mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
[ACS-3640] Reverting reverted changes for a 11 y aca 881740 snackbar messages disappear without option to adjust timing (#2785)
* ACS-3640 Increasing time of autoclosing snackbar and adding X icon to close snackbar * ACS-3640 Fix lint issues * ACS-3640 Addressing PR comments * ACS-3640 Fix lint issue * ACS-3640 Added aria label for action icon * ACS-3640 Fixed one left file * ACS-3640 Fixed lint issues * ACS-3640 Correction for e2e * ACS-3640 Reverting reverted corrections for e2e * ACS-3640 Use data automation id * ACS-3640 Update ADF version
This commit is contained in:
@@ -35,7 +35,7 @@ export interface SnackbarAction extends Action {
|
||||
payload: string;
|
||||
params?: any;
|
||||
userAction?: SnackbarUserAction;
|
||||
duration: number;
|
||||
duration?: number;
|
||||
}
|
||||
|
||||
export class SnackbarUserAction {
|
||||
@@ -46,7 +46,6 @@ export class SnackbarInfoAction implements SnackbarAction {
|
||||
readonly type = SnackbarActionTypes.Info;
|
||||
|
||||
userAction?: SnackbarUserAction;
|
||||
duration = 4000;
|
||||
|
||||
constructor(public payload: string, public params?: any) {}
|
||||
}
|
||||
@@ -55,7 +54,6 @@ export class SnackbarWarningAction implements SnackbarAction {
|
||||
readonly type = SnackbarActionTypes.Warning;
|
||||
|
||||
userAction?: SnackbarUserAction;
|
||||
duration = 4000;
|
||||
|
||||
constructor(public payload: string, public params?: any) {}
|
||||
}
|
||||
@@ -64,7 +62,6 @@ export class SnackbarErrorAction implements SnackbarAction {
|
||||
readonly type = SnackbarActionTypes.Error;
|
||||
|
||||
userAction?: SnackbarUserAction;
|
||||
duration = 4000;
|
||||
|
||||
constructor(public payload: string, public params?: any) {}
|
||||
}
|
||||
|
@@ -23,7 +23,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { TranslationService } from '@alfresco/adf-core';
|
||||
import { SnackbarContentComponent, SnackBarData, TranslationService } from '@alfresco/adf-core';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { MatSnackBar } from '@angular/material/snack-bar';
|
||||
import { Actions, ofType, createEffect } from '@ngrx/effects';
|
||||
@@ -81,10 +81,17 @@ export class SnackbarEffects {
|
||||
if (action.userAction) {
|
||||
actionName = this.translate(action.userAction.title);
|
||||
}
|
||||
|
||||
const snackBarRef = this.snackBar.open(message, actionName, {
|
||||
duration: action.duration || 4000,
|
||||
panelClass
|
||||
const snackBarRef = this.snackBar.openFromComponent<SnackbarContentComponent, SnackBarData>(SnackbarContentComponent, {
|
||||
...(action.duration !== undefined && action.duration !== null && { duration: action.duration }),
|
||||
panelClass,
|
||||
data: {
|
||||
message,
|
||||
actionLabel: actionName,
|
||||
actionIcon: 'close',
|
||||
actionIconAriaLabel: 'CLOSE',
|
||||
showAction: true,
|
||||
callActionOnIconClick: false
|
||||
}
|
||||
});
|
||||
|
||||
if (action.userAction) {
|
||||
|
Reference in New Issue
Block a user