[ADF-4896] Merging AMA and ADF notifications for a better world

This commit is contained in:
Andras Popovics
2019-09-17 14:33:35 +01:00
committed by Denys Vuika
parent 922a85935e
commit 14800ce399
35 changed files with 276 additions and 217 deletions

View File

@@ -16,7 +16,7 @@
*/
import { LogService } from '../services/log.service';
import { NotificationService } from '../services/notification.service';
import { NotificationService } from '../notifications/services/notification.service';
import { AppConfigService } from '../app-config/app-config.service';
import { TestBed } from '@angular/core/testing';
import { ClipboardModule } from './clipboard.module';

View File

@@ -18,7 +18,7 @@
import { Injectable, Inject } from '@angular/core';
import { DOCUMENT } from '@angular/platform-browser';
import { LogService } from '../services/log.service';
import { NotificationService } from '../services/notification.service';
import { NotificationService } from '../notifications/services/notification.service';
@Injectable()
export class ClipboardService {

View File

@@ -41,7 +41,7 @@ import { CommentsModule } from './comments/comments.module';
import { ButtonsMenuModule } from './buttons-menu/buttons-menu.module';
import { TemplateModule } from './templates/template.module';
import { ClipboardModule } from './clipboard/clipboard.module';
import { NotificationHistoryModule } from './notification-history/notification-history.module';
import { NotificationHistoryModule } from './notifications/notification-history.module';
import { DirectiveModule } from './directives/directive.module';
import { DialogModule } from './dialogs/dialog.module';

View File

@@ -5,9 +5,9 @@
"CLAIM": "مطالبة",
"UNCLAIM": "تحرير",
"START PROCESS": "بدء العملية",
"NOTIFICATION_HISTORY": {
"NOTIFICATIONS": {
"NO_MESSAGE": "لا توجد رسائل",
"NOTIFICATIONS": "إعلامات",
"TITLE": "إعلامات",
"MARK_AS_READ": "وضع علامة على الكل كغير مقروءة"
},
"FORM": {

View File

@@ -5,9 +5,9 @@
"CLAIM": "Převzít",
"UNCLAIM": "Vzdát se",
"START PROCESS": "Zahájit proces",
"NOTIFICATION_HISTORY": {
"NOTIFICATIONS": {
"NO_MESSAGE": "Žádné zprávy",
"NOTIFICATIONS": "Upozornění",
"TITLE": "Upozornění",
"MARK_AS_READ": "Označit všechny jako přečtené"
},
"FORM": {

View File

@@ -5,9 +5,9 @@
"CLAIM": "Gør krav på",
"UNCLAIM": "Frigiv",
"START PROCESS": "Start proces",
"NOTIFICATION_HISTORY": {
"NOTIFICATIONS": {
"NO_MESSAGE": "Ingen meddelelser",
"NOTIFICATIONS": "Meddelelser",
"TITLE": "Meddelelser",
"MARK_AS_READ": "Markér alle som læst"
},
"FORM": {

View File

@@ -5,9 +5,9 @@
"CLAIM": "Beanspruchen",
"UNCLAIM": "Anspruch aufheben",
"START PROCESS": "Prozess starten",
"NOTIFICATION_HISTORY": {
"NOTIFICATIONS": {
"NO_MESSAGE": "Keine Nachrichten",
"NOTIFICATIONS": "Benachrichtigungen",
"TITLE": "Benachrichtigungen",
"MARK_AS_READ": "Alles als gelesen markieren"
},
"FORM": {

View File

@@ -5,10 +5,11 @@
"CLAIM": "CLAIM",
"UNCLAIM": "RELEASE",
"START PROCESS": "START PROCESS",
"NOTIFICATION_HISTORY": {
"NOTIFICATIONS": {
"NO_MESSAGE": "No messages",
"NOTIFICATIONS": "Notifications",
"MARK_AS_READ": "Mark all as read"
"TITLE": "Notifications",
"MARK_AS_READ": "Mark all as read",
"SYSTEM": "System"
},
"FORM": {
"START_FORM": {

View File

@@ -5,9 +5,9 @@
"CLAIM": "Pedir",
"UNCLAIM": "Liberar",
"START PROCESS": "Iniciar proceso",
"NOTIFICATION_HISTORY": {
"NOTIFICATIONS": {
"NO_MESSAGE": "No hay mensajes",
"NOTIFICATIONS": "Notificaciones",
"TITLE": "Notificaciones",
"MARK_AS_READ": "Marcar todo como leído"
},
"FORM": {

View File

@@ -5,9 +5,9 @@
"CLAIM": "Varaa",
"UNCLAIM": "Vapauta",
"START PROCESS": "Käynnistä prosessi",
"NOTIFICATION_HISTORY": {
"NOTIFICATIONS": {
"NO_MESSAGE": "Ei viestejä",
"NOTIFICATIONS": "Ilmoitukset",
"TITLE": "Ilmoitukset",
"MARK_AS_READ": "Merkitse kaikki luetuiksi"
},
"FORM": {

View File

@@ -5,9 +5,9 @@
"CLAIM": "S'attribuer",
"UNCLAIM": "Libérer",
"START PROCESS": "Démarrer le processus",
"NOTIFICATION_HISTORY": {
"NOTIFICATIONS": {
"NO_MESSAGE": "Aucun message",
"NOTIFICATIONS": "Notifications",
"TITLE": "Notifications",
"MARK_AS_READ": "Marquer tout comme lu"
},
"FORM": {

View File

@@ -5,9 +5,9 @@
"CLAIM": "Richiedi",
"UNCLAIM": "Restituisci",
"START PROCESS": "Avvia processo",
"NOTIFICATION_HISTORY": {
"NOTIFICATIONS": {
"NO_MESSAGE": "Nessun messaggio",
"NOTIFICATIONS": "Notifiche",
"TITLE": "Notifiche",
"MARK_AS_READ": "Seleziona tutti come già letti"
},
"FORM": {

View File

@@ -5,9 +5,9 @@
"CLAIM": "担当する",
"UNCLAIM": "担当解除",
"START PROCESS": "プロセスの開始",
"NOTIFICATION_HISTORY": {
"NOTIFICATIONS": {
"NO_MESSAGE": "メッセージなし",
"NOTIFICATIONS": "通知",
"TITLE": "通知",
"MARK_AS_READ": "すべて既読にする"
},
"FORM": {

View File

@@ -5,9 +5,9 @@
"CLAIM": "Krev",
"UNCLAIM": "Frigi",
"START PROCESS": "Start prosess",
"NOTIFICATION_HISTORY": {
"NOTIFICATIONS": {
"NO_MESSAGE": "Ingen meldinger",
"NOTIFICATIONS": "Varsler",
"TITLE": "Varsler",
"MARK_AS_READ": "Merk alle som lest"
},
"FORM": {

View File

@@ -5,9 +5,9 @@
"CLAIM": "Claimen",
"UNCLAIM": "Vrijgeven",
"START PROCESS": "Proces starten",
"NOTIFICATION_HISTORY": {
"NOTIFICATIONS": {
"NO_MESSAGE": "Geen berichten",
"NOTIFICATIONS": "Meldingen",
"TITLE": "Meldingen",
"MARK_AS_READ": "Alles markeren als gelezen"
},
"FORM": {

View File

@@ -5,9 +5,9 @@
"CLAIM": "Przejmij",
"UNCLAIM": "Zwolnij",
"START PROCESS": "Rozpocznij proces",
"NOTIFICATION_HISTORY": {
"NOTIFICATIONS": {
"NO_MESSAGE": "Brak komunikatów",
"NOTIFICATIONS": "Powiadomienia",
"TITLE": "Powiadomienia",
"MARK_AS_READ": "Oznacz wszystkie jako przeczytane"
},
"FORM": {

View File

@@ -5,9 +5,9 @@
"CLAIM": "Reivindicar",
"UNCLAIM": "Liberar",
"START PROCESS": "Iniciar processo",
"NOTIFICATION_HISTORY": {
"NOTIFICATIONS": {
"NO_MESSAGE": "Não há mensagens",
"NOTIFICATIONS": "Notificações",
"TITLE": "Notificações",
"MARK_AS_READ": "Marcar todas como lidas"
},
"FORM": {

View File

@@ -5,9 +5,9 @@
"CLAIM": "Принять",
"UNCLAIM": "Освободить",
"START PROCESS": "Начать процесс",
"NOTIFICATION_HISTORY": {
"NOTIFICATIONS": {
"NO_MESSAGE": "Нет сообщений",
"NOTIFICATIONS": "Оповещения",
"TITLE": "Оповещения",
"MARK_AS_READ": "Отметить все как прочитанное"
},
"FORM": {

View File

@@ -5,9 +5,9 @@
"CLAIM": "Anta",
"UNCLAIM": "Avsäga",
"START PROCESS": "Starta process",
"NOTIFICATION_HISTORY": {
"NOTIFICATIONS": {
"NO_MESSAGE": "Inga meddelanden",
"NOTIFICATIONS": "Aviseringar",
"TITLE": "Aviseringar",
"MARK_AS_READ": "Markera allt som läst"
},
"FORM": {

View File

@@ -5,9 +5,9 @@
"CLAIM": "申领",
"UNCLAIM": "释放",
"START PROCESS": "启动流程",
"NOTIFICATION_HISTORY": {
"NOTIFICATIONS": {
"NO_MESSAGE": "无消息",
"NOTIFICATIONS": "通知",
"TITLE": "通知",
"MARK_AS_READ": "全部标记为已读"
},
"FORM": {

View File

@@ -41,7 +41,7 @@ export * from './directives/index';
export * from './clipboard/index';
export * from './dialogs/index';
export * from './icon/index';
export * from './notification-history/index';
export * from './notifications/index';
export * from './utils/index';
export * from './interface/index';

View File

@@ -26,5 +26,4 @@ export * from './redirection.model';
export * from './pagination.model';
export * from './oauth-config.model';
export * from './request-pagination.model';
export * from './notification.model';
export * from './decimal-number.model';

View File

@@ -9,7 +9,7 @@
<div id="adf-notification-history-list">
<mat-list>
<mat-list-item>
<h6 mat-line>{{ 'NOTIFICATION_HISTORY.NOTIFICATIONS' | translate }}</h6>
<h6 mat-line>{{ 'NOTIFICATIONS.TITLE' | translate }}</h6>
</mat-list-item>
</mat-list>
<mat-divider></mat-divider>
@@ -17,14 +17,14 @@
<mat-list>
<mat-list-item *ngFor="let notification of notifications">
<mat-icon mat-list-icon>{{notification.info ? notification.info: 'info'}}</mat-icon>
<h4 mat-line>{{notification.message}}</h4>
<p mat-line> {{notification.dateTime | date}} </p>
<h4 *ngFor="let message of notification.messages" mat-line>{{ message }}</h4>
<p mat-line> {{notification.datetime | date}} </p>
</mat-list-item>
<mat-list-item *ngIf="isEmptyNotification()" id="adf-notification-history-component-no-message">
<h4 mat-line>{{ 'NOTIFICATION_HISTORY.NO_MESSAGE' | translate }}</h4>
<h4 mat-line>{{ 'NOTIFICATIONS.NO_MESSAGE' | translate }}</h4>
</mat-list-item>
<mat-action-list *ngIf="!isEmptyNotification()" id="adf-notification-history-mark-as-read">
<button mat-list-item (click)="markAsRead()">{{ 'NOTIFICATION_HISTORY.MARK_AS_READ' | translate }}
<button mat-list-item (click)="markAsRead()">{{ 'NOTIFICATIONS.MARK_AS_READ' | translate }}
</button>
</mat-action-list>
</mat-list>

View File

@@ -16,11 +16,11 @@
*/
import { async, ComponentFixture, inject, TestBed } from '@angular/core/testing';
import { NotificationService } from '../services';
import { setupTestBed } from '../testing/setupTestBed';
import { CoreTestingModule } from '../testing/core.testing.module';
import { setupTestBed } from '../../testing/setupTestBed';
import { CoreTestingModule } from '../../testing/core.testing.module';
import { NotificationHistoryComponent } from './notification-history.component';
import { OverlayContainer } from '@angular/cdk/overlay';
import { NotificationService } from '../services/notification.service';
describe('Notification History Component', () => {

View File

@@ -17,7 +17,7 @@
import { Component, Input, ViewChild, OnDestroy } from '@angular/core';
import { NotificationService } from '../services/notification.service';
import { NotificationModel } from '../models/notification.model';
import { Notification } from '../models/notification.model';
import { MatMenuTrigger } from '@angular/material';
import { takeUntil } from 'rxjs/operators';
import { Subject } from 'rxjs';
@@ -31,7 +31,7 @@ export class NotificationHistoryComponent implements OnDestroy {
onDestroy$ = new Subject<boolean>();
notifications: NotificationModel[] = [];
notifications: Notification[] = [];
@ViewChild(MatMenuTrigger)
trigger: MatMenuTrigger;
@@ -46,7 +46,7 @@ export class NotificationHistoryComponent implements OnDestroy {
constructor(
private notificationService: NotificationService) {
this.notificationService.messages
this.notificationService.notifications$
.pipe(takeUntil(this.onDestroy$))
.subscribe((message) => {
this.notifications.push(message);

View File

@@ -0,0 +1,54 @@
/*!
* @license
* Copyright 2019 Alfresco Software, Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {
NotificationInitiator,
NOTIFICATION_TYPE,
Notification
} from '../models/notification.model';
export const rootInitiator: NotificationInitiator = {
key: '*',
displayName: 'NOTIFICATIONS.SYSTEM'
};
export function info(messages: string | string[], initiator: NotificationInitiator = rootInitiator): Notification {
return {
type: NOTIFICATION_TYPE.INFO,
datetime: new Date(),
initiator,
messages: [].concat(messages)
};
}
export function warning(messages: string | string[], initiator: NotificationInitiator = rootInitiator): Notification {
return {
type: NOTIFICATION_TYPE.WARN,
datetime: new Date(),
initiator,
messages: [].concat(messages)
};
}
export function error(messages: string | string[], initiator: NotificationInitiator = rootInitiator): Notification {
return {
type: NOTIFICATION_TYPE.ERROR,
datetime: new Date(),
initiator,
messages: [].concat(messages)
};
}

View File

@@ -15,7 +15,21 @@
* limitations under the License.
*/
export interface NotificationModel {
dateTime: Date;
message: string;
export enum NOTIFICATION_TYPE {
INFO = 'info',
WARN = 'warning',
ERROR = 'error'
}
export interface NotificationInitiator {
key: string | Symbol;
displayName: string;
extra?: any;
}
export interface Notification {
type: NOTIFICATION_TYPE;
initiator: NotificationInitiator;
datetime: Date;
messages: string[];
}

View File

@@ -19,7 +19,7 @@ import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { MaterialModule } from '../material.module';
import { NotificationHistoryComponent } from './notification-history.component';
import { NotificationHistoryComponent } from './components/notification-history.component';
import { TranslateModule } from '@ngx-translate/core';
@NgModule({

View File

@@ -15,5 +15,8 @@
* limitations under the License.
*/
export * from './notification-history.component';
export * from './components/notification-history.component';
export * from './helpers/notification.factory';
export * from './models/notification.model';
export * from './services/notification.service';
export * from './notification-history.module';

View File

@@ -23,10 +23,10 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
import { MatSnackBar, MatSnackBarModule, MatSnackBarConfig } from '@angular/material';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { NotificationService } from './notification.service';
import { TranslationMock } from '../mock/translation.service.mock';
import { TranslationService } from './translation.service';
import { TranslationMock } from '../../mock/translation.service.mock';
import { TranslationService } from '../../services/translation.service';
import { HttpClientModule } from '@angular/common/http';
import { setupTestBed } from '../testing/setupTestBed';
import { setupTestBed } from '../../testing/setupTestBed';
@Component({
template: '',

View File

@@ -0,0 +1,129 @@
/*!
* @license
* Copyright 2019 Alfresco Software, Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Injectable } from '@angular/core';
import { MatSnackBar, MatSnackBarRef, MatSnackBarConfig } from '@angular/material';
import { TranslationService } from '../../services/translation.service';
import { AppConfigService, AppConfigValues } from '../../app-config/app-config.service';
import { Subject } from 'rxjs';
import { Notification } from '../models/notification.model';
import { info, warning, error } from '../helpers/notification.factory';
const INFO_SNACK_CLASS = 'adf-info-snackbar';
const WARN_SNACK_CLASS = 'adf-warning-snackbar';
const ERROR_SNACK_CLASS = 'adf-error-snackbar';
@Injectable({
providedIn: 'root'
})
export class NotificationService {
DEFAULT_DURATION_MESSAGE: number = 5000;
notifications$: Subject<Notification> = new Subject();
constructor(private snackBar: MatSnackBar,
private translationService: TranslationService,
private appConfigService: AppConfigService) {
this.DEFAULT_DURATION_MESSAGE = this.appConfigService.get<number>(AppConfigValues.NOTIFY_DURATION) || this.DEFAULT_DURATION_MESSAGE;
}
/**
* Opens a SnackBar notification to show a message.
* @param message The message (or resource key) to show.
* @param config Time before notification disappears after being shown or MatSnackBarConfig object
* @param interpolateArgs The interpolation parameters to add for the translation
* @returns Information/control object for the SnackBar
*/
openSnackMessage(message: string, config?: number | MatSnackBarConfig, interpolateArgs?: any): MatSnackBarRef<any> {
return this.dispatchNotification(message, null, config, interpolateArgs);
}
/**
* Opens a SnackBar notification with a message and a response button.
* @param message The message (or resource key) to show.
* @param action Caption for the response button
* @param config Time before notification disappears after being shown or MatSnackBarConfig object
* @param interpolateArgs The interpolation parameters to add for the translation
* @returns Information/control object for the SnackBar
*/
openSnackMessageAction(message: string, action: string, config?: number | MatSnackBarConfig, interpolateArgs?: any): MatSnackBarRef<any> {
return this.dispatchNotification(message, action, config, interpolateArgs);
}
/**
* Rase error message
* @param message Text message or translation key for the message.
* @param action Action name
* @param interpolateArgs The interpolation parameters to add for the translation
*/
showError(message: string, action?: string, interpolateArgs?: any): MatSnackBarRef<any> {
return this.dispatchNotification(message, action, { panelClass: ERROR_SNACK_CLASS }, interpolateArgs);
}
/**
* Rase info message
* @param message Text message or translation key for the message.
* @param action Action name
* @param interpolateArgs The interpolation parameters to add for the translation
*/
showInfo(message: string, action?: string, interpolateArgs?: any): MatSnackBarRef<any> {
return this.dispatchNotification(message, action, { panelClass: INFO_SNACK_CLASS }, interpolateArgs);
}
/**
* Rase warning message
* @param message Text message or translation key for the message.
* @param action Action name
* @param interpolateArgs The interpolation parameters to add for the translation
*/
showWarning(message: string, action?: string, interpolateArgs?: any): MatSnackBarRef<any> {
return this.dispatchNotification(message, action, { panelClass: WARN_SNACK_CLASS }, interpolateArgs);
}
/**
* dismiss the notification snackbar
*/
dismissSnackMessageAction() {
return this.snackBar.dismiss();
}
private dispatchNotification(message: string, action?: string, config?: number | MatSnackBarConfig, interpolateArgs?: any): MatSnackBarRef<any> {
const translatedMessage: string = this.translationService.instant(message, interpolateArgs);
const createNotification = this.getNotificationCreator(config);
this.notifications$.next(createNotification(translatedMessage));
return this.snackBar.open(translatedMessage, action, {
duration: (typeof config === 'number') ? config : this.DEFAULT_DURATION_MESSAGE,
panelClass: INFO_SNACK_CLASS,
...( (typeof config === 'object') ? config : {} )
});
}
private getNotificationCreator(config?: number | MatSnackBarConfig) {
const panelClass: string = config && (<MatSnackBarConfig> config).panelClass && (<MatSnackBarConfig> config).panelClass[0] || '';
switch (panelClass) {
case ERROR_SNACK_CLASS:
return error;
case WARN_SNACK_CLASS:
return warning;
default:
return info;
}
}
}

View File

@@ -1,140 +0,0 @@
/*!
* @license
* Copyright 2019 Alfresco Software, Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Injectable } from '@angular/core';
import { MatSnackBar, MatSnackBarRef, MatSnackBarConfig } from '@angular/material';
import { TranslationService } from './translation.service';
import { AppConfigService, AppConfigValues } from '../app-config/app-config.service';
import { Subject } from 'rxjs';
import { NotificationModel } from '../models/notification.model';
@Injectable({
providedIn: 'root'
})
export class NotificationService {
DEFAULT_DURATION_MESSAGE: number = 5000;
messages: Subject<NotificationModel> = new Subject();
constructor(private snackBar: MatSnackBar,
private translationService: TranslationService,
private appConfigService: AppConfigService) {
this.DEFAULT_DURATION_MESSAGE = this.appConfigService.get<number>(AppConfigValues.NOTIFY_DURATION) || this.DEFAULT_DURATION_MESSAGE;
}
/**
* Opens a SnackBar notification to show a message.
* @param message The message (or resource key) to show.
* @param translationArgs The interpolation parameters to add for the translation
* @param config Time before notification disappears after being shown or MatSnackBarConfig object
* @returns Information/control object for the SnackBar
*/
openSnackMessage(message: string, config?: number | MatSnackBarConfig, translationArgs?: any): MatSnackBarRef<any> {
const translatedMessage = this.translationService.instant(message, translationArgs);
return this.performOpening(translatedMessage, config);
}
private performOpening(translatedMessage: string, config?: number | MatSnackBarConfig): MatSnackBarRef<any> {
if (!config) {
config = this.DEFAULT_DURATION_MESSAGE;
}
if (typeof config === 'number') {
config = {
duration: config
};
}
this.messages.next({ message: translatedMessage, dateTime: new Date });
return this.snackBar.open(translatedMessage, null, config);
}
/**
* Opens a SnackBar notification with a message and a response button.
* @param message The message (or resource key) to show.
* @param action Caption for the response button
* @param config Time before notification disappears after being shown or MatSnackBarConfig object
* @returns Information/control object for the SnackBar
*/
openSnackMessageAction(message: string, action: string, config?: number | MatSnackBarConfig): MatSnackBarRef<any> {
if (!config) {
config = this.DEFAULT_DURATION_MESSAGE;
}
const translatedMessage = this.translationService.instant(message);
if (typeof config === 'number') {
config = {
duration: config
};
}
this.messages.next({ message: translatedMessage, dateTime: new Date });
return this.snackBar.open(translatedMessage, action, config);
}
/**
* dismiss the notification snackbar
*/
dismissSnackMessageAction() {
return this.snackBar.dismiss();
}
protected showMessage(message: string, panelClass: string, action?: string, interpolateArgs?: any): MatSnackBarRef<any> {
message = this.translationService.instant(message, interpolateArgs);
return this.openMessageBar(message, panelClass, action);
}
private openMessageBar(message: string, panelClass: string, action?: string): MatSnackBarRef<any> {
this.messages.next({ message: message, dateTime: new Date });
return this.snackBar.open(message, action, {
duration: this.DEFAULT_DURATION_MESSAGE,
panelClass
});
}
/**
* Rase error message
* @param message Text message or translation key for the message.
* @param action Action name
*/
showError(message: string, action?: string): MatSnackBarRef<any> {
return this.showMessage(message, 'adf-error-snackbar', action);
}
/**
* Rase info message
* @param message Text message or translation key for the message.
* @param action Action name
*/
showInfo(message: string, action?: string, interpolateArgs?: any): MatSnackBarRef<any> {
return this.showMessage(message, 'adf-info-snackbar', action, interpolateArgs);
}
/**
* Rase warning message
* @param message Text message or translation key for the message.
* @param action Action name
*/
showWarning(message: string, action?: string): MatSnackBarRef<any> {
return this.showMessage(message, 'adf-warning-snackbar', action);
}
}

View File

@@ -28,7 +28,6 @@ export * from './page-title.service';
export * from './storage.service';
export * from './cookie.service';
export * from './renditions.service';
export * from './notification.service';
export * from './log.service';
export * from './translation.service';
export * from './translate-loader.service';