spree_admin 5.1.0.beta3 → 5.1.0.beta4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ad8df3c5f0debff456ba6a1a0e71dc8d30fec31ad3ba5d64bfe0cab5d38d16de
4
- data.tar.gz: 57aa367a0b8685fa0a58256572a3251a3b85174de87285533b1a29078209fbef
3
+ metadata.gz: 3f5759966c4d6a61b9c2b51e85b01e209cefabf35fb2ec0934623d21f1937e23
4
+ data.tar.gz: '0994653a7d251af2746bde91daf82e7ea397063821f4f8019face626deb733d6'
5
5
  SHA512:
6
- metadata.gz: c6296a732fe8e299b6b9081110b63a83f7b583488365c90b7611cbc00bf1f4162519f56817672dc20d4f2e5898aaf44f39e0e77a0ff70e10642981c44160b7ef
7
- data.tar.gz: 97d4e2b93be33bc4ba57fc8cdea559720c117628f28029cecc39bdb0dda53473b4bf513e190a7ab2ceca512d827d08250d9f63bf7eefe1e290fc7545c9b56f59
6
+ metadata.gz: 55e5ffcfc30c9238cbe32909defe509b7a9dd919d80589cafcc24031acbd6559bd05c56aea57bd62dbbc06ae496b6787a087b3ac9a5306b141924884b6e5896a
7
+ data.tar.gz: 838eba52a5b8bc939c4c7ac5a541cc621f1f347f43f0354a591c973a13c33fea7a2cc79ea18e88f1f1bf0d41c4e34a27bebf418640bc1e5a8a4cb5fdbe3f1748
@@ -16,7 +16,7 @@
16
16
  display: flex;
17
17
  align-items: center;
18
18
  justify-content: space-between;
19
- padding-left: 0.75rem;
19
+ padding-left: 0.5rem;
20
20
  padding-right: 0.75rem;
21
21
  background-color: $sidebar-bg;
22
22
  width: $sidebar-width;
@@ -27,9 +27,9 @@ $container-max-widths: (
27
27
  sm: 540px,
28
28
  md: 720px,
29
29
  lg: 960px,
30
- xl: 1240px
30
+ xl: 1272px
31
31
  ) !default;
32
-
32
+ $grid-gutter-width: 16px !default;
33
33
 
34
34
  $theme-colors: (
35
35
  "white": $white,
@@ -0,0 +1,12 @@
1
+ module Spree
2
+ module Admin
3
+ module OrderBreadcrumbConcern
4
+ extend ActiveSupport::Concern
5
+
6
+ included do
7
+ add_breadcrumb Spree.t(:orders), :admin_orders_path
8
+ add_breadcrumb_icon 'inbox'
9
+ end
10
+ end
11
+ end
12
+ end
@@ -3,6 +3,7 @@ module Spree
3
3
  class OrdersController < Spree::Admin::BaseController
4
4
  include Spree::Admin::OrderConcern
5
5
  include Spree::Admin::OrdersFiltersHelper
6
+ include Spree::Admin::OrderBreadcrumbConcern
6
7
 
7
8
  before_action :initialize_order_events
8
9
  before_action :load_order, only: %i[edit cancel resend]
@@ -11,9 +12,6 @@ module Spree
11
12
 
12
13
  helper_method :model_class
13
14
 
14
- add_breadcrumb Spree.t(:orders), :admin_orders_path
15
- add_breadcrumb_icon 'inbox'
16
-
17
15
  def create
18
16
  @order = Spree::Order.create(created_by: try_spree_current_user, store: current_store)
19
17
 
@@ -180,10 +180,10 @@ module Spree
180
180
  @product_options[option_type.id.to_s] = {
181
181
  name: option_type.presentation,
182
182
  position: index + 1,
183
- values: option_values.pluck(:presentation).uniq
183
+ values: option_values.pluck(:name, :presentation).uniq.map { |name, presentation| { value: name, text: presentation } }
184
184
  }
185
185
 
186
- @product_available_options[option_type.id.to_s] = option_type.option_values.to_tom_select_json
186
+ @product_available_options[option_type.id.to_s] = option_type.option_values.pluck(:name, :presentation).uniq.map { |name, presentation| { id: name, name: presentation } }
187
187
  end
188
188
 
189
189
  @product_stock = {}
@@ -1,6 +1,8 @@
1
1
  module Spree
2
2
  module Admin
3
3
  class RefundsController < ResourceController
4
+ include Spree::Admin::OrderBreadcrumbConcern
5
+
4
6
  belongs_to 'spree/payment', find_by: :number
5
7
 
6
8
  before_action :load_order
@@ -18,6 +20,8 @@ module Spree
18
20
 
19
21
  def load_order
20
22
  @order = @payment.order if @payment
23
+
24
+ add_breadcrumb @order.number, spree.edit_admin_order_path(@order)
21
25
  end
22
26
 
23
27
  def refund_reasons
@@ -26,8 +26,9 @@ export default class extends Controller {
26
26
  values() {
27
27
  return this.selectTargets
28
28
  .map((selectTarget) => selectTarget.querySelector('select'))
29
- .map((select) => select.options[select.selectedIndex].text)
30
- .filter((text) => text?.length > 0)
29
+ .map((select) => select.options[select.selectedIndex])
30
+ .filter((option) => option.value.length > 0)
31
+ .map((option) => ({ text: option.text, value: option.value}))
31
32
  }
32
33
 
33
34
  setValues() {
@@ -129,7 +129,7 @@ export default class extends CheckboxSelectAll {
129
129
  const nestingLevel = internalName.split('/').length
130
130
  if (nestingLevel === 1) {
131
131
  const firstOptionKey = Object.keys(this.optionsValue)[0]
132
- const newOptionValues = this.optionsValue[firstOptionKey].values.filter((value) => value !== internalName)
132
+ const newOptionValues = this.optionsValue[firstOptionKey].values.filter((value) => value.text !== internalName)
133
133
  if (newOptionValues.length === 0) {
134
134
  const newOptionsValue = this.optionsValue
135
135
  delete newOptionsValue[firstOptionKey]
@@ -265,12 +265,12 @@ export default class extends CheckboxSelectAll {
265
265
  let name = ''
266
266
  let internalName = name
267
267
  if (i === 0) {
268
- name = variant[keys[i]]
268
+ name = variant[keys[i]].text
269
269
  internalName = name
270
270
  } else {
271
- const namesPath = keys.slice(1, keys.length).map((key) => variant[key])
271
+ const namesPath = keys.slice(1, keys.length).map((key) => variant[key].text)
272
272
  name = namesPath.join(' / ')
273
- internalName = `${variant[keys[0]]}/${namesPath.join('/')}`
273
+ internalName = `${variant[keys[0]].text}/${namesPath.join('/')}`
274
274
  }
275
275
 
276
276
  return { name, internalName }
@@ -572,12 +572,12 @@ export default class extends CheckboxSelectAll {
572
572
  refreshParentInputs() {
573
573
  const firstOption = Object.values(this.optionsValue)[0]
574
574
  if (firstOption) {
575
- firstOption.values.forEach((name) => {
575
+ firstOption.values.forEach((option) => {
576
576
  this.currenciesValue.forEach((currency) => {
577
- this.updateParentPriceRange(name, currency)
577
+ this.updateParentPriceRange(option.text, currency)
578
578
  })
579
579
  this.stockLocationsValue.forEach((stockLocationId) => {
580
- this.updateParentStockSum(name, stockLocationId)
580
+ this.updateParentStockSum(option.text, stockLocationId)
581
581
  })
582
582
  this.updateShopLocationCountOnHand()
583
583
  })
@@ -615,11 +615,17 @@ export default class extends CheckboxSelectAll {
615
615
  .find((option) => option.name === key).position
616
616
  inputs.push(positionInput)
617
617
 
618
- const valueInput = document.createElement('input')
619
- valueInput.type = 'hidden'
620
- valueInput.name = `product[variants_attributes][${i}][options][][value]`
621
- valueInput.value = variant[key]
622
- inputs.push(valueInput)
618
+ const optionNameInput = document.createElement('input')
619
+ optionNameInput.type = 'hidden'
620
+ optionNameInput.name = `product[variants_attributes][${i}][options][][option_value_name]`
621
+ optionNameInput.value = variant[key].value
622
+ inputs.push(optionNameInput)
623
+
624
+ const optionIdInput = document.createElement('input')
625
+ optionIdInput.type = 'hidden'
626
+ optionIdInput.name = `product[variants_attributes][${i}][options][][option_value_presentation]`
627
+ optionIdInput.value = variant[key].text
628
+ inputs.push(optionIdInput)
623
629
  })
624
630
 
625
631
  return inputs
@@ -924,8 +930,8 @@ export default class extends CheckboxSelectAll {
924
930
  const optionValuesSelectContainer = template.querySelector('[data-slot="optionValuesSelectContainer"]')
925
931
  const tomSelectOptionValues = optionValues.map((optionValue) => {
926
932
  return {
927
- id: availableOptions.find((availableOption) => availableOption.name === optionValue)?.id,
928
- name: optionValue
933
+ id: optionValue.value,
934
+ name: optionValue.text,
929
935
  }
930
936
  })
931
937
 
@@ -948,8 +954,8 @@ export default class extends CheckboxSelectAll {
948
954
  values.forEach((value) => {
949
955
  const template = this.optionValueTemplateTarget.content.cloneNode(true)
950
956
  const optionValueNameEl = template.querySelector('[data-slot="optionValueName"]')
951
- optionValueNameEl.textContent = value
952
- optionValueNameEl.dataset.name = value
957
+ optionValueNameEl.textContent = value.text
958
+ optionValueNameEl.dataset.name = value.text
953
959
 
954
960
  templates.push(template)
955
961
  })
@@ -3,7 +3,7 @@
3
3
  <div data-replace-target="from">
4
4
  <div readonly class="form-control d-flex align-items-center justify-content-between pr-1">
5
5
  <span class="text-muted">
6
- ...<%= form.object.send(field).last(4) %>
6
+ ...<%= form.object.send(field)&.last(4) %>
7
7
  </span>
8
8
  <button class="btn btn-sm btn-light" type="button" data-action="click->replace#replace">
9
9
  <%= icon 'edit', class: 'mr-2' %>
@@ -23,4 +23,4 @@
23
23
  <% else %>
24
24
  <%= form.password_field(field, preference_field_options(options)) %>
25
25
  <% end %>
26
- </div>
26
+ </div>
@@ -1,7 +1,5 @@
1
- <%= render 'spree/admin/orders/header' %>
2
-
3
- <div class="row">
4
- <div class="col-lg-6">
1
+ <div class="row mt-4">
2
+ <div class="col-lg-6 offset-lg-3">
5
3
  <%= render 'spree/admin/shared/error_messages', target: @refund %>
6
4
 
7
5
  <%= form_for [:admin, @refund.payment.order, @refund.payment, @refund] do |f| %>
@@ -1,4 +1,4 @@
1
- <% orders_active = %[orders checkouts].include?(controller_name) || @order %>
1
+ <% orders_active = %[orders checkouts].include?(controller_name) || @order&.present? || @parent&.is_a?(Spree::Order) %>
2
2
  <% if can?(:manage, Spree::Order) %>
3
3
  <% orders_label = Spree.t(:orders) %>
4
4
  <% if ready_to_ship_orders_count&.positive? %>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.1.0.beta3
4
+ version: 5.1.0.beta4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vendo Connect Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-05-29 00:00:00.000000000 Z
11
+ date: 2025-06-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: spree_core
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 5.1.0.beta3
19
+ version: 5.1.0.beta4
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 5.1.0.beta3
26
+ version: 5.1.0.beta4
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: spree_api
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 5.1.0.beta3
33
+ version: 5.1.0.beta4
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 5.1.0.beta3
40
+ version: 5.1.0.beta4
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: active_link_to
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -328,6 +328,7 @@ files:
328
328
  - app/controllers/concerns/spree/admin/analytics_concern.rb
329
329
  - app/controllers/concerns/spree/admin/breadcrumb_concern.rb
330
330
  - app/controllers/concerns/spree/admin/bulk_operations_concern.rb
331
+ - app/controllers/concerns/spree/admin/order_breadcrumb_concern.rb
331
332
  - app/controllers/concerns/spree/admin/order_concern.rb
332
333
  - app/controllers/concerns/spree/admin/page_builder_concern.rb
333
334
  - app/controllers/concerns/spree/admin/preferences_concern.rb
@@ -1118,9 +1119,9 @@ licenses:
1118
1119
  - AGPL-3.0-or-later
1119
1120
  metadata:
1120
1121
  bug_tracker_uri: https://github.com/spree/spree/issues
1121
- changelog_uri: https://github.com/spree/spree/releases/tag/v5.1.0.beta3
1122
+ changelog_uri: https://github.com/spree/spree/releases/tag/v5.1.0.beta4
1122
1123
  documentation_uri: https://docs.spreecommerce.org/
1123
- source_code_uri: https://github.com/spree/spree/tree/v5.1.0.beta3
1124
+ source_code_uri: https://github.com/spree/spree/tree/v5.1.0.beta4
1124
1125
  post_install_message:
1125
1126
  rdoc_options: []
1126
1127
  require_paths: