UI: Add custom translate for notification message

This commit is contained in:
Artem Dzhereleiko 2023-05-19 11:16:12 +03:00
parent 733a2a03e4
commit 5509b93cc8
2 changed files with 7 additions and 2 deletions

View File

@ -28,8 +28,8 @@
</mat-icon>
</ng-template>
<div class="content" fxFlex>
<div class="title" [innerHTML]="(utils.customTranslation(notification.subject, notification.subject) | safe: 'html' )"></div>
<div class="message" [innerHTML]="(notification.text | safe: 'html' )"></div>
<div class="title" [innerHTML]="(title | safe: 'html' )"></div>
<div class="message" [innerHTML]="(message | safe: 'html' )"></div>
<button *ngIf="showButton" mat-stroked-button class="button" color="primary"
(click)="navigate($event)">
{{ buttonLabel }}

View File

@ -62,6 +62,9 @@ export class NotificationComponent implements OnInit {
currentDate = Date.now();
title = '';
message = '';
constructor(
public utils: UtilsService,
private router: Router
@ -72,6 +75,8 @@ export class NotificationComponent implements OnInit {
this.showIcon = this.notification.additionalConfig?.icon?.enabled;
this.showButton = this.notification.additionalConfig?.actionButtonConfig?.enabled;
this.hideMarkAsReadButton = this.notification.status === NotificationStatus.READ;
this.title = this.utils.customTranslation(this.notification.subject, this.notification.subject);
this.message = this.utils.customTranslation(this.notification.text, this.notification.text);
if (this.showButton) {
this.buttonLabel = this.utils.customTranslation(this.notification.additionalConfig.actionButtonConfig.text,
this.notification.additionalConfig.actionButtonConfig.text);