From: Pawel Kowalczyk Date: Tue, 4 Sep 2018 12:16:44 +0000 (+0200) Subject: merge master X-Git-Tag: 1.3.0~119^2~2 X-Git-Url: https://git.arvados.org/arvados-workbench2.git/commitdiff_plain/1703f15adf9e3875ff0c78ce78117a87b70ca05c merge master Feature #13860 Arvados-DCO-1.1-Signed-off-by: Pawel Kowalczyk --- 1703f15adf9e3875ff0c78ce78117a87b70ca05c diff --cc src/components/subprocess-filter/subprocess-filter.tsx index 23c1e658,58c33ee5..36be50d9 --- a/src/components/subprocess-filter/subprocess-filter.tsx +++ b/src/components/subprocess-filter/subprocess-filter.tsx @@@ -5,13 -5,13 +5,15 @@@ import * as React from 'react'; import { StyleRulesCallback, WithStyles, withStyles } from '@material-ui/core/styles'; import { ArvadosTheme } from '~/common/custom-theme'; -import { Grid, Typography, Switch } from '@material-ui/core'; +import { Typography, Switch } from '@material-ui/core'; - type CssRules = 'container' | 'label' | 'value' | 'switch'; -type CssRules = 'grid' | 'label' | 'value' | 'switch'; ++type CssRules = 'container' | 'label' | 'value'; const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ - grid: { - display: 'flex' + container: { + display: 'flex', ++ alignItems: 'center', ++ height: '20px' }, label: { width: '86px', @@@ -20,13 -20,12 +22,7 @@@ }, value: { width: '24px', - paddingLeft: theme.spacing.unit - }, - switch: { - '& span:first-child': { - height: '18px' - } + paddingLeft: theme.spacing.unit, - }, - switch: { - height: '20px', - '& span:first-child': { - height: '18px' - } } }); @@@ -42,10 -41,10 +38,10 @@@ type SubprocessFilterProps = Subprocess export const SubprocessFilter = withStyles(styles)( ({ classes, label, value, key, checked, onToggle }: SubprocessFilterProps) => - +
{label}: {value} -- {onToggle && (), + TOGGLE_PROCESS_PANEL_FILTER: ofType(), +}); + +export type ProcessPanelAction = UnionOf; + +export const toggleProcessPanelFilter = procesPanelActions.TOGGLE_PROCESS_PANEL_FILTER; + +export const loadProcessPanel = (uuid: string) => + (dispatch: Dispatch) => { + dispatch(loadProcess(uuid)); + dispatch(initProcessPanelFilters); + }; + +export const initProcessPanelFilters = procesPanelActions.INIT_PROCESS_PANEL_FILTERS([ - 'Queued', - 'Complete', - 'Active', - 'Failed' ++ ProcessStatus.QUEUED, ++ ProcessStatus.COMPLETED, ++ ProcessStatus.FAILED, ++ ProcessStatus.RUNNING, ++ ProcessStatus.LOCKED, ++ ProcessStatus.CANCELLED +]); diff --cc src/store/workbench/workbench-actions.ts index 80f50fe1,effac1d1..7077f414 --- a/src/store/workbench/workbench-actions.ts +++ b/src/store/workbench/workbench-actions.ts @@@ -32,7 -32,6 +32,7 @@@ import * as processesActions from '../p import { trashPanelColumns } from "~/views/trash-panel/trash-panel"; import { loadTrashPanel, trashPanelActions } from "~/store/trash-panel/trash-panel-action"; import { initProcessLogsPanel } from '../process-logs-panel/process-logs-panel-actions'; ++import { loadProcessPanel } from '~/store/process-panel/process-panel-actions'; export const loadWorkbench = () => @@@ -186,13 -185,10 +186,12 @@@ export const moveCollection = (data: Mo export const loadProcess = (uuid: string) => async (dispatch: Dispatch, getState: () => RootState) => { - await dispatch(processesActions.loadProcess(uuid)); - const process = getProcess(uuid)(getState().resources); - if (process) { - await dispatch(activateSidePanelTreeItem(process.containerRequest.ownerUuid)); - dispatch(setCollectionBreadcrumbs(process.containerRequest.ownerUuid)); - dispatch(loadDetailsPanel(uuid)); - } ++ dispatch(loadProcessPanel(uuid)); + const process = await dispatch(processesActions.loadProcess(uuid)); + await dispatch(activateSidePanelTreeItem(process.containerRequest.ownerUuid)); + dispatch(setProcessBreadcrumbs(uuid)); + dispatch(loadDetailsPanel(uuid)); ++ }; export const loadProcessLog = (uuid: string) => diff --cc src/views/process-panel/process-panel-root.tsx index f76efe0d,8e78f564..d12704bc --- a/src/views/process-panel/process-panel-root.tsx +++ b/src/views/process-panel/process-panel-root.tsx @@@ -28,8 -27,8 +28,8 @@@ export type ProcessPanelRootProps = Pro export const ProcessPanelRoot = (props: ProcessPanelRootProps) => props.process - ? - + ? - ++ diff --cc src/views/process-panel/subprocesses-card.tsx index 6c5562db,ac60c9f6..85de7033 --- a/src/views/process-panel/subprocesses-card.tsx +++ b/src/views/process-panel/subprocesses-card.tsx @@@ -49,15 -31,12 +49,15 @@@ export const SubprocessesCard = withSty - - - + + + + { - filters.map(filter => - onToggle(filter)} /> + filters.map(filter => - ++ + onToggle(filter.label)} /> + ) }