Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3c8aa875a0 | ||
|
|
49c8cb82c7 | ||
|
|
ef70bfdc3c |
@@ -2,9 +2,9 @@ version: "2"
|
||||
plugins:
|
||||
rubocop:
|
||||
enabled: true
|
||||
channel: "rubocop-1-12"
|
||||
channel: "rubocop-0-76"
|
||||
config:
|
||||
file: ".rubocop.yml"
|
||||
file: ".rubocop_styleguide.yml"
|
||||
scss-lint:
|
||||
enabled: true
|
||||
checks:
|
||||
|
||||
5
.github/codecov.yml
vendored
@@ -1,5 +0,0 @@
|
||||
coverage:
|
||||
status:
|
||||
project:
|
||||
default:
|
||||
informational: true
|
||||
325
.github/workflows/build.yml
vendored
@@ -1,325 +0,0 @@
|
||||
name: Build
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
pull_request:
|
||||
|
||||
env:
|
||||
DISABLE_KNAPSACK: true
|
||||
TIMEZONE: UTC
|
||||
COVERAGE: true
|
||||
|
||||
jobs:
|
||||
test-controllers-and-serializers:
|
||||
runs-on: ubuntu-18.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
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- 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@v2
|
||||
with:
|
||||
node-version: '14.15.5'
|
||||
|
||||
- name: Install JS dependencies
|
||||
run: yarn install --frozen-lockfile
|
||||
|
||||
- name: Set up application.yml
|
||||
run: cp config/application.yml.example config/application.yml
|
||||
|
||||
- name: Set up database
|
||||
run: |
|
||||
bundle exec rake db:create RAILS_ENV=test
|
||||
bundle exec rake db:schema:load RAILS_ENV=test
|
||||
|
||||
- name: Run controller tests
|
||||
run: bundle exec rspec --profile -- spec/controllers spec/serializers
|
||||
|
||||
- name: Codecov
|
||||
uses: codecov/codecov-action@v1.3.1
|
||||
|
||||
test-models:
|
||||
runs-on: ubuntu-18.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
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- 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@v2
|
||||
with:
|
||||
node-version: '14.15.5'
|
||||
|
||||
- name: Install JS dependencies
|
||||
run: yarn install --frozen-lockfile
|
||||
|
||||
- name: Set up application.yml
|
||||
run: cp config/application.yml.example config/application.yml
|
||||
|
||||
- name: Set up database
|
||||
run: |
|
||||
bundle exec rake db:create RAILS_ENV=test
|
||||
bundle exec rake db:schema:load RAILS_ENV=test
|
||||
|
||||
- name: Run tests
|
||||
run: bundle exec rspec --profile -- spec/models
|
||||
|
||||
- name: Codecov
|
||||
uses: codecov/codecov-action@v1.3.1
|
||||
|
||||
test-admin-features-1:
|
||||
runs-on: ubuntu-18.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
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- 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@v2
|
||||
with:
|
||||
node-version: '14.15.5'
|
||||
|
||||
- name: Install JS dependencies
|
||||
run: yarn install --frozen-lockfile
|
||||
|
||||
- name: Set up application.yml
|
||||
run: cp config/application.yml.example config/application.yml
|
||||
|
||||
- name: Set up database
|
||||
run: |
|
||||
bundle exec rake db:create RAILS_ENV=test
|
||||
bundle exec rake db:schema:load RAILS_ENV=test
|
||||
|
||||
- name: Run admin feature tests
|
||||
run: bundle exec rspec --profile -- spec/features/admin/[a-o0-9]*_spec.rb
|
||||
|
||||
- name: Codecov
|
||||
uses: codecov/codecov-action@v1.3.1
|
||||
|
||||
test-admin-features-2:
|
||||
runs-on: ubuntu-18.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
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- 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@v2
|
||||
with:
|
||||
node-version: '14.15.5'
|
||||
|
||||
- name: Install JS dependencies
|
||||
run: yarn install --frozen-lockfile
|
||||
|
||||
- name: Set up application.yml
|
||||
run: cp config/application.yml.example config/application.yml
|
||||
|
||||
- name: Set up database
|
||||
run: |
|
||||
bundle exec rake db:create RAILS_ENV=test
|
||||
bundle exec rake db:schema:load RAILS_ENV=test
|
||||
|
||||
- name: Run admin feature tests
|
||||
run: bundle exec rspec --profile -- spec/features/admin/[p-z]*_spec.rb
|
||||
|
||||
- name: Codecov
|
||||
uses: codecov/codecov-action@v1.3.1
|
||||
|
||||
test-consumer-features:
|
||||
runs-on: ubuntu-18.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
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- 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@v2
|
||||
with:
|
||||
node-version: '14.15.5'
|
||||
|
||||
- name: Install JS dependencies
|
||||
run: yarn install --frozen-lockfile
|
||||
|
||||
- name: Set up application.yml
|
||||
run: cp config/application.yml.example config/application.yml
|
||||
|
||||
- name: Set up database
|
||||
run: |
|
||||
bundle exec rake db:create RAILS_ENV=test
|
||||
bundle exec rake db:schema:load RAILS_ENV=test
|
||||
|
||||
- name: Run consumer feature tests
|
||||
run: bundle exec rspec --profile -- spec/features/consumer
|
||||
|
||||
- name: Codecov
|
||||
uses: codecov/codecov-action@v1.3.1
|
||||
|
||||
test-engines-etc:
|
||||
runs-on: ubuntu-18.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
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- 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@v2
|
||||
with:
|
||||
node-version: '14.15.5'
|
||||
|
||||
- name: Install JS dependencies
|
||||
run: yarn install --frozen-lockfile
|
||||
|
||||
- name: Set up application.yml
|
||||
run: cp config/application.yml.example config/application.yml
|
||||
|
||||
- name: Set up database
|
||||
run: |
|
||||
bundle exec rake db:create RAILS_ENV=test
|
||||
bundle exec rake db:schema:load RAILS_ENV=test
|
||||
|
||||
- name: Run JS tests
|
||||
run: RAILS_ENV=test bundle exec rake karma:run
|
||||
|
||||
# Migration tests need to be run in a separate task.
|
||||
# See: https://github.com/openfoodfoundation/openfoodnetwork/pull/6924#issuecomment-813056525
|
||||
- name: Run migration tests
|
||||
run: bundle exec rspec --pattern "spec/{migrations}/**/*_spec.rb"
|
||||
|
||||
- name: Run all other tests
|
||||
run: bundle exec rake ofn:specs:run:excluding_folders["models,controllers,serializers,features,lib,migrations"]
|
||||
|
||||
test-the-rest:
|
||||
runs-on: ubuntu-18.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
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- 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@v2
|
||||
with:
|
||||
node-version: '14.15.5'
|
||||
|
||||
- name: Install JS dependencies
|
||||
run: yarn install --frozen-lockfile
|
||||
|
||||
- name: Set up application.yml
|
||||
run: cp config/application.yml.example config/application.yml
|
||||
|
||||
- name: Set up database
|
||||
run: |
|
||||
bundle exec rake db:create RAILS_ENV=test
|
||||
bundle exec rake db:schema:load RAILS_ENV=test
|
||||
|
||||
- name: Run admin feature folders, engines, lib
|
||||
run: bundle exec rspec --profile --pattern "engines/*/spec/{,/*/**}/*_spec.rb,spec/features/admin/*/*_spec.rb,spec/lib/{,/*/**}/*_spec.rb"
|
||||
|
||||
- name: Codecov
|
||||
uses: codecov/codecov-action@v1.5.0
|
||||
2
.gitignore
vendored
@@ -31,7 +31,6 @@ app/public
|
||||
public/system
|
||||
public/stylesheets
|
||||
public/images
|
||||
public/files
|
||||
public/spree
|
||||
public/assets
|
||||
config/abr.yml
|
||||
@@ -47,4 +46,3 @@ coverage
|
||||
/reports/
|
||||
!/reports/README.md
|
||||
bin/
|
||||
/spec/components/stories/**/*.stories.json
|
||||
|
||||
@@ -1 +1 @@
|
||||
14.16.1
|
||||
5.12.0
|
||||
|
||||
@@ -10,8 +10,8 @@ inherit_from:
|
||||
# The automatically generated todo list to ignore all current violations.
|
||||
- .rubocop_todo.yml
|
||||
|
||||
# Our Open Food Network style guide. If you want to see all violations,
|
||||
# then use only that configuration:
|
||||
# Our Open Food Network style guide. It's used by Code Climate. If you want to see all violations,
|
||||
# then use only that configuration (like Code Climate):
|
||||
#
|
||||
# bundle exec rubocop -c .rubocop_styleguide.yml
|
||||
#
|
||||
|
||||
@@ -21,25 +21,6 @@
|
||||
Layout/LineLength:
|
||||
Max: 100
|
||||
Exclude:
|
||||
- app/controllers/spree/admin/products_controller.rb
|
||||
- app/controllers/spree/admin/reports_controller.rb
|
||||
- app/controllers/spree/paypal_controller.rb
|
||||
- engines/order_management/spec/services/order_management/order/stripe_sca_payment_authorize_spec.rb
|
||||
- engines/order_management/spec/services/order_management/order/updater_spec.rb
|
||||
- engines/order_management/spec/services/order_management/reports/bulk_coop/bulk_coop_report_spec.rb
|
||||
- lib/open_food_network/reports/line_items.rb
|
||||
- spec/controllers/spree/admin/orders/invoices_spec.rb
|
||||
- spec/controllers/spree/admin/tax_rates_controller_spec.rb
|
||||
- spec/controllers/user_passwords_controller_spec.rb
|
||||
- spec/features/admin/configuration/general_settings_spec.rb
|
||||
- spec/features/consumer/shopping/unit_price_spec.rb
|
||||
- spec/helpers/admin/orders_helper_spec.rb
|
||||
- spec/lib/open_food_network/order_cycle_management_report_spec.rb
|
||||
- spec/lib/stripe/authorize_response_patcher_spec.rb
|
||||
- spec/services/bulk_invoice_service_spec.rb
|
||||
- spec/services/content_sanitizer_spec.rb
|
||||
- spec/services/process_payment_intent_spec.rb
|
||||
- spec/support/features/datepicker_helper.rb
|
||||
- app/controllers/admin/bulk_line_items_controller.rb
|
||||
- app/controllers/admin/contents_controller.rb
|
||||
- app/controllers/admin/customers_controller.rb
|
||||
@@ -249,6 +230,7 @@ Layout/LineLength:
|
||||
- spec/lib/open_food_network/products_and_inventory_report_spec.rb
|
||||
- spec/lib/open_food_network/scope_variant_to_hub_spec.rb
|
||||
- spec/lib/open_food_network/tag_rule_applicator_spec.rb
|
||||
- spec/lib/open_food_network/user_balance_calculator_spec.rb
|
||||
- spec/lib/open_food_network/users_and_enterprises_report_spec.rb
|
||||
- spec/lib/open_food_network/xero_invoices_report_spec.rb
|
||||
- spec/lib/spree/core/calculated_adjustments_spec.rb
|
||||
@@ -347,29 +329,6 @@ Layout/LineLength:
|
||||
Metrics/AbcSize:
|
||||
Max: 15
|
||||
Exclude:
|
||||
- app/controllers/admin/schedules_controller.rb
|
||||
- app/controllers/checkout_controller.rb
|
||||
- app/controllers/spree/admin/general_settings_controller.rb
|
||||
- app/controllers/spree/admin/images_controller.rb
|
||||
- app/controllers/spree/admin/mail_methods_controller.rb
|
||||
- app/controllers/spree/admin/shipping_methods_controller.rb
|
||||
- app/controllers/spree/paypal_controller.rb
|
||||
- app/helpers/spree/base_helper.rb
|
||||
- app/jobs/subscription_placement_job.rb
|
||||
- app/models/order_cycle.rb
|
||||
- app/models/product_import/unit_converter.rb
|
||||
- app/models/spree/gateway/pay_pal_express.rb
|
||||
- app/serializers/api/admin/enterprise_serializer.rb
|
||||
- app/services/order_factory.rb
|
||||
- app/services/variants_stock_levels.rb
|
||||
- engines/order_management/app/services/order_management/subscriptions/form.rb
|
||||
- lib/open_food_network/enterprise_fee_calculator.rb
|
||||
- lib/open_food_network/order_grouper.rb
|
||||
- lib/spree/core/controller_helpers/auth.rb
|
||||
- lib/spree/core/controller_helpers/common.rb
|
||||
- lib/spree/core/product_duplicator.rb
|
||||
- lib/stripe/authorize_response_patcher.rb
|
||||
- lib/stripe/profile_storer.rb
|
||||
- app/controllers/admin/bulk_line_items_controller.rb
|
||||
- app/controllers/admin/customers_controller.rb
|
||||
- app/controllers/admin/enterprise_fees_controller.rb
|
||||
@@ -509,7 +468,7 @@ Metrics/AbcSize:
|
||||
|
||||
Metrics/BlockLength:
|
||||
Max: 25
|
||||
IgnoredMethods: [
|
||||
ExcludedMethods: [
|
||||
"class_eval",
|
||||
"collection",
|
||||
"context",
|
||||
@@ -523,8 +482,6 @@ Metrics/BlockLength:
|
||||
"scenario"
|
||||
]
|
||||
Exclude:
|
||||
- spec/features/admin/order_cycles/complex_updating_specific_time_spec.rb
|
||||
- spec/features/admin/tag_rules_spec.rb
|
||||
- app/models/spree/order/checkout.rb
|
||||
- app/models/spree/payment/processing.rb
|
||||
- app/models/spree/shipment.rb
|
||||
@@ -557,27 +514,6 @@ Metrics/BlockLength:
|
||||
Metrics/CyclomaticComplexity:
|
||||
Max: 6
|
||||
Exclude:
|
||||
- app/controllers/admin/resource_controller.rb
|
||||
- app/controllers/spree/admin/payment_methods_controller.rb
|
||||
- app/controllers/spree/admin/payments_controller.rb
|
||||
- app/controllers/spree/admin/products_controller.rb
|
||||
- app/controllers/spree/admin/users_controller.rb
|
||||
- app/models/product_import/entry_validator.rb
|
||||
- app/models/spree/order_inventory.rb
|
||||
- app/models/spree/order.rb
|
||||
- app/models/spree/shipment.rb
|
||||
- app/models/spree/tax_rate.rb
|
||||
- app/models/spree/variant.rb
|
||||
- engines/order_management/app/services/order_management/reports/enterprise_fee_summary/parameters.rb
|
||||
- lib/active_merchant/billing/gateways/stripe_decorator.rb
|
||||
- lib/open_food_network/group_buy_report.rb
|
||||
- lib/open_food_network/order_cycle_form_applicator.rb
|
||||
- lib/open_food_network/order_cycle_permissions.rb
|
||||
- lib/open_food_network/payments_report.rb
|
||||
- lib/spree/core/controller_helpers/common.rb
|
||||
- lib/stripe/authorize_response_patcher.rb
|
||||
- lib/stripe/credit_card_clone_destroyer.rb
|
||||
- spec/support/i18n_translations_checker.rb
|
||||
- app/controllers/admin/enterprise_fees_controller.rb
|
||||
- app/controllers/admin/enterprises_controller.rb
|
||||
- app/controllers/spree/admin/taxons_controller.rb
|
||||
@@ -616,18 +552,6 @@ Metrics/CyclomaticComplexity:
|
||||
Metrics/PerceivedComplexity:
|
||||
Max: 7
|
||||
Exclude:
|
||||
- app/controllers/spree/admin/payment_methods_controller.rb
|
||||
- app/controllers/spree/admin/payments_controller.rb
|
||||
- app/controllers/spree/admin/users_controller.rb
|
||||
- app/models/product_import/entry_validator.rb
|
||||
- app/models/spree/order_inventory.rb
|
||||
- app/models/spree/shipment.rb
|
||||
- app/models/spree/variant.rb
|
||||
- lib/active_merchant/billing/gateways/stripe_decorator.rb
|
||||
- lib/open_food_network/group_buy_report.rb
|
||||
- lib/open_food_network/order_cycle_form_applicator.rb
|
||||
- lib/open_food_network/order_cycle_permissions.rb
|
||||
- lib/open_food_network/payments_report.rb
|
||||
- app/controllers/admin/enterprises_controller.rb
|
||||
- app/controllers/api/variants_controller.rb
|
||||
- app/controllers/spree/admin/taxons_controller.rb
|
||||
@@ -778,18 +702,10 @@ Metrics/MethodLength:
|
||||
- spec/features/consumer/shopping/variant_overrides_spec.rb
|
||||
- spec/models/product_importer_spec.rb
|
||||
- spec/support/i18n_translations_checker.rb
|
||||
- app/controllers/admin/bulk_line_items_controller.rb
|
||||
- app/controllers/spree/paypal_controller.rb
|
||||
- app/jobs/subscription_placement_job.rb
|
||||
- app/models/spree/gateway/pay_pal_express.rb
|
||||
|
||||
Metrics/ClassLength:
|
||||
Max: 100
|
||||
Exclude:
|
||||
- app/controllers/admin/customers_controller.rb
|
||||
- app/controllers/spree/admin/payments_controller.rb
|
||||
- app/controllers/spree/paypal_controller.rb
|
||||
- engines/order_management/app/services/order_management/order/updater.rb
|
||||
- app/controllers/admin/enterprises_controller.rb
|
||||
- app/controllers/admin/order_cycles_controller.rb
|
||||
- app/controllers/admin/resource_controller.rb
|
||||
@@ -848,7 +764,6 @@ Metrics/ModuleLength:
|
||||
- app/models/spree/payment/processing.rb
|
||||
- engines/order_management/spec/services/order_management/subscriptions/proxy_order_syncer_spec.rb
|
||||
- engines/order_management/spec/services/order_management/subscriptions/validator_spec.rb
|
||||
- engines/order_management/spec/services/order_management/subscriptions/summary_spec.rb
|
||||
- lib/open_food_network/column_preference_defaults.rb
|
||||
- spec/controllers/admin/order_cycles_controller_spec.rb
|
||||
- spec/controllers/api/orders_controller_spec.rb
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
# Our Open Food Network style guide.
|
||||
#
|
||||
# These are the rules we agreed upon and we work towards.
|
||||
# These are the rules we agreed upon and we work towards. Code Climate uses
|
||||
# these rules to rate our code and detect new violations. But when you run
|
||||
# rubocop locally, the default configuration file `.rubocop.yml` loads
|
||||
# our "todo lists" to ignore all current violations.
|
||||
AllCops:
|
||||
NewCops: disable
|
||||
SuggestExtensions: false
|
||||
TargetRailsVersion: 5.0
|
||||
TargetRailsVersion: 4.0
|
||||
Exclude:
|
||||
- 'bin/**/*'
|
||||
- 'db/**/*'
|
||||
@@ -182,7 +183,7 @@ Metrics/AbcSize:
|
||||
|
||||
Metrics/BlockLength:
|
||||
Max: 25
|
||||
IgnoredMethods: [
|
||||
ExcludedMethods: [
|
||||
"class_eval",
|
||||
"collection",
|
||||
"context",
|
||||
@@ -216,6 +217,3 @@ Metrics/ParameterLists:
|
||||
|
||||
Metrics/PerceivedComplexity:
|
||||
Max: 7
|
||||
|
||||
Naming/PredicateName:
|
||||
Enabled: false
|
||||
|
||||
@@ -1 +1 @@
|
||||
2.5.8
|
||||
2.4.4
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
module.exports = {
|
||||
stories: ['../spec/components/stories/**/*.stories.json'],
|
||||
addons: [
|
||||
'@storybook/addon-docs',
|
||||
'@storybook/addon-controls',
|
||||
],
|
||||
};
|
||||
@@ -1,2 +0,0 @@
|
||||
<link href='https://fonts.googleapis.com/css?family=Roboto:400,300italic,400italic,300,700,700italic|Oswald:300,400,700' rel='stylesheet' type='text/css'>
|
||||
<link rel="stylesheet" media="screen" href="http://localhost:3000/assets/darkswarm/all.css" />
|
||||
@@ -1,5 +0,0 @@
|
||||
export const parameters = {
|
||||
server: {
|
||||
url: `http://localhost:3000/rails/stories`,
|
||||
},
|
||||
};
|
||||
@@ -15,14 +15,6 @@ Create a new branch on your local machine to make your changes against (based on
|
||||
|
||||
git checkout -b branch-name-here --no-track upstream/master
|
||||
|
||||
You might need to update or install missing gems:
|
||||
|
||||
bundle install
|
||||
|
||||
Also, there might be missing dependencies, after pulling a particular branch. To update dependencies, run:
|
||||
|
||||
yarn install
|
||||
|
||||
If you want to run the whole test suite, we recommend using a free CI service to run your tests in parallel. Running the whole suite locally in series is likely to take > 40 minutes. [TravisCI][travis] and [SemaphoreCI][semaphore] both work great in our experience. Either way, make sure the tests pass on your new branch:
|
||||
|
||||
bundle exec rspec spec
|
||||
|
||||
@@ -6,13 +6,12 @@ This is a general guide to setting up an Open Food Network **development environ
|
||||
|
||||
The fastest way to make it work locally is to use Docker, you only need to setup git, see the [Docker setup guide](docker/README.md).
|
||||
Otherwise, for a local setup you will need:
|
||||
* Ruby and bundler (check current Ruby version in [.ruby-version](https://github.com/openfoodfoundation/openfoodnetwork/blob/master/.ruby-version) file)
|
||||
* Ruby 2.3.7 and bundler
|
||||
* PostgreSQL database
|
||||
* Chrome (for testing)
|
||||
|
||||
The following guides will provide OS-specific step-by-step instructions to get these requirements installed:
|
||||
- [Ubuntu Setup Guide][ubuntu]
|
||||
- [Debian Setup Guide][debian]
|
||||
- [OSX Setup Guide][osx]
|
||||
|
||||
If you are likely to need to manage multiple version of ruby on your local machine, we recommend version managers such as [rbenv](https://github.com/rbenv/rbenv) or [RVM](https://rvm.io/).
|
||||
@@ -21,7 +20,7 @@ For those new to Rails, the following tutorial will help get you up to speed wit
|
||||
|
||||
### Get it
|
||||
|
||||
So you have set up your local environment according to the requirements listed above. If you're planning on contributing code to the project (which we [LOVE](CONTRIBUTING.md)), it is a good idea to begin by forking this repo using the `Fork` button in the top-right corner of this screen. You should then be able to use `git clone` to copy your fork onto your local machine:
|
||||
If you're planning on contributing code to the project (which we [LOVE](CONTRIBUTING.md)), it is a good idea to begin by forking this repo using the `Fork` button in the top-right corner of this screen. You should then be able to use `git clone` to copy your fork onto your local machine.
|
||||
|
||||
git clone https://github.com/YOUR_GITHUB_USERNAME_HERE/openfoodnetwork
|
||||
|
||||
@@ -78,6 +77,8 @@ Note: If your OS is not explicitly supported in the setup guides then not all te
|
||||
|
||||
Note: The time zone on your machine should match the one defined in `config/application.yml`.
|
||||
|
||||
The project is configured to use [Zeus][zeus] to reduce the pre-test startup time while Rails loads. See the [Zeus GitHub page][zeus] for usage instructions.
|
||||
|
||||
Once [npm dependencies are installed][karma], AngularJS tests can be run with:
|
||||
|
||||
./script/karma run
|
||||
@@ -115,8 +116,8 @@ If these commands succeed, you should be able to [continue the setup process](#g
|
||||
[developer-wiki]: https://github.com/openfoodfoundation/openfoodnetwork/wiki
|
||||
[osx]: https://github.com/openfoodfoundation/openfoodnetwork/wiki/Development-Environment-Setup:-OS-X
|
||||
[ubuntu]: https://github.com/openfoodfoundation/openfoodnetwork/wiki/Development-Environment-Setup:-Ubuntu
|
||||
[debian]: https://github.com/openfoodfoundation/openfoodnetwork/wiki/Development-Environment-Setup:-Debian
|
||||
[wiki]: https://github.com/openfoodfoundation/openfoodnetwork/wiki
|
||||
[zeus]: https://github.com/burke/zeus
|
||||
[rubocop]: https://rubocop.readthedocs.io/en/latest/
|
||||
[karma]: https://github.com/openfoodfoundation/openfoodnetwork/wiki/Karma
|
||||
[slack-dev]: https://openfoodnetwork.slack.com/messages/C2GQ45KNU
|
||||
|
||||
87
Gemfile
@@ -1,27 +1,52 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
source 'https://rubygems.org'
|
||||
ruby "2.5.8"
|
||||
ruby "2.4.4"
|
||||
git_source(:github) { |repo_name| "https://github.com/#{repo_name}.git" }
|
||||
|
||||
gem 'rails', '~> 5.2'
|
||||
plugin 'bootboot', '~> 0.1.1' unless Bundler.settings[:frozen]
|
||||
Plugin.__send__(:load_plugin, 'bootboot') if Plugin.installed?('bootboot')
|
||||
|
||||
gem 'activemerchant', '>= 1.78.0'
|
||||
gem 'angular-rails-templates', '>= 0.3.0'
|
||||
gem 'awesome_nested_set'
|
||||
gem 'ransack', '2.4.1'
|
||||
gem 'responders'
|
||||
gem 'sass', '<= 4.7.1'
|
||||
gem 'sass-rails', '< 6.0.0'
|
||||
if ENV['DEPENDENCIES_NEXT']
|
||||
enable_dual_booting if Plugin.installed?('bootboot')
|
||||
|
||||
# This will only be loaded when running
|
||||
# bundler command prefixed with `DEPENDENCIES_NEXT=1
|
||||
gem 'rails', '> 5.0', '< 5.1'
|
||||
|
||||
gem 'activemerchant', '>= 1.78.0'
|
||||
gem 'angular-rails-templates', '>= 0.3.0'
|
||||
gem 'awesome_nested_set'
|
||||
gem 'ransack', '2.3.0'
|
||||
gem 'responders'
|
||||
gem 'sass', '<= 4.7.1'
|
||||
gem 'sass-rails', '< 6.0.0'
|
||||
gem 'libv8', '< 8'
|
||||
else
|
||||
gem 'rails', '~> 4.2'
|
||||
|
||||
gem 'activemerchant', '~> 1.78.0'
|
||||
gem 'angular-rails-templates', '~> 0.3.0'
|
||||
gem 'awesome_nested_set', '~> 3.3.1'
|
||||
gem 'ransack', '~> 1.8.10'
|
||||
gem 'responders', '~> 2.0'
|
||||
gem 'sass'
|
||||
gem 'sass-rails'
|
||||
|
||||
gem 'db2fog'
|
||||
gem 'unicorn'
|
||||
|
||||
group :test do
|
||||
gem 'test_after_commit' # needed to test Devise callbacks
|
||||
end
|
||||
end
|
||||
|
||||
gem 'i18n'
|
||||
gem 'i18n-js', '~> 3.8.3'
|
||||
gem 'i18n-js', '~> 3.8.0'
|
||||
gem 'rails-i18n'
|
||||
gem 'rails_safe_tasks', '~> 1.0'
|
||||
|
||||
gem "activerecord-import"
|
||||
gem "db2fog", github: "openfoodfoundation/db2fog", branch: "rails-5"
|
||||
gem "fog-aws", ">= 0.6.0"
|
||||
|
||||
gem "catalog", path: "./engines/catalog"
|
||||
gem 'dfc_provider', path: './engines/dfc_provider'
|
||||
@@ -29,14 +54,14 @@ gem "order_management", path: "./engines/order_management"
|
||||
gem 'web', path: './engines/web'
|
||||
|
||||
gem 'activerecord-postgresql-adapter'
|
||||
gem 'pg', '~> 1.2.3'
|
||||
gem 'pg', '~> 0.21.0'
|
||||
|
||||
gem 'acts_as_list', '1.0.4'
|
||||
gem 'cancancan', '~> 1.15.0'
|
||||
gem 'acts_as_list', '0.9.19'
|
||||
gem 'cancancan', '~> 1.7.0'
|
||||
gem 'ffaker'
|
||||
gem 'highline', '2.0.3' # Necessary for the install generator
|
||||
gem 'json'
|
||||
gem 'monetize', '~> 1.11'
|
||||
gem 'monetize', '~> 1.10'
|
||||
gem 'paranoia', '~> 2.4'
|
||||
gem 'state_machines-activerecord'
|
||||
gem 'stringex', '~> 2.8.5'
|
||||
@@ -48,7 +73,7 @@ gem 'devise'
|
||||
gem 'devise-encryptable'
|
||||
gem 'devise-token_authenticatable'
|
||||
gem 'jwt', '~> 2.2'
|
||||
gem 'oauth2', '~> 1.4.7' # Used for Stripe Connect
|
||||
gem 'oauth2', '~> 1.4.4' # Used for Stripe Connect
|
||||
|
||||
gem 'daemons'
|
||||
gem 'delayed_job_active_record'
|
||||
@@ -68,22 +93,18 @@ gem 'actionpack-action_caching'
|
||||
# AMS is deprecated, we will introduce an alternative at some point
|
||||
gem "active_model_serializers", "0.8.4"
|
||||
gem 'activerecord-session_store'
|
||||
gem 'acts-as-taggable-on', '~> 7.0'
|
||||
gem 'acts-as-taggable-on', '~> 4.0'
|
||||
gem 'angularjs-file-upload-rails', '~> 2.4.1'
|
||||
gem 'custom_error_message', github: 'jeremydurham/custom-err-msg'
|
||||
gem 'dalli'
|
||||
gem 'figaro'
|
||||
gem 'geocoder'
|
||||
gem 'gmaps4rails'
|
||||
gem 'mimemagic', '> 0.3.5'
|
||||
gem 'paper_trail', '~> 10.3.1'
|
||||
gem 'paperclip', '~> 3.4.1'
|
||||
gem 'rack-rewrite'
|
||||
gem 'rack-ssl', require: 'rack/ssl'
|
||||
gem 'roadie-rails', '~> 2.2.0'
|
||||
|
||||
gem 'redis', '>= 4.0', require: ['redis', 'redis/connection/hiredis']
|
||||
gem 'hiredis'
|
||||
gem 'roadie-rails', '~> 1.3.0'
|
||||
|
||||
gem 'combine_pdf'
|
||||
gem 'wicked_pdf'
|
||||
@@ -96,10 +117,10 @@ gem 'whenever', require: false
|
||||
|
||||
gem 'test-unit', '~> 3.4'
|
||||
|
||||
gem 'coffee-rails', '~> 5.0.0'
|
||||
gem 'coffee-rails', '~> 4.2.2'
|
||||
gem 'compass-rails'
|
||||
|
||||
gem 'mini_racer', '0.4.0'
|
||||
gem 'mini_racer', '0.2.15'
|
||||
|
||||
gem 'uglifier', '>= 1.0.3'
|
||||
|
||||
@@ -115,14 +136,6 @@ gem 'select2-rails', '~> 3.4.7'
|
||||
|
||||
gem 'ofn-qz', github: 'openfoodfoundation/ofn-qz', branch: 'ofn-rails-4'
|
||||
|
||||
gem 'good_migrations'
|
||||
|
||||
gem 'flipper'
|
||||
gem 'flipper-active_record'
|
||||
gem 'flipper-ui'
|
||||
|
||||
gem "view_component", require: "view_component/engine"
|
||||
|
||||
group :production, :staging do
|
||||
gem 'ddtrace'
|
||||
gem 'unicorn-worker-killer'
|
||||
@@ -130,11 +143,11 @@ end
|
||||
|
||||
group :test, :development do
|
||||
# Pretty printed test output
|
||||
gem 'atomic'
|
||||
gem 'awesome_print'
|
||||
gem 'bullet'
|
||||
gem 'capybara'
|
||||
gem 'database_cleaner', require: false
|
||||
gem "factory_bot_rails", '6.2.0', require: false
|
||||
gem "factory_bot_rails", '5.2.0', require: false
|
||||
gem 'fuubar', '~> 2.5.1'
|
||||
gem 'json_spec', '~> 1.1.4'
|
||||
gem 'knapsack'
|
||||
@@ -150,11 +163,9 @@ group :test, :development do
|
||||
end
|
||||
|
||||
group :test do
|
||||
gem 'codecov', require: false
|
||||
gem 'simplecov', require: false
|
||||
gem 'test-prof'
|
||||
gem 'webmock'
|
||||
gem 'rails-controller-testing'
|
||||
# See spec/spec_helper.rb for instructions
|
||||
# gem 'perftools.rb'
|
||||
end
|
||||
@@ -169,8 +180,6 @@ group :development do
|
||||
gem 'spring'
|
||||
gem 'spring-commands-rspec'
|
||||
|
||||
gem "view_component_storybook", require: "view_component/storybook/engine"
|
||||
|
||||
# 1.0.9 fixed openssl issues on macOS https://github.com/eventmachine/eventmachine/issues/602
|
||||
# While we don't require this gem directly, no dependents forced the upgrade to a version
|
||||
# greater than 1.0.9, so we just required the latest available version here.
|
||||
|
||||
659
Gemfile.lock
666
Gemfile_next.lock
Normal file
@@ -0,0 +1,666 @@
|
||||
GIT
|
||||
remote: https://github.com/jeremydurham/custom-err-msg.git
|
||||
revision: 3a8ec9dddc7a5b0aab7c69a6060596de300c68f4
|
||||
specs:
|
||||
custom_error_message (1.1.1)
|
||||
|
||||
GIT
|
||||
remote: https://github.com/openfoodfoundation/ofn-qz.git
|
||||
revision: 467f6ea1c44529c7c91cac4c8211bbd863588c0b
|
||||
branch: ofn-rails-4
|
||||
specs:
|
||||
ofn-qz (0.1.0)
|
||||
|
||||
PATH
|
||||
remote: engines/catalog
|
||||
specs:
|
||||
catalog (0.0.1)
|
||||
|
||||
PATH
|
||||
remote: engines/dfc_provider
|
||||
specs:
|
||||
dfc_provider (0.0.1)
|
||||
active_model_serializers (~> 0.8.4)
|
||||
jwt (~> 2.2)
|
||||
rspec (~> 3.9)
|
||||
|
||||
PATH
|
||||
remote: engines/order_management
|
||||
specs:
|
||||
order_management (0.0.1)
|
||||
|
||||
PATH
|
||||
remote: engines/web
|
||||
specs:
|
||||
web (0.0.1)
|
||||
|
||||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
actioncable (5.0.7.2)
|
||||
actionpack (= 5.0.7.2)
|
||||
nio4r (>= 1.2, < 3.0)
|
||||
websocket-driver (~> 0.6.1)
|
||||
actionmailer (5.0.7.2)
|
||||
actionpack (= 5.0.7.2)
|
||||
actionview (= 5.0.7.2)
|
||||
activejob (= 5.0.7.2)
|
||||
mail (~> 2.5, >= 2.5.4)
|
||||
rails-dom-testing (~> 2.0)
|
||||
actionpack (5.0.7.2)
|
||||
actionview (= 5.0.7.2)
|
||||
activesupport (= 5.0.7.2)
|
||||
rack (~> 2.0)
|
||||
rack-test (~> 0.6.3)
|
||||
rails-dom-testing (~> 2.0)
|
||||
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
||||
actionpack-action_caching (1.2.1)
|
||||
actionpack (>= 4.0.0)
|
||||
actionview (5.0.7.2)
|
||||
activesupport (= 5.0.7.2)
|
||||
builder (~> 3.1)
|
||||
erubis (~> 2.7.0)
|
||||
rails-dom-testing (~> 2.0)
|
||||
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
||||
active_model_serializers (0.8.4)
|
||||
activemodel (>= 3.0)
|
||||
activejob (5.0.7.2)
|
||||
activesupport (= 5.0.7.2)
|
||||
globalid (>= 0.3.6)
|
||||
activemerchant (1.107.4)
|
||||
activesupport (>= 4.2)
|
||||
builder (>= 2.1.2, < 4.0.0)
|
||||
i18n (>= 0.6.9)
|
||||
nokogiri (~> 1.4)
|
||||
activemodel (5.0.7.2)
|
||||
activesupport (= 5.0.7.2)
|
||||
activerecord (5.0.7.2)
|
||||
activemodel (= 5.0.7.2)
|
||||
activesupport (= 5.0.7.2)
|
||||
arel (~> 7.0)
|
||||
activerecord-import (1.0.7)
|
||||
activerecord (>= 3.2)
|
||||
activerecord-postgresql-adapter (0.0.1)
|
||||
pg
|
||||
activerecord-session_store (1.1.3)
|
||||
actionpack (>= 4.0)
|
||||
activerecord (>= 4.0)
|
||||
multi_json (~> 1.11, >= 1.11.2)
|
||||
rack (>= 1.5.2, < 3)
|
||||
railties (>= 4.0)
|
||||
activesupport (5.0.7.2)
|
||||
concurrent-ruby (~> 1.0, >= 1.0.2)
|
||||
i18n (>= 0.7, < 2)
|
||||
minitest (~> 5.1)
|
||||
tzinfo (~> 1.1)
|
||||
acts-as-taggable-on (4.0.0)
|
||||
activerecord (>= 4.0)
|
||||
acts_as_list (0.9.19)
|
||||
activerecord (>= 3.0)
|
||||
addressable (2.7.0)
|
||||
public_suffix (>= 2.0.2, < 5.0)
|
||||
andand (1.3.3)
|
||||
angular-rails-templates (1.1.0)
|
||||
railties (>= 4.2, < 7)
|
||||
sprockets (>= 3.0, < 5)
|
||||
tilt
|
||||
angular_rails_csrf (4.2.0)
|
||||
railties (>= 3, < 7)
|
||||
angularjs-file-upload-rails (2.4.1)
|
||||
angularjs-rails (1.5.5)
|
||||
arel (7.1.4)
|
||||
ast (2.4.1)
|
||||
atomic (1.1.101)
|
||||
awesome_nested_set (3.2.1)
|
||||
activerecord (>= 4.0.0, < 7.0)
|
||||
awesome_print (1.8.0)
|
||||
aws-sdk (1.67.0)
|
||||
aws-sdk-v1 (= 1.67.0)
|
||||
aws-sdk-v1 (1.67.0)
|
||||
json (~> 1.4)
|
||||
nokogiri (~> 1)
|
||||
bcrypt (3.1.16)
|
||||
bugsnag (6.18.0)
|
||||
concurrent-ruby (~> 1.0)
|
||||
builder (3.2.4)
|
||||
byebug (11.0.1)
|
||||
cancancan (1.7.1)
|
||||
capybara (3.15.0)
|
||||
addressable
|
||||
mini_mime (>= 0.1.3)
|
||||
nokogiri (~> 1.8)
|
||||
rack (>= 1.6.0)
|
||||
rack-test (>= 0.6.3)
|
||||
regexp_parser (~> 1.2)
|
||||
xpath (~> 3.2)
|
||||
childprocess (3.0.0)
|
||||
chronic (0.10.2)
|
||||
chunky_png (1.3.14)
|
||||
climate_control (0.2.0)
|
||||
cocaine (0.5.8)
|
||||
climate_control (>= 0.0.3, < 1.0)
|
||||
coderay (1.1.3)
|
||||
coffee-rails (4.2.2)
|
||||
coffee-script (>= 2.2.0)
|
||||
railties (>= 4.0.0)
|
||||
coffee-script (2.4.1)
|
||||
coffee-script-source
|
||||
execjs
|
||||
coffee-script-source (1.12.2)
|
||||
combine_pdf (1.0.19)
|
||||
ruby-rc4 (>= 0.1.5)
|
||||
compass (1.0.3)
|
||||
chunky_png (~> 1.2)
|
||||
compass-core (~> 1.0.2)
|
||||
compass-import-once (~> 1.0.5)
|
||||
rb-fsevent (>= 0.9.3)
|
||||
rb-inotify (>= 0.9)
|
||||
sass (>= 3.3.13, < 3.5)
|
||||
compass-core (1.0.3)
|
||||
multi_json (~> 1.0)
|
||||
sass (>= 3.3.0, < 3.5)
|
||||
compass-import-once (1.0.5)
|
||||
sass (>= 3.2, < 3.5)
|
||||
compass-rails (2.0.1)
|
||||
compass (~> 1.0.0)
|
||||
concurrent-ruby (1.1.7)
|
||||
crack (0.4.4)
|
||||
crass (1.0.6)
|
||||
css_parser (1.7.1)
|
||||
addressable
|
||||
daemons (1.3.1)
|
||||
dalli (2.7.11)
|
||||
database_cleaner (1.8.5)
|
||||
ddtrace (0.43.0)
|
||||
msgpack
|
||||
debugger-linecache (1.2.0)
|
||||
delayed_job (4.1.8)
|
||||
activesupport (>= 3.0, < 6.1)
|
||||
delayed_job_active_record (4.1.4)
|
||||
activerecord (>= 3.0, < 6.1)
|
||||
delayed_job (>= 3.0, < 5)
|
||||
delayed_job_web (1.4.3)
|
||||
activerecord (> 3.0.0)
|
||||
delayed_job (> 2.0.3)
|
||||
rack-protection (>= 1.5.5)
|
||||
sinatra (>= 1.4.4)
|
||||
devise (4.7.3)
|
||||
bcrypt (~> 3.0)
|
||||
orm_adapter (~> 0.1)
|
||||
railties (>= 4.1.0)
|
||||
responders
|
||||
warden (~> 1.2.3)
|
||||
devise-encryptable (0.2.0)
|
||||
devise (>= 2.1.0)
|
||||
devise-token_authenticatable (1.1.0)
|
||||
devise (>= 4.0.0, < 5.0.0)
|
||||
diff-lcs (1.4.4)
|
||||
docile (1.3.2)
|
||||
erubis (2.7.0)
|
||||
eventmachine (1.2.7)
|
||||
execjs (2.7.0)
|
||||
factory_bot (5.2.0)
|
||||
activesupport (>= 4.2.0)
|
||||
factory_bot_rails (5.2.0)
|
||||
factory_bot (~> 5.2.0)
|
||||
railties (>= 4.2.0)
|
||||
faraday (1.0.1)
|
||||
multipart-post (>= 1.2, < 3)
|
||||
ffaker (2.11.0)
|
||||
ffi (1.13.1)
|
||||
figaro (1.2.0)
|
||||
thor (>= 0.14.0, < 2)
|
||||
foundation-icons-sass-rails (3.0.0)
|
||||
railties (>= 3.1.1)
|
||||
sass-rails (>= 3.1.1)
|
||||
foundation-rails (5.5.2.1)
|
||||
railties (>= 3.1.0)
|
||||
sass (>= 3.3.0, < 3.5)
|
||||
fuubar (2.5.1)
|
||||
rspec-core (~> 3.0)
|
||||
ruby-progressbar (~> 1.4)
|
||||
geocoder (1.6.4)
|
||||
get_process_mem (0.2.7)
|
||||
ffi (~> 1.0)
|
||||
globalid (0.4.2)
|
||||
activesupport (>= 4.2.0)
|
||||
gmaps4rails (2.1.2)
|
||||
haml (5.2.0)
|
||||
temple (>= 0.8.0)
|
||||
tilt
|
||||
hashdiff (1.0.1)
|
||||
highline (2.0.3)
|
||||
i18n (1.8.5)
|
||||
concurrent-ruby (~> 1.0)
|
||||
i18n-js (3.8.0)
|
||||
i18n (>= 0.6.6)
|
||||
immigrant (0.3.6)
|
||||
activerecord (>= 3.0)
|
||||
jaro_winkler (1.5.4)
|
||||
jquery-migrate-rails (1.2.1)
|
||||
jquery-rails (4.4.0)
|
||||
rails-dom-testing (>= 1, < 3)
|
||||
railties (>= 4.2.0)
|
||||
thor (>= 0.14, < 2.0)
|
||||
jquery-ui-rails (4.2.1)
|
||||
railties (>= 3.2.16)
|
||||
json (1.8.6)
|
||||
json-schema (2.8.1)
|
||||
addressable (>= 2.4)
|
||||
json_spec (1.1.5)
|
||||
multi_json (~> 1.0)
|
||||
rspec (>= 2.0, < 4.0)
|
||||
jwt (2.2.2)
|
||||
kaminari (1.2.1)
|
||||
activesupport (>= 4.1.0)
|
||||
kaminari-actionview (= 1.2.1)
|
||||
kaminari-activerecord (= 1.2.1)
|
||||
kaminari-core (= 1.2.1)
|
||||
kaminari-actionview (1.2.1)
|
||||
actionview
|
||||
kaminari-core (= 1.2.1)
|
||||
kaminari-activerecord (1.2.1)
|
||||
activerecord
|
||||
kaminari-core (= 1.2.1)
|
||||
kaminari-core (1.2.1)
|
||||
kgio (2.11.3)
|
||||
knapsack (1.20.0)
|
||||
rake
|
||||
launchy (2.4.3)
|
||||
addressable (~> 2.3)
|
||||
letter_opener (1.7.0)
|
||||
launchy (~> 2.2)
|
||||
libv8 (7.3.492.27.1)
|
||||
loofah (2.7.0)
|
||||
crass (~> 1.0.2)
|
||||
nokogiri (>= 1.5.9)
|
||||
mail (2.7.1)
|
||||
mini_mime (>= 0.1.1)
|
||||
method_source (1.0.0)
|
||||
mime-types (3.3.1)
|
||||
mime-types-data (~> 3.2015)
|
||||
mime-types-data (3.2020.1104)
|
||||
mini_mime (1.0.2)
|
||||
mini_portile2 (2.4.0)
|
||||
mini_racer (0.2.15)
|
||||
libv8 (> 7.3)
|
||||
minitest (5.14.2)
|
||||
monetize (1.9.4)
|
||||
money (~> 6.12)
|
||||
money (6.13.8)
|
||||
i18n (>= 0.6.4, <= 2)
|
||||
msgpack (1.3.3)
|
||||
multi_json (1.15.0)
|
||||
multi_xml (0.6.0)
|
||||
multipart-post (2.1.1)
|
||||
mustermann (1.1.1)
|
||||
ruby2_keywords (~> 0.0.1)
|
||||
nio4r (2.5.2)
|
||||
nokogiri (1.10.10)
|
||||
mini_portile2 (~> 2.4.0)
|
||||
oauth2 (1.4.4)
|
||||
faraday (>= 0.8, < 2.0)
|
||||
jwt (>= 1.0, < 3.0)
|
||||
multi_json (~> 1.3)
|
||||
multi_xml (~> 0.5)
|
||||
rack (>= 1.2, < 3)
|
||||
orm_adapter (0.5.0)
|
||||
paper_trail (10.3.1)
|
||||
activerecord (>= 4.2)
|
||||
request_store (~> 1.1)
|
||||
paperclip (3.4.2)
|
||||
activemodel (>= 3.0.0)
|
||||
activerecord (>= 3.0.0)
|
||||
activesupport (>= 3.0.0)
|
||||
cocaine (~> 0.5.0)
|
||||
mime-types
|
||||
parallel (1.19.2)
|
||||
paranoia (2.4.2)
|
||||
activerecord (>= 4.0, < 6.1)
|
||||
parser (2.7.2.0)
|
||||
ast (~> 2.4.1)
|
||||
paypal-sdk-core (0.2.10)
|
||||
multi_json (~> 1.0)
|
||||
xml-simple
|
||||
paypal-sdk-merchant (1.106.1)
|
||||
paypal-sdk-core (~> 0.2.3)
|
||||
pg (0.21.0)
|
||||
polyamorous (2.3.0)
|
||||
activerecord (>= 5.0)
|
||||
power_assert (1.2.0)
|
||||
pry (0.13.1)
|
||||
coderay (~> 1.1)
|
||||
method_source (~> 1.0)
|
||||
pry-byebug (3.9.0)
|
||||
byebug (~> 11.0)
|
||||
pry (~> 0.13.0)
|
||||
public_suffix (4.0.6)
|
||||
rack (2.2.3)
|
||||
rack-mini-profiler (2.0.2)
|
||||
rack (>= 1.2.0)
|
||||
rack-protection (2.1.0)
|
||||
rack
|
||||
rack-rewrite (1.5.1)
|
||||
rack-ssl (1.4.1)
|
||||
rack
|
||||
rack-test (0.6.3)
|
||||
rack (>= 1.0)
|
||||
rails (5.0.7.2)
|
||||
actioncable (= 5.0.7.2)
|
||||
actionmailer (= 5.0.7.2)
|
||||
actionpack (= 5.0.7.2)
|
||||
actionview (= 5.0.7.2)
|
||||
activejob (= 5.0.7.2)
|
||||
activemodel (= 5.0.7.2)
|
||||
activerecord (= 5.0.7.2)
|
||||
activesupport (= 5.0.7.2)
|
||||
bundler (>= 1.3.0)
|
||||
railties (= 5.0.7.2)
|
||||
sprockets-rails (>= 2.0.0)
|
||||
rails-dom-testing (2.0.3)
|
||||
activesupport (>= 4.2.0)
|
||||
nokogiri (>= 1.6)
|
||||
rails-html-sanitizer (1.3.0)
|
||||
loofah (~> 2.3)
|
||||
rails-i18n (5.1.3)
|
||||
i18n (>= 0.7, < 2)
|
||||
railties (>= 5.0, < 6)
|
||||
rails_safe_tasks (1.0.0)
|
||||
railties (5.0.7.2)
|
||||
actionpack (= 5.0.7.2)
|
||||
activesupport (= 5.0.7.2)
|
||||
method_source
|
||||
rake (>= 0.8.7)
|
||||
thor (>= 0.18.1, < 2.0)
|
||||
rainbow (3.0.0)
|
||||
raindrops (0.19.1)
|
||||
rake (13.0.1)
|
||||
ransack (2.3.0)
|
||||
actionpack (>= 5.0)
|
||||
activerecord (>= 5.0)
|
||||
activesupport (>= 5.0)
|
||||
i18n
|
||||
polyamorous (= 2.3.0)
|
||||
rb-fsevent (0.10.4)
|
||||
rb-inotify (0.10.1)
|
||||
ffi (~> 1.0)
|
||||
redcarpet (3.5.0)
|
||||
regexp_parser (1.8.2)
|
||||
request_store (1.5.0)
|
||||
rack (>= 1.4)
|
||||
responders (2.4.1)
|
||||
actionpack (>= 4.2.0, < 6.0)
|
||||
railties (>= 4.2.0, < 6.0)
|
||||
rexml (3.2.4)
|
||||
roadie (3.5.1)
|
||||
css_parser (~> 1.4)
|
||||
nokogiri (~> 1.8)
|
||||
roadie-rails (1.3.0)
|
||||
railties (>= 3.0, < 5.3)
|
||||
roadie (~> 3.1)
|
||||
roo (2.8.3)
|
||||
nokogiri (~> 1)
|
||||
rubyzip (>= 1.3.0, < 3.0.0)
|
||||
rspec (3.10.0)
|
||||
rspec-core (~> 3.10.0)
|
||||
rspec-expectations (~> 3.10.0)
|
||||
rspec-mocks (~> 3.10.0)
|
||||
rspec-core (3.10.0)
|
||||
rspec-support (~> 3.10.0)
|
||||
rspec-expectations (3.10.0)
|
||||
diff-lcs (>= 1.2.0, < 2.0)
|
||||
rspec-support (~> 3.10.0)
|
||||
rspec-mocks (3.10.0)
|
||||
diff-lcs (>= 1.2.0, < 2.0)
|
||||
rspec-support (~> 3.10.0)
|
||||
rspec-rails (4.0.1)
|
||||
actionpack (>= 4.2)
|
||||
activesupport (>= 4.2)
|
||||
railties (>= 4.2)
|
||||
rspec-core (~> 3.9)
|
||||
rspec-expectations (~> 3.9)
|
||||
rspec-mocks (~> 3.9)
|
||||
rspec-support (~> 3.9)
|
||||
rspec-retry (0.6.2)
|
||||
rspec-core (> 3.3)
|
||||
rspec-support (3.10.0)
|
||||
rswag (2.3.1)
|
||||
rswag-api (= 2.3.1)
|
||||
rswag-specs (= 2.3.1)
|
||||
rswag-ui (= 2.3.1)
|
||||
rswag-api (2.3.1)
|
||||
railties (>= 3.1, < 7.0)
|
||||
rswag-specs (2.3.1)
|
||||
activesupport (>= 3.1, < 7.0)
|
||||
json-schema (~> 2.2)
|
||||
railties (>= 3.1, < 7.0)
|
||||
rswag-ui (2.3.1)
|
||||
actionpack (>= 3.1, < 7.0)
|
||||
railties (>= 3.1, < 7.0)
|
||||
rubocop (0.81.0)
|
||||
jaro_winkler (~> 1.5.1)
|
||||
parallel (~> 1.10)
|
||||
parser (>= 2.7.0.1)
|
||||
rainbow (>= 2.2.2, < 4.0)
|
||||
rexml
|
||||
ruby-progressbar (~> 1.7)
|
||||
unicode-display_width (>= 1.4.0, < 2.0)
|
||||
rubocop-rails (2.5.2)
|
||||
activesupport
|
||||
rack (>= 1.1)
|
||||
rubocop (>= 0.72.0)
|
||||
ruby-progressbar (1.10.1)
|
||||
ruby-rc4 (0.1.5)
|
||||
ruby2_keywords (0.0.2)
|
||||
rubyzip (1.3.0)
|
||||
sass (3.4.25)
|
||||
sass-rails (5.0.7)
|
||||
railties (>= 4.0.0, < 6)
|
||||
sass (~> 3.1)
|
||||
sprockets (>= 2.8, < 4.0)
|
||||
sprockets-rails (>= 2.0, < 4.0)
|
||||
tilt (>= 1.1, < 3)
|
||||
select2-rails (3.4.9)
|
||||
sass-rails
|
||||
thor (~> 0.14)
|
||||
selenium-webdriver (3.142.7)
|
||||
childprocess (>= 0.5, < 4.0)
|
||||
rubyzip (>= 1.2.2)
|
||||
shoulda-matchers (4.0.1)
|
||||
activesupport (>= 4.2.0)
|
||||
simplecov (0.17.1)
|
||||
docile (~> 1.1)
|
||||
json (>= 1.8, < 3)
|
||||
simplecov-html (~> 0.10.0)
|
||||
simplecov-html (0.10.2)
|
||||
sinatra (2.1.0)
|
||||
mustermann (~> 1.0)
|
||||
rack (~> 2.2)
|
||||
rack-protection (= 2.1.0)
|
||||
tilt (~> 2.0)
|
||||
spring (2.0.2)
|
||||
activesupport (>= 4.2)
|
||||
spring-commands-rspec (1.0.4)
|
||||
spring (>= 0.9.1)
|
||||
sprockets (3.7.2)
|
||||
concurrent-ruby (~> 1.0)
|
||||
rack (> 1, < 3)
|
||||
sprockets-rails (3.2.2)
|
||||
actionpack (>= 4.0)
|
||||
activesupport (>= 4.0)
|
||||
sprockets (>= 3.0.0)
|
||||
state_machines (0.5.0)
|
||||
state_machines-activemodel (0.7.1)
|
||||
activemodel (>= 4.1)
|
||||
state_machines (>= 0.5.0)
|
||||
state_machines-activerecord (0.6.0)
|
||||
activerecord (>= 4.1)
|
||||
state_machines-activemodel (>= 0.5.0)
|
||||
stringex (2.8.5)
|
||||
stripe (5.28.0)
|
||||
temple (0.8.2)
|
||||
test-prof (0.7.5)
|
||||
test-unit (3.3.7)
|
||||
power_assert
|
||||
thor (0.20.3)
|
||||
thread_safe (0.3.6)
|
||||
tilt (2.0.10)
|
||||
timecop (0.9.2)
|
||||
tzinfo (1.2.8)
|
||||
thread_safe (~> 0.1)
|
||||
uglifier (4.2.0)
|
||||
execjs (>= 0.3.0, < 3)
|
||||
unicode-display_width (1.7.0)
|
||||
unicorn (5.7.0)
|
||||
kgio (~> 2.6)
|
||||
raindrops (~> 0.7)
|
||||
unicorn-rails (2.2.1)
|
||||
rack
|
||||
unicorn
|
||||
unicorn-worker-killer (0.4.4)
|
||||
get_process_mem (~> 0)
|
||||
unicorn (>= 4, < 6)
|
||||
warden (1.2.9)
|
||||
rack (>= 2.0.9)
|
||||
webdrivers (4.2.0)
|
||||
nokogiri (~> 1.6)
|
||||
rubyzip (>= 1.3.0)
|
||||
selenium-webdriver (>= 3.0, < 4.0)
|
||||
webmock (3.10.0)
|
||||
addressable (>= 2.3.6)
|
||||
crack (>= 0.3.2)
|
||||
hashdiff (>= 0.4.0, < 2.0.0)
|
||||
websocket-driver (0.6.5)
|
||||
websocket-extensions (>= 0.1.0)
|
||||
websocket-extensions (0.1.5)
|
||||
whenever (1.0.0)
|
||||
chronic (>= 0.6.3)
|
||||
wicked_pdf (2.1.0)
|
||||
activesupport
|
||||
wkhtmltopdf-binary (0.12.6.5)
|
||||
xml-simple (1.1.5)
|
||||
xpath (3.2.0)
|
||||
nokogiri (~> 1.8)
|
||||
|
||||
PLATFORMS
|
||||
ruby
|
||||
|
||||
DEPENDENCIES
|
||||
actionpack-action_caching
|
||||
active_model_serializers (= 0.8.4)
|
||||
activemerchant (>= 1.78.0)
|
||||
activerecord-import
|
||||
activerecord-postgresql-adapter
|
||||
activerecord-session_store
|
||||
acts-as-taggable-on (~> 4.0)
|
||||
acts_as_list (= 0.9.19)
|
||||
andand
|
||||
angular-rails-templates (>= 0.3.0)
|
||||
angular_rails_csrf
|
||||
angularjs-file-upload-rails (~> 2.4.1)
|
||||
angularjs-rails (= 1.5.5)
|
||||
atomic
|
||||
awesome_nested_set
|
||||
awesome_print
|
||||
aws-sdk (= 1.67.0)
|
||||
bugsnag
|
||||
byebug
|
||||
cancancan (~> 1.7.0)
|
||||
capybara
|
||||
catalog!
|
||||
coffee-rails (~> 4.2.2)
|
||||
combine_pdf
|
||||
compass-rails
|
||||
custom_error_message!
|
||||
daemons
|
||||
dalli
|
||||
database_cleaner
|
||||
ddtrace
|
||||
debugger-linecache
|
||||
delayed_job_active_record
|
||||
delayed_job_web
|
||||
devise
|
||||
devise-encryptable
|
||||
devise-token_authenticatable
|
||||
dfc_provider!
|
||||
eventmachine (>= 1.2.3)
|
||||
factory_bot_rails (= 5.2.0)
|
||||
ffaker
|
||||
figaro
|
||||
foundation-icons-sass-rails
|
||||
foundation-rails (= 5.5.2.1)
|
||||
fuubar (~> 2.5.1)
|
||||
geocoder
|
||||
gmaps4rails
|
||||
haml
|
||||
highline (= 2.0.3)
|
||||
i18n
|
||||
i18n-js (~> 3.8.0)
|
||||
immigrant
|
||||
jquery-migrate-rails
|
||||
jquery-rails (= 4.4.0)
|
||||
jquery-ui-rails (~> 4.2)
|
||||
json
|
||||
json_spec (~> 1.1.4)
|
||||
jwt (~> 2.2)
|
||||
kaminari (~> 1.2.1)
|
||||
knapsack
|
||||
letter_opener (>= 1.4.1)
|
||||
libv8 (< 8)
|
||||
mini_racer (= 0.2.15)
|
||||
monetize (~> 1.1)
|
||||
oauth2 (~> 1.4.4)
|
||||
ofn-qz!
|
||||
order_management!
|
||||
paper_trail (~> 10.3.1)
|
||||
paperclip (~> 3.4.1)
|
||||
paranoia (~> 2.4)
|
||||
paypal-sdk-merchant (= 1.106.1)
|
||||
pg (~> 0.21.0)
|
||||
pry
|
||||
pry-byebug
|
||||
rack-mini-profiler (< 3.0.0)
|
||||
rack-rewrite
|
||||
rack-ssl
|
||||
rails (> 5.0, < 5.1)
|
||||
rails-i18n
|
||||
rails_safe_tasks (~> 1.0)
|
||||
ransack (= 2.3.0)
|
||||
redcarpet
|
||||
responders
|
||||
roadie-rails (~> 1.3.0)
|
||||
roo (~> 2.8.3)
|
||||
rspec-rails (>= 3.5.2)
|
||||
rspec-retry
|
||||
rswag
|
||||
rubocop
|
||||
rubocop-rails
|
||||
sass (<= 4.7.1)
|
||||
sass-rails (< 6.0.0)
|
||||
select2-rails (~> 3.4.7)
|
||||
selenium-webdriver
|
||||
shoulda-matchers
|
||||
simplecov
|
||||
spring
|
||||
spring-commands-rspec
|
||||
state_machines-activerecord
|
||||
stringex (~> 2.8.5)
|
||||
stripe
|
||||
test-prof
|
||||
test-unit (~> 3.3)
|
||||
timecop
|
||||
uglifier (>= 1.0.3)
|
||||
unicorn-rails
|
||||
unicorn-worker-killer
|
||||
web!
|
||||
webdrivers
|
||||
webmock
|
||||
whenever
|
||||
wicked_pdf
|
||||
wkhtmltopdf-binary
|
||||
|
||||
RUBY VERSION
|
||||
ruby 2.4.4p296
|
||||
|
||||
BUNDLED WITH
|
||||
1.17.3
|
||||
@@ -1,5 +1,4 @@
|
||||
[](https://github.com/openfoodfoundation/openfoodnetwork/actions/workflows/build.yml)
|
||||
[](https://codecov.io/gh/openfoodfoundation/openfoodnetwork)
|
||||
[](https://semaphoreci.com/openfoodfoundation/openfoodnetwork-2)
|
||||
[](https://codeclimate.com/github/openfoodfoundation/openfoodnetwork)
|
||||
|
||||
# Open Food Network
|
||||
@@ -34,7 +33,7 @@ We also have a [Super Admin Guide][super-admin-guide] to help with configuration
|
||||
|
||||
## Testing
|
||||
|
||||
If you'd like to help out with testing, please introduce yourself on the #testing channel on [Slack][slack-invite] and download the [ZenHub browser extension][zenhub] to view the development pipeline. Also, do have a look in our [Welcome New QAs board](https://github.com/openfoodfoundation/openfoodnetwork/projects/31) for some good first issues, both on manual and automated testing (RSpec/Capybara).
|
||||
If you'd like to help out with testing, please introduce yourself on the #testing channel on [Slack][slack-invite] and download the [ZenHub browser extension][zenhub] to view the development pipeline.
|
||||
|
||||
We use [BrowserStack](https://www.browserstack.com/) as a manual testing tool. BrowserStack provides open source projects with unlimited and free of charge accounts. A big thanks to them!
|
||||
|
||||
|
||||
4
Rakefile
@@ -8,6 +8,4 @@ require_relative 'config/application'
|
||||
|
||||
Openfoodnetwork::Application.load_tasks
|
||||
|
||||
unless ENV['DISABLE_KNAPSACK']
|
||||
Knapsack.load_tasks if defined?(Knapsack)
|
||||
end
|
||||
Knapsack.load_tasks if defined?(Knapsack)
|
||||
|
||||
|
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 6.1 KiB |
|
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 6.1 KiB |
|
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 6.1 KiB |
|
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 6.1 KiB |
|
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.5 KiB |
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.5 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
@@ -1 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50"><circle cx="24.87" cy="24.87" r="24" fill="#f4f9fd" stroke="#cfe1f3" stroke-miterlimit="10"/><path d="M36.31 18.13c0 7.51-8.11 7.63-8.11 10.4v.71c0 .74-.6 1.34-1.34 1.34h-5.11c-.74 0-1.34-.6-1.34-1.34v-.97c0-4 3.04-5.61 5.33-6.89 1.97-1.1 3.17-1.85 3.17-3.31 0-1.93-2.46-3.21-4.46-3.21-2.6 0-3.8 1.23-5.48 3.36-.45.57-1.28.68-1.87.24l-3.12-2.36a1.35 1.35 0 01-.3-1.83c2.65-3.89 6.02-6.07 11.27-6.07 5.49-.02 11.36 4.27 11.36 9.93zM29 36.86c0 2.59-2.11 4.71-4.71 4.71s-4.71-2.11-4.71-4.71c0-2.59 2.11-4.71 4.71-4.71S29 34.27 29 36.86z" fill="#81b2e1"/></svg>
|
||||
|
Before Width: | Height: | Size: 618 B |
@@ -10,6 +10,7 @@
|
||||
//= require jquery-migrate-min
|
||||
//= require jquery_ujs
|
||||
//= require jquery.ui.all
|
||||
//= require jquery-ui-timepicker-addon
|
||||
//= require jquery.powertip
|
||||
//= require jquery.cookie
|
||||
//= require jquery.jstree/jquery.jstree
|
||||
@@ -23,24 +24,6 @@
|
||||
//= require angular-rails-templates
|
||||
//= require lodash.underscore.js
|
||||
|
||||
// datetimepicker (fil, nb)
|
||||
//= require flatpickr/dist/flatpickr.min
|
||||
//= require flatpickr/dist/l10n/ar
|
||||
//= require flatpickr/dist/l10n/cat
|
||||
//= require flatpickr/dist/l10n/cy
|
||||
//= require flatpickr/dist/l10n/de
|
||||
//= require flatpickr/dist/l10n/es
|
||||
//= require flatpickr/dist/l10n/fr
|
||||
//= require flatpickr/dist/l10n/it
|
||||
//= require flatpickr/dist/l10n/nl
|
||||
//= require flatpickr/dist/l10n/pl
|
||||
//= require flatpickr/dist/l10n/pt
|
||||
//= require flatpickr/dist/l10n/ru
|
||||
//= require flatpickr/dist/l10n/sv
|
||||
//= require flatpickr/dist/l10n/tr
|
||||
//= require shortcut-buttons-flatpickr/dist/shortcut-buttons-flatpickr.min
|
||||
//= require flatpickr/dist/plugins/labelPlugin/labelPlugin
|
||||
|
||||
// spree
|
||||
//= require admin/spree/spree
|
||||
//= require admin/spree/spree-select2
|
||||
@@ -52,9 +35,6 @@
|
||||
//= require admin/spree/handlebar_extensions
|
||||
|
||||
// OFN specific
|
||||
//= require ../shared/shared
|
||||
//= require_tree ../shared/directives
|
||||
//= require_tree ../templates/shared
|
||||
//= require_tree ../templates/admin
|
||||
//= require ./admin_ofn
|
||||
//= require ./customers/customers
|
||||
|
||||
@@ -21,7 +21,6 @@ angular.module("ofn.admin").controller "AdminProductEditCtrl", ($scope, $timeout
|
||||
sorting: ""
|
||||
}
|
||||
|
||||
$scope.sorting = "name asc"
|
||||
$scope.producers = producers
|
||||
$scope.taxons = Taxons.all
|
||||
$scope.tax_categories = tax_categories
|
||||
@@ -49,7 +48,7 @@ angular.module("ofn.admin").controller "AdminProductEditCtrl", ($scope, $timeout
|
||||
'q[name_cont]': $scope.q.query,
|
||||
'q[supplier_id_eq]': $scope.q.producerFilter,
|
||||
'q[primary_taxon_id_eq]': $scope.q.categoryFilter,
|
||||
'q[s]': $scope.sorting,
|
||||
'q[s]': $scope.q.sorting,
|
||||
import_date: $scope.q.importDateFilter,
|
||||
page: $scope.page,
|
||||
per_page: $scope.per_page
|
||||
@@ -105,7 +104,7 @@ angular.module("ofn.admin").controller "AdminProductEditCtrl", ($scope, $timeout
|
||||
$scope.$watch 'sortOptions', (sort) ->
|
||||
return unless sort && sort.predicate != ""
|
||||
|
||||
$scope.sorting = sort.getSortingExpr(defaultDirection: "asc")
|
||||
$scope.q.sorting = sort.getSortingExpr()
|
||||
$scope.fetchProducts()
|
||||
, true
|
||||
|
||||
@@ -147,7 +146,7 @@ angular.module("ofn.admin").controller "AdminProductEditCtrl", ($scope, $timeout
|
||||
if confirm("Are you sure?")
|
||||
$http(
|
||||
method: "DELETE"
|
||||
url: "/api/v0/products/" + product.id
|
||||
url: "/api/products/" + product.id
|
||||
).success (data) ->
|
||||
$scope.products.splice $scope.products.indexOf(product), 1
|
||||
DirtyProducts.deleteProduct product.id
|
||||
@@ -162,7 +161,7 @@ angular.module("ofn.admin").controller "AdminProductEditCtrl", ($scope, $timeout
|
||||
if confirm(t("are_you_sure"))
|
||||
$http(
|
||||
method: "DELETE"
|
||||
url: "/api/v0/products/" + product.permalink_live + "/variants/" + variant.id
|
||||
url: "/api/products/" + product.permalink_live + "/variants/" + variant.id
|
||||
).success (data) ->
|
||||
$scope.removeVariant(product, variant)
|
||||
else
|
||||
@@ -217,7 +216,6 @@ angular.module("ofn.admin").controller "AdminProductEditCtrl", ($scope, $timeout
|
||||
'q[name_cont]': $scope.q.query
|
||||
'q[supplier_id_eq]': $scope.q.producerFilter
|
||||
'q[primary_taxon_id_eq]': $scope.q.categoryFilter
|
||||
'q[s]': $scope.sorting
|
||||
import_date: $scope.q.importDateFilter
|
||||
page: $scope.page
|
||||
per_page: $scope.per_page
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
angular.module("ofn.admin").directive "datepicker", ->
|
||||
require: "ngModel"
|
||||
link: (scope, element, attrs, ngModel) ->
|
||||
element.datepicker
|
||||
dateFormat: "yy-mm-dd"
|
||||
onSelect: (dateText, inst) ->
|
||||
scope.$apply (scope) ->
|
||||
# Fires ngModel.$parsers
|
||||
ngModel.$setViewValue dateText
|
||||
@@ -0,0 +1,11 @@
|
||||
angular.module("ofn.admin").directive "datetimepicker", ->
|
||||
require: "ngModel"
|
||||
link: (scope, element, attrs, ngModel) ->
|
||||
element.datetimepicker
|
||||
dateFormat: "yy-mm-dd"
|
||||
timeFormat: "HH:mm:ss"
|
||||
stepMinute: 15
|
||||
onSelect: (dateText, inst) ->
|
||||
scope.$apply (scope) ->
|
||||
# Fires ngModel.$parsers
|
||||
ngModel.$setViewValue dateText
|
||||
@@ -1,7 +1,7 @@
|
||||
angular.module('admin.enterpriseFees').directive 'spreeDeleteResource', ->
|
||||
(scope, element, attrs) ->
|
||||
if scope.enterprise_fee.id
|
||||
url = '/api/v0/enterprise_fees/' + scope.enterprise_fee.id
|
||||
url = '/api/enterprise_fees/' + scope.enterprise_fee.id
|
||||
html = '<a href="' + url + '" class="delete-resource icon_link icon-trash no-text" data-action="remove" data-confirm="' + t('are_you_sure') + '" url="' + url + '"></a>'
|
||||
#var html = '<a href="'+url+'" class="delete-resource" data-confirm="Are you sure?"><img alt="Delete" src="/assets/admin/icons/delete.png" /> Delete</a>';
|
||||
element.append html
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
angular.module("admin.indexUtils").factory "resources", ($resource) ->
|
||||
LineItem = $resource '/api/v0/orders/:order_number/line_items/:line_item_id.json',
|
||||
LineItem = $resource '/api/orders/:order_number/line_items/:line_item_id.json',
|
||||
{ order_number: '@order_number', line_item_id: '@line_item_id'},
|
||||
'update': { method: 'PUT' }
|
||||
Customer = $resource '/admin/customers/:customer_id.json',
|
||||
|
||||
@@ -3,11 +3,9 @@ angular.module("admin.indexUtils").factory 'SortOptions', ->
|
||||
predicate: ""
|
||||
reverse: true
|
||||
|
||||
getSortingExpr: (options) ->
|
||||
defaultDirection = if (options && options.defaultDirection) then options.defaultDirection else "desc"
|
||||
reverseDirection = if defaultDirection == "desc" then "asc" else "desc"
|
||||
sortingExpr = this.predicate + ' ' + defaultDirection if this.reverse
|
||||
sortingExpr = this.predicate + ' ' + reverseDirection if !this.reverse
|
||||
getSortingExpr: () ->
|
||||
sortingExpr = this.predicate + ' desc' if this.reverse
|
||||
sortingExpr = this.predicate + ' asc' if !this.reverse
|
||||
sortingExpr
|
||||
|
||||
toggle: (predicate) ->
|
||||
|
||||
@@ -3,12 +3,21 @@ angular.module('admin.orderCycles', ['ngTagsInput', 'admin.indexUtils', 'admin.e
|
||||
require: "ngModel"
|
||||
link: (scope, element, attrs, ngModel) ->
|
||||
$timeout ->
|
||||
flatpickr(element, Object.assign({},
|
||||
window.FLATPICKR_DATETIME_DEFAULT, {
|
||||
onOpen: (selectedDates, dateStr, instance) ->
|
||||
instance.setDate(ngModel.$modelValue)
|
||||
instance.input.dispatchEvent(new Event('focus', { bubbles: true }));
|
||||
}));
|
||||
# using $parse instead of scope[attrs.datetimepicker] for cases
|
||||
# where attrs.datetimepicker is 'foo.bar.lol'
|
||||
$(element).datetimepicker(
|
||||
Object.assign(
|
||||
window.JQUERY_UI_DATETIME_PICKER_DEFAULTS,
|
||||
{
|
||||
onSelect: (dateText, inst) ->
|
||||
scope.$apply(->
|
||||
element.val(dateText)
|
||||
parsed = $parse(attrs.datetimepicker)
|
||||
parsed.assign(scope, dateText)
|
||||
)
|
||||
}
|
||||
)
|
||||
)
|
||||
|
||||
.directive 'ofnOnChange', ->
|
||||
(scope, element, attrs) ->
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
angular.module('admin.orderCycles').factory('ExchangeProduct', ($resource) ->
|
||||
ExchangeProductResource = $resource('/api/v0/exchanges/:exchange_id/products.json', {}, {
|
||||
ExchangeProductResource = $resource('/api/exchanges/:exchange_id/products.json', {}, {
|
||||
'index': { method: 'GET' }
|
||||
'variant_count': { method: 'GET', params: { action_name: "variant_count" }}
|
||||
})
|
||||
|
||||
@@ -9,7 +9,7 @@ angular.module("admin.products").controller "editUnitsCtrl", ($scope, VariantUni
|
||||
if $scope.product.variant_unit == 'items'
|
||||
$scope.variant_unit_with_scale = 'items'
|
||||
else
|
||||
$scope.variant_unit_with_scale = $scope.product.variant_unit + '_' + $scope.product.variant_unit_scale.replace(/\.0$/, '');
|
||||
$scope.variant_unit_with_scale = $scope.product.variant_unit + '_' + $scope.product.variant_unit_scale
|
||||
|
||||
$scope.setFields = ->
|
||||
if $scope.variant_unit_with_scale == 'items'
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
angular.module("admin.products")
|
||||
.controller "unitsCtrl", ($scope, VariantUnitManager, OptionValueNamer, UnitPrices) ->
|
||||
.controller "unitsCtrl", ($scope, VariantUnitManager, OptionValueNamer) ->
|
||||
$scope.product = { master: {} }
|
||||
$scope.product.master.product = $scope.product
|
||||
$scope.placeholder_text = ""
|
||||
|
||||
$scope.$watchCollection '[product.variant_unit_with_scale, product.master.unit_value_with_description, product.price, product.variant_unit_name]', ->
|
||||
$scope.$watchCollection '[product.variant_unit_with_scale, product.master.unit_value_with_description]', ->
|
||||
$scope.processVariantUnitWithScale()
|
||||
$scope.processUnitValueWithDescription()
|
||||
$scope.processUnitPrice()
|
||||
$scope.placeholder_text = new OptionValueNamer($scope.product.master).name()
|
||||
|
||||
$scope.variant_unit_options = VariantUnitManager.variantUnitOptions()
|
||||
@@ -33,14 +32,6 @@ angular.module("admin.products")
|
||||
$scope.product.master.unit_value *= $scope.product.variant_unit_scale if $scope.product.master.unit_value && $scope.product.variant_unit_scale
|
||||
$scope.product.master.unit_description = match[3]
|
||||
|
||||
$scope.processUnitPrice = ->
|
||||
price = $scope.product.price
|
||||
scale = $scope.product.variant_unit_scale
|
||||
unit_type = $scope.product.variant_unit
|
||||
unit_value = $scope.product.master.unit_value
|
||||
variant_unit_name = $scope.product.variant_unit_name
|
||||
$scope.unit_price = UnitPrices.displayableUnitPrice(price, scale, unit_type, unit_value, variant_unit_name)
|
||||
|
||||
$scope.hasVariants = (product) ->
|
||||
Object.keys(product.variants).length > 0
|
||||
|
||||
|
||||
@@ -1,24 +1,8 @@
|
||||
angular.module("admin.products").controller "variantUnitsCtrl", ($scope, VariantUnitManager, $timeout, UnitPrices) ->
|
||||
angular.module("admin.products").controller "variantUnitsCtrl", ($scope, VariantUnitManager, $timeout) ->
|
||||
|
||||
$scope.unitName = (scale, type) ->
|
||||
VariantUnitManager.getUnitName(scale, type)
|
||||
|
||||
$scope.$watchCollection "[unit_value_human, variant.price]", ->
|
||||
$scope.processUnitPrice()
|
||||
|
||||
$scope.processUnitPrice = ->
|
||||
if ($scope.variant)
|
||||
price = $scope.variant.price
|
||||
scale = $scope.scale
|
||||
unit_type = angular.element("#product_variant_unit").val()
|
||||
if (unit_type != "items")
|
||||
$scope.updateValue()
|
||||
unit_value = $scope.unit_value
|
||||
else
|
||||
unit_value = 1
|
||||
variant_unit_name = angular.element("#product_variant_unit_name").val()
|
||||
$scope.unit_price = UnitPrices.displayableUnitPrice(price, scale, unit_type, unit_value, variant_unit_name)
|
||||
|
||||
$scope.scale = angular.element('#product_variant_unit_scale').val()
|
||||
|
||||
$scope.updateValue = ->
|
||||
@@ -27,6 +11,4 @@ angular.module("admin.products").controller "variantUnitsCtrl", ($scope, Variant
|
||||
|
||||
variant_unit_value = angular.element('#variant_unit_value').val()
|
||||
$scope.unit_value_human = variant_unit_value / $scope.scale
|
||||
|
||||
$timeout -> $scope.processUnitPrice()
|
||||
$timeout -> $scope.updateValue()
|
||||
|
||||
@@ -1 +1 @@
|
||||
angular.module("admin.products", ["textAngular", "admin.utils", "OFNShared"])
|
||||
angular.module("admin.products", ["textAngular", "admin.utils"])
|
||||
|
||||
@@ -8,7 +8,7 @@ angular.module("ofn.admin").factory "ProductImageService", (FileUploader, SpreeA
|
||||
autoUpload: true
|
||||
|
||||
configure: (product) =>
|
||||
@imageUploader.url = "/api/v0/product_images/#{product.id}"
|
||||
@imageUploader.url = "/api/product_images/#{product.id}"
|
||||
@imagePreview = product.image_url
|
||||
@imageUploader.onSuccessItem = (image, response) =>
|
||||
product.thumb_url = response.thumb_url
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
angular.module("admin.products").factory "UnitPrices", (VariantUnitManager, localizeCurrencyFilter) ->
|
||||
class UnitPrices
|
||||
@displayableUnitPrice: (price, scale, unit_type, unit_value, variant_unit_name) ->
|
||||
if price && !isNaN(price) && unit_type && unit_value
|
||||
value = localizeCurrencyFilter(UnitPrices.price(price, scale, unit_type, unit_value, variant_unit_name))
|
||||
unit = UnitPrices.unit(scale, unit_type, variant_unit_name)
|
||||
return value + " / " + unit
|
||||
return null
|
||||
|
||||
@price: (price, scale, unit_type, unit_value) ->
|
||||
price / @denominator(scale, unit_type, unit_value)
|
||||
|
||||
@denominator: (scale, unit_type, unit_value) ->
|
||||
unit = @unit(scale, unit_type)
|
||||
if unit == "lb"
|
||||
unit_value / 453.6
|
||||
else if unit == "kg"
|
||||
unit_value / 1000
|
||||
else
|
||||
unit_value
|
||||
|
||||
@unit: (scale, unit_type, variant_unit_name = '') ->
|
||||
if variant_unit_name.length > 0
|
||||
variant_unit_name
|
||||
else if unit_type == "items"
|
||||
"item"
|
||||
else if VariantUnitManager.systemOfMeasurement(scale, unit_type) == "imperial"
|
||||
"lb"
|
||||
else if unit_type == "weight"
|
||||
"kg"
|
||||
else if unit_type == "volume"
|
||||
"L"
|
||||
@@ -67,9 +67,3 @@ angular.module("admin.products").factory "VariantUnitManager", (availableUnits)
|
||||
scaleSystem = @units[unitType][scale]['system']
|
||||
(parseFloat(scale) for scale, scaleInfo of @units[unitType] when scaleInfo['system'] == scaleSystem).sort (a, b) ->
|
||||
a - b
|
||||
|
||||
@systemOfMeasurement: (scale, unitType) ->
|
||||
if @units[unitType][scale]
|
||||
@units[unitType][scale]['system']
|
||||
else
|
||||
'custom'
|
||||
|
||||
@@ -9,12 +9,12 @@ angular.module("admin.resources").factory 'EnterpriseResource', ($resource) ->
|
||||
'update':
|
||||
method: 'PUT'
|
||||
'removeLogo':
|
||||
url: '/api/v0/enterprises/:id/logo.json'
|
||||
url: '/api/enterprises/:id/logo.json'
|
||||
method: 'DELETE'
|
||||
'removePromoImage':
|
||||
url: '/api/v0/enterprises/:id/promo_image.json'
|
||||
url: '/api/enterprises/:id/promo_image.json'
|
||||
method: 'DELETE'
|
||||
'removeTermsAndConditions':
|
||||
url: '/api/v0/enterprises/:id/terms_and_conditions.json'
|
||||
url: '/api/enterprises/:id/terms_and_conditions.json'
|
||||
method: 'DELETE'
|
||||
})
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
angular.module("admin.resources").factory 'OrderResource', ($resource) ->
|
||||
$resource('/admin/orders/:id/:action.json', {}, {
|
||||
'index':
|
||||
url: '/api/v0/orders.json'
|
||||
url: '/api/orders.json'
|
||||
method: 'GET'
|
||||
'update':
|
||||
method: 'PUT'
|
||||
'capture':
|
||||
url: '/api/v0/orders/:id/capture.json'
|
||||
url: '/api/orders/:id/capture.json'
|
||||
method: 'PUT'
|
||||
params:
|
||||
id: '@id'
|
||||
'ship':
|
||||
url: '/api/v0/orders/:id/ship.json'
|
||||
url: '/api/orders/:id/ship.json'
|
||||
method: 'PUT'
|
||||
params:
|
||||
id: '@id'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
angular.module("admin.resources").factory 'ProductResource', ($resource) ->
|
||||
$resource('/admin/product/:id/:action.json', {}, {
|
||||
'index':
|
||||
url: '/api/v0/products/bulk_products.json'
|
||||
url: '/api/products/bulk_products.json'
|
||||
method: 'GET'
|
||||
})
|
||||
|
||||
@@ -10,8 +10,8 @@ angular.module("ofn.admin").factory "BulkProducts", (ProductResource, dataFetche
|
||||
angular.extend(@pagination, data.pagination)
|
||||
|
||||
cloneProduct: (product) ->
|
||||
$http.post("/api/v0/products/" + product.id + "/clone").success (data) =>
|
||||
dataFetcher("/api/v0/products/" + data.id + "?template=bulk_show").then (newProduct) =>
|
||||
$http.post("/api/products/" + product.id + "/clone").success (data) =>
|
||||
dataFetcher("/api/products/" + data.id + "?template=bulk_show").then (newProduct) =>
|
||||
@unpackProduct newProduct
|
||||
@insertProductAfter(product, newProduct)
|
||||
|
||||
|
||||
@@ -98,6 +98,40 @@ $.fn.radioControlsVisibilityOfElement = function(dependentElementSelector){
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
if (typeof Spree !== 'undefined' &&
|
||||
typeof Spree.translations !== 'undefined') {
|
||||
handle_date_picker_fields = function(){
|
||||
$('.datepicker').datepicker({
|
||||
dateFormat: Spree.translations.date_picker,
|
||||
dayNames: Spree.translations.abbr_day_names,
|
||||
dayNamesMin: Spree.translations.abbr_day_names,
|
||||
monthNames: Spree.translations.month_names,
|
||||
prevText: Spree.translations.previous,
|
||||
nextText: Spree.translations.next,
|
||||
showOn: "focus"
|
||||
});
|
||||
|
||||
$.datepicker.regional[I18n.locale] = {
|
||||
prevText: Spree.translations.previous,
|
||||
nextText: Spree.translations.next,
|
||||
monthNames: Spree.translations.month_names,
|
||||
dayNames: Spree.translations.abbr_day_names,
|
||||
dayNamesMin: Spree.translations.abbr_day_names,
|
||||
dateFormat: Spree.translations.date_picker
|
||||
};
|
||||
$.datepicker.setDefaults( $.datepicker.regional[I18n.locale]);
|
||||
// Correctly display range dates
|
||||
$('.date-range-filter .datepicker-from').datepicker('option', 'onSelect', function(selectedDate) {
|
||||
$(".date-range-filter .datepicker-to" ).datepicker( "option", "minDate", selectedDate );
|
||||
});
|
||||
$('.date-range-filter .datepicker-to').datepicker('option', 'onSelect', function(selectedDate) {
|
||||
$(".date-range-filter .datepicker-from" ).datepicker( "option", "maxDate", selectedDate );
|
||||
});
|
||||
}
|
||||
|
||||
handle_date_picker_fields();
|
||||
}
|
||||
|
||||
$(".observe_field").on('change', function() {
|
||||
target = $(this).attr("data-update");
|
||||
ajax_indicator = $(this).attr("data-ajax-indicator") || '#busy_indicator';
|
||||
|
||||
@@ -23,6 +23,8 @@ angular.module("admin.tagRules").controller "TagRulesCtrl", ($scope, $http, $fil
|
||||
preferred_customer_tags: (tag.text for tag in tagGroup.tags).join(",")
|
||||
type: "TagRule::#{ruleType}"
|
||||
switch ruleType
|
||||
when "DiscountOrder"
|
||||
newRule.calculator = { preferred_flat_percent: 0 }
|
||||
when "FilterShippingMethods"
|
||||
newRule.peferred_shipping_method_tags = []
|
||||
newRule.preferred_matched_shipping_methods_visibility = "visible"
|
||||
|
||||
@@ -8,6 +8,7 @@ angular.module("admin.tagRules").directive 'newTagRuleDialog', ($compile, $templ
|
||||
template = $compile($templateCache.get('admin/new_tag_rule_dialog.html'))(scope)
|
||||
|
||||
scope.ruleTypes = [
|
||||
# { id: "DiscountOrder", name: 'Apply a discount to orders' }
|
||||
{ id: "FilterProducts", name: t('js.tag_rules.show_hide_variants') }
|
||||
{ id: "FilterShippingMethods", name: t('js.tag_rules.show_hide_shipping') }
|
||||
{ id: "FilterPaymentMethods", name: t('js.tag_rules.show_hide_payment') }
|
||||
|
||||
@@ -1,51 +1,30 @@
|
||||
$(document).ready(function() {
|
||||
var onClickButtons = function(index, fp) {
|
||||
var date;
|
||||
switch (index) {
|
||||
case 0:
|
||||
date = new Date();
|
||||
break;
|
||||
}
|
||||
fp.setDate(date, true);
|
||||
$(document).ready(function(){
|
||||
window.JQUERY_UI_DATE_PICKER_DEFAULTS = {
|
||||
dateFormat: Spree.translations.date_picker,
|
||||
dayNames: Spree.translations.abbr_day_names,
|
||||
dayNamesMin: Spree.translations.abbr_day_names,
|
||||
monthNames: Spree.translations.month_names,
|
||||
prevText: Spree.translations.previous,
|
||||
nextText: Spree.translations.next,
|
||||
oneLine: true,
|
||||
showOn: 'button',
|
||||
buttonImage: "<%= asset_path 'datepicker/cal.gif' %>",
|
||||
buttonImageOnly: true
|
||||
}
|
||||
window.FLATPICKR_DATE_DEFAULT = {
|
||||
altInput: true,
|
||||
altFormat: Spree.translations.flatpickr_date_format,
|
||||
dateFormat: "Y-m-d",
|
||||
locale: I18n.locale,
|
||||
plugins: [
|
||||
ShortcutButtonsPlugin({
|
||||
button: [{
|
||||
label: Spree.translations.today
|
||||
}],
|
||||
label: "or",
|
||||
onClick: onClickButtons
|
||||
}),
|
||||
labelPlugin({})
|
||||
]
|
||||
}
|
||||
window.FLATPICKR_DATETIME_DEFAULT = Object.assign(
|
||||
|
||||
window.JQUERY_UI_DATETIME_PICKER_DEFAULTS = Object.assign(
|
||||
{},
|
||||
window.FLATPICKR_DATE_DEFAULT,
|
||||
window.JQUERY_UI_DATE_PICKER_DEFAULTS,
|
||||
{
|
||||
altInput: true,
|
||||
altFormat: Spree.translations.flatpickr_datetime_format,
|
||||
dateFormat: "Y-m-d H:i",
|
||||
enableTime: true,
|
||||
time_24hr: true,
|
||||
plugins: [
|
||||
ShortcutButtonsPlugin({
|
||||
button: [{
|
||||
label: Spree.translations.now
|
||||
}],
|
||||
label: "or",
|
||||
onClick: onClickButtons
|
||||
}),
|
||||
labelPlugin({})
|
||||
]
|
||||
currentText: Spree.translations.datetime_ui_current_text,
|
||||
closeText: Spree.translations.datetime_ui_close_text,
|
||||
timeText: Spree.translations.datetime_ui_time_text,
|
||||
timeFormat: 'HH:mm',
|
||||
controlType: 'select',
|
||||
stepMinute: 15
|
||||
}
|
||||
);
|
||||
flatpickr(".datetimepicker", window.FLATPICKR_DATETIME_DEFAULT);
|
||||
$('.datetimepicker').datetimepicker(window.JQUERY_UI_DATETIME_PICKER_DEFAULTS);
|
||||
$('a.close').click(function(event){
|
||||
event.preventDefault();
|
||||
$(this).parent().slideUp(250);
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
angular.module("admin.utils").directive "datepicker", ($window, $timeout) ->
|
||||
angular.module("admin.utils").directive "datepicker", ->
|
||||
require: "ngModel"
|
||||
link: (scope, element, attrs, ngModel) ->
|
||||
$timeout ->
|
||||
flatpickr(element, Object.assign(
|
||||
{},
|
||||
$window.FLATPICKR_DATE_DEFAULT, {
|
||||
onOpen: (selectedDates, dateStr, instance) ->
|
||||
instance.setDate(ngModel.$modelValue)
|
||||
}
|
||||
));
|
||||
element.datepicker
|
||||
dateFormat: "yy-mm-dd"
|
||||
onSelect: (dateText, inst) ->
|
||||
scope.$apply (scope) ->
|
||||
# Fires ngModel.$parsers
|
||||
ngModel.$setViewValue dateText
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
angular.module("admin.utils").factory "StatusMessage", ->
|
||||
angular.module("admin.utils").factory "StatusMessage", ($timeout) ->
|
||||
new class StatusMessage
|
||||
types:
|
||||
progress: {style: {color: '#ff9906'}}
|
||||
alert: {style: {color: 'grey'}}
|
||||
notice: {style: {color: 'grey'}}
|
||||
success: {style: {color: '#9fc820'}}
|
||||
failure: {style: {color: '#da5354'}}
|
||||
progress: {timeout: false, style: {color: '#ff9906'}}
|
||||
alert: {timeout: 5000, style: {color: 'grey'}}
|
||||
notice: {timeout: false, style: {color: 'grey'}}
|
||||
success: {timeout: 5000, style: {color: '#9fc820'}}
|
||||
failure: {timeout: false, style: {color: '#da5354'}}
|
||||
|
||||
statusMessage:
|
||||
text: ""
|
||||
@@ -25,7 +25,13 @@ angular.module("admin.utils").factory "StatusMessage", ->
|
||||
display: (type, text) ->
|
||||
@statusMessage.text = text
|
||||
@statusMessage.style = @types[type].style
|
||||
null
|
||||
$timeout.cancel @statusMessage.timeout if @statusMessage.timeout
|
||||
timeout = @types[type].timeout
|
||||
if timeout
|
||||
@statusMessage.timeout = $timeout =>
|
||||
@clear()
|
||||
, timeout, true
|
||||
null # So we don't return weird timeouts
|
||||
|
||||
clear: ->
|
||||
@statusMessage.text = ''
|
||||
|
||||
@@ -42,7 +42,7 @@ angular.module("admin.variantOverrides").controller "AdminVariantOverridesCtrl",
|
||||
$scope.fetchProducts()
|
||||
|
||||
$scope.fetchProducts = ->
|
||||
url = "/api/v0/products/overridable?page=::page::;per_page=100"
|
||||
url = "/api/products/overridable?page=::page::;per_page=100"
|
||||
PagedFetcher.fetch url, $scope.addProducts
|
||||
|
||||
$scope.addProducts = (data) ->
|
||||
|
||||
@@ -11,17 +11,14 @@
|
||||
#= require leaflet-1.6.0.js
|
||||
#= require leaflet-providers.js
|
||||
#= require lodash.underscore.js
|
||||
# bluebird.js and angular-simple-logger are dependencies of angular-google-maps.js 2.0.0
|
||||
# bluebird.js is a dependency of angular-google-maps.js 2.0.0
|
||||
#= require bluebird.js
|
||||
#= require angular-simple-logger.min.js
|
||||
#= require angular-scroll.min.js
|
||||
#= require angular-google-maps.min.js
|
||||
#= require ../shared/mm-foundation-tpls-0.9.0-20180826174721.min.js
|
||||
#= require ../shared/ng-infinite-scroll.min.js
|
||||
#= require ../shared/angular-local-storage.js
|
||||
#= require ../shared/angular-slideables.js
|
||||
#= require ../shared/shared
|
||||
#= require_tree ../shared/directives
|
||||
#= require angularjs-file-upload
|
||||
#= require i18n/translations
|
||||
|
||||
|
||||
@@ -1,20 +1,12 @@
|
||||
Darkswarm.controller "EditBoughtOrderController", ($scope, $resource, $timeout, Cart, Messages) ->
|
||||
Darkswarm.controller "EditBoughtOrderController", ($scope, $resource, Cart) ->
|
||||
$scope.showBought = false
|
||||
$scope.removeEnabled = true
|
||||
|
||||
$scope.deleteLineItem = (id) ->
|
||||
if Cart.isOnlyItemInOrder(id)
|
||||
Messages.error(t 'orders_cannot_remove_the_final_item')
|
||||
$scope.removeEnabled = false
|
||||
$timeout (->
|
||||
$scope.removeEnabled = true
|
||||
), 10000
|
||||
else
|
||||
params = {id: id}
|
||||
success = (response) ->
|
||||
$(".line-item-" + id).remove()
|
||||
Cart.removeFinalisedLineItem(id)
|
||||
fail = (error) ->
|
||||
console.log error
|
||||
params = {id: id}
|
||||
success = (response) ->
|
||||
$(".line-item-" + id).remove()
|
||||
Cart.removeFinalisedLineItem(id)
|
||||
fail = (error) ->
|
||||
console.log error
|
||||
|
||||
$resource("/line_items/:id").delete(params, success, fail)
|
||||
$resource("/line_items/:id").delete(params, success, fail)
|
||||
|
||||
@@ -24,7 +24,7 @@ Darkswarm.controller "HubNodeCtrl", ($scope, HashNavigation, CurrentHub, $http,
|
||||
$scope.shopfront_loading = true
|
||||
$scope.toggle_tab(event)
|
||||
|
||||
$http.get("/api/v0/shops/" + $scope.hub.id)
|
||||
$http.get("/api/shops/" + $scope.hub.id)
|
||||
.success (data) ->
|
||||
$scope.shopfront_loading = false
|
||||
$scope.hub = data
|
||||
|
||||
@@ -24,7 +24,7 @@ Darkswarm.controller "ProducerNodeCtrl", ($scope, HashNavigation, $anchorScroll,
|
||||
$scope.shopfront_loading = true
|
||||
$scope.toggle_tab(event)
|
||||
|
||||
$http.get("/api/v0/shops/" + $scope.producer.id)
|
||||
$http.get("/api/shops/" + $scope.producer.id)
|
||||
.success (data) ->
|
||||
$scope.shopfront_loading = false
|
||||
$scope.producer = data
|
||||
|
||||
@@ -11,8 +11,6 @@ Darkswarm.controller "ProductsCtrl", ($scope, $sce, $filter, $rootScope, Product
|
||||
$scope.supplied_taxons = null
|
||||
$scope.supplied_properties = null
|
||||
$scope.showFilterSidebar = false
|
||||
$scope.activeTaxons = []
|
||||
$scope.activeProperties = []
|
||||
|
||||
# Update filters after initial load of shop tab
|
||||
$timeout =>
|
||||
@@ -22,7 +20,6 @@ Darkswarm.controller "ProductsCtrl", ($scope, $sce, $filter, $rootScope, Product
|
||||
$rootScope.$on "orderCycleSelected", ->
|
||||
$scope.update_filters()
|
||||
$scope.clearAll()
|
||||
$scope.page = 1
|
||||
|
||||
$scope.update_filters = ->
|
||||
order_cycle_id = OrderCycle.order_cycle.order_cycle_id
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
Darkswarm.controller "RegistrationCtrl", ($scope, RegistrationService, EnterpriseRegistrationService, availableCountries, GmapsGeo) ->
|
||||
Darkswarm.controller "RegistrationCtrl", ($scope, RegistrationService, EnterpriseRegistrationService, availableCountries) ->
|
||||
$scope.currentStep = RegistrationService.currentStep
|
||||
$scope.enterprise = EnterpriseRegistrationService.enterprise
|
||||
$scope.select = RegistrationService.select
|
||||
$scope.geocodedAddress = ''
|
||||
$scope.latLong = null
|
||||
$scope.addressConfirmed = false
|
||||
|
||||
$scope.steps = ['details', 'contact', 'type', 'about', 'images', 'social']
|
||||
|
||||
# Filter countries without states since the form requires a state to be selected.
|
||||
@@ -24,26 +22,3 @@ Darkswarm.controller "RegistrationCtrl", ($scope, RegistrationService, Enterpris
|
||||
|
||||
$scope.countryHasStates = ->
|
||||
$scope.enterprise.country.states.length > 0
|
||||
|
||||
$scope.map = {center: {latitude: 0.000000, longitude: 0.000000 }, zoom: 1}
|
||||
$scope.options = {scrollwheel: false}
|
||||
$scope.locateAddress = () ->
|
||||
{ address1, address2, city, state_id, zipcode } = $scope.enterprise.address
|
||||
addressQuery = [address1, address2, city, state_id, zipcode].filter((value) => !!value).join(", ")
|
||||
GmapsGeo.geocode addressQuery, (results, status) =>
|
||||
$scope.geocodedAddress = results && results[0]?.formatted_address
|
||||
location = results[0]?.geometry?.location
|
||||
if location
|
||||
$scope.$apply(() =>
|
||||
$scope.latLong = {latitude: location.lat(), longitude: location.lng()}
|
||||
$scope.map = {center: {latitude: location.lat(), longitude: location.lng()}, zoom: 16 }
|
||||
)
|
||||
|
||||
$scope.toggleAddressConfirmed = ->
|
||||
$scope.addressConfirmed = !$scope.addressConfirmed
|
||||
if $scope.addressConfirmed
|
||||
$scope.enterprise.address.latitude = $scope.latLong.latitude
|
||||
$scope.enterprise.address.longitude = $scope.latLong.longitude
|
||||
else
|
||||
$scope.enterprise.address.latitude = null
|
||||
$scope.enterprise.address.longitude = null
|
||||
|
||||
@@ -10,11 +10,10 @@ window.Darkswarm = angular.module("Darkswarm", [
|
||||
'uiGmapgoogle-maps',
|
||||
'duScroll',
|
||||
'angularFileUpload',
|
||||
'angularSlideables',
|
||||
'OFNShared'
|
||||
'angularSlideables'
|
||||
]).config ($httpProvider, $tooltipProvider, $locationProvider, $anchorScrollProvider) ->
|
||||
$httpProvider.defaults.headers['common']['X-Requested-With'] = 'XMLHttpRequest'
|
||||
$httpProvider.defaults.headers.common['Accept'] = "application/json, text/javascript, */*"
|
||||
$httpProvider.defaults.headers.common.Accept = "application/json, text/javascript, */*"
|
||||
|
||||
# We manually handle our scrolling
|
||||
$anchorScrollProvider.disableAutoScrolling()
|
||||
|
||||
@@ -3,15 +3,7 @@ Darkswarm.directive "bodyScroll", ($rootScope, BodyScroll) ->
|
||||
scope: true
|
||||
link: (scope, elem, attrs) ->
|
||||
$rootScope.$on "toggleBodyScroll", ->
|
||||
if BodyScroll.disabled && document.body.scrollHeight > document.body.clientHeight
|
||||
document.body.style.top = "-#{window.scrollY}px"
|
||||
document.body.style.position = 'fixed'
|
||||
document.body.style.overflowY = 'scroll'
|
||||
document.body.style.width = '100%'
|
||||
if BodyScroll.disabled
|
||||
elem.addClass "disable-scroll"
|
||||
else
|
||||
scrollY = parseInt(document.body.style.top) * -1
|
||||
document.body.style.position = ''
|
||||
document.body.style.top = ''
|
||||
document.body.style.overflowY = ''
|
||||
document.body.style.width = ''
|
||||
window.scrollTo(0, scrollY) if scrollY
|
||||
elem.removeClass "disable-scroll"
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
Darkswarm.directive 'mapOsmTiles', ($timeout) ->
|
||||
restrict: 'E'
|
||||
require: '^uiGmapGoogleMap'
|
||||
scope: {}
|
||||
link: (scope, elem, attrs, ctrl) ->
|
||||
$timeout =>
|
||||
map = ctrl.getMap()
|
||||
|
||||
map.mapTypes.set 'OSM', new google.maps.ImageMapType
|
||||
getTileUrl: (coord, zoom) ->
|
||||
# "Wrap" x (logitude) at 180th meridian properly
|
||||
# NB: Don't touch coord.x because coord param is by reference, and changing its x property breaks something in Google's lib
|
||||
tilesPerGlobe = 1 << zoom
|
||||
x = coord.x % tilesPerGlobe
|
||||
if x < 0
|
||||
x = tilesPerGlobe + x
|
||||
# Wrap y (latitude) in a like manner if you want to enable vertical infinite scroll
|
||||
'https://a.tile.openstreetmap.org/' + zoom + '/' + x + '/' + coord.y + '.png'
|
||||
tileSize: new google.maps.Size(256, 256)
|
||||
name: 'OpenStreetMap'
|
||||
maxZoom: 18
|
||||
@@ -1,8 +0,0 @@
|
||||
Darkswarm.directive "shopVariantWithUnitPrice", ->
|
||||
restrict: 'E'
|
||||
replace: true
|
||||
templateUrl: 'shop_variant_with_unit_price.html'
|
||||
scope:
|
||||
variant: '='
|
||||
show_unit_price: '=showunitprice'
|
||||
controller: 'ShopVariantCtrl'
|
||||
@@ -115,10 +115,6 @@ Darkswarm.factory 'Cart', (CurrentOrder, Variants, $timeout, $http, $modal, $roo
|
||||
@line_items = []
|
||||
localStorageService.clearAll() # One day this will have to be moar GRANULAR
|
||||
|
||||
isOnlyItemInOrder: (id) =>
|
||||
deletedItem = @line_items_finalised.find((item) -> item.id == id)
|
||||
@line_items_finalised.filter((item) -> item.order_id == deletedItem.order_id).length == 1
|
||||
|
||||
removeFinalisedLineItem: (id) =>
|
||||
@line_items_finalised = @line_items_finalised.filter (item) ->
|
||||
item.id != id
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
angular.module("Darkswarm").factory 'Customer', ($resource, $injector, Messages) ->
|
||||
Customer = $resource('/api/v0/customers/:id/:action.json', {}, {
|
||||
Customer = $resource('/api/customers/:id/:action.json', {}, {
|
||||
'index':
|
||||
method: 'GET'
|
||||
isArray: true
|
||||
|
||||
@@ -8,5 +8,5 @@ Darkswarm.factory "EnterpriseImageService", (FileUploader, spreeApiKey) ->
|
||||
autoUpload: true
|
||||
|
||||
configure: (enterprise) =>
|
||||
@imageUploader.url = "/api/v0/enterprises/#{enterprise.id}/update_image"
|
||||
@imageUploader.url = "/api/enterprises/#{enterprise.id}/update_image"
|
||||
@imageUploader.onSuccessItem = (image, response) => @imageSrc = response
|
||||
|
||||
@@ -5,7 +5,7 @@ Darkswarm.factory "EnterpriseModal", ($modal, $rootScope, $http)->
|
||||
scope = $rootScope.$new(true) # Spawn an isolate to contain the enterprise
|
||||
scope.embedded_layout = window.location.search.indexOf("embedded_shopfront=true") != -1
|
||||
|
||||
$http.get("/api/v0/shops/" + enterprise.id).success (data) ->
|
||||
$http.get("/api/shops/" + enterprise.id).success (data) ->
|
||||
scope.enterprise = data
|
||||
$modal.open(templateUrl: "enterprise_modal.html", scope: scope)
|
||||
.error (data) ->
|
||||
|
||||
@@ -18,10 +18,9 @@ Darkswarm.factory "EnterpriseRegistrationService", ($http, RegistrationService,
|
||||
Loading.message = t('creating') + " " + @enterprise.name
|
||||
$http(
|
||||
method: "POST"
|
||||
url: "/api/v0/enterprises"
|
||||
url: "/api/enterprises"
|
||||
data:
|
||||
enterprise: @prepare()
|
||||
use_geocoder: @useGeocoder()
|
||||
params:
|
||||
token: spreeApiKey
|
||||
).success((data) =>
|
||||
@@ -43,10 +42,9 @@ Darkswarm.factory "EnterpriseRegistrationService", ($http, RegistrationService,
|
||||
Loading.message = t('updating') + " " + @enterprise.name
|
||||
$http(
|
||||
method: "PUT"
|
||||
url: "/api/v0/enterprises/#{@enterprise.id}"
|
||||
url: "/api/enterprises/#{@enterprise.id}"
|
||||
data:
|
||||
enterprise: @prepare()
|
||||
use_geocoder: @useGeocoder()
|
||||
params:
|
||||
token: spreeApiKey
|
||||
).success((data) ->
|
||||
@@ -65,7 +63,3 @@ Darkswarm.factory "EnterpriseRegistrationService", ($http, RegistrationService,
|
||||
enterprise.address_attributes = @enterprise.address if @enterprise.address?
|
||||
enterprise.address_attributes.country_id = @enterprise.country.id if @enterprise.country?
|
||||
enterprise
|
||||
|
||||
useGeocoder: =>
|
||||
if @enterprise.address? && !@enterprise.address.latitude? && !@enterprise.address.longitude?
|
||||
return "1"
|
||||
|
||||
@@ -10,7 +10,7 @@ Darkswarm.service "GmapsGeo", ->
|
||||
# console.log "Error: #{status}"
|
||||
geocode: (address, callback) ->
|
||||
geocoder = new google.maps.Geocoder()
|
||||
geocoder.geocode {'address': address, 'region': "<%= DefaultCountry.code %>"}, callback
|
||||
geocoder.geocode {'address': address, 'region': "<%= Spree::Country.find_by(id: Spree::Config[:default_country_id]).iso %>"}, callback
|
||||
|
||||
distanceBetween: (src, dst) ->
|
||||
google.maps.geometry.spherical.computeDistanceBetween @toLatLng(src), @toLatLng(dst)
|
||||
@@ -20,4 +20,4 @@ Darkswarm.service "GmapsGeo", ->
|
||||
if locatable.lat?
|
||||
locatable
|
||||
else
|
||||
new google.maps.LatLng locatable.latitude, locatable.longitude
|
||||
new google.maps.LatLng locatable.latitude, locatable.longitude
|
||||
@@ -4,10 +4,12 @@ Darkswarm.factory "MapConfiguration", ->
|
||||
center:
|
||||
latitude: -37.4713077
|
||||
longitude: 144.7851531
|
||||
cluster_icon: "/map_icons/map_009-cluster.svg"
|
||||
cluster_icon: "<%= image_path('map_009-cluster.svg') %>"
|
||||
zoom: 12
|
||||
additional_options:
|
||||
# mapTypeId: 'satellite'
|
||||
mapTypeId: 'OSM'
|
||||
mapTypeControl: false
|
||||
streetViewControl: false
|
||||
styles: [{"featureType":"landscape","stylers":[{"saturation":-100},{"lightness":65},{"visibility":"on"}]},{"featureType":"poi","stylers":[{"saturation":-100},{"lightness":51},{"visibility":"simplified"}]},{"featureType":"road.highway","stylers":[{"saturation":-100},{"visibility":"simplified"}]},{"featureType":"road.arterial","stylers":[{"saturation":-100},{"lightness":30},{"visibility":"on"}]},{"featureType":"road.local","stylers":[{"saturation":-100},{"lightness":40},{"visibility":"on"}]},{"featureType":"transit","stylers":[{"saturation":-100},{"visibility":"simplified"}]},{"featureType":"administrative.province","stylers":[{"visibility":"off"}]},{"featureType":"water","elementType":"labels","stylers":[{"visibility":"on"},{"lightness":-25},{"saturation":-100}]},{"featureType":"water","elementType":"geometry","stylers":[{"hue":"#ffff00"},{"lightness":-25},{"saturation":-97}]},{"featureType":"road","elementType": "labels.icon","stylers":[{"visibility":"off"}]}]
|
||||
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
Darkswarm.factory 'OrderCycleResource', ($resource) ->
|
||||
$resource('/api/v0/order_cycles/:id.json', {}, {
|
||||
$resource('/api/order_cycles/:id.json', {}, {
|
||||
'products':
|
||||
method: 'GET'
|
||||
isArray: true
|
||||
url: '/api/v0/order_cycles/:id/products.json'
|
||||
url: '/api/order_cycles/:id/products.json'
|
||||
params:
|
||||
id: '@id'
|
||||
'taxons':
|
||||
method: 'GET'
|
||||
isArray: true
|
||||
url: '/api/v0/order_cycles/:id/taxons.json'
|
||||
url: '/api/order_cycles/:id/taxons.json'
|
||||
params:
|
||||
id: '@id'
|
||||
'properties':
|
||||
method: 'GET'
|
||||
isArray: true
|
||||
url: '/api/v0/order_cycles/:id/properties.json'
|
||||
url: '/api/order_cycles/:id/properties.json'
|
||||
params:
|
||||
id: '@id'
|
||||
})
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
Darkswarm.factory 'ShopsResource', ($resource) ->
|
||||
$resource('/api/v0/shops/:id.json', {}, {
|
||||
$resource('/api/shops/:id.json', {}, {
|
||||
'closed_shops':
|
||||
method: 'GET'
|
||||
isArray: true
|
||||
url: '/api/v0/shops/closed_shops.json'
|
||||
url: '/api/shops/closed_shops.json'
|
||||
})
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
|
||||
OFNShared.directive "questionMarkWithTooltip", ($tooltip)->
|
||||
# We use the $tooltip service from Angular foundation to give us boilerplate
|
||||
# Subsequently we patch the scope, template and restrictions
|
||||
tooltip = $tooltip 'questionMarkWithTooltip', 'questionMarkWithTooltip', 'click'
|
||||
tooltip.scope =
|
||||
context: "="
|
||||
key: "="
|
||||
tooltip.templateUrl = "shared/question_mark_with_tooltip_icon.html"
|
||||
tooltip.replace = true
|
||||
tooltip.restrict = 'E'
|
||||
tooltip
|
||||
|
||||
# This is automatically referenced via naming convention in $tooltip
|
||||
OFNShared.directive 'questionMarkWithTooltipPopup', ->
|
||||
restrict: 'EA'
|
||||
replace: true
|
||||
templateUrl: 'shared/question_mark_with_tooltip.html'
|
||||
scope: false
|
||||
@@ -1,4 +0,0 @@
|
||||
window.OFNShared = angular.module("OFNShared", [
|
||||
"mm.foundation"
|
||||
]).config ($httpProvider) ->
|
||||
$httpProvider.defaults.headers.common["Accept"] = "application/json, text/javascript, */*"
|
||||
@@ -6,7 +6,7 @@
|
||||
%p.error{ ng: { show: 'error' } }
|
||||
{{error}}
|
||||
|
||||
%img.spinner{ src: image_path("spinning-circles.svg"), ng: { show: "loading" } }
|
||||
%img.spinner{ src: "/assets/spinning-circles.svg", ng: { show: "loading" } }
|
||||
%p{ ng: { show: "loading" } }
|
||||
= t('js.admin.orders.index.please_wait')
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
%form#image_upload{ name: 'form', novalidate: true, enctype: 'multipart/form-data', multipart: true, ng: { controller: "ProductImageCtrl" } }
|
||||
%div.image-preview
|
||||
%img.spinner{ src: image_path("spinning-circles.svg"), ng: { hide: "!imageUploader.isUploading" }}
|
||||
%img.spinner{ src: "/assets/spinning-circles.svg", ng: { hide: "!imageUploader.isUploading" }}
|
||||
%img.preview{ng: {src: "{{imagePreview}}", class: "{'faded': imageUploader.isUploading}"}}
|
||||
|
||||
%label{for: 'image-upload', class: 'button'} {{ 'admin.products.index.upload_an_image' | t }}
|
||||
|
||||
@@ -6,6 +6,6 @@
|
||||
|
||||
.sixteen.columns.alpha#loading{ 'ng-show' => 'productsLoading()' }
|
||||
%br
|
||||
%img.spinner{ src: image_path("spinning-circles.svg")}
|
||||
%img.spinner{ src: "/assets/spinning-circles.svg" }
|
||||
%h1
|
||||
{{ 'js.admin.panels.exchange_products.loading_variants' | t }}
|
||||
|
||||
@@ -2,21 +2,12 @@
|
||||
.columns.small-12
|
||||
%h3{"ng-bind" => "::variant.extended_name"}
|
||||
|
||||
.flex.variant-bulk-buy-price-summary{style: "justify-content: space-around;"}
|
||||
.variant-unit
|
||||
{{ ::variant.unit_to_display }}
|
||||
.div
|
||||
.row.variant-bulk-buy-price-summary
|
||||
.columns.small-6
|
||||
.variant-unit {{ ::variant.unit_to_display }}
|
||||
.columns.small-6
|
||||
{{ variant.line_item.total_price | localizeCurrency }}
|
||||
|
||||
.unit-price{"ng-if": "show_unit_price"}
|
||||
%question-mark-with-tooltip{"question-mark-with-tooltip": "_",
|
||||
"question-mark-with-tooltip-append-to-body": "true",
|
||||
"question-mark-with-tooltip-placement": "top",
|
||||
"question-mark-with-tooltip-animation": true,
|
||||
style: "margin-right: 5px",
|
||||
key: "'js.shopfront.unit_price_tooltip'"}
|
||||
{{ variant.unit_price_price | localizeCurrency }} / {{ variant.unit_price_unit }}
|
||||
|
||||
.row
|
||||
.columns.small-12.medium-6
|
||||
.variant-bulk-buy-quantity-label
|
||||
@@ -25,7 +16,10 @@
|
||||
%button.bulk-buy-add.variant-quantity{type: "button", ng: {click: "add(-1)", disabled: "!canAdd(-1)"}}>
|
||||
-# U+FF0D Fullwidth Hyphen-Minus
|
||||
-
|
||||
%input.bulk-buy.variant-quantity{type: "number", min: "0", max: "{{ available() }}",
|
||||
%input.bulk-buy.variant-quantity{
|
||||
type: "number",
|
||||
min: "0",
|
||||
max: "{{ available() }}",
|
||||
ng: {model: "variant.line_item.quantity", max: "Infinity"}}>
|
||||
%button.bulk-buy-add.variant-quantity{type: "button", ng: {click: "add(1)", disabled: "!canAdd(1)"}}
|
||||
-# U+FF0B Fullwidth Plus Sign
|
||||
@@ -37,7 +31,10 @@
|
||||
%button.bulk-buy-add.variant-quantity{type: "button", ng: {click: "addMax(-1)", disabled: "!canAddMax(-1)"}}>
|
||||
-# U+FF0D Fullwidth Hyphen-Minus
|
||||
-
|
||||
%input.bulk-buy.variant-quantity{type: "number", min: "0", max: "{{ available() }}",
|
||||
%input.bulk-buy.variant-quantity{
|
||||
type: "number",
|
||||
min: "0",
|
||||
max: "{{ available() }}",
|
||||
ng: {model: "variant.line_item.max_quantity", max: "Infinity"}}>
|
||||
%button.bulk-buy-add.variant-quantity{type: "button", ng: {click: "addMax(1)", disabled: "!canAddMax(1)"}}
|
||||
-# U+FF0B Fullwidth Plus Sign
|
||||
|
||||
@@ -8,8 +8,12 @@
|
||||
%button.variant-quantity{type: "button", ng: {click: "add(-1)", disabled: "!canAdd(-1)"}}>
|
||||
-# U+FF0D Fullwidth Hyphen-Minus
|
||||
-
|
||||
%input.variant-quantity{ type: "number", min: "0", max: "{{ available() }}",
|
||||
ng: {model: "variant.line_item.quantity", max: "Infinity"}}>
|
||||
%input.variant-quantity{
|
||||
type: "number",
|
||||
min: "0",
|
||||
max: "{{ available() }}",
|
||||
ng: {model: "variant.line_item.quantity", max: "Infinity"}
|
||||
}>
|
||||
%button.variant-quantity{type: "button", ng: {click: "add(1)", disabled: "!canAdd(1)"}}
|
||||
-# U+FF0B Fullwidth Plus Sign
|
||||
+
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
.joyride-tip-guide.question-mark-tooltip{class: "{{ context }}", ng: {class: "{ in: tt_isOpen, fade: tt_animation }", show: "tt_isOpen"}}
|
||||
.background{ng: {click: "tt_isOpen = false"}}
|
||||
.joyride-content-wrapper
|
||||
{{ key | t }}
|
||||
%span.joyride-nub.bottom
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
%button.question-mark-icon{"ng-class" => "{open: tt_isOpen}", type: 'button'}
|
||||
@@ -1,23 +0,0 @@
|
||||
.variants.row
|
||||
.small-4.medium-4.large-5.columns.variant-name
|
||||
.inline{"ng-if" => "::variant.display_name"} {{ ::variant.display_name }}
|
||||
.variant-unit {{ ::variant.unit_to_display }}
|
||||
.small-3.medium-3.large-2.columns.variant-price
|
||||
%price-breakdown{"price-breakdown" => "_", variant: "variant",
|
||||
"price-breakdown-append-to-body" => "true",
|
||||
"price-breakdown-placement" => "bottom",
|
||||
"price-breakdown-animation" => true}
|
||||
{{ variant.price_with_fees | localizeCurrency }}
|
||||
.unit-price.variant-unit-price
|
||||
%question-mark-with-tooltip{"question-mark-with-tooltip" => "_",
|
||||
"question-mark-with-tooltip-append-to-body" => "true",
|
||||
"question-mark-with-tooltip-placement" => "top",
|
||||
"question-mark-with-tooltip-animation" => true,
|
||||
key: "'js.shopfront.unit_price_tooltip'"}
|
||||
{{ variant.unit_price_price | localizeCurrency }} / {{ variant.unit_price_unit }}
|
||||
|
||||
.medium-2.large-2.columns.total-price
|
||||
%span{"ng-class" => "{filled: variant.line_item.total_price}"}
|
||||
{{ variant.line_item.total_price | localizeCurrency }}
|
||||
%ng-include{src: "'partials/shop_variant_no_group_buy.html'"}
|
||||
%ng-include{src: "'partials/shop_variant_with_group_buy.html'"}
|
||||
@@ -7,13 +7,11 @@
|
||||
*= require normalize
|
||||
*= require responsive-tables
|
||||
*= require jquery.powertip
|
||||
*= require jquery.ui.dialog
|
||||
*= require jquery.ui.datepicker
|
||||
*= require jquery-ui-timepicker-addon
|
||||
*= require shared/textAngular
|
||||
*= require shared/ng-tags-input.min
|
||||
*= require select2
|
||||
*= require flatpickr/dist/flatpickr
|
||||
*= require flatpickr/dist/themes/material_blue
|
||||
*= require shortcut-buttons-flatpickr/dist/themes/light
|
||||
|
||||
*= require_self
|
||||
*/
|
||||
@@ -31,8 +29,6 @@
|
||||
@import 'shared/forms';
|
||||
@import 'shared/layout';
|
||||
|
||||
@import 'plugins/flatpickr-customization';
|
||||
|
||||
@import 'plugins/powertip';
|
||||
@import 'plugins/jstree';
|
||||
@import 'plugins/font-awesome';
|
||||
@@ -48,6 +44,3 @@
|
||||
@import 'components/*';
|
||||
@import 'pages/*';
|
||||
@import '*';
|
||||
|
||||
@import "../shared/question-mark-icon";
|
||||
@import "question-mark-tooltip";
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
@import 'admin/globals/mixins';
|
||||
@import 'admin/plugins/font-awesome';
|
||||
|
||||
// scss-lint:disable QualifyingElement
|
||||
|
||||
.date-range-filter {
|
||||
.range-divider {
|
||||
padding: 0;
|
||||
@@ -13,21 +11,148 @@
|
||||
}
|
||||
}
|
||||
|
||||
input.datetimepicker {
|
||||
min-width: 12.9em;
|
||||
}
|
||||
#ui-datepicker-div {
|
||||
@include border-radius($border-radius);
|
||||
border-color: $color-3;
|
||||
padding: 0;
|
||||
margin-top: 10px;
|
||||
|
||||
.container input[readonly].flatpickr-input,
|
||||
.container input[readonly].datepicker,
|
||||
.container input[readonly].datetimepicker {
|
||||
background-color: $white;
|
||||
cursor: pointer;
|
||||
}
|
||||
&:before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
border-left: 10px solid transparent;
|
||||
border-right: 10px solid transparent;
|
||||
border-bottom: 10px solid $color-3;
|
||||
top: 0px;
|
||||
margin-top: -10px;
|
||||
left: 25px;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
img.ui-datepicker-trigger {
|
||||
margin-left: -1.75em;
|
||||
position: absolute;
|
||||
margin-top: 0.5em;
|
||||
}
|
||||
.ui-datepicker-header {
|
||||
padding: 0;
|
||||
background-image: none;
|
||||
background-color: $color-3;
|
||||
border: none;
|
||||
border-bottom: none;
|
||||
border-radius: 0;
|
||||
height: 32px;
|
||||
|
||||
// scss-lint:enable QualifyingElement
|
||||
.ui-datepicker-prev, .ui-datepicker-next {
|
||||
border-radius: 0;
|
||||
top: 0;
|
||||
height: 32px;
|
||||
|
||||
&:hover {
|
||||
border: none;
|
||||
background-image: none;
|
||||
background-color: $color-3;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.ui-icon {
|
||||
background-image: none;
|
||||
text-indent: 0;
|
||||
color: $color-1;
|
||||
width: 10px;
|
||||
margin-left: -5px;
|
||||
@extend [class^="icon-"]:before;
|
||||
|
||||
&:hover {
|
||||
color: very-light($color-2, 25);
|
||||
}
|
||||
}
|
||||
}
|
||||
.ui-datepicker-prev {
|
||||
left: 0;
|
||||
|
||||
.ui-icon {
|
||||
@extend .icon-arrow-left;
|
||||
}
|
||||
}
|
||||
.ui-datepicker-next {
|
||||
right: 0;
|
||||
|
||||
.ui-icon {
|
||||
@extend .icon-arrow-right;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
.ui-icon {
|
||||
margin-left: -5px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.ui-datepicker-title {
|
||||
color: $color-1;
|
||||
text-transform: uppercase;
|
||||
font-size: 85% !important;
|
||||
padding: 6px 10px;
|
||||
}
|
||||
}
|
||||
|
||||
table.ui-datepicker-calendar {
|
||||
border: none;
|
||||
|
||||
thead {
|
||||
th {
|
||||
border-bottom: 1px solid $color-border;
|
||||
border-right: 1px solid $color-border;
|
||||
color: $color-body-text;
|
||||
width: 33px;
|
||||
|
||||
&:last-child {
|
||||
border-right: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
tbody {
|
||||
tr:hover {
|
||||
td {
|
||||
background-color: transparent !important;
|
||||
}
|
||||
}
|
||||
&:last-child tr:last-child td {
|
||||
border-bottom: none;
|
||||
}
|
||||
td {
|
||||
a {
|
||||
border: 1px solid transparent;
|
||||
background-color: $color-1;
|
||||
background-image: none;
|
||||
font-size: 85%;
|
||||
color: $color-body-text;
|
||||
|
||||
&.ui-state-active {
|
||||
background-color: $color-2;
|
||||
color: $color-1;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background-color: $color-2;
|
||||
color: $color-1;
|
||||
border-color: darken($color-2, 5);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
&.ui-state-disabled {
|
||||
.ui-state-default {
|
||||
border: none;
|
||||
background-image: none;
|
||||
background-color: transparent;
|
||||
}
|
||||
}
|
||||
|
||||
&.ui-datepicker-today {
|
||||
a {
|
||||
background-color: $color-6;
|
||||
color: $color-1;
|
||||
border: 1px solid darken($color-6, 5);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
9
app/assets/stylesheets/admin/datepicker.scss
Normal file
@@ -0,0 +1,9 @@
|
||||
input.datetimepicker {
|
||||
min-width: 12.9em;
|
||||
}
|
||||
|
||||
img.ui-datepicker-trigger {
|
||||
margin-left: -1.75em;
|
||||
position: absolute;
|
||||
margin-top: 0.5em;
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
$background-grey: #eceef1;
|
||||
$background-blue: #5498da;
|
||||
|
||||
// scss-lint:disable SelectorFormat
|
||||
|
||||
.flatpickr-calendar {
|
||||
border-radius: 0;
|
||||
|
||||
// Disable animation
|
||||
&.animate.open {
|
||||
animation: none;
|
||||
}
|
||||
|
||||
&.arrowBottom::after {
|
||||
border-top-color: $background-grey;
|
||||
}
|
||||
|
||||
&.arrowTop::after {
|
||||
border-bottom-color: $background-blue;
|
||||
}
|
||||
|
||||
.flatpickr-months .flatpickr-month {
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.flatpickr-months .flatpickr-month,
|
||||
.flatpickr-current-month .flatpickr-monthDropdown-months {
|
||||
background: $background-blue;
|
||||
}
|
||||
|
||||
.flatpickr-weekdays {
|
||||
background: $background-blue;
|
||||
|
||||
.flatpickr-weekday {
|
||||
background: $background-blue;
|
||||
}
|
||||
}
|
||||
|
||||
.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: $background-blue;
|
||||
border-color: $background-blue;
|
||||
}
|
||||
}
|
||||
|
||||
// scss-lint:enable SelectorFormat
|
||||
@@ -1,18 +0,0 @@
|
||||
.joyride-tip-guide {
|
||||
background: $color-3;
|
||||
color: $white;
|
||||
font-family: inherit;
|
||||
font-weight: $font-weight-normal;
|
||||
position: absolute;
|
||||
z-index: 101;
|
||||
padding: 5px 15px;
|
||||
|
||||
.joyride-nub.bottom {
|
||||
border: 10px solid;
|
||||
display: block;
|
||||
height: 0;
|
||||
position: absolute;
|
||||
width: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,13 +117,6 @@ button.bulk-buy-add.variant-quantity {
|
||||
}
|
||||
}
|
||||
|
||||
// Hide number arrows on Chrome, Safari, Edge, Opera
|
||||
.variant-quantity::-webkit-outer-spin-button,
|
||||
.variant-quantity::-webkit-inner-spin-button {
|
||||
-webkit-appearance: none;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.variant-bulk-buy-price-summary {
|
||||
color: $disabled-med;
|
||||
margin-bottom: 1em;
|
||||
|
||||
@@ -181,10 +181,11 @@ shop ordercycle {
|
||||
}
|
||||
}
|
||||
|
||||
shop .tab-buttons ordercycle {
|
||||
shop navigation ordercycle {
|
||||
margin-top: 3.4em;
|
||||
padding: 1em;
|
||||
height: 7.6em;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
right: 1em;
|
||||
}
|
||||
|
||||
|
||||
@@ -65,14 +65,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
.variant-unit-price {
|
||||
color: $grey-700;
|
||||
font-size: 0.85rem;
|
||||
margin-top: 15px;
|
||||
position: relative;
|
||||
left: -1px;
|
||||
}
|
||||
|
||||
// Total price
|
||||
.total-price {
|
||||
padding-left: 0rem;
|
||||
|
||||
@@ -99,6 +99,7 @@
|
||||
.transaction-group {}
|
||||
|
||||
table {
|
||||
width: 100%;
|
||||
border-radius: $radius-medium $radius-medium 0 0;
|
||||
|
||||
tr:nth-of-type(even) {
|
||||
@@ -142,29 +143,3 @@
|
||||
width: 10%;
|
||||
}
|
||||
}
|
||||
|
||||
table {
|
||||
&.full {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
&.top-rounded {
|
||||
border-radius: $radius-medium $radius-medium 0 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Note this relies on the <th> using `.show-for-large-up` as well.
|
||||
.requiring-authorization tr {
|
||||
position: relative;
|
||||
|
||||
th:last-child {
|
||||
position: absolute;
|
||||
// The following calculation is the equivalent of:
|
||||
//
|
||||
// $table-cell-padding + 2 * browser's default border-spacing + 2 * table border
|
||||
//
|
||||
// Unfortunately we can't use Scss's interpolation
|
||||
// https://sass-lang.com/documentation/interpolation. We're using a too old version perhaps?
|
||||
right: calc(12px + 2*2px + 2*1px);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,5 +21,3 @@
|
||||
ofn-modal {
|
||||
display: block;
|
||||
}
|
||||
|
||||
@import "../shared/question-mark-icon";
|
||||
|
||||
@@ -42,10 +42,8 @@ $black: #000;
|
||||
$white: #fff;
|
||||
|
||||
$grey-050: #f7f7f7;
|
||||
$grey-075: #f3f8fc;
|
||||
$grey-100: #e6e6e6;
|
||||
$grey-200: #ddd;
|
||||
$grey-250: #cfe1f3;
|
||||
$grey-300: #ccc;
|
||||
$grey-400: #bbb;
|
||||
$grey-500: #999;
|
||||
@@ -55,9 +53,6 @@ $grey-650: #666;
|
||||
$grey-700: #555;
|
||||
$grey-800: #333;
|
||||
|
||||
$tiny-blue: #80b2e1;
|
||||
$dynamic-blue: #3d8dd1;
|
||||
|
||||
$teal-300: #80d3df;
|
||||
$teal-400: #4cb5c5;
|
||||
$teal-500: #0096ad;
|
||||
|
||||
@@ -52,11 +52,6 @@
|
||||
font-size: 1.5em;
|
||||
}
|
||||
}
|
||||
|
||||
.unit-price {
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.go-shopping {
|
||||
@@ -87,8 +82,7 @@
|
||||
padding: 0.5em 0 0.5em 1em;
|
||||
}
|
||||
|
||||
span,
|
||||
.total-price {
|
||||
span {
|
||||
color: $grey-800;
|
||||
font-size: 16px;
|
||||
line-height: 1.4em;
|
||||
|
||||
@@ -44,12 +44,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
.unit-price {
|
||||
color: $grey-500;
|
||||
font-size: $text-xs;
|
||||
}
|
||||
|
||||
|
||||
input {
|
||||
&.ng-invalid-stock,
|
||||
&.ng-invalid-number {
|
||||
|
||||