|
|
@ -27,7 +27,6 @@ |
|
|
</mat-toolbar> |
|
|
</mat-toolbar> |
|
|
<mat-progress-bar color="warn" mode="indeterminate" *ngIf="isLoading$ | async"> |
|
|
<mat-progress-bar color="warn" mode="indeterminate" *ngIf="isLoading$ | async"> |
|
|
</mat-progress-bar> |
|
|
</mat-progress-bar> |
|
|
<div style="height: 4px;" *ngIf="!(isLoading$ | async)"></div> |
|
|
|
|
|
<div mat-dialog-content> |
|
|
<div mat-dialog-content> |
|
|
<mat-horizontal-stepper linear #createNotification |
|
|
<mat-horizontal-stepper linear #createNotification |
|
|
[labelPosition]="(stepperLabelPosition | async)" |
|
|
[labelPosition]="(stepperLabelPosition | async)" |
|
|
@ -40,12 +39,11 @@ |
|
|
<ng-template matStepLabel>{{ 'notification.compose' | translate }}</ng-template> |
|
|
<ng-template matStepLabel>{{ 'notification.compose' | translate }}</ng-template> |
|
|
<form [formGroup]="notificationRequestForm"> |
|
|
<form [formGroup]="notificationRequestForm"> |
|
|
<div fxLayout="row" fxLayoutAlign="center"> |
|
|
<div fxLayout="row" fxLayoutAlign="center"> |
|
|
<mat-button-toggle-group class="tb-notification-use-template-toggle-group" |
|
|
<tb-toggle-select class="tb-notification-use-template-toggle-group" appearance="fill" |
|
|
style="width: 320px;" |
|
|
formControlName="useTemplate"> |
|
|
formControlName="useTemplate"> |
|
|
<tb-toggle-option [value]="false">{{ 'notification.start-from-scratch' | translate }}</tb-toggle-option> |
|
|
<mat-button-toggle fxFlex [value]=false>{{ 'notification.start-from-scratch' | translate }}</mat-button-toggle> |
|
|
<tb-toggle-option [value]="true">{{ 'notification.use-template' | translate }}</tb-toggle-option> |
|
|
<mat-button-toggle fxFlex [value]=true>{{ 'notification.use-template' | translate }}</mat-button-toggle> |
|
|
</tb-toggle-select> |
|
|
</mat-button-toggle-group> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
<div *ngIf="notificationRequestForm.get('useTemplate').value; else scratchTemplate"> |
|
|
<div *ngIf="notificationRequestForm.get('useTemplate').value; else scratchTemplate"> |
|
|
<tb-template-autocomplete |
|
|
<tb-template-autocomplete |
|
|
@ -172,73 +170,82 @@ |
|
|
{{ 'notification.message-required' | translate }} |
|
|
{{ 'notification.message-required' | translate }} |
|
|
</mat-error> |
|
|
</mat-error> |
|
|
</mat-form-field> |
|
|
</mat-form-field> |
|
|
<section formGroupName="additionalConfig"> |
|
|
<section formGroupName="additionalConfig" class="tb-form-panel no-padding no-border"> |
|
|
<section formGroupName="icon" class="additional-config-group"> |
|
|
<div class="tb-form-row space-between" formGroupName="icon"> |
|
|
<mat-slide-toggle formControlName="enabled" class="toggle"> |
|
|
<mat-slide-toggle formControlName="enabled" class="mat-slide"> |
|
|
{{ 'icon.icon' | translate }} |
|
|
{{ 'icon.icon' | translate }} |
|
|
</mat-slide-toggle> |
|
|
</mat-slide-toggle> |
|
|
<div *ngIf="webTemplateForm.get('additionalConfig.icon.enabled').value" |
|
|
<div fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="8px"> |
|
|
fxLayout="row" fxLayoutGap.gt-xs="8px" fxLayout.xs="column"> |
|
|
<tb-material-icon-select asBoxInput |
|
|
<tb-material-icon-select formControlName="icon" required fxFlex> |
|
|
[color]="webTemplateForm.get('additionalConfig.icon.color').value" |
|
|
|
|
|
formControlName="icon"> |
|
|
</tb-material-icon-select> |
|
|
</tb-material-icon-select> |
|
|
<tb-color-input formControlName="color" fxFlex> |
|
|
<tb-color-input asBoxInput |
|
|
|
|
|
formControlName="color"> |
|
|
</tb-color-input> |
|
|
</tb-color-input> |
|
|
</div> |
|
|
</div> |
|
|
</section> |
|
|
</div> |
|
|
<section formGroupName="actionButtonConfig" class="additional-config-group"> |
|
|
<div class="tb-form-panel tb-slide-toggle stroked" formGroupName="actionButtonConfig"> |
|
|
<mat-slide-toggle formControlName="enabled" class="toggle"> |
|
|
<mat-expansion-panel class="tb-settings" [expanded]="webTemplateForm.get('additionalConfig.actionButtonConfig.enabled').value"> |
|
|
{{ 'notification.action-button' | translate }} |
|
|
<mat-expansion-panel-header fxLayout="row wrap" class="fill-width"> |
|
|
</mat-slide-toggle> |
|
|
<mat-panel-title fxFlex="60"> |
|
|
<div *ngIf="webTemplateForm.get('additionalConfig.actionButtonConfig.enabled').value"> |
|
|
<mat-slide-toggle class="mat-slide" formControlName="enabled" (click)="$event.stopPropagation()" |
|
|
<div fxLayout="row" fxLayoutGap.gt-xs="8px" fxLayout.xs="column"> |
|
|
fxLayoutAlign="center"> |
|
|
<mat-form-field class="mat-block" fxFlex> |
|
|
{{ 'notification.action-button' | translate }} |
|
|
<mat-label translate>notification.button-text</mat-label> |
|
|
</mat-slide-toggle> |
|
|
<input matInput formControlName="text" required> |
|
|
</mat-panel-title> |
|
|
<mat-error *ngIf="webTemplateForm.get('additionalConfig.actionButtonConfig.text').hasError('required')"> |
|
|
</mat-expansion-panel-header> |
|
|
{{ 'notification.button-text-required' | translate }} |
|
|
<ng-template matExpansionPanelContent class="tb-extension-panel"> |
|
|
</mat-error> |
|
|
<div fxLayout="row" fxLayoutGap.gt-xs="8px" fxLayout.xs="column"> |
|
|
<mat-error *ngIf="webTemplateForm.get('additionalConfig.actionButtonConfig.text').hasError('maxlength')"> |
|
|
<mat-form-field class="mat-block" fxFlex> |
|
|
{{ 'notification.button-text-max-length' | translate : |
|
|
<mat-label translate>notification.button-text</mat-label> |
|
|
{length: webTemplateForm.get('additionalConfig.actionButtonConfig.text').getError('maxlength').requiredLength} |
|
|
<input matInput formControlName="text" required> |
|
|
}} |
|
|
<mat-error *ngIf="webTemplateForm.get('additionalConfig.actionButtonConfig.text').hasError('required')"> |
|
|
</mat-error> |
|
|
{{ 'notification.button-text-required' | translate }} |
|
|
</mat-form-field> |
|
|
</mat-error> |
|
|
</div> |
|
|
<mat-error *ngIf="webTemplateForm.get('additionalConfig.actionButtonConfig.text').hasError('maxlength')"> |
|
|
<div fxLayout="row" fxLayoutGap.gt-xs="8px" fxLayout.xs="column"> |
|
|
{{ 'notification.button-text-max-length' | translate : |
|
|
<mat-form-field fxFlex="30" fxFlex.xs="100"> |
|
|
{length: webTemplateForm.get('additionalConfig.actionButtonConfig.text').getError('maxlength').requiredLength} |
|
|
<mat-label translate>notification.action-type</mat-label> |
|
|
}} |
|
|
<mat-select formControlName="linkType"> |
|
|
</mat-error> |
|
|
<mat-option *ngFor="let actionButtonLinkType of actionButtonLinkTypes" [value]="actionButtonLinkType"> |
|
|
</mat-form-field> |
|
|
{{ actionButtonLinkTypeTranslateMap.get(actionButtonLinkType) | translate }} |
|
|
</div> |
|
|
</mat-option> |
|
|
<div fxLayout="row" fxLayoutGap.gt-xs="8px" fxLayout.xs="column"> |
|
|
</mat-select> |
|
|
<mat-form-field fxFlex="30" fxFlex.xs="100"> |
|
|
</mat-form-field> |
|
|
<mat-label translate>notification.action-type</mat-label> |
|
|
<mat-form-field fxFlex |
|
|
<mat-select formControlName="linkType"> |
|
|
*ngIf="webTemplateForm.get('additionalConfig.actionButtonConfig.linkType').value === actionButtonLinkType.LINK; else dashboardSelector"> |
|
|
<mat-option *ngFor="let actionButtonLinkType of actionButtonLinkTypes" [value]="actionButtonLinkType"> |
|
|
<mat-label translate>notification.link</mat-label> |
|
|
{{ actionButtonLinkTypeTranslateMap.get(actionButtonLinkType) | translate }} |
|
|
<input matInput formControlName="link" required> |
|
|
</mat-option> |
|
|
<mat-error *ngIf="webTemplateForm.get('additionalConfig.actionButtonConfig.link').hasError('required')"> |
|
|
</mat-select> |
|
|
{{ 'notification.link-required' | translate }} |
|
|
</mat-form-field> |
|
|
</mat-error> |
|
|
<mat-form-field fxFlex |
|
|
</mat-form-field> |
|
|
*ngIf="webTemplateForm.get('additionalConfig.actionButtonConfig.linkType').value === actionButtonLinkType.LINK; else dashboardSelector"> |
|
|
<ng-template #dashboardSelector> |
|
|
<mat-label translate>notification.link</mat-label> |
|
|
<tb-dashboard-autocomplete |
|
|
<input matInput formControlName="link" required> |
|
|
fxFlex="35" fxFlex.xs="100" |
|
|
<mat-error *ngIf="webTemplateForm.get('additionalConfig.actionButtonConfig.link').hasError('required')"> |
|
|
required |
|
|
{{ 'notification.link-required' | translate }} |
|
|
formControlName="dashboardId"> |
|
|
</mat-error> |
|
|
</tb-dashboard-autocomplete> |
|
|
</mat-form-field> |
|
|
<tb-dashboard-state-autocomplete fxFlex="35" fxFlex.xs="100" |
|
|
<ng-template #dashboardSelector> |
|
|
[dashboardId]="webTemplateForm.get('additionalConfig.actionButtonConfig.dashboardId').value" |
|
|
<tb-dashboard-autocomplete |
|
|
formControlName="dashboardState"> |
|
|
fxFlex="35" fxFlex.xs="100" |
|
|
</tb-dashboard-state-autocomplete> |
|
|
required |
|
|
</ng-template> |
|
|
formControlName="dashboardId"> |
|
|
</div> |
|
|
</tb-dashboard-autocomplete> |
|
|
<mat-slide-toggle formControlName="setEntityIdInState" class="toggle" |
|
|
<tb-dashboard-state-autocomplete fxFlex="35" fxFlex.xs="100" |
|
|
*ngIf="webTemplateForm.get('additionalConfig.actionButtonConfig.linkType').value === actionButtonLinkType.DASHBOARD"> |
|
|
[dashboardId]="webTemplateForm.get('additionalConfig.actionButtonConfig.dashboardId').value" |
|
|
{{ 'notification.set-entity-from-notification' | translate }} |
|
|
formControlName="dashboardState"> |
|
|
</mat-slide-toggle> |
|
|
</tb-dashboard-state-autocomplete> |
|
|
</div> |
|
|
</ng-template> |
|
|
</section> |
|
|
</div> |
|
|
|
|
|
<mat-slide-toggle formControlName="setEntityIdInState" class="toggle" |
|
|
|
|
|
*ngIf="webTemplateForm.get('additionalConfig.actionButtonConfig.linkType').value === actionButtonLinkType.DASHBOARD"> |
|
|
|
|
|
{{ 'notification.set-entity-from-notification' | translate }} |
|
|
|
|
|
</mat-slide-toggle> |
|
|
|
|
|
</ng-template> |
|
|
|
|
|
</mat-expansion-panel> |
|
|
|
|
|
</div> |
|
|
</section> |
|
|
</section> |
|
|
</form> |
|
|
</form> |
|
|
</mat-step> |
|
|
</mat-step> |
|
|
@ -333,6 +340,78 @@ |
|
|
</mat-form-field> |
|
|
</mat-form-field> |
|
|
</form> |
|
|
</form> |
|
|
</mat-step> |
|
|
</mat-step> |
|
|
|
|
|
<mat-step *ngIf="!notificationRequestForm.get('useTemplate').value && |
|
|
|
|
|
notificationRequestForm.get('template.configuration.deliveryMethodsTemplates.MICROSOFT_TEAMS.enabled').value" |
|
|
|
|
|
[stepControl]="microsoftTeamsTemplateForm"> |
|
|
|
|
|
<ng-template matStepLabel>{{ 'notification.delivery-method.microsoft-teams' | translate }}</ng-template> |
|
|
|
|
|
<div class="tb-hint-available-params mat-body-2"> |
|
|
|
|
|
<span class="content">{{ 'notification.input-fields-support-templatization' | translate}}</span> |
|
|
|
|
|
<span tb-help-popup="{{ notificationTemplateTypeTranslateMap.get(templateNotificationForm.get('notificationType').value).helpId }}" |
|
|
|
|
|
tb-help-popup-placement="bottom" |
|
|
|
|
|
trigger-style="letter-spacing:0.25px" |
|
|
|
|
|
[tb-help-popup-style]="{maxWidth: '800px'}" |
|
|
|
|
|
trigger-text="{{ 'notification.see-documentation' | translate }}"></span> |
|
|
|
|
|
</div> |
|
|
|
|
|
<form [formGroup]="microsoftTeamsTemplateForm"> |
|
|
|
|
|
<mat-form-field class="mat-block"> |
|
|
|
|
|
<mat-label translate>notification.subject</mat-label> |
|
|
|
|
|
<input matInput formControlName="subject"> |
|
|
|
|
|
</mat-form-field> |
|
|
|
|
|
<mat-form-field class="mat-block"> |
|
|
|
|
|
<mat-label translate>notification.message</mat-label> |
|
|
|
|
|
<textarea matInput |
|
|
|
|
|
cdkTextareaAutosize |
|
|
|
|
|
cols="1" |
|
|
|
|
|
cdkAutosizeMinRows="1" |
|
|
|
|
|
formControlName="body"> |
|
|
|
|
|
</textarea> |
|
|
|
|
|
<mat-error *ngIf="microsoftTeamsTemplateForm.get('body').hasError('required')"> |
|
|
|
|
|
{{ 'notification.message-required' | translate }} |
|
|
|
|
|
</mat-error> |
|
|
|
|
|
</mat-form-field> |
|
|
|
|
|
<div class="tb-form-panel no-padding no-border"> |
|
|
|
|
|
<div class="tb-form-row space-between"> |
|
|
|
|
|
<div translate>notification.theme-color</div> |
|
|
|
|
|
<tb-color-input asBoxInput formControlName="themeColor"></tb-color-input> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="tb-form-panel tb-slide-toggle stroked" formGroupName="button"> |
|
|
|
|
|
<mat-expansion-panel class="tb-settings" [expanded]="microsoftTeamsTemplateForm.get('button.enabled').value"> |
|
|
|
|
|
<mat-expansion-panel-header fxLayout="row wrap" class="fill-width"> |
|
|
|
|
|
<mat-panel-title fxFlex="60"> |
|
|
|
|
|
<mat-slide-toggle class="mat-slide" formControlName="enabled" (click)="$event.stopPropagation()" |
|
|
|
|
|
fxLayoutAlign="center"> |
|
|
|
|
|
{{ 'notification.action-button' | translate }} |
|
|
|
|
|
</mat-slide-toggle> |
|
|
|
|
|
</mat-panel-title> |
|
|
|
|
|
</mat-expansion-panel-header> |
|
|
|
|
|
<ng-template matExpansionPanelContent> |
|
|
|
|
|
<div fxLayout="row" fxLayoutGap.gt-xs="8px" fxLayout.xs="column"> |
|
|
|
|
|
<mat-form-field class="mat-block" fxFlex> |
|
|
|
|
|
<mat-label translate>notification.button-text</mat-label> |
|
|
|
|
|
<input matInput formControlName="name" required> |
|
|
|
|
|
<mat-error *ngIf="microsoftTeamsTemplateForm.get('button.name').hasError('required')"> |
|
|
|
|
|
{{ 'notification.button-text-required' | translate }} |
|
|
|
|
|
</mat-error> |
|
|
|
|
|
<mat-error *ngIf="microsoftTeamsTemplateForm.get('button.name').hasError('maxlength')"> |
|
|
|
|
|
{{ 'notification.button-text-max-length' | translate : |
|
|
|
|
|
{length: microsoftTeamsTemplateForm.get('button.name').getError('maxlength').requiredLength} |
|
|
|
|
|
}} |
|
|
|
|
|
</mat-error> |
|
|
|
|
|
</mat-form-field> |
|
|
|
|
|
<mat-form-field fxFlex> |
|
|
|
|
|
<mat-label translate>notification.link</mat-label> |
|
|
|
|
|
<input matInput formControlName="uri" required> |
|
|
|
|
|
<mat-error *ngIf="microsoftTeamsTemplateForm.get('button.uri').hasError('required')"> |
|
|
|
|
|
{{ 'notification.link-required' | translate }} |
|
|
|
|
|
</mat-error> |
|
|
|
|
|
</mat-form-field> |
|
|
|
|
|
</div> |
|
|
|
|
|
</ng-template> |
|
|
|
|
|
</mat-expansion-panel> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
</form> |
|
|
|
|
|
</mat-step> |
|
|
<mat-step> |
|
|
<mat-step> |
|
|
<ng-template matStepLabel>{{ 'notification.review' | translate }}</ng-template> |
|
|
<ng-template matStepLabel>{{ 'notification.review' | translate }}</ng-template> |
|
|
<mat-progress-spinner color="warn" mode="indeterminate" |
|
|
<mat-progress-spinner color="warn" mode="indeterminate" |
|
|
@ -377,6 +456,16 @@ |
|
|
{{ preview.processedTemplates.SLACK.body }} |
|
|
{{ preview.processedTemplates.SLACK.body }} |
|
|
</div> |
|
|
</div> |
|
|
</section> |
|
|
</section> |
|
|
|
|
|
<section class="preview-group notification" *ngIf="preview.processedTemplates.MICROSOFT_TEAMS?.enabled"> |
|
|
|
|
|
<div fxLayout="row" fxLayoutGap="8px" fxLayoutAlign="start center"> |
|
|
|
|
|
<mat-icon class="tb-mat-18" svgIcon="mdi:microsoft-teams"></mat-icon> |
|
|
|
|
|
<div class="group-title" translate>notification.delivery-method.microsoft-teams-preview</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="notification-content mini"> |
|
|
|
|
|
<div class="subject">{{ preview.processedTemplates.MICROSOFT_TEAMS.subject }}</div> |
|
|
|
|
|
{{ preview.processedTemplates.MICROSOFT_TEAMS.body }} |
|
|
|
|
|
</div> |
|
|
|
|
|
</section> |
|
|
<section class="preview-group"> |
|
|
<section class="preview-group"> |
|
|
<div fxLayout="row" fxLayoutGap="8px" fxLayoutAlign="start center"> |
|
|
<div fxLayout="row" fxLayoutGap="8px" fxLayoutAlign="start center"> |
|
|
<mat-icon class="tb-mat-18">supervisor_account</mat-icon> |
|
|
<mat-icon class="tb-mat-18">supervisor_account</mat-icon> |
|
|
@ -399,7 +488,7 @@ |
|
|
</mat-horizontal-stepper> |
|
|
</mat-horizontal-stepper> |
|
|
</div> |
|
|
</div> |
|
|
<mat-divider></mat-divider> |
|
|
<mat-divider></mat-divider> |
|
|
<div mat-dialog-actions fxLayout="row"> |
|
|
<div mat-dialog-actions class="tb-dialog-actions"> |
|
|
<button mat-stroked-button *ngIf="selectedIndex > 0" |
|
|
<button mat-stroked-button *ngIf="selectedIndex > 0" |
|
|
(click)="backStep()">{{ 'action.back' | translate }}</button> |
|
|
(click)="backStep()">{{ 'action.back' | translate }}</button> |
|
|
<span fxFlex></span> |
|
|
<span fxFlex></span> |
|
|
|