add spinner, mark form as dirty on email editor ready to avoid accidental clicking out of view, change button ui

This commit is contained in:
mchouliara 2024-10-02 16:17:38 +03:00
parent 7bda265eb1
commit c99a369663
3 changed files with 5 additions and 4 deletions

View File

@ -6,16 +6,16 @@
<app-navigation-breadcrumb /> <app-navigation-breadcrumb />
</div> </div>
<div class="col-auto"> <div class="col-auto">
<button mat-button class="rounded-btn secondary" (click)="cancel()" type="button">{{'NOTIFICATION-SERVICE.NOTIFICATION-TEMPLATE-EDITOR.ACTIONS.CANCEL' | translate}}</button> <button mat-button class="rounded-btn neutral" (click)="cancel()" type="button">{{'NOTIFICATION-SERVICE.NOTIFICATION-TEMPLATE-EDITOR.ACTIONS.CANCEL' | translate}}</button>
</div> </div>
<div class="col-auto" *ngIf="canDelete"> <div class="col-auto" *ngIf="canDelete">
<button mat-button class="rounded-btn secondary" type="button" (click)="delete()"> <button mat-button class="rounded-btn delete" type="button" (click)="delete()">
<mat-icon>delete</mat-icon> <mat-icon>delete</mat-icon>
{{'NOTIFICATION-SERVICE.NOTIFICATION-TEMPLATE-EDITOR.ACTIONS.DELETE' | translate}} {{'NOTIFICATION-SERVICE.NOTIFICATION-TEMPLATE-EDITOR.ACTIONS.DELETE' | translate}}
</button> </button>
</div> </div>
<div class="col-auto" *ngIf="canSave"> <div class="col-auto" *ngIf="canSave">
<button mat-button class="rounded-btn secondary" (click)="attemptSave()" [disabled]="!editorReady"> <button mat-button class="rounded-btn primary" (click)="attemptSave()" [disabled]="!editorReady">
<mat-icon>save</mat-icon> <mat-icon>save</mat-icon>
{{'NOTIFICATION-SERVICE.NOTIFICATION-TEMPLATE-EDITOR.ACTIONS.SAVE' | translate}} {{'NOTIFICATION-SERVICE.NOTIFICATION-TEMPLATE-EDITOR.ACTIONS.SAVE' | translate}}
</button> </button>

View File

@ -335,6 +335,7 @@ export class NotificationTemplateEditorComponent extends BaseEditor<Notification
const design = JSON.parse(body)?.design as JSONTemplate; const design = JSON.parse(body)?.design as JSONTemplate;
this.emailEditor.loadDesign(design); this.emailEditor.loadDesign(design);
} }
this.formGroup.markAsDirty();
this.editorReady = true; this.editorReady = true;
} }

View File

@ -39,7 +39,7 @@ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
EditorModule, EditorModule,
NotificationServiceFormattingModule, NotificationServiceFormattingModule,
EmailEditorModule, EmailEditorModule,
MatProgressSpinnerModule MatProgressSpinnerModule,
], ],
declarations: [ declarations: [
NotificationTemplateEditorComponent, NotificationTemplateEditorComponent,