solidus_backend 2.8.2 → 2.9.2

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 (110) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/spree/backend/components/sortable_table.js +1 -0
  3. data/app/assets/javascripts/spree/backend/components/tabs.js +1 -0
  4. data/app/assets/javascripts/spree/backend/shipments.js +1 -0
  5. data/app/assets/javascripts/spree/backend/stock_management.js +9 -0
  6. data/app/assets/javascripts/spree/backend/templates/orders/line_item.hbs +1 -1
  7. data/app/assets/javascripts/spree/backend/views/stock/edit_stock_item_row.js +18 -2
  8. data/app/assets/stylesheets/spree/backend/_bootstrap_custom.scss +24 -16
  9. data/app/assets/stylesheets/spree/backend/components/_breadcrumb.scss +12 -0
  10. data/app/assets/stylesheets/spree/backend/components/_buttons.scss +18 -0
  11. data/app/assets/stylesheets/spree/backend/components/_image_placeholder.scss +2 -2
  12. data/app/assets/stylesheets/spree/backend/components/_list_group.scss +2 -2
  13. data/app/assets/stylesheets/spree/backend/components/_messages.scss +20 -12
  14. data/app/assets/stylesheets/spree/backend/components/_navigation.scss +45 -11
  15. data/app/assets/stylesheets/spree/backend/components/_progress.scss +3 -3
  16. data/app/assets/stylesheets/spree/backend/components/_sidebar.scss +1 -2
  17. data/app/assets/stylesheets/spree/backend/components/_tabs.scss +14 -13
  18. data/app/assets/stylesheets/spree/backend/globals/_deprecated_variables.scss +24 -0
  19. data/app/assets/stylesheets/spree/backend/globals/_deprecation.scss +10 -1
  20. data/app/assets/stylesheets/spree/backend/globals/_functions.scss +4 -1
  21. data/app/assets/stylesheets/spree/backend/globals/_variables.scss +88 -57
  22. data/app/assets/stylesheets/spree/backend/globals/_variables_override.scss +1 -0
  23. data/app/assets/stylesheets/spree/backend/globals/mixins/_caret.scss +1 -1
  24. data/app/assets/stylesheets/spree/backend/globals/mixins/_line_through.scss +1 -1
  25. data/app/assets/stylesheets/spree/backend/sections/_log_entries.scss +8 -2
  26. data/app/assets/stylesheets/spree/backend/sections/_orders.scss +17 -6
  27. data/app/assets/stylesheets/spree/backend/sections/_products.scss +3 -1
  28. data/app/assets/stylesheets/spree/backend/sections/_promotions.scss +5 -5
  29. data/app/assets/stylesheets/spree/backend/sections/_style_guide.scss +4 -4
  30. data/app/assets/stylesheets/spree/backend/sections/_taxonomies.scss +1 -1
  31. data/app/assets/stylesheets/spree/backend/shared/_fonts.scss +15 -0
  32. data/app/assets/stylesheets/spree/backend/shared/_forms.scss +27 -7
  33. data/app/assets/stylesheets/spree/backend/shared/_header.scss +2 -2
  34. data/app/assets/stylesheets/spree/backend/shared/_icons.scss +5 -1
  35. data/app/assets/stylesheets/spree/backend/shared/_layout.scss +5 -4
  36. data/app/assets/stylesheets/spree/backend/shared/_tables.scss +11 -6
  37. data/app/assets/stylesheets/spree/backend/shared/_typography.scss +10 -6
  38. data/app/assets/stylesheets/spree/backend/spree_admin.scss +3 -0
  39. data/app/controllers/spree/admin/customer_returns_controller.rb +8 -1
  40. data/app/controllers/spree/admin/log_entries_controller.rb +3 -0
  41. data/app/controllers/spree/admin/orders_controller.rb +0 -1
  42. data/app/controllers/spree/admin/users_controller.rb +4 -2
  43. data/app/helpers/spree/admin/base_helper.rb +9 -3
  44. data/app/helpers/spree/admin/promotions_helper.rb +15 -0
  45. data/app/views/spree/admin/images/index.html.erb +1 -1
  46. data/app/views/spree/admin/log_entries/index.html.erb +1 -19
  47. data/app/views/spree/admin/option_types/edit.html.erb +1 -1
  48. data/app/views/spree/admin/orders/_line_items_edit_form.html.erb +1 -1
  49. data/app/views/spree/admin/payments/_capture_events.html.erb +15 -18
  50. data/app/views/spree/admin/payments/_list.html.erb +1 -1
  51. data/app/views/spree/admin/payments/_log_entries.html.erb +29 -0
  52. data/app/views/spree/admin/payments/show.html.erb +13 -6
  53. data/app/views/spree/admin/payments/source_forms/{_storecredit.html.erb → _store_credit.html.erb} +0 -0
  54. data/app/views/spree/admin/payments/source_views/{_storecredit.html.erb → _store_credit.html.erb} +0 -0
  55. data/app/views/spree/admin/prices/_form.html.erb +1 -1
  56. data/app/views/spree/admin/product_properties/index.html.erb +1 -1
  57. data/app/views/spree/admin/products/_form.html.erb +16 -5
  58. data/app/views/spree/admin/products/edit.html.erb +1 -1
  59. data/app/views/spree/admin/promotions/_form.html.erb +2 -2
  60. data/app/views/spree/admin/promotions/index.html.erb +4 -4
  61. data/app/views/spree/admin/reimbursements/edit.html.erb +2 -2
  62. data/app/views/spree/admin/shared/_head.html.erb +0 -3
  63. data/app/views/spree/admin/shared/_modal.html.erb +1 -1
  64. data/app/views/spree/admin/shipping_methods/_form.html.erb +10 -10
  65. data/app/views/spree/admin/stock_items/_stock_management.html.erb +1 -1
  66. data/app/views/spree/admin/store_credits/edit_validity.html.erb +1 -1
  67. data/app/views/spree/admin/store_credits/index.html.erb +1 -1
  68. data/app/views/spree/admin/store_credits/show.html.erb +1 -1
  69. data/app/views/spree/admin/stores/_form.html.erb +1 -0
  70. data/app/views/spree/admin/style_guide/topics/typography/_colors.html.erb +30 -20
  71. data/app/views/spree/admin/style_guide/topics/typography/_fonts.html.erb +1 -1
  72. data/app/views/spree/admin/taxonomies/edit.html.erb +1 -1
  73. data/app/views/spree/admin/taxons/_form.html.erb +1 -1
  74. data/app/views/spree/admin/taxons/edit.html.erb +2 -2
  75. data/app/views/spree/admin/users/edit.html.erb +2 -2
  76. data/app/views/spree/admin/users/index.html.erb +2 -2
  77. data/app/views/spree/admin/variants/_form.html.erb +1 -1
  78. data/app/views/spree/admin/variants/index.html.erb +1 -1
  79. data/app/views/spree/admin/zones/_state_members.html.erb +1 -1
  80. data/spec/controllers/spree/admin/locale_controller_spec.rb +45 -0
  81. data/spec/controllers/spree/admin/orders/customer_details_controller_spec.rb +3 -3
  82. data/spec/controllers/spree/admin/orders_controller_spec.rb +2 -2
  83. data/spec/controllers/spree/admin/stock_locations_controller_spec.rb +1 -1
  84. data/spec/features/admin/locale_spec.rb +1 -2
  85. data/spec/features/admin/orders/adjustments_spec.rb +1 -1
  86. data/spec/features/admin/orders/customer_details_spec.rb +5 -7
  87. data/spec/features/admin/orders/customer_returns_spec.rb +28 -0
  88. data/spec/features/admin/orders/listing_spec.rb +1 -6
  89. data/spec/features/admin/orders/log_entries_spec.rb +2 -2
  90. data/spec/features/admin/orders/new_order_spec.rb +3 -3
  91. data/spec/features/admin/orders/order_details_spec.rb +8 -3
  92. data/spec/features/admin/orders/payments_spec.rb +80 -39
  93. data/spec/features/admin/products/edit/products_spec.rb +25 -0
  94. data/spec/features/admin/products/edit/taxons_spec.rb +4 -0
  95. data/spec/features/admin/products/pricing_spec.rb +24 -6
  96. data/spec/features/admin/products/products_spec.rb +4 -4
  97. data/spec/features/admin/products/stock_management_spec.rb +17 -0
  98. data/spec/features/admin/products/variant_spec.rb +1 -1
  99. data/spec/features/admin/promotions/promotion_spec.rb +52 -0
  100. data/spec/features/admin/store_credits_spec.rb +3 -3
  101. data/spec/features/admin/users_spec.rb +22 -0
  102. data/spec/spec_helper.rb +1 -2
  103. data/spec/support/appear_before_matcher.rb +1 -1
  104. data/vendor/assets/fonts/inter/Inter-Regular.woff +0 -0
  105. data/vendor/assets/fonts/inter/Inter-Regular.woff2 +0 -0
  106. data/vendor/assets/fonts/inter/Inter-SemiBold.woff +0 -0
  107. data/vendor/assets/fonts/inter/Inter-SemiBold.woff2 +0 -0
  108. data/vendor/assets/stylesheets/solidus_admin/bootstrap/_pagination.scss +4 -0
  109. metadata +21 -11
  110. data/.eslintrc +0 -21
@@ -31,7 +31,9 @@ div[data-hook="admin_products_index_search_buttons"] {
31
31
  margin-bottom: 15px;
32
32
 
33
33
  strong {
34
- color: $color-2;
34
+ background: $color-primary-light;
35
+ padding: .1em .3em;
36
+ border-radius: 3px;
35
37
  }
36
38
  }
37
39
 
@@ -51,7 +51,7 @@
51
51
  top: 10px;
52
52
 
53
53
  &:hover {
54
- color: #c60f13;
54
+ color: $color-red;
55
55
  }
56
56
  }
57
57
  }
@@ -71,7 +71,7 @@
71
71
  top: 10px;
72
72
 
73
73
  &:hover {
74
- color: #c60f13;
74
+ color: $color-red;
75
75
  }
76
76
  }
77
77
  }
@@ -97,13 +97,13 @@
97
97
  }
98
98
 
99
99
  &.action-remove {
100
- background-color: lighten($color-5, 50);
101
- border-color: lighten($color-5, 45);
100
+ background-color: lighten($color-red, 50);
101
+ border-color: lighten($color-red, 45);
102
102
  text-decoration: line-through;
103
103
 
104
104
  .promotion-title, input[type="text"], input[type="number"],
105
105
  .token-input-list {
106
- border-color: lighten($color-5, 45);
106
+ border-color: lighten($color-red, 45);
107
107
  }
108
108
  }
