diff --git a/app/models/tag_adjustment.rb b/app/models/tag_adjustment.rb index 8c26aa62d..aec115d09 100644 --- a/app/models/tag_adjustment.rb +++ b/app/models/tag_adjustment.rb @@ -1,7 +1,6 @@ class TagAdjustment < ApplicationRecord validates :tag_name, presence: true, uniqueness: { scope: :article_id, message: I18n.t("models.tag_adjustment.unique") } - validates :reason_for_adjustment, presence: true validates :adjustment_type, inclusion: { in: %w[removal addition] }, presence: true validates :status, inclusion: { in: %w[committed pending committed_and_resolvable resolved] }, presence: true has_many :notifications, as: :notifiable, inverse_of: :notifiable, dependent: :delete_all diff --git a/app/views/moderations/actions_panel.html.erb b/app/views/moderations/actions_panel.html.erb index 7d80a6431..b08a1b7e3 100644 --- a/app/views/moderations/actions_panel.html.erb +++ b/app/views/moderations/actions_panel.html.erb @@ -137,7 +137,7 @@ <% end %> <% end %>
diff --git a/app/views/notifications/_tagadjustment.html.erb b/app/views/notifications/_tagadjustment.html.erb index 9143904f9..7deb4e6d4 100644 --- a/app/views/notifications/_tagadjustment.html.erb +++ b/app/views/notifications/_tagadjustment.html.erb @@ -14,12 +14,14 @@ title: link_to(h(data["article"]["title"]), data["article"]["path"]), ) %> -- <%= t("views.notifications.tag.reason") %> - <%= data["reason_for_adjustment"] %> -
-+ <%= t("views.notifications.tag.reason") %> + <%= data["reason_for_adjustment"] %> +
+<%= t("views.notifications.tag.check_html", other: link_to(t("views.notifications.tag.other"), "/tags")) %>
<% end %> diff --git a/config/locales/views/moderations/en.yml b/config/locales/views/moderations/en.yml index b6218fa37..1538d8a77 100644 --- a/config/locales/views/moderations/en.yml +++ b/config/locales/views/moderations/en.yml @@ -19,7 +19,7 @@ en: icon: Adjust tags add: Add tag add_placeholder: Add a tag - reason: Reason for tag adjustment + reason: Reason for tag adjustment (optional) remove: Remove tag submit: Submit approve: diff --git a/config/locales/views/moderations/fr.yml b/config/locales/views/moderations/fr.yml index 7e0e552fc..f912359d4 100644 --- a/config/locales/views/moderations/fr.yml +++ b/config/locales/views/moderations/fr.yml @@ -19,7 +19,7 @@ fr: icon: Adjust tags add: Add tag add_placeholder: Add a tag - reason: Reason for tag adjustment + reason: Reason for tag adjustment (optional) remove: Remove tag submit: Submit approve: diff --git a/cypress/e2e/seededFlows/moderationFlows/adjustPostTags.spec.js b/cypress/e2e/seededFlows/moderationFlows/adjustPostTags.spec.js index 357c4130e..b99f8e222 100644 --- a/cypress/e2e/seededFlows/moderationFlows/adjustPostTags.spec.js +++ b/cypress/e2e/seededFlows/moderationFlows/adjustPostTags.spec.js @@ -18,7 +18,9 @@ describe('Adjust post tags', () => { cy.getIframeBody('.actions-panel-iframe').within(() => { cy.findByRole('button', { name: 'Open adjust tags section' }).click(); cy.findByPlaceholderText('Add a tag').type('tag2'); - cy.findByPlaceholderText('Reason for tag adjustment').type('testing'); + cy.findByPlaceholderText('Reason for tag adjustment (optional)').type( + 'testing', + ); cy.findByRole('button', { name: 'Submit' }).click(); }); @@ -36,7 +38,9 @@ describe('Adjust post tags', () => { cy.getIframeBody('.actions-panel-iframe').within(() => { cy.findByRole('button', { name: 'Open adjust tags section' }).click(); - cy.findByPlaceholderText('Reason for tag adjustment').type('testing'); + cy.findByPlaceholderText('Reason for tag adjustment (optional)').type( + 'testing', + ); cy.findByRole('button', { name: '#tag1 Remove tag' }).click(); cy.findByRole('button', { name: 'Submit' }).click(); @@ -84,7 +88,9 @@ describe('Adjust post tags', () => { cy.getIframeBody('.actions-panel-iframe').within(() => { cy.findByRole('button', { name: 'Open adjust tags section' }).click(); cy.findByPlaceholderText('Add a tag').type('tag2'); - cy.findByPlaceholderText('Reason for tag adjustment').type('testing'); + cy.findByPlaceholderText('Reason for tag adjustment (optional)').type( + 'testing', + ); cy.findByRole('button', { name: 'Submit' }).click(); }); @@ -102,7 +108,9 @@ describe('Adjust post tags', () => { cy.getIframeBody('.actions-panel-iframe').within(() => { cy.findByRole('button', { name: 'Open adjust tags section' }).click(); - cy.findByPlaceholderText('Reason for tag adjustment').type('testing'); + cy.findByPlaceholderText('Reason for tag adjustment (optional)').type( + 'testing', + ); cy.findByRole('button', { name: '#tag1 Remove tag' }).click(); cy.findByRole('button', { name: 'Submit' }).click(); @@ -144,7 +152,9 @@ describe('Adjust post tags', () => { .should('have.attr', 'aria-expanded', 'true'); cy.findByPlaceholderText('Add a tag').type('tag2'); - cy.findByPlaceholderText('Reason for tag adjustment').type('testing'); + cy.findByPlaceholderText('Reason for tag adjustment (optional)').type( + 'testing', + ); cy.findByRole('button', { name: 'Submit' }).click(); }); @@ -168,7 +178,9 @@ describe('Adjust post tags', () => { .pipe(click) .should('have.attr', 'aria-expanded', 'true'); - cy.findByPlaceholderText('Reason for tag adjustment').type('testing'); + cy.findByPlaceholderText('Reason for tag adjustment (optional)').type( + 'testing', + ); cy.findByRole('button', { name: '#tag1 Remove tag' }).click(); cy.findByRole('button', { name: 'Submit' }).click(); diff --git a/spec/requests/tag_adjustments_spec.rb b/spec/requests/tag_adjustments_spec.rb index 1151e5043..4993427ea 100644 --- a/spec/requests/tag_adjustments_spec.rb +++ b/spec/requests/tag_adjustments_spec.rb @@ -8,7 +8,6 @@ RSpec.describe "TagAdjustments", type: :request do { tag_name: tag.name, article_id: article.id, - reason_for_adjustment: "Test #{rand(100)}", adjustment_type: "removal" } end diff --git a/spec/services/tag_adjustment_creation_service_spec.rb b/spec/services/tag_adjustment_creation_service_spec.rb index 8aff352e5..38699f930 100644 --- a/spec/services/tag_adjustment_creation_service_spec.rb +++ b/spec/services/tag_adjustment_creation_service_spec.rb @@ -12,7 +12,6 @@ RSpec.describe TagAdjustmentCreationService, type: :service do status: "committed", tag_name: tag.name, article_id: article.id, - reason_for_adjustment: "Test", ) end diff --git a/spec/services/tag_adjustment_update_service_spec.rb b/spec/services/tag_adjustment_update_service_spec.rb index 21a4d3bfc..7b41ce8dc 100644 --- a/spec/services/tag_adjustment_update_service_spec.rb +++ b/spec/services/tag_adjustment_update_service_spec.rb @@ -12,7 +12,6 @@ RSpec.describe TagAdjustmentUpdateService, type: :service do status: "committed", tag_name: tag.name, article_id: article.id, - reason_for_adjustment: "reasons", ) end