spree_backend 4.7.1 → 4.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (130) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +36 -129
  3. data/.github/CONTRIBUTING.md +1 -1
  4. data/.ruby-version +1 -0
  5. data/Gemfile +4 -3
  6. data/README.md +5 -38
  7. data/SECURITY.md +1 -1
  8. data/app/assets/config/spree_backend_manifest.js +4 -1
  9. data/app/assets/images/favicon.png +0 -0
  10. data/app/assets/images/favicon_dark_bg.png +0 -0
  11. data/app/assets/images/logo_dark.png +0 -0
  12. data/app/assets/images/logo_light.png +0 -0
  13. data/app/assets/images/spark_solutions_logo.png +0 -0
  14. data/app/assets/images/vendo_logo.png +0 -0
  15. data/app/assets/javascripts/spree/backend/global/_index.js +1 -0
  16. data/app/assets/javascripts/spree/backend/global/tinymce.es6 +2 -2
  17. data/app/assets/javascripts/spree/backend/global/tooltips.es6 +21 -0
  18. data/app/assets/javascripts/spree/backend.js +3 -0
  19. data/app/assets/stylesheets/spree/backend/components/_buttons.scss +0 -4
  20. data/app/assets/stylesheets/spree/backend/components/_navbar.scss +4 -7
  21. data/app/assets/stylesheets/spree/backend/components/_tables.scss +0 -1
  22. data/app/assets/stylesheets/spree/backend/global/_variables.scss +16 -2
  23. data/app/assets/stylesheets/spree/backend/plugins/_sweetalert2_custom.scss +1 -1
  24. data/app/assets/stylesheets/spree/backend/shared/_base.scss +0 -2
  25. data/app/helpers/spree/admin/base_helper.rb +8 -0
  26. data/app/helpers/spree/admin/navigation_helper.rb +1 -1
  27. data/app/helpers/spree/admin/stores_helper.rb +3 -3
  28. data/app/javascript/spree/backend/application.js +5 -0
  29. data/app/javascript/spree/{dashboard → backend}/controllers/clipboard_controller.js +0 -1
  30. data/app/javascript/spree/backend/controllers/index.js +11 -0
  31. data/app/javascript/spree/{dashboard → backend}/controllers/sortable_tree_controller.js +1 -1
  32. data/app/javascript/spree/backend/helpers/index.js +1 -0
  33. data/app/javascript/spree/{dashboard/utilities → backend/helpers}/request_utility.js +1 -1
  34. data/app/models/spree/admin/actions/action.rb +1 -1
  35. data/app/models/spree/admin/updater.rb +35 -0
  36. data/app/views/spree/admin/adjustments/_adjustments_table.html.erb +1 -1
  37. data/app/views/spree/admin/cms_pages/_form.html.erb +3 -3
  38. data/app/views/spree/admin/cms_pages/_live_preview_area.html.erb +1 -1
  39. data/app/views/spree/admin/cms_pages/index.html.erb +1 -1
  40. data/app/views/spree/admin/countries/index.html.erb +1 -1
  41. data/app/views/spree/admin/customer_returns/_return_item_decision.html.erb +1 -1
  42. data/app/views/spree/admin/customer_returns/index.html.erb +1 -1
  43. data/app/views/spree/admin/dashboard/_getting_started.html.erb +18 -18
  44. data/app/views/spree/admin/data_feeds/index.html.erb +1 -1
  45. data/app/views/spree/admin/images/index.html.erb +1 -1
  46. data/app/views/spree/admin/menus/edit.html.erb +1 -1
  47. data/app/views/spree/admin/menus/index.html.erb +1 -1
  48. data/app/views/spree/admin/oauth_applications/index.html.erb +3 -3
  49. data/app/views/spree/admin/option_types/_option_value_fields.html.erb +1 -1
  50. data/app/views/spree/admin/option_types/edit.html.erb +1 -1
  51. data/app/views/spree/admin/option_types/index.html.erb +2 -2
  52. data/app/views/spree/admin/orders/_channel_form.html.erb +1 -1
  53. data/app/views/spree/admin/orders/_line_items.html.erb +1 -1
  54. data/app/views/spree/admin/orders/_shipment.html.erb +14 -12
  55. data/app/views/spree/admin/orders/_shipment_manifest.html.erb +1 -1
  56. data/app/views/spree/admin/payment_methods/_form.html.erb +15 -2
  57. data/app/views/spree/admin/payment_methods/index.html.erb +2 -2
  58. data/app/views/spree/admin/product_properties/_product_property_fields.html.erb +3 -3
  59. data/app/views/spree/admin/products/_autocomplete.js.erb +1 -1
  60. data/app/views/spree/admin/promotion_categories/index.html.erb +1 -1
  61. data/app/views/spree/admin/promotions/_actions.html.erb +1 -1
  62. data/app/views/spree/admin/promotions/_rules.html.erb +1 -1
  63. data/app/views/spree/admin/promotions/calculators/tiered_flat_rate/_fields.html.erb +1 -1
  64. data/app/views/spree/admin/promotions/calculators/tiered_percent/_fields.html.erb +1 -1
  65. data/app/views/spree/admin/promotions/index.html.erb +2 -2
  66. data/app/views/spree/admin/promotions/rules/_option_value.html.erb +1 -1
  67. data/app/views/spree/admin/properties/index.html.erb +1 -1
  68. data/app/views/spree/admin/prototypes/_prototypes.html.erb +1 -1
  69. data/app/views/spree/admin/prototypes/index.html.erb +1 -1
  70. data/app/views/spree/admin/reimbursement_types/index.html.erb +1 -1
  71. data/app/views/spree/admin/return_authorizations/index.html.erb +1 -1
  72. data/app/views/spree/admin/roles/index.html.erb +1 -1
  73. data/app/views/spree/admin/shared/_account_nav.html.erb +31 -17
  74. data/app/views/spree/admin/shared/_edit_resource_links.html.erb +1 -1
  75. data/app/views/spree/admin/shared/_head.html.erb +7 -1
  76. data/app/views/spree/admin/shared/_header.html.erb +27 -19
  77. data/app/views/spree/admin/shared/_new_resource_links.html.erb +1 -1
  78. data/app/views/spree/admin/shared/_order_tabs.html.erb +1 -11
  79. data/app/views/spree/admin/shared/_product_tabs.html.erb +1 -11
  80. data/app/views/spree/admin/shared/_store_switcher.html.erb +5 -5
  81. data/app/views/spree/admin/shared/_tabs.html.erb +11 -0
  82. data/app/views/spree/admin/shared/_version.html.erb +20 -7
  83. data/app/views/spree/admin/shared/named_types/_index.html.erb +1 -1
  84. data/app/views/spree/admin/shipping_categories/index.html.erb +1 -1
  85. data/app/views/spree/admin/shipping_methods/index.html.erb +1 -1
  86. data/app/views/spree/admin/states/index.html.erb +1 -1
  87. data/app/views/spree/admin/stock_locations/index.html.erb +1 -1
  88. data/app/views/spree/admin/stock_movements/index.html.erb +1 -1
  89. data/app/views/spree/admin/stock_transfers/index.html.erb +1 -1
  90. data/app/views/spree/admin/stock_transfers/show.html.erb +1 -1
  91. data/app/views/spree/admin/store_credit_categories/index.html.erb +1 -1
  92. data/app/views/spree/admin/stores/edit.html.erb +1 -1
  93. data/app/views/spree/admin/stores/index.html.erb +1 -1
  94. data/app/views/spree/admin/tax_categories/index.html.erb +1 -1
  95. data/app/views/spree/admin/tax_rates/index.html.erb +1 -1
  96. data/app/views/spree/admin/taxonomies/_list.html.erb +1 -1
  97. data/app/views/spree/admin/taxonomies/edit.html.erb +1 -1
  98. data/app/views/spree/admin/taxonomies/index.html.erb +1 -1
  99. data/app/views/spree/admin/users/_tabs.html.erb +1 -11
  100. data/app/views/spree/admin/variants/_autocomplete_line_items_stock.js.erb +3 -3
  101. data/app/views/spree/admin/variants/_autocomplete_stock.js.erb +2 -2
  102. data/app/views/spree/admin/variants/_split.js.erb +1 -1
  103. data/app/views/spree/admin/variants/index.html.erb +1 -1
  104. data/app/views/spree/admin/webhooks_subscribers/index.html.erb +12 -1
  105. data/app/views/spree/admin/zones/index.html.erb +1 -1
  106. data/app/views/spree/layouts/admin.html.erb +1 -1
  107. data/config/importmap.rb +9 -0
  108. data/config/locales/en.yml +4 -1
  109. data/lib/generators/spree/backend/install/install_generator.rb +0 -2
  110. data/lib/spree/backend/configuration.rb +0 -2
  111. data/lib/spree/backend/engine.rb +13 -0
  112. data/lib/spree/backend/runtime_configuration.rb +8 -0
  113. data/lib/spree/backend/version.rb +1 -1
  114. data/lib/spree/backend.rb +4 -2
  115. data/lib/spree_backend.rb +2 -2
  116. data/license.md +8 -3
  117. data/spree_backend.gemspec +6 -4
  118. metadata +70 -28
  119. data/app/assets/images/admin/logo.png +0 -0
  120. data/app/javascript/spree/dashboard/index.js +0 -54
  121. data/app/javascript/spree/dashboard/utilities/bootstrap.js +0 -17
  122. data/lib/generators/spree/backend/install/templates/app/javascript/spree-dashboard.js +0 -6
  123. data/package.json +0 -46
  124. data/rollup.config.js +0 -43
  125. data/yarn.lock +0 -1012
  126. /data/app/javascript/spree/{dashboard → backend}/controllers/password_toggle_controller.js +0 -0
  127. /data/app/javascript/spree/{dashboard → backend}/controllers/product_edit_controller.js +0 -0
  128. /data/app/javascript/spree/{dashboard → backend}/controllers/spree_controller.js +0 -0
  129. /data/app/javascript/spree/{dashboard → backend}/controllers/upload_button_controller.js +0 -0
  130. /data/app/javascript/spree/{dashboard → backend}/controllers/webhooks_subscriber_events_controller.js +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 59f19e0ef61d647e5f849d61e2edfd0027d55ac89e1fea4e9990aa7782d973b3
