workarea-admin 3.5.20 → 3.5.26

Sign up to get free protection for your applications and to get access to all the features.
Files changed (29) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/workarea/admin/modules/new_navigation_taxons.js +2 -1
  3. data/app/controllers/workarea/admin/create_release_undos_controller.rb +19 -5
  4. data/app/controllers/workarea/admin/impersonations_controller.rb +2 -1
  5. data/app/controllers/workarea/admin/releases_controller.rb +1 -4
  6. data/app/helpers/workarea/admin/application_helper.rb +4 -0
  7. data/app/helpers/workarea/admin/changesets_helper.rb +20 -4
  8. data/app/view_models/workarea/admin/changeset_summary_view_model.rb +39 -0
  9. data/app/view_models/workarea/admin/release_view_model.rb +22 -3
  10. data/app/views/workarea/admin/catalog_categories/edit.html.haml +3 -0
  11. data/app/views/workarea/admin/changesets/index.html.haml +30 -1
  12. data/app/views/workarea/admin/create_release_undos/new.html.haml +6 -3
  13. data/app/views/workarea/admin/create_release_undos/review.html.haml +8 -2
  14. data/app/views/workarea/admin/navigation_redirects/index.html.haml +5 -0
  15. data/app/views/workarea/admin/releases/_cards.html.haml +8 -67
  16. data/app/views/workarea/admin/releases/show.html.haml +8 -0
  17. data/app/views/workarea/admin/users/insights.html.haml +12 -0
  18. data/config/locales/en.yml +24 -35
  19. data/config/routes.rb +3 -5
  20. data/test/helpers/workarea/admin/changesets_helper_test.rb +24 -0
  21. data/test/integration/workarea/admin/create_release_undos_integration_test.rb +27 -2
  22. data/test/integration/workarea/admin/impersonations_integration_test.rb +19 -3
  23. data/test/javascripts/fixtures/existing_navigation_taxon.html.haml +10 -0
  24. data/test/javascripts/new_navigation_taxons_spec.js +12 -1
  25. data/test/system/workarea/admin/impersonation_system_test.rb +1 -1
  26. data/test/system/workarea/admin/releases_system_test.rb +45 -16
  27. metadata +10 -9
  28. data/app/views/workarea/admin/releases/original.html.haml +0 -50
  29. data/app/views/workarea/admin/releases/undo.html.haml +0 -64
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a607bf3907ae033b463b4ea975e63e3baa64fb962d657df6cf0441071b815660
4
- data.tar.gz: df1ead081c2c5fe988c3f982ee90aaf27c98f45e7d1b3834e5586c1edd6059c0
3
+ metadata.gz: 63e71785795f88b55b9472da8afe05b1c3a8af3ae039fc631a190f1abe8910e1
4
+ data.tar.gz: 9fecf928a3ac3cb6e6f10dc0d5b854d0cdfb201ba2c787cfe1c8307786ea9849
5
5
  SHA512:
