OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
[#43675] fig regarding comments
Dmitrii4534007a3be4
diff --git a/config/locales/js-en.yml b/config/locales/js-en.ymlindex 024912adc44..19b8b9333ea 100644--- a/config/locales/js-en.yml+++ b/config/locales/js-en.yml@@ -629,9 +629,6 @@ en:mentioned:title: 'I am @mentioned'description: 'Receive a notification every time someone mentions me anywhere'- involved:- title: 'Assigned to me or accountable'- description: 'Receive notifications for all activities on work packages for which I am assignee or accountable'assignee: 'Assignee'responsible: 'Accountable'watched: 'Updates on watched items'diff --git a/db/migrate/20220922200908_add_assignee.rb b/db/migrate/20220922200908_split_involved_notification_setting.rbsimilarity index 75%rename from db/migrate/20220922200908_add_assignee.rbrename to db/migrate/20220922200908_split_involved_notification_setting.rbindex 8e15229d088..dc4dce2953d 100644--- a/db/migrate/20220922200908_add_assignee.rb+++ b/db/migrate/20220922200908_split_involved_notification_setting.rb@@ -1,4 +1,4 @@-class AddAssignee < ActiveRecord::Migration[7.0]+class SplitInvolvedNotificationSetting < ActiveRecord::Migration[7.0]def changechange_table :notification_settings, bulk: true do |t|t.column :assignee, :boolean, default: false, null: false@@ -8,13 +8,13 @@ class AddAssignee < ActiveRecord::Migration[7.0]reversible do |change|change.up doNotificationSetting.where(involved: true).update_all(assignee: true, responsible: true)- remove_column :notification_settings, :involved, :booleanendchange.down do- add_column :notification_settings, :involved, :booleanNotificationSetting.where(assignee: true).or(NotificationSetting.where(responsible: true)).update_all(involved: true)endend++ remove_column :notification_settings, :involved, :booleanendenddiff --git a/frontend/src/app/features/user-preferences/notifications-settings/page/notifications-settings-page.component.html b/frontend/src/app/features/user-preferences/notifications-settings/page/notifications-settings-page.component.htmlindex e35be13487a..fb9b04cde88 100644--- a/frontend/src/app/features/user-preferences/notifications-settings/page/notifications-settings-page.component.html+++ b/frontend/src/app/features/user-preferences/notifications-settings/page/notifications-settings-page.component.html@@ -17,9 +17,9 @@slot="input"/><p slot="description">{{ text.mentioned.description }}</p>- </op-checkbox-field>+ </spot-selector-field>- <op-checkbox-field+ <spot-selector-field[label]="text.assignee"[control]="form.get('assignee')">@@ -29,9 +29,9 @@formControlName="assignee"data-qa-global-notification-type="assignee"/>- </op-checkbox-field>+ </spot-selector-field>- <op-checkbox-field+ <spot-selector-field[label]="text.responsible"[control]="form.get('responsible')">@@ -41,7 +41,7 @@formControlName="responsible"data-qa-global-notification-type="responsible"/>- </op-checkbox-field>+ </spot-selector-field><h5>{{ text.alsoNotifyFor.title }}</h5><p>{{ text.alsoNotifyFor.description }}</p>diff --git a/modules/documents/spec/services/notifications/create_from_model_service_document_spec.rb b/modules/documents/spec/services/notifications/create_from_model_service_document_spec.rbindex e5829200fa9..898cc64bc42 100644--- a/modules/documents/spec/services/notifications/create_from_model_service_document_spec.rb+++ b/modules/documents/spec/services/notifications/create_from_model_service_document_spec.rb@@ -68,10 +68,20 @@ describe Notifications::CreateFromModelService, 'document', with_settings: { jouendend- context 'with the user having registered for assignee and responsible notifications' do+ context 'with the user having registered for assignee notifications' dolet(:recipient_notification_settings) do[- build(:notification_setting, **notification_settings_all_false.merge(assignee: true, responsible: true))+ build(:notification_setting, **notification_settings_all_false.merge(assignee: true))+ ]+ end++ it_behaves_like 'creates no notification'+ end++ context 'with the user having registered for responsible notifications' do+ let(:recipient_notification_settings) do+ [+ build(:notification_setting, **notification_settings_all_false.merge(responsible: true))]end@@ -116,10 +126,20 @@ describe Notifications::CreateFromModelService, 'document', with_settings: { jouendend- context 'with the user having registered for assignee and responsible notifications' do+ context 'with the user having registered for assignee notifications' do+ let(:recipient_notification_settings) do+ [+ build(:notification_setting, **notification_settings_all_false.merge(assignee: true))+ ]+ end++ it_behaves_like 'creates no notification'+ end++ context 'with the user having registered for responsible notifications' dolet(:recipient_notification_settings) do[- build(:notification_setting, **notification_settings_all_false.merge(assignee: true, responsible: true))+ build(:notification_setting, **notification_settings_all_false.merge(responsible: true))]enddiff --git a/spec/services/notifications/create_from_model_service_comment_spec.rb b/spec/services/notifications/create_from_model_service_comment_spec.rbindex e651be0b59b..2cc02630539 100644--- a/spec/services/notifications/create_from_model_service_comment_spec.rb+++ b/spec/services/notifications/create_from_model_service_comment_spec.rb@@ -73,10 +73,20 @@ describe Notifications::CreateFromModelService, 'comment', with_settings: { jourendend- context 'with the user having registered for assignee and responsible notifications' do+ context 'with the user having registered for assignee notifications' dolet(:recipient_notification_settings) do[- build(:notification_setting, **notification_settings_all_false.merge(assignee: true, responsible: true))+ build(:notification_setting, **notification_settings_all_false.merge(assignee: true))+ ]+ end++ it_behaves_like 'creates no notification'+ end++ context 'with the user having registered for responsible notifications' do+ let(:recipient_notification_settings) do+ [+ build(:notification_setting, **notification_settings_all_false.merge(responsible: true))]enddiff --git a/spec/services/notifications/create_from_model_service_message_spec.rb b/spec/services/notifications/create_from_model_service_message_spec.rbindex 1ffec2fd7ce..576509d0b71 100644--- a/spec/services/notifications/create_from_model_service_message_spec.rb+++ b/spec/services/notifications/create_from_model_service_message_spec.rb@@ -74,10 +74,20 @@ describe Notifications::CreateFromModelService, 'message', with_settings: { jourendend- context 'with the user having registered for assignee and responsible notifications' do+ context 'with the user having registered for assignee notifications' dolet(:recipient_notification_settings) do[- build(:notification_setting, **notification_settings_all_false.merge(assignee: true, responsible: true))+ build(:notification_setting, **notification_settings_all_false.merge(assignee: true))+ ]+ end++ it_behaves_like 'creates no notification'+ end++ context 'with the user having registered for responsible notifications' do+ let(:recipient_notification_settings) do+ [+ build(:notification_setting, **notification_settings_all_false.merge(responsible: true))]end@@ -206,10 +216,20 @@ describe Notifications::CreateFromModelService, 'message', with_settings: { jourendend- context 'with the user having registered for assignee and responsible notifications' do+ context 'with the user having registered for assignee notifications' do+ let(:recipient_notification_settings) do+ [+ build(:notification_setting, **notification_settings_all_false.merge(assignee: true))+ ]+ end++ it_behaves_like 'creates no notification'+ end++ context 'with the user having registered for responsible notifications' dolet(:recipient_notification_settings) do[- build(:notification_setting, **notification_settings_all_false.merge(assignee: true, responsible: true))+ build(:notification_setting, **notification_settings_all_false.merge(responsible: true))]enddiff --git a/spec/services/notifications/create_from_model_service_news_spec.rb b/spec/services/notifications/create_from_model_service_news_spec.rbindex 574632496ec..20a6e735a34 100644--- a/spec/services/notifications/create_from_model_service_news_spec.rb+++ b/spec/services/notifications/create_from_model_service_news_spec.rb@@ -66,10 +66,20 @@ describe Notifications::CreateFromModelService, 'news', with_settings: { journalendend- context 'with the user having registered for assignee and responsible notifications' do+ context 'with the user having registered for assignee notifications' dolet(:recipient_notification_settings) do[- build(:notification_setting, **notification_settings_all_false.merge(assignee: true, responsible: true))+ build(:notification_setting, **notification_settings_all_false.merge(assignee: true))+ ]+ end++ it_behaves_like 'creates no notification'+ end++ context 'with the user having registered for responsible notifications' do+ let(:recipient_notification_settings) do+ [+ build(:notification_setting, **notification_settings_all_false.merge(responsible: true))]enddiff --git a/spec/services/notifications/create_from_model_service_wiki_spec.rb b/spec/services/notifications/create_from_model_service_wiki_spec.rbindex 639425c4105..49be3682848 100644--- a/spec/services/notifications/create_from_model_service_wiki_spec.rb+++ b/spec/services/notifications/create_from_model_service_wiki_spec.rb@@ -72,10 +72,20 @@ describe Notifications::CreateFromModelService, 'wiki', with_settings: { journalendend- context 'with the user having registered for assignee and responsible notifications' do+ context 'with the user having registered for assignee notifications' dolet(:recipient_notification_settings) do[- build(:notification_setting, **notification_settings_all_false.merge(assignee: true, responsible: true))+ build(:notification_setting, **notification_settings_all_false.merge(assignee: true))+ ]+ end++ it_behaves_like 'creates no notification'+ end++ context 'with the user having registered for responsible notifications' do+ let(:recipient_notification_settings) do+ [+ build(:notification_setting, **notification_settings_all_false.merge(responsible: true))]end@@ -165,10 +175,20 @@ describe Notifications::CreateFromModelService, 'wiki', with_settings: { journalendend- context 'with the user having registered for assignee and responsible notifications' do+ context 'with the user having registered for assignee notifications' do+ let(:recipient_notification_settings) do+ [+ build(:notification_setting, **notification_settings_all_false.merge(assignee: true))+ ]+ end++ it_behaves_like 'creates no notification'+ end++ context 'with the user having registered for responsible notifications' dolet(:recipient_notification_settings) do[- build(:notification_setting, **notification_settings_all_false.merge(assignee: true, responsible: true))+ build(:notification_setting, **notification_settings_all_false.merge(responsible: true))]enddiff --git a/spec/services/notifications/create_from_model_service_work_package_spec.rb b/spec/services/notifications/create_from_model_service_work_package_spec.rbindex 212ba90dd08..7c35fb6697d 100644--- a/spec/services/notifications/create_from_model_service_work_package_spec.rb+++ b/spec/services/notifications/create_from_model_service_work_package_spec.rb@@ -103,7 +103,7 @@ describe Notifications::CreateFromModelService,let(:user_property) { :assigned_to }let(:recipient_notification_settings) do[- build(:notification_setting, **notification_settings_all_false.merge(assignee: true, responsible: true))+ build(:notification_setting, **notification_settings_all_false.merge(assignee: true))]end@@ -150,7 +150,7 @@ describe Notifications::CreateFromModelService,context 'when assignee has all in app notifications enabled but only assignee for mail' dolet(:recipient_notification_settings) do[- build(:notification_setting, **notification_settings_all_false.merge(assignee: true, responsible: true))+ build(:notification_setting, **notification_settings_all_false.merge(assignee: true))]end@@ -194,7 +194,7 @@ describe Notifications::CreateFromModelService,let(:user_property) { :responsible }let(:recipient_notification_settings) do[- build(:notification_setting, **notification_settings_all_false.merge(assignee: true, responsible: true))+ build(:notification_setting, **notification_settings_all_false.merge(responsible: true))]end