mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
Revert snackbar changes (#2778)
* Revert "[AAE-10766] upgrade to new About component (#2769)"
This reverts commit 5ce4835e4c
.
* restore about dialog changes
* latest ADF alpha
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,6 +46,7 @@ export class SnackbarInfoAction implements SnackbarAction {
|
||||
readonly type = SnackbarActionTypes.Info;
|
||||
|
||||
userAction?: SnackbarUserAction;
|
||||
duration = 4000;
|
||||
|
||||
constructor(public payload: string, public params?: any) {}
|
||||
}
|
||||
@@ -54,6 +55,7 @@ export class SnackbarWarningAction implements SnackbarAction {
|
||||
readonly type = SnackbarActionTypes.Warning;
|
||||
|
||||
userAction?: SnackbarUserAction;
|
||||
duration = 4000;
|
||||
|
||||
constructor(public payload: string, public params?: any) {}
|
||||
}
|
||||
@@ -62,6 +64,7 @@ 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 { SnackbarContentComponent, SnackBarData, TranslationService } from '@alfresco/adf-core';
|
||||
import { 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,17 +81,10 @@ export class SnackbarEffects {
|
||||
if (action.userAction) {
|
||||
actionName = this.translate(action.userAction.title);
|
||||
}
|
||||
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
|
||||
}
|
||||
|
||||
const snackBarRef = this.snackBar.open(message, actionName, {
|
||||
duration: action.duration || 4000,
|
||||
panelClass
|
||||
});
|
||||
|
||||
if (action.userAction) {
|
||||
|
@@ -23,7 +23,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { browser, by, ElementFinder, WebElement } from 'protractor';
|
||||
import { browser, by, ElementFinder } from 'protractor';
|
||||
import { BrowserVisibility, Logger } from '@alfresco/adf-testing';
|
||||
import { APP_ROUTES, USE_HASH_STRATEGY } from './../configs';
|
||||
import { Utils, waitElement, waitForPresence, isPresentAndDisplayed } from '../utilities/utils';
|
||||
@@ -35,10 +35,10 @@ export abstract class Page {
|
||||
|
||||
layout = this.byCss('app-layout');
|
||||
overlay = this.byCss('.cdk-overlay-container');
|
||||
snackBar = this.byCss('.adf-snackbar-message-content-action-label');
|
||||
snackBar = this.byCss('.mat-simple-snackbar-action button');
|
||||
dialogContainer = this.byCss('.mat-dialog-container');
|
||||
snackBarContainer = this.byCss('.mat-snack-bar-container');
|
||||
snackBarAction = this.byCss('.adf-snackbar-message-content-action-label');
|
||||
snackBarAction = this.byCss('.mat-simple-snackbar-action button');
|
||||
genericError = this.byCss('aca-generic-error');
|
||||
genericErrorIcon = this.byCss('aca-generic-error .mat-icon');
|
||||
genericErrorTitle = this.byCss('.generic-error__title');
|
||||
@@ -88,25 +88,14 @@ export abstract class Page {
|
||||
}
|
||||
|
||||
async getSnackBarMessage(): Promise<string> {
|
||||
const elem = await waitElement('.adf-snackbar-message-content');
|
||||
const attributeValue: string = await browser.executeScript(`return arguments[0].innerText`, elem);
|
||||
return attributeValue || '';
|
||||
}
|
||||
|
||||
async getSnackBarAction(): Promise<string> {
|
||||
let elem: WebElement;
|
||||
try {
|
||||
elem = await waitElement('.adf-snackbar-message-content-action-label');
|
||||
} catch (e) {
|
||||
return '';
|
||||
}
|
||||
const elem = await waitElement('.mat-snack-bar-container');
|
||||
const attributeValue: string = await browser.executeScript(`return arguments[0].innerText`, elem);
|
||||
return attributeValue || '';
|
||||
}
|
||||
|
||||
async clickSnackBarAction(): Promise<void> {
|
||||
try {
|
||||
const action = await waitElement('.adf-snackbar-message-content-action-label');
|
||||
const action = await waitElement('.mat-simple-snackbar-action button');
|
||||
await action.click();
|
||||
} catch (e) {
|
||||
Logger.error(e, '.......failed on click snack bar action.........');
|
||||
|
Reference in New Issue
Block a user