6
- metadata.gz: 201839f44d3f88443143a796a34c6062d9b6ed0abc417ae2e1c54ae661ef767d5d288bd6a3f540c0ecebb464970a6750b550082f7617b1083c8ab8432551d8cd
7
- data.tar.gz: 114f7ae013a9df030ddac85460e6e3c689c44243726698a0de307678aeee2d707cef52d7d5d9195f9577121416588007423f09a2a0a7300e48ed117fa0664f7a
6
+ metadata.gz: 7fdb291a95851692d78d2f9e3a7cdf0e4411ad8dc2b94a805e9b88d005ea1045ba9f59bdf51eb8e316d0bc94c65a20820598d1c1052cf89645942919c2e7cfaa
7
+ data.tar.gz: 74997eb59bce76b12c712b0a553b2b9a64a9570567af778dc103401a27918c200481bbcf27fd04f753db364754f34c8e1be3f1a83691e8bd23fde3f90faae109
@@ -23,8 +23,9 @@ WORKAREA.registerModule('newNavigationTaxons', (function () {
23
23
  createRemoteSelect = function (event) {
24
24
  var $typeSelect = $(event.currentTarget),
25
25
  $idSelect = $('[name=navigable_id]', event.delegateTarget),
26
+ $section = $typeSelect.closest('[data-new-navigation-taxon]'),
26
27
  settings = getConfig($typeSelect),
27
- selected = $typeSelect.data('newNavigationTaxon');
28
+ selected = $section.data('newNavigationTaxon');
28
29
 
29
30
  if ($idSelect.is('.select2-hidden-accessible') && _.isUndefined(selected)) {
30
31
  destroyRemoteSelect($idSelect);
@@ -13,12 +13,20 @@ module Workarea
13
13
  @undo_release.attributes = params[:release]
14
14
 
15
15
  if @undo_release.save
16
- @release.changesets.each do |changeset|
17
- changeset.build_undo(release: @undo_release.model).save!
16
+ @release.changesets.limit(Workarea.config.per_page).each do |changeset|
17
+ if changeset.releasable.present?
18
+ changeset.build_undo(release: @undo_release.model).save!
19
+ changeset.releasable.run_callbacks(:save)
20
+ end
18
21
  end
19
22
 
23
+ BuildReleaseUndoChangesets.perform_async(
24
+ @undo_release.id,
25
+ @release.id
26
+ ) if @release.changeset_count > Workarea.config.per_page
27
+
20
28
  flash[:success] = t('workarea.admin.create_release_undos.flash_messages.saved')
21
- redirect_to review_release_undo_path(@release)
29
+ redirect_to review_release_undo_path(@release, @undo_release)
22
30
  else
23
31
  render :new, status: :unprocessable_entity
24
32
  end
@@ -35,8 +43,14 @@ module Workarea
35
43
  end
36
44
 
37
45
  def find_undo_release
38
- model = @release.model.undo || @release.build_undo(params[:release])
39
- @undo_release = ReleaseViewModel.new(model, view_model_options)
46
+ model =
47
+ if params[:id].present?
48
+ @release.model.undos.find(params[:id])
49
+ else
50
+ @release.build_undo
51
+ end
52
+
53
+ @undo_release = ReleaseViewModel.wrap(model, view_model_options)
40
54
  end
41
55
  end
42
56
  end
@@ -27,7 +27,8 @@ module Workarea
27
27
  clear_current_order
28
28
 
29
29
  flash[:success] = t('workarea.admin.users.flash_messages.stopped')
30
- redirect_back_or(user_path(previous_user_id))
30
+ referrer = URI.parse(request.referrer).request_uri rescue nil
31
+ redirect_back_or(referrer.presence || user_path(previous_user_id))
31
32
  end
32
33
  end
33
34
  end
@@ -43,9 +43,6 @@ module Workarea
43
43
  end
44
44
  end
45
45
 
46
- def original
47
- end
48
-
49
46
  def publish
50
47
  self.current_release = nil
51
48
  PublishRelease.perform_async(@release.id)
@@ -59,7 +56,7 @@ module Workarea
59
56
  @release.destroy
60
57
 
61
58
  flash[:success] = t('workarea.admin.releases.flash_messages.removed')
62
- redirect_to releases_path
59
+ redirect_back_or releases_path
63
60
  end
64
61
 
65
62
  def calendar_feed
@@ -175,6 +175,10 @@ module Workarea
175
175
  .map { |unit, val| t("workarea.duration.#{unit}", count: val) }
176
176
  .to_sentence
177
177
  end
178
+
179
+ def navigation_redirects_enabled?
180
+ !Rails.application.config.consider_all_requests_local
181
+ end
178
182
  end
179
183
  end
180
184
  end
@@ -2,13 +2,29 @@ module Workarea
2
2
  module Admin::ChangesetsHelper
3
3
  def changeset_icon(changeset, options = {})
4
4
  type = changeset.root.model_name.element
5
- inline_svg(icon_path(type), options)
5
+ inline_svg(
6
+ releasable_icon_path(type),
7
+ options.reverse_merge(fallback: default_releasable_icon_path)
8
+ )
6
9
  end
7
10
 
8
- private
11
+ def releaseable_icon(model, options = {})
12
+ type = model.model_name.element
13
+ inline_svg(
14
+ releasable_icon_path(type),
15
+ options.reverse_merge(fallback: default_releasable_icon_path)
16
+ )
17
+ end
18
+
19
+ def releasable_icon_path(type)
20
+ return default_releasable_icon_path unless type.present?
21
+
22
+ Workarea.config.releasable_icons[type.to_sym] ||
23
+ "workarea/admin/icons/#{type}.svg"
24
+ end
9
25
 
10
- def icon_path(type)
11
- Workarea.config.releasable_icons[type.to_sym] || "workarea/admin/icons/#{type}.svg"
26
+ def default_releasable_icon_path
27
+ 'workarea/admin/icons/release.svg'
12
28
  end
13
29
  end
14
30
  end
@@ -0,0 +1,39 @@
1
+ module Workarea
2
+ module Admin
3
+ class ChangesetSummaryViewModel < ApplicationViewModel
4
+ delegate :model_name, to: :model_class
5
+
6
+ def count
7
+ model['count']
8
+ end
9
+
10
+ def type
11
+ model['_id']
12
+ end
13
+
14
+ def type_filter
15
+ search_model&.type || model_name.param_key
16
+ end
17
+
18
+ def label
19
+ type_filter.titleize.pluralize(count)
20
+ end
21
+
22
+ def searchable?
23
+ search_model.present?
24
+ end
25
+
26
+ private
27
+
28
+ def model_class
29
+ @model_class ||= type.constantize
30
+ end
31
+
32
+ def search_model
33
+ return @search_model if defined?(@serch_model)
34
+
35
+ @search_model = Search::Admin.for(model_class.new)
36
+ end
37
+ end
38
+ end
39
+ end
@@ -7,9 +7,29 @@ module Workarea
7
7
  @timeline ||= TimelineViewModel.new(model)
8
8
  end
9
9
 
10
+ def changeset_count
11
+ @changeset_count ||= model.changesets.count
12
+ end
13
+
14
+ def additional_changesets_count
15
+ [changeset_count - Workarea.config.per_page, 0].max
16
+ end
17
+
18
+ def show_changeset_summary?
19
+ changeset_count > Workarea.config.per_page
20
+ end
21
+
22
+ def changeset_summary
23
+ @changeset_summary ||=
24
+ Release::Changeset.summary(model.id).map do |type|
25
+ ChangesetSummaryViewModel.new(type)
26
+ end
27
+ end
28
+
10
29
  def changesets_with_releasable
11
30
  @changesets_with_releasable ||= model
12
31
  .changesets
32
+ .latest
13
33
  .map { |c| ChangesetViewModel.wrap(c) }
14
34
  .select { |changeset| changeset.root.present? }
15
35
  .reject { |changeset| changeset.releasable.blank? }
@@ -23,9 +43,8 @@ module Workarea
23
43
  calendar_at&.to_date
24
44
  end
25
45
 
26
- def undo
27
- return unless undo?
28
- @undo ||= ReleaseViewModel.wrap(model.undo, options)
46
+ def undos
47
+ @undos ||= ReleaseViewModel.wrap(model.undos, options)
29
48
  end
30
49
 
31
50
  def undoes
@@ -60,6 +60,9 @@
60
60
  .property
61
61
  = label_tag 'category_default_sort', t('workarea.admin.fields.default_sort'), class: 'property__name'
62
62
  = select_tag 'category[default_sort]', options_for_select(@category.sort_options, selected: @category.default_sort)
63
+ - if @category.featured_products?
64
+ %span.property__note
65
+ = t('workarea.admin.catalog_categories.edit.default_sort_note')
63
66
 
64
67
  .property
65
68
  = label_tag 'category_terms_facets_list', t('workarea.admin.fields.terms_facets_list'), class: 'property__name'
@@ -13,12 +13,37 @@
13
13
  .view__container
14
14
  = render_cards_for(@release, :planned_changes)
15
15
 
16
- - if @release.changesets_with_releasable.blank?
16
+ - if @release.changeset_count.zero?
17
17
  .section.align-center
18
18
  %p.heading.heading--3= t('workarea.admin.changesets.no_changesets')
19
19
  %p.heading.heading--3= link_to t('workarea.admin.changesets.plan_some_changes'), release_releasables_path(@release)
20
20
 
21
+ .browsing-controls.browsing-controls--with-divider
22
+ %p.browsing-controls__count{ data: { browsing_controls_count: @release.changeset_count } }
23
+ = t('workarea.admin.changesets.pluralize_change', count: @release.changeset_count)
24
+
25
+
21
26
  .grid.grid--center
27
+ - if @release.show_changeset_summary?
28
+ .grid__cell.grid__cell--80-at-medium
29
+ .section
30
+ .grid.grid--center.grid--auto
31
+ - @release.changeset_summary.each do |summary|
32
+ .grid__cell
33
+ - if summary.searchable?
34
+ .card.card--button
35
+ = link_to search_path(type: [summary.type_filter], upcoming_changes: [@release.id]), class: 'card__header' do
36
+ .card__header-text #{summary.count} #{summary.label}
37
+ = releaseable_icon summary, { class: 'card__icon'}
38
+ - else
39
+ .card
40
+ .card__header
41
+ .card__header-text #{summary.count} #{summary.label}
42
+ = releaseable_icon summary, { class: 'card__icon'}
43
+
44
+ .grid__cell.grid__cell--80-at-medium
45
+ %h2.align-center= t('workarea.admin.changesets.recent')
46
+
22
47
  .grid__cell.grid__cell--80-at-medium
23
48
  %ul.list-reset
24
49
  - @release.changesets_with_releasable.each do |changeset|
@@ -42,3 +67,7 @@
42
67
  .release-changeset__body
43
68
  - changeset.changed_fields.each do |field|
44
69
  = render_changeset_field(changeset, field)
70
+
71
+ - if @release.show_changeset_summary?
72
+ %li.text.text--large.align-center
73
+ = link_to t('workarea.admin.cards.more', amount: @release.additional_changesets_count ), search_path(upcoming_changes: [@release.id])
@@ -9,7 +9,7 @@
9
9
  - @undo_release.errors.full_messages.each do |message|
10
10
  = render_message 'error', message
11
11
 
12
- = form_tag release_undo_path(@release), method: 'post' do
12
+ = form_tag release_undos_path(@release), method: 'post' do
13
13
  .section
14
14
  .property.property--required
15
15
  = label_tag 'release_name', t('workarea.admin.fields.name'), class: 'property__name'
@@ -26,12 +26,15 @@
26
26
  .grid__cell.grid__cell--50-at-medium
27
27
  .property
28
28
  = label_tag 'release_publish_at', t('workarea.admin.fields.undo_at'), class: 'property__name'
29
- .box.box--rounded= hidden_field_tag 'release[publish_at]', @undo_release.publish_at, data: { datetimepicker_field: { inline: true } }
29
+ .box.box--rounded= hidden_field_tag 'release[publish_at]', @undo_release.publish_at, data: { datetimepicker_field: { inline: true, uiOptions: { minDate: (@release.publish_at.present? ? @release.publish_at.to_s(:date_only) : 0) } } }
30
30
 
31
31
  .workflow-bar
32
32
  .grid.grid--middle
33
33
  .grid__cell.grid__cell--20
34
- = link_to t('workarea.admin.form.cancel'), undo_release_path(@release), class: 'workflow-bar__button workflow-bar__button--delete'
34
+ - if @undo_release.persisted?
35
+ = link_to t('workarea.admin.form.cancel'), release_path(@undo_release, return_to: release_path(@release)), class: 'workflow-bar__button workflow-bar__button--delete', data: { method: 'delete', confirm: t('workarea.admin.create_release_undos.workflow.delete_confirmation') }
36
+ - else
37
+ = link_to t('workarea.admin.form.cancel'), release_path(@release), class: 'workflow-bar__button workflow-bar__button--delete'
35
38
 
36
39
  .grid__cell.grid__cell--60
37
40
  %ol.workflow-bar__steps
@@ -34,15 +34,21 @@
34
34
  - changeset.changed_fields.each do |field|
35
35
  = render_changeset_field(changeset, field)
36
36
 
37
+ - if @release.show_changeset_summary?
38
+ %li.text.text--large.align-center
39
+ = t('workarea.admin.cards.more', amount: @release.additional_changesets_count )
40
+
41
+ %p= t('workarea.admin.create_release_undos.review.change_count_message')
42
+
37
43
  .workflow-bar
38
44
  .grid.grid--middle
39
45
  .grid__cell.grid__cell--20
40
- = link_to t('workarea.admin.form.cancel'), release_path(@undo_release), class: 'workflow-bar__button workflow-bar__button--delete', data: { method: 'delete', confirm: t('workarea.admin.create_release_undos.workflow.delete_confirmation') }
46
+ = link_to t('workarea.admin.form.cancel'), release_path(@undo_release, return_to: release_path(@release)), class: 'workflow-bar__button workflow-bar__button--delete', data: { method: 'delete', confirm: t('workarea.admin.create_release_undos.workflow.delete_confirmation') }
41
47
 
42
48
  .grid__cell.grid__cell--60
43
49
  %ol.workflow-bar__steps
44
50
  %li.workflow-bar__step
45
- 1) #{link_to t('workarea.admin.create_release_undos.workflow.setup'), new_release_undo_path(@release)}
51
+ 1) #{link_to t('workarea.admin.create_release_undos.workflow.setup'), new_release_undo_path(@release, id: @undo_release.id)}
46
52
  %li.workflow-bar__step
47
53
  %strong 2) #{t('workarea.admin.create_release_undos.workflow.review')}
48
54
 
@@ -5,6 +5,11 @@
5
5
  .view__heading
6
6
  = link_to "↑ #{t('workarea.admin.navigation_redirects.index.dashboard_link')}", settings_dashboards_path, class: 'view__dashboard-button'
7
7
  %h1= t('workarea.admin.navigation_redirects.index.title')
8
+ - unless navigation_redirects_enabled?
9
+ .grid.grid--center
10
+ .grid__cell.grid__cell--50
11
+ = render_message 'warning' do
12
+ = t('workarea.admin.navigation_redirects.index.disabled')
8
13
 
9
14
  .view__container
10
15
 
@@ -62,80 +62,21 @@
62
62
 
63
63
  - if local_assigns[:active].blank?
64
64
  .card__body
65
- - if model.changesets_with_releasable.empty?
65
+ - if model.changeset_count.zero?
66
66
  %p.card__empty-note= t('workarea.admin.releases.cards.planned_changes.empty_note')
67
67
  = link_to release_changesets_path(model), class: 'card__button' do
68
68
  %span.button.button--small= t('workarea.admin.releases.cards.planned_changes.button')
69
69
  - else
70
- - model.changesets_with_releasable.take(3).each do |changeset|
71
-
72
- .activity
73
- .activity__header
74
- .activity__avatar
75
- = changeset_icon changeset, { class: 'svg-icon'}
76
- .activity__name= changeset.name
77
- .activity__time
78
- = changeset.publish_humanized
79
- - if changeset.release_date.present?
80
- = local_time(changeset.release_date, :long)
81
- .activity__message
82
- .release-changeset.release-changeset--activity
83
- .release-changeset__body
84
- - changeset.changed_fields.each do |field|
85
- = render_changeset_field(changeset, field)
70
+ %table
71
+ %tbody
72
+ - model.changeset_summary.each do |summary|
73
+ %tr
74
+ %td.align-right
75
+ %strong= summary.count
76
+ %td= summary.label
86
77
 
87
78
  = link_to release_changesets_path(model), class: 'card__button' do
88
79
  %span.button.button--small= t('workarea.admin.releases.cards.planned_changes.button')
89
80
 
90
- .grid__cell
91
- - if model.undoes?
92
- .card{ class: card_classes(:original, local_assigns[:active]) }
93
- = link_to original_release_path(model), class: 'card__header' do
94
- %span.card__header-text= t('workarea.admin.releases.cards.original.title')
95
- = inline_svg 'workarea/admin/icons/planned_changes.svg', class: 'card__icon'
96
-
97
- - if local_assigns[:active].blank?
98
- .card__body
99
- .card__empty-note
100
- %p= t('workarea.admin.releases.cards.original.undoes_html', link: link_to(model.undoes.name, release_path(model.undoes)))
101
-
102
- - if model.undoes.publish_at.present? && model.undoes.publish_at.future?
103
- %p= t('workarea.admin.releases.cards.undo.set_to_publish_html', link: link_to(model.undoes.name, release_path(model.undoes)), at: local_time_ago(model.undoes.publish_at))
104
- - elsif model.undoes.published_at.present?
105
- %p= t('workarea.admin.releases.cards.undo.published_html', link: link_to(model.undoes.name, release_path(model.undoes)), at: local_time_ago(model.undoes.published_at))
106
- - else
107
- %p= t('workarea.admin.releases.cards.undo.unscheduled_html', link: link_to(model.undoes.name, release_path(model.undoes)))
108
-
109
- = link_to original_release_path(model), class: 'card__button' do
110
- %span.button.button--small= t('workarea.admin.releases.cards.original.learn_more')
111
-
112
- - else
113
- .card{ class: card_classes(:undo, local_assigns[:active]) }
114
- = link_to undo_release_path(model), class: 'card__header' do
115
- %span.card__header-text= t('workarea.admin.releases.cards.undo.title')
116
- = inline_svg 'workarea/admin/icons/planned_changes.svg', class: 'card__icon'
117
-
118
- - if local_assigns[:active].blank?
119
- .card__body
120
- .card__empty-note
121
- - if model.undo.blank?
122
- %p= t('workarea.admin.releases.cards.undo.not_setup')
123
-
124
- = link_to undo_release_path(model), class: 'card__button' do
125
- %span.button.button--small= t('workarea.admin.releases.cards.undo.build_an_undo')
126
-
127
- - else
128
- %p= t('workarea.admin.releases.cards.undo.undo_html', link: link_to(model.undo.name, release_path(model.undo)), at: local_time_ago(model.undo.created_at))
129
-
130
- - if model.undo.publish_at.present? && model.undo.publish_at.future?
131
- %p= t('workarea.admin.releases.cards.undo.set_to_publish_html', link: link_to(model.undo.name, release_path(model.undo)), at: local_time_ago(model.undo.publish_at))
132
- - elsif model.undo.published_at.present?
133
- %p= t('workarea.admin.releases.cards.undo.published_html', link: link_to(model.undo.name, release_path(model.undo)), at: local_time_ago(model.undo.published_at))
134
- - else
135
- %p= t('workarea.admin.releases.cards.undo.unscheduled_html', link: link_to(model.undo.name, release_path(model.undo)))
136
-
137
- = link_to undo_release_path(model), class: 'card__button' do
138
- %span.button.button--small= t('workarea.admin.releases.cards.undo.learn_more')
139
-
140
81
  .grid__cell
141
82
  = render 'workarea/admin/comments/card', commentable: model, active: local_assigns[:active]
@@ -20,6 +20,11 @@
20
20
  .grid__cell.grid__cell--80
21
21
  .grid.grid--auto.grid--right
22
22
  - if !@release.has_changes?
23
+ .grid__cell
24
+ = link_to t('workarea.admin.releases.show.build_undo'), '#no-changes-to-undo-info', disabled: 'disabled', data: { tooltip: '' }, class: 'workflow-bar__button'
25
+ #no-changes-to-undo-info.tooltip-content
26
+ %p= t('workarea.admin.releases.show.no_changes_to_undo')
27
+
23
28
  .grid__cell
24
29
  = 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
30
  #no-changes-to-preview-info.tooltip-content
@@ -31,6 +36,9 @@
31
36
  %p= t('workarea.admin.releases.show.no_changes_to_publish')
32
37
 
33
38
  - else
39
+ .grid__cell
40
+ = link_to t('workarea.admin.releases.show.build_undo'), new_release_undo_path(@release), class: 'workflow-bar__button'
41
+
34
42
  .grid__cell
35
43
  - if @release.published? && !@release.scheduled?
36
44
  = 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'
@@ -106,6 +106,18 @@
106
106
  = @user.insights.average_order_value_percentile.ordinalize
107
107
  = t('workarea.admin.users.insights.percentile')
108
108
 
109
+ .align-center
110
+ = link_to '#customer-insights-info', data: { tooltip: { side: 'bottom', interactive: true } } do
111
+ = t('workarea.admin.users.insights.customer_insights')
112
+ #customer-insights-info.tooltip-content.align-center
113
+ = t( |
114
+ 'workarea.admin.users.insights.customer_insights_info_html', |
115
+ best_customers_path: insights_report_path(type: Workarea::Insights::BestCustomers), |
116
+ customers_at_risk_path: insights_report_path(type: Workarea::Insights::CustomersAtRisk), |
117
+ repeat_purchase_rate_path: insights_report_path(type: Workarea::Insights::RepeatPurchaseRate), |
118
+ orders_path: orders_user_path(@user) |
119
+ ) |
120
+
109
121
  .section
110
122
  %h2.align-center= t('workarea.admin.users.insights.recently_viewed.title')
111
123
  .grid.grid--center
@@ -303,6 +303,7 @@ en:
303
303
  views: views
304
304
  edit:
305
305
  client_id_note: Identifies the category for product import
306
+ default_sort_note: 'Since this category has featured products, this sort controls the products listed after the selected featured products.'
306
307
  filters_note_html: 'Comma separated: just, like, this. If these fields are blank, the global values will be used from %{search_settings_link}.'
307
308
  page_title: Attributes for %{category}
308
309
  search_settings: search settings
@@ -580,8 +581,12 @@ en:
580
581
  no_changesets: There aren't any planned changes for this release.
581
582
  plan_some_changes: Go plan some changes!
582
583
  planned_changes_for: Planned Changes For
584
+ pluralize_change:
585
+ one: '%{count} Change'
586
+ other: '%{count} Changes'
583
587
  published_on: Published On
584
588
  publishes_on: Publishes On
589
+ recent: Recent Changes
585
590
  releases: Releases
586
591
  unscheduled: Unscheduled
587
592
  catalog_product_copies:
@@ -1215,6 +1220,7 @@ en:
1215
1220
  review:
1216
1221
  title: Review Undo Changes for %{name}
1217
1222
  changes_description_html: These changes have been saved on the %{undo} release. They are the opposite of the changes in the %{original} release. You can view, edit, or delete these changes like changes in a normal release.
1223
+ change_count_message: The full list of changes is generating and too large to display. To make further changes, finish creating the release then view the changes card.
1218
1224
  workflow:
1219
1225
  setup: Setup
1220
1226
  review: Review
@@ -2489,6 +2495,10 @@ en:
2489
2495
  destination_label: Redirect To
2490
2496
  destination_note: Can be any URL
2491
2497
  destination_placeholder: "/new/path.html"
2498
+ disabled: >
2499
+ This application is configured to consider requests to be local, so the Workarea exception handling isn't used.
2500
+ This is most likely because it's running the development environment, where you want exceptions to be seen in responses.
2501
+ These redirects won't work without this.
2492
2502
  from: From
2493
2503
  import: Import Redirects
2494
2504
  modified: Modified
@@ -3100,19 +3110,6 @@ en:
3100
3110
  changes: Changes
3101
3111
  empty_note: You can view and manage changes for this release once they are planned.
3102
3112
  planned: Planned
3103
- undo:
3104
- title: Undo
3105
- not_setup: This release doesn't have an undo setup.
3106
- build_an_undo: Build an Undo
3107
- set_to_publish_html: "%{link} is set to publish at <strong>%{at}</strong>."
3108
- published_html: "%{link} published at <strong>%{at}</strong>."
3109
- unscheduled_html: "%{link} is unscheduled."
3110
- undo_html: The %{link} release was created <strong>%{at}</strong> to undo this release.
3111
- learn_more: Learn More
3112
- original:
3113
- title: Original Release
3114
- undoes_html: This release undoes the %{link} release.
3115
- learn_more: Learn More
3116
3113
  edit:
3117
3114
  index_link: Release calendar
3118
3115
  last_published_at: Last Published at
@@ -3178,6 +3175,7 @@ en:
3178
3175
  view: View
3179
3176
  view_release: View Release
3180
3177
  show:
3178
+ build_undo: Build Undo
3181
3179
  index_link: Release calendar
3182
3180
  plan_changes_to_preview: Plan some changes to preview this release
3183
3181
  publish_now: Publish Now
@@ -3190,8 +3188,6 @@ en:
3190
3188
  no_changes_to_publish: There are no changes to publish for this release. Click on the Plan Changes card to start!
3191
3189
  no_changes_to_undo: There are no changes to undo for this release. Click on the Plan Changes card to start!
3192
3190
  user_cannot_publish_info: You do not have permission to publish a release.
3193
- cannot_undo_info: You cannot undo a release that's not published or already undone.
3194
- user_cannot_undo_info: You do not have permission to undo a release.
3195
3191
  summary:
3196
3192
  change:
3197
3193
  one: "%{count} Change"
@@ -3216,24 +3212,6 @@ en:
3216
3212
  starts_on: Starts on %{date}
3217
3213
  ends_on: Ends on %{date}
3218
3214
  no_undo_date: There is no undo date set for this release.
3219
- undo:
3220
- page_title: Undo %{name}
3221
- index_link: Release calendar
3222
- plan_changes: Plan Changes
3223
- no_changes_html: There are no changes to undo for this release! Head to %{plan_changes} to make some.
3224
- undoing: Undoing a Release
3225
- description: You can setup an undo to automatically revert the changes in this release at a future point in time. After being setup, this "undo release" will behave like any other release. You'll be able to edit, reschdule, or modify the changes as you please.
3226
- build_an_undo_now: Build an Undo Now
3227
- created_description_html: "%{undo} was created %{at} to undo the %{original} release."
3228
- no_changes_for_this_release: No changes for this release now.
3229
- view_the_undo_release: View the Undo Release
3230
- original:
3231
- page_title: Original Release for %{name}
3232
- index_link: Release calendar
3233
- title: Original Release
3234
- created_description_html: "%{undo} was created %{at} to undo the %{original} release."
3235
- no_changes_for_this_release: No changes for this release now.
3236
- view_the_original_release: View the Original Release
3237
3215
  reports:
3238
3216
  all_reports: View All Reports
3239
3217
  average_order_value:
@@ -3506,10 +3484,10 @@ en:
3506
3484
  description: Define what filters should be shown on search results and categories.
3507
3485
  title: Filters
3508
3486
  synonyms:
3509
- description: Define groups of search terms that should return the same result.
3487
+ description: Define groups of search terms that mean the same thing. Keep in mind this is not the same as "return the same results". For that task, use search customizations.
3510
3488
  phrase_example: united states,u s a,united states of america => usa
3511
3489
  phrase_example_description: 'You can create synonym functionality out of a phrase like so:'
3512
- simple_example: "tshirt, t-shirt, tee-shirt \nskirt, skort"
3490
+ simple_example: "denim, jeans, dungarees \nshirt, pullover, blouse"
3513
3491
  simple_example_description: 'Enter one synonym group per line, for example:'
3514
3492
  title: Synonyms
3515
3493
  title: Search Settings
@@ -4067,6 +4045,17 @@ en:
4067
4045
  aov: AOV
4068
4046
  insights_for_this_customer: Insights for this Customer
4069
4047
  percentile: percentile
4048
+ customer_insights: Wondering about how Workarea customer insights work?
4049
+ customer_insights_info_html: >
4050
+ <strong>How are customer metrics tracked?</strong>
4051
+ <p>Workarea's metrics engine saves reporting and insights data based on the customer's email address.
4052
+ This allows for the best tracking of customers for generating helpful insights like
4053
+ <a href="%{best_customers_path}">Best Customers</a>, <a href="%{customers_at_risk_path}">Customers at Risk</a>,
4054
+ and <a href="%{repeat_purchase_rate_path}">Repeat Purchase Rate</a> as accurately as possible across both
4055
+ guest and account checkouts.</p>
4056
+ <strong>Wondering why some numbers don't line up?</strong>
4057
+ <p>Because reporting is tracked by email address, changes in email address and/or having an account
4058
+ can cause mismatch between the <a href="%{orders_path}">Orders</a> card and these insights.</p>
4070
4059
  login:
4071
4060
  never: Never logged in
4072
4061
  time_ago: "%{period} ago"
@@ -108,15 +108,13 @@ Workarea::Admin::Engine.routes.draw do
108
108
  resources :releases do
109
109
  resources :changesets, only: [:index, :destroy]
110
110
  resources :releasables, only: [:index, :show]
111
- resource :undo, controller: 'create_release_undos', only: [:new, :create] do
112
- get :review
113
- post :complete
111
+
112
+ resources :undos, controller: 'create_release_undos', only: [:new, :create] do
113
+ member { get :review }
114
114
  end
115
115
 
116
116
  member do
117
117
  get 'edit_for/:type', action: :edit_for, as: :edit_for
118
- get :undo
119
- get :original
120
118
  patch :publish
121
119
  end
122
120
 
@@ -0,0 +1,24 @@
1
+ require 'test_helper'
2
+
3
+ module Workarea
4
+ module Admin
5
+ class ChangesetsHelperTest < ViewTest
6
+ def test_releasable_icon_path
7
+ assert_equal(
8
+ releasable_icon_path(nil),
9
+ 'workarea/admin/icons/release.svg'
10
+ )
11
+
12
+ assert_equal(
13
+ releasable_icon_path('product'),
14
+ 'workarea/admin/icons/products.svg'
15
+ )
16
+
17
+ assert_equal(
18
+ releasable_icon_path('variants'),
19
+ 'workarea/admin/icons/variants.svg'
20
+ )
21
+ end
22
+ end
23
+ end
24
+ end
@@ -10,19 +10,44 @@ module Workarea
10
10
  release = create_release
11
11
 
12
12
  release.as_current { releasable.update_attributes!(name: 'Bar') }
13
+ release.changesets.create!(releasable: Catalog::Product.new) # test missing releasable
13
14
 
14
- post admin.release_undo_path(release),
15
+ post admin.release_undos_path(release),
15
16
  params: { release: { name: 'Undo Bar', tag_list: 'foo,bar,baz' } }
16
17
 
17
18
  assert_equal(2, Release.count)
18
19
  undo_release = Release.desc(:created_at).first
19
20
 
20
- assert_equal(undo_release, release.reload.undo)
21
+ assert_equal(undo_release, release.reload.undos.first)
21
22
  assert_equal('Undo Bar', undo_release.name)
22
23
  assert_equal(%w(foo bar baz), undo_release.tags)
23
24
  assert_equal(1, undo_release.changesets.size)
24
25
  assert_equal(1, undo_release.changesets.first.changeset.size)
25
26
  assert_equal(releasable, undo_release.changesets.first.releasable)
27
+ assert_equal([releasable], Search::AdminSearch.new(upcoming_changes: [undo_release.id]).results)
28
+ end
29
+
30
+ def test_create_for_large_changesets
31
+ Sidekiq::Testing.fake!
32
+
33
+ Workarea.config.per_page = 1
34
+
35
+ releasable_one = create_page(name: 'Foo')
36
+ releasable_two = create_page(name: 'Bar')
37
+ release = create_release
38
+
39
+ release.as_current do
40
+ releasable_one.update!(name: 'Changed Foo')
41
+ releasable_two.update!(name: 'Changed Bar')
42
+ end
43
+
44
+ post admin.release_undos_path(release),
45
+ params: { release: { name: 'Undo Test' } }
46
+
47
+ assert_equal(2, Release.count)
48
+ undo_release = Release.desc(:created_at).first
49
+ assert_equal(1, undo_release.changesets.size)
50
+ assert_equal(1, BuildReleaseUndoChangesets.jobs.size)
26
51
  end
27
52
  end
28
53
  end
@@ -50,17 +50,33 @@ module Workarea
50
50
 
51
51
  post admin.impersonations_path, params: { user_id: @user.id }
52
52
  delete admin.impersonations_path
53
+ assert_equal(previous_user_id, session[:user_id])
54
+ assert(session[:admin_id].blank?)
53
55
 
54
- assert_redirected_to(admin.user_path(@user.id))
56
+ post admin.impersonations_path, params: { user_id: @user.id }
57
+ delete admin.impersonations_path
55
58
  assert_equal(previous_user_id, session[:user_id])
56
59
  assert(session[:admin_id].blank?)
60
+ end
61
+
62
+ def test_redirection_after_destroy
63
+ post admin.impersonations_path, params: { user_id: @user.id }
64
+ delete admin.impersonations_path
65
+ assert_redirected_to(admin.user_path(@user.id))
57
66
 
58
67
  post admin.impersonations_path, params: { user_id: @user.id }
59
68
  delete admin.impersonations_path(return_to: '/foo')
69
+ assert_redirected_to('/foo')
60
70
 
71
+ post admin.impersonations_path, params: { user_id: @user.id }
72
+ delete admin.impersonations_path(return_to: '/foo'),
73
+ headers: { 'HTTP_REFERER' => admin.catalog_products_path }
61
74
  assert_redirected_to('/foo')
62
- assert_equal(previous_user_id, session[:user_id])
63
- assert(session[:admin_id].blank?)
75
+
76
+ post admin.impersonations_path, params: { user_id: @user.id }
77
+ delete admin.impersonations_path,
78
+ headers: { 'HTTP_REFERER' => admin.catalog_products_url(host: 'foo.com') }
79
+ assert_redirected_to(admin.catalog_products_path)
64
80
  end
65
81
  end
66
82
  end
@@ -0,0 +1,10 @@
1
+ .new-navigation-link__section{ data: { new_navigation_taxon: 'bar' } }
2
+ %fieldset
3
+ %legend
4
+ %span.heading.heading--2 Existing
5
+ .property
6
+ = label_tag 'navigable_type', 'Type', class: 'property__name'
7
+ = select_tag 'navigable_type', options_for_select([['Foo', 'foo', { data: { new_navigation_taxon_endpoint: 'http://foo.com' } }], ['Bar', 'bar', { data: { new_navigation_taxon_endpoint: 'http://bar.com' } }]])
8
+ .property
9
+ = label_tag 'navigable_id', 'Name', class: 'property__name'
10
+ = select_tag 'navigable_id', options_for_select([['Bar', 'bar']], 'bar'), include_blank: true
@@ -6,7 +6,6 @@
6
6
  it('initializes select2 on navigable id select', function () {
7
7
  var markup = 'new_navigation_taxon.html',
8
8
  $fixture = $(fixture.load(markup, true)),
9
-
10
9
  $select = $('[name=navigable_id]', $fixture);
11
10
 
12
11
  expect($select.is('.select2-hidden-accessible')).to.not.be.ok;
@@ -14,6 +13,18 @@
14
13
  WORKAREA.newNavigationTaxons.init($fixture);
15
14
 
16
15
  expect($select.is('.select2-hidden-accessible')).to.be.ok;
16
+ expect($select.val()).to.equal('');
17
+ });
18
+
19
+ it('saves with the existing data', function () {
20
+ var markup = 'existing_navigation_taxon.html',
21
+ $fixture = $(fixture.load(markup, true)),
22
+ $select = $('[name=navigable_id]', $fixture);
23
+
24
+ WORKAREA.newNavigationTaxons.init($fixture);
25
+
26
+ expect($select.is('.select2-hidden-accessible')).to.be.ok;
27
+ expect($select.val()).to.equal('bar');
17
28
  });
18
29
  });
