Skip to content

Commit

Permalink
Article Versions squash
Browse files Browse the repository at this point in the history
  • Loading branch information
lentschi committed Jan 12, 2024
1 parent 16eb988 commit bae450a
Show file tree
Hide file tree
Showing 202 changed files with 47,271 additions and 1,440 deletions.
14 changes: 14 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = {
"env": {
"browser": true,
"jquery": true,
"es6": true
},
"extends": "eslint:recommended",
"parserOptions": {
"ecmaVersion": 6
},
"rules": {
"no-unused-vars": ["error", { "vars": "local" }]
}
}
2 changes: 1 addition & 1 deletion .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,7 @@ Rails/HasManyOrHasOneDependent:
Exclude:
- 'app/models/article.rb'
- 'app/models/article_category.rb'
- 'app/models/article_price.rb'
- 'app/models/article_version.rb'
- 'app/models/financial_link.rb'
- 'app/models/financial_transaction.rb'
- 'app/models/group_order.rb'
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile-dev
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM ruby:2.6

# Install dependencies
RUN deps='libmagic-dev chromium' && \
RUN deps='libmagic-dev chromium nodejs' && \
apt-get update && \
apt-get install --no-install-recommends -y $deps && \
rm -Rf /var/lib/apt/lists/* /var/cache/apt/*
Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ group :development do
gem 'mailcatcher'
gem 'web-console'
gem 'listen'
gem 'byebug'

# Better error output
gem 'better_errors'
Expand Down
2 changes: 2 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ GEM
bullet (7.0.1)
activesupport (>= 3.0.0)
uniform_notifier (~> 1.11)
byebug (11.1.3)
capybara (3.36.0)
addressable
matrix
Expand Down Expand Up @@ -577,6 +578,7 @@ DEPENDENCIES
bootsnap
bootstrap-datepicker-rails
bullet
byebug
capybara
connection_pool
daemons
Expand Down
12 changes: 12 additions & 0 deletions HACKATHON_TODOS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# TODO-no-upstream - whole file
- Replace all remaining occurrences of `.unit_quantity`
- Receive orders page:
* Determine +/- button functionality for very small or non-existant pack sizes
* BE validation of order amount
* Investigate total_balance hidden field meaning (old issue)
* Formatting: Alignment breaks with numbers that have more than one digit (old issue; but renewed importance due to floats)
* Article (version) Field translations of new / moved fields

# POST-merge:

* Close https://github.com/foodcoops/foodsoft/issues/396
3 changes: 2 additions & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
web: bundle exec rails server --binding=0.0.0.0 --port=$PORT
# TODO-no-upstream:
web: bundle exec rails server --binding=0.0.0.0 --port=$PORT; tail -f log/development.log
worker: QUEUE=* bundle exec rake resque:work
mail: bundle exec rake foodsoft:reply_email_smtp_server
cron: supercronic crontab
22 changes: 21 additions & 1 deletion app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,30 @@
//= require i18n
//= require i18n/translations
//= require_self
//= require ordering
//= require units-converter
//= require article-form
//= require unit-conversion-field
//= require group-order-form
//= require receive-order-form
//= require stupidtable
//= require touchclick
//= require delta_input
//= require recurring_select

$.fn.select2.defaults.set('theme', 'bootstrap');

// on first focus (bubbles up to document), open the menu
$(document).on('focus', '.select2-selection.select2-selection--single', function () {
$(this).closest(".select2-container").siblings('select:enabled').select2('open');
});

// steal focus during close - only capture once and stop propogation
$('select.select2').on('select2:closing', function (e) {
$(e.target).data("select2").$selection.one('focus focusin', function (e) {
e.stopPropagation();
});
});

// Load following statements, when DOM is ready
$(function() {

Expand Down Expand Up @@ -121,6 +137,10 @@ $(function() {
// Handle ajax errors
// render json: {error: "can't except this!"}, status: :unprocessable_entity
$(document).ajaxError(function(ev, xhr, settings, exception) {
if (xhr.statusText === 'abort') {
return;
}

try {
msg = xhr.responseJSON.error;
} catch(err) {
Expand Down
Loading

0 comments on commit bae450a

Please sign in to comment.