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
hide share options in notifications behind feature flag
ulferts0304869c7cab
diff --git a/frontend/src/app/features/in-app-notifications/center/menu/menu.component.ts b/frontend/src/app/features/in-app-notifications/center/menu/menu.component.tsindex d2918153a2c..ae6beb1ceeb 100644--- a/frontend/src/app/features/in-app-notifications/center/menu/menu.component.ts+++ b/frontend/src/app/features/in-app-notifications/center/menu/menu.component.ts@@ -41,6 +41,7 @@ import { I18nService } from 'core-app/core/i18n/i18n.service';import { INotificationPageQueryParameters } from '../../in-app-notifications.routes';import { IanMenuService } from './state/ian-menu.service';import { BannersService } from 'core-app/core/enterprise/banners.service';+import { ConfigurationService } from 'core-app/core/config/configuration.service';export const ianMenuSelector = 'op-ian-menu';@@ -100,14 +101,15 @@ export class IanMenuComponent implements OnInit {isEnterprise: true,...this.eeGuardedDateAlertRoute,},- {- key: 'shared',- title: this.I18n.t('js.notifications.menu.shared'),- icon: 'share',- ...getUiLinkForFilters({ filter: 'reason', name: 'shared' }),- },];+ sharedMenuItem = {+ key: 'shared',+ title: this.I18n.t('js.notifications.menu.shared'),+ icon: 'share',+ ...getUiLinkForFilters({ filter: 'reason', name: 'shared' }),+ };+notificationsByProject$ = this.ianMenuService.notificationsByProject$.pipe(map((items) => items.map((item) => ({@@ -168,7 +170,12 @@ export class IanMenuComponent implements OnInit {readonly ianMenuService:IanMenuService,readonly state:StateService,readonly bannersService:BannersService,- ) { }+ readonly configurationService:ConfigurationService,+ ) {+ if (this.configurationService.activeFeatureFlags.includes('workPackageSharing')) {+ this.reasonMenuItems.push(this.sharedMenuItem);+ }+ }ngOnInit():void {this.ianMenuService.reload();diff --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 d4563ad7d89..83fd6ee80af 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@@ -56,6 +56,7 @@<spot-selector-field[label]="text.shared"[control]="form.get('shared')"+ *ngIf="displaySharedOption"><inputslot="input"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 80730c3db62..2f8a7e9789b 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@@ -20,6 +20,7 @@ import { INotificationSetting } from 'core-app/features/user-preferences/state/nimport { BannersService } from 'core-app/core/enterprise/banners.service';import { enterpriseDocsUrl } from 'core-app/core/setup/globals/constants.const';import { OVERDUE_REMINDER_AVAILABLE_TIMEFRAMES, REMINDER_AVAILABLE_TIMEFRAMES } from '../overdue-reminder-available-times';+import { ConfigurationService } from 'core-app/core/config/configuration.service';export const myNotificationsPageComponentSelector = 'op-notifications-page';@@ -66,6 +67,8 @@ export class NotificationsSettingsPageComponent extends UntilDestroyedMixin implpublic eeShowBanners = false;+ public displaySharedOption = false;+public form = new UntypedFormGroup({assignee: new UntypedFormControl(false),responsible: new UntypedFormControl(false),@@ -142,6 +145,7 @@ export class NotificationsSettingsPageComponent extends UntilDestroyedMixin implprivate currentUserService:CurrentUserService,private uiRouterGlobals:UIRouterGlobals,readonly bannersService:BannersService,+ readonly configurationService:ConfigurationService,) {super();}@@ -150,6 +154,7 @@ export class NotificationsSettingsPageComponent extends UntilDestroyedMixin implthis.form.disable();this.userId = (this.userId || this.uiRouterGlobals.params.userId) as string;this.eeShowBanners = this.bannersService.eeShowBanners;+ this.displaySharedOption = this.configurationService.activeFeatureFlags.includes('workPackageSharing');this.currentUserServicediff --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 739bdd7b0e3..cb5a9ec7ef0 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,7 +72,7 @@</td></ng-container></tr>- <tr>+ <tr *ngIf="displaySharedOption"><th class="op-table--cell op-table--cell_soft-heading">{{ text.shared }}</th>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 476cbd08cfc..39716da008a 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@@ -13,6 +13,7 @@ import idFromLink from 'core-app/features/hal/helpers/id-from-link';import { HalSourceLink } from 'core-app/features/hal/resources/hal-resource';import { BannersService } from 'core-app/core/enterprise/banners.service';import { OVERDUE_REMINDER_AVAILABLE_TIMEFRAMES, REMINDER_AVAILABLE_TIMEFRAMES } from '../overdue-reminder-available-times';+import { ConfigurationService } from 'core-app/core/config/configuration.service';@Component({selector: 'op-notification-settings-table',@@ -27,6 +28,8 @@ export class NotificationSettingsTableComponent implements OnInit {public eeShowBanners = false;+ public displaySharedOption = false;+public availableTimes = [{value: null,@@ -81,10 +84,12 @@ export class NotificationSettingsTableComponent implements OnInit {private I18n:I18nService,private pathHelper:PathHelperService,readonly bannersService:BannersService,+ readonly configurationService:ConfigurationService,) {}ngOnInit():void {this.eeShowBanners = this.bannersService.eeShowBanners;+ this.displaySharedOption = this.configurationService.activeFeatureFlags.includes('workPackageSharing');}projectLink(href:string) {diff --git a/spec/features/notifications/notification_center/notification_center_sidemenu_spec.rb b/spec/features/notifications/notification_center/notification_center_sidemenu_spec.rbindex 92e5a4b05e4..dc6143fd3f4 100644--- a/spec/features/notifications/notification_center/notification_center_sidemenu_spec.rb+++ b/spec/features/notifications/notification_center/notification_center_sidemenu_spec.rb@@ -1,7 +1,10 @@require 'spec_helper'-RSpec.describe "Notification center sidemenu", :js, :with_cuprite,- with_ee: %i[date_alerts] do+RSpec.describe "Notification center sidemenu",+ :js,+ :with_cuprite,+ with_ee: %i[date_alerts],+ with_flag: { work_package_sharing: true } doshared_let(:project) { create(:project) }shared_let(:project2) { create(:project) }shared_let(:project3) { create(:project, parent: project2) }diff --git a/spec/features/notifications/settings/my_notifications_settings_spec.rb b/spec/features/notifications/settings/my_notifications_settings_spec.rbindex df8afe0436b..5098a1bff7f 100644--- a/spec/features/notifications/settings/my_notifications_settings_spec.rb+++ b/spec/features/notifications/settings/my_notifications_settings_spec.rb@@ -2,7 +2,9 @@ require 'rails_helper'require_relative '../../users/notifications/shared_examples'require 'support/pages/my/notifications'-RSpec.describe "My notifications settings", js: true, with_cuprite: true do+RSpec.describe "My notifications settings",+ :js,+ :with_cuprite doshared_let(:user) { create(:user) }let(:settings_page) { Pages::My::Notifications.new(user) }diff --git a/spec/features/users/notifications/shared_examples.rb b/spec/features/users/notifications/shared_examples.rbindex 01e35b0bd36..dcce527a274 100644--- a/spec/features/users/notifications/shared_examples.rb+++ b/spec/features/users/notifications/shared_examples.rb@@ -1,5 +1,7 @@RSpec.shared_examples 'notification settings workflow' do- describe 'with another project the user can see', with_ee: %i[date_alerts] do+ describe 'with another project the user can see',+ with_ee: %i[date_alerts],+ with_flag: { work_package_sharing: true } doshared_let(:project) { create(:project) }shared_let(:project_alt) { create(:project) }shared_let(:role) { create(:project_role, permissions: %i[view_project]) }