19
30
  });
@@ -49,7 +49,7 @@ module Workarea
49
49
  click_button 'Stop Impersonation'
50
50
  end
51
51
 
52
- assert_equal(admin.user_path(user), current_path)
52
+ assert_equal(admin.root_path, current_path)
53
53
  assert(page.has_content?('Success'))
54
54
  end
55
55
  end
@@ -124,6 +124,11 @@ module Workarea
124
124
  end
125
125
 
126
126
  visit admin.release_path(Release.first)
127
+ assert(page.has_content?('2 Products'))
128
+ assert(page.has_content?('1 Pricing Sku'))
129
+ assert(page.has_content?('1 Discount'))
130
+ assert(page.has_content?('1 System Page'))
131
+
127
132
  click_link t('workarea.admin.releases.cards.planned_changes.planned')
128
133
  assert(page.has_content?('Test Page'))
129
134
  assert(page.has_content?('Foo Bar'))
@@ -228,10 +233,7 @@ module Workarea
228
233
 
229
234
  visit admin.list_releases_path
230
235
  click_link 'Foo Release'
231
- click_link t('workarea.admin.releases.cards.undo.title')
232
-
233
- assert(page.has_content?(t('workarea.admin.releases.undo.undoing')))
234
- click_link "#{t('workarea.admin.releases.undo.build_an_undo_now')} →"
236
+ click_link t('workarea.admin.releases.show.build_undo')
235
237
 
