X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/00a61a4484185dc98daa92af5f189779cc10ad3c..b449a296cd8fc842ee196e1056e3be93fc9d29f5:/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 2e8433a9..0f797590 100644 --- a/src/views-components/side-panel-button/side-panel-button.tsx +++ b/src/views-components/side-panel-button/side-panel-button.tsx @@ -13,8 +13,8 @@ import { StyleRulesCallback, WithStyles, withStyles, Toolbar, Grid, Button, Menu import { AddIcon, CollectionIcon, ProcessIcon, ProjectIcon } from '~/components/icon/icon'; 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'; +import { runProcessPanelActions } from '~/store/run-process-panel/run-process-panel-actions'; type CssRules = 'button' | 'menuItem' | 'icon'; @@ -34,8 +34,8 @@ const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ }); interface SidePanelDataProps { + location: any; currentItemId: string; - buttonVisible: boolean; } interface SidePanelState { @@ -49,16 +49,10 @@ const transformOrigin: PopoverOrigin = { horizontal: 0 }; -const isButtonVisible = ({ router }: RootState) => { - const pathname = router.location ? router.location.pathname : ''; - const match = matchProjectRoute(pathname); - return !!match; -}; - export const SidePanelButton = withStyles(styles)( connect((state: RootState) => ({ currentItemId: getProperty(PROJECT_PANEL_CURRENT_UUID)(state.properties), - buttonVisible: isButtonVisible(state) + location: state.router.location }))( class extends React.Component { @@ -67,10 +61,10 @@ export const SidePanelButton = withStyles(styles)( }; render() { - const { classes, buttonVisible } = this.props; + const { classes } = this.props; const { anchorEl } = this.state; return - {buttonVisible && +