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

Add upsale component and route to it

Oliver Günther42849cf79e64
diff --git a/config/locales/js-en.yml b/config/locales/js-en.yml
index 92fe2975602..503fef0dd79 100644
--- a/config/locales/js-en.yml
+++ b/config/locales/js-en.yml
@@ -602,6 +602,9 @@ en:
property_is: 'is in %{difference_in_days}'
property_was: 'was %{difference_in_days} ago'
property_is_deleted: 'is deleted'
+ upsale:
+ title: 'Date alerts'
+ description: 'With date alerts, you will be notified of upcoming start or finish dates so that you never miss or forget an important deadline.'
facets:
unread: 'Unread'
unread_title: 'Show unread'
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.ts
index d467c0dbc4e..457c3f38c5b 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
@@ -40,6 +40,7 @@ import idFromLink from 'core-app/features/hal/helpers/id-from-link';
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';
export const ianMenuSelector = 'op-ian-menu';
@@ -97,7 +98,7 @@ export class IanMenuComponent implements OnInit {
title: this.I18n.t('js.notifications.menu.date_alert'),
icon: 'date-alert',
isEnterprise: true,
- ...getUiLinkForFilters({ filter: 'reason', name: 'dateAlert' }),
+ ...this.eeGuardedDateAlertRoute,
},
];
@@ -160,9 +161,18 @@ export class IanMenuComponent implements OnInit {
readonly I18n:I18nService,
readonly ianMenuService:IanMenuService,
readonly state:StateService,
+ readonly bannersService:BannersService,
) { }
ngOnInit():void {
this.ianMenuService.reload();
}
+
+ private get eeGuardedDateAlertRoute() {
+ if (this.bannersService.eeShowBanners) {
+ return { uiSref: 'notifications.date_alerts_upsale', uiParams: null, uiOptions: { inherit: false } };
+ }
+
+ return getUiLinkForFilters({ filter: 'reason', name: 'dateAlert' });
+ }
}
diff --git a/frontend/src/app/features/in-app-notifications/date-alerts-upsale/ian-date-alerts-upsale.component.html b/frontend/src/app/features/in-app-notifications/date-alerts-upsale/ian-date-alerts-upsale.component.html
new file mode 100644
index 00000000000..b5615ee5f0d
--- /dev/null
+++ b/frontend/src/app/features/in-app-notifications/date-alerts-upsale/ian-date-alerts-upsale.component.html
@@ -0,0 +1,5 @@
+<op-enterprise-page
+ [feature_image]="image"
+ [feature_title]="text.title"
+ [feature_description]="text.description"
+></op-enterprise-page>
diff --git a/frontend/src/app/features/in-app-notifications/date-alerts-upsale/ian-date-alerts-upsale.component.ts b/frontend/src/app/features/in-app-notifications/date-alerts-upsale/ian-date-alerts-upsale.component.ts
new file mode 100644
index 00000000000..6b1354f8369
--- /dev/null
+++ b/frontend/src/app/features/in-app-notifications/date-alerts-upsale/ian-date-alerts-upsale.component.ts
@@ -0,0 +1,21 @@
+import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core';
+import { I18nService } from 'core-app/core/i18n/i18n.service';
+import { imagePath } from 'core-app/shared/helpers/images/path-helper';
+
+@Component({
+ selector: 'op-ian-date-alerts-upsale',
+ templateUrl: './ian-date-alerts-upsale.component.html',
+ changeDetection: ChangeDetectionStrategy.OnPush,
+})
+export class InAppNotificationsDateAlertsUpsaleComponent {
+ image = imagePath('notification-center/date-alerts-ee.png');
+
+ text = {
+ title: this.I18n.t('js.notifications.date_alerts.upsale.title'),
+ description: this.I18n.t('js.notifications.date_alerts.upsale.description'),
+ };
+
+ constructor(
+ readonly I18n:I18nService,
+ ) { }
+}
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 39334eb26e8..72e1bb38f66 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
@@ -22,6 +22,7 @@ import { EmptyStateComponent } from './center/empty-state/empty-state.component'
import { IanBellService } from 'core-app/features/in-app-notifications/bell/state/ian-bell.service';
import { InAppNotificationActorsLineComponent } from './entry/actors-line/in-app-notification-actors-line.component';
import { InAppNotificationDateAlertComponent } from './entry/date-alert/in-app-notification-date-alert.component';
+import { InAppNotificationsDateAlertsUpsaleComponent } from 'core-app/features/in-app-notifications/date-alerts-upsale/ian-date-alerts-upsale.component';
@NgModule({
declarations: [
@@ -37,6 +38,7 @@ import { InAppNotificationDateAlertComponent } from './entry/date-alert/in-app-n
EmptyStateComponent,
InAppNotificationActorsLineComponent,
InAppNotificationDateAlertComponent,
+ InAppNotificationsDateAlertsUpsaleComponent,
],
imports: [
OPSharedModule,
diff --git a/frontend/src/app/features/in-app-notifications/in-app-notifications.routes.ts b/frontend/src/app/features/in-app-notifications/in-app-notifications.routes.ts
index 0477ecf166d..1c55b961a74 100644
--- a/frontend/src/app/features/in-app-notifications/in-app-notifications.routes.ts
+++ b/frontend/src/app/features/in-app-notifications/in-app-notifications.routes.ts
@@ -32,6 +32,7 @@ import { WorkPackageSplitViewComponent } from 'core-app/features/work-packages/r
import { InAppNotificationCenterComponent } from 'core-app/features/in-app-notifications/center/in-app-notification-center.component';
import { InAppNotificationCenterPageComponent } from 'core-app/features/in-app-notifications/center/in-app-notification-center-page.component';
import { WorkPackagesBaseComponent } from 'core-app/features/work-packages/routing/wp-base/wp--base.component';
+import { InAppNotificationsDateAlertsUpsaleComponent } from 'core-app/features/in-app-notifications/date-alerts-upsale/ian-date-alerts-upsale.component';
export interface INotificationPageQueryParameters {
filter?:string;
@@ -51,6 +52,11 @@ export const IAN_ROUTES:Ng2StateDeclaration[] = [
'!$default': { component: WorkPackagesBaseComponent },
},
},
+ {
+ url: '/date_alerts',
+ name: 'notifications.date_alerts_upsale',
+ component: InAppNotificationsDateAlertsUpsaleComponent,
+ },
{
name: 'notifications.center',
component: InAppNotificationCenterPageComponent,
diff --git a/frontend/src/app/shared/components/enterprise-page/enterprise-page.component.html b/frontend/src/app/shared/components/enterprise-page/enterprise-page.component.html
index aaa11c0f8b7..6381a22a4ad 100644
--- a/frontend/src/app/shared/components/enterprise-page/enterprise-page.component.html
+++ b/frontend/src/app/shared/components/enterprise-page/enterprise-page.component.html
@@ -16,7 +16,7 @@
<source src="feature_video" type="video/mp4">
</video>
- <img src="feature_image" class="widget-box--teaser-image" *ngIf="feature_image">
+ <img [src]="feature_image" class="widget-box--teaser-image" *ngIf="feature_image">
<img [src]="image.enterprise_edition" class="widget-box--teaser-image_default" *ngIf="!feature_image">
diff --git a/frontend/src/assets/images/notification-center/date-alerts-ee.png b/frontend/src/assets/images/notification-center/date-alerts-ee.png
new file mode 100644
index 00000000000..dc104a20e6e
Binary files /dev/null and b/frontend/src/assets/images/notification-center/date-alerts-ee.png differ