236
238
  fill_in 'release[name]', with: 'Foo Bar Undo'
237
239
  click_button t('workarea.admin.create_release_undos.workflow.create_undo')
@@ -240,19 +242,9 @@ module Workarea
240
242
 
241
243
  click_link "#{t('workarea.admin.create_release_undos.workflow.done')} →"
242
244
  assert(page.has_content?('Foo Bar Undo'))
245
+ assert(page.has_content?('1 Content Page'))
243
246
 
244
- click_link t('workarea.admin.releases.cards.original.title')
245
- assert(page.has_content?('Foo Release'))
246
- assert(page.has_content?('Test Page'))
247
- assert(page.has_content?('Foo Bar'))
248
-
249
- within('.text.text--large', match: :first) { click_link 'Foo Release' }
250
- assert(page.has_content?('Foo Release'))
251
- assert(page.has_content?('Test Page'))
252
- assert(page.has_content?('Foo Bar'))
253
-
254
- click_link t('workarea.admin.releases.cards.undo.title')
255
- assert(page.has_content?('Foo Bar Undo'))
247
+ click_link t('workarea.admin.releases.cards.planned_changes.planned')
256
248
  assert(page.has_content?('Test Page'))
257
249
  assert(page.has_content?('Foo Bar'))
258
250
  end
