Compare commits

..

1 commit

Author SHA1 Message Date
1279437ed5 include foodsoft-article-import
use filetypes for manual uploading bnn, odin, foodsoft file

use opts in .parse

adapt specs to include file format

add specs for odin, bnn, foodsoft files

adapt localize input to remove ',' separator and replace with '.'

remove depr foodsoftfile.rb and spreadsheet.rb

remove todo
2023-02-22 14:44:23 +01:00
16 changed files with 17 additions and 38 deletions

View file

@ -1,4 +1,4 @@
FROM ruby:2.7
FROM ruby:2.6
RUN supercronicUrl=https://github.com/aptible/supercronic/releases/download/v0.1.3/supercronic-linux-amd64 && \
supercronicBin=/usr/local/bin/supercronic && \
@ -15,16 +15,13 @@ ENV PORT=3000 \
WORKDIR /usr/src/app
COPY Gemfile Gemfile.lock ./
COPY plugins/ ./plugins
COPY config/ ./config
COPY . ./
# install dependencies and generate crontab
RUN buildDeps='libmagic-dev' && \
apt-get update && \
apt-get install --no-install-recommends -y $buildDeps && \
echo 'gem: --no-document' >> ~/.gemrc && \
gem install bundler && \
bundle config build.nokogiri "--use-system-libraries" && \
bundle install --deployment --without development test -j 4 && \
apt-get purge -y --auto-remove $buildDeps && \
@ -32,8 +29,6 @@ RUN buildDeps='libmagic-dev' && \
\
bundle exec whenever >crontab
COPY . ./
# compile assets with temporary mysql server
RUN export DATABASE_URL=mysql2://localhost/temp?encoding=utf8 && \
export SECRET_KEY_BASE=thisisnotimportantnow && \

View file

@ -7,6 +7,7 @@ gem 'mail', '~> 2.7.1' # bug with mail 2.8.0 https://github.com/mikel/mail/issue
gem 'sassc-rails'
gem 'less-rails'
gem 'uglifier'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
gem 'therubyracer', platforms: :ruby
@ -126,7 +127,3 @@ group :test do
gem 'rswag-specs'
gem 'hashie', '~> 3.4.6', require: false # https://github.com/westfieldlabs/apivore/issues/114
end
gem "importmap-rails", "~> 1.1"
gem "terser", "~> 1.1"

View file

@ -264,9 +264,6 @@ GEM
i18n-spec (0.6.0)
iso
ice_cube (0.16.4)
importmap-rails (1.1.5)
actionpack (>= 6.0.0)
railties (>= 6.0.0)
inherited_resources (1.13.1)
actionpack (>= 5.2, < 7.1)
has_scope (~> 0.6)
@ -556,8 +553,6 @@ GEM
sqlite3 (>= 1.3.3)
table_print (1.5.7)
temple (0.9.1)
terser (1.1.13)
execjs (>= 0.3.0, < 3)
therubyracer (0.12.3)
libv8 (~> 3.16.14.15)
ref
@ -578,6 +573,8 @@ GEM
unf (~> 0.1.0)
tzinfo (2.0.5)
concurrent-ruby (~> 1.0)
uglifier (4.2.0)
execjs (>= 0.3.0, < 3)
unf (0.1.4)
unf_ext
unf_ext (0.0.8.2)
@ -641,7 +638,6 @@ DEPENDENCIES
i18n-js (~> 3.0.0.rc8)
i18n-spec
ice_cube
importmap-rails (~> 1.1)
inherited_resources
jquery-rails
kaminari
@ -693,11 +689,11 @@ DEPENDENCIES
sprockets (< 4)
sqlite3 (~> 1.3.6)
table_print
terser (~> 1.1)
therubyracer
twitter-bootstrap-rails (~> 2.2.8)
uglifier
web-console
whenever
BUNDLED WITH
2.4.5
2.4.2

View file

