[ARVADOS-WORKBENCH2] updated: 2.1.0-378-gf6d52fc8

Git user git at public.arvados.org
Mon May 17 23:10:26 UTC 2021


Summary of changes:
 cypress/integration/project.spec.js                | 50 ++++++++++++++++++++--
 src/store/trash/trash-actions.ts                   |  8 +---
 .../side-panel-tree/side-panel-tree.tsx            |  4 +-
 3 files changed, 52 insertions(+), 10 deletions(-)

       via  f6d52fc8be3fa84d981bcd20763f35adb7a2c795 (commit)
       via  1e1abe6a0146d3f31836334a7e5880e349afed24 (commit)
      from  55b961b8fb542c624725756d93c8eb5777211b72 (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 f6d52fc8be3fa84d981bcd20763f35adb7a2c795
Author: Lucas Di Pentima <lucas.dipentima at curii.com>
Date:   Mon May 17 20:09:50 2021 -0300

    17637: Adds tests.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas.dipentima at curii.com>

diff --git a/cypress/integration/project.spec.js b/cypress/integration/project.spec.js
index 86dcbc2a..af2d93e3 100644
--- a/cypress/integration/project.spec.js
+++ b/cypress/integration/project.spec.js
@@ -122,17 +122,61 @@ describe('Project tests', function() {
 
             // Go to subproject and trash it.
             cy.goToPath(`/projects/${testSubProject.uuid}`);
-            cy.get('[data-cy=breadcrumb-last]').should('contain', testSubProject.name);
-            cy.get('[data-cy=breadcrumb-last]').rightclick();
+            cy.get('[data-cy=side-panel-tree]').should('contain', testSubProject.name);
+            cy.get('[data-cy=breadcrumb-last]')
+                .should('contain', testSubProject.name)
+                .rightclick();
             cy.get('[data-cy=context-menu]').contains('Move to trash').click();
 
             // Confirm that the parent project should be displayed.
             cy.get('[data-cy=breadcrumb-last]').should('contain', testRootProject.name);
             cy.url().should('contain', `/projects/${testRootProject.uuid}`);
+            cy.get('[data-cy=side-panel-tree]').should('not.contain', testSubProject.name);
 
             // Checks for bugfix #17637.
             cy.get('[data-cy=not-found-content]').should('not.exist');
             cy.get('[data-cy=not-found-page]').should('not.exist');
         });
     });