@@ -341,6 +333,43 @@ module Workarea
341
333
  assert(page.has_content?('Release Six'))
342
334
  end
343
335
  end
336
+
337
+ def test_viewing_large_changesets
338
+ Workarea.config.per_page = 2
339
+
340
+ release = create_release
341
+ product_one = create_product(id: 'PROD1', name: 'Product One')
342
+ product_two = create_product(id: 'PROD2', name: 'Product Two')
343
+ content_page = create_page(name: 'Test Page')
344
+
345
+ release.as_current do
346
+ product_one.variants.first.update!(details: { 'Color' => 'Orange' })
347
+ product_two.update!(name: 'Test Product Changed')
348
+ content_page.update!(name: 'Test Page Changed')
349
+ end
350
+
351
+ visit admin.release_path(release)
352
+
353
+ assert(page.has_content?('2 Products'))
354
+ assert(page.has_content?('1 Content Page'))
355
+
356
+ click_link t('workarea.admin.releases.cards.planned_changes.planned')
357
+
358
+ assert(page.has_content?('2 Products'))
359
+ assert(page.has_content?('1 Content Page'))
360
+
361
+ assert(page.has_content?('Test Product Changed'))
362
+ assert(page.has_content?('Test Page Changed'))
363
+ assert(page.has_no_content?('Orange'))
364
+
365
+ assert(page.has_content?(t('workarea.admin.changesets.recent')))
366
+ assert(page.has_content?(t('workarea.admin.cards.more', amount: 1)))
367
+
368
+ click_link '2 Products'
369
+
370
+ assert(page.has_content?('Product One'))
371
+ assert(page.has_content?('Product Two'))
372
+ end
344
373
  end