@ -18,7 +18,7 @@ class Finance::FinancialTransactionsController < ApplicationController
sort = "created_on DESC"
end
@q = FinancialTransaction.ransack(params[:q])
@q = FinancialTransaction.search(params[:q])
@financial_transactions_all = @q.result(distinct: true).includes(:user).order(sort)
@financial_transactions_all = @financial_transactions_all.visible unless params[:show_hidden]
@financial_transactions_all = @financial_transactions_all.where(ordergroup_id: @ordergroup.id) if @ordergroup

View file

@ -1 +0,0 @@
// Configure your import map in config/importmap.rb. Read more: https://github.com/rails/importmap-rails

View file

@ -32,8 +32,8 @@ class GroupOrder < ApplicationRecord
# Generate some data for the javascript methods in ordering view
def load_data
data = {}
data[:account_balance] = ordergroup.nil? ? BigDecimal('+Infinity') : ordergroup.account_balance
data[:available_funds] = ordergroup.nil? ? BigDecimal('+Infinity') : ordergroup.get_available_funds(self)
data[:account_balance] = ordergroup.nil? ? BigDecimal.new('+Infinity') : ordergroup.account_balance
data[:available_funds] = ordergroup.nil? ? BigDecimal.new('+Infinity') : ordergroup.get_available_funds(self)
# load prices and other stuff....
data[:order_articles] = {}

View file

@ -8,10 +8,10 @@
= csrf_meta_tags
= stylesheet_link_tag "application", :media => "all"
//%link(href="images/favicon.ico" rel="shortcut icon")
= yield(:head)
= foodcoop_css_tag
%body
= yield
@ -19,9 +19,7 @@
Javascripts
\==================================================
/ Placed at the end of the document so the pages load faster
= javascript_importmap_tags
= javascript_include_tag "application_legacy"
= javascript_include_tag "application"
:javascript
I18n.defaultLocale = "#{I18n.default_locale}";
I18n.locale = "#{I18n.locale}";

View file

@ -1,4 +0,0 @@
#!/usr/bin/env ruby
require_relative "../config/application"
require "importmap/commands"

View file

@ -29,7 +29,7 @@ Rails.application.configure do
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
# Compress JavaScripts and CSS.
config.assets.js_compressor = :terser
config.assets.js_compressor = :uglifier
config.assets.css_compressor = :sass
# Do not fallback to assets pipeline if a precompiled asset is missed.

View file

@ -1,2 +0,0 @@
# Pin npm packages by running ./bin/importmap
pin "application", preload: true

View file

@ -9,4 +9,4 @@ Rails.application.config.assets.version = '1.0'
# Precompile additional assets.
# application.js, application.css, and all non-JS/CSS in the app/assets
# folder are already added.
Rails.application.config.assets.precompile += %w( application_legacy.js jquery.min.js )
# Rails.application.config.assets.precompile += %w( admin.js admin.css )

View file

@ -3,7 +3,7 @@ class String
# remove comma from decimal inputs
def self.delocalized_decimal(string)
if !string.blank? and string.is_a?(String)
BigDecimal(string.sub(',', '.'))
BigDecimal.new(string.sub(',', '.'))
else
string
end

View file

@ -11,7 +11,7 @@ services:
build:
context: .
dockerfile: Dockerfile-dev
platform: linux/x86_64
platform: linux/x86_64
command: ./proc-start worker
volumes:
- bundle:/usr/local/bundle

View file

@ -32,7 +32,7 @@ class CurrentOrders::ArticlesController < ApplicationController
else
@order_articles = OrderArticle.where(order_id: @current_orders.all.map(&:id))
end
@q = OrderArticle.ransack(params[:q])
@q = OrderArticle.search(params[:q])
@order_articles = @order_articles.ordered.merge(@q.result).includes(:article, :article_price)
@order_article = @order_articles.where(id: params[:id]).first
end

View file