import * as Routes from 'routes/routes';
import { toggleDetailsPanel } from 'store/details-panel/details-panel-action';
import RefreshButton from "components/refresh-button/refresh-button";
+import { reloadProjectMatchingUuid } from "store/workbench/workbench-actions";
+import { loadSidePanelTreeProjects } from "store/side-panel-tree/side-panel-tree-actions";
type CssRules = "infoTooltip";
export const MainContentBar =
connect((state: RootState) => ({
- buttonVisible: isButtonVisible(state)
- }), {
+ buttonVisible: isButtonVisible(state),
+ projectUuid: state.detailsPanel.resourceUuid,
+ }), (dispatch) => ({
onDetailsPanelToggle: toggleDetailsPanel,
- })(
+ onRefreshButtonClick: (id) => {
+ dispatch<any>(loadSidePanelTreeProjects(id));
+ dispatch<any>(reloadProjectMatchingUuid([id]));
+ }
+ }))(
withStyles(styles)(
(props: MainContentBarProps & WithStyles<CssRules> & any) =>
<Toolbar>
<Breadcrumbs />
</Grid>
<Grid item>
- <RefreshButton />
+ <RefreshButton onClick={() => {
+ props.onRefreshButtonClick(props.projectUuid);
+ }} />
</Grid>
<Grid item>
{props.buttonVisible && <Tooltip title="Additional Info">