345
374
  end
346
375
  end
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.20
4
+ version: 3.5.26
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-09-30 00:00:00.000000000 Z
11
+ date: 2021-01-20 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.20
19
+ version: 3.5.26
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.20
26
+ version: 3.5.26
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.20
33
+ version: 3.5.26
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.20
40
+ version: 3.5.26
41
41
  description: Provides site administration functionality for the Workarea Commerce
42
42
  Platform.
43
43
  email:
@@ -551,6 +551,7 @@ files:
551
551
  - app/view_models/workarea/admin/bulk_action_sequential_product_edit_view_model.rb
552
552
  - app/view_models/workarea/admin/category_view_model.rb
553
553
  - app/view_models/workarea/admin/changes_view_model.rb
554
+ - app/view_models/workarea/admin/changeset_summary_view_model.rb
554
555
  - app/view_models/workarea/admin/changeset_view_model.rb
555
556
  - app/view_models/workarea/admin/code_list_view_model.rb
556
557
  - app/view_models/workarea/admin/comment_view_model.rb
@@ -1065,9 +1066,7 @@ files:
1065
1066
  - app/views/workarea/admin/releases/index.html.haml
1066
1067
  - app/views/workarea/admin/releases/list.html.haml
1067
1068
  - app/views/workarea/admin/releases/new.html.haml
