X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/3263f15e7742236185e2b8e5203d1becc8bfdcf1..refs/heads/14528_table_view_and_actions:/src/views-components/side-panel-button/side-panel-button.tsx?ds=sidebyside 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 80b3163f..61e72d08 100644 --- a/src/views-components/side-panel-button/side-panel-button.tsx +++ b/src/views-components/side-panel-button/side-panel-button.tsx @@ -13,7 +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,7 +35,6 @@ const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ interface SidePanelDataProps { currentItemId: string; - showButton: boolean; } interface SidePanelState { @@ -45,19 +45,12 @@ type SidePanelProps = SidePanelDataProps & DispatchProp & WithStyles; const transformOrigin: PopoverOrigin = { vertical: -50, - horizontal: 45 -}; - -const checkButtonVisibility = ({ router }: RootState) => { - const pathname = router.location ? router.location.pathname : ''; - const match = matchProjectRoute(pathname); - return match ? true : false; + horizontal: 0 }; export const SidePanelButton = withStyles(styles)( connect((state: RootState) => ({ - currentItemId: getProperty(PROJECT_PANEL_CURRENT_UUID)(state.properties), - showButton: checkButtonVisibility(state) + currentItemId: getProperty(PROJECT_PANEL_CURRENT_UUID)(state.properties) }))( class extends React.Component { @@ -66,11 +59,11 @@ export const SidePanelButton = withStyles(styles)( }; render() { - const { classes, showButton } = this.props; + const { classes } = this.props; const { anchorEl } = this.state; return - {showButton && - + +