This commit is contained in:
Artem Dzhereleiko 2025-07-28 17:55:30 +03:00
parent db1eb1682f
commit 7acf8de9f8
2 changed files with 6 additions and 13 deletions

View File

@ -63,7 +63,7 @@
<ng-template #searchNotEmpty>
<span>{{ 'notification.no-template-matching' | translate : {template: truncate.transform(searchText, true, 6, &apos;...&apos;)} }}</span>
<span *ngIf="allowCreate">
<a translate (click)="createTemplateBySearchText($event, searchText)">notification.create-new-template</a>
<a translate (click)="createTemplateByName($event, searchText)">notification.create-new-template</a>
</span>
</ng-template>
</div>

View File

@ -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
});
}
createTemplateBySearchText($event: Event, searchText: string) {
if ($event) {
$event.stopPropagation();
this.createTemplateByName($event);
}
createTemplateByName($event: Event, name?: string) {
$event?.stopPropagation();
this.openNotificationTemplateDialog({
isAdd: true,
predefinedType: this.notificationTypes,
name: searchText
name
});
}