[ARVADOS-WORKBENCH2] updated: 2.3.0-3-g9610e9d1
Git user
git at public.arvados.org
Mon Nov 22 18:55:27 UTC 2021
Summary of changes:
cypress/integration/side-panel.spec.js | 26 ++++++++++++++++++++++
src/components/refresh-button/refresh-button.tsx | 9 +++++++-
.../main-content-bar/main-content-bar.tsx | 17 ++++++++++----
3 files changed, 47 insertions(+), 5 deletions(-)
via 9610e9d15c6c00b0684753d1f3ec90d550e700cf (commit)
from bb1b66c4f7858fb19075d9541ac43ecb7ac955f3 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 9610e9d15c6c00b0684753d1f3ec90d550e700cf
Author: Daniel Kutyła <daniel.kutyla at contractors.roche.com>
Date: Sun Nov 14 19:52:15 2021 +0100
Merge branch '18195-Refresh-Button-does-not-seem-to-refresh-the-sidebar-tree' into main
closes #18195
Arvados-DCO-1.1-Signed-off-by: Daniel Kutyła <daniel.kutyla at contractors.roche.com>
diff --git a/cypress/integration/side-panel.spec.js b/cypress/integration/side-panel.spec.js
index 912e68eb..f9d4dca3 100644
--- a/cypress/integration/side-panel.spec.js
+++ b/cypress/integration/side-panel.spec.js
@@ -114,4 +114,30 @@ describe('Side panel tests', function() {
});
});
+ it('side panel react to refresh when project data changes', () => {
+ const project = 'writableProject';
+
+ cy.createProject({
+ owningUser: activeUser,
+ targetUser: activeUser,
+ projectName: project,
+ canWrite: true,
+ addToFavorites: false
+ });
+
+ cy.getAll('@writableProject')
+ .then(function ([writableProject]) {
+ cy.loginAs(activeUser);
+
+ cy.get('[data-cy=side-panel-tree]').contains('Projects').click();
+
+ cy.get('[data-cy=side-panel-tree]').contains(writableProject.name).should('exist');
+
+ cy.trashGroup(activeUser.token, writableProject.uuid);
+
+ cy.contains('Refresh').click();
+
+ cy.contains(writableProject.name).should('not.exist');
+ });
+ });
})
diff --git a/src/components/refresh-button/refresh-button.tsx b/src/components/refresh-button/refresh-button.tsx
index f2c41d28..9971547b 100644
--- a/src/components/refresh-button/refresh-button.tsx
+++ b/src/components/refresh-button/refresh-button.tsx
@@ -22,13 +22,20 @@ const styles: StyleRulesCallback<CssRules> = theme => ({
},
});
-export const RefreshButton = ({ history, classes }: RouteComponentProps & WithStyles<CssRules>) =>
+interface RefreshButtonProps {
+ onClick?: () => void;
+}
+
+export const RefreshButton = ({ history, classes, onClick }: RouteComponentProps & WithStyles<CssRules> & RefreshButtonProps) =>
<Button
color="primary"
size="small"
variant="contained"
onClick={() => {
history.replace(window.location.pathname);
+ if (onClick) {
+ onClick();
+ }
}}
className={classNames(classes.buttonRight, classes.button)}>
<ReRunProcessIcon />
diff --git a/src/views-components/main-content-bar/main-content-bar.tsx b/src/views-components/main-content-bar/main-content-bar.tsx
index 6e1368c0..10ae1790 100644
--- a/src/views-components/main-content-bar/main-content-bar.tsx
+++ b/src/views-components/main-content-bar/main-content-bar.tsx
@@ -12,6 +12,8 @@ import { RootState } from 'store/store';
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";
@@ -55,10 +57,15 @@ const isButtonVisible = ({ router }: RootState) => {
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>
@@ -67,7 +74,9 @@ export const MainContentBar =
<Breadcrumbs />
</Grid>
<Grid item>
- <RefreshButton />
+ <RefreshButton onClick={() => {
+ props.onRefreshButtonClick(props.projectUuid);
+ }} />
</Grid>
<Grid item>
{props.buttonVisible && <Tooltip title="Additional Info">
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list