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
add shared to notification reason
ulfertsd6215083d038
diff --git a/app/models/notification_setting.rb b/app/models/notification_setting.rbindex d2c7c3221cc..63f96689012 100644--- a/app/models/notification_setting.rb+++ b/app/models/notification_setting.rb@@ -3,6 +3,7 @@ class NotificationSetting < ApplicationRecordASSIGNEE = :assigneeRESPONSIBLE = :responsibleMENTIONED = :mentioned+ SHARED = :sharedSTART_DATE = :start_dateDUE_DATE = :due_dateOVERDUE = :overdue@@ -26,6 +27,7 @@ class NotificationSetting < ApplicationRecordASSIGNEE,RESPONSIBLE,MENTIONED,+ SHARED,WORK_PACKAGE_CREATED,WORK_PACKAGE_COMMENTED,WORK_PACKAGE_PROCESSED,diff --git a/app/services/user_preferences/update_service.rb b/app/services/user_preferences/update_service.rbindex bf45ba206e5..2683b42e514 100644--- a/app/services/user_preferences/update_service.rb+++ b/app/services/user_preferences/update_service.rb@@ -92,6 +92,7 @@ module UserPreferencescolumns: %i[watchedassigneeresponsible+ sharedmentionedstart_datedue_datediff --git a/config/locales/js-en.yml b/config/locales/js-en.ymlindex d62c875c8bf..f7ae7144ca9 100644--- a/config/locales/js-en.yml+++ b/config/locales/js-en.yml@@ -713,6 +713,7 @@ en:description: 'Receive a notification every time someone mentions me anywhere'assignee: 'Assignee'responsible: 'Accountable'+ shared: 'Shared'watched: 'Watcher'work_package_commented: 'All new comments'work_package_created: 'New work packages'diff --git a/db/migrate/20231024150429_add_shared_to_notification_settings.rb b/db/migrate/20231024150429_add_shared_to_notification_settings.rbnew file mode 100644index 00000000000..5d936873f8e--- /dev/null+++ b/db/migrate/20231024150429_add_shared_to_notification_settings.rb@@ -0,0 +1,5 @@+class AddSharedToNotificationSettings < ActiveRecord::Migration[7.0]+ def change+ add_column :notification_settings, :shared, :boolean, default: false, null: false+ end+enddiff --git a/docs/api/apiv3/components/schemas/user_preferences_model.yml b/docs/api/apiv3/components/schemas/user_preferences_model.ymlindex c1abfc6fbd3..0d59ee532a2 100644--- a/docs/api/apiv3/components/schemas/user_preferences_model.yml+++ b/docs/api/apiv3/components/schemas/user_preferences_model.yml@@ -20,6 +20,7 @@ example:- watched: falseinvolved: truementioned: false+ shared: truenewsAdded: false,newsCommented: falsedocumentAdded: falsediff --git a/docs/api/apiv3/paths/my_preferences.yml b/docs/api/apiv3/paths/my_preferences.ymlindex 3db1e21dde1..2e11f669105 100644--- a/docs/api/apiv3/paths/my_preferences.yml+++ b/docs/api/apiv3/paths/my_preferences.yml@@ -26,6 +26,7 @@ get:watched: falseinvolved: truementioned: false+ shared: truenewsAdded: false,newsCommented: falsedocumentAdded: false@@ -89,6 +90,7 @@ patch:watched: falseinvolved: truementioned: false+ shared: truenewsAdded: false,newsCommented: falsedocumentAdded: falsediff --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 fe1242a46ab..d4563ad7d89 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@@ -53,6 +53,18 @@/></spot-selector-field>+ <spot-selector-field+ [label]="text.shared"+ [control]="form.get('shared')"+ >+ <input+ slot="input"+ type="checkbox"+ formControlName="shared"+ data-qa-global-notification-type="shared"+ />+ </spot-selector-field>+<h5>{{ text.dateAlerts.title }}</h5><p>{{ text.dateAlerts.description }}</p><div *ngIf="!eeShowBanners">diff --git a/frontend/src/app/features/user-preferences/notifications-settings/page/notifications-settings-page.component.ts b/frontend/src/app/features/user-preferences/notifications-settings/page/notifications-settings-page.component.tsindex 010de25044e..80730c3db62 100644--- a/frontend/src/app/features/user-preferences/notifications-settings/page/notifications-settings-page.component.ts+++ b/frontend/src/app/features/user-preferences/notifications-settings/page/notifications-settings-page.component.ts@@ -26,6 +26,7 @@ export const myNotificationsPageComponentSelector = 'op-notifications-page';interface IToastSettingsValue {assignee:boolean;responsible:boolean;+ shared:boolean;workPackageCreated:boolean;workPackageProcessed:boolean;workPackageScheduled:boolean;@@ -68,6 +69,7 @@ export class NotificationsSettingsPageComponent extends UntilDestroyedMixin implpublic form = new UntypedFormGroup({assignee: new UntypedFormControl(false),responsible: new UntypedFormControl(false),+ shared: new UntypedFormControl(false),workPackageCreated: new UntypedFormControl(false),workPackageProcessed: new UntypedFormControl(false),workPackageScheduled: new UntypedFormControl(false),@@ -118,6 +120,7 @@ export class NotificationsSettingsPageComponent extends UntilDestroyedMixin impl},assignee: this.I18n.t('js.notifications.settings.reasons.assignee'),responsible: this.I18n.t('js.notifications.settings.reasons.responsible'),+ shared: this.I18n.t('js.notifications.settings.reasons.shared'),startDate: this.I18n.t('js.work_packages.properties.startDate'),dueDate: this.I18n.t('js.work_packages.properties.dueDate'),overdue: this.I18n.t('js.notifications.settings.global.overdue'),@@ -178,6 +181,7 @@ export class NotificationsSettingsPageComponent extends UntilDestroyedMixin implthis.form.get('assignee')?.setValue(settings.assignee);this.form.get('responsible')?.setValue(settings.responsible);+ this.form.get('shared')?.setValue(settings.shared);this.form.get('workPackageCreated')?.setValue(settings.workPackageCreated);this.form.get('workPackageProcessed')?.setValue(settings.workPackageProcessed);this.form.get('workPackageScheduled')?.setValue(settings.workPackageScheduled);@@ -211,6 +215,7 @@ export class NotificationsSettingsPageComponent extends UntilDestroyedMixin implproject: new UntypedFormControl(setting._links.project),assignee: new UntypedFormControl(setting.assignee),responsible: new UntypedFormControl(setting.responsible),+ shared: new UntypedFormControl(setting.shared),workPackageCreated: new UntypedFormControl(setting.workPackageCreated),workPackageProcessed: new UntypedFormControl(setting.workPackageProcessed),workPackageScheduled: new UntypedFormControl(setting.workPackageScheduled),@@ -239,6 +244,7 @@ export class NotificationsSettingsPageComponent extends UntilDestroyedMixin implmentioned: true,assignee: notificationSettings.assignee,responsible: notificationSettings.responsible,+ shared: notificationSettings.shared,workPackageCreated: notificationSettings.workPackageCreated,workPackageProcessed: notificationSettings.workPackageProcessed,workPackageScheduled: notificationSettings.workPackageScheduled,@@ -255,6 +261,7 @@ export class NotificationsSettingsPageComponent extends UntilDestroyedMixin implmentioned: true,assignee: settings.assignee,responsible: settings.responsible,+ shared: settings.shared,workPackageCreated: settings.workPackageCreated,workPackageProcessed: settings.workPackageProcessed,workPackageScheduled: settings.workPackageScheduled,diff --git a/frontend/src/app/features/user-preferences/notifications-settings/table/notification-settings-table.component.html b/frontend/src/app/features/user-preferences/notifications-settings/table/notification-settings-table.component.htmlindex b7459728f55..739bdd7b0e3 100644--- a/frontend/src/app/features/user-preferences/notifications-settings/table/notification-settings-table.component.html+++ b/frontend/src/app/features/user-preferences/notifications-settings/table/notification-settings-table.component.html@@ -72,6 +72,21 @@</td></ng-container></tr>+ <tr>+ <th class="op-table--cell op-table--cell_soft-heading">+ {{ text.shared }}+ </th>+ <ng-container *ngFor="let item of settings.controls">+ <td class="op-table--cell" [formGroup]="item">+ <input+ type="checkbox"+ formControlName="shared"+ data-qa-project-notification-type="shared"+ [attr.data-qa-project]="item.controls.project.value.title"+ />+ </td>+ </ng-container>+ </tr><tr *ngIf="!eeShowBanners"><th class="op-table--cell op-table--cell_soft-heading">diff --git a/frontend/src/app/features/user-preferences/notifications-settings/table/notification-settings-table.component.ts b/frontend/src/app/features/user-preferences/notifications-settings/table/notification-settings-table.component.tsindex bd46f864a65..476cbd08cfc 100644--- a/frontend/src/app/features/user-preferences/notifications-settings/table/notification-settings-table.component.ts+++ b/frontend/src/app/features/user-preferences/notifications-settings/table/notification-settings-table.component.ts@@ -64,6 +64,7 @@ export class NotificationSettingsTableComponent implements OnInit {},assignee: this.I18n.t('js.notifications.settings.reasons.assignee'),responsible: this.I18n.t('js.notifications.settings.reasons.responsible'),+ shared: this.I18n.t('js.notifications.settings.reasons.shared'),watched_header: this.I18n.t('js.notifications.settings.reasons.watched'),work_package_commented_header: this.I18n.t('js.notifications.settings.reasons.work_package_commented'),work_package_created_header: this.I18n.t('js.notifications.settings.reasons.work_package_created'),@@ -95,6 +96,7 @@ export class NotificationSettingsTableComponent implements OnInit {project: new UntypedFormControl(project),assignee: new UntypedFormControl(false),responsible: new UntypedFormControl(false),+ shared: new UntypedFormControl(false),workPackageCreated: new UntypedFormControl(false),workPackageProcessed: new UntypedFormControl(false),workPackageScheduled: new UntypedFormControl(false),diff --git a/frontend/src/app/features/user-preferences/state/notification-setting.model.ts b/frontend/src/app/features/user-preferences/state/notification-setting.model.tsindex accbc9a202d..0d994f8adbe 100644--- a/frontend/src/app/features/user-preferences/state/notification-setting.model.ts+++ b/frontend/src/app/features/user-preferences/state/notification-setting.model.ts@@ -5,6 +5,7 @@ export interface INotificationSetting {watched:boolean;assignee:boolean;responsible:boolean;+ shared:boolean;mentioned:boolean;workPackageCommented:boolean;workPackageCreated:boolean;@@ -34,6 +35,7 @@ export function buildNotificationSetting(project:null|HalSourceLink, params:Part},assignee: true,responsible: true,+ shared: true,mentioned: true,watched: true,workPackageCommented: true,diff --git a/spec/features/users/notifications/shared_examples.rb b/spec/features/users/notifications/shared_examples.rbindex 3d5ba107d24..01e35b0bd36 100644--- a/spec/features/users/notifications/shared_examples.rb+++ b/spec/features/users/notifications/shared_examples.rb@@ -17,6 +17,7 @@ RSpec.shared_examples 'notification settings workflow' do# Set settings for global emailsettings_page.configure_global assignee: true,responsible: true,+ shared: true,work_package_commented: true,work_package_created: true,work_package_processed: true,@@ -32,6 +33,7 @@ RSpec.shared_examples 'notification settings workflow' dosettings_page.configure_project project:,assignee: true,responsible: true,+ shared: true,work_package_commented: false,work_package_created: false,work_package_processed: false,@@ -56,6 +58,7 @@ RSpec.shared_examples 'notification settings workflow' doexpect(global_settings.responsible).to be_truthyexpect(global_settings.mentioned).to be_truthyexpect(global_settings.watched).to be_truthy+ expect(global_settings.shared).to be_truthyexpect(global_settings.work_package_commented).to be_truthyexpect(global_settings.work_package_created).to be_truthyexpect(global_settings.work_package_processed).to be_truthy@@ -70,6 +73,7 @@ RSpec.shared_examples 'notification settings workflow' doexpect(project_settings.responsible).to be_truthyexpect(project_settings.mentioned).to be_truthyexpect(project_settings.watched).to be_truthy+ expect(project_settings.shared).to be_truthyexpect(project_settings.work_package_commented).to be_falseyexpect(project_settings.work_package_created).to be_falseyexpect(project_settings.work_package_processed).to be_falseydiff --git a/spec/features/users/notifications/user_notifications_settings_spec.rb b/spec/features/users/notifications/user_notifications_settings_spec.rbindex 4cf16184437..be864bb720c 100644--- a/spec/features/users/notifications/user_notifications_settings_spec.rb+++ b/spec/features/users/notifications/user_notifications_settings_spec.rb@@ -1,9 +1,9 @@require 'rails_helper'-require_relative './shared_examples'+require_relative 'shared_examples'RSpec.describe "user notifications settings",- js: true,- with_cuprite: true do+ :js,+ :with_cuprite doshared_let(:user) { create(:user) }let(:settings_page) { Pages::Notifications::Settings.new(user) }