-})
\ No newline at end of file
+
+    it('navigates to the root project after trashing the parent of the one being displayed', function() {
+        cy.createGroup(activeUser.token, {
+            name: `Test root project ${Math.floor(Math.random() * 999999)}`,
+            group_class: 'project',
+        }).as('testRootProject').then(function() {
+            cy.createGroup(activeUser.token, {
+                name : `Test subproject ${Math.floor(Math.random() * 999999)}`,
+                group_class: 'project',
+                owner_uuid: this.testRootProject.uuid,
+            }).as('testSubProject').then(function() {
+                cy.createGroup(activeUser.token, {
+                    name : `Test sub subproject ${Math.floor(Math.random() * 999999)}`,
+                    group_class: 'project',
+                    owner_uuid: this.testSubProject.uuid,
+                }).as('testSubSubProject');
+            });
+        });
+        cy.getAll('@testRootProject', '@testSubProject', '@testSubSubProject').then(function([testRootProject, testSubProject, testSubSubProject]) {
+            cy.loginAs(activeUser);
+
+            // Go to innermost project and trash its parent.
+            cy.goToPath(`/projects/${testSubSubProject.uuid}`);
+            cy.get('[data-cy=side-panel-tree]').should('contain', testSubSubProject.name);
+            cy.get('[data-cy=breadcrumb-last]').should('contain', testSubSubProject.name);
+            cy.get('[data-cy=side-panel-tree]')
+                .contains(testSubProject.name)
+                .rightclick();
+            cy.get('[data-cy=context-menu]').contains('Move to trash').click();
+
+            // Confirm that the trashed project's parent should be displayed.
+            cy.get('[data-cy=breadcrumb-last]').should('contain', testRootProject.name);
+            cy.url().should('contain', `/projects/${testRootProject.uuid}`);
+            cy.get('[data-cy=side-panel-tree]').should('not.contain', testSubProject.name);
+            cy.get('[data-cy=side-panel-tree]').should('not.contain', testSubSubProject.name);
+
+            // Checks for bugfix #17637.
+            cy.get('[data-cy=not-found-content]').should('not.exist');
+            cy.get('[data-cy=not-found-page]').should('not.exist');
+        });
+    });
+});
\ No newline at end of file
diff --git a/src/views-components/side-panel-tree/side-panel-tree.tsx b/src/views-components/side-panel-tree/side-panel-tree.tsx
index 4c6f01a1..bd6762e5 100644
--- a/src/views-components/side-panel-tree/side-panel-tree.tsx
+++ b/src/views-components/side-panel-tree/side-panel-tree.tsx
@@ -41,7 +41,9 @@ const mapDispatchToProps = (dispatch: Dispatch, props: SidePanelTreeProps): Side
 
 export const SidePanelTree = connect(undefined, mapDispatchToProps)(
     (props: SidePanelTreeActionProps) =>
-        <TreePicker {...props} render={renderSidePanelItem} pickerId={SIDE_PANEL_TREE} />);
+        <span data-cy="side-panel-tree">
+        <TreePicker {...props} render={renderSidePanelItem} pickerId={SIDE_PANEL_TREE} />
+        </span>);
 
 const renderSidePanelItem = (item: TreeItem<ProjectResource>) => {
     const name = typeof item.data === 'string' ? item.data : item.data.name;

commit 1e1abe6a0146d3f31836334a7e5880e349afed24
Author: Lucas Di Pentima <lucas.dipentima at curii.com>
Date:   Mon May 17 18:36:03 2021 -0300

    17637: Fixes edge case while simplifying code.
    
    The "not found" dialog appeared if trashing an indirect ancestor project
    of the one being displayed, by right-clicking on the righgt side panel tree.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas.dipentima at curii.com>

diff --git a/src/store/trash/trash-actions.ts b/src/store/trash/trash-actions.ts
index 5d654b76..38587deb 100644
--- a/src/store/trash/trash-actions.ts
+++ b/src/store/trash/trash-actions.ts
@@ -8,7 +8,7 @@ import { ServiceRepository } from "~/services/services";
 import { snackbarActions, SnackbarKind } from "~/store/snackbar/snackbar-actions";
 import { trashPanelActions } from "~/store/trash-panel/trash-panel-action";
 import { activateSidePanelTreeItem, loadSidePanelTreeProjects } from "~/store/side-panel-tree/side-panel-tree-actions";
-import { getProjectPanelCurrentUuid, projectPanelActions } from "~/store/project-panel/project-panel-action";
+import { projectPanelActions } from "~/store/project-panel/project-panel-action";
 import { ResourceKind } from "~/models/resource";
 import { navigateTo, navigateToTrash } from '~/store/navigation/navigation-action';
 import { matchCollectionRoute } from '~/routes/routes';
@@ -28,12 +28,8 @@ export const toggleProjectTrashed = (uuid: string, ownerUuid: string, isTrashed:
                 errorMessage = "Could not move project to trash";
                 successMessage = "Added to trash";
                 await services.groupsService.trash(uuid);
-                if (getProjectPanelCurrentUuid(getState()) === uuid) {
-                    dispatch<any>(navigateTo(ownerUuid));
-                } else {
-                    dispatch(projectPanelActions.REQUEST_ITEMS());
-                }
                 dispatch<any>(loadSidePanelTreeProjects(ownerUuid));
+                dispatch<any>(navigateTo(ownerUuid));
             }
         } catch (e) {
             dispatch(snackbarActions.OPEN_SNACKBAR({

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list