workarea-admin 3.5.13 → 3.5.18

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/jquery_ujs/insert.js +30 -0
  3. data/app/assets/javascripts/workarea/admin/application.js.erb +1 -0
  4. data/app/assets/javascripts/workarea/admin/modules/remote_selects.js +13 -1
  5. data/app/assets/stylesheets/workarea/admin/components/_workflow_bar.scss +5 -0
  6. data/app/controllers/workarea/admin/bulk_variant_saving.rb +2 -1
  7. data/app/controllers/workarea/admin/configurations_controller.rb +2 -0
  8. data/app/view_models/workarea/admin/code_list_view_model.rb +1 -1
  9. data/app/view_models/workarea/admin/variant_view_model.rb +4 -0
  10. data/app/views/layouts/workarea/admin/application.html.haml +3 -1
  11. data/app/views/workarea/admin/catalog_variants/index.html.haml +1 -1
  12. data/app/views/workarea/admin/catalog_variants/new.html.haml +2 -0
  13. data/app/views/workarea/admin/changesets/index.html.haml +3 -1
  14. data/app/views/workarea/admin/content/_edit.html.haml +1 -1
  15. data/app/views/workarea/admin/content_assets/index.html.haml +2 -0
  16. data/app/views/workarea/admin/create_segments/setup.html.haml +2 -0
  17. data/app/views/workarea/admin/create_users/admin.html.haml +2 -0
  18. data/app/views/workarea/admin/facets/_applied.html.haml +1 -1
  19. data/app/views/workarea/admin/fulfillment_skus/edit.html.haml +3 -1
  20. data/app/views/workarea/admin/fulfillment_skus/new.html.haml +3 -1
  21. data/app/views/workarea/admin/inventory_skus/edit.html.haml +3 -1
  22. data/app/views/workarea/admin/inventory_skus/new.html.haml +3 -1
  23. data/app/views/workarea/admin/pricing_discount_code_lists/_cards.html.haml +1 -1
  24. data/app/views/workarea/admin/pricing_discount_code_lists/promo_codes.html.haml +3 -3
  25. data/app/views/workarea/admin/pricing_discount_code_lists/show.html.haml +1 -1
  26. data/app/views/workarea/admin/releases/show.html.haml +8 -4
  27. data/app/views/workarea/admin/segments/index.html.haml +1 -1
  28. data/app/views/workarea/admin/toolbar/show.html.haml +2 -0
  29. data/app/views/workarea/admin/users/permissions.html.haml +1 -1
  30. data/app/views/workarea/admin/users/show.html.haml +2 -2
  31. data/config/locales/en.yml +5 -1
  32. data/test/view_models/workarea/admin/code_list_view_model_test.rb +5 -0
  33. metadata +7 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '098a9ad9021d540d19a295ea8a02b2977d741bfceea307bc6ec4a5f5af89220c'
4
- data.tar.gz: 04c129147a023ced5857739fb66c749f1360e47f97b11961e99453b58ba1219b
3
+ metadata.gz: c6b46068c998bbe814822add9ab5e2cc9036905b1fff4051093c2d8312f2d959
4
+ data.tar.gz: 586a0e6ec7cc56a6fec6bb5bedcb5a1f3472f687b62c8185b585b264bb5ea6a6
5
5
  SHA512:
6
- metadata.gz: 855fa89d046ba65fa09c03ae3f82f34cfb508db818ab381b0c25c5fd353b5628003d4087c9ceae11daa1cb2cf7a12c97ae36c9c8166f8a0611f7df3390ec6b17
7
- data.tar.gz: '0601691b31b981310a4a139ee8ef894e16a0e5afcafcb87ba8c01c79e568ace43469da3c78dd180a6794644f6034d6e49d039c6c8566b5c7ff58e0c72c541048'
6
+ metadata.gz: f12e56f8d1f0013c1f63da5aa37880f28da03fa746a9f8926574b1889ebbd8910e76dd7a6f63aeeaf41a1831ea388df9aacc74833a7b0e7f21423d6ec4d3f5e4
7
+ data.tar.gz: 518be2e9744c165d0dcbc31eaba2e4f31f531dba8adc977b11fab3c64cce694e4c36a8e1f2e8ab473fb5b48ff104cbb6dfb73bdefcd387d190b5fb0a39831379
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Add data-insert to an element. When that element is also data-remote, the
3
+ * server's response will be appended into the element matching the value of
4
+ * the data-insert attribute. (with WORKAREA modules initialized). If that
5
+ * element is also insert-before or insert-after, the response will instead
6
+ * be inserted before or after, respectively, the matching element.
7
+ */
8
+
9
+ $(document).on('ajax:success', function (event, response) {
10
+ var $element = $(event.target),
11
+ targetSelector = $element.data('insert'),
12
+ $target,
13
+ $content;
14
+
15
+ if (! $element.is('[data-insert]')) { return; }
16
+ if (_.isEmpty(targetSelector)) { return; }
17
+
18
+ $target = $(targetSelector);
19
+ $content = $(response);
20
+
21
+ if ($element.is('[data-insert-after]')) {
22
+ $content.insertAfter($target);
23
+ } else if ($element.is('[data-insert-before]')) {
24
+ $content.insertBefore($target);
25
+ } else {
26
+ $target.append($content);
27
+ }
28
+
29
+ WORKAREA.initModules($content);
30
+ });
@@ -14,6 +14,7 @@ window.feature.testAll();
14
14
  jquery3
15
15
  jquery_ujs
16
16
  jquery_ujs/replace
17
+ jquery_ujs/insert
17
18
  jquery-ui/core
18
19
  jquery-ui/widget
19
20
  jquery-ui/position