109
109
 
@@ -48,7 +48,7 @@
48
48
 
49
49
  > a {
50
50
  font-size: 1.2rem;
51
- font-weight: 300;
51
+ font-weight: $font-weight-normal;
52
52
  }
53
53
  }
54
54
 
@@ -64,7 +64,7 @@
64
64
  }
65
65
 
66
66
  &-intro,
67
- &-section:not(:last-child) {
67
+ &-section {
68
68
  margin: 4rem 0;
69
69
  }
70
70
 
@@ -112,8 +112,8 @@
112
112
  table.with-actions-borders {
113
113
  th, td {
114
114
  &.actions {
115
- border-right: 1px solid #cee1f4 !important;
116
- border-bottom: 1px solid #cee1f4 !important;
115
+ border-right: 1px solid $color-style-guide-table-border !important;
116
+ border-bottom: 1px solid $color-style-guide-table-border !important;
117
117
  }
118
118
  }
119
119
  }
@@ -12,7 +12,7 @@
12
12
  }
13
13
 
14
14
  .taxon {
15
- background-color: very-light($color-3);
15
+ background-color: $color-light;
16
16
  border: 1px solid $color-border;
17
17
  border-radius: $border-radius;
18
18
  color: $body-color;
@@ -0,0 +1,15 @@
1
+ @font-face {
2
+ font-family: 'Inter';
3
+ font-style: normal;
4
+ font-weight: $font-weight-normal;
5
+ src: font-url("inter/Inter-Regular.woff2") format("woff2"),
6
+ font-url("inter/Inter-Regular.woff") format("woff");
7
+ }
8
+
9
+ @font-face {
10
+ font-family: 'Inter';
11
+ font-style: normal;
12
+ font-weight: $font-weight-bold;
13
+ src: font-url("inter/Inter-SemiBold.woff2") format("woff2"),
14
+ font-url("inter/Inter-SemiBold.woff") format("woff");
15
+ }
@@ -41,6 +41,8 @@ textarea {
41
41
  }
42
42
 
43
43
  label {
44
+ font-size: inherit;
45
+
44
46
  &.required:after {
45
47
  content: " *";
46
48
  }
@@ -64,7 +66,19 @@ button,
64
66
  // In order to avoid the clashing between using `:not(.btn)` and
65
67
  // `@extend .btn` we need to use an attribute selector of `[class*="btn"]`.
66
68
  @extend .btn;
67
- @include button-variant(theme-color("primary"), theme-color("primary"));
69
+ background: linear-gradient($color-white, lighten($color-light-dark, 2%));
70
+ color: $color-dark;
71
+ border-color: $color-dark-accent;
72
+
73
+ &:hover {
74
+ background: linear-gradient($color-white, $color-light-dark);
75
+ color: $color-primary;
76
+ }
77
+
78
+ &.disabled,
79
+ &:disabled {
80
+ color: $color-disabled;
81
+ }
68
82
  }
69
83
 
70
84
  &:before {
@@ -106,6 +120,10 @@ span.info {
106
120
  margin-top: 2.25rem;
107
121
  }
108
122
  }
123
+
124
+ label {
125
+ font-size: $label-font-size;
126
+ }
109
127
 
110
128
  ul {
111
129
  list-style: none;
@@ -131,21 +149,21 @@ span.info {
131
149
  &.withError {
132
150
  .field_with_errors {
133
151
  label {
134
- color: very-light(theme-color("danger"), 30);
152
+ color: theme-color("danger");
135
153
  }
136
154
 
137
155
  input {
138
- border-color: very-light(theme-color("danger"), 15);
156
+ border-color: theme-color("danger");
139
157
  }
140
158
  }
141
159
  .formError {
142
- color: very-light(theme-color("danger"), 30);
160
+ color: lighten(theme-color("danger"), 15);
143
161
  font-style: italic;
144
162
  font-size: 85%;
145
163
  }
146
164
  .select2-container {
147
165
  border-radius: 4px;
148
- border: 1px solid very-light(theme-color("danger"), 15);
166
+ border: 1px solid theme-color("danger");
149
167
  }
150
168
  }
151
169
  }
@@ -172,12 +190,14 @@ fieldset {
172
190
  }
173
191
 
174
192
  legend {
175
- color: $color-2;
176
- font-size: 16px;
193
+ color: $color-dark;
194
+ font-size: 14px;
177
195
  font-weight: $font-weight-bold;
178
196
  text-align: center;
179
197
  padding: 8px 15px;
180
198
  width: auto;
199
+ margin-left: auto;
200
+ margin-right: auto;
181
201
 
182
202
  -webkit-font-smoothing: antialiased;
183
203
  -moz-osx-font-smoothing: grayscale;
@@ -2,7 +2,7 @@
2
2
  display: flex;
3
3
  align-items: center;
4
4
  padding: 15px $grid-gutter-width;
5
- background-color: very-light($color-3, 4);
5
+ background-color: $color-header-bg;
6
6
  border-bottom: 1px solid $color-border;
7
7
  height: $main-header-height;
8
8
 
@@ -17,7 +17,7 @@
17
17
  -moz-osx-font-smoothing: grayscale;
18
18
 
19
19
  i {
20
- color: $color-2;
20
+ color: $color-primary;
21
21
  }
22
22
  }
23
23
 
@@ -14,6 +14,10 @@
14
14
  }
15
15
  }
16
16
 
17
+ .btn.fa {
18
+ font: normal normal $btn-font-weight #{$font-size-base}/#{$btn-line-height} "FontAwesome";
19
+ }
20
+
17
21
  .fa-email { @extend .fa-envelope }
18
22
  .fa-resume { @extend .fa-refresh }
19
23
  .fa-approve { @extend .fa-check }
@@ -26,7 +30,7 @@
26
30
 
27
31
  .fa-trash { @extend .fa-trash-o }
28
32
 
29
- .fa-capture { @extend .fa-check }
33
+ .fa-capture { @extend .fa-thumbs-up }
30
34
  .fa-credit { @extend .fa-check }
31
35
  .fa-approve { @extend .fa-check }
32
36
  .fa-icon-cogs { @extend .fa-cogs }
@@ -8,6 +8,10 @@ body {
8
8
  padding-left: $width-sidebar;
9
9
  }
10
10
 
11
+ .admin {
12
+ background-color: $admin-body-bg;
13
+ }
14
+
11
15
  .admin-nav {
12
16
  position: absolute;
13
17
  top: 0;
@@ -18,6 +22,7 @@ body {
18
22
  }
19
23
 
20
24
  .content-wrapper {
25
+ background-color: $content-wrapper-bg;
21
26
  padding-top: 1rem;
22
27
  padding-left: $grid-gutter-width;
23
28
  padding-right: $grid-gutter-width;
@@ -29,10 +34,6 @@ body {
29
34
  }
30
35
  }
31
36
 
32
- .content-main {
33
- overflow-x: hidden; // makes sure that the tabs are able to resize
34
- }
35
-
36
37
  #content {
37
38
  position: relative;
38
39
  padding: 0;
@@ -47,12 +47,12 @@ table {
47
47
 
48
48
  button[class*='fa-'] {
49
49
  color: $link-color;
50
- background-color: transparent;
50
+ background: transparent;
51
51
  border: 0 none;
52
52
  padding: 0 !important;
53
53
 
54
54
  &:hover {
55
- background-color: transparent;
55
+ background: transparent;
56
56
  }
57
57
  }
58
58
 
@@ -61,7 +61,7 @@ table {
61
61
  padding-left: 0px;
62
62
 
63
63
  &:hover {
64
- color: $color-3;
64
+ color: $color-dark-light;
65
65
  }
66
66
  }
67
67
 
@@ -108,14 +108,14 @@ table {
108
108
  }
109
109
 
110
110
  th a {
111
- color: $color-4;
111
+ color: $color-dark;
112
112
  }
113
113
 
114
114
  tbody {
115
115
  tr {
116
116
  &.deleted td {
117
- background-color: very-light(theme-color("danger"), 6);
118
- border-color: very-light(theme-color("danger"), 15);
117
+ background-color: lighten(theme-color("danger"), 6);
118
+ border-color: lighten(theme-color("danger"), 15);
119
119
  }
120
120
  }
121
121
 
@@ -123,4 +123,9 @@ table {
123
123
  border-top: none;
124
124
  }
125
125
  }
126
+
127
+ pre {
128
+ font-size: 100%;
129
+ margin-bottom: 0;
130
+ }
126
131
  }
@@ -7,7 +7,7 @@ html {
7
7
 
8
8
  body {
9
9
  padding: 0;
10
- font-weight: 400;
10
+ font-weight: $font-weight-normal;
11
11
  text-rendering: optimizeLegibility;
12
12
  }
13
13
 
@@ -17,6 +17,11 @@ hr {
17
17
  border-left: none;
18
18
  }
19
19
 
20
+ strong,
21
+ b {
22
+ font-weight: $font-weight-bold;
23
+ }
24
+
20
25
  // Headings
21
26
  //--------------------------------------------------------------
22
27
 
@@ -68,7 +73,6 @@ dl {
68
73
  width: 40%;
69
74
  font-weight: $font-weight-bold;
70
75
  padding-left: 0;
71
- font-size: 85%;
72
76
  clear: left;
73
77
  }
74
78
 
@@ -93,10 +97,10 @@ dl {
93
97
 
94
98
  .uppercase { text-transform: uppercase }
95
99
 
96
- .green { color: $color-2 }
97
- .blue { color: $color-3 }
98
- .red { color: $color-5 }
99
- .yellow { color: $color-6 }
100
+ .green { color: $color-green }
101
+ .blue { color: $color-primary }
102
+ .red { color: $color-red }
103
+ .yellow { color: $color-yellow }
100
104
 
101
105
  .negative { color: $red }
102
106
  input[type="number"].negative { color: $red } // needed to override blue style that is more specific than '.negative'
@@ -2,12 +2,14 @@
2
2
  @import 'spree/backend/globals/deprecation';
3
3
  @import 'spree/backend/globals/variables_override';
4
4
  @import 'spree/backend/globals/variables';
5
+ @import 'spree/backend/globals/deprecated_variables';
5
6
 
6
7
  @import 'bootstrap_custom';
7
8
  @import 'solidus_admin/bootstrap/bootstrap';
8
9
 
9
10
  @import 'spree/backend/globals/mixins';
10
11
 
12
+ @import 'spree/backend/shared/fonts';
11
13
  @import 'spree/backend/shared/typography';
12
14
  @import 'spree/backend/shared/images';
13
15
  @import 'spree/backend/shared/tables';
@@ -20,6 +22,7 @@
20
22
  @import 'spree/backend/components/states';
21
23
  @import 'spree/backend/components/actions';
22
24
  @import 'spree/backend/components/breadcrumb';
25
+ @import 'spree/backend/components/buttons';
23
26
  @import 'spree/backend/components/number_with_currency';
24
27
  @import 'spree/backend/components/hint';
25
28
  @import 'spree/backend/components/image_placeholder';
@@ -10,6 +10,7 @@ module Spree
10
10
  before_action :load_form_data, only: [:new, :edit]
11
11
  before_action :build_return_items_from_params, only: [:create]
12
12
  create.fails :load_form_data
13
+ create.after :order_process_return
13
14
 
14
15
  def edit
15
16
  @pending_return_items = @customer_return.return_items.select(&:pending?)
@@ -23,6 +24,10 @@ module Spree
23
24
 
24
25
  private
25
26
 
27
+ def order_process_return
28
+ @customer_return.process_return!
29
+ end
30
+
26
31
  def location_after_save
27
32
  url_for([:edit, :admin, @order, @customer_return])
28
33
  end
@@ -60,11 +65,13 @@ module Spree
60
65
 
61
66
  def build_return_items_from_params
62
67
  return_items_params = permitted_resource_params.delete(:return_items_attributes).values
63
-
64
68
  @customer_return.return_items = return_items_params.map do |item_params|
65
69
  next unless item_params.delete('returned') == '1'
66
70
  return_item = item_params[:id] ? Spree::ReturnItem.find(item_params[:id]) : Spree::ReturnItem.new
67
71
  return_item.assign_attributes(item_params)
72
+
73
+ return_item.skip_customer_return_processing = true
74
+
68
75
  if item_params[:reception_status_event].blank?
69
76
  return redirect_to(new_object_url, flash: { error: 'Reception status choice required' })
70
77
  end
@@ -6,6 +6,9 @@ module Spree
6
6
  before_action :find_order_and_payment
7
7
 
8
8
  def index
9
+ Spree::Deprecation.warn 'Using a dedicated route for payment log entries ' \
10
+ 'has been deprecated in favor of displaying the log entries on ' \
11
+ 'the payment screen itself.', caller_locations(0)
9
12
  @log_entries = @payment.log_entries
10
13
  end
11
14
 
@@ -14,7 +14,6 @@ module Spree
14
14
  respond_to :html
15
15
 
16
16
  def index
17
- query_present = params[:q]
18
17
  params[:q] ||= {}
19
18
  params[:q][:completed_at_not_null] ||= '1' if Spree::Config[:show_only_complete_orders_by_default]
20
19
  @show_only_completed = params[:q][:completed_at_not_null] == '1'
@@ -71,24 +71,26 @@ module Spree
71
71
 
72
72
  def items
73
73
  params[:q] ||= {}
74
+
74
75
  @search = Spree::Order.includes(
75
76
  line_items: {
76
77
  variant: [:product, { option_values: :option_type }]
77
78
  }
78
79
  ).ransack(params[:q].merge(user_id_eq: @user.id))
80
+
79
81
  @orders = @search.result.page(params[:page]).per(Spree::Config[:admin_products_per_page])
80
82
  end
81
83
 
82
84
  def generate_api_key
83
85
  if @user.generate_spree_api_key!
84
- flash[:success] = t('spree.api.key_generated')
86
+ flash[:success] = t('spree.admin.api.key_generated')
85
87
  end
86
88
  redirect_to edit_admin_user_path(@user)
87
89
  end
88
90
 
89
91
  def clear_api_key
90
92
  if @user.clear_spree_api_key!
91
- flash[:success] = t('spree.api.key_cleared')
93
+ flash[:success] = t('spree.admin.api.key_cleared')
92
94
  end
93
95
  redirect_to edit_admin_user_path(@user)
94
96
  end