diff --git a/ui-ngx/src/app/shared/components/notification/template-autocomplete.component.html b/ui-ngx/src/app/shared/components/notification/template-autocomplete.component.html index 446dc18e34..d712f11114 100644 --- a/ui-ngx/src/app/shared/components/notification/template-autocomplete.component.html +++ b/ui-ngx/src/app/shared/components/notification/template-autocomplete.component.html @@ -63,7 +63,7 @@ {{ 'notification.no-template-matching' | translate : {template: truncate.transform(searchText, true, 6, '...')} }} - notification.create-new-template + notification.create-new-template diff --git a/ui-ngx/src/app/shared/components/notification/template-autocomplete.component.ts b/ui-ngx/src/app/shared/components/notification/template-autocomplete.component.ts index 3bf066d43b..8054483027 100644 --- a/ui-ngx/src/app/shared/components/notification/template-autocomplete.component.ts +++ b/ui-ngx/src/app/shared/components/notification/template-autocomplete.component.ts @@ -212,23 +212,16 @@ export class TemplateAutocompleteComponent implements ControlValueAccessor, OnIn } createTemplate($event: Event, button: MatButton) { - if ($event) { - $event.stopPropagation(); - } + $event?.stopPropagation(); button._elementRef.nativeElement.blur(); - this.openNotificationTemplateDialog({ - isAdd: true, - predefinedType: this.notificationTypes - }); + this.createTemplateByName($event); } - createTemplateBySearchText($event: Event, searchText: string) { - if ($event) { - $event.stopPropagation(); - } + createTemplateByName($event: Event, name?: string) { + $event?.stopPropagation(); this.openNotificationTemplateDialog({ isAdd: true, predefinedType: this.notificationTypes, - name: searchText + name }); }