Change default entity action notification; fix default rules names
This commit is contained in:
parent
c542bb9b16
commit
e8179271d2
@ -109,7 +109,7 @@ public class DefaultNotificationSettingsService implements NotificationSettingsS
|
||||
|
||||
defaultNotifications.create(tenantId, DefaultNotifications.newAlarm, tenantAdmins.getId());
|
||||
defaultNotifications.create(tenantId, DefaultNotifications.alarmUpdate, tenantAdmins.getId());
|
||||
defaultNotifications.create(tenantId, DefaultNotifications.deviceAction, tenantAdmins.getId());
|
||||
defaultNotifications.create(tenantId, DefaultNotifications.entityAction, tenantAdmins.getId());
|
||||
defaultNotifications.create(tenantId, DefaultNotifications.deviceActivity, tenantAdmins.getId());
|
||||
defaultNotifications.create(tenantId, DefaultNotifications.alarmComment, tenantAdmins.getId());
|
||||
defaultNotifications.create(tenantId, DefaultNotifications.alarmAssignment, affectedUser.getId());
|
||||
|
||||
@ -179,13 +179,13 @@ public class DefaultNotifications {
|
||||
.description("Send notification to tenant admins when any alarm is updated or cleared")
|
||||
.build())
|
||||
.build();
|
||||
public static final DefaultNotification deviceAction = DefaultNotification.builder()
|
||||
.name("Device action notification")
|
||||
public static final DefaultNotification entityAction = DefaultNotification.builder()
|
||||
.name("Entity action notification")
|
||||
.type(NotificationType.ENTITY_ACTION)
|
||||
.subject("${entityType} was ${actionType}")
|
||||
.text("${entityType} '${entityName}' was ${actionType} by user ${userEmail}")
|
||||
.icon("info").color(null)
|
||||
.button("Go to device").link("/devices/${entityId}")
|
||||
.button("Go to ${entityType:lowerCase}").link("/${entityType:lowerCase}s/${entityId}")
|
||||
.rule(DefaultRule.builder()
|
||||
.name("Device created")
|
||||
.triggerConfig(EntityActionNotificationRuleTriggerConfig.builder()
|
||||
@ -341,7 +341,7 @@ public class DefaultNotifications {
|
||||
public NotificationRule toRule(NotificationTemplateId templateId, NotificationTargetId... targets) {
|
||||
DefaultRule defaultRule = this.rule;
|
||||
NotificationRule rule = new NotificationRule();
|
||||
rule.setName(name);
|
||||
rule.setName(defaultRule.getName());
|
||||
rule.setTemplateId(templateId);
|
||||
rule.setTriggerType(defaultRule.getTriggerConfig().getTriggerType());
|
||||
rule.setTriggerConfig(defaultRule.getTriggerConfig());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user