X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/f79c7407429a38dfe3c274e886983d8e3ea0fdaa..84a608e65b0f130cf57938c7c60a2c354bc14431:/src/views-components/side-panel-button/side-panel-button.tsx diff --git a/src/views-components/side-panel-button/side-panel-button.tsx b/src/views-components/side-panel-button/side-panel-button.tsx index f0543b4c..2e8433a9 100644 --- a/src/views-components/side-panel-button/side-panel-button.tsx +++ b/src/views-components/side-panel-button/side-panel-button.tsx @@ -14,6 +14,7 @@ import { AddIcon, CollectionIcon, ProcessIcon, ProjectIcon } from '~/components/ import { openProjectCreateDialog } from '~/store/projects/project-create-actions'; import { openCollectionCreateDialog } from '~/store/collections/collection-create-actions'; import { matchProjectRoute } from '~/routes/routes'; +import { navigateToRunProcess } from '~/store/navigation/navigation-action'; type CssRules = 'button' | 'menuItem' | 'icon'; @@ -34,7 +35,7 @@ const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ interface SidePanelDataProps { currentItemId: string; - showButton: boolean; + buttonVisible: boolean; } interface SidePanelState { @@ -45,10 +46,10 @@ type SidePanelProps = SidePanelDataProps & DispatchProp & WithStyles; const transformOrigin: PopoverOrigin = { vertical: -50, - horizontal: 45 + horizontal: 0 }; -const checkButtonVisibility = ({ router }: RootState) => { +const isButtonVisible = ({ router }: RootState) => { const pathname = router.location ? router.location.pathname : ''; const match = matchProjectRoute(pathname); return !!match; @@ -57,7 +58,7 @@ const checkButtonVisibility = ({ router }: RootState) => { export const SidePanelButton = withStyles(styles)( connect((state: RootState) => ({ currentItemId: getProperty(PROJECT_PANEL_CURRENT_UUID)(state.properties), - showButton: checkButtonVisibility(state) + buttonVisible: isButtonVisible(state) }))( class extends React.Component { @@ -66,11 +67,11 @@ export const SidePanelButton = withStyles(styles)( }; render() { - const { classes, showButton } = this.props; + const { classes, buttonVisible } = this.props; const { anchorEl } = this.state; return - {showButton && - + {buttonVisible && +