-
@@ -39,7 +38,7 @@
{{ notification.createdTime ?? currentDate | dateAgo }}
-
diff --git a/ui-ngx/src/app/shared/components/notification/notification.component.ts b/ui-ngx/src/app/shared/components/notification/notification.component.ts
index 0fedd3a978..2173c30023 100644
--- a/ui-ngx/src/app/shared/components/notification/notification.component.ts
+++ b/ui-ngx/src/app/shared/components/notification/notification.component.ts
@@ -19,6 +19,7 @@ import {
ActionButtonLinkType,
AlarmSeverityNotificationColors,
Notification,
+ NotificationStatus,
NotificationType,
NotificationTypeIcons
} from '@shared/models/notification.models';
@@ -53,6 +54,7 @@ export class NotificationComponent implements OnInit {
showIcon = false;
showButton = false;
buttonLabel = '';
+ hideMarkAsReadButton = false;
tinycolor = tinycolor_;
@@ -71,6 +73,7 @@ export class NotificationComponent implements OnInit {
ngOnInit() {
this.showIcon = this.notification.additionalConfig?.icon?.enabled;
this.showButton = this.notification.additionalConfig?.actionButtonConfig?.enabled;
+ this.hideMarkAsReadButton = this.notification.status === NotificationStatus.READ;
if (this.showButton) {
this.buttonLabel = this.utils.customTranslation(this.notification.additionalConfig.actionButtonConfig.text,
this.notification.additionalConfig.actionButtonConfig.text);
@@ -96,7 +99,13 @@ export class NotificationComponent implements OnInit {
let state = null;
if (this.notification.additionalConfig.actionButtonConfig.dashboardState) {
const stateObject: StateObject = {};
- stateObject.params = {};
+ if (this.notification.additionalConfig.actionButtonConfig.setEntityIdInState) {
+ stateObject.params = {
+ entityId: this.notification.info.originatorId ?? null
+ };
+ } else {
+ stateObject.params = {};
+ }
stateObject.id = this.notification.additionalConfig.actionButtonConfig.dashboardState;
state = objToBase64URI([ stateObject ]);
}
diff --git a/ui-ngx/src/app/shared/models/notification.models.ts b/ui-ngx/src/app/shared/models/notification.models.ts
index 1c9cc0e472..3c4ffbb994 100644
--- a/ui-ngx/src/app/shared/models/notification.models.ts
+++ b/ui-ngx/src/app/shared/models/notification.models.ts
@@ -23,7 +23,7 @@ import { NotificationTargetId } from '@shared/models/id/notification-target-id';
import { NotificationTemplateId } from '@shared/models/id/notification-template-id';
import { EntityId } from '@shared/models/id/entity-id';
import { NotificationRuleId } from '@shared/models/id/notification-rule-id';
-import { AlarmSeverity, AlarmStatus } from '@shared/models/alarm.models';
+import { AlarmSearchStatus, AlarmSeverity, AlarmStatus } from '@shared/models/alarm.models';
import { EntityType } from '@shared/models/entity-type.models';
export interface Notification {
@@ -45,6 +45,7 @@ export interface NotificationInfo {
alarmSeverity?: AlarmSeverity;
alarmStatus?: AlarmStatus;
alarmType?: string;
+ originatorId?: EntityId;
}
export interface NotificationRequest extends Omit
, 'label'> {
@@ -73,7 +74,7 @@ export interface NotificationRequestPreview {
export interface NotificationRequestStats {
sent: Map;
- errors: Map>;
+ errors: { [key in NotificationDeliveryMethod]: {[key in string]: string}};
processedRecipients: Map>;
}
@@ -111,7 +112,10 @@ export interface NotificationRule extends Omit, 'la
export interface NotificationRuleTriggerConfig {
alarmTypes?: Array;
alarmSeverities?: Array;
- clearRule?: AlarmStatus;
+ alarmStatus?: Array;
+ clearRule?: {
+ alarmStatus: Array;
+ };
devices?: Array;
deviceProfiles?: Array;
entityType?: EntityType;
@@ -205,11 +209,11 @@ interface PushDeliveryMethodAdditionalConfig {
actionButtonConfig: {
enabled: boolean;
text: string;
- color: string;
linkType: ActionButtonLinkType,
link?: string;
dashboardId?: string;
dashboardState?: string;
+ setEntityIdInState?: boolean
};
}
diff --git a/ui-ngx/src/assets/locale/locale.constant-en_US.json b/ui-ngx/src/assets/locale/locale.constant-en_US.json
index 1ec049c875..12f33f3a34 100644
--- a/ui-ngx/src/assets/locale/locale.constant-en_US.json
+++ b/ui-ngx/src/assets/locale/locale.constant-en_US.json
@@ -2749,12 +2749,16 @@
"delivery-method": "Delivery method",
"delivery-method-type": {
"email": "Email",
+ "email-failed-sent": "Email messages failed sent",
"email-preview": "Email notification preview",
"push": "Web",
+ "push-failed-sent": "Web messages failed sent",
"push-preview": "Web notification preview",
"slack": "Slack",
+ "slack-failed-sent": "Slack messages failed sent",
"slack-preview": "Slack notification preview",
"sms": "SMS",
+ "sms-failed-sent": "SMS messages failed sent",
"sms-preview": "SMS notification preview"
},
"delivery-methods": "Delivery methods",
@@ -2773,6 +2777,8 @@
"email-settings": "Email settings",
"entity-action-trigger-settings": "Entity action trigger settings",
"entity-type": "Entity type",
+ "failed-send": "Failed send",
+ "fails": "Fails",
"filter": "Filter",
"first-recipient": "First recipient",
"hierarchy-of-receiving": "Hierarchy of receiving notifications",
@@ -2827,6 +2833,7 @@
"send-notification": "Send notification",
"sent": "Sent",
"settings": "Notification settings",
+ "set-entity-from-notification": "Set entity from notification to dashboard state",
"slack": "Slack",
"slack-chanel-type": "Slack chanel type",
"slack-chanel-types": {