Browse Source

UI: Add hint for used default alarm dashboard in mobile push notification

pull/10273/head^2
Vladyslav_Prykhodko 3 years ago
parent
commit
ff0ec47ae7
  1. 10
      ui-ngx/src/app/modules/home/pages/notification/template/configuration/notification-action-button-configuration.component.html
  2. 3
      ui-ngx/src/app/modules/home/pages/notification/template/configuration/notification-action-button-configuration.component.ts
  3. 1
      ui-ngx/src/app/modules/home/pages/notification/template/configuration/notification-template-configuration.component.html
  4. 14
      ui-ngx/src/app/modules/home/pages/notification/template/configuration/notification-template-configuration.component.ts
  5. 1
      ui-ngx/src/assets/locale/locale.constant-en_US.json

10
ui-ngx/src/app/modules/home/pages/notification/template/configuration/notification-action-button-configuration.component.html

@ -20,10 +20,12 @@
[expanded]="actionButtonConfigForm.get('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">
{{ actionTitle }}
</mat-slide-toggle>
<div tb-hint-tooltip-icon="{{ sliderHint }}" class="tb-form-row no-border no-padding">
<mat-slide-toggle class="mat-slide" formControlName="enabled" (click)="$event.stopPropagation()"
fxLayoutAlign="center">
{{ actionTitle }}
</mat-slide-toggle>
</div>
</mat-panel-title>
</mat-expansion-panel-header>
<ng-template matExpansionPanelContent class="tb-extension-panel">

3
ui-ngx/src/app/modules/home/pages/notification/template/configuration/notification-action-button-configuration.component.ts

@ -52,6 +52,9 @@ export class NotificationActionButtonConfigurationComponent implements ControlVa
@Input()
actionTitle: string;
@Input()
sliderHint: string;
private hideButtonTextValue = false;
get hideButtonText(): boolean {

1
ui-ngx/src/app/modules/home/pages/notification/template/configuration/notification-template-configuration.component.html

@ -124,6 +124,7 @@
<tb-notification-action-button-configuration
formControlName="onClick"
hideButtonText
[sliderHint]="hotificationTapActionHint"
actionTitle="{{ 'notification.notification-tap-action' | translate }}">
</tb-notification-action-button-configuration>
</div>

14
ui-ngx/src/app/modules/home/pages/notification/template/configuration/notification-template-configuration.component.ts

@ -36,6 +36,7 @@ import { takeUntil } from 'rxjs/operators';
import { Subject } from 'rxjs';
import { isDefinedAndNotNull } from '@core/utils';
import { coerceBoolean } from '@shared/decorators/coercion';
import { TranslateService } from '@ngx-translate/core';
@Component({
selector: 'tb-template-configuration',
@ -96,7 +97,8 @@ export class NotificationTemplateConfigurationComponent implements OnDestroy, Co
private propagateChange = (v: any) => { };
private readonly destroy$ = new Subject<void>();
constructor(private fb: FormBuilder) {
constructor(private fb: FormBuilder,
private translate: TranslateService) {
this.templateConfigurationForm = this.buildForm();
this.templateConfigurationForm.valueChanges.pipe(
takeUntil(this.destroy$)
@ -137,6 +139,16 @@ export class NotificationTemplateConfigurationComponent implements OnDestroy, Co
};
}
get hotificationTapActionHint(): string {
switch (this.notificationType) {
case NotificationType.ALARM:
case NotificationType.ALARM_ASSIGNMENT:
case NotificationType.ALARM_COMMENT:
return this.translate.instant('notification.notification-tap-action-hint');
}
return '';
}
private updateDisabledForms(){
Object.values(NotificationDeliveryMethod).forEach((method) => {
const form = this.templateConfigurationForm.get(method);

1
ui-ngx/src/assets/locale/locale.constant-en_US.json

@ -3349,6 +3349,7 @@
"notification": "Notification",
"notification-center": "Notification center",
"notification-tap-action": "Notification tap action",
"notification-tap-action-hint": "If not enabled, the default alarm dashboard will be used",
"notify": "notify",
"notify-again": "Notify again",
"notify-alarm-action": {

Loading…
Cancel
Save