[arvados-workbench2] updated: 2.4.0-191-gd7c97556
git repository hosting
git at public.arvados.org
Tue Aug 23 20:13:52 UTC 2022
Summary of changes:
src/store/tree-picker/tree-picker-actions.ts | 1 -
.../projects-tree-picker/projects-tree-picker.tsx | 4 +-
src/views-components/snackbar/snackbar.tsx | 57 +++++++++++-----------
src/views-components/tree-picker/tree-picker.ts | 1 -
.../run-process-panel/inputs/project-input.tsx | 8 ++-
5 files changed, 34 insertions(+), 37 deletions(-)
via d7c9755621d7d6f6c57810fc9fe04c8dc65b640e (commit)
from a6e83a8e7ba34c1a2b2540d5790d0d273364380e (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 d7c9755621d7d6f6c57810fc9fe04c8dc65b640e
Author: Daniel Kutyła <daniel.kutyla at contractors.roche.com>
Date: Tue Aug 23 22:13:22 2022 +0200
18692: Fixed error formatting
Arvados-DCO-1.1-Signed-off-by: Daniel Kutyła <daniel.kutyla at contractors.roche.com>
diff --git a/src/store/tree-picker/tree-picker-actions.ts b/src/store/tree-picker/tree-picker-actions.ts
index fd7cc4ce..23f548cd 100644
--- a/src/store/tree-picker/tree-picker-actions.ts
+++ b/src/store/tree-picker/tree-picker-actions.ts
@@ -119,7 +119,6 @@ export const loadProject = (params: LoadProjectParams) =>
)(new FilterBuilder());
const { items } = await services.groupsService.contents(loadShared ? '' : id, { filters, excludeHomeProject: loadShared || undefined });
-
dispatch<any>(receiveTreePickerData<GroupContentsResource>({
id,
pickerId,
diff --git a/src/views-components/projects-tree-picker/projects-tree-picker.tsx b/src/views-components/projects-tree-picker/projects-tree-picker.tsx
index ee8ce1d5..c4a6e3ab 100644
--- a/src/views-components/projects-tree-picker/projects-tree-picker.tsx
+++ b/src/views-components/projects-tree-picker/projects-tree-picker.tsx
@@ -3,7 +3,7 @@
// SPDX-License-Identifier: AGPL-3.0
import React from 'react';
-import { values, memoize, pipe } from 'lodash/fp';
+import { values, pipe } from 'lodash/fp';
import { HomeTreePicker } from 'views-components/projects-tree-picker/home-tree-picker';
import { SharedTreePicker } from 'views-components/projects-tree-picker/shared-tree-picker';
import { FavoritesTreePicker } from 'views-components/projects-tree-picker/favorites-tree-picker';
@@ -46,5 +46,5 @@ export const ProjectsTreePicker = ({ pickerId, ...props }: ProjectsTreePickerPro
</div>;
};
-const getRelatedTreePickers = memoize(pipe(getProjectsTreePickerIds, values));
+const getRelatedTreePickers = pipe(getProjectsTreePickerIds, values);
const disableActivation = [SHARED_PROJECT_ID, FAVORITES_PROJECT_ID];
diff --git a/src/views-components/snackbar/snackbar.tsx b/src/views-components/snackbar/snackbar.tsx
index a33b6968..037f564a 100644
--- a/src/views-components/snackbar/snackbar.tsx
+++ b/src/views-components/snackbar/snackbar.tsx
@@ -8,7 +8,7 @@ import { connect } from "react-redux";
import { RootState } from "store/store";
import { Button, IconButton, StyleRulesCallback, WithStyles, withStyles, SnackbarContent } from '@material-ui/core';
import MaterialSnackbar, { SnackbarOrigin } from "@material-ui/core/Snackbar";
-import { snackbarActions, SnackbarKind } from "store/snackbar/snackbar-actions";
+import { snackbarActions, SnackbarKind, SnackbarMessage } from "store/snackbar/snackbar-actions";
import { navigateTo } from 'store/navigation/navigation-action';
import WarningIcon from '@material-ui/icons/Warning';
import CheckCircleIcon from '@material-ui/icons/CheckCircle';
@@ -23,9 +23,7 @@ interface SnackbarDataProps {
anchorOrigin?: SnackbarOrigin;
autoHideDuration?: number;
open: boolean;
- message?: React.ReactElement<any>;
- kind: SnackbarKind;
- link?: string;
+ messages: SnackbarMessage[];
}
interface SnackbarEventProps {
@@ -39,10 +37,8 @@ const mapStateToProps = (state: RootState): SnackbarDataProps => {
return {
anchorOrigin: { vertical: "bottom", horizontal: "right" },
open: state.snackbar.open,
- message: <span>{messages.length > 0 ? messages[0].message : ""}</span>,
- autoHideDuration: messages.length > 0 ? messages[0].hideDuration : 0,
- kind: messages.length > 0 ? messages[0].kind : SnackbarKind.INFO,
- link: messages.length > 0 ? messages[0].link : ''
+ messages,
+ autoHideDuration: messages.length > 0 ? messages[0].hideDuration : 0
};
};
@@ -60,7 +56,7 @@ const mapDispatchToProps = (dispatch: Dispatch): SnackbarEventProps => ({
}
});
-type CssRules = "success" | "error" | "info" | "warning" | "icon" | "iconVariant" | "message" | "linkButton";
+type CssRules = "success" | "error" | "info" | "warning" | "icon" | "iconVariant" | "message" | "linkButton" | "snackbarContent";
const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
success: {
@@ -88,6 +84,9 @@ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
},
linkButton: {
fontWeight: 'bolder'
+ },
+ snackbarContent: {
+ marginBottom: '1rem'
}
});
@@ -104,36 +103,38 @@ export const Snackbar = withStyles(styles)(connect(mapStateToProps, mapDispatchT
[SnackbarKind.ERROR]: [ErrorIcon, classes.error]
};
- const [Icon, cssClass] = variants[props.kind];
-
-
-
return (
<MaterialSnackbar
open={props.open}
- message={props.message}
onClose={props.onClose}
onExited={props.onExited}
anchorOrigin={props.anchorOrigin}
autoHideDuration={props.autoHideDuration}>
- <div data-cy="snackbar"><SnackbarContent
- className={classNames(cssClass)}
- aria-describedby="client-snackbar"
- message={
- <span id="client-snackbar" className={classes.message}>
- <Icon className={classNames(classes.icon, classes.iconVariant)} />
- {props.message}
- </span>
+ <div data-cy="snackbar">
+ {
+ props.messages.map(message => {
+ const [Icon, cssClass] = variants[message.kind];
+
+ return <SnackbarContent
+ className={classNames(cssClass, classes.snackbarContent)}
+ aria-describedby="client-snackbar"
+ message={
+ <span id="client-snackbar" className={classes.message}>
+ <Icon className={classNames(classes.icon, classes.iconVariant)} />
+ {message.message}
+ </span>
+ }
+ action={actions(message, props.onClick, props.onClose, classes)}
+ />
+ })
}
- action={actions(props)}
- /></div>
+ </div>
</MaterialSnackbar>
);
}
));
-const actions = (props: SnackbarProps) => {
- const { link, onClose, onClick, classes } = props;
+const actions = (props: SnackbarMessage, onClick, onClose, classes) => {
const actions = [
<IconButton
key="close"
@@ -143,14 +144,14 @@ const actions = (props: SnackbarProps) => {
<CloseIcon className={classes.icon} />
</IconButton>
];
- if (link) {
+ if (props.link) {
actions.splice(0, 0,
<Button key="goTo"
aria-label="goTo"
size="small"
color="inherit"
className={classes.linkButton}
- onClick={() => onClick(link)}>
+ onClick={() => onClick(props.link)}>
<span data-cy='snackbar-goto-action'>Go To</span>
</Button>
);
diff --git a/src/views-components/tree-picker/tree-picker.ts b/src/views-components/tree-picker/tree-picker.ts
index 68a0a414..a6fdfefe 100644
--- a/src/views-components/tree-picker/tree-picker.ts
+++ b/src/views-components/tree-picker/tree-picker.ts
@@ -39,7 +39,6 @@ const mapStateToProps =
<T>(state: RootState, props: TreePickerProps<T>): Pick<TreeProps<T>, 'items' | 'disableRipple' | 'itemsMap'> => {
const itemsIdMap: Map<string, TreeItem<T>> = new Map();
const tree = state.treePicker[props.pickerId] || createTree();
-
return {
disableRipple: true,
items: getNodeChildrenIds('')(tree)
diff --git a/src/views/run-process-panel/inputs/project-input.tsx b/src/views/run-process-panel/inputs/project-input.tsx
index 7b45a6d1..ea5651e3 100644
--- a/src/views/run-process-panel/inputs/project-input.tsx
+++ b/src/views/run-process-panel/inputs/project-input.tsx
@@ -59,12 +59,10 @@ export const ProjectInputComponent = connect(mapStateToProps)(
open: false,
};
- componentDidMount() {
+ render() {
this.props.dispatch<any>(
initProjectsTreePicker(this.props.commandInput.id));
- }
- render() {
return <>
{this.renderInput()}
{this.renderDialog()}
@@ -109,7 +107,7 @@ export const ProjectInputComponent = connect(mapStateToProps)(
}
renderDialog() {
- return <Dialog
+ return this.state.open ? <Dialog
open={this.state.open}
onClose={this.closeDialog}
fullWidth
@@ -130,7 +128,7 @@ export const ProjectInputComponent = connect(mapStateToProps)(
color='primary'
onClick={this.submit}>Ok</Button>
</DialogActions>
- </Dialog>;
+ </Dialog> : null;
}
});
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list