1068
- - app/views/workarea/admin/releases/original.html.haml
1069
1069
  - app/views/workarea/admin/releases/show.html.haml
1070
- - app/views/workarea/admin/releases/undo.html.haml
1071
1070
  - app/views/workarea/admin/reports/_export.html.haml
1072
1071
  - app/views/workarea/admin/reports/_group_by_time.html.haml
1073
1072
  - app/views/workarea/admin/reports/average_order_value.html.haml
@@ -1289,6 +1288,7 @@ files:
1289
1288
  - test/dummy/tmp/screenshots/.keep
1290
1289
  - test/helpers/workarea/admin/application_helper_test.rb
1291
1290
  - test/helpers/workarea/admin/buttons_helper_test.rb
1291
+ - test/helpers/workarea/admin/changesets_helper_test.rb
1292
1292
  - test/helpers/workarea/admin/content_helper_test.rb
1293
1293
  - test/helpers/workarea/admin/facets_helper_test.rb
1294
1294
  - test/helpers/workarea/admin/icons_helper_test.rb
@@ -1390,6 +1390,7 @@ files:
1390
1390
  - test/javascripts/fixtures/datepicker_fields.html.haml
1391
1391
  - test/javascripts/fixtures/datetimepicker_fields.html.haml
1392
1392
  - test/javascripts/fixtures/direct_upload.html.haml
