mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[NO-ISSUE] Fix e2e test (#4621)
* fix sso, change timeout, parallel * cange travis * move name apps in resources file * resources fix * resources fix * add sleep before search group * add possibility to extend duration of snack-bar message from configuration * fix unit test * fix unit test * remove timeout * change timeout * decrease message time * add lint main branch travis * reduce timeout * add new check application presence * change permission script fix search selector * fix travis conf * check app environment and upload the app if abbsent * fix cloud test * remove duplicate * restore ps test * restore resources file * fix e2e test * process with variables missing * test new conf travis * fix lint * fix spellcheck * remove duplicate module * fix ps module * fix travis conf * change check activiti env * add concept of processes in resources
This commit is contained in:
@@ -18,16 +18,20 @@
|
||||
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';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class NotificationService {
|
||||
|
||||
static DEFAULT_DURATION_MESSAGE: number = 5000;
|
||||
DEFAULT_DURATION_MESSAGE: number = 5000;
|
||||
|
||||
constructor(private snackBar: MatSnackBar,
|
||||
private translationService: TranslationService) {
|
||||
private translationService: TranslationService,
|
||||
private appConfigService: AppConfigService) {
|
||||
this.DEFAULT_DURATION_MESSAGE = this.appConfigService.get<number>(AppConfigValues.NOTIFY_DURATION) || this.DEFAULT_DURATION_MESSAGE;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -36,7 +40,10 @@ export class NotificationService {
|
||||
* @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 = NotificationService.DEFAULT_DURATION_MESSAGE): MatSnackBarRef<any> {
|
||||
openSnackMessage(message: string, config?: number | MatSnackBarConfig): MatSnackBarRef<any> {
|
||||
if (!config) {
|
||||
config = this.DEFAULT_DURATION_MESSAGE;
|
||||
}
|
||||
|
||||
const translatedMessage = this.translationService.instant(message);
|
||||
|
||||
@@ -56,7 +63,10 @@ export class NotificationService {
|
||||
* @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 = NotificationService.DEFAULT_DURATION_MESSAGE): MatSnackBarRef<any> {
|
||||
openSnackMessageAction(message: string, action: string, config?: number | MatSnackBarConfig): MatSnackBarRef<any> {
|
||||
if (!config) {
|
||||
config = this.DEFAULT_DURATION_MESSAGE;
|
||||
}
|
||||
|
||||
const translatedMessage = this.translationService.instant(message);
|
||||
|
||||
|
Reference in New Issue
Block a user