4
- data.tar.gz: 1646f1a5a5af36d79a06064eb74e04b2b39837c8415e003175fb9b5186b0cefb
3
+ metadata.gz: 3300d2767c8c33fab939d5c7c30dd41db56d9c422469820f8eaeef2bcf71ba6e
4
+ data.tar.gz: 745fb617eed98c7268c185eddc32eab136e6067624b712fbd85f9c777b520bbe
5
5
  SHA512:
6
- metadata.gz: dced348669db9b22b4dc638fcf67cc331d9dd313c1bb7e89a638967bd5809ecc4c5ab65963b5578b855d40fde4c14caec673e7fcde52771bb38822cd19d02bc2
7
- data.tar.gz: c22016785bc6b36dae52c31c433ef9f019ee980bca9aaab2212427e74b0e7fda46bfa941ced8545c68b1acfbe45dcf3c1e17589bda46ab3b52393a067585503b
6
+ metadata.gz: e291674023a82d06681356deeffcfe747da3450e835f6fbbd7ca81be1782bc54be59471a9bf1040ea2ee0b685a30f7a2a2e20cda76d1c6a7b5c8b1016f797f0c
7
+ data.tar.gz: 27ca5a00563290b6523fa8ff3bcc73f00c8e4a250c319942e15f556c129021603f0555003603ac68f93e196b04cbb45b8dfb11f1ed619d5f3b814cc3c0edaaf7
data/.circleci/config.yml CHANGED
@@ -10,24 +10,17 @@ defaults: &defaults
10
10
  RAILS_VERSION: '~> 7.1.0'
11
11
  working_directory: ~/spree
12
12
  docker:
13
- - image: &ruby_3_0_image circleci/ruby:3.0-node-browsers
14
- - image: &redis_image circleci/redis:6.2-alpine
13
+ - image: &ruby_image cimg/ruby:3.3.0-browsers
15
14
 
16
- defaults_3_2: &defaults_3_2
17
- <<: *defaults
18
- docker:
19
- - image: &ruby_3_2_image cimg/ruby:3.2.0-browsers
20
- - image: *redis_image
21
-
22
- run_tests_3_0: &run_tests_3_0
15
+ run_tests: &run_tests
23
16
  <<: *defaults
24
17
  parallelism: 8
25
18
  steps:
26
19
  - checkout
27
20
  - restore_cache:
28
21
  keys:
29
- - spree-dashboard-bundle-v10-ruby-3-0-{{ .Branch }}
30
- - spree-dashboard-bundle-v10-ruby-3-0
22
+ - spree-storefront-bundle-{{ checksum ".ruby-version" }}-{{ .Branch }}
23
+ - spree-storefront-bundle-{{ checksum ".ruby-version" }}
31
24
  - run:
32
25
  name: Add keyserver
33
26
  command: sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4EB27DB2A3B88B8B
@@ -35,20 +28,16 @@ run_tests_3_0: &run_tests_3_0
35
28
  name: Install libvips
36
29
  command: sudo apt-get update && sudo apt-get install libvips
37
30
  - run:
38
- name: Set bundle path
39
- command: bundle config --local path vendor/bundle
31
+ name: Set bundle path
32
+ command: bundle config --local path vendor/bundle
40
33
  - run:
41
- name: Ensure bundle Install
42
- command: |
43
- bundle check || bundle install
34
+ name: Ensure Bundle Install
35
+ command: |
36
+ bundle check || bundle install
44
37
  - run:
45
38
  name: Create test app
46
39
  command: |
47
40
  bundle exec rake test_app
48
- - run:
49
- name: Unlink NPM package
50
- command: |
51
- cd spec/dummy && yarn unlink @spree/dashboard
52
41
  - run:
53
42
  name: Run Rspec
54
43
  command: |
@@ -60,57 +49,17 @@ run_tests_3_0: &run_tests_3_0
60
49
  - store_test_results:
61
50
  path: ~/rspec
62
51
  - store_artifacts:
63
- path: /tmp/test-artifacts
64
-
65
- run_tests_3_2: &run_tests_3_2
66
- <<: *defaults_3_2
67
- parallelism: 8
68
- steps:
69
- - checkout
70
- - restore_cache:
71
- keys:
72
- - spree-dashboard-bundle-v10-ruby-3-2-{{ .Branch }}
73
- - spree-dashboard-bundle-v10-ruby-3-2
74
- - run:
75
- name: Install libvips
76
- command: sudo apt-get update && sudo apt-get install libvips42
77
- - run:
78
- name: Set bundle path
79
- command: bundle config --local path vendor/bundle
80
- - run:
81
- name: Ensure bundle Install
82
- command: |
83
- bundle check || bundle install
84
- - run:
85
- name: Create test app
86
- command: |
87
- bundle exec rake test_app
88
- - run:
89
- name: Unlink NPM package
90
- command: |
91
- cd spec/dummy && yarn unlink @spree/dashboard
92
- - run:
93
- name: Run Rspec
94
- command: |
95
- TESTFILES=$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)
96
- bundle exec rspec --format documentation \
97
- --format RspecJunitFormatter \
98
- -o ~/rspec/rspec.xml \
99
- -- ${TESTFILES}
100
- - store_test_results:
101
- path: ~/rspec
102
- - store_artifacts:
103
- path: /tmp/test-artifacts
52
+ path: tmp/capybara
104
53
 
105
54
  jobs:
106
- bundle_ruby_3_0:
55
+ bundle:
107
56
  <<: *defaults
108
57
  steps:
109
58
  - checkout
110
59
  - restore_cache:
111
60
  keys:
112
- - spree-dashboard-bundle-v10-ruby-3-0-{{ .Branch }}
113
- - spree-dashboard-bundle-v10-ruby-3-0
61
+ - spree-storefront-bundle-{{ checksum ".ruby-version" }}-{{ .Branch }}
62
+ - spree-storefront-bundle-{{ checksum ".ruby-version" }}
114
63
  - run:
115
64
  name: Add keyserver
116
65
  command: sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4EB27DB2A3B88B8B
@@ -127,84 +76,42 @@ jobs:
127
76
  - save_cache:
128
77
  paths:
129
78
  - vendor/bundle
130
- key: spree-dashboard-bundle-v10-ruby-3-0-{{ checksum "Gemfile.lock" }}
79
+ key: spree-storefront-bundle-{{ checksum ".ruby-version" }}-{{ .Branch }}
131
80
 
132
- bundle_ruby_3_2:
133
- <<: *defaults_3_2
134
- steps:
135
- - checkout
136
- - restore_cache:
137
- keys:
138
- - spree-dashboard-bundle-v10-ruby-3-2-{{ .Branch }}
139
- - spree-dashboard-bundle-v10-ruby-3-2
140
- - run:
141
- name: Install libvips
142
- command: sudo apt-get update && sudo apt-get install libvips42
143
- - run:
144
- name: Set bundle path
145
- command: bundle config --local path vendor/bundle
146
- - run:
147
- name: Bundle Install
148
- command: |
149
- bundle check || bundle install
150
- - save_cache:
151
- paths:
152
- - vendor/bundle
153
- key: spree-dashboard-bundle-v10-ruby-3-2-{{ checksum "Gemfile.lock" }}
154
-
155
- tests_ruby_3_0_rails_7_0_postgres:
156
- <<: *run_tests_3_0
157
- environment:
81
+ tests_mysql:
82
+ <<: *run_tests
83
+ environment: &mysql_environment
158
84
  <<: *environment
159
- DB: postgres
160
- DB_HOST: localhost
161
- DB_USERNAME: postgres
162
- RAILS_VERSION: '~> 7.0.0'
85
+ DB: mysql
86
+ DB_HOST: 127.0.0.1
87
+ DB_USERNAME: root
88
+ COVERAGE: true
89
+ COVERAGE_DIR: /tmp/workspace/simplecov
163
90
  docker:
164
- - image: *ruby_3_0_image
165
- - image: &postgres_image circleci/postgres:12-alpine
166
- environment:
167
- POSTGRES_USER: postgres
168
- - image: *redis_image
91
+ - image: *ruby_image
92
+ - image: cimg/mysql:8.0
169
93
 
170
- tests_ruby_3_2_rails_7_1_postgres:
171
- <<: *run_tests_3_2
172
- environment:
94
+ tests_postgres:
95
+ <<: *run_tests
96
+ environment: &postgres_environment
173
97
  <<: *environment
174
98
  DB: postgres
175
99
  DB_HOST: localhost
176
100
  DB_USERNAME: postgres
177
101
  docker:
178
- - image: *ruby_3_2_image
179
- - image: *postgres_image
180
- - image: *redis_image
181
-
182
- tests_ruby_3_2_rails_7_1_mysql:
183
- <<: *run_tests_3_2
184
- environment:
185
- <<: *environment
186
- DB: mysql
187
- DB_HOST: 127.0.0.1
188
- DB_USERNAME: root
189
- COVERAGE: true
190
- COVERAGE_DIR: /tmp/workspace/simplecov
191
- docker:
192
- - image: *ruby_3_2_image
193
- - image: *redis_image
194
- - image: &mysql_image circleci/mysql:8-ram
102
+ - image: *ruby_image
103
+ - image: cimg/postgres:16.2
104
+ environment:
105
+ POSTGRES_USER: postgres
195
106
 
196
107
  workflows:
197
108
  version: 2
198
109
  main:
199
110
  jobs:
200
- - bundle_ruby_3_0
201
- - bundle_ruby_3_2
202
- - tests_ruby_3_2_rails_7_1_postgres:
203
- requires:
204
- - bundle_ruby_3_2
205
- - tests_ruby_3_0_rails_7_0_postgres:
111
+ - bundle
112
+ - tests_postgres:
206
113
  requires:
207
- - bundle_ruby_3_0
208
- - tests_ruby_3_2_rails_7_1_mysql:
114
+ - bundle
115
+ - tests_mysql:
209
116
  requires:
210
- - bundle_ruby_3_2
117
+ - bundle
@@ -1 +1 @@
1
- Please visit [Contributing section](https://dev-docs.spreecommerce.org/contributing/index) of Spree Guides. Thank you!
1
+ Please visit [Contributing section](https://docs.spreecommerce.org/developer/contributing/quickstart) of Spree Guides. Thank you!
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 3.3.0
data/Gemfile CHANGED
@@ -16,8 +16,10 @@ end
16
16
  platforms :ruby do
17
17
  if ENV['DB'] == 'mysql'
18
18
  gem 'mysql2'
19
+ elsif ENV['DB'] == 'postgres'
20
+ gem 'pg'
19
21
  else
20
- gem 'pg', '~> 1.1'
22
+ gem 'sqlite3', '~> 2.0'
21
23
  end
22
24
  end
23
25
 
@@ -56,12 +58,11 @@ group :test, :development do
56
58
  end
57
59
 
58
60
  group :development do
59
- gem 'github_fast_changelog'
60
61
  gem 'solargraph'
61
62
  end
62
63
 
63
64
 
64
- spree_opts = { github: 'spree/spree', branch: '4-7-stable' }
65
+ spree_opts = { github: 'spree/spree', branch: 'main' }
65
66
  gem 'spree_core', spree_opts
66
67
  gem 'spree_api', spree_opts
67
68
  gemspec
data/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  # Spree Admin Dashboard
6
6
 
7
- This is the default Spree Admin Dashboard.
7
+ This is the default Spree Admin Dashboard.
8
8
 
9
9
  ## Developed by
10
10
 
@@ -37,52 +37,19 @@ Default credentials:
37
37
 
38
38
  ## Installation
39
39
 
40
- Spree Admin Dashboard is bundled with [Spree Starter](https://github.com/spree/spree_starter) and we recommend following [Spree Getting Started guide](https://dev-docs.spreecommerce.org/getting-started/installation).
40
+ Spree Admin Dashboard is bundled with [Spree Starter](https://github.com/spree/spree_starter) and we recommend following [Spree Getting Started guide](https://docs.spreecommerce.org/getting-started/installation).
41
41
 
42
- You can also [add Spree and Admin Dashboard to an existing Ruby on Rails application](https://dev-docs.spreecommerce.org/advanced/existing_app_tutorial) as well.
42
+ You can also [add Spree and Admin Dashboard to an existing Ruby on Rails application](https://docs.spreecommerce.org/advanced/existing_app_tutorial) as well.
43
43
 
44
44
  ## Documentation
45
45
 
46
- * [Developer Documentation](https://dev-docs.spreecommerce.org/)
46
+ * [Developer Documentation](https://docs.spreecommerce.org/)
47
47
 
48
48
  ## Contributing
49
49
 
50
50
  Spree Admin Dashboard is an open source project and we love contributions in any form - pull requests, issues, feature ideas!
51
51
 
52
- Please review the [Spree Contributing Guide](https://dev-docs.spreecommerce.org/contributing/index)
53
-
54
- ### Development Setup (JavaScript)
55
-
56
- When working on the JavaScript in Spree Dashboard locally, you will need to yarn link your local development copy of `@spree/dashboard`, to the Rails app you are working in, so that your changes are picked up and represented live in the view.
57
-
58
-
59
- From the root of `spree_backend` run:
60
-
61
- ```bash
62
- yarn link
63
- ```
64
-
65
- Next, from the root of the Rails app you are using to develop run:
66
-
67
- ```bash
68
- yarn link "@spree/dashboard"
69
- ```
70
-
71
- Once your local Spree Dashboard is linked with the Rails app you are using for development you will need two terminal tabs open,
72
- one at the root of your Rails app, and one at the root of `spree_backend`.
73
-
74
- In the terminal window at the root of the `spree_backend` run:
75
-
76
- ```bash
77
- yarn watch
78
- ```
79
-
80
- And from the Rails app you are using to run Spree and develop in run the following:
81
-
82
- ```bash
83
- bin/dev
84
- ```
85
- Any changes made to the JavaScript files in `spree_backend` will be processed by yarn and picked up in the Rails app you are running for development.
52
+ Please review the [Spree Contributing Guide](https://docs.spreecommerce.org/developer/contributing/quickstart)
86
53
 
87
54
  ### Local setup
88
55
 
data/SECURITY.md CHANGED
@@ -1 +1 @@
1
- Please see [Spree Guides Security section](https://dev-docs.spreecommerce.org/security/index).
1
+ Please see [Spree Guides Security section](https://docs.spreecommerce.org/developer/security/quickstart).
@@ -1,6 +1,9 @@
1
1
  //= link_tree ../images
2
2
 
3
- //= link spree-dashboard.js
3
+ //= link_directory ../../javascript/spree/backend .js
4
+ //= link_directory ../../javascript/spree/backend/controllers .js
5
+ //= link_directory ../../javascript/spree/backend/helpers .js
6
+
4
7
  //= link spree/backend/all.js
5
8
  //= link spree/backend/all.css
6
9
 
Binary file
Binary file
Binary file
Binary file
@@ -1,3 +1,4 @@
1
+ //= require spree/backend/global/tooltips
1
2
  //= require spree/backend/global/alerts
2
3
  //= require spree/backend/global/animate_css
3
4
  //= require spree/backend/global/fetch_request_utility
@@ -4,7 +4,7 @@ document.addEventListener("spree:load", function() {
4
4
  tinymce.init({
5
5
  selector: '.spree-rte',
6
6
  plugins: [
7
- 'image table paste code link table'
7
+ 'image table paste code link table lists'
8
8
  ],
9
9
  menubar: false,
10
10
  toolbar: 'undo redo | styleselect | bold italic link forecolor backcolor | alignleft aligncenter alignright alignjustify | table | bullist numlist outdent indent | code '
@@ -14,7 +14,7 @@ document.addEventListener("spree:load", function() {
14
14
  selector: '.spree-rte-simple',
15
15
  menubar: false,
16
16
  plugins: [
17
- 'image table paste link table'
17
+ 'image table paste link table lists'
18
18
  ],
19
19
  toolbar: 'undo redo | styleselect | bold italic link forecolor backcolor | alignleft aligncenter alignright alignjustify | table | bullist numlist outdent indent'
20
20
  });
@@ -0,0 +1,21 @@
1
+ const initTooltips = () => {
2
+ $('.with-tip').each(function() {
3
+ $(this).tooltip()
4
+ })
5
+
6
+ $('.with-tip').on('show.bs.tooltip', function(event) {
7
+ if (('ontouchstart' in window)) {
8
+ event.preventDefault()
9
+ }
10
+ })
11
+ }
12
+
13
+ const removeTooltips = () => {
14
+ $('.with-tip').each(function() {
15
+ $(this).tooltip('dispose')
16
+ })
17
+ }
18
+
19
+ document.addEventListener("turbo:click", removeTooltips)
20
+ document.addEventListener("turbo:load", initTooltips)
21
+ document.addEventListener('turbo:frame-render', initTooltips)
@@ -10,6 +10,9 @@
10
10
  //= require tinymce
11
11
  //= require underscore-min.js
12
12
  //= require jsonapi-serializer.min
13
+ //= require popper
14
+ //= require bootstrap-sprockets
15
+ //= require flatpickr
13
16
 
14
17
  //= require spree/backend/global/_index
15
18
 
@@ -1,7 +1,3 @@
1
- .payment-action-save {
2
- @include button-variant(theme-color('success'), theme-color('success'), theme-color('success') );
3
- }
4
-
5
1
  .btn,
6
2
  .nav-pills > li > a {
7
3
  vertical-align: middle;
@@ -1,3 +1,7 @@
1
+ .dropdown-menu {
2
+ @extend .shadow;
3
+ }
4
+
1
5
  .header {
2
6
  .navbar {
3
7
  min-height:54px;
@@ -16,13 +20,6 @@
16
20
  }
17
21
  }
18
22
 
19
- #accountNav {
20
- i {
21
- font-size: 1.3em;
22
- line-height: 1rem;
23
- }
24
- }
25
-
26
23
  #storeSwitcherDropdown {
27
24
  .dropdown-menu.show {
28
25
  min-width: 250px;
@@ -19,7 +19,6 @@ table.table {
19
19
 
20
20
  thead {
21
21
  th {
22
- text-transform: uppercase;
23
22
  font-size: $small-font-size;
24
23
  padding: 0.5rem;
25
24
  padding-top: 14px;
@@ -1,8 +1,22 @@
1
+ // https://github.com/twbs/bootstrap/blob/v4.6.2/scss/_variables.scss
2
+
1
3
  $theme-colors: (
2
- "primary": #4C75BA,
4
+ "primary": #000,
3
5
  );
4
6
 
5
- $enable-shadows: true;
7
+ $enable-responsive-font-sizes: true;
8
+ $font-family-sans-serif: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif !default;
9
+ $font-size-base: 0.813rem !default;
10
+ $font-size-plus: 0.875rem !default;
11
+ $font-size-sm: 0.75rem !default;
12
+ $font-size-lg: 1rem !default;
13
+
14
+ $border-radius: 0.5rem !default;
15
+ $border-radius-sm: 0.4rem !default;
16
+ $border-radius-lg: 0.75rem !default;
17
+
18
+ $dropdown-item-padding-y: .5rem !default;
19
+ $dropdown-item-padding-x: 1rem !default;
6
20
 
7
21
  // https://github.com/twbs/bootstrap/issues/32019
8
22
  // we need this hotfix for sassc
@@ -5,7 +5,7 @@ body.swal2-shown {
5
5
  }
6
6
  .swal2-html-container {
7
7
  text-align: left;
8
- font-size: 0.9em;
8
+ font-size: 0.813rem !important;
9
9
 
10
10
  .alert-link {
11
11
  font-weight: 400;
@@ -44,8 +44,6 @@ div.admin-product-image-container {
44
44
  img {
45
45
  max-width: 100%;
46
46
  height: auto;
47
- align-self: center;
48
- transform: scale(1.6);
49
47
  }
50
48
 
51
49
  svg {
@@ -286,6 +286,14 @@ module Spree
286
286
  def taxon_wysiwyg_editor_enabled?
287
287
  Spree::Backend::Config[:taxon_wysiwyg_editor_enabled]
288
288
  end
289
+
290
+ def spree_admin_show_version?
291
+ can?(:admin, current_store) && Spree::Backend::RuntimeConfig[:admin_show_version]
292
+ end
293
+
294
+ def spree_update_available?
295
+ @spree_update_available ||= !Rails.env.test? && Spree::Admin::Updater.update_available?
296
+ end
289
297
  end
290
298
  end
291
299
  end
@@ -301,7 +301,7 @@ module Spree
301
301
  end
302
302
 
303
303
  def page_header_back_button(url)
304
- link_to url, class: 'btn btn-outline-info mr-3 pr-1' do
304
+ link_to url, class: 'btn btn-light mr-3 pr-1' do
305
305
  svg_icon name: 'chevron-left.svg', width: 15, height: 15
306
306
  end
307
307
  end
@@ -16,14 +16,14 @@ module Spree
16
16
  def store_switcher_link(store)
17
17
  if current_store.id == store.id
18
18
  classes = 'disabled bg-light'
19
- icon = svg_icon name: 'circle-fill.svg', width: '18', height: '18'
19
+ icon = svg_icon name: 'circle-fill.svg', width: '14', height: '14'
20
20
  else
21
21
  classes = nil
22
- icon = svg_icon name: 'circle.svg', width: '18', height: '18'
22
+ icon = svg_icon name: 'circle.svg', width: '14', height: '14'
23
23
  end
24
24
 
25
25
  link_to icon + store.unique_name, spree.admin_url(host: store.formatted_url),
26
- class: "#{classes} py-3 px-4 dropdown-item rounded", id: store.code, data: { turbo: false }
26
+ class: "#{classes} dropdown-item", id: store.code, data: { turbo: false }
27
27
  end
28
28
  end
29
29
  end
@@ -0,0 +1,5 @@
1
+ // Configure your import map in config/importmap.rb. Read more: https://github.com/rails/importmap-rails
2
+ import "@hotwired/turbo-rails"
3
+ import "@rails/request.js"
4
+ import "controllers"
5
+ import "helpers"
@@ -4,7 +4,6 @@ export default class extends Controller {
4
4
  static targets = [ "source" ]
5
5
 
6
6
  copy(event) {
7
- console.log(event)
8
7
  event.preventDefault()
9
8
  this.sourceTarget.select()
10
9
  document.execCommand("copy")
@@ -0,0 +1,11 @@
1
+ // Import and register all your controllers from the importmap under controllers/*
2
+
3
+ import { application } from "controllers/application"
4
+
5
+ // Eager load all controllers defined in the import map under controllers/**/*_controller
6
+ import { eagerLoadControllersFrom } from "@hotwired/stimulus-loading"
7
+ eagerLoadControllersFrom("controllers", application)
8
+
9
+ // Lazy load controllers as they appear in the DOM (remember not to preload controllers in import map!)
10
+ // import { lazyLoadControllersFrom } from "@hotwired/stimulus-loading"
11
+ // lazyLoadControllersFrom("controllers", application)
@@ -1,6 +1,6 @@
1
1
  import { Controller } from "@hotwired/stimulus"
2
2
  import { Sortable } from "sortablejs"
3
- import { patch } from "../utilities/request_utility"
3
+ import { patch } from "helpers"
4
4
 
5
5
  export default class extends Controller {
6
6
  static values = { handle: String }
@@ -0,0 +1 @@
1
+ export * from "helpers/request_utility"
@@ -50,4 +50,4 @@ export function patch (url, options) {
50
50
  export function destroy (url, options) {
51
51
  const request = new FetchRequest("delete", url, options)
52
52
  return withProgress(request.perform())
53
- }
53
+ }
@@ -3,7 +3,7 @@ module Spree
3
3
  module Actions
4
4
  class Action
5
5
  STYLE_CLASSES = {
6
- ::Spree::Admin::Actions::ActionStyle::PRIMARY => 'btn-success',
6
+ ::Spree::Admin::Actions::ActionStyle::PRIMARY => 'btn-primary',
7
7
  ::Spree::Admin::Actions::ActionStyle::SECONDARY => 'btn-secondary',
8
8
  ::Spree::Admin::Actions::ActionStyle::LIGHT => 'btn-light'
9
9
  }
@@ -0,0 +1,35 @@
1
+ require 'net/http'
2
+ require 'json'
3
+ require 'uri'
4
+
5
+ module Spree
6
+ module Admin
7
+ class Updater
8
+ SPREE_CLOUD_UPDATES_URL = 'https://spreecloud.io/updates.json'
9
+
10
+ @updates = nil
11
+
12
+ def self.update_available?
13
+ fetch_updates.any?
14
+ end
15
+
16
+ def self.fetch_updates
17
+ @updates ||= Rails.cache.fetch("spree/admin/updater/fetch_updates/#{Spree.version}", expires_in: 1.day) do
18
+ uri = URI(SPREE_CLOUD_UPDATES_URL)
19
+ params = { version: Spree.version }
20
+ uri.query = URI.encode_www_form(params)
21
+
22
+ http = Net::HTTP.new(uri.host, uri.port)
23
+ http.use_ssl = uri.scheme == 'https'
24
+ http.open_timeout = 1 # 1s timeout for opening the connection
25
+ http.read_timeout = 1 # 1s timeout for reading the response
26
+
27
+ response = http.get(uri)
28
+ return {} unless response.is_a?(Net::HTTPSuccess)
29
+
30
+ JSON.parse(response.body)
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end