1393
+ - test/javascripts/fixtures/existing_navigation_taxon.html.haml
1393
1394
  - test/javascripts/fixtures/help_lookup_button.haml
1394
1395
  - test/javascripts/fixtures/menu_editor_menu_list_sortable.html.haml
1395
1396
  - test/javascripts/fixtures/new_navigation_taxon.html.haml
@@ -1527,7 +1528,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1527
1528
  - !ruby/object:Gem::Version
1528
1529
  version: '0'
1529
1530
  requirements: []
1530
- rubygems_version: 3.0.3
1531
+ rubygems_version: 3.2.3
1531
1532
  signing_key:
1532
1533
  specification_version: 4
1533
1534
  summary: Admin for the Workarea Commerce Platform
@@ -1,50 +0,0 @@
1
- - @page_title = t('workarea.admin.releases.original.page_title', name: @release.name)
2
-
3
- .view
4
- .view__header
5
- .grid.grid--middle.grid--right
6
- .grid__cell.grid__cell--50
7
- .view__heading
8
- = link_to "↑ #{t('workarea.admin.releases.original.index_link')}", releases_path
9
- %h1= link_to @release.name, url_for(@release)
10
- .grid__cell.grid__cell--25
11
- = render_aux_navigation_for(@release)
12
-
13
- .view__container
14
- = render_cards_for(@release, :original)
15
-
16
- .view__container.view__container--narrow
17
- .section
18
- .grid.grid--center
19
- .grid__cell.grid__cell--25
20
- %p.text.text--large= t('workarea.admin.releases.original.created_description_html', undo: link_to(@release.name, @release), original: link_to(@release.undoes.name, @release.undoes), at: local_time_ago(@release.created_at))
21
- .grid__cell.grid__cell--25.align-center
22
- .card{ class: card_classes(:planned_changes) }
23
- = link_to @release.undoes, class: 'card__header' do
24
- %span.card__header-text= @release.undoes.name
25
- = inline_svg 'workarea/admin/icons/planned_changes.svg', class: 'card__icon'
26
-
27
- .card__body
28
- - if @release.undoes.changesets_with_releasable.empty?
29
- %p.card__empty-note= t('workarea.admin.releases.original.no_changes_for_this_release')
30
- - else
31
- - @release.undoes.changesets_with_releasable.take(3).each do |changeset|
32
- .activity
33
- .activity__header
34
- .activity__avatar
35
- = changeset_icon changeset, { class: 'svg-icon'}
36
- .activity__name= changeset.release.name
37
- .activity__time
38
- = changeset.publish_humanized
39
- - if changeset.release_date.present?
40
- = local_time(changeset.release_date, :long)
41
- .activity__message
42
- .release-changeset.release-changeset--activity
43
- .release-changeset__body
44
- - changeset.changed_fields.each do |field|
45
- = render_changeset_field(changeset, field)
46
-
47
- = link_to @release.undoes, class: 'card__button' do
48
- %span.button.button--small= t('workarea.admin.releases.original.view_the_original_release')
49
-
50
-
@@ -1,64 +0,0 @@
1
- - @page_title = t('workarea.admin.releases.undo.page_title', name: @release.name)
2
-
3
- .view
4
- .view__header
5
- .grid.grid--middle.grid--right
6
- .grid__cell.grid__cell--50
7
- .view__heading
8
- = link_to "↑ #{t('workarea.admin.releases.undo.index_link')}", releases_path
9
- %h1= link_to @release.name, url_for(@release)
10
- .grid__cell.grid__cell--25
11
- = render_aux_navigation_for(@release)
12
-
13
- .view__container
14
- = render_cards_for(@release, :undo)
15
-
16
- .view__container.view__container--narrow
17
- .section
18
- - if @release.changesets_with_releasable.empty?
19
- .grid.grid--center
20
- .grid__cell.grid__cell--50
21
- %h2.align-center= t('workarea.admin.releases.undo.undoing')
22
- %p.align-center= t('workarea.admin.releases.undo.no_changes_html', plan_changes: link_to(t('workarea.releases.undo.plan_changes'), release_releasables_path(@release)))
23
-
24
- - elsif @release.undo.blank?
25
- .grid.grid--center
26
- .grid__cell.grid__cell--50
27
- %h2.align-center= t('workarea.admin.releases.undo.undoing')
28
- %p.align-center= t('workarea.admin.releases.undo.description')
29
- %p.align-center= link_to "#{t('workarea.admin.releases.undo.build_an_undo_now')} →", new_release_undo_path(@release), class: 'button'
30
- - else
31
- .grid.grid--center
32
- .grid__cell.grid__cell--25
33
- %p.text.text--large= t('workarea.admin.releases.undo.created_description_html', undo: link_to(@release.undo.name, @release.undo), original: link_to(@release.name, @release), at: local_time_ago(@release.created_at))
34
- .grid__cell.grid__cell--25.align-center
35
- .card{ class: card_classes(:planned_changes) }
36
- = link_to @release.undo, class: 'card__header' do
37
- %span.card__header-text= @release.undo.name
38
- = inline_svg 'workarea/admin/icons/planned_changes.svg', class: 'card__icon'
39
-
40
- .card__body
41
- - if @release.undo.changesets_with_releasable.empty?
42
- %p.card__empty-note= t('workarea.admin.releases.undo.no_changes_for_this_release')
43
- - else
44
- - @release.undo.changesets_with_releasable.take(3).each do |changeset|
45
- .activity
46
- .activity__header
47
- .activity__avatar
48
- = changeset_icon changeset, { class: 'svg-icon'}
49
- .activity__name= changeset.release.name
50
- .activity__time
51
- = changeset.publish_humanized
52
- - if changeset.release_date.present?
53
- = local_time(changeset.release_date, :long)
54
- .activity__message
55
- .release-changeset.release-changeset--activity
56
- .release-changeset__body
57
- - changeset.changed_fields.each do |field|
58
- = render_changeset_field(changeset, field)
59
-
60
- = link_to @release.undo, class: 'card__button' do
61
- %span.button.button--small= t('workarea.admin.releases.undo.view_the_undo_release')
62
-
63
-
64
-