mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-21 20:06:54 +00:00
Compare commits
134 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
92dcf926b5 | ||
|
|
1fcc98af80 | ||
|
|
67dbf552b1 | ||
|
|
899879b88d | ||
|
|
9a57935709 | ||
|
|
5de928f452 | ||
|
|
524d68496a | ||
|
|
b117608229 | ||
|
|
1ccd580c7b | ||
|
|
bff38b2c5b | ||
|
|
eb911d9fe3 | ||
|
|
9fa46d378f | ||
|
|
3c4845813d | ||
|
|
7166fa6a25 | ||
|
|
9d36d1942e | ||
|
|
9dc3f2d69e | ||
|
|
7b07817bbf | ||
|
|
a36627927d | ||
|
|
cc80949d56 | ||
|
|
5c8bbb3a38 | ||
|
|
e8669f0178 | ||
|
|
ef31e1d063 | ||
|
|
4ef5609b0e | ||
|
|
4e70a86fa9 | ||
|
|
44f52c21db | ||
|
|
e8b8a8961e | ||
|
|
9a849bb2ee | ||
|
|
9c8525b797 | ||
|
|
a9edc0cb9c | ||
|
|
7556eee5d4 | ||
|
|
44760ce8b6 | ||
|
|
25ab334d73 | ||
|
|
85dc32ffcb | ||
|
|
763d922510 | ||
|
|
a8bb05c575 | ||
|
|
0ce1ccf2d6 | ||
|
|
e288c7a551 | ||
|
|
dc030182db | ||
|
|
ddd0b939fe | ||
|
|
a4b6c05d58 | ||
|
|
b3d0c0f2d5 | ||
|
|
3afd8b7189 | ||
|
|
7d51bd7b83 | ||
|
|
974842300c | ||
|
|
9474b574ad | ||
|
|
3a490a1f26 | ||
|
|
fce3c46e55 | ||
|
|
a95bef141f | ||
|
|
f25fb19fe8 | ||
|
|
25ed405da7 | ||
|
|
00176b2b95 | ||
|
|
8f25718e62 | ||
|
|
98b9395c31 | ||
|
|
540c673924 | ||
|
|
4149c14e8d | ||
|
|
af43fe9a5b | ||
|
|
2a3c4d6649 | ||
|
|
c954187322 | ||
|
|
dbb7155114 | ||
|
|
27b396cbc2 | ||
|
|
1abc406156 | ||
|
|
5cab0f7f3d | ||
|
|
56ce4ab04f | ||
|
|
d351bf9a9a | ||
|
|
b447e4052c | ||
|
|
29196375f5 | ||
|
|
23570be6a1 | ||
|
|
6652b7fe5c | ||
|
|
6cb17905cd | ||
|
|
6aa449aacb | ||
|
|
c2f82202a6 | ||
|
|
6c219b31a3 | ||
|
|
b889f31c1a | ||
|
|
83c7764456 | ||
|
|
23c3573b8f | ||
|
|
7c8a3bd7c9 | ||
|
|
b66d263bc6 | ||
|
|
9afa75d91c | ||
|
|
d15708d4e3 | ||
|
|
dafbefe8e3 | ||
|
|
9d33402d9e | ||
|
|
abf8d44935 | ||
|
|
fb15b19e88 | ||
|
|
e5c6ff433c | ||
|
|
bb35629960 | ||
|
|
c4e75dc557 | ||
|
|
10d1d2066e | ||
|
|
3c53214daa | ||
|
|
40a9c36c85 | ||
|
|
48ecbaaa16 | ||
|
|
ef7684e079 | ||
|
|
04c3b8b9cf | ||
|
|
fd3a54a904 | ||
|
|
236abe485a | ||
|
|
8fb11b9151 | ||
|
|
b9471d4f01 | ||
|
|
b5da120805 | ||
|
|
da5976d85d | ||
|
|
9e1047288f | ||
|
|
ff9985dd88 | ||
|
|
e62eca93c1 | ||
|
|
8d532ae262 | ||
|
|
d2f28e2095 | ||
|
|
dbd5186dfa | ||
|
|
61cb7c4402 | ||
|
|
ccfb83d2cd | ||
|
|
d6aa0168b2 | ||
|
|
2a8ef5a45e | ||
|
|
c423641102 | ||
|
|
22559a755f | ||
|
|
e877f94e07 | ||
|
|
820fff0528 | ||
|
|
09bcc772ff | ||
|
|
49e376f9b6 | ||
|
|
85d3f5f9d7 | ||
|
|
9dd81604e9 | ||
|
|
61d3f79444 | ||
|
|
204295dc91 | ||
|
|
4ed71f1883 | ||
|
|
92585b65c5 | ||
|
|
099f75befb | ||
|
|
2eaf79b149 | ||
|
|
60f0a58508 | ||
|
|
688020a304 | ||
|
|
4b1bd362e0 | ||
|
|
4b3465de78 | ||
|
|
b358468952 | ||
|
|
c1c0a72184 | ||
|
|
4f265eed2a | ||
|
|
bdf132a833 | ||
|
|
262b546836 | ||
|
|
4bfd39caec | ||
|
|
58c8eae08c | ||
|
|
cb1b24695e |
334
.github/workflows/build.yml
vendored
334
.github/workflows/build.yml
vendored
@@ -8,7 +8,7 @@ on:
|
||||
pull_request:
|
||||
|
||||
env:
|
||||
DISABLE_KNAPSACK: true
|
||||
DISABLE_KNAPSACK_PRO: false
|
||||
TIMEZONE: UTC
|
||||
COVERAGE: true
|
||||
RAILS_ENV: test
|
||||
@@ -17,7 +17,7 @@ permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
rspec:
|
||||
knapsack_rspec_controllers:
|
||||
runs-on: ubuntu-20.04
|
||||
services:
|
||||
postgres:
|
||||
@@ -33,19 +33,15 @@ jobs:
|
||||
POSTGRES_USER: ofn
|
||||
POSTGRES_PASSWORD: f00d
|
||||
strategy:
|
||||
matrix:
|
||||
specs:
|
||||
- "spec/controllers"
|
||||
- "spec/models"
|
||||
- "spec/lib"
|
||||
- "spec/migrations"
|
||||
- "spec/serializers"
|
||||
- "spec/system/admin/[a-o0-9]*"
|
||||
- "spec/system/admin/[p-z]*"
|
||||
- "spec/system/consumer/[a-o0-9]*"
|
||||
- "spec/system/consumer/[p-z]*"
|
||||
- "engines/*/spec"
|
||||
fail-fast: false
|
||||
matrix:
|
||||
# [n] - where the n is a number of parallel jobs you want to run your tests on.
|
||||
# Use a higher number if you have slow tests to split them between more parallel jobs.
|
||||
# Remember to update the value of the `ci_node_index` below to (0..n-1).
|
||||
ci_node_total: [8]
|
||||
# Indexes for parallel jobs (starting from zero).
|
||||
# E.g. use [0, 1] for 2 parallel jobs, [0, 1, 2] for 3 parallel jobs, etc.
|
||||
ci_node_index: [0, 1, 2, 3, 4, 5, 6, 7]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
@@ -72,7 +68,161 @@ jobs:
|
||||
bundle exec rake db:schema:load
|
||||
|
||||
- name: Run tests
|
||||
run: bundle exec rspec --profile -- ${{ matrix.specs }}
|
||||
|
||||
env:
|
||||
KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC: 864ef557d85ea8e603e086c0387d5154
|
||||
KNAPSACK_PRO_CI_NODE_TOTAL: ${{ matrix.ci_node_total }}
|
||||
KNAPSACK_PRO_CI_NODE_INDEX: ${{ matrix.ci_node_index }}
|
||||
KNAPSACK_PRO_LOG_LEVEL: info
|
||||
# if you use Knapsack Pro Queue Mode you must set below env variable
|
||||
# to be able to retry CI build and run previously recorded tests
|
||||
# https://github.com/KnapsackPro/knapsack_pro-ruby#knapsack_pro_fixed_queue_split-remember-queue-split-on-retry-ci-node
|
||||
# KNAPSACK_PRO_FIXED_QUEUE_SPLIT: false
|
||||
# RSpec split test files by test examples feature - it's optional
|
||||
# https://knapsackpro.com/faq/question/how-to-split-slow-rspec-test-files-by-test-examples-by-individual-it
|
||||
#KNAPSACK_PRO_RSPEC_SPLIT_BY_TEST_EXAMPLES: true
|
||||
KNAPSACK_PRO_TEST_FILE_PATTERN: "{spec/controllers/**{,/*/**}/*_spec.rb}"
|
||||
|
||||
run: |
|
||||
bundle exec rake knapsack_pro:rspec
|
||||
|
||||
knapsack_rspec_models:
|
||||
runs-on: ubuntu-20.04
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:10
|
||||
ports: ["5432:5432"]
|
||||
options: >-
|
||||
--health-cmd pg_isready
|
||||
--health-interval 10s
|
||||
--health-timeout 5s
|
||||
--health-retries 5
|
||||
env:
|
||||
POSTGRES_DB: open_food_network_test
|
||||
POSTGRES_USER: ofn
|
||||
POSTGRES_PASSWORD: f00d
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
# [n] - where the n is a number of parallel jobs you want to run your tests on.
|
||||
# Use a higher number if you have slow tests to split them between more parallel jobs.
|
||||
# Remember to update the value of the `ci_node_index` below to (0..n-1).
|
||||
ci_node_total: [7]
|
||||
# Indexes for parallel jobs (starting from zero).
|
||||
# E.g. use [0, 1] for 2 parallel jobs, [0, 1, 2] for 3 parallel jobs, etc.
|
||||
ci_node_index: [0, 1, 2, 3, 4, 5, 6]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Setup redis
|
||||
uses: supercharge/redis-github-action@1.4.0
|
||||
with:
|
||||
redis-version: 6
|
||||
|
||||
- name: Set up Ruby
|
||||
uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
||||
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16
|
||||
|
||||
- name: Install JS dependencies
|
||||
run: yarn install --frozen-lockfile
|
||||
|
||||
- name: Set up database
|
||||
run: |
|
||||
bundle exec rake db:create
|
||||
bundle exec rake db:schema:load
|
||||
|
||||
- name: Run tests
|
||||
|
||||
env:
|
||||
KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC: 09476e2ce491c12083df62768667c674
|
||||
KNAPSACK_PRO_CI_NODE_TOTAL: ${{ matrix.ci_node_total }}
|
||||
KNAPSACK_PRO_CI_NODE_INDEX: ${{ matrix.ci_node_index }}
|
||||
KNAPSACK_PRO_LOG_LEVEL: info
|
||||
# if you use Knapsack Pro Queue Mode you must set below env variable
|
||||
# to be able to retry CI build and run previously recorded tests
|
||||
# https://github.com/KnapsackPro/knapsack_pro-ruby#knapsack_pro_fixed_queue_split-remember-queue-split-on-retry-ci-node
|
||||
# KNAPSACK_PRO_FIXED_QUEUE_SPLIT: false
|
||||
# RSpec split test files by test examples feature - it's optional
|
||||
# https://knapsackpro.com/faq/question/how-to-split-slow-rspec-test-files-by-test-examples-by-individual-it
|
||||
#KNAPSACK_PRO_RSPEC_SPLIT_BY_TEST_EXAMPLES: true
|
||||
KNAPSACK_PRO_TEST_FILE_PATTERN: "{spec/models/**{,/*/**}/*_spec.rb}"
|
||||
|
||||
run: |
|
||||
bundle exec rake knapsack_pro:rspec
|
||||
|
||||
knapsack_rspec_system:
|
||||
runs-on: ubuntu-20.04
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:10
|
||||
ports: ["5432:5432"]
|
||||
options: >-
|
||||
--health-cmd pg_isready
|
||||
--health-interval 10s
|
||||
--health-timeout 5s
|
||||
--health-retries 5
|
||||
env:
|
||||
POSTGRES_DB: open_food_network_test
|
||||
POSTGRES_USER: ofn
|
||||
POSTGRES_PASSWORD: f00d
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
# [n] - where the n is a number of parallel jobs you want to run your tests on.
|
||||
# Use a higher number if you have slow tests to split them between more parallel jobs.
|
||||
# Remember to update the value of the `ci_node_index` below to (0..n-1).
|
||||
ci_node_total: [10]
|
||||
# Indexes for parallel jobs (starting from zero).
|
||||
# E.g. use [0, 1] for 2 parallel jobs, [0, 1, 2] for 3 parallel jobs, etc.
|
||||
ci_node_index: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Setup redis
|
||||
uses: supercharge/redis-github-action@1.4.0
|
||||
with:
|
||||
redis-version: 6
|
||||
|
||||
- name: Set up Ruby
|
||||
uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
||||
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16
|
||||
|
||||
- name: Install JS dependencies
|
||||
run: yarn install --frozen-lockfile
|
||||
|
||||
- name: Set up database
|
||||
run: |
|
||||
bundle exec rake db:create
|
||||
bundle exec rake db:schema:load
|
||||
|
||||
- name: Run tests
|
||||
|
||||
env:
|
||||
KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC: ff2456e64c9f2aa5157eb0daf711d3c3
|
||||
KNAPSACK_PRO_CI_NODE_TOTAL: ${{ matrix.ci_node_total }}
|
||||
KNAPSACK_PRO_CI_NODE_INDEX: ${{ matrix.ci_node_index }}
|
||||
KNAPSACK_PRO_LOG_LEVEL: info
|
||||
# if you use Knapsack Pro Queue Mode you must set below env variable
|
||||
# to be able to retry CI build and run previously recorded tests
|
||||
# https://github.com/KnapsackPro/knapsack_pro-ruby#knapsack_pro_fixed_queue_split-remember-queue-split-on-retry-ci-node
|
||||
KNAPSACK_PRO_FIXED_QUEUE_SPLIT: true
|
||||
# RSpec split test files by test examples feature - it's optional
|
||||
# https://knapsackpro.com/faq/question/how-to-split-slow-rspec-test-files-by-test-examples-by-individual-it
|
||||
#KNAPSACK_PRO_RSPEC_SPLIT_BY_TEST_EXAMPLES: true
|
||||
KNAPSACK_PRO_TEST_FILE_PATTERN: "{spec/system/**{,/*/**}/*_spec.rb}"
|
||||
|
||||
run: |
|
||||
bundle exec rake knapsack_pro:queue:rspec
|
||||
|
||||
- name: Archive failed tests screenshots
|
||||
if: failure()
|
||||
@@ -83,7 +233,155 @@ jobs:
|
||||
retention-days: 7
|
||||
if-no-files-found: ignore
|
||||
|
||||
test-the-rest:
|
||||
knapsack_rspec_engines:
|
||||
runs-on: ubuntu-20.04
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:10
|
||||
ports: ["5432:5432"]
|
||||
options: >-
|
||||
--health-cmd pg_isready
|
||||
--health-interval 10s
|
||||
--health-timeout 5s
|
||||
--health-retries 5
|
||||
env:
|
||||
POSTGRES_DB: open_food_network_test
|
||||
POSTGRES_USER: ofn
|
||||
POSTGRES_PASSWORD: f00d
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
# [n] - where the n is a number of parallel jobs you want to run your tests on.
|
||||
# Use a higher number if you have slow tests to split them between more parallel jobs.
|
||||
# Remember to update the value of the `ci_node_index` below to (0..n-1).
|
||||
ci_node_total: [5]
|
||||
# Indexes for parallel jobs (starting from zero).
|
||||
# E.g. use [0, 1] for 2 parallel jobs, [0, 1, 2] for 3 parallel jobs, etc.
|
||||
ci_node_index: [0, 1, 2, 3, 4]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Setup redis
|
||||
uses: supercharge/redis-github-action@1.4.0
|
||||
with:
|
||||
redis-version: 6
|
||||
|
||||
- name: Set up Ruby
|
||||
uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
||||
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16
|
||||
|
||||
- name: Install JS dependencies
|
||||
run: yarn install --frozen-lockfile
|
||||
|
||||
- name: Set up database
|
||||
run: |
|
||||
bundle exec rake db:create
|
||||
bundle exec rake db:schema:load
|
||||
|
||||
- name: Run tests
|
||||
|
||||
env:
|
||||
KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC: d6ea7ceb766404ccd016c19aa2c81b1c
|
||||
KNAPSACK_PRO_CI_NODE_TOTAL: ${{ matrix.ci_node_total }}
|
||||
KNAPSACK_PRO_CI_NODE_INDEX: ${{ matrix.ci_node_index }}
|
||||
KNAPSACK_PRO_LOG_LEVEL: info
|
||||
# if you use Knapsack Pro Queue Mode you must set below env variable
|
||||
# to be able to retry CI build and run previously recorded tests
|
||||
# https://github.com/KnapsackPro/knapsack_pro-ruby#knapsack_pro_fixed_queue_split-remember-queue-split-on-retry-ci-node
|
||||
# KNAPSACK_PRO_FIXED_QUEUE_SPLIT: false
|
||||
# RSpec split test files by test examples feature - it's optional
|
||||
# https://knapsackpro.com/faq/question/how-to-split-slow-rspec-test-files-by-test-examples-by-individual-it
|
||||
#KNAPSACK_PRO_RSPEC_SPLIT_BY_TEST_EXAMPLES: true
|
||||
KNAPSACK_PRO_TEST_FILE_PATTERN: "{spec/lib/**{,/*/**}/*_spec.rb,spec/migrations/**{,/*/**}/*_spec.rb,spec/serializers/**{,/*/**}/*_spec.rb,engines/**{,/*/**}/*_spec.rb}"
|
||||
|
||||
run: |
|
||||
bundle exec rake knapsack_pro:rspec
|
||||
|
||||
- name: Archive failed tests screenshots
|
||||
if: failure()
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: failed-tests-screenshots
|
||||
path: tmp/capybara/screenshots/*.png
|
||||
retention-days: 7
|
||||
if-no-files-found: ignore
|
||||
|
||||
knapsack_rspec_test_the_rest:
|
||||
runs-on: ubuntu-20.04
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:10
|
||||
ports: ["5432:5432"]
|
||||
options: >-
|
||||
--health-cmd pg_isready
|
||||
--health-interval 10s
|
||||
--health-timeout 5s
|
||||
--health-retries 5
|
||||
env:
|
||||
POSTGRES_DB: open_food_network_test
|
||||
POSTGRES_USER: ofn
|
||||
POSTGRES_PASSWORD: f00d
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
# [n] - where the n is a number of parallel jobs you want to run your tests on.
|
||||
# Use a higher number if you have slow tests to split them between more parallel jobs.
|
||||
# Remember to update the value of the `ci_node_index` below to (0..n-1).
|
||||
ci_node_total: [5]
|
||||
# Indexes for parallel jobs (starting from zero).
|
||||
# E.g. use [0, 1] for 2 parallel jobs, [0, 1, 2] for 3 parallel jobs, etc.
|
||||
ci_node_index: [0, 1, 2, 3, 4]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Setup redis
|
||||
uses: supercharge/redis-github-action@1.4.0
|
||||
with:
|
||||
redis-version: 6
|
||||
|
||||
- name: Set up Ruby
|
||||
uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
||||
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16
|
||||
|
||||
- name: Install JS dependencies
|
||||
run: yarn install --frozen-lockfile
|
||||
|
||||
- name: Set up database
|
||||
run: |
|
||||
bundle exec rake db:create
|
||||
bundle exec rake db:schema:load
|
||||
|
||||
- name: Run tests
|
||||
|
||||
env:
|
||||
KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC: e3b8800198d2d89b70c7edbdd85f8fd8
|
||||
KNAPSACK_PRO_CI_NODE_TOTAL: ${{ matrix.ci_node_total }}
|
||||
KNAPSACK_PRO_CI_NODE_INDEX: ${{ matrix.ci_node_index }}
|
||||
KNAPSACK_PRO_LOG_LEVEL: info
|
||||
# if you use Knapsack Pro Queue Mode you must set below env variable
|
||||
# to be able to retry CI build and run previously recorded tests
|
||||
# https://github.com/KnapsackPro/knapsack_pro-ruby#knapsack_pro_fixed_queue_split-remember-queue-split-on-retry-ci-node
|
||||
# KNAPSACK_PRO_FIXED_QUEUE_SPLIT: false
|
||||
# RSpec split test files by test examples feature - it's optional
|
||||
# https://knapsackpro.com/faq/question/how-to-split-slow-rspec-test-files-by-test-examples-by-individual-it
|
||||
#KNAPSACK_PRO_RSPEC_SPLIT_BY_TEST_EXAMPLES: true
|
||||
KNAPSACK_PRO_TEST_FILE_EXCLUDE_PATTERN: "{engines/**{,/*/**}/*_spec.rb,spec/models/**{,/*/**}/*_spec.rb,spec/controllers/**{,/*/**}/*_spec.rb,spec/serializers/**{,/*/**}/*_spec.rb,spec/lib/**{,/*/**}/*_spec.rb,spec/migrations/**{,/*/**}/*_spec.rb,spec/system/**{,/*/**}/*_spec.rb}"
|
||||
|
||||
|
||||
run: |
|
||||
bundle exec rake knapsack_pro:rspec
|
||||
|
||||
non_knapsack_jest_karma:
|
||||
runs-on: ubuntu-20.04
|
||||
services:
|
||||
postgres:
|
||||
@@ -122,12 +420,8 @@ jobs:
|
||||
run: |
|
||||
bundle exec rake db:create
|
||||
bundle exec rake db:schema:load
|
||||
|
||||
- name: Run JS tests
|
||||
run: bundle exec rake karma:run
|
||||
|
||||
- name: Run jest tests
|
||||
run: yarn jest
|
||||
|
||||
- name: Run all other tests
|
||||
run: bundle exec rspec --exclude-pattern "./models/**/*_spec.rb, ./controllers/**/*_spec.rb, ./serializers/**/*_spec.rb, ./lib/**/*_spec.rb, ./migrations/**/*_spec.rb, ./system/**/*_spec.rb"
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
# Basically, ignore everythings expect app/webpacker/controllers/*.js and app/webpacker/packs/*.js
|
||||
*.css
|
||||
*.scss
|
||||
# Except v2
|
||||
!/app/webpacker/css/admin/v2/**/*.scss
|
||||
*.md
|
||||
*.yml
|
||||
*.yaml
|
||||
|
||||
4
Gemfile
4
Gemfile
@@ -136,6 +136,8 @@ gem 'flipper-ui'
|
||||
|
||||
gem "view_component"
|
||||
|
||||
gem 'mini_portile2', '~> 2.8'
|
||||
|
||||
group :production, :staging do
|
||||
gem 'ddtrace'
|
||||
gem 'rack-timeout'
|
||||
@@ -150,7 +152,7 @@ group :test, :development do
|
||||
gem "factory_bot_rails", '6.2.0', require: false
|
||||
gem 'fuubar', '~> 2.5.1'
|
||||
gem 'json_spec', '~> 1.1.4'
|
||||
gem 'knapsack', require: false
|
||||
gem 'knapsack_pro'
|
||||
gem 'letter_opener', '>= 1.4.1'
|
||||
gem 'rspec-rails', ">= 3.5.2"
|
||||
gem 'rspec-retry', require: false
|
||||
|
||||
37
Gemfile.lock
37
Gemfile.lock
@@ -158,16 +158,16 @@ GEM
|
||||
awesome_nested_set (3.5.0)
|
||||
activerecord (>= 4.0.0, < 7.1)
|
||||
aws-eventstream (1.2.0)
|
||||
aws-partitions (1.651.0)
|
||||
aws-sdk-core (3.166.0)
|
||||
aws-partitions (1.669.0)
|
||||
aws-sdk-core (3.168.2)
|
||||
aws-eventstream (~> 1, >= 1.0.2)
|
||||
aws-partitions (~> 1, >= 1.651.0)
|
||||
aws-sigv4 (~> 1.5)
|
||||
jmespath (~> 1, >= 1.6.1)
|
||||
aws-sdk-kms (1.59.0)
|
||||
aws-sdk-kms (1.60.0)
|
||||
aws-sdk-core (~> 3, >= 3.165.0)
|
||||
aws-sigv4 (~> 1.1)
|
||||
aws-sdk-s3 (1.117.1)
|
||||
aws-sdk-s3 (1.117.2)
|
||||
aws-sdk-core (~> 3, >= 3.165.0)
|
||||
aws-sdk-kms (~> 1)
|
||||
aws-sigv4 (~> 1.4)
|
||||
@@ -177,12 +177,12 @@ GEM
|
||||
bigdecimal (3.0.2)
|
||||
bindata (2.4.12)
|
||||
bindex (0.8.1)
|
||||
bootsnap (1.13.0)
|
||||
bootsnap (1.15.0)
|
||||
msgpack (~> 1.2)
|
||||
bugsnag (6.24.2)
|
||||
concurrent-ruby (~> 1.0)
|
||||
builder (3.2.4)
|
||||
bullet (7.0.3)
|
||||
bullet (7.0.4)
|
||||
activesupport (>= 3.0.0)
|
||||
uniform_notifier (~> 1.11)
|
||||
cable_ready (5.0.0.pre9)
|
||||
@@ -353,7 +353,7 @@ GEM
|
||||
ipaddress (0.8.3)
|
||||
irb (1.4.2)
|
||||
reline (>= 0.3.0)
|
||||
jmespath (1.6.1)
|
||||
jmespath (1.6.2)
|
||||
jquery-rails (4.4.0)
|
||||
rails-dom-testing (>= 1, < 3)
|
||||
railties (>= 4.2.0)
|
||||
@@ -375,7 +375,7 @@ GEM
|
||||
jsonapi-serializer (2.2.0)
|
||||
activesupport (>= 4.2)
|
||||
jwt (2.5.0)
|
||||
knapsack (4.0.0)
|
||||
knapsack_pro (3.4.2)
|
||||
rake
|
||||
launchy (2.5.0)
|
||||
addressable (~> 2.7)
|
||||
@@ -409,7 +409,7 @@ GEM
|
||||
money (~> 6.12)
|
||||
money (6.16.0)
|
||||
i18n (>= 0.6.4, <= 2)
|
||||
msgpack (1.5.4)
|
||||
msgpack (1.6.0)
|
||||
multi_json (1.15.0)
|
||||
multi_xml (0.6.0)
|
||||
net-protocol (0.1.3)
|
||||
@@ -545,7 +545,7 @@ GEM
|
||||
ffi (~> 1.0)
|
||||
redcarpet (3.5.1)
|
||||
redis (4.8.0)
|
||||
regexp_parser (2.6.0)
|
||||
regexp_parser (2.6.1)
|
||||
reline (0.3.1)
|
||||
io-console (~> 0.5)
|
||||
request_store (1.5.0)
|
||||
@@ -589,14 +589,14 @@ GEM
|
||||
rspec-retry (0.6.2)
|
||||
rspec-core (> 3.3)
|
||||
rspec-support (3.10.3)
|
||||
rswag-api (2.7.0)
|
||||
rswag-api (2.8.0)
|
||||
railties (>= 3.1, < 7.1)
|
||||
rswag-specs (2.8.0)
|
||||
activesupport (>= 3.1, < 7.1)
|
||||
json-schema (>= 2.2, < 4.0)
|
||||
railties (>= 3.1, < 7.1)
|
||||
rspec-core (>= 2.14)
|
||||
rswag-ui (2.7.0)
|
||||
rswag-ui (2.8.0)
|
||||
actionpack (>= 3.1, < 7.1)
|
||||
railties (>= 3.1, < 7.1)
|
||||
rubocop (1.39.0)
|
||||
@@ -611,7 +611,7 @@ GEM
|
||||
unicode-display_width (>= 1.4.0, < 3.0)
|
||||
rubocop-ast (1.23.0)
|
||||
parser (>= 3.1.1.0)
|
||||
rubocop-rails (2.17.2)
|
||||
rubocop-rails (2.17.3)
|
||||
activesupport (>= 4.2.0)
|
||||
rack (>= 1.1)
|
||||
rubocop (>= 1.33.0, < 2.0)
|
||||
@@ -682,7 +682,7 @@ GEM
|
||||
railties (>= 5.2)
|
||||
redis
|
||||
stringex (2.8.5)
|
||||
stripe (7.1.0)
|
||||
stripe (8.0.0)
|
||||
swd (1.3.0)
|
||||
activesupport (>= 3)
|
||||
attr_required (>= 0.0.5)
|
||||
@@ -694,7 +694,7 @@ GEM
|
||||
thor (1.2.1)
|
||||
thread-local (1.1.0)
|
||||
tilt (2.0.11)
|
||||
timecop (0.9.5)
|
||||
timecop (0.9.6)
|
||||
timeout (0.3.0)
|
||||
ttfunk (1.7.0)
|
||||
tzinfo (2.0.5)
|
||||
@@ -711,7 +711,7 @@ GEM
|
||||
activemodel (>= 3.0.0)
|
||||
public_suffix
|
||||
vcr (6.1.0)
|
||||
view_component (2.76.0)
|
||||
view_component (2.78.0)
|
||||
activesupport (>= 5.0.0, < 8.0)
|
||||
concurrent-ruby (~> 1.0)
|
||||
method_source (~> 1.0)
|
||||
@@ -744,7 +744,7 @@ GEM
|
||||
chronic (>= 0.6.3)
|
||||
wicked_pdf (2.6.3)
|
||||
activesupport
|
||||
wkhtmltopdf-binary (0.12.6.5)
|
||||
wkhtmltopdf-binary (0.12.6.6)
|
||||
xml-simple (1.1.8)
|
||||
xpath (3.2.0)
|
||||
nokogiri (~> 1.8)
|
||||
@@ -818,11 +818,12 @@ DEPENDENCIES
|
||||
json_spec (~> 1.1.4)
|
||||
jsonapi-serializer
|
||||
jwt (~> 2.3)
|
||||
knapsack
|
||||
knapsack_pro
|
||||
letter_opener (>= 1.4.1)
|
||||
listen
|
||||
mime-types
|
||||
mimemagic (> 0.3.5)
|
||||
mini_portile2 (~> 2.8)
|
||||
mini_racer (= 0.4.0)
|
||||
monetize (~> 1.11)
|
||||
oauth2 (~> 1.4.7)
|
||||
|
||||
3
Rakefile
3
Rakefile
@@ -8,6 +8,3 @@ require_relative 'config/application'
|
||||
|
||||
Openfoodnetwork::Application.load_tasks
|
||||
|
||||
if !ENV['DISABLE_KNAPSACK'] && defined?(Knapsack)
|
||||
Knapsack.load_tasks
|
||||
end
|
||||
|
||||
@@ -34,6 +34,7 @@ module Spree
|
||||
link = link_to_with_icon(options[:icon], titleized_label, destination_url)
|
||||
css_classes << 'tab-with-icon'
|
||||
else
|
||||
titleized_label = raw("<span class='text'>#{titleized_label}</span>")
|
||||
link = link_to(titleized_label, destination_url)
|
||||
end
|
||||
|
||||
|
||||
@@ -6,9 +6,9 @@ class Enterprise < ApplicationRecord
|
||||
# The next Rails version will have named variants but we need to store them
|
||||
# ourselves for now.
|
||||
LOGO_SIZES = {
|
||||
thumb: { resize_to_limit: [100, 100] },
|
||||
small: { resize_to_limit: [180, 180] },
|
||||
medium: { resize_to_limit: [300, 300] },
|
||||
thumb: { gravity: "Center", resize: "100x100^", crop: '100x100+0+0' },
|
||||
small: { gravity: "Center", resize: "180x180^", crop: '180x180+0+0' },
|
||||
medium: { gravity: "Center", resize: "300x300^", crop: '300x300+0+0' },
|
||||
}.freeze
|
||||
PROMO_IMAGE_SIZES = {
|
||||
thumb: { resize_to_limit: [100, 100] },
|
||||
|
||||
@@ -102,7 +102,6 @@
|
||||
= af.label :latitude, t(:latitude)
|
||||
\/
|
||||
= af.label :longitude, t(:longitude)
|
||||
%span.required *
|
||||
%div{'ofn-with-tip' => t('latitude_longitude_tip')}
|
||||
%a= t('admin.whats_this')
|
||||
.four.columns
|
||||
|
||||
@@ -41,7 +41,6 @@
|
||||
= af.label :latitude, t(:latitude)
|
||||
\/
|
||||
= af.label :longitude, t(:longitude)
|
||||
%span.required *
|
||||
= render partial: 'admin/shared/tooltip', locals: {tooltip_text: t('latitude_longitude_tip')}
|
||||
.four.columns
|
||||
= af.text_field :latitude, { placeholder: t(:latitude_placeholder) }
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
%br
|
||||
100 x 100 pixels
|
||||
.omega.eight.columns
|
||||
%img{ class: 'image-field-group__preview-image', ng: { src: '{{ Enterprise.logo.medium }}', if: 'Enterprise.logo' } }
|
||||
%img{ class: 'image-field-group__preview-image', ng: { src: '{{ Enterprise.logo.thumb }}', if: 'Enterprise.logo' } }
|
||||
%br
|
||||
= f.file_field :logo
|
||||
%a.button.red{ href: '', ng: {click: 'removeLogo()', if: 'Enterprise.logo'} }
|
||||
= t('.remove_logo')
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
.row.date-range-filter
|
||||
.alpha.two.columns= label_tag nil, t(:date_range)
|
||||
.omega.fourteen.columns
|
||||
= f.text_field "#{field}_gt", :class => 'datetimepicker datepicker-from', :placeholder => t(:start), data: { controller: "flatpickr", "flatpickr-enable-time-value": true }
|
||||
= f.text_field "#{field}_gt", :class => 'datetimepicker datepicker-from', :placeholder => t(:start), data: { controller: "flatpickr", "flatpickr-enable-time-value": true, "flatpickr-default-date-value": "startOfDay" }
|
||||
%span.range-divider
|
||||
%i.icon-arrow-right
|
||||
= f.text_field "#{field}_lt", :class => 'datetimepicker datepicker-to', :placeholder => t(:stop), data: { controller: "flatpickr", "flatpickr-enable-time-value": true }
|
||||
= f.text_field "#{field}_lt", :class => 'datetimepicker datepicker-to', :placeholder => t(:stop), data: { controller: "flatpickr", "flatpickr-enable-time-value": true, "flatpickr-default-date-value": "endOfDay" }
|
||||
|
||||
@@ -1 +1,5 @@
|
||||
= render 'admin/reports/date_range_form', f: f
|
||||
|
||||
.row
|
||||
.alpha.two.columns= label_tag nil, t(:report_hubs)
|
||||
.omega.fourteen.columns= f.collection_select(:distributor_id_in, @data.orders_distributors, :id, :name, {}, {class: "select2 fullwidth", multiple: true})
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
%a{"ng-click" => "triggerProductModal()"}
|
||||
%span.product-thumb__bulk-label{"ng-if" => "::product.group_buy"}
|
||||
= t(".bulk")
|
||||
%img{"ng-src" => "{{::product.primaryImageOrMissing}}", loading: "lazy"}
|
||||
%img{"ng-src" => "{{::product.primaryImageOrMissing}}"}
|
||||
|
||||
.summary
|
||||
.summary-header
|
||||
|
||||
@@ -54,6 +54,6 @@
|
||||
.actions.filter-actions
|
||||
%a.button.icon-search{'ng-click' => 'fetchResults()'}
|
||||
= t(:filter_results)
|
||||
%a.button{'ng-click' => 'clearFilters()', "id": "clear_filters_button"}
|
||||
%a.button{'ng-click' => 'clearFilters()', "id": "clear_filters_button", "class": ("secondary" if feature?(:admin_style_v2, spree_current_user)) }
|
||||
= t(:clear_filters)
|
||||
|
||||
|
||||
@@ -95,17 +95,17 @@
|
||||
%td.align-center
|
||||
%span{'ng-bind-html' => 'order.display_total'}
|
||||
%td.actions
|
||||
%div.row-loading-icons
|
||||
%div{ng: {show: 'rowStatus[order.id] == "loading"', cloak: true}, style: "width: 30px; height: 30px;"}
|
||||
= render partial: "components/spinner"
|
||||
%i.success.icon-ok-sign{ng: {show: 'rowStatus[order.id] == "success"'} }
|
||||
%i.error.icon-remove-sign.with-tip{ng: {show: 'rowStatus[order.id] == "error"'}, 'ofn-with-tip' => t('.order_not_updated')}
|
||||
%a.icon_link.with-tip.icon-edit.no-text{'ng-href' => '{{order.edit_path}}', 'data-action' => 'edit', 'ofn-with-tip' => t('.edit')}
|
||||
%div{'ng-if' => 'order.ready_to_ship'}
|
||||
%button.icon-road.icon_link.with-tip.no-text{'ng-click' => 'shipOrder(order)', rel: 'nofollow', 'ofn-with-tip' => t('.ship')}
|
||||
%div{'ng-if' => 'order.ready_to_capture'}
|
||||
%button.icon-capture.icon_link.no-text{'ng-click' => 'capturePayment(order)', rel: 'nofollow', 'ofn-with-tip' => t('.capture')}
|
||||
|
||||
.flex
|
||||
%div.row-loading-icons
|
||||
%div{ng: {show: 'rowStatus[order.id] == "loading"', cloak: true}, style: "width: 30px; height: 30px;"}
|
||||
= render partial: "components/spinner"
|
||||
%i.success.icon-ok-sign{ng: {show: 'rowStatus[order.id] == "success"'} }
|
||||
%i.error.icon-remove-sign.with-tip{ng: {show: 'rowStatus[order.id] == "error"'}, 'ofn-with-tip' => t('.order_not_updated')}
|
||||
%a.icon_link.with-tip.icon-edit.no-text{'ng-href' => '{{order.edit_path}}', 'data-action' => 'edit', 'ofn-with-tip' => t('.edit')}
|
||||
%div{'ng-if' => 'order.ready_to_ship'}
|
||||
%button.icon-road.icon_link.with-tip.no-text{'ng-click' => 'shipOrder(order)', rel: 'nofollow', 'ofn-with-tip' => t('.ship')}
|
||||
%div{'ng-if' => 'order.ready_to_capture'}
|
||||
%button.icon-capture.icon_link.no-text{'ng-click' => 'capturePayment(order)', rel: 'nofollow', 'ofn-with-tip' => t('.capture')}
|
||||
.sixteen.columns.alpha#loading{ 'ng-show' => 'RequestMonitor.loading' }
|
||||
= render partial: "components/admin_spinner"
|
||||
%h1
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
= t(controller.controller_name, :default => controller.controller_name.titleize)
|
||||
= " - OFN #{t(:administration)}"
|
||||
|
||||
%link{:href => "https://fonts.googleapis.com/css?family=Open+Sans:400italic,600italic,400,600&subset=latin,cyrillic,greek,vietnamese", :rel => "stylesheet", :type => "text/css"}
|
||||
%link{:href => "https://fonts.googleapis.com/css?family=Open+Sans:400italic,600italic,400,600,700&subset=latin,cyrillic,greek,vietnamese", :rel => "stylesheet", :type => "text/css"}
|
||||
|
||||
= stylesheet_pack_tag 'admin-styles', media: "screen, print"
|
||||
= render "layouts/bugsnag_js"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
%head{"data-hook" => "admin_inside_head"}
|
||||
= render :partial => 'spree/admin/shared/head'
|
||||
|
||||
%body.admin
|
||||
%body.admin{ "class": ("admin-v2" if feature?(:admin_style_v2, spree_current_user)) }
|
||||
- if content_for?(:main_ng_app_name)
|
||||
- if content_for?(:main_ng_ctrl_name)
|
||||
%div{ "ng-app" => yield(:main_ng_app_name).strip.html_safe, "ng-controller" => yield(:main_ng_ctrl_name).strip.html_safe }
|
||||
|
||||
@@ -1,21 +1,31 @@
|
||||
import { Controller } from "stimulus";
|
||||
|
||||
export default class extends Controller {
|
||||
static targets = ["reportType", "checkbox", "label"]
|
||||
static targets = ["reportType", "checkbox", "label"];
|
||||
|
||||
handleSelectChange() {
|
||||
this.reportTypeTarget.value == "csv" ? this.disableField() : this.enableField()
|
||||
this.reportTypeTarget.value == "csv"
|
||||
? this.disableField()
|
||||
: this.enableField();
|
||||
}
|
||||
|
||||
disableField() {
|
||||
this.checkboxTarget.checked = false;
|
||||
this.checkboxTarget.disabled = true;
|
||||
this.labelTarget.classList.add("disabled");
|
||||
if (this.hasCheckboxTarget) {
|
||||
this.checkboxTarget.checked = false;
|
||||
this.checkboxTarget.disabled = true;
|
||||
}
|
||||
if (this.hasLabelTarget) {
|
||||
this.labelTarget.classList.add("disabled");
|
||||
}
|
||||
}
|
||||
|
||||
enableField() {
|
||||
this.checkboxTarget.checked = true;
|
||||
this.checkboxTarget.disabled = false;
|
||||
this.labelTarget.classList.remove("disabled");
|
||||
if (this.hasCheckboxTarget) {
|
||||
this.checkboxTarget.checked = true;
|
||||
this.checkboxTarget.disabled = false;
|
||||
}
|
||||
if (this.hasLabelTarget) {
|
||||
this.labelTarget.classList.remove("disabled");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,10 @@ import ShortcutButtonsPlugin from "shortcut-buttons-flatpickr";
|
||||
import labelPlugin from "flatpickr/dist/plugins/labelPlugin/labelPlugin";
|
||||
|
||||
export default class extends Flatpickr {
|
||||
static values = { enableTime: Boolean, mode: String };
|
||||
/*
|
||||
* defaultDate (optional): "startOfDay" | "endOfDay"
|
||||
*/
|
||||
static values = { enableTime: Boolean, mode: String, defaultDate: String };
|
||||
static targets = ["start", "end"];
|
||||
locales = {
|
||||
ar: ar,
|
||||
@@ -60,6 +63,9 @@ export default class extends Flatpickr {
|
||||
|
||||
open() {
|
||||
this.fp.element.dispatchEvent(new Event("focus"));
|
||||
if (!this.fp.selectedDates.length) {
|
||||
this.setDefaultDateValue();
|
||||
}
|
||||
}
|
||||
onChangeEvent(e) {
|
||||
if (
|
||||
@@ -136,4 +142,16 @@ export default class extends Flatpickr {
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
setDefaultDateValue() {
|
||||
if (this.defaultDateValue === "startOfDay") {
|
||||
this.fp.setDate(moment().startOf("day").format());
|
||||
} else if (this.defaultDateValue === "endOfDay") {
|
||||
/*
|
||||
* We use "startOf('day')" of tomorrow in order to not lose
|
||||
* the records between [23:59:00 ~ 23:59:59] of today
|
||||
*/
|
||||
this.fp.setDate(moment().add(1, "days").startOf("day").format());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,3 +120,5 @@
|
||||
@import "components/tom_select";
|
||||
|
||||
@import 'app/components/help_modal_component/help_modal_component';
|
||||
|
||||
@import "v2/main.scss";
|
||||
|
||||
@@ -78,7 +78,6 @@ nav.menu {
|
||||
text-transform: uppercase;
|
||||
position: relative;
|
||||
text-align: center;
|
||||
font-weight: 600;
|
||||
|
||||
i {
|
||||
display: inline;
|
||||
|
||||
66
app/webpacker/css/admin/v2/components/buttons.scss
Normal file
66
app/webpacker/css/admin/v2/components/buttons.scss
Normal file
@@ -0,0 +1,66 @@
|
||||
/* Overide buttons.scss app/webpacker/css/admin/components/buttons.scss */
|
||||
|
||||
@mixin backgroundAndBorder($color) {
|
||||
background-color: $color;
|
||||
border: 2px solid $color;
|
||||
}
|
||||
|
||||
input[type="submit"],
|
||||
select[type="submit"],
|
||||
.select2-container-multi [type="submit"].select2-choices,
|
||||
input[type="button"],
|
||||
select[type="button"],
|
||||
.select2-container-multi [type="button"].select2-choices,
|
||||
button,
|
||||
.button,
|
||||
.actions a:not([class*="icon-"]),
|
||||
.admin__section-header .ofn-drop-down // Same behavior as the button
|
||||
{
|
||||
&.disabled,
|
||||
&[disabled] {
|
||||
@include backgroundAndBorder($v2-light-grey);
|
||||
}
|
||||
|
||||
&:not(.disabled):not([disabled]):not(.secondary) {
|
||||
// Change the color of the button only if it's not disabled
|
||||
@include backgroundAndBorder($v2-blue-light);
|
||||
|
||||
&:hover {
|
||||
@include backgroundAndBorder($v2-blue);
|
||||
box-shadow: $v2-box-shadow;
|
||||
}
|
||||
}
|
||||
|
||||
&.secondary {
|
||||
background-color: $white;
|
||||
border: 2px solid $v2-blue-light;
|
||||
color: $v2-blue-light;
|
||||
|
||||
&:hover {
|
||||
background-color: $v2-blue-lightest;
|
||||
color: $v2-blue;
|
||||
box-shadow: $v2-box-shadow;
|
||||
}
|
||||
}
|
||||
|
||||
&.active {
|
||||
@include backgroundAndBorder($v2-blue);
|
||||
}
|
||||
}
|
||||
|
||||
#table-filter .actions {
|
||||
/* used to draw a line on the right and left of the actions buttons
|
||||
We can then remove the dropshadow on the buttons */
|
||||
&:before,
|
||||
&:after {
|
||||
background-color: $v2-light-grey; // same color as the border of the fieldset. see forms.scss
|
||||
height: 1px;
|
||||
content: attr(data-initials);
|
||||
flex-grow: 1; // make the line as long as it can
|
||||
}
|
||||
}
|
||||
|
||||
#table-filter fieldset:has(.actions) {
|
||||
// do not apply border to filter actions as it's drawn by the #table-filter .actions before and after pseudo elements
|
||||
border-bottom: 0;
|
||||
}
|
||||
9
app/webpacker/css/admin/v2/components/progress.scss
Normal file
9
app/webpacker/css/admin/v2/components/progress.scss
Normal file
@@ -0,0 +1,9 @@
|
||||
/* Overide app/webpacker/css/admin/components/progress.scss file */
|
||||
|
||||
#progress {
|
||||
background-color: $v2-blue;
|
||||
}
|
||||
|
||||
#loading {
|
||||
color: $v2-blue;
|
||||
}
|
||||
73
app/webpacker/css/admin/v2/components/tables.scss
Normal file
73
app/webpacker/css/admin/v2/components/tables.scss
Normal file
@@ -0,0 +1,73 @@
|
||||
/* Overide tables.scss app/webpacker/css/admin/components/tables.scss */
|
||||
|
||||
table thead th {
|
||||
background-color: $v2-medium-light-grey;
|
||||
border: none;
|
||||
color: $v2-blue;
|
||||
text-transform: capitalize;
|
||||
font-size: 13px;
|
||||
|
||||
a {
|
||||
border: none;
|
||||
color: $v2-blue;
|
||||
}
|
||||
}
|
||||
|
||||
table tbody tr {
|
||||
&:first-child th,
|
||||
&:first-child td {
|
||||
border-top: none; // Don't show the top border of the first row
|
||||
}
|
||||
td:not(:first-child) {
|
||||
border-left: none; // Only show left border on the first cells, as it indicates the order state by its color
|
||||
}
|
||||
|
||||
td {
|
||||
border-bottom: none; // By default, do not show the border of the cells
|
||||
border-right: none;
|
||||
border-top: none;
|
||||
|
||||
border-bottom: 2px solid $v2-medium-light-grey;
|
||||
&.actions {
|
||||
border-bottom: 2px solid $v2-medium-light-grey !important; // needs to be important because of already defined with important
|
||||
}
|
||||
> .flex {
|
||||
display: flex;
|
||||
column-gap: 10px;
|
||||
}
|
||||
}
|
||||
&.even,
|
||||
&.odd {
|
||||
td {
|
||||
background-color: transparent; // Do not use odd and even colors for background
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
table th.actions,
|
||||
table td.actions {
|
||||
// Special for icons in the actions column
|
||||
[class*="icon-"].no-text {
|
||||
border: 2px solid $v2-blue-light;
|
||||
background-color: $v2-blue-lightest;
|
||||
|
||||
&:hover {
|
||||
border-color: $v2-blue;
|
||||
background-color: $v2-blue-light;
|
||||
box-shadow: $v2-box-shadow;
|
||||
|
||||
&:before {
|
||||
color: white;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
table#listing_orders td {
|
||||
// When the table is the listing of orders, we need to increase the height of the cells
|
||||
padding: 20px 0;
|
||||
|
||||
&.actions {
|
||||
padding-left: 20px;
|
||||
}
|
||||
}
|
||||
13
app/webpacker/css/admin/v2/main.scss
Normal file
13
app/webpacker/css/admin/v2/main.scss
Normal file
@@ -0,0 +1,13 @@
|
||||
@import "variables.scss";
|
||||
@import "shared/typography.scss";
|
||||
|
||||
body.admin.admin-v2 {
|
||||
@import "navigation.scss";
|
||||
@import "plugins/select2.scss";
|
||||
@import "plugins/powertip.scss";
|
||||
@import "plugins/flatpickr-customization.scss";
|
||||
@import "shared/forms.scss";
|
||||
@import "components/buttons.scss";
|
||||
@import "components/tables.scss";
|
||||
@import "components/progress.scss";
|
||||
}
|
||||
62
app/webpacker/css/admin/v2/navigation.scss
Normal file
62
app/webpacker/css/admin/v2/navigation.scss
Normal file
@@ -0,0 +1,62 @@
|
||||
#header {
|
||||
#login-nav {
|
||||
li {
|
||||
color: $v2-medium-dark-grey;
|
||||
|
||||
i {
|
||||
@include v2-link-color();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#admin-menu {
|
||||
background-color: $v2-orange;
|
||||
|
||||
li a span.text {
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
li.tab-with-icon a:before {
|
||||
display: none;
|
||||
}
|
||||
|
||||
li a:hover,
|
||||
li.selected a {
|
||||
background-color: $v2-orange-light;
|
||||
|
||||
span {
|
||||
text-shadow: 1px 1px 9px $v2-orange;
|
||||
}
|
||||
|
||||
&:after {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#sub-menu {
|
||||
background-color: $v2-orange-light;
|
||||
|
||||
li a {
|
||||
font-size: 100%;
|
||||
}
|
||||
|
||||
li a:hover,
|
||||
li.selected a {
|
||||
text-shadow: 1px 1px 9px $v2-orange;
|
||||
background-color: lighten($v2-orange-light, 7%);
|
||||
&:after {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.admin__section-header {
|
||||
background-color: transparent;
|
||||
border-bottom: none;
|
||||
|
||||
h1.js-admin-page-title {
|
||||
color: $v2-medium-dark-grey;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
/* Override flatpickr styles: app/webpacker/css/admin/plugins/flatpickr-customization.scss */
|
||||
|
||||
.flatpickr-calendar {
|
||||
&.arrowTop::after {
|
||||
border-bottom-color: $v2-blue-light;
|
||||
}
|
||||
.flatpickr-months .flatpickr-month,
|
||||
.flatpickr-current-month .flatpickr-monthDropdown-months {
|
||||
background: $v2-blue-light;
|
||||
color: white;
|
||||
input {
|
||||
color: white;
|
||||
}
|
||||
}
|
||||
|
||||
.flatpickr-weekdays {
|
||||
background: $v2-blue-light;
|
||||
|
||||
.flatpickr-weekday {
|
||||
background: $v2-blue-light;
|
||||
color: white;
|
||||
}
|
||||
}
|
||||
|
||||
.flatpickr-day.selected,
|
||||
.flatpickr-day.startRange,
|
||||
.flatpickr-day.endRange,
|
||||
.flatpickr-day.selected.inRange,
|
||||
.flatpickr-day.startRange.inRange,
|
||||
.flatpickr-day.endRange.inRange,
|
||||
.flatpickr-day.selected:focus,
|
||||
.flatpickr-day.startRange:focus,
|
||||
.flatpickr-day.endRange:focus,
|
||||
.flatpickr-day.selected:hover,
|
||||
.flatpickr-day.startRange:hover,
|
||||
.flatpickr-day.endRange:hover,
|
||||
.flatpickr-day.selected.prevMonthDay,
|
||||
.flatpickr-day.startRange.prevMonthDay,
|
||||
.flatpickr-day.endRange.prevMonthDay,
|
||||
.flatpickr-day.selected.nextMonthDay,
|
||||
.flatpickr-day.startRange.nextMonthDay,
|
||||
.flatpickr-day.endRange.nextMonthDay {
|
||||
background: $v2-blue-light;
|
||||
border-color: $v2-blue-light;
|
||||
}
|
||||
}
|
||||
31
app/webpacker/css/admin/v2/plugins/powertip.scss
Normal file
31
app/webpacker/css/admin/v2/plugins/powertip.scss
Normal file
@@ -0,0 +1,31 @@
|
||||
/* Overide file powertip.scss app/webpacker/css/admin/v2/plugins/powertip.scss */
|
||||
|
||||
#powerTip {
|
||||
background-color: $v2-blue;
|
||||
|
||||
&.n:before,
|
||||
&.ne:before,
|
||||
&.nw:before {
|
||||
border-top-color: $v2-blue;
|
||||
}
|
||||
|
||||
&.e:before {
|
||||
border-right-color: $v2-blue;
|
||||
}
|
||||
&.s:before,
|
||||
&.se:before,
|
||||
&.sw:before {
|
||||
border-bottom-color: $v2-blue;
|
||||
}
|
||||
&.w:before {
|
||||
border-left-color: $v2-blue;
|
||||
}
|
||||
&.ne:before,
|
||||
&.se:before {
|
||||
border-right-color: $v2-blue;
|
||||
}
|
||||
&.nw:before,
|
||||
&.sw:before {
|
||||
border-right-color: $v2-blue;
|
||||
}
|
||||
}
|
||||
70
app/webpacker/css/admin/v2/plugins/select2.scss
Normal file
70
app/webpacker/css/admin/v2/plugins/select2.scss
Normal file
@@ -0,0 +1,70 @@
|
||||
/* Override select2 styles app/webpacker/css/admin/plugins/select2.scss */
|
||||
|
||||
.select2-container {
|
||||
.select2-choice {
|
||||
background-color: transparent;
|
||||
border: 1px solid $v2-light-grey !important;
|
||||
color: $v2-medium-grey !important;
|
||||
padding-left: 5px;
|
||||
font-size: 13px;
|
||||
padding-top: 3px;
|
||||
|
||||
.select2-arrow {
|
||||
color: $v2-medium-grey;
|
||||
}
|
||||
}
|
||||
|
||||
&.select2-container-active,
|
||||
&:hover {
|
||||
.select2-choice {
|
||||
background-color: transparent !important;
|
||||
border-color: $v2-medium-grey !important;
|
||||
}
|
||||
}
|
||||
|
||||
&.select2-dropdown-open.select2-container-active {
|
||||
&:not(.select2-drop-above) {
|
||||
.select2-choice {
|
||||
border-bottom-left-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
}
|
||||
}
|
||||
&.select2-drop-above .select.select2-choice {
|
||||
border-top-left-radius: 0;
|
||||
border-top-right-radius: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.select2-container-multi {
|
||||
.select2-choices {
|
||||
border-color: $v2-medium-grey !important;
|
||||
.select2-search-choice {
|
||||
background-color: $v2-blue-light;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.select2-drop {
|
||||
border-color: $v2-medium-grey;
|
||||
}
|
||||
|
||||
.select2-search {
|
||||
color: $v2-medium-grey;
|
||||
}
|
||||
|
||||
.select2-results {
|
||||
margin-right: 0;
|
||||
li {
|
||||
.select2-result-label {
|
||||
color: $v2-medium-grey;
|
||||
}
|
||||
&.select2-highlighted {
|
||||
background-color: $v2-blue;
|
||||
}
|
||||
&.select2-no-results,
|
||||
&.select2-searching {
|
||||
color: $v2-medium-grey;
|
||||
}
|
||||
}
|
||||
}
|
||||
55
app/webpacker/css/admin/v2/shared/forms.scss
Normal file
55
app/webpacker/css/admin/v2/shared/forms.scss
Normal file
@@ -0,0 +1,55 @@
|
||||
/* Overide forms.scss app/webpacker/css/admin/shared/forms.scss */
|
||||
|
||||
input[type="text"],
|
||||
.select2-container-multi .select2-choices,
|
||||
.select2-search input,
|
||||
.select2-search select,
|
||||
select,
|
||||
input[type="password"],
|
||||
input[type="email"],
|
||||
input[type="url"],
|
||||
input[type="tel"],
|
||||
input[type="date"],
|
||||
input[type="datetime"],
|
||||
input[type="time"],
|
||||
input[type="number"],
|
||||
textarea,
|
||||
fieldset {
|
||||
// Change the color of all inputs
|
||||
color: $v2-medium-grey;
|
||||
border-color: $v2-light-grey !important;
|
||||
|
||||
&:focus {
|
||||
border-color: $v2-medium-grey;
|
||||
}
|
||||
}
|
||||
|
||||
fieldset label {
|
||||
color: $v2-medium-grey;
|
||||
}
|
||||
|
||||
fieldset legend {
|
||||
color: $v2-blue;
|
||||
}
|
||||
|
||||
input[type="checkbox"],
|
||||
input[type="radio"] {
|
||||
accent-color: $v2-blue;
|
||||
}
|
||||
|
||||
fieldset .filter-actions {
|
||||
button,
|
||||
.button,
|
||||
input[type="submit"] {
|
||||
box-shadow: none;
|
||||
width: 200px; // adjust at the same size in order to center them. Not ideal but works for now.
|
||||
|
||||
&:first-of-type {
|
||||
margin-right: 0; // don't see any reason to have a margin right on the first button as it's managed by the flexbox
|
||||
}
|
||||
|
||||
&:hover {
|
||||
box-shadow: $v2-box-shadow;
|
||||
}
|
||||
}
|
||||
}
|
||||
18
app/webpacker/css/admin/v2/shared/typography.scss
Normal file
18
app/webpacker/css/admin/v2/shared/typography.scss
Normal file
@@ -0,0 +1,18 @@
|
||||
// Overide app/webpacker/css/admin/shared/typography.scss
|
||||
|
||||
@mixin v2-link-color() {
|
||||
color: $v2-blue;
|
||||
border-color: $v2-blue;
|
||||
&:hover {
|
||||
color: $v2-blue-dark;
|
||||
border-color: $v2-blue-dark;
|
||||
}
|
||||
}
|
||||
|
||||
body.admin.admin-v2 {
|
||||
color: $v2-body-grey;
|
||||
|
||||
a:not(.button) {
|
||||
@include v2-link-color();
|
||||
}
|
||||
}
|
||||
23
app/webpacker/css/admin/v2/variables.scss
Normal file
23
app/webpacker/css/admin/v2/variables.scss
Normal file
@@ -0,0 +1,23 @@
|
||||
// Should finally replace (or at least complete) the file /admin/globale/variables.scss
|
||||
|
||||
$v2-orange: #f27052;
|
||||
$v2-orange-light: #f5947d;
|
||||
$v2-orange-lighter: #f8b7a8;
|
||||
$v2-orange-lightest: #fcdbd4;
|
||||
|
||||
$v2-dark-grey: #333333;
|
||||
$v2-medium-dark-grey: #444444;
|
||||
$v2-body-grey: #666666;
|
||||
$v2-medium-grey: #717171;
|
||||
$v2-medium-light-grey: #e6e6e6;
|
||||
$v2-light-grey: #e7e7e7;
|
||||
|
||||
$v2-blue: #017a9a;
|
||||
$v2-blue-dark: #005e7a;
|
||||
$v2-blue-light: #0096ad;
|
||||
$v2-blue-lightest: #e6f7fa; // Could be used as a background color for the action icons
|
||||
|
||||
$v2-green: #019854;
|
||||
$v2-green-light: #01cb70;
|
||||
|
||||
$v2-box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25); // Default box shadow for actions stuff
|
||||
13
bin/knapsack_pro_rspec
Executable file
13
bin/knapsack_pro_rspec
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
if [ "$KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC" = "" ]; then
|
||||
KNAPSACK_PRO_ENDPOINT=https://api-disabled-for-fork.knapsackpro.com \
|
||||
KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC=disabled-for-fork \
|
||||
KNAPSACK_PRO_MAX_REQUEST_RETRIES=0 \
|
||||
bundle exec rake knapsack_pro:rspec # use Regular Mode here always
|
||||
else
|
||||
# Regular Mode
|
||||
bundle exec rake knapsack_pro:rspec
|
||||
|
||||
# or you can use Queue Mode instead of Regular Mode if you like
|
||||
# bundle exec rake knapsack_pro:queue:rspec
|
||||
fi
|
||||
@@ -155,15 +155,17 @@ module Openfoodnetwork
|
||||
|
||||
initializer "ofn.reports" do |app|
|
||||
module ::Reporting; end
|
||||
loader = Zeitwerk::Loader.new
|
||||
loader.push_dir("#{Rails.root}/lib/reporting", namespace: ::Reporting)
|
||||
loader.enable_reloading
|
||||
loader.setup
|
||||
loader.eager_load
|
||||
Rails.application.reloader.to_prepare do
|
||||
loader = Zeitwerk::Loader.new
|
||||
loader.push_dir("#{Rails.root}/lib/reporting", namespace: ::Reporting)
|
||||
loader.enable_reloading
|
||||
loader.setup
|
||||
loader.eager_load
|
||||
|
||||
if Rails.env.development?
|
||||
require 'listen'
|
||||
Listen.to("lib/reporting") { loader.reload }.start
|
||||
if Rails.env.development?
|
||||
require 'listen'
|
||||
Listen.to("lib/reporting") { loader.reload }.start
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -247,5 +249,7 @@ module Openfoodnetwork
|
||||
config.active_storage.variable_content_types += ["image/svg+xml"]
|
||||
|
||||
config.exceptions_app = self.routes
|
||||
|
||||
config.autoloader = :zeitwerk
|
||||
end
|
||||
end
|
||||
|
||||
@@ -627,6 +627,7 @@ de_DE:
|
||||
conditional_blank: Darf nicht leer sein, wenn das Feld 'unit_type' leer ist.
|
||||
no_product: Es konnten keine passenden Produkte in der Datenbank gefunden werden.
|
||||
not_found: Konnte nicht in der Datenbank gefunden werden.
|
||||
category_not_found: stimmt nicht mit den verfügbaren Kategorien überein. Diese finden Sie auf der Seite zum Produktimport. Überprüfen Sie zusätzlich Ihre Angaben auf Tippfehler.
|
||||
not_updatable: Kann über den Produktimport nicht auf bestehende Produkte aktualisiert werden.
|
||||
blank: darf nicht leer sein
|
||||
products_no_permission: Sie sind nicht berechtigt, Produkte dieses Unternehmens zu verwalten.
|
||||
|
||||
@@ -30,6 +30,7 @@ en_CA:
|
||||
shipping_category_id: "Shipping Category"
|
||||
variant_unit: "Variant Unit"
|
||||
variant_unit_name: "Variant Unit Name"
|
||||
unit_value: "Unit value"
|
||||
spree/credit_card:
|
||||
base: "Credit Card"
|
||||
number: "Number"
|
||||
@@ -626,6 +627,7 @@ en_CA:
|
||||
conditional_blank: can't be blank if unit_type is blank
|
||||
no_product: did not match any products in the database
|
||||
not_found: not found in database
|
||||
category_not_found: doesn't match allowed categories. See the correct categories to choose from on the product import page, or check that there's no misspelling.
|
||||
not_updatable: cannot be updated on existing products via product import
|
||||
blank: can't be blank
|
||||
products_no_permission: you do not have permission to manage products for this enterprise
|
||||
@@ -882,7 +884,7 @@ en_CA:
|
||||
name: Name
|
||||
name_placeholder: eg. Professor Plum's Biodynamic Truffles
|
||||
groups: Groups
|
||||
groups_tip: Select any markets or groups that you are a member of. This will help customers find your enterprise.
|
||||
groups_tip: Select any markets, networks or groups that you are a member of. This will help customers find your enterprise.
|
||||
groups_placeholder: Start typing to search available markets or groups...
|
||||
primary_producer: Primary Producer?
|
||||
primary_producer_tip: Select 'Producer' if you are a primary producer, grower, maker or designer
|
||||
@@ -1579,7 +1581,7 @@ en_CA:
|
||||
menu_2_url: "/map"
|
||||
menu_3_title: "Producers"
|
||||
menu_3_url: "/producers"
|
||||
menu_4_title: "Markets"
|
||||
menu_4_title: "Networks"
|
||||
menu_4_url: "/groups"
|
||||
menu_5_title: "About"
|
||||
menu_5_url: "https://about.openfoodnetwork.ca"
|
||||
@@ -1641,7 +1643,7 @@ en_CA:
|
||||
label_map: "Map"
|
||||
label_producer: "Producer"
|
||||
label_producers: "Producers"
|
||||
label_groups: "Markets"
|
||||
label_groups: "Networks"
|
||||
label_about: "About"
|
||||
label_blog: "Blog"
|
||||
label_support: "Support"
|
||||
@@ -1980,7 +1982,7 @@ en_CA:
|
||||
shopping_tabs_about: "About"
|
||||
shopping_tabs_producers: "Producers"
|
||||
shopping_tabs_contact: "Contact"
|
||||
shopping_tabs_groups: "Markets"
|
||||
shopping_tabs_groups: "Networks"
|
||||
shopping_contact_address: "Address"
|
||||
shopping_contact_web: "Contact"
|
||||
shopping_contact_social: "Follow"
|
||||
@@ -2045,14 +2047,14 @@ en_CA:
|
||||
components_profiles_show: "Show profiles"
|
||||
components_filters_nofilters: "No filters"
|
||||
components_filters_clearfilters: "Clear all filters"
|
||||
groups_title: Markets
|
||||
groups_headline: 'Markets / Regions '
|
||||
groups_text: "Markets are collectives of producers, hubs and distributors who share something in common like location, farmers market or philosophy. This makes your shopping experience easier. So explore our groups and have the curating done for you."
|
||||
groups_title: Networks
|
||||
groups_headline: 'Networks / Regions '
|
||||
groups_text: "Networks are collectives of producers, hubs and distributors who share something in common like location, farmers market or philosophy. This makes your shopping experience easier. So explore our networks and have the curating done for you."
|
||||
groups_search: "Search name or keyword"
|
||||
groups_no_groups: "No groups found"
|
||||
groups_about: "About Us"
|
||||
groups_producers: "Our vendors"
|
||||
groups_hubs: "Go Shopping!"
|
||||
groups_producers: "Members"
|
||||
groups_hubs: "Go Shopping"
|
||||
groups_contact_web: Contact
|
||||
groups_contact_social: Follow
|
||||
groups_contact_address: Address
|
||||
|
||||
@@ -627,6 +627,7 @@ en_FR:
|
||||
conditional_blank: can't be blank if unit_type is blank
|
||||
no_product: did not match any products in the database
|
||||
not_found: not found in database
|
||||
category_not_found: doesn't match allowed categories. See the correct categories to choose from on the product import page, or check that there's no misspelling.
|
||||
not_updatable: cannot be updated on existing products via product import
|
||||
blank: can't be blank
|
||||
products_no_permission: you do not have permission to manage products for this enterprise
|
||||
|
||||
@@ -627,6 +627,7 @@ fr:
|
||||
conditional_blank: ne peut pas être vide si unit_type est vide
|
||||
no_product: n'a pu être associé à aucun produit existant dans la base de données
|
||||
not_found: non trouvé dans le base de données
|
||||
category_not_found: n'est pas conforme aux catégories utilisées. Merci de modifier les catégories en utilisant celles listées sur la page d'import ou vérifier qu'il n'y ait pas de faute de frappe ou d'espace à fin du mot.
|
||||
not_updatable: ne peut pas être mis à jour pour des produits existants via la fonctionnalité d'import de fichier produits
|
||||
blank: Champ obligatoire
|
||||
products_no_permission: vous n'avez pas l'autorisation de gérer les produits de cette entreprise
|
||||
@@ -1805,7 +1806,7 @@ fr:
|
||||
label: Ville
|
||||
placeholder: ex. Metz
|
||||
state_id:
|
||||
label: Statut
|
||||
label: Département
|
||||
zipcode:
|
||||
label: Code postal
|
||||
placeholder: ex. 57000
|
||||
@@ -3026,7 +3027,7 @@ fr:
|
||||
inventory_tagged_bottom: "sont:"
|
||||
new_tag_rule_dialog:
|
||||
select_rule_type: "Choisir le type de règle:"
|
||||
add_rule: "Ajouter une règle"
|
||||
add_rule: "Valider"
|
||||
enterprise_fees:
|
||||
inherit_from_product: "Hériter du produit"
|
||||
orders:
|
||||
|
||||
@@ -30,6 +30,7 @@ fr_CA:
|
||||
shipping_category_id: "Condition de transport"
|
||||
variant_unit: "Unité"
|
||||
variant_unit_name: "Unité de la variante"
|
||||
unit_value: "Nb unités"
|
||||
spree/credit_card:
|
||||
base: "Carte de crédit"
|
||||
number: "N° commande"
|
||||
@@ -627,6 +628,7 @@ fr_CA:
|
||||
conditional_blank: Champ obligatoire si le type d'unité est vide
|
||||
no_product: 'aucun produit trouvé '
|
||||
not_found: n'a pas été trouvé dans la base de donnée
|
||||
category_not_found: n'est pas conforme aux catégories utilisées. Merci de modifier les catégories en utilisant celles listées sur la page d'import ou vérifier qu'il n'y ait pas de faute de frappe ou d'espace à fin du mot.
|
||||
not_updatable: ne peut pas être mis à jour pour des produits existants via la fonctionnalité d'import de fichier produits
|
||||
blank: Champ obligatoire
|
||||
products_no_permission: vous n'avez pas les droits requis pour gérer les produits de cette entreprise
|
||||
|
||||
@@ -628,6 +628,7 @@ ru:
|
||||
conditional_blank: не может быть пустым, если unit_type пуст
|
||||
no_product: не найдено ни одного товара в базе данных
|
||||
not_found: не найден в базе данных
|
||||
category_not_found: не соответствует разрешенным категориям. Посмотрите, какие категории выбрать на странице импорта продуктов, или проверьте, нет ли орфографических ошибок.
|
||||
not_updatable: невозможно обновить существующие товары с помощью импорта товаров
|
||||
blank: не может быть пустым
|
||||
products_no_permission: у Вас нет разрешения на управление товарами этого предприятия
|
||||
@@ -1990,7 +1991,7 @@ ru:
|
||||
shopping_contact_social: "Следовать"
|
||||
shopping_groups_part_of: "часть:"
|
||||
shopping_producers_of_hub: "%{hub} производители:"
|
||||
enterprises_next_closing: "Закрытие заказа через"
|
||||
enterprises_next_closing: "Закрытие заказа"
|
||||
enterprises_currently_open: "Заказы открыты"
|
||||
enterprises_ready_for: "Готов к"
|
||||
enterprises_choose: "Выберите, когда вы хотите свой заказ:"
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
ActiveRecord::Schema.define(version: 2022_10_07_105052) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "pg_stat_statements"
|
||||
enable_extension "plpgsql"
|
||||
|
||||
create_table "active_storage_attachments", force: :cascade do |t|
|
||||
|
||||
@@ -43,6 +43,10 @@ module Reporting
|
||||
proc { |line_items| line_items.first.variant.full_name }
|
||||
end
|
||||
|
||||
def variant_sku
|
||||
proc { |line_items| line_items.first.variant.sku }
|
||||
end
|
||||
|
||||
def supplier_name
|
||||
proc { |line_items| line_items.first.variant.product.supplier.name }
|
||||
end
|
||||
|
||||
@@ -12,7 +12,8 @@ module Reporting
|
||||
quantity: proc { |line_items| line_items.sum(&:quantity) },
|
||||
total_units: proc { |line_items| total_units(line_items) },
|
||||
curr_cost_per_unit: proc { |line_items| line_items.first.price },
|
||||
total_cost: proc { |line_items| line_items.sum(&:amount) }
|
||||
total_cost: proc { |line_items| line_items.sum(&:amount) },
|
||||
sku: variant_sku
|
||||
}
|
||||
end
|
||||
|
||||
@@ -41,6 +42,10 @@ module Reporting
|
||||
[e.variant_id, e.price]
|
||||
}.values
|
||||
end
|
||||
|
||||
def default_params
|
||||
super.merge({ fields_to_hide: ["sku"] })
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -24,12 +24,15 @@ Shoulda::Matchers.configure do |config|
|
||||
end
|
||||
end
|
||||
|
||||
require 'knapsack_pro'
|
||||
KnapsackPro::Adapters::RSpecAdapter.bind
|
||||
|
||||
# Allow connections to selenium whilst raising errors when connecting to external sites
|
||||
require 'webmock/rspec'
|
||||
WebMock.enable!
|
||||
WebMock.disable_net_connect!(
|
||||
allow_localhost: true,
|
||||
allow: 'chromedriver.storage.googleapis.com'
|
||||
allow: ['chromedriver.storage.googleapis.com', 'api.knapsackpro.com']
|
||||
)
|
||||
|
||||
# Requires supporting ruby files with custom matchers and macros, etc,
|
||||
|
||||
@@ -25,6 +25,7 @@ module Reporting
|
||||
context 'with completed order' do
|
||||
let(:bill_address) { create(:address) }
|
||||
let(:distributor) { create(:distributor_enterprise) }
|
||||
let(:distributor1) { create(:distributor_enterprise) }
|
||||
let(:product) { create(:product) }
|
||||
let(:shipping_method) { create(:shipping_method) }
|
||||
let(:shipping_instructions) { 'pick up on thursday please!' }
|
||||
@@ -82,6 +83,26 @@ module Reporting
|
||||
table = subject.table_rows
|
||||
expect(table.size).to eq 2
|
||||
end
|
||||
|
||||
context "filtering by distributor" do
|
||||
it do
|
||||
create(:line_item_with_shipment, order: order)
|
||||
|
||||
report1 = Base.new(create(:admin_user), {})
|
||||
table = report1.table_rows
|
||||
expect(table.size).to eq 2
|
||||
|
||||
report2 = Base.new(create(:admin_user),
|
||||
{ q: { distributor_id_in: [distributor.id] } })
|
||||
table2 = report2.table_rows
|
||||
expect(table2.size).to eq 2
|
||||
|
||||
report3 = Base.new(create(:admin_user),
|
||||
{ q: { distributor_id_in: [distributor1.id] } })
|
||||
table3 = report3.table_rows
|
||||
expect(table3.size).to eq 0
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -18,6 +18,10 @@ module Reporting
|
||||
OrderCycleSupplierTotals.new(current_user, params)
|
||||
end
|
||||
|
||||
let(:table_headers) do
|
||||
report.table_headers
|
||||
end
|
||||
|
||||
let(:report_table) do
|
||||
report.table_rows
|
||||
end
|
||||
@@ -31,6 +35,15 @@ module Reporting
|
||||
supplier_name_field = report_table.first[0]
|
||||
expect(supplier_name_field).to eq supplier.name
|
||||
end
|
||||
|
||||
it "includes sku column" do
|
||||
variant_sku = order.line_items.first.variant.sku
|
||||
last_column_title = table_headers.last
|
||||
first_row_last_column_value = report_table.first.last
|
||||
|
||||
expect(last_column_title).to eq "SKU"
|
||||
expect(first_row_last_column_value).to eq variant_sku
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -88,8 +88,8 @@ describe Spree::Payment do
|
||||
before do
|
||||
allow(payment).to receive(:record_response)
|
||||
allow(card).to receive(:has_payment_profile?).and_return(true)
|
||||
payment.stub(:update_order)
|
||||
payment.stub(:create_payment_profile)
|
||||
allow(payment).to receive(:update_order).and_return(true)
|
||||
allow(payment).to receive(:create_payment_profile).and_return(true)
|
||||
end
|
||||
|
||||
context "#process!" do
|
||||
|
||||
@@ -5,14 +5,6 @@ require 'base_spec_helper'
|
||||
require 'database_cleaner'
|
||||
require 'view_component/test_helpers'
|
||||
|
||||
# This spec_helper.rb is being used by the custom engines in engines/. The engines are not set up to
|
||||
# use Knapsack, and this provides the option to disable it when running the tests in CI services.
|
||||
unless ENV['DISABLE_KNAPSACK']
|
||||
require 'knapsack'
|
||||
Knapsack.tracker.config(enable_time_offset_warning: false) unless ENV['CI']
|
||||
Knapsack::Adapters::RSpecAdapter.bind
|
||||
end
|
||||
|
||||
Capybara.javascript_driver = :chrome
|
||||
Capybara.default_max_wait_time = 30
|
||||
Capybara.disable_animation = true
|
||||
|
||||
@@ -32,5 +32,6 @@ module AuthenticationHelper
|
||||
def expect_logged_in
|
||||
# Ensure page has been reloaded after submitting login form
|
||||
expect(page).to_not have_selector ".menu #login-link"
|
||||
expect(page).to_not have_content "Login"
|
||||
end
|
||||
end
|
||||
|
||||
@@ -9,4 +9,5 @@ VCR.configure do |config|
|
||||
config.configure_rspec_metadata!
|
||||
config.filter_sensitive_data('<HIDDEN_KEY>') { ENV['STRIPE_SECRET_TEST_API_KEY'] }
|
||||
config.filter_sensitive_data('<HIDDEN_CUSTOMER>') { ENV['STRIPE_CUSTOMER'] }
|
||||
config.ignore_hosts('localhost', '127.0.0.1', '0.0.0.0', 'api.knapsackpro.com')
|
||||
end
|
||||
|
||||
@@ -5,7 +5,7 @@ require 'system_helper'
|
||||
describe '
|
||||
As an administrator
|
||||
I want to create/update complex order cycles with a specific time
|
||||
', js: true do
|
||||
' do
|
||||
include AdminHelper
|
||||
include AuthenticationHelper
|
||||
include WebHelper
|
||||
@@ -49,7 +49,7 @@ describe '
|
||||
payment_method_ii.update!(name: "Cash")
|
||||
end
|
||||
|
||||
it "creating an order cycle with full interface", js: true do
|
||||
it "creating an order cycle with full interface", retry: 3 do
|
||||
## CREATE
|
||||
login_as_admin_and_visit admin_order_cycles_path
|
||||
click_link 'New Order Cycle'
|
||||
|
||||
@@ -16,7 +16,7 @@ module CupriteHelpers
|
||||
# Use our `Capybara.save_path` to store screenshots with other capybara artifacts
|
||||
# (Rails screenshots path is not configurable https://github.com/rails/rails/blob/49baf092439fc74fc3377b12e3334c3dd9d0752f/actionpack/lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb#L79)
|
||||
def absolute_image_path
|
||||
Rails.root.join("#{Capybara.save_path}/screenshots/#{image_name}.png")
|
||||
Rails.root.join("#{Capybara.save_path}/screenshots/#{image_name.parameterize}.png")
|
||||
end
|
||||
|
||||
# Make failure screenshots compatible with multi-session setup.
|
||||
|
||||
36
yarn.lock
36
yarn.lock
@@ -1679,9 +1679,9 @@
|
||||
integrity sha512-Skfy0YS3NJ5nV9us0uuPN0HDk1Q4edljaOhRBJGDWs9EBa7ZVMYBHRFlhLvvmwEoaIM9BlH6QJFn9/uZg0bACg==
|
||||
|
||||
"@floating-ui/dom@^1.0.1":
|
||||
version "1.0.6"
|
||||
resolved "https://registry.yarnpkg.com/@floating-ui/dom/-/dom-1.0.6.tgz#e42393ec381a4fe96673fbcee137a95e86c93ebc"
|
||||
integrity sha512-kt/tg1oip9OAH1xjCTcx1OpcUpu9rjDw3GKJ/rEhUqhO7QyJWfrHU0DpLTNsH67+JyFL5Kv9X1utsXwKFVtyEQ==
|
||||
version "1.0.7"
|
||||
resolved "https://registry.yarnpkg.com/@floating-ui/dom/-/dom-1.0.7.tgz#9e8e6615ce03e5ebc6a4ae879640a199a366f86d"
|
||||
integrity sha512-6RsqvCYe0AYWtsGvuWqCm7mZytnXAZCjWtsWu1Kg8dI3INvj/DbKlDsZO+mKSaQdPT12uxIW9W2dAWJkPx4Y5g==
|
||||
dependencies:
|
||||
"@floating-ui/core" "^1.0.2"
|
||||
|
||||
@@ -1690,10 +1690,10 @@
|
||||
resolved "https://registry.yarnpkg.com/@hotwired/stimulus-webpack-helpers/-/stimulus-webpack-helpers-1.0.1.tgz#4cd74487adeca576c9865ac2b9fe5cb20cef16dd"
|
||||
integrity sha512-wa/zupVG0eWxRYJjC1IiPBdt3Lruv0RqGN+/DTMmUWUyMAEB27KXmVY6a8YpUVTM7QwVuaLNGW4EqDgrS2upXQ==
|
||||
|
||||
"@hotwired/stimulus@>= 3.0", "@hotwired/stimulus@^3.1.1":
|
||||
version "3.1.1"
|
||||
resolved "https://registry.yarnpkg.com/@hotwired/stimulus/-/stimulus-3.1.1.tgz#652f08a8e1d5edcb407340e58818fcff463b5848"
|
||||
integrity sha512-e0JpzIaYLsRRXevRDVs0yevabiCvieIWWCwh7VqVXjXM5AOHdjb7AjaKIj34zYFmY1N6HIRRfk915WVMYlHnDA==
|
||||
"@hotwired/stimulus@>= 3.0", "@hotwired/stimulus@^3.2.1":
|
||||
version "3.2.1"
|
||||
resolved "https://registry.yarnpkg.com/@hotwired/stimulus/-/stimulus-3.2.1.tgz#e3de23623b0c52c247aba4cd5d530d257008676b"
|
||||
integrity sha512-HGlzDcf9vv/EQrMJ5ZG6VWNs8Z/xMN+1o2OhV1gKiSG6CqZt5MCBB1gRg5ILiN3U0jEAxuDTNPRfBcnZBDmupQ==
|
||||
|
||||
"@hotwired/turbo@^7.1.0":
|
||||
version "7.2.4"
|
||||
@@ -3758,9 +3758,9 @@ bail@^1.0.0:
|
||||
integrity sha512-xFbRxM1tahm08yHBP16MMjVUAvDaBMD38zsM9EMAUN61omwLmKlOpB/Zku5QkjZ8TZ4vn53pj+t518cH0S03RQ==
|
||||
|
||||
balanced-match@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767"
|
||||
integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c=
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee"
|
||||
integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==
|
||||
|
||||
base64-js@^1.0.2:
|
||||
version "1.5.1"
|
||||
@@ -4574,7 +4574,7 @@ compression@^1.7.4:
|
||||
concat-map@0.0.1:
|
||||
version "0.0.1"
|
||||
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
|
||||
integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=
|
||||
integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==
|
||||
|
||||
concat-stream@^1.5.0:
|
||||
version "1.6.2"
|
||||
@@ -8693,9 +8693,9 @@ minimalistic-crypto-utils@^1.0.1:
|
||||
integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=
|
||||
|
||||
minimatch@^3.0.4:
|
||||
version "3.0.4"
|
||||
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
|
||||
integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==
|
||||
version "3.1.2"
|
||||
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b"
|
||||
integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==
|
||||
dependencies:
|
||||
brace-expansion "^1.1.7"
|
||||
|
||||
@@ -11597,11 +11597,11 @@ stimulus-flatpickr@^1.4.0:
|
||||
integrity sha512-rcC/c9+E+f5W2kOjaaLShtf3i+p95ACqt+oGzSAgeuZh2YeIN8gW4EWO7h0STBLzSVPl6BjIfPWP7upMPavIVQ==
|
||||
|
||||
stimulus@^3.0.1:
|
||||
version "3.1.1"
|
||||
resolved "https://registry.yarnpkg.com/stimulus/-/stimulus-3.1.1.tgz#ef37aafce32c24d91b8fe496855436d096c6cb44"
|
||||
integrity sha512-eFOPFB6tJXJ6wFpUVjpi0/tYSiY4LPwdZa/1S6bzhhEt5cSIfmtndrHpaUo76uElpWnfmEEOB4ezMXtGnG9HBQ==
|
||||
version "3.2.1"
|
||||
resolved "https://registry.yarnpkg.com/stimulus/-/stimulus-3.2.1.tgz#bf049a4379ed4ff7475515acce1f0b6fa15a0187"
|
||||
integrity sha512-EhpuHnTwtkWrE5m7tQxLBLsi1aE6xJ/9MbB88aKXZSquIC4pCueKJ2AGaF5gq+/BzP7+xvYaVYA0j1dIUuBsgA==
|
||||
dependencies:
|
||||
"@hotwired/stimulus" "^3.1.1"
|
||||
"@hotwired/stimulus" "^3.2.1"
|
||||
"@hotwired/stimulus-webpack-helpers" "^1.0.0"
|
||||
|
||||
stimulus_reflex@3.5.0-pre9:
|
||||
|
||||
Reference in New Issue
Block a user