UI: Fixed size notification action button; added validation button text length

This commit is contained in:
Vladyslav_Prykhodko 2023-05-08 11:20:37 +03:00
parent 81b4459687
commit ffa481d780
5 changed files with 15 additions and 2 deletions

View File

@ -198,6 +198,11 @@
<mat-error *ngIf="webTemplateForm.get('additionalConfig.actionButtonConfig.text').hasError('required')"> <mat-error *ngIf="webTemplateForm.get('additionalConfig.actionButtonConfig.text').hasError('required')">
{{ 'notification.button-text-required' | translate }} {{ 'notification.button-text-required' | translate }}
</mat-error> </mat-error>
<mat-error *ngIf="webTemplateForm.get('additionalConfig.actionButtonConfig.text').hasError('maxlength')">
{{ 'notification.button-text-max-length' | translate :
{length: webTemplateForm.get('additionalConfig.actionButtonConfig.text').getError('maxlength').requiredLength}
}}
</mat-error>
</mat-form-field> </mat-form-field>
</div> </div>
<div fxLayout="row" fxLayoutGap.gt-xs="8px" fxLayout.xs="column"> <div fxLayout="row" fxLayoutGap.gt-xs="8px" fxLayout.xs="column">

View File

@ -99,7 +99,7 @@ export abstract class TemplateConfiguration<T, R = any> extends DialogComponent<
}), }),
actionButtonConfig: this.fb.group({ actionButtonConfig: this.fb.group({
enabled: [false], enabled: [false],
text: [{value: '', disabled: true}, Validators.required], text: [{value: '', disabled: true}, [Validators.required, Validators.maxLength(50)]],
linkType: [ActionButtonLinkType.LINK], linkType: [ActionButtonLinkType.LINK],
link: [{value: '', disabled: true}, Validators.required], link: [{value: '', disabled: true}, Validators.required],
dashboardId: [{value: null, disabled: true}, Validators.required], dashboardId: [{value: null, disabled: true}, Validators.required],

View File

@ -126,6 +126,11 @@
<mat-error *ngIf="webTemplateForm.get('additionalConfig.actionButtonConfig.text').hasError('required')"> <mat-error *ngIf="webTemplateForm.get('additionalConfig.actionButtonConfig.text').hasError('required')">
{{ 'notification.button-text-required' | translate }} {{ 'notification.button-text-required' | translate }}
</mat-error> </mat-error>
<mat-error *ngIf="webTemplateForm.get('additionalConfig.actionButtonConfig.text').hasError('maxlength')">
{{ 'notification.button-text-max-length' | translate :
{length: webTemplateForm.get('additionalConfig.actionButtonConfig.text').getError('maxlength').requiredLength}
}}
</mat-error>
</mat-form-field> </mat-form-field>
</div> </div>
<div fxLayout="row" fxLayoutGap.gt-xs="8px" fxLayout.xs="column"> <div fxLayout="row" fxLayoutGap.gt-xs="8px" fxLayout.xs="column">
@ -189,7 +194,7 @@
<mat-label class="tb-title tb-required" <mat-label class="tb-title tb-required"
[ngClass]="{'tb-error': (emailStep.interacted || emailTemplateForm.get('body').dirty) && emailTemplateForm.get('body').hasError('required')}" [ngClass]="{'tb-error': (emailStep.interacted || emailTemplateForm.get('body').dirty) && emailTemplateForm.get('body').hasError('required')}"
translate>notification.message</mat-label> translate>notification.message</mat-label>
<editor [init]="tinyMceOptions" matInput formControlName="body"></editor> <editor [init]="tinyMceOptions" formControlName="body"></editor>
<mat-error class="tb-mat-error" <mat-error class="tb-mat-error"
*ngIf="(emailStep.interacted || emailTemplateForm.get('body').dirty) && emailTemplateForm.get('body').hasError('required')"> *ngIf="(emailStep.interacted || emailTemplateForm.get('body').dirty) && emailTemplateForm.get('body').hasError('required')">
{{ 'notification.message-required' | translate }} {{ 'notification.message-required' | translate }}

View File

@ -44,6 +44,8 @@
.button { .button {
margin-top: 12px; margin-top: 12px;
border-color: initial; border-color: initial;
height: fit-content;
line-height: 2;
} }
} }

View File

@ -2808,6 +2808,7 @@
"basic-settings": "Basic settings", "basic-settings": "Basic settings",
"button-text": "Button text", "button-text": "Button text",
"button-text-required": "Button text is required", "button-text-required": "Button text is required",
"button-text-max-length": "Button text should be less than or equal to {{ length }} characters",
"compose": "Compose", "compose": "Compose",
"conversation": "Conversation", "conversation": "Conversation",
"conversation-required": "Conversation is required", "conversation-required": "Conversation is required",