UI: Optimize filter allow notification type
This commit is contained in:
parent
25e1d73ca0
commit
eda7cf3619
@ -442,11 +442,16 @@ export class RuleNotificationDialogComponent extends
|
||||
}
|
||||
|
||||
private allowTriggerTypes(): TriggerType[] {
|
||||
const sysAdminAllowTriggerTypes = new Set([
|
||||
TriggerType.ENTITIES_LIMIT,
|
||||
TriggerType.API_USAGE_LIMIT,
|
||||
TriggerType.NEW_PLATFORM_VERSION,
|
||||
]);
|
||||
|
||||
if (this.isSysAdmin()) {
|
||||
return [TriggerType.ENTITIES_LIMIT, TriggerType.API_USAGE_LIMIT, TriggerType.NEW_PLATFORM_VERSION];
|
||||
return Array.from(sysAdminAllowTriggerTypes);
|
||||
}
|
||||
return Object.values(TriggerType).filter(type => type !== TriggerType.ENTITIES_LIMIT && type !== TriggerType.API_USAGE_LIMIT
|
||||
&& type !== TriggerType.NEW_PLATFORM_VERSION);
|
||||
return Object.values(TriggerType).filter(type => !sysAdminAllowTriggerTypes.has(type));
|
||||
}
|
||||
|
||||
get allowEntityTypeForEntityAction(): EntityType[] {
|
||||
|
||||
@ -177,11 +177,15 @@ export class TemplateNotificationDialogComponent
|
||||
}
|
||||
|
||||
private allowNotificationType(): NotificationType[] {
|
||||
const sysAdminAllowNotificationTypes = new Set([
|
||||
NotificationType.ENTITIES_LIMIT,
|
||||
NotificationType.API_USAGE_LIMIT,
|
||||
NotificationType.NEW_PLATFORM_VERSION,
|
||||
]);
|
||||
|
||||
if (this.isSysAdmin()) {
|
||||
return [NotificationType.GENERAL, NotificationType.ENTITIES_LIMIT, NotificationType.API_USAGE_LIMIT, NotificationType.NEW_PLATFORM_VERSION];
|
||||
return [NotificationType.GENERAL, ...sysAdminAllowNotificationTypes];
|
||||
}
|
||||
return Object.values(NotificationType)
|
||||
.filter(type => type !== NotificationType.ENTITIES_LIMIT && type !== NotificationType.API_USAGE_LIMIT
|
||||
&& type !== NotificationType.NEW_PLATFORM_VERSION);
|
||||
return Object.values(NotificationType).filter(type => !sysAdminAllowNotificationTypes.has(type));
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user