[arvados-workbench2] updated: 2.4.0-193-g3108f379
git repository hosting
git at public.arvados.org
Wed Aug 24 22:38:57 UTC 2022
Summary of changes:
cypress/integration/group-manage.spec.js | 2 +-
src/store/snackbar/snackbar-reducer.ts | 19 +++++++++++++++----
src/views-components/snackbar/snackbar.tsx | 9 +++++----
3 files changed, 21 insertions(+), 9 deletions(-)
via 3108f379099f4e0928680e15aa9116542f43a9c6 (commit)
from 3db967cb60770fc35c958b400268ca4d3b33a3c7 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 3108f379099f4e0928680e15aa9116542f43a9c6
Author: Daniel Kutyła <daniel.kutyla at contractors.roche.com>
Date: Thu Aug 25 00:38:13 2022 +0200
18692: Changed Snackbar closing
Arvados-DCO-1.1-Signed-off-by: Daniel Kutyła <daniel.kutyla at contractors.roche.com>
diff --git a/cypress/integration/group-manage.spec.js b/cypress/integration/group-manage.spec.js
index 0c28997f..ffe2c8c4 100644
--- a/cypress/integration/group-manage.spec.js
+++ b/cypress/integration/group-manage.spec.js
@@ -254,7 +254,7 @@ describe('Group manage tests', function() {
.should('not.contain', groupName + ' (renamed)');
});
- it.skip('disables group-related controls for built-in groups', function() {
+ it('disables group-related controls for built-in groups', function() {
cy.loginAs(adminUser);
['All users', 'Anonymous users', 'System group'].forEach((builtInGroup) => {
diff --git a/src/store/snackbar/snackbar-reducer.ts b/src/store/snackbar/snackbar-reducer.ts
index fa1717c7..e367ac5f 100644
--- a/src/store/snackbar/snackbar-reducer.ts
+++ b/src/store/snackbar/snackbar-reducer.ts
@@ -29,10 +29,21 @@ export const snackbarReducer = (state = initialState, action: SnackbarAction) =>
})
};
},
- CLOSE_SNACKBAR: () => ({
- ...state,
- open: false
- }),
+ CLOSE_SNACKBAR: (payload) => {
+ let newMessages: any = [...state.messages];// state.messages.filter(({ message }) => message !== payload);
+
+ if (JSON.stringify(payload) === '{}') {
+ newMessages.pop();
+ } else {
+ newMessages = state.messages.filter(({ message }) => message !== payload);
+ }
+
+ return {
+ ...state,
+ messages: newMessages,
+ open: newMessages.length > 0
+ }
+ },
SHIFT_MESSAGES: () => {
const messages = state.messages.filter((m, idx) => idx > 0);
return {
diff --git a/src/views-components/snackbar/snackbar.tsx b/src/views-components/snackbar/snackbar.tsx
index 037f564a..2aa60709 100644
--- a/src/views-components/snackbar/snackbar.tsx
+++ b/src/views-components/snackbar/snackbar.tsx
@@ -27,7 +27,7 @@ interface SnackbarDataProps {
}
interface SnackbarEventProps {
- onClose?: (event: React.SyntheticEvent<any>, reason: string) => void;
+ onClose?: (event: React.SyntheticEvent<any>, reason: string, message?: string) => void;
onExited: () => void;
onClick: (uuid: string) => void;
}
@@ -43,9 +43,9 @@ const mapStateToProps = (state: RootState): SnackbarDataProps => {
};
const mapDispatchToProps = (dispatch: Dispatch): SnackbarEventProps => ({
- onClose: (event: any, reason: string) => {
+ onClose: (event: any, reason: string, message: '') => {
if (reason !== "clickaway") {
- dispatch(snackbarActions.CLOSE_SNACKBAR());
+ dispatch(snackbarActions.CLOSE_SNACKBAR(message));
}
},
onExited: () => {
@@ -116,6 +116,7 @@ export const Snackbar = withStyles(styles)(connect(mapStateToProps, mapDispatchT
const [Icon, cssClass] = variants[message.kind];
return <SnackbarContent
+ key={message.message}
className={classNames(cssClass, classes.snackbarContent)}
aria-describedby="client-snackbar"
message={
@@ -140,7 +141,7 @@ const actions = (props: SnackbarMessage, onClick, onClose, classes) => {
key="close"
aria-label="Close"
color="inherit"
- onClick={e => onClose && onClose(e, '')}>
+ onClick={e => onClose && onClose(e, '', props.message)}>
<CloseIcon className={classes.icon} />
</IconButton>
];
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list