@@ -31,9 +31,14 @@ WORKAREA.registerModule('remoteSelects', (function () {
31
31
  $(select).data('remoteSelect').options
32
32
  );
33
33
 
34
+
34
35
  settings.ajax.url = $(select).data('remoteSelect').source;
35
36
  settings.templateResult = formatOption;
36
37
 
38
+ if (settings.dropdownParent) {
39
+ settings.dropdownParent = $(settings.dropdownParent);
40
+ }
41
+
37
42
  return settings;
38
43
  },
39
44
 
@@ -73,9 +78,16 @@ WORKAREA.registerModule('remoteSelects', (function () {
73
78
  },
74
79
 
75
80
  initSelect2 = function (index, select) {
81
+ var config = getConfig(select);
82
+
76
83
  injectHiddenInput(index, select);
84
+ $(select).select2(config);
77
85
 
78
- $(select).select2(getConfig(select));
86
+ if (config.autoSubmit) {
87
+ $(select).on('select2:select', function () {
88
+ $(this).parents('form').submit();
89
+ });
90
+ }
79
91
 
80
92
  if ($(select).is('[multiple]')) {
81
93
  initSortable(select);
@@ -117,3 +117,8 @@ $workflow-bar-button-confirm-delete-hover-bg-color: $bright-red !default;
117
117
  background-color: $workflow-bar-button-confirm-delete-hover-bg-color;
118
118
  }
119
119
  }
120
+
121
+ .workflow-bar__button--disabled {
122
+ opacity: $forms-disabled-opacity;
123
+ cursor: not-allowed;
124
+ }
@@ -21,8 +21,9 @@ module Workarea
21
21
  end
22
22
 
23
23
  if attributes[:inventory].present?
24
- inventory = Inventory::Sku.find_or_create_by(id: variant.sku)
24
+ inventory = Inventory::Sku.find_or_initialize_by(id: variant.sku)
25
25
  inventory.available = attributes[:inventory]
26
+ inventory.policy = 'standard' if inventory.new_record?
26
27
  inventory.save!
27
28
  end
28
29
  end
@@ -1,6 +1,8 @@
1
1
  module Workarea
2
2
  module Admin
3
3
  class ConfigurationsController < Admin::ApplicationController
4
+ required_permissions :settings
5
+
4
6
  before_action :find_configuration
5
7
 
6
8
  def show; end
@@ -10,7 +10,7 @@ module Workarea
10
10
  end
11
11
 
12
12
  def used_count
13
- model.count - unused_promo_codes.count
13
+ model.promo_codes.count - unused_promo_codes.count
14
14
  end
15
15
 
16
16
  def last_used_at
@@ -15,6 +15,10 @@ module Workarea
15
15
  inventory.available
16
16
  end
17
17
 
18
+ def available_to_sell_inventory
19
+ inventory.available_to_sell
20
+ end
21
+
18
22
  def fulfillment
19
23
  @fulfillment ||= Fulfillment::Sku.find_or_create_by(id: sku)
20
24
  end
@@ -183,7 +183,9 @@
183
183
  %li.menu__item= link_to t('workarea.admin.layout.log_out'), storefront.logout_path, data: { method: 'delete' }, class: 'menu__link'
184
184
 
185
185
  .page-content
186
- #main.page-content__main{ role: 'main' }= yield
186
+ #main.page-content__main{ role: 'main' }
187
+ = append_partials('admin.page_content_top')
188
+ = yield
187
189
 
188
190
  %p.visually-hidden= link_to t('workarea.admin.layout.top_of_page'), '#top'
189
191
  = yield :javascript
@@ -45,7 +45,7 @@
45
45
  %td= link_to variant.fulfillment_policy, fulfillment_sku_path(variant.sku)
46
46
  %td.align-center
47
47
  = link_to inventory_sku_path(variant.sku) do
48
- = variant.available_inventory
48
+ = variant.available_to_sell_inventory
49
49
  %td.align-right
50
50
  = link_to pricing_sku_path(variant.sku) do
51
51
  = number_to_currency variant.pricing.sell_price
@@ -62,6 +62,8 @@
62
62
  = render 'workarea/admin/shared/csv_formatting_tooltip'
63
63
  %td.align-center -
64
64
 
65
+ = append_partials('admin.additional_variant_information_fields', variant: @variant)
66
+
65
67
  .workflow-bar
66
68
  .grid.grid--auto.grid--right.grid--middle
67
69
  .grid__cell= render 'workarea/admin/shared/activate_select', name: 'variant[activate_with]'
@@ -14,7 +14,9 @@
14
14
  = render_cards_for(@release, :planned_changes)
15
15
 
16
16
  - if @release.changesets_with_releasable.blank?
17
- %p.heading--2.align-center= t('workarea.admin.changesets.no_activity')
17
+ .section.align-center
18
+ %p.heading.heading--3= t('workarea.admin.changesets.no_changesets')
19
+ %p.heading.heading--3= link_to t('workarea.admin.changesets.plan_some_changes'), release_releasables_path(@release)
18
20
 
19
21
  .grid.grid--center
20
22
  .grid__cell.grid__cell--80-at-medium
@@ -7,7 +7,7 @@
7
7
  .grid.grid--middle
8
8
  .grid__cell.grid__cell--50
9
9
  - if content.show_areas?
10
- %span= content.name
10
+ %span #{t('workarea.admin.content.edit.current_area')}:
11
11
  = inline_svg('workarea/admin/icons/navigate_next.svg', class: 'svg-icon svg-icon--small svg-icon--white')
12
12
  = form_tag request.path, method: 'get', class: 'content-editor__area-select-form' do
13
13
  = select_tag 'area_id', options_for_select(content.area_options, content.current_area), data: { form_submitting_control: '' }
@@ -9,6 +9,8 @@
9
9
  %h1.heading--no-margin= t('workarea.admin.content_assets.index.title')
10
10
  %p= t('workarea.admin.content_assets.index.description')
11
11
 
12
+ = append_partials('admin.content_assets_index_view_heading')
13
+
12
14
  .view__container
13
15
  - if s3?
14
16
  .direct-upload{ data: { direct_upload: { type: 'asset' }.to_json, unsaved_changes: '' } }
@@ -10,6 +10,8 @@
10
10
  = render_message 'error', message
11
11
 
12
12
  = form_tag create_segments_path, method: 'post' do
13
+ = hidden_field_tag :id, @segment.id unless @segment.new_record?
14
+
13
15
  .section
14
16
  .property.property--required
15
17
  = label_tag 'segment_name', t('workarea.admin.fields.name'), class: 'property__name'
@@ -140,6 +140,8 @@
140
140
  = inline_svg('workarea/admin/icons/help.svg', class: 'svg-icon')
141
141
  %span= t('workarea.admin.users.permissions.help')
142
142
 
143
+ = append_partials('admin.user_permissions')
144
+
143
145
  .workflow-bar
144
146
  .grid.grid--middle
145
147
  .grid__cell.grid__cell--20
@@ -10,7 +10,7 @@
10
10
  - @search.facet_selections.each do |facet, values|
11
11
  - values.each do |value|
12
12
  %li.browsing-controls__applied-filter
13
- %span= value.titleize
13
+ %span= facet_value_display_name(facet, value)
14
14
  = link_to facet_path(facet, value), class: 'browsing-controls__applied-remove-link' do
15
15
  = inline_svg('workarea/admin/icons/close.svg', class: 'browsing-controls__applied-icon svg-icon svg-icon--small svg-icon--black', title: t('workarea.admin.facets.applied.remove_filter'))
16
16
 
@@ -31,7 +31,9 @@
31
31
  = inline_svg('workarea/admin/icons/help.svg', class: 'svg-icon svg-icon--small svg-icon--blue', title: t('workarea.admin.fields.policy'))
32
32
 
33
33
  #policy-info.tooltip-content
34
- %p= t('workarea.admin.fulfillment_skus.edit.policy_info_html')
34
+ %p
35
+ = t('workarea.admin.fulfillment_skus.edit.policy_info_html')
36
+ = append_partials('admin.fulfillment_sku_policy_info')
35
37
  = select_tag 'sku[policy]', options_for_select(fulfillment_policies, @sku.policy.optionize)
36
38
 
37
39
  .property
@@ -29,7 +29,9 @@
29
29
  = inline_svg('workarea/admin/icons/help.svg', class: 'svg-icon svg-icon--small svg-icon--blue', title: t('workarea.admin.fields.policy'))
30
30
 
31
31
  #policy-info.tooltip-content
32
- %p= t('workarea.admin.fulfillment_skus.edit.policy_info_html')
32
+ %p
33
+ = t('workarea.admin.fulfillment_skus.edit.policy_info_html')
34
+ = append_partials('admin.fulfillment_sku_policy_info')
33
35
  = select_tag 'sku[policy]', options_for_select(fulfillment_policies, @sku.policy.optionize)
34
36
 
35
37
  .property
@@ -32,7 +32,9 @@
32
32
  = link_to '#tracking-policy-info', data: { tooltip: '' } do
33
33
  = inline_svg('workarea/admin/icons/help.svg', class: 'svg-icon svg-icon--small svg-icon--blue', title: t('workarea.admin.inventory_skus.edit.tracking_policy'))
34
34
  #tracking-policy-info.tooltip-content
35
- %p= t('workarea.admin.inventory_skus.edit.tracking_policy_info_html')
35
+ %p
36
+ = t('workarea.admin.inventory_skus.edit.tracking_policy_info_html')
37
+ = append_partials('admin.inventory_sku_policy_info')
36
38
  = select_tag 'sku[policy]', options_for_select(inventory_policies, @sku.policy.optionize)
37
39
 
38
40
  .grid.grid--huge
@@ -28,7 +28,9 @@
28
28
  = link_to '#tracking-policy-info', data: { tooltip: '' } do
29
29
  = inline_svg('workarea/admin/icons/help.svg', class: 'svg-icon svg-icon--small svg-icon--blue', title: t('workarea.admin.inventory_skus.edit.tracking_policy'))
30
30
  #tracking-policy-info.tooltip-content
31
- %p= t('workarea.admin.inventory_skus.edit.tracking_policy_info_html')
31
+ %p
32
+ = t('workarea.admin.inventory_skus.edit.tracking_policy_info_html')
33
+ = append_partials('admin.inventory_sku_policy_info')
32
34
  = select_tag 'sku[policy]', options_for_select(inventory_policies, @sku.policy.optionize)
33
35
 
34
36
  .property
@@ -45,7 +45,7 @@
45
45
  .grid
46
46
  .grid__cell.grid__cell--50
47
47
  .align-center
48
- %h2.heading.heading--no-margin= model.count
48
+ %h2.heading.heading--no-margin= model.promo_codes.count
49
49
  %p #{t('workarea.admin.pricing_discount_code_lists.cards.promo_codes.total')}
50
50
  .grid__cell.grid__cell--50
51
51
  .align-center
@@ -17,7 +17,7 @@
17
17
 
18
18
  .view__container.view__container--narrow
19
19
  = render_cards_for(@code_list, :promo_codes)
20
- %p.align-center= t('workarea.admin.pricing_discount_code_lists.promo_code', count: @code_list.count)
20
+ %p.align-center= t('workarea.admin.pricing_discount_code_lists.promo_code', count: @code_list.promo_codes.count)
21
21
 
22
22
  %table
23
23
  %thead
@@ -43,8 +43,8 @@
43
43
  .grid__cell= link_to t('workarea.admin.shared.bulk_actions.import'), new_data_file_import_path(model_type: Workarea::Pricing::Discount::GeneratedPromoCode, return_to: pricing_discount_code_list_path(@code_list)), class: 'workflow-bar__button'
44
44
  .grid__cell= link_to t('workarea.admin.shared.bulk_actions.export'), new_data_file_export_path(model_type: Workarea::Pricing::Discount::GeneratedPromoCode, query_id: generic_admin_search_query_id(model_type: Workarea::Pricing::Discount::GeneratedPromoCode, query_params: { code_list_id: @code_list.id }), return_to: pricing_discount_code_list_path(@code_list)), class: 'workflow-bar__button workflow-bar__button--left-divide'
45
45
  - else
46
- .grid__cell= link_to t('workarea.admin.shared.bulk_actions.import'), '#disabled-info', disabled: 'disabled', class: 'workflow-bar__button', data: { tooltip: '' }
47
- .grid__cell= link_to t('workarea.admin.shared.bulk_actions.export'), '#disabled-info', disabled: 'disabled', class: 'workflow-bar__button workflow-bar__button--left-divide', data: { tooltip: '' }
46
+ .grid__cell= link_to t('workarea.admin.shared.bulk_actions.import'), '#disabled-info', disabled: 'disabled', class: 'workflow-bar__button workflow-bar__button--disabled', data: { tooltip: '' }
47
+ .grid__cell= link_to t('workarea.admin.shared.bulk_actions.export'), '#disabled-info', disabled: 'disabled', class: 'workflow-bar__button workflow-bar__button--left-divide workflow-bar__button--disabled', data: { tooltip: '' }
48
48
 
49
49
  #disabled-info.tooltip-content
50
50
  %p= t('workarea.admin.pricing_discount_code_lists.show.disabled_info')
@@ -25,7 +25,7 @@
25
25
  - if @code_list.generation_complete?
26
26
  .grid__cell= link_to t('workarea.admin.actions.delete'), pricing_discount_code_list_path(@code_list), class: 'workflow-bar__button workflow-bar__button--delete', data: { method: 'delete', confirm: t('workarea.admin.actions.delete_confirmation') }
27
27
  - else
28
- .grid__cell= link_to t('workarea.admin.actions.delete'), '#disabled-info', disabled: 'disabled', class: 'workflow-bar__button workflow-bar__button--delete', data: { tooltip: '' }
28
+ .grid__cell= link_to t('workarea.admin.actions.delete'), '#disabled-info', disabled: 'disabled', class: 'workflow-bar__button workflow-bar__button--delete workflow-bar__button--disabled', data: { tooltip: '' }
29
29
 
30
30
  #disabled-info.tooltip-content
31
31
  %p= t('workarea.admin.pricing_discount_code_lists.show.disabled_info')
@@ -21,18 +21,22 @@
21
21
  .grid.grid--auto.grid--right
22
22
  - if !@release.has_changes?
23
23
  .grid__cell
24
- = link_to t('workarea.admin.releases.show.visit_storefront_to_preview'), '#no-changes-to-preview-info', disabled: 'disabled', data: { tooltip: '' }, class: 'workflow-bar__button workflow-bar__button--update'
24
+ = link_to t('workarea.admin.releases.show.visit_storefront_to_preview'), '#no-changes-to-preview-info', disabled: 'disabled', data: { tooltip: '' }, class: 'workflow-bar__button workflow-bar__button--update workflow-bar__button--disabled'
25
25
  #no-changes-to-preview-info.tooltip-content
26
26
  %p= t('workarea.admin.releases.show.no_changes_to_preview')
27
27
 
28
28
  .grid__cell
29
- = link_to t('workarea.admin.releases.show.publish_now'), '#no-changes-to-publish-info', disabled: 'disabled', data: { tooltip: '' }, class: 'workflow-bar__button workflow-bar__button--update'
29
+ = link_to t('workarea.admin.releases.show.publish_now'), '#no-changes-to-publish-info', disabled: 'disabled', data: { tooltip: '' }, class: 'workflow-bar__button workflow-bar__button--update workflow-bar__button--disabled'
30
30
  #no-changes-to-publish-info.tooltip-content
31
31
  %p= t('workarea.admin.releases.show.no_changes_to_publish')
32
32
 
33
33
  - else
34
34
  .grid__cell
35
- - if current_release.try(:id) == @release.id
35
+ - if @release.published? && !@release.scheduled?
36
+ = link_to t('workarea.admin.releases.show.visit_storefront_to_preview'), '#cannot-preview-info', disabled: 'disabled', data: { tooltip: '' }, class: 'workflow-bar__button workflow-bar__button--update workflow-bar__button--disabled'
37
+ #cannot-preview-info.tooltip-content
38
+ %p= t('workarea.admin.releases.show.unscheduled_republish_preview_info')
39
+ - elsif current_release.try(:id) == @release.id
36
40
  = link_to t('workarea.admin.releases.show.visit_storefront_to_preview'), storefront.root_path, class: 'workflow-bar__button workflow-bar__button--update'
37
41
  - else
38
42
  = form_tag release_session_path, method: :post do
@@ -46,6 +50,6 @@
46
50
  = form_tag publish_release_path(@release), method: :patch do
47
51
  = button_tag publish_text, value: 'publish', class: 'workflow-bar__button workflow-bar__button--update'
48
52
  - else
49
- = link_to publish_text, '#cannot-publish-info', disabled: 'disabled', data: { tooltip: '' }, class: 'workflow-bar__button workflow-bar__button--update'
53
+ = link_to publish_text, '#cannot-publish-info', disabled: 'disabled', data: { tooltip: '' }, class: 'workflow-bar__button workflow-bar__button--update workflow-bar__button--disabled'
50
54
  #cannot-publish-info.tooltip-content
51
55
  %p= t('workarea.admin.releases.show.user_cannot_publish_info')
@@ -56,7 +56,7 @@
56
56
 
57
57
  .grid__cell.grid__cell--50.align-right
58
58
  - if segments.size >= 15
59
- = link_to t('workarea.admin.segments.index.add_custom'), '#max-segments-info', disabled: 'disabled', data: { tooltip: '' }, class: 'workflow-bar__button workflow-bar__button--create'
59
+ = link_to t('workarea.admin.segments.index.add_custom'), '#max-segments-info', disabled: 'disabled', data: { tooltip: '' }, class: 'workflow-bar__button workflow-bar__button--create workflow-bar__button--disabled'
60
60
  #max-segments-info.tooltip-content
61
61
  %p= t('workarea.admin.segments.index.max_segments')
62
62
 
@@ -32,6 +32,8 @@
32
32
  = search_field_tag :q, nil, placeholder: t('workarea.admin.toolbar.search_placeholder'), title: t('workarea.admin.toolbar.search_title'), class: 'search-form__input', data: { categorized_autocomplete_field: '' }, id: 'admin_search', aria: { label: t('workarea.admin.toolbar.search_title') }
33
33
  = submit_tag t('workarea.admin.toolbar.search'), class: 'search-form__button', value: 'search_admin'
34
34
 
35
+ = append_partials('admin.toolbar_header')
36
+
35
37
  - if @model.present?
36
38
  - unless @model.active?
37
39
  .header__alert
@@ -136,6 +136,6 @@
136
136
 
137
137
  .workflow-bar
138
138
  .grid.grid--auto.grid--right.grid--middle
139
- = append_partials('admin.user_permissions_workflow_bar')
139
+ = append_partials('admin.user_permissions_workflow_bar', user: @user)
140
140
  - button_styles = @user.super_admin? ? 'workflow-bar__button' : 'workflow-bar__button workflow-bar__button--update'
141
141
  .grid__cell= button_tag t('workarea.admin.users.permissions.button'), value: 'save_permissions', class: button_styles, disabled: @user.super_admin?
@@ -24,13 +24,13 @@
24
24
  .grid.grid--auto.grid--right.grid--middle.grid--flush
25
25
  - if @user == current_user
26
26
  .grid__cell
27
- = link_to t('workarea.admin.users.show.impersonate'), '#impersonate-yourself-info', disabled: 'disabled', data: { tooltip: '' }, class: 'workflow-bar__button workflow-bar__button--update'
27
+ = link_to t('workarea.admin.users.show.impersonate'), '#impersonate-yourself-info', disabled: 'disabled', data: { tooltip: '' }, class: 'workflow-bar__button workflow-bar__button--update workflow-bar__button--disabled'
28
28
  #impersonate-yourself-info.tooltip-content
29
29
  %p= t('workarea.admin.users.show.cant_impersonate_yourself')
30
30
 
31
31
  - elsif @user.admin?
32
32
  .grid__cell
33
- = link_to t('workarea.admin.users.show.impersonate'), '#impersonate-other-admins-info', disabled: 'disabled', data: { tooltip: '' }, class: 'workflow-bar__button workflow-bar__button--update'
33
+ = link_to t('workarea.admin.users.show.impersonate'), '#impersonate-other-admins-info', disabled: 'disabled', data: { tooltip: '' }, class: 'workflow-bar__button workflow-bar__button--update workflow-bar__button--disabled'
34
34
  #impersonate-other-admins-info.tooltip-content
35
35
  %p= t('workarea.admin.users.show.cant_impersonate_other_administrators')
36
36
 
@@ -579,6 +579,8 @@ en:
579
579
  flash_messages:
580
580
  removed: These changes have been removed
581
581
  no_activity: No activity to show
582
+ no_changesets: There aren't any planned changes for this release.
583
+ plan_some_changes: Go plan some changes!
582
584
  planned_changes_for: Planned Changes For
583
585
  published_on: Published On
584
586
  publishes_on: Publishes On
@@ -703,6 +705,7 @@ en:
703
705
  loading: Loading...
704
706
  preview: Preview
705
707
  title: Content for %{content}
708
+ current_area: 'Current Area'
706
709
  form:
707
710
  all_blocks: All blocks
708
711
  cancel: Cancel
@@ -1863,7 +1866,7 @@ en:
1863
1866
  policy: 'Policy:'
1864
1867
  file: 'File:'
1865
1868
  edit:
1866
- policy_info_html: "<p><strong>Ship:</strong> Item requires shipping. System does nothing automatically for this SKU.</p> <p><strong>Ignore:</strong> Item does not require shipping. System does nothing automatically for this SKU.</p> <p><strong>Download:</strong> Generates a unique URL token that grants the customer access to attached file through a download link in the order summary.</p>"
1869
+ policy_info_html: "<p><strong>Shipping:</strong> Item requires shipping. System does nothing automatically for this SKU.</p><p><strong>Download:</strong> Generates a unique URL token that grants the customer access to attached file through a download link in the order summary.</p>"
1867
1870
  page_title: Edit Fulfillment SKU %{sku}
1868
1871
  save_sku: Save SKU
1869
1872
  flash_messages:
@@ -3189,6 +3192,7 @@ en:
3189
3192
  start_preview_in_storefront: Start preview in storefront
3190
3193
  undo: Undo
3191
3194
  visit_storefront_to_preview: Preview
3195
+ unscheduled_republish_preview_info: This release is already published, you'll need to schedule it again to preview its changes.
3192
3196
  no_changes_to_preview: There are no changes to preview. Click on the Plan Changes card to start!
3193
3197
  no_changes_to_publish: There are no changes to publish for this release. Click on the Plan Changes card to start!
3194
3198
  no_changes_to_undo: There are no changes to undo for this release. Click on the Plan Changes card to start!
@@ -21,6 +21,11 @@ module Workarea
21
21
 
22
22
  view_model = CodeListViewModel.wrap(code_list)
23
23
  assert_equal(1, view_model.used_count)
24
+
25
+ code_list.promo_codes.create!(code: "#{code_list.prefix}123")
26
+
27
+ view_model = CodeListViewModel.wrap(code_list)
28
+ assert_equal(1, view_model.used_count)
24
29
  end
25
30
 
26
31
  def test_last_used_at
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: workarea-admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.13
4
+ version: 3.5.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Crouse
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-11 00:00:00.000000000 Z
11
+ date: 2020-09-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: workarea-core
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 3.5.13
19
+ version: 3.5.18
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: 3.5.13
26
+ version: 3.5.18
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: workarea-storefront
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 3.5.13
33
+ version: 3.5.18
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: 3.5.13
40
+ version: 3.5.18
41
41
  description: Provides site administration functionality for the Workarea Commerce
42
42
  Platform.
43
43
  email:
@@ -175,6 +175,7 @@ files:
175
175
  - app/assets/images/workarea/admin/selected.svg
176
176
  - app/assets/images/workarea/admin/valid.svg
177
177
  - app/assets/javascripts/jquery_ui/admin/categorized_autocomplete.js
178
+ - app/assets/javascripts/jquery_ujs/insert.js
178
179
  - app/assets/javascripts/jquery_ujs/replace.js
179
180
  - app/assets/javascripts/workarea/admin/application.js.erb
180
181
  - app/assets/javascripts/workarea/admin/config.js.erb