Skip to content

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

Remove center page and toolbar

Oliver Güntherf9aa46d87f6c
diff --git a/app/views/digest_mailer/work_packages.html.erb b/app/views/digest_mailer/work_packages.html.erb
index eb6aed6410a..802f6f887ac 100644
--- a/app/views/digest_mailer/work_packages.html.erb
+++ b/app/views/digest_mailer/work_packages.html.erb
@@ -11,7 +11,7 @@
<%= render partial: 'mailer/mailer_header',
locals: {
summary: "#{I18n.t(:'mail.digests.you_have')} #{digest_summary_text(@notification_ids.length, @mentioned_count)}",
- button_href: notifications_center_url,
+ button_href: notifications_url,
button_text: I18n.t(:'mail.notification.center'),
user: @user,
} %>
@@ -60,7 +60,7 @@
<table <%= placeholder_table_styles %>>
<tr>
<td style="background: #D1E5F5; padding: 8px 12px; border: 1px solid #1A67A3; border-radius: 16px; overflow: hidden; text-overflow: ellipsis;">
- <a href="<%= notifications_center_url %>"
+ <a href="<%= notifications_path %>"
target="_blank"
style="color: #1A67A3; text-decoration: none; font-size: 14px;white-space: nowrap;">
<%= I18n.t(:'mail.work_packages.see_all') %>
diff --git a/app/views/mailer/_notification_row.html.erb b/app/views/mailer/_notification_row.html.erb
index 40917f65e31..78018903ca5 100644
--- a/app/views/mailer/_notification_row.html.erb
+++ b/app/views/mailer/_notification_row.html.erb
@@ -1,5 +1,5 @@
<a style="text-decoration: none;display: block;"
- href="<%= local_assigns[:notification_url] || notifications_path(work_package.id) %>"
+ href="<%= local_assigns[:notification_url] || details_notifications_url(work_package.id) %>"
target="_blank">
<%= render layout: 'mailer/border_table' do %>
<tr>
@@ -104,7 +104,7 @@
</table>
<a style="margin-left: 12px;"
- href="<%= defined?(open_in_browser_path) ? open_in_browser_path : notifications_path(work_package.id) %>"
+ href="<%= defined?(open_in_browser_path) ? open_in_browser_path : details_notifications_url(work_package.id) %>"
target="_blank"
rel="noopener noreferrer">
<%= I18n.t('mail.work_packages.open_in_browser') %>
diff --git a/app/views/work_package_mailer/mentioned.html.erb b/app/views/work_package_mailer/mentioned.html.erb
index 579cec2353c..c91e9387bc3 100644
--- a/app/views/work_package_mailer/mentioned.html.erb
+++ b/app/views/work_package_mailer/mentioned.html.erb
@@ -11,7 +11,7 @@
<%= render partial: 'mailer/mailer_header',
locals: {
summary: I18n.t(:'mail.work_packages.mentioned_by', user: @journal.user),
- button_href: notifications_path(@work_package.id),
+ button_href: details_notifications_url(@work_package.id),
button_text: I18n.t(:'mail.notification.see_in_center'),
user: @user,
} %>
diff --git a/frontend/src/app/features/in-app-notifications/center/in-app-notification-center-page.component.ts b/frontend/src/app/features/in-app-notifications/center/in-app-notification-center-page.component.ts
deleted file mode 100644
index 441511f2bfd..00000000000
--- a/frontend/src/app/features/in-app-notifications/center/in-app-notification-center-page.component.ts
+++ /dev/null
@@ -1,145 +0,0 @@
-import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Injector, OnDestroy, OnInit } from '@angular/core';
-import {
- ToolbarButtonComponentDefinition,
- ViewPartitionState,
-} from 'core-app/features/work-packages/routing/partitioned-query-space-page/partitioned-query-space-page.component';
-import { StateService, TransitionService } from '@uirouter/core';
-import { I18nService } from 'core-app/core/i18n/i18n.service';
-import { ApiV3Service } from 'core-app/core/apiv3/api-v3.service';
-import {
- NotificationSettingsButtonComponent,
-} from 'core-app/features/in-app-notifications/center/toolbar/settings/notification-settings-button.component';
-import {
- ActivateFacetButtonComponent,
-} from 'core-app/features/in-app-notifications/center/toolbar/facet/activate-facet-button.component';
-import {
- MarkAllAsReadButtonComponent,
-} from 'core-app/features/in-app-notifications/center/toolbar/mark-all-as-read/mark-all-as-read-button.component';
-import { UntilDestroyedMixin } from 'core-app/shared/helpers/angular/until-destroyed.mixin';
-import { BackRoutingService } from 'core-app/features/work-packages/components/back-routing/back-routing.service';
-import { OpTitleService } from 'core-app/core/html/op-title.service';
-
-@Component({
- templateUrl: '../../work-packages/routing/partitioned-query-space-page/partitioned-query-space-page.component.html',
- styleUrls: [
- '../../work-packages/routing/partitioned-query-space-page/partitioned-query-space-page.component.sass',
- ],
- changeDetection: ChangeDetectionStrategy.OnPush,
-})
-export class InAppNotificationCenterPageComponent extends UntilDestroyedMixin implements OnInit, OnDestroy {
- text = {
- title: this.I18n.t('js.notifications.title'),
- };
-
- /** Disable the back button */
- backButtonCallback = undefined;
-
- /** Current query title to render */
- selectedTitle = this.text.title;
-
- /** Disable filter container for now */
- filterContainerDefinition = null;
-
- /** We need to pass the correct partition state to the view to manage the grid */
- currentPartition:ViewPartitionState = '-split';
-
- /** Show a toolbar */
- showToolbar = true;
-
- /** Toolbar is not editable */
- titleEditingEnabled = false;
-
- /** Listener callbacks */
- // eslint-disable-next-line @typescript-eslint/ban-types
- removeTransitionSubscription:Function;
-
- /** Not saveable */
- showToolbarSaveButton = false;
-
- /** Toolbar is always enabled */
- toolbarDisabled = false;
-
- /** Define the buttons shown in the toolbar */
- toolbarButtonComponents:ToolbarButtonComponentDefinition[] = [
- {
- component: ActivateFacetButtonComponent,
- containerClasses: 'form--field-inline-buttons-container',
- },
- {
- component: MarkAllAsReadButtonComponent,
- containerClasses: 'hidden-for-mobile',
- },
- {
- component: NotificationSettingsButtonComponent,
- containerClasses: 'hidden-for-tablet',
- },
- ];
-
- /** Global referrer set when coming to the notification center */
- private documentReferer:string;
-
- constructor(
- readonly I18n:I18nService,
- readonly cdRef:ChangeDetectorRef,
- readonly $transitions:TransitionService,
- readonly state:StateService,
- readonly injector:Injector,
- readonly apiV3Service:ApiV3Service,
- readonly backRoutingService:BackRoutingService,
- readonly titleService:OpTitleService,
- ) {
- super();
- }
-
- ngOnInit():void {
- this.documentReferer = document.referrer;
-
- this.setInitialHtmlTitle();
-
- this.removeTransitionSubscription = this.$transitions.onSuccess({}, ():any => {
- this.titleService.setFirstPart(this.text.title);
- });
- }
-
- ngOnDestroy():void {
- super.ngOnDestroy();
- this.removeTransitionSubscription();
- }
-
- /**
- * We need to set the current partition to the grid to ensure
- * either side gets expanded to full width if we're not in '-split' mode.
- *
- * @param state The current or entering state
- */
- setPartition(state:{ data:{ partition?:ViewPartitionState } }):void {
- this.currentPartition = state.data?.partition || '-split';
- }
-
- // For shared template compliance
- // eslint-disable-next-line class-methods-use-this
- updateTitleName(_val:string):void {
- }
-
- // For shared template compliance
- // eslint-disable-next-line class-methods-use-this
- changeChangesFromTitle(_val:string):void {
- }
-
- private setInitialHtmlTitle():void {
- const currentTitleParts = this.titleService.titleParts;
-
- // Prepend "Notifications" if only the application name is shown
- if (currentTitleParts.length === 1) {
- this.titleService.prependFirstPart(this.text.title);
- }
-
- // A click on the left side menu of the notification center newly triggers the center page (and thus the ngOnInit).
- // So the transition hook only works for changing the content of the split screen but not when switching for example
- // from "watched" to "mentioned".
- // So we override the first part in this case to make sure that there is not the name of a WP is shown when there is no split screen visible.
- if (currentTitleParts[0] !== this.text.title) {
- this.titleService.setFirstPart(this.text.title);
- }
- }
-}
diff --git a/frontend/src/app/features/in-app-notifications/center/toolbar/facet/activate-facet-button.component.html b/frontend/src/app/features/in-app-notifications/center/toolbar/facet/activate-facet-button.component.html
deleted file mode 100644
index 94e7512c442..00000000000
--- a/frontend/src/app/features/in-app-notifications/center/toolbar/facet/activate-facet-button.component.html
+++ /dev/null
@@ -1,15 +0,0 @@
-<ng-container *ngFor="let facet of availableFacets">
- <button
- type="button"
- class="button form--field-inline-button"
- [title]="text.facet_titles[facet]"
- [class.-active]="facet === (activeFacet$ | async)"
- (click)="activateFacet(facet)"
- >
- <span
- class="button--text button--text_without_icon"
- [textContent]="text.facets[facet]"
- >
- </span>
- </button>
-</ng-container>
diff --git a/frontend/src/app/features/in-app-notifications/center/toolbar/facet/activate-facet-button.component.ts b/frontend/src/app/features/in-app-notifications/center/toolbar/facet/activate-facet-button.component.ts
deleted file mode 100644
index 883d05a6a11..00000000000
--- a/frontend/src/app/features/in-app-notifications/center/toolbar/facet/activate-facet-button.component.ts
+++ /dev/null
@@ -1,39 +0,0 @@
-import { ChangeDetectionStrategy, Component } from '@angular/core';
-import { I18nService } from 'core-app/core/i18n/i18n.service';
-import { IanCenterService } from 'core-app/features/in-app-notifications/center/state/ian-center.service';
-import {
- IAN_FACET_FILTERS,
- InAppNotificationFacet,
-} from 'core-app/features/in-app-notifications/center/state/ian-center.store';
-
-@Component({
- selector: 'op-activate-facet',
- templateUrl: './activate-facet-button.component.html',
- changeDetection: ChangeDetectionStrategy.OnPush,
-})
-export class ActivateFacetButtonComponent {
- text = {
- facets: {
- unread: this.I18n.t('js.notifications.facets.unread'),
- all: this.I18n.t('js.notifications.facets.all'),
- },
- facet_titles: {
- unread: this.I18n.t('js.notifications.facets.unread_title'),
- all: this.I18n.t('js.notifications.facets.all_title'),
- },
- };
-
- availableFacets = Object.keys(IAN_FACET_FILTERS);
-
- activeFacet$ = this.storeService.activeFacet$;
-
- constructor(
- private I18n:I18nService,
- private storeService:IanCenterService,
- ) {
- }
-
- activateFacet(facet:InAppNotificationFacet):void {
- this.storeService.setFacet(facet);
- }
-}
diff --git a/frontend/src/app/features/in-app-notifications/center/toolbar/mark-all-as-read/mark-all-as-read-button.component.html b/frontend/src/app/features/in-app-notifications/center/toolbar/mark-all-as-read/mark-all-as-read-button.component.html
deleted file mode 100644
index 43a9e793d56..00000000000
--- a/frontend/src/app/features/in-app-notifications/center/toolbar/mark-all-as-read/mark-all-as-read-button.component.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<button
- type="button"
- class="button"
- (click)="markAllRead()"
->
- <span
- class="spot-icon spot-icon_mark-all-read"
- ></span>
- <span>{{text.mark_all_read}}</span>
-</button>
diff --git a/frontend/src/app/features/in-app-notifications/center/toolbar/mark-all-as-read/mark-all-as-read-button.component.ts b/frontend/src/app/features/in-app-notifications/center/toolbar/mark-all-as-read/mark-all-as-read-button.component.ts
deleted file mode 100644
index c8fdaff39f3..00000000000
--- a/frontend/src/app/features/in-app-notifications/center/toolbar/mark-all-as-read/mark-all-as-read-button.component.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-import {
- ChangeDetectionStrategy,
- Component,
-} from '@angular/core';
-import { I18nService } from 'core-app/core/i18n/i18n.service';
-import { IanCenterService } from 'core-app/features/in-app-notifications/center/state/ian-center.service';
-
-@Component({
- selector: 'op-mark-all-as-read-button',
- templateUrl: './mark-all-as-read-button.component.html',
- changeDetection: ChangeDetectionStrategy.OnPush,
-})
-export class MarkAllAsReadButtonComponent {
- text = {
- mark_all_read: this.I18n.t('js.notifications.center.mark_all_read'),
- };
-
- constructor(
- private I18n:I18nService,
- private storeService:IanCenterService,
- ) {
- }
-
- markAllRead():void {
- this.storeService.markAllAsRead();
- }
-}
diff --git a/frontend/src/app/features/in-app-notifications/center/toolbar/settings/notification-settings-button.component.html b/frontend/src/app/features/in-app-notifications/center/toolbar/settings/notification-settings-button.component.html
deleted file mode 100644
index 9e908097337..00000000000
--- a/frontend/src/app/features/in-app-notifications/center/toolbar/settings/notification-settings-button.component.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<a
- class="button"
- [href]="myNotificationSettingsLink"
- target="_blank"
->
- <span
- class="spot-icon spot-icon_settings"
- ></span>
- <span>{{text.mySettings}}</span>
-</a>
diff --git a/frontend/src/app/features/in-app-notifications/center/toolbar/settings/notification-settings-button.component.ts b/frontend/src/app/features/in-app-notifications/center/toolbar/settings/notification-settings-button.component.ts
deleted file mode 100644
index 97fa037304e..00000000000
--- a/frontend/src/app/features/in-app-notifications/center/toolbar/settings/notification-settings-button.component.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-import { ChangeDetectionStrategy, Component } from '@angular/core';
-import { PathHelperService } from 'core-app/core/path-helper/path-helper.service';
-import { I18nService } from 'core-app/core/i18n/i18n.service';
-
-@Component({
- selector: 'op-notification-settings-button',
- templateUrl: './notification-settings-button.component.html',
- changeDetection: ChangeDetectionStrategy.OnPush,
-})
-export class NotificationSettingsButtonComponent {
- myNotificationSettingsLink = this.pathHelper.myNotificationsSettingsPath();
-
- text = {
- mySettings: this.I18n.t('js.notifications.settings.title'),
- };
-
- constructor(
- private I18n:I18nService,
- private pathHelper:PathHelperService,
- ) {
- }
-}
diff --git a/frontend/src/app/features/in-app-notifications/in-app-notifications.module.ts b/frontend/src/app/features/in-app-notifications/in-app-notifications.module.ts
index 38b4267ccb1..0737be32ef4 100644
--- a/frontend/src/app/features/in-app-notifications/in-app-notifications.module.ts
+++ b/frontend/src/app/features/in-app-notifications/in-app-notifications.module.ts
@@ -13,9 +13,6 @@ import { InAppNotificationCenterPageComponent } from 'core-app/features/in-app-n
import { OpenprojectWorkPackagesModule } from 'core-app/features/work-packages/openproject-work-packages.module';
import { DynamicModule } from 'ng-dynamic-component';
import { InAppNotificationStatusComponent } from './entry/status/in-app-notification-status.component';
-import { NotificationSettingsButtonComponent } from './center/toolbar/settings/notification-settings-button.component';
-import { ActivateFacetButtonComponent } from './center/toolbar/facet/activate-facet-button.component';
-import { MarkAllAsReadButtonComponent } from './center/toolbar/mark-all-as-read/mark-all-as-read-button.component';
import { OpenprojectContentLoaderModule } from 'core-app/shared/components/op-content-loader/openproject-content-loader.module';
import { EmptyStateComponent } from './center/empty-state/empty-state.component';
import { IanBellService } from 'core-app/features/in-app-notifications/bell/state/ian-bell.service';
@@ -30,9 +27,7 @@ import { InAppNotificationsDateAlertsUpsaleComponent } from 'core-app/features/i
InAppNotificationEntryComponent,
InAppNotificationCenterPageComponent,
InAppNotificationStatusComponent,
- NotificationSettingsButtonComponent,
- ActivateFacetButtonComponent,
- MarkAllAsReadButtonComponent,
+ IanMenuComponent,
EmptyStateComponent,
InAppNotificationActorsLineComponent,
InAppNotificationDateAlertComponent,
@@ -40,10 +35,6 @@ import { InAppNotificationsDateAlertsUpsaleComponent } from 'core-app/features/i
],
imports: [
OpSharedModule,
- // Routes for /backlogs
- UIRouterModule.forChild({
- states: IAN_ROUTES,
- }),
DynamicModule,
CommonModule,
IconModule,
@@ -54,6 +45,7 @@ import { InAppNotificationsDateAlertsUpsaleComponent } from 'core-app/features/i
],
providers: [
IanBellService,
+ IanCenterService,
],
})
export class OpenProjectInAppNotificationsModule {