solidus_backend 2.10.0.beta1 → 2.10.5

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of solidus_backend might be problematic. Click here for more details.

Files changed (65) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/spree/backend.js +1 -0
  3. data/app/assets/javascripts/spree/backend/components/admin_nav.js +24 -0
  4. data/app/assets/javascripts/spree/backend/components/tabs.js +1 -1
  5. data/app/assets/javascripts/spree/backend/views/order/address.js +7 -5
  6. data/app/assets/stylesheets/spree/backend/_bootstrap_custom.scss +2 -0
  7. data/app/assets/stylesheets/spree/backend/components/_breadcrumb.scss +3 -3
  8. data/app/assets/stylesheets/spree/backend/components/_messages.scss +4 -0
  9. data/app/assets/stylesheets/spree/backend/components/_navigation.scss +182 -49
  10. data/app/assets/stylesheets/spree/backend/globals/_variables.scss +2 -0
  11. data/app/assets/stylesheets/spree/backend/shared/_header.scss +5 -1
  12. data/app/assets/stylesheets/spree/backend/shared/_layout.scss +0 -9
  13. data/app/controllers/spree/admin/orders_controller.rb +2 -2
  14. data/app/controllers/spree/admin/payment_methods_controller.rb +3 -3
  15. data/app/controllers/spree/admin/payments_controller.rb +2 -2
  16. data/app/controllers/spree/admin/product_properties_controller.rb +1 -1
  17. data/app/controllers/spree/admin/products_controller.rb +1 -1
  18. data/app/controllers/spree/admin/resource_controller.rb +12 -3
  19. data/app/controllers/spree/admin/taxons/attachment_controller.rb +20 -0
  20. data/app/controllers/spree/admin/users_controller.rb +4 -0
  21. data/app/helpers/spree/admin/orders_helper.rb +1 -1
  22. data/app/views/spree/admin/customer_returns/new.html.erb +1 -1
  23. data/app/views/spree/admin/option_types/edit.html.erb +1 -1
  24. data/app/views/spree/admin/orders/edit.html.erb +1 -1
  25. data/app/views/spree/admin/payment_methods/new.html.erb +1 -1
  26. data/app/views/spree/admin/prices/_master_variant_table.html.erb +41 -41
  27. data/app/views/spree/admin/promotion_code_batches/new.html.erb +1 -1
  28. data/app/views/spree/admin/promotion_codes/new.html.erb +1 -1
  29. data/app/views/spree/admin/promotions/_actions.html.erb +1 -0
  30. data/app/views/spree/admin/return_authorizations/new.html.erb +1 -1
  31. data/app/views/spree/admin/shared/_calculator_fields.html.erb +5 -0
  32. data/app/views/spree/admin/shared/_navigation.html.erb +3 -0
  33. data/app/views/spree/admin/shared/_new_resource_links.html.erb +1 -1
  34. data/app/views/spree/admin/shared/_settings_sub_menu.html.erb +1 -1
  35. data/app/views/spree/admin/shipping_methods/_form.html.erb +1 -1
  36. data/app/views/spree/admin/tax_rates/_form.html.erb +1 -1
  37. data/app/views/spree/admin/taxonomies/new.html.erb +1 -1
  38. data/app/views/spree/admin/taxons/_form.html.erb +1 -5
  39. data/app/views/spree/admin/taxons/attachment_forms/_paperclip.html.erb +16 -0
  40. data/app/views/spree/admin/users/_form.html.erb +12 -10
  41. data/app/views/spree/admin/users/edit.html.erb +1 -2
  42. data/app/views/spree/layouts/admin.html.erb +1 -2
  43. data/config/routes.rb +4 -6
  44. data/lib/spree/backend_configuration.rb +2 -1
  45. data/solidus_backend.gemspec +1 -1
  46. data/spec/controllers/spree/admin/resource_controller_spec.rb +12 -1
  47. data/spec/controllers/spree/admin/users_controller_spec.rb +23 -0
  48. data/spec/features/admin/configuration/payment_methods_spec.rb +11 -2
  49. data/spec/features/admin/configuration/shipping_methods_spec.rb +13 -1
  50. data/spec/features/admin/configuration/taxonomies_spec.rb +7 -0
  51. data/spec/features/admin/orders/customer_returns_spec.rb +20 -7
  52. data/spec/features/admin/orders/new_order_spec.rb +48 -0
  53. data/spec/features/admin/orders/return_authorizations_spec.rb +38 -9
  54. data/spec/features/admin/products/edit/images_spec.rb +1 -1
  55. data/spec/features/admin/products/products_spec.rb +12 -0
  56. data/spec/features/admin/promotion_adjustments_spec.rb +9 -0
  57. data/spec/features/admin/promotions/promotion_code_batches_spec.rb +37 -0
  58. data/spec/features/admin/promotions/promotion_code_spec.rb +31 -0
  59. data/spec/features/admin/taxons_spec.rb +12 -0
  60. data/spec/features/admin/users_spec.rb +18 -8
  61. data/spec/{support → fixtures/files}/ror_ringer.jpeg +0 -0
  62. data/spec/spec_helper.rb +1 -0
  63. data/spec/support/feature/base_feature_helper.rb +6 -1
  64. data/vendor/assets/stylesheets/solidus_admin/bootstrap/_variables.scss +1 -1
  65. metadata +17 -12
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6900a204c004e5fe7d29af73908bdc9ccc97edd722a4000946a6c15baca90ed6
4
- data.tar.gz: b52e623d7cf35f72ac8fe09661da2c4e69f7f727636393429f2e638919bc6dcc
3
+ metadata.gz: d77a5049c9373ee4c417b2d28b5ca09ae01e301de70ffc90db790e188cce1ff9
4
+ data.tar.gz: 5f7083196306a532c49d463979bc287f161fa815407921621e5b13c74c1e32fa
5
5
  SHA512:
6
- metadata.gz: 502d7cb40991948f4cd60ee9d602cf94121109fd933c5f7b97aab79f0ae05c92b29b88efb71a803e2f53479a1d0d1b287be8b5fa10184956f977f697134dd93e
7
- data.tar.gz: 649b8e1085cd38b2ae6ea77065a5eff52efe187facef00c924e1d18ddcee06286cbcb09c716f8fbe1c748625d87271b7f6f5cd8505f1261ebb74f2661f0ab375
6
+ metadata.gz: 3eb638d8544eef741cf4d6c5559cdf6ded6426fb2971d12a32cc10e214b840e578d208514999f2617af115502548923c0d0088381141ca9465b346dd036ca3ec
7
+ data.tar.gz: 437679ef077e5b67833f4b1875caa0e9f8737ae1e55f63e713ff8c8c81a0604d5e252a6d3f8351990ce36b6adab45c71f9b7e2d0a6da8067e6893fa7d1e5fc2d
@@ -30,6 +30,7 @@
30
30
  //= require spree/backend/components/tooltips
31
31
  //= require spree/backend/components/editable_table
32
32
  //= require spree/backend/components/sortable_table
33
+ //= require spree/backend/components/admin_nav
33
34
  //= require spree/backend/datepicker
34
35
  //= require spree/backend/flash
35
36
  //= require spree/backend/gateway
@@ -0,0 +1,24 @@
1
+ Spree.ready(function() {
2
+ if (window.screen.width <= 1024 && !document.cookie.includes("admin_nav_hidden")) {
3
+ // Set default nav to collapse on small screens - but don't override user preference
4
+ document.body.classList.add("admin-nav-hidden");
5
+ document.cookie = "admin_nav_hidden=true; expires=Fri, 31 Dec 9999 23:59:59 GMT";
6
+ }
7
+
8
+ var adminNavToggle = document.querySelector("#admin-nav-toggle");
9
+
10
+ if (adminNavToggle) {
11
+ adminNavToggle.addEventListener("click", function(e) {
12
+ e.preventDefault();
13
+ document.body.classList.toggle("admin-nav-hidden");
14
+ $(document.body).trigger("sticky_kit:recalc");
15
+ adminNavToggle.classList.toggle("fa-chevron-circle-left");
16
+ adminNavToggle.classList.toggle("fa-chevron-circle-right");
17
+ document.cookie = "admin_nav_hidden=" + document.body.classList.contains("admin-nav-hidden") + "; expires=Fri, 31 Dec 9999 23:59:59 GMT";
18
+ });
19
+ }
20
+
21
+ if (document.body.classList.contains('admin-nav-hidden')) {
22
+ $(adminNavToggle).removeClass('fa-chevron-circle-left').addClass('fa-chevron-circle-right');
23
+ }
24
+ });
@@ -22,7 +22,7 @@ Tabs = (function() {
22
22
  });
23
23
  this.totalTabsWidth = this.tabWidths.reduce(function(previousValue, currentValue) {
24
24
  return previousValue + currentValue;
25
- });
25
+ }, 0);
26
26
 
27
27
  window.addEventListener("resize", this.overflowTabs);
28
28
  this.overflowTabs();
@@ -3,14 +3,14 @@ Spree.Views.Order.Address = Backbone.View.extend({
3
3
  // read initial values from page
4
4
  this.onChange();
5
5
 
6
- this.render();
7
- this.listenTo(this.model, "change", this.render);
8
-
9
6
  this.stateSelect =
10
7
  new Spree.Views.StateSelect({
11
8
  model: this.model,
12
9
  el: this.$el
13
10
  });
11
+
12
+ this.render();
13
+ this.listenTo(this.model, "change", this.render);
14
14
  },
15
15
 
16
16
  events: {
@@ -24,7 +24,7 @@ Spree.Views.Order.Address = Backbone.View.extend({
24
24
  eachField: function(callback){
25
25
  var view = this;
26
26
  var fields = ["firstname", "lastname", "company", "address1", "address2",
27
- "city", "zipcode", "phone", "country_id"];
27
+ "city", "zipcode", "phone", "country_id", "state_name"];
28
28
  _.each(fields, function(field) {
29
29
  var el = view.$('[name$="[' + field + ']"]');
30
30
  if (el.length) callback(field, el);
@@ -43,6 +43,8 @@ Spree.Views.Order.Address = Backbone.View.extend({
43
43
  var model = this.model;
44
44
  this.eachField(function(name, el) {
45
45
  el.val(model.get(name))
46
- })
46
+ });
47
+
48
+ this.stateSelect.render();
47
49
  }
48
50
  });
@@ -85,6 +85,8 @@ $dropdown-link-hover-bg: $color-primary !default;
85
85
 
86
86
  $breadcrumb-bg: transparent !default;
87
87
  $breadcrumb-active-color: $color-primary !default;
88
+ $breadcrumb-padding-y: .75rem !default;
89
+ $breadcrumb-padding-x: 0 !default;
88
90
 
89
91
  // Popover
90
92
 
@@ -1,15 +1,15 @@
1
1
  .breadcrumb {
2
2
  font-size: 16px;
3
3
  margin-bottom: 0;
4
-
4
+
5
5
  a {
6
6
  color: $breadcrumb-color;
7
-
7
+
8
8
  &:hover {
9
9
  color: $breadcrumb-active-color;
10
10
  }
11
11
  }
12
-
12
+
13
13
  .active {
14
14
  font-weight: $font-weight-bold;
15
15
  }
@@ -30,6 +30,10 @@
30
30
  left: $width-sidebar;
31
31
  right: 0;
32
32
  z-index: 1000;
33
+
34
+ .admin-nav-hidden & {
35
+ left: $width-sidebar-collapsed;
36
+ }
33
37
  }
34
38
 
35
39
  .flash {
@@ -2,6 +2,91 @@ $padding-x-navbar: 26px;
2
2
  $padding-y-navbar: 13px;
3
3
  $padding-y-navbar-submenu: 9px;
4
4
 
5
+ #admin-nav-toggle {
6
+ border-bottom: $border-sidebar;
7
+ padding: ($padding-y-navbar/ 2) $padding-x-navbar;
8
+ width: 100%;
9
+ text-align: left;
10
+ color: $color-navbar;
11
+ font-weight: $font-weight-bold;
12
+ position: relative;
13
+ overflow: hidden;
14
+ display: block;
15
+ height: 39px;
16
+ z-index: 1;
17
+
18
+ span {
19
+ font-size: $font-size-sm;
20
+ font-weight: $font-weight-bold;
21
+ }
22
+
23
+ &.btn {
24
+ background-color: transparent;
25
+ }
26
+
27
+ &.fa {
28
+ text-indent: 2em;
29
+
30
+ &:before {
31
+ color: $color-icon-navbar;
32
+ font-weight: $font-weight-normal;
33
+ position: absolute;
34
+ left: 1em;
35
+ top: 0;
36
+ line-height: 39px;
37
+ transform: translateX(-50%);
38
+ transition: transform .5s ease-in-out;
39
+ }
40
+
41
+ &:focus {
42
+ outline: 0;
43
+ box-shadow: none;
44
+ }
45
+ }
46
+ }
47
+
48
+ .admin-nav-hidden {
49
+ padding-left: $width-sidebar-collapsed;
50
+
51
+ .admin-nav,
52
+ .admin-nav-footer {
53
+ width: $width-sidebar-collapsed;
54
+ }
55
+
56
+ .text {
57
+ transform: translateX(-50px);
58
+ display: none;
59
+ }
60
+
61
+ .admin-login-nav a {
62
+ text-overflow: clip;
63
+ }
64
+
65
+ .brand-link {
66
+ overflow: hidden;
67
+
68
+ img {
69
+ max-width: 125px;
70
+ }
71
+ }
72
+
73
+ .admin-nav-menu {
74
+ li {
75
+ &.selected:not(:hover) > ul {
76
+ visibility: hidden;
77
+ }
78
+
79
+ &.selected:not(:hover) .admin-subnav {
80
+ display: none;
81
+ }
82
+ }
83
+ }
84
+
85
+ .admin-nav-menu .selected li {
86
+ padding-left: 0;
87
+ }
88
+ }
89
+
5
90
  nav.menu {
6
91
  ul {
7
92
  list-style: none;
@@ -26,16 +111,27 @@ nav.menu {
26
111
  }
27
112
 
28
113
  .admin-nav {
114
+ position: absolute;
115
+ top: 0;
116
+ bottom: 0;
117
+ left: 0;
118
+ z-index: $zindex-sticky;
119
+ width: $width-sidebar;
29
120
  border-right: $border-sidebar;
30
121
  background: $color-sidebar-bg;
31
- z-index: $zindex-sticky;
122
+
123
+ @media print {
124
+ display: none
125
+ }
32
126
  }
33
127
 
34
128
  .admin-nav-header {
35
129
  background-color: $color-white;
36
130
  border-bottom: 1px solid $color-border;
131
+ border-right: 1px solid $color-border;
37
132
  text-align: center;
38
133
  padding: 0 1.25em;
134
+ width: $width-sidebar;
39
135
  // Using line height for proper vertical centering.
40
136
  // As line height does not take the border width into account we need to subtract it.
41
137
  line-height: $main-header-height - 1px;
@@ -73,56 +169,13 @@ nav.menu {
73
169
  }
74
170
 
75
171
  &:not(.selected):not(:hover) > ul {
76
- display: none;
77
- }
78
-
79
- &:not(.selected) {
80
- position: relative;
81
-
82
- // flyout nav
83
- > ul {
84
- position: absolute;
85
- top: 0;
86
- left: 100%;
87
- width: $width-sidebar-flyout;
88
- margin-left: 0;
89
- background: $color-white;
90
- box-shadow: 1px 0 4px 0 rgba(0, 0, 0, 0.1);
91
- border-radius: 0 4px 4px 4px;
92
- border: 1px solid $color-border;
93
- @include caret($direction: left, $color-caret: $color-white);
94
-
95
- &:before {
96
- z-index: 1;
97
- top: 1.5em;
98
- }
99
-
100
- &:after {
101
- content: '';
102
- display: block;
103
- position: absolute;
104
- border-width: 1em 1em;
105
- border-style: solid;
106
- border-color: transparent;
107
- border-right-color: $color-border;
108
- left: -2.1em;
109
- top: 1.5em;
110
- margin-top: -1em;
111
- }
112
-
113
- > li {
114
- background: $color-white;
115
-
116
- a {
117
- font-weight: $font-weight-bold;
118
- }
119
- }
120
- }
172
+ visibility: hidden;
121
173
  }
122
174
  }
123
175
 
124
176
  a {
125
177
  display: block;
178
+ min-height: 39px;
126
179
  padding: $padding-y-navbar $padding-x-navbar;
127
180
  color: $color-navbar;
128
181
  font-weight: $font-weight-bold;
@@ -177,8 +230,58 @@ nav.menu {
177
230
  }
178
231
  }
179
232
 
233
+ .admin-nav-menu li:not(.selected),
234
+ .admin-nav-hidden .admin-nav-menu li.selected:hover {
235
+ position: relative;
236
+
237
+ // flyout nav
238
+ > ul {
239
+ position: absolute;
240
+ top: 0;
241
+ left: 100%;
242
+ width: $width-sidebar-flyout;
243
+ margin-left: 0;
244
+ background: $color-white;
245
+ box-shadow: 1px 0 4px 0 rgba(0, 0, 0, 0.1);
246
+ border-radius: 0 4px 4px 4px;
247
+ border: 1px solid $color-border;
248
+ @include caret($direction: left, $color-caret: $color-white);
249
+
250
+ &:before {
251
+ z-index: 1;
252
+ top: 1.5em;
253
+ pointer-events: none;
254
+ }
255
+
256
+ &:after {
257
+ content: '';
258
+ display: block;
259
+ position: absolute;
260
+ border-width: 1em 1em;
261
+ border-style: solid;
262
+ border-color: transparent;
263
+ border-right-color: $color-border;
264
+ left: -2.1em;
265
+ top: 1.5em;
266
+ margin-top: -1em;
267
+ pointer-events: none;
268
+ }
269
+
270
+ > li {
271
+ background: $color-white;
272
+
273
+ a {
274
+ font-weight: $font-weight-bold;
275
+ }
276
+ }
277
+ }
278
+ }
279
+
180
280
  .admin-nav-footer {
281
+ width: $width-sidebar;
181
282
  background-color: $color-navbar-footer-bg;
283
+ border-top: $border-sidebar;
284
+ border-right: $border-sidebar;
182
285
 
183
286
  a {
184
287
  color: $color-navbar-footer;
@@ -191,14 +294,40 @@ nav.menu {
191
294
 
192
295
  .admin-locale-selection {
193
296
  margin: 1em;
297
+ position: relative;
298
+
299
+ &::after {
300
+ content: "\f0ac";
301
+ font-family: "FontAwesome";
302
+ position: absolute;
303
+ top: 0;
304
+ left: 0;
305
+ padding: .5rem 0 .5rem .25rem;
306
+ z-index: -1;
307
+ }
308
+
309
+ .admin-nav-hidden & {
310
+ .js-locale-selection.custom-select {
311
+ background-color: transparent;
312
+ background-position: 1.5rem center;
313
+ background-size: 8px 9px;
314
+ border: 0;
315
+ opacity: .6;
316
+ position: relative;
317
+ overflow: hidden;
318
+ text-indent: 1rem;
319
+ z-index: 1;
320
+
321
+ &:focus {
322
+ box-shadow: none;
323
+ }
324
+ }
325
+ }
194
326
  }
195
327
 
196
328
  .admin-nav.fits .admin-nav-footer {
197
329
  position: fixed;
198
330
  bottom: 0;
199
- width: $width-sidebar;
200
- border-top: $border-sidebar;
201
- border-right: $border-sidebar;
202
331
  }
203
332
 
204
333
  .admin-login-nav {
@@ -226,4 +355,8 @@ nav.menu {
226
355
 
227
356
  .brand-link {
228
357
  display: block;
358
+
359
+ img {
360
+ max-width: 125px;
361
+ }
229
362
  }
@@ -169,6 +169,8 @@ $actions-brd-colors: $color-action-edit-brd, $color-action-clone-brd, $color-act
169
169
  //--------------------------------------------------------------
170
170
  $width-sidebar: 200px !default;
171
171
  $width-sidebar-flyout: 225px !default;
172
+ $width-sidebar-collapsed: 52px !default;
173
+ $sidebar-transition: 250ms ease-in !default;
172
174
  $border-sidebar: 1px solid $color-sidebar-border !default;
173
175
 
174
176
  // Main
@@ -1,11 +1,15 @@
1
1
  .main-header {
2
2
  display: flex;
3
3
  align-items: center;
4
- padding: 15px $grid-gutter-width;
5
4
  background-color: $color-header-bg;
5
+ padding: ($grid-gutter-width / 2) $grid-gutter-width;
6
6
  border-bottom: 1px solid $color-border;
7
7
  height: $main-header-height;
8
8
 
9
+ .admin-nav-hidden & {
10
+ margin-left: ($width-sidebar - $width-sidebar-collapsed);
11
+ }
12
+
9
13
  @media print { display: none }
10
14
  }
11
15