spree_backend 4.3.0 → 4.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +222 -0
- data/.codeclimate.yml +36 -0
- data/.editorconfig +22 -0
- data/.eslintignore +7 -0
- data/.eslintrc.cjs +29 -0
- data/.gem_release.yml +4 -0
- data/.github/CONTRIBUTING.md +1 -0
- data/.github/ISSUE_TEMPLATE/bug_report.md +47 -0
- data/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
- data/.github/ISSUE_TEMPLATE.md +39 -0
- data/.github/dependabot.yml +7 -0
- data/.github/workflows/spelling_lint.yml +34 -0
- data/.gitignore +64 -0
- data/.rubocop.yml +197 -0
- data/.solargraph.yml +20 -0
- data/.stylelintignore +4 -0
- data/.stylelintrc +6 -0
- data/CODE_OF_CONDUCT.md +22 -0
- data/Gemfile +59 -3
- data/README.md +123 -0
- data/SECURITY.md +1 -0
- data/app/assets/config/spree_backend_manifest.js +1 -1
- data/app/assets/images/backend-cloud-arrow-up.svg +4 -0
- data/app/assets/images/backend-eye-open.svg +1 -1
- data/app/assets/images/backend-file-earmark-font.svg +4 -0
- data/app/assets/images/backend-file-earmark-image.svg +4 -0
- data/app/assets/images/backend-file-earmark-music.svg +4 -0
- data/app/assets/images/backend-file-earmark-pdf.svg +4 -0
- data/app/assets/images/backend-file-earmark-play.svg +4 -0
- data/app/assets/images/backend-file-earmark-spreadsheet.svg +3 -0
- data/app/assets/images/backend-file-earmark-zip.svg +4 -0
- data/app/assets/images/backend-file-earmark.svg +3 -0
- data/app/assets/images/backend-hdd.svg +4 -0
- data/app/assets/images/backend-link.svg +4 -0
- data/app/assets/images/backend-view.svg +1 -1
- data/app/assets/javascripts/spree/backend/address_states.es6 +2 -0
- data/app/assets/javascripts/spree/backend/adjustments.js +5 -5
- data/app/assets/javascripts/spree/backend/admin.js +4 -6
- data/app/assets/javascripts/spree/backend/calculator.js +1 -1
- data/app/assets/javascripts/spree/backend/checkouts/edit.js +1 -1
- data/app/assets/javascripts/spree/backend/cms/links.es6 +1 -1
- data/app/assets/javascripts/spree/backend/cms/live_preview.es6 +1 -1
- data/app/assets/javascripts/spree/backend/cms/page.es6 +22 -40
- data/app/assets/javascripts/spree/backend/cms/section.es6 +1 -1
- data/app/assets/javascripts/spree/backend/gateway.js +1 -1
- data/app/assets/javascripts/spree/backend/general_settings.js +1 -1
- data/app/assets/javascripts/spree/backend/global/_index.js +3 -1
- data/app/assets/javascripts/spree/backend/global/alerts.es6 +1 -1
- data/app/assets/javascripts/spree/backend/global/animate_css.es6 +19 -0
- data/app/assets/javascripts/spree/backend/global/fetch_request_utility.es6 +114 -0
- data/app/assets/javascripts/spree/backend/global/flatpickr.es6 +8 -1
- data/app/assets/javascripts/spree/backend/global/info_alert.es6 +1 -1
- data/app/assets/javascripts/spree/backend/global/radio_panel_toggle.es6 +1 -1
- data/app/assets/javascripts/spree/backend/global/ransack.es6 +7 -5
- data/app/assets/javascripts/spree/backend/global/responsive_menus.es6 +1 -1
- data/app/assets/javascripts/spree/backend/global/select2_autocomplete.es6 +11 -4
- data/app/assets/javascripts/spree/backend/global/select2_populate.es6 +2 -2
- data/app/assets/javascripts/spree/backend/global/side_scroll_indication.es6 +2 -2
- data/app/assets/javascripts/spree/backend/global/sortable.es6 +1 -1
- data/app/assets/javascripts/spree/backend/global/tinymce.es6 +3 -2
- data/app/assets/javascripts/spree/backend/line_items.js +7 -9
- data/app/assets/javascripts/spree/backend/line_items_on_order_edit.js +23 -28
- data/app/assets/javascripts/spree/backend/menus/_index.es6 +0 -1
- data/app/assets/javascripts/spree/backend/menus/menu_item.es6 +1 -1
- data/app/assets/javascripts/spree/backend/multi_currency.js +2 -2
- data/app/assets/javascripts/spree/backend/option_type_autocomplete.js +1 -1
- data/app/assets/javascripts/spree/backend/orders/edit.js +1 -1
- data/app/assets/javascripts/spree/backend/payments/edit.js +32 -22
- data/app/assets/javascripts/spree/backend/payments/new.js +1 -1
- data/app/assets/javascripts/spree/backend/product_picker.js +16 -25
- data/app/assets/javascripts/spree/backend/progress.js +5 -3
- data/app/assets/javascripts/spree/backend/promotions.js +3 -1
- data/app/assets/javascripts/spree/backend/returns/expedited_exchanges_warning.js +1 -1
- data/app/assets/javascripts/spree/backend/returns/return_item_selection.js +1 -1
- data/app/assets/javascripts/spree/backend/shipments.js +80 -79
- data/app/assets/javascripts/spree/backend/spree-select2.js +8 -1
- data/app/assets/javascripts/spree/backend/states.js +1 -1
- data/app/assets/javascripts/spree/backend/stock_location.js +1 -1
- data/app/assets/javascripts/spree/backend/stock_management.js +1 -1
- data/app/assets/javascripts/spree/backend/stock_movement.js +58 -13
- data/app/assets/javascripts/spree/backend/stock_transfer.js +62 -32
- data/app/assets/javascripts/spree/backend/taxon_autocomplete.js +9 -8
- data/app/assets/javascripts/spree/backend/taxons.js +17 -14
- data/app/assets/javascripts/spree/backend/user_picker.js +1 -1
- data/app/assets/javascripts/spree/backend/users/edit.js +1 -1
- data/app/assets/javascripts/spree/backend/variant_autocomplete.js +19 -11
- data/app/assets/javascripts/spree/backend/variant_management.js +1 -1
- data/app/assets/javascripts/spree/backend/zone.js +1 -1
- data/app/assets/javascripts/spree/backend.js +13 -33
- data/app/assets/javascripts/spree.js +2 -9
- data/app/assets/stylesheets/spree/backend/components/_main.scss +8 -0
- data/app/assets/stylesheets/spree/backend/plugins/_nav_x.scss +1 -1
- data/app/assets/stylesheets/spree/backend/plugins/_select2_custom.scss +1 -1
- data/app/assets/stylesheets/spree/backend/shared/_forms.scss +1 -1
- data/app/assets/stylesheets/spree/backend/shared/_sortable_tree.scss +62 -0
- data/app/assets/stylesheets/spree/backend/spree_admin.css.scss +3 -0
- data/app/assets/stylesheets/spree/backend/views/_digitals.scss +33 -0
- data/app/assets/stylesheets/spree/backend/views/{prototypes.scss → _prototypes.scss} +0 -0
- data/app/assets/stylesheets/spree/backend/views/_taxonomies.scss +3 -0
- data/app/controllers/spree/admin/base_controller.rb +4 -13
- data/app/controllers/spree/admin/digitals_controller.rb +33 -0
- data/app/controllers/spree/admin/general_settings_controller.rb +0 -5
- data/app/controllers/spree/admin/images_controller.rb +1 -1
- data/app/controllers/spree/admin/oauth_applications_controller.rb +17 -0
- data/app/controllers/spree/admin/orders/customer_details_controller.rb +2 -2
- data/app/controllers/spree/admin/orders_controller.rb +10 -2
- data/app/controllers/spree/admin/payment_methods_controller.rb +2 -2
- data/app/controllers/spree/admin/payments_controller.rb +1 -1
- data/app/controllers/spree/admin/products_controller.rb +4 -2
- data/app/controllers/spree/admin/promotions_controller.rb +1 -1
- data/app/controllers/spree/admin/properties_controller.rb +1 -1
- data/app/controllers/spree/admin/resource_controller.rb +9 -4
- data/app/controllers/spree/admin/return_index_controller.rb +3 -4
- data/app/controllers/spree/admin/stock_transfers_controller.rb +2 -2
- data/app/controllers/spree/admin/store_credits_controller.rb +2 -2
- data/app/controllers/spree/admin/stores_controller.rb +2 -2
- data/app/controllers/spree/admin/taxons_controller.rb +23 -38
- data/app/controllers/spree/admin/users_controller.rb +6 -19
- data/app/controllers/spree/admin/variants_controller.rb +1 -2
- data/app/controllers/spree/admin/webhooks_subscribers_controller.rb +48 -0
- data/app/helpers/spree/admin/base_helper.rb +27 -9
- data/app/helpers/spree/admin/digital_helper.rb +28 -0
- data/app/helpers/spree/admin/menu_helper.rb +0 -21
- data/app/helpers/spree/admin/navigation_helper.rb +19 -9
- data/app/helpers/spree/admin/sortable_tree_helper.rb +31 -0
- data/app/helpers/spree/admin/stores_helper.rb +1 -1
- data/app/helpers/spree/admin/webhooks_subscribers_helper.rb +31 -0
- data/app/javascript/spree/dashboard/controllers/clipboard_controller.js +12 -0
- data/app/javascript/spree/dashboard/controllers/password_toggle_controller.js +14 -0
- data/app/javascript/spree/dashboard/controllers/sortable_tree_controller.js +55 -0
- data/app/javascript/spree/dashboard/controllers/spree_controller.js +25 -0
- data/app/javascript/spree/dashboard/controllers/upload_button_controller.js +13 -0
- data/app/javascript/spree/dashboard/controllers/webhooks_subscriber_events_controller.js +19 -0
- data/app/javascript/spree/dashboard/index.js +49 -0
- data/app/{assets/javascripts/spree/backend/global/bootstrap.es6 → javascript/spree/dashboard/utilities/bootstrap.js} +6 -2
- data/app/javascript/spree/dashboard/utilities/request_utility.js +54 -0
- data/app/models/spree/backend_configuration.rb +11 -0
- data/app/views/spree/admin/adjustments/_form.html.erb +2 -2
- data/app/views/spree/admin/adjustments/index.html.erb +1 -0
- data/app/views/spree/admin/cms_pages/_form.html.erb +8 -8
- data/app/views/spree/admin/cms_pages/edit.html.erb +1 -6
- data/app/views/spree/admin/cms_sections/_form.html.erb +2 -2
- data/app/views/spree/admin/cms_sections/types/_featured_article.html.erb +6 -6
- data/app/views/spree/admin/cms_sections/types/_hero_image.html.erb +6 -6
- data/app/views/spree/admin/cms_sections/types/_image_gallery.html.erb +12 -12
- data/app/views/spree/admin/cms_sections/types/_rich_text_content.html.erb +1 -1
- data/app/views/spree/admin/cms_sections/types/_side_by_side_images.html.erb +12 -12
- data/app/views/spree/admin/countries/_form.html.erb +4 -4
- data/app/views/spree/admin/customer_returns/new.html.erb +1 -1
- data/app/views/spree/admin/digitals/_form.html.erb +35 -0
- data/app/views/spree/admin/digitals/index.html.erb +25 -0
- data/app/views/spree/admin/general_settings/edit.html.erb +1 -22
- data/app/views/spree/admin/menu_items/_form.html.erb +6 -6
- data/app/views/spree/admin/menus/_form.html.erb +3 -3
- data/app/views/spree/admin/menus/edit.html.erb +18 -18
- data/app/views/spree/admin/oauth_applications/_form.html.erb +22 -0
- data/app/views/spree/admin/oauth_applications/create.turbo_stream.erb +38 -0
- data/app/views/spree/admin/oauth_applications/edit.html.erb +13 -0
- data/app/views/spree/admin/oauth_applications/index.html.erb +51 -0
- data/app/views/spree/admin/oauth_applications/new.html.erb +15 -0
- data/app/views/spree/admin/option_types/_form.html.erb +3 -3
- data/app/views/spree/admin/option_types/_option_value_fields.html.erb +2 -2
- data/app/views/spree/admin/orders/_channel_form.html.erb +1 -1
- data/app/views/spree/admin/orders/_form.html.erb +1 -0
- data/app/views/spree/admin/orders/_line_items_edit_form.html.erb +1 -0
- data/app/views/spree/admin/orders/_order_actions.html.erb +6 -0
- data/app/views/spree/admin/orders/_search.html.erb +151 -0
- data/app/views/spree/admin/orders/index.html.erb +2 -151
- data/app/views/spree/admin/payment_methods/_form.html.erb +2 -2
- data/app/views/spree/admin/payments/_list.html.erb +1 -1
- data/app/views/spree/admin/products/_form.html.erb +19 -20
- data/app/views/spree/admin/products/index.html.erb +2 -1
- data/app/views/spree/admin/products/new.html.erb +6 -6
- data/app/views/spree/admin/promotion_actions/create.js.erb +1 -1
- data/app/views/spree/admin/promotion_categories/_form.html.erb +2 -2
- data/app/views/spree/admin/promotions/_form.html.erb +5 -5
- data/app/views/spree/admin/properties/_form.html.erb +3 -3
- data/app/views/spree/admin/prototypes/_form.html.erb +4 -4
- data/app/views/spree/admin/refunds/new.html.erb +2 -2
- data/app/views/spree/admin/reimbursement_types/_form.html.erb +2 -2
- data/app/views/spree/admin/return_authorizations/_form.html.erb +3 -3
- data/app/views/spree/admin/roles/_form.html.erb +1 -1
- data/app/views/spree/admin/shared/_account_nav.html.erb +1 -1
- data/app/views/spree/admin/shared/_address_form.html.erb +4 -4
- data/app/views/spree/admin/shared/_head.html.erb +4 -8
- data/app/views/spree/admin/shared/_main_menu.html.erb +12 -0
- data/app/views/spree/admin/shared/_new_resource_links.html.erb +1 -1
- data/app/views/spree/admin/shared/_product_tabs.html.erb +8 -0
- data/app/views/spree/admin/shared/_version.html.erb +1 -1
- data/app/views/spree/admin/shared/cms/_spree_product.html.erb +2 -2
- data/app/views/spree/admin/shared/cms/_spree_taxon.html.erb +2 -2
- data/app/views/spree/admin/shared/linkables/_spree_cms_page.erb +2 -2
- data/app/views/spree/admin/shared/linkables/_spree_product.html.erb +2 -2
- data/app/views/spree/admin/shared/linkables/_spree_taxon.html.erb +2 -2
- data/app/views/spree/admin/shared/linkables/_url.html.erb +1 -1
- data/app/views/spree/admin/shared/named_types/_form.html.erb +1 -1
- data/app/views/spree/admin/{menus/nested_menu_items/_item_bar.html.erb → shared/sortable_tree/_menu.html.erb} +10 -7
- data/app/views/spree/admin/shared/sortable_tree/_taxonomy.html.erb +34 -0
- data/app/views/spree/admin/shared/sub_menu/_apps.html.erb +3 -0
- data/app/views/spree/admin/shared/sub_menu/_integrations.html.erb +3 -0
- data/app/views/spree/admin/shipping_categories/_form.html.erb +1 -1
- data/app/views/spree/admin/shipping_methods/_form.html.erb +8 -8
- data/app/views/spree/admin/states/_form.html.erb +2 -2
- data/app/views/spree/admin/stock_locations/_form.html.erb +2 -2
- data/app/views/spree/admin/stock_movements/_form.html.erb +3 -3
- data/app/views/spree/admin/store_credit_categories/_form.html.erb +1 -1
- data/app/views/spree/admin/store_credits/_form.html.erb +4 -4
- data/app/views/spree/admin/stores/_form.html.erb +280 -227
- data/app/views/spree/admin/tax_categories/_form.html.erb +4 -4
- data/app/views/spree/admin/tax_rates/_form.html.erb +4 -3
- data/app/views/spree/admin/taxonomies/_form.html.erb +2 -2
- data/app/views/spree/admin/taxonomies/edit.html.erb +34 -29
- data/app/views/spree/admin/taxons/_form.html.erb +101 -57
- data/app/views/spree/admin/taxons/edit.html.erb +6 -3
- data/app/views/spree/admin/taxons/index.html.erb +1 -1
- data/app/views/spree/admin/taxons/new.html.erb +16 -0
- data/app/views/spree/admin/users/_form.html.erb +3 -3
- data/app/views/spree/admin/users/edit.html.erb +0 -40
- data/app/views/spree/admin/variants/_autocomplete.js.erb +5 -5
- data/app/views/spree/admin/variants/_autocomplete_line_items_stock.js.erb +2 -2
- data/app/views/spree/admin/variants/_autocomplete_stock.js.erb +6 -6
- data/app/views/spree/admin/variants/_split.js.erb +1 -1
- data/app/views/spree/admin/variants/index.html.erb +4 -1
- data/app/views/spree/admin/webhooks_subscribers/_form.html.erb +101 -0
- data/app/views/spree/admin/webhooks_subscribers/edit.html.erb +13 -0
- data/app/views/spree/admin/webhooks_subscribers/index.html.erb +47 -0
- data/app/views/spree/admin/webhooks_subscribers/new.html.erb +13 -0
- data/app/views/spree/admin/webhooks_subscribers/show.html.erb +59 -0
- data/app/views/spree/admin/zones/_country_members.html.erb +1 -1
- data/app/views/spree/admin/zones/_form.html.erb +2 -2
- data/app/views/spree/admin/zones/_state_members.html.erb +1 -1
- data/app/views/spree/layouts/admin.html.erb +1 -11
- data/codespell.txt +8 -0
- data/config/locales/en.yml +273 -0
- data/config/routes.rb +6 -2
- data/lib/generators/spree/backend/install/install_generator.rb +4 -2
- data/lib/generators/spree/backend/install/templates/app/javascript/spree-dashboard.js +7 -0
- data/lib/spree/backend/engine.rb +2 -1
- data/lib/spree/backend/testing_support/capybara_utils.rb +53 -0
- data/lib/spree/backend/testing_support/flash.rb +38 -0
- data/lib/spree/backend/testing_support/flatpickr_capybara.rb +126 -0
- data/lib/spree/backend/version.rb +9 -0
- data/lib/spree/backend.rb +2 -1
- data/lib/spree_backend.rb +17 -0
- data/license.md +13 -0
- data/package.json +45 -0
- data/rollup.config.js +41 -0
- data/spree_backend.gemspec +17 -16
- data/vendor/assets/javascripts/purify.js +1 -1
- data/vendor/assets/stylesheets/animate.css +2 -4
- data/yarn.lock +944 -0
- metadata +118 -36
- data/app/assets/javascripts/spree/backend/menus/menu.es6 +0 -57
- data/app/assets/javascripts/spree/backend/taxon_permalink_preview.js +0 -11
- data/app/assets/javascripts/spree/backend/taxon_tree_menu.js +0 -35
- data/app/assets/javascripts/spree/backend/taxonomy.js +0 -178
- data/app/views/spree/admin/taxonomies/_js_head.html.erb +0 -7
- data/vendor/assets/javascripts/jquery.jstree/jquery.jstree.js +0 -4564
- data/vendor/assets/javascripts/js.cookie.js +0 -163
- data/vendor/assets/javascripts/modernizr.js +0 -3
- data/vendor/assets/stylesheets/jquery.jstree/themes/spree/style.scss +0 -230
- data/vendor/assets/stylesheets/jquery.jstree/themes/spree/throbber.gif +0 -0
@@ -0,0 +1,126 @@
|
|
1
|
+
module Spree
|
2
|
+
module Backend
|
3
|
+
module TestingSupport
|
4
|
+
module FlatpickrCapybara
|
5
|
+
def fill_in_date_manually(label_text, options = {})
|
6
|
+
with_open_flatpickr(label_text) do |field|
|
7
|
+
fill_in field[:id], with: string_date(options)
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
def fill_in_date_picker(label_text, options = {})
|
12
|
+
if options[:hour].blank? && options[:minute].blank?
|
13
|
+
flatpickr_date_only(label_text, options)
|
14
|
+
else
|
15
|
+
flatpickr_date_time(label_text, options)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def fill_in_date_with_js(label_text, options = {})
|
20
|
+
date_field = find("input[id='#{label_text}']")
|
21
|
+
script = "document.querySelector('#{date_field}').flatpickr().setDate('#{string_date(options)}');"
|
22
|
+
|
23
|
+
page.execute_script(script)
|
24
|
+
end
|
25
|
+
|
26
|
+
private
|
27
|
+
|
28
|
+
def flatpickr_date_only(label_text, options = {})
|
29
|
+
within_open_flatpickr(label_text) do
|
30
|
+
within_flatpickr_months do
|
31
|
+
fill_in_flatpickr_year(options[:year].to_i)
|
32
|
+
sleep(0.25) # Pause to let JavaScript adjust the month selector in the flatpickr cal in relation to any related FROM...TO cal.
|
33
|
+
|
34
|
+
select_flatpickr_month(options[:month].to_i)
|
35
|
+
sleep(0.25) # Pause to let JavaScript adjust the day selection area in the flatpickr cal in relation to any related FROM...TO cal.
|
36
|
+
|
37
|
+
click_on_flatpickr_day(options[:day].to_i)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
def flatpickr_date_time(label_text, options = {})
|
43
|
+
within_open_flatpickr(label_text) do
|
44
|
+
within_flatpickr_months do
|
45
|
+
fill_in_flatpickr_year(options[:year].to_i)
|
46
|
+
sleep(0.25) # Pause to let JavaScript adjust the month selector in the flatpickr cal in relation to any related FROM...TO cal.
|
47
|
+
|
48
|
+
select_flatpickr_month(options[:month].to_i)
|
49
|
+
sleep(0.25) # Pause to let JavaScript adjust the day selection area in the flatpickr cal in relation to any related FROM...TO cal.
|
50
|
+
|
51
|
+
click_on_flatpickr_day(options[:day].to_i)
|
52
|
+
end
|
53
|
+
|
54
|
+
within_flatpickr_time do
|
55
|
+
select_flatpickr_hour(options[:hour].to_i)
|
56
|
+
select_flatpickr_min(options[:minute].to_i)
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
def with_open_flatpickr(label_text)
|
62
|
+
field_label = find_field(id: label_text, type: :hidden)
|
63
|
+
|
64
|
+
date_field = field_label.sibling('.flatpickr-alt-input')
|
65
|
+
date_field.click # Open the flatpickr cal.
|
66
|
+
sleep(0.25) # Pause to let JavaScript populate DOM with an open flatpickr cal.
|
67
|
+
|
68
|
+
yield(date_field) # Complete required action within the open flatpickr cal.
|
69
|
+
|
70
|
+
date_field.send_keys :tab # Close the date flatpickr cal.
|
71
|
+
sleep(0.25) # Pause to let JavaScript adjust any DOM values in relation to any related FROM...TO cal.
|
72
|
+
end
|
73
|
+
|
74
|
+
def within_open_flatpickr(label_text, &block)
|
75
|
+
with_open_flatpickr(label_text) do
|
76
|
+
within find('.flatpickr-calendar.open', &block)
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
def within_flatpickr_months(&block)
|
81
|
+
within find('.flatpickr-months > .flatpickr-month > .flatpickr-current-month', &block)
|
82
|
+
end
|
83
|
+
|
84
|
+
def within_flatpickr_time(&block)
|
85
|
+
within find('.flatpickr-time', &block)
|
86
|
+
end
|
87
|
+
|
88
|
+
def select_flatpickr_month(month)
|
89
|
+
accurate_month = (month.to_i - 1)
|
90
|
+
|
91
|
+
find("select.flatpickr-monthDropdown-months > option[value='#{accurate_month}']").select_option
|
92
|
+
end
|
93
|
+
|
94
|
+
def fill_in_flatpickr_year(year)
|
95
|
+
find('input.cur-year').set(year)
|
96
|
+
end
|
97
|
+
|
98
|
+
def click_on_flatpickr_day(day)
|
99
|
+
within_flatpickr_days do
|
100
|
+
find('.flatpickr-day:not(.prevMonthDay):not(.nextMonthDay)', text: day, exact_text: true).click
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
def within_flatpickr_days(&block)
|
105
|
+
within find('.flatpickr-innerContainer > .flatpickr-rContainer > .flatpickr-days > .dayContainer', &block)
|
106
|
+
end
|
107
|
+
|
108
|
+
def select_flatpickr_hour(hour)
|
109
|
+
find('input.flatpickr-hour').set(hour)
|
110
|
+
end
|
111
|
+
|
112
|
+
def select_flatpickr_min(min)
|
113
|
+
find('input.flatpickr-minute').set(min)
|
114
|
+
end
|
115
|
+
|
116
|
+
def string_date(options)
|
117
|
+
if options[:hour].present? && options[:minute].present?
|
118
|
+
"#{options[:year]}-#{options[:month]}-#{options[:day]}-#{options[:hour]}-#{options[:minute]}"
|
119
|
+
else
|
120
|
+
"#{options[:year]}-#{options[:month]}-#{options[:day]}"
|
121
|
+
end
|
122
|
+
end
|
123
|
+
end
|
124
|
+
end
|
125
|
+
end
|
126
|
+
end
|
data/lib/spree/backend.rb
CHANGED
data/lib/spree_backend.rb
CHANGED
@@ -1 +1,18 @@
|
|
1
1
|
require 'spree/backend'
|
2
|
+
|
3
|
+
module Spree
|
4
|
+
def self.admin_path
|
5
|
+
Spree::Backend::Config[:admin_path]
|
6
|
+
end
|
7
|
+
|
8
|
+
# Used to configure admin_path for Spree
|
9
|
+
#
|
10
|
+
# Example:
|
11
|
+
#
|
12
|
+
# write the following line in `config/initializers/spree.rb`
|
13
|
+
# Spree.admin_path = '/custom-path'
|
14
|
+
|
15
|
+
def self.admin_path=(path)
|
16
|
+
Spree::Backend::Config[:admin_path] = path
|
17
|
+
end
|
18
|
+
end
|
data/license.md
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
Spree License
|
2
|
+
=============
|
3
|
+
|
4
|
+
Copyright © 2007-2021, Spree Commerce Inc., Spark Solutions Sp. z o.o. and other contributors.
|
5
|
+
All rights reserved.
|
6
|
+
|
7
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
8
|
+
|
9
|
+
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
10
|
+
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
11
|
+
* Neither the name of Spree Commerce Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
12
|
+
|
13
|
+
_This software is provided by the copyright holders and contributors "as is" and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall the copyright owner or contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage._
|
data/package.json
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
{
|
2
|
+
"name": "@spree/dashboard",
|
3
|
+
"version": "0.1.0",
|
4
|
+
"description": "Spree Dashboard",
|
5
|
+
"main": "app/assets/javascripts/spree-dashboard.js",
|
6
|
+
"type": "module",
|
7
|
+
"files": [
|
8
|
+
"app/assets/javascripts/*.js",
|
9
|
+
"src/*.js"
|
10
|
+
],
|
11
|
+
"homepage": "https://spreecommerce.org/",
|
12
|
+
"repository": {
|
13
|
+
"type": "git",
|
14
|
+
"url": "git+https://github.com/spree/spree_backend.git"
|
15
|
+
},
|
16
|
+
"bugs": {
|
17
|
+
"url": "https://github.com/spree/spree_backend/issues"
|
18
|
+
},
|
19
|
+
"author": "Spark Solutions <hi@sparksolutions.co>",
|
20
|
+
"license": "MIT",
|
21
|
+
"dependencies": {
|
22
|
+
"@hotwired/stimulus": "^3.0.1",
|
23
|
+
"@hotwired/turbo": "^7.0.1",
|
24
|
+
"@rails/request.js": "^0.0.5",
|
25
|
+
"bootstrap": "4.6.1",
|
26
|
+
"flatpickr": "^4.6.9",
|
27
|
+
"jquery": "3.5.1",
|
28
|
+
"popper.js": "1.16.1",
|
29
|
+
"sortablejs": "^1.14.0",
|
30
|
+
"stimulus-sortable": "^3.1.0"
|
31
|
+
},
|
32
|
+
"devDependencies": {
|
33
|
+
"@rollup/plugin-commonjs": "^19.0.1",
|
34
|
+
"@rollup/plugin-node-resolve": "^11.0.1",
|
35
|
+
"eslint": "^8.2.0",
|
36
|
+
"rollup": "^2.35.1",
|
37
|
+
"rollup-plugin-terser": "^7.0.2"
|
38
|
+
},
|
39
|
+
"scripts": {
|
40
|
+
"build": "rollup --config rollup.config.js",
|
41
|
+
"watch": "rollup --config rollup.config.js -w",
|
42
|
+
"lint": "eslint app/javascript",
|
43
|
+
"prepublishOnly": "rm -rf src && cp -R app/javascript/spree/dashboard src"
|
44
|
+
}
|
45
|
+
}
|
data/rollup.config.js
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
import resolve from "@rollup/plugin-node-resolve"
|
2
|
+
import commonjs from "@rollup/plugin-commonjs"
|
3
|
+
import { terser } from "rollup-plugin-terser"
|
4
|
+
|
5
|
+
const terserOptions = {
|
6
|
+
mangle: false,
|
7
|
+
compress: false,
|
8
|
+
format: {
|
9
|
+
beautify: true,
|
10
|
+
indent_level: 2
|
11
|
+
}
|
12
|
+
}
|
13
|
+
|
14
|
+
export default [
|
15
|
+
{
|
16
|
+
input: "app/javascript/spree/dashboard/index.js",
|
17
|
+
output: {
|
18
|
+
file: "app/assets/javascripts/spree-dashboard.js",
|
19
|
+
format: "umd",
|
20
|
+
name: "SpreeDashboard"
|
21
|
+
},
|
22
|
+
plugins: [
|
23
|
+
resolve(),
|
24
|
+
commonjs(),
|
25
|
+
terser(terserOptions)
|
26
|
+
]
|
27
|
+
},
|
28
|
+
|
29
|
+
{
|
30
|
+
input: "app/javascript/spree/dashboard/index.js",
|
31
|
+
output: {
|
32
|
+
file: "app/assets/javascripts/spree-dashboard.esm.js",
|
33
|
+
format: "es"
|
34
|
+
},
|
35
|
+
plugins: [
|
36
|
+
resolve(),
|
37
|
+
commonjs(),
|
38
|
+
terser(terserOptions)
|
39
|
+
]
|
40
|
+
}
|
41
|
+
]
|
data/spree_backend.gemspec
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
# encoding: UTF-8
|
2
|
-
require_relative '
|
2
|
+
require_relative 'lib/spree/backend/version.rb'
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.platform = Gem::Platform::RUBY
|
6
6
|
s.name = 'spree_backend'
|
7
|
-
s.version = Spree.version
|
7
|
+
s.version = Spree::Backend.version
|
8
8
|
s.authors = ['Sean Schofield', 'Spark Solutions']
|
9
9
|
s.email = 'hello@spreecommerce.org'
|
10
10
|
s.summary = 'Admin Dashboard for Spree eCommerce platform'
|
@@ -13,10 +13,10 @@ Gem::Specification.new do |s|
|
|
13
13
|
s.license = 'BSD-3-Clause'
|
14
14
|
|
15
15
|
s.metadata = {
|
16
|
-
"bug_tracker_uri" => "https://github.com/spree/
|
17
|
-
"changelog_uri" => "https://github.com/spree/
|
16
|
+
"bug_tracker_uri" => "https://github.com/spree/spree_backend/issues",
|
17
|
+
"changelog_uri" => "https://github.com/spree/spree_backend/releases/tag/v#{s.version}",
|
18
18
|
"documentation_uri" => "https://dev-docs.spreecommerce.org/",
|
19
|
-
"source_code_uri" => "https://github.com/spree/
|
19
|
+
"source_code_uri" => "https://github.com/spree/spree_backend/tree/v#{s.version}",
|
20
20
|
}
|
21
21
|
|
22
22
|
s.required_ruby_version = '>= 2.5'
|
@@ -25,19 +25,20 @@ Gem::Specification.new do |s|
|
|
25
25
|
s.require_path = 'lib'
|
26
26
|
s.requirements << 'none'
|
27
27
|
|
28
|
-
s.add_dependency '
|
29
|
-
s.add_dependency 'spree_core', ">= #{s.version}"
|
28
|
+
s.add_dependency 'spree', ">= 4.4.0.rc1"
|
30
29
|
|
31
30
|
s.add_dependency 'babel-transpiler', '~> 0.7'
|
32
|
-
s.add_dependency 'bootstrap',
|
33
|
-
s.add_dependency 'glyphicons',
|
34
|
-
s.add_dependency 'flatpickr',
|
35
|
-
s.add_dependency '
|
36
|
-
s.add_dependency '
|
37
|
-
s.add_dependency '
|
31
|
+
s.add_dependency 'bootstrap', '~> 4.0'
|
32
|
+
s.add_dependency 'glyphicons', '~> 1.0'
|
33
|
+
s.add_dependency 'flatpickr', '~> 4.6'
|
34
|
+
s.add_dependency 'hotwire-rails'
|
35
|
+
s.add_dependency 'inline_svg', '~> 1.5'
|
36
|
+
s.add_dependency 'jsbundling-rails'
|
37
|
+
s.add_dependency 'jquery-rails', '~> 4.3'
|
38
|
+
s.add_dependency 'jquery-ui-rails', '~> 6.0'
|
38
39
|
s.add_dependency 'responders'
|
39
|
-
s.add_dependency 'sass-rails',
|
40
|
-
s.add_dependency 'select2-rails',
|
41
|
-
s.add_dependency 'sprockets',
|
40
|
+
s.add_dependency 'sass-rails', '>= 5'
|
41
|
+
s.add_dependency 'select2-rails', '~> 4.0'
|
42
|
+
s.add_dependency 'sprockets', '~> 4.0'
|
42
43
|
s.add_dependency 'tinymce-rails'
|
43
44
|
end
|
@@ -347,7 +347,7 @@
|
|
347
347
|
* DOMPurify. */
|
348
348
|
var RETURN_DOM_IMPORT = false;
|
349
349
|
|
350
|
-
/* Try to return a Trusted Type object instead of a string,
|
350
|
+
/* Try to return a Trusted Type object instead of a string, return a string in
|
351
351
|
* case Trusted Types are not supported */
|
352
352
|
var RETURN_TRUSTED_TYPE = false;
|
353
353
|
|