15768: feedback cleanup Arvados-DCO-1.1-Signed-off-by: Lisa Knox <lisa.knox@curii...
authorLisa Knox <lisaknox83@gmail.com>
Tue, 17 Oct 2023 13:51:44 +0000 (09:51 -0400)
committerLisa Knox <lisaknox83@gmail.com>
Tue, 17 Oct 2023 13:51:44 +0000 (09:51 -0400)
14 files changed:
cypress/integration/collection.spec.js
src/views-components/context-menu/action-sets/api-client-authorization-action-set.ts
src/views-components/context-menu/action-sets/group-action-set.ts
src/views-components/context-menu/action-sets/group-member-action-set.ts
src/views-components/context-menu/action-sets/keep-service-action-set.ts
src/views-components/context-menu/action-sets/link-action-set.ts
src/views-components/context-menu/action-sets/repository-action-set.ts
src/views-components/context-menu/action-sets/root-project-action-set.ts
src/views-components/context-menu/action-sets/search-results-action-set.ts
src/views-components/context-menu/action-sets/ssh-key-action-set.ts
src/views-components/context-menu/action-sets/trashed-collection-action-set.ts
src/views-components/context-menu/action-sets/user-action-set.ts
src/views-components/context-menu/action-sets/virtual-machine-action-set.ts
src/views-components/data-explorer/renderers.tsx

index 35f36e1e0b90d0d21c9684603a383e04d850a704..f83a974193abe98926bb982ce4d731446ebd9bb3 100644 (file)
@@ -453,60 +453,6 @@ describe("Collection panel tests", function () {
             });
     });
 
-    it("renames a file to a different directory", function () {
-        // Creates the collection using the admin token so we can set up
-        // a bogus manifest text without block signatures.
-        cy.createCollection(adminUser.token, {
-            name: `Test collection ${Math.floor(Math.random() * 999999)}`,
-            owner_uuid: activeUser.user.uuid,
-            manifest_text: ". 37b51d194a7513e45b56f6524f2d51f2+3 0:3:bar\n",
-        })
-            .as("testCollection")
-            .then(function () {
-                cy.loginAs(activeUser);
-                cy.goToPath(`/collections/${this.testCollection.uuid}`);
-
-                ["subdir", "G%C3%BCnter's%20file", "table%&?*2"].forEach(subdir => {
-                    cy.waitForDom().get("[data-cy=collection-files-panel]").contains("bar").rightclick();
-                    cy.get("[data-cy=context-menu]").contains("Rename").click();
-                    cy.get("[data-cy=form-dialog]")
-                        .should("contain", "Rename")
-                        .within(() => {
-                            cy.get("input").type(`{selectall}{backspace}${subdir}/foo`);
-                        });
-                    cy.get("[data-cy=form-submit-btn]").click();
-                    cy.get("[data-cy=collection-files-panel]").should("not.contain", "bar").and("contain", subdir);
-                    cy.get("[data-cy=collection-files-panel]").contains(subdir).click();
-
-                    // Rename 'subdir/foo' to 'bar'
-                    cy.wait(1000);
-                    cy.get("[data-cy=collection-files-panel]").contains("foo").rightclick();
-                    cy.get("[data-cy=context-menu]").contains("Rename").click();
-                    cy.get("[data-cy=form-dialog]")
-                        .should("contain", "Rename")
-                        .within(() => {
-                            cy.get("input").should("have.value", `${subdir}/foo`).type(`{selectall}{backspace}bar`);
-                        });
-                    cy.get("[data-cy=form-submit-btn]").click();
-
-                    // need to wait for dialog to dismiss
-                    cy.get("[data-cy=form-dialog]").should("not.exist");
-
-                    cy.waitForDom().get("[data-cy=collection-files-panel]").contains("Home").click();
-
-                    cy.wait(2000);
-                    cy.get("[data-cy=collection-files-panel]")
-                        .should("contain", subdir) // empty dir kept
-                        .and("contain", "bar");
-
-                    cy.get("[data-cy=collection-files-panel]").contains(subdir).rightclick();
-                    cy.get("[data-cy=context-menu]").contains("Remove").click();
-                    cy.get("[data-cy=confirmation-dialog-ok-btn]").click();
-                    cy.get("[data-cy=form-dialog]").should("not.exist");
-                });
-            });
-    });
-
     it("shows collection owner", () => {
         cy.createCollection(adminUser.token, {
             name: `Test collection ${Math.floor(Math.random() * 999999)}`,
index 0d3bebb12efc98d852ec8d80dc37942be5e73049..8e75d22f6714d97853f2d7061aa9167dc793a072 100644 (file)
@@ -16,27 +16,21 @@ export const apiClientAuthorizationActionSet: ContextMenuActionSet = [
             name: "Attributes",
             icon: AttributesIcon,
             execute: (dispatch, resources) => {
-                for (const resource of [...resources]) {
-                    dispatch<any>(openApiClientAuthorizationAttributesDialog(resource.uuid));
-                }
+                    dispatch<any>(openApiClientAuthorizationAttributesDialog(resources[0].uuid));
             },
         },
         {
             name: "API Details",
             icon: AdvancedIcon,
             execute: (dispatch, resources) => {
-                for (const resource of [...resources]) {
-                    dispatch<any>(openAdvancedTabDialog(resource.uuid));
-                }
+                    dispatch<any>(openAdvancedTabDialog(resources[0].uuid));
             },
         },
         {
             name: "Remove",
             icon: RemoveIcon,
             execute: (dispatch, resources) => {
-                for (const resource of [...resources]) {
-                    dispatch<any>(openApiClientAuthorizationRemoveDialog(resource.uuid));
-                }
+                    dispatch<any>(openApiClientAuthorizationRemoveDialog(resources[0].uuid));
             },
         },
     ],
index 23d882640433ff55a1e533bd0a9b90358e0dcf44..816583faa9f05e3c2d5291362dc12449b503dc92 100644 (file)
@@ -13,28 +13,28 @@ export const groupActionSet: ContextMenuActionSet = [
             name: 'Rename',
             icon: RenameIcon,
             execute: (dispatch, resources) => {
-                resources.forEach((resource) => dispatch<any>(openGroupUpdateDialog(resource)));
+                dispatch<any>(openGroupUpdateDialog(resources[0]))
             },
         },
         {
             name: 'Attributes',
             icon: AttributesIcon,
             execute: (dispatch, resources) => {
-                resources.forEach((resource) => dispatch<any>(openGroupAttributes(resource.uuid)));
+                dispatch<any>(openGroupAttributes(resources[0].uuid))
             },
         },
         {
             name: 'API Details',
             icon: AdvancedIcon,
             execute: (dispatch, resources) => {
-                resources.forEach((resource) => dispatch<any>(openAdvancedTabDialog(resource.uuid)));
+                dispatch<any>(openAdvancedTabDialog(resources[0].uuid));
             },
         },
         {
             name: 'Remove',
             icon: RemoveIcon,
             execute: (dispatch, resources) => {
-                resources.forEach((resource) => dispatch<any>(openRemoveGroupDialog(resource.uuid)));
+                dispatch<any>(openRemoveGroupDialog(resources[0].uuid));
             },
         },
     ],
index 17b3d74c06457d58c1b1511b4b2a36362e7f536a..ad1ce97c2dcb8ba3ee238d7ee10b1a39809f81e7 100644 (file)
@@ -13,21 +13,21 @@ export const groupMemberActionSet: ContextMenuActionSet = [
             name: 'Attributes',
             icon: AttributesIcon,
             execute: (dispatch, resources) => {
-                resources.forEach((resource) => dispatch<any>(openGroupMemberAttributes(resource.uuid)));
+                 dispatch<any>(openGroupMemberAttributes(resources[0].uuid));
             },
         },
         {
             name: 'API Details',
             icon: AdvancedIcon,
             execute: (dispatch, resources) => {
-                resources.forEach((resource) => dispatch<any>(openAdvancedTabDialog(resource.uuid)));
+                 dispatch<any>(openAdvancedTabDialog(resources[0].uuid));
             },
         },
         {
             name: 'Remove',
             icon: RemoveIcon,
             execute: (dispatch, resources) => {
-                resources.forEach((resource) => dispatch<any>(openRemoveGroupMemberDialog(resource.uuid)));
+                 dispatch<any>(openRemoveGroupMemberDialog(resources[0].uuid));
             },
         },
     ],
index 0d2cbd0742414f6bd6da58e7e11b1322d2fc3fe9..2957f008cd055f04fea2533e3a5e9e28ee96dfac 100644 (file)
@@ -13,21 +13,21 @@ export const keepServiceActionSet: ContextMenuActionSet = [
             name: 'Attributes',
             icon: AttributesIcon,
             execute: (dispatch, resources) => {
-                resources.forEach((resource) => dispatch<any>(openKeepServiceAttributesDialog(resource.uuid)));
+                 dispatch<any>(openKeepServiceAttributesDialog(resources[0].uuid));
             },
         },
         {
             name: 'API Details',
             icon: AdvancedIcon,
             execute: (dispatch, resources) => {
-                resources.forEach((resource) => dispatch<any>(openAdvancedTabDialog(resource.uuid)));
+                 dispatch<any>(openAdvancedTabDialog(resources[0].uuid));
             },
         },
         {
             name: 'Remove',
             icon: RemoveIcon,
             execute: (dispatch, resources) => {
-                resources.forEach((resource) => dispatch<any>(openKeepServiceRemoveDialog(resource.uuid)));
+                 dispatch<any>(openKeepServiceRemoveDialog(resources[0].uuid));
             },
         },
     ],
index 4f0b330ec3f7e6660170180c62a4169d29770295..86458423c2e09e489016d3dd8d226c72dd370b8e 100644 (file)
@@ -13,21 +13,21 @@ export const linkActionSet: ContextMenuActionSet = [
             name: 'Attributes',
             icon: AttributesIcon,
             execute: (dispatch, resources) => {
-                resources.forEach((resource) => dispatch<any>(openLinkAttributesDialog(resource.uuid)));
+                 dispatch<any>(openLinkAttributesDialog(resources[0].uuid));
             },
         },
         {
             name: 'API Details',
             icon: AdvancedIcon,
             execute: (dispatch, resources) => {
-                resources.forEach((resource) => dispatch<any>(openAdvancedTabDialog(resource.uuid)));
+                 dispatch<any>(openAdvancedTabDialog(resources[0].uuid));
             },
         },
         {
             name: 'Remove',
             icon: RemoveIcon,
             execute: (dispatch, resources) => {
-                resources.forEach((resource) => dispatch<any>(openLinkRemoveDialog(resource.uuid)));
+                 dispatch<any>(openLinkRemoveDialog(resources[0].uuid));
             },
         },
     ],
index e893a7fa6fffd2c5ffcdc36353f779bf6546494f..cbdcd004288780cbdbd3c5cfe2e41449d966fae5 100644 (file)
@@ -14,28 +14,28 @@ export const repositoryActionSet: ContextMenuActionSet = [
             name: 'Attributes',
             icon: AttributesIcon,
             execute: (dispatch, resources) => {
-                resources.forEach((resource) => dispatch<any>(openRepositoryAttributes(resource.uuid)));
+                 dispatch<any>(openRepositoryAttributes(resources[0].uuid));
             },
         },
         {
             name: 'Share',
             icon: ShareIcon,
             execute: (dispatch, resources) => {
-                resources.forEach((resource) => dispatch<any>(openSharingDialog(resource.uuid)));
+                 dispatch<any>(openSharingDialog(resources[0].uuid));
             },
         },
         {
             name: 'API Details',
             icon: AdvancedIcon,
             execute: (dispatch, resources) => {
-                resources.forEach((resource) => dispatch<any>(openAdvancedTabDialog(resource.uuid)));
+                 dispatch<any>(openAdvancedTabDialog(resources[0].uuid));
             },
         },
         {
             name: 'Remove',
             icon: RemoveIcon,
             execute: (dispatch, resources) => {
-                resources.forEach((resource) => dispatch<any>(openRemoveRepositoryDialog(resource.uuid)));
+                 dispatch<any>(openRemoveRepositoryDialog(resources[0].uuid));
             },
         },
     ],
index afd7a477771db3164a13b0e7556eac0b10dda020..a779d1eb2967877c766d7166b63ae00697a4bfb4 100644 (file)
@@ -13,14 +13,14 @@ export const rootProjectActionSet: ContextMenuActionSet = [
             icon: NewProjectIcon,
             name: 'New project',
             execute: (dispatch, resources) => {
-                resources.forEach((resource) => dispatch<any>(openProjectCreateDialog(resource.uuid)));
+                 dispatch<any>(openProjectCreateDialog(resources[0].uuid));
             },
         },
         {
             icon: CollectionIcon,
             name: 'New Collection',
             execute: (dispatch, resources) => {
-                resources.forEach((resource) => dispatch<any>(openCollectionCreateDialog(resource.uuid)));
+                 dispatch<any>(openCollectionCreateDialog(resources[0].uuid));
             },
         },
     ],
index 4921cfc35e23a5b4d3bf4026aa19644be2b9f2c5..dcc9eae20700160c3fdd3bf72224754b9bdded81 100644 (file)
@@ -35,7 +35,7 @@ export const searchResultsActionSet: ContextMenuActionSet = [
             icon: AdvancedIcon,
             name: 'API Details',
             execute: (dispatch, resources) => {
-                resources.forEach((resource) => dispatch<any>(openAdvancedTabDialog(resource.uuid)));
+                dispatch<any>(openAdvancedTabDialog(resources[0].uuid));
             },
         },
     ],
index f0620ede0a5419d3829bf3abd834e3787591742b..c31e1681a4f88bd861c12ae6158837db982ccdbb 100644 (file)
@@ -13,21 +13,21 @@ export const sshKeyActionSet: ContextMenuActionSet = [
             name: 'Attributes',
             icon: AttributesIcon,
             execute: (dispatch, resources) => {
-                resources.forEach((resource) => dispatch<any>(openSshKeyAttributesDialog(resource.uuid)));
+                dispatch<any>(openSshKeyAttributesDialog(resources[0].uuid));
             },
         },
         {
             name: 'API Details',
             icon: AdvancedIcon,
             execute: (dispatch, resources) => {
-                resources.forEach((resource) => dispatch<any>(openAdvancedTabDialog(resource.uuid)));
+                dispatch<any>(openAdvancedTabDialog(resources[0].uuid));
             },
         },
         {
             name: 'Remove',
             icon: RemoveIcon,
             execute: (dispatch, resources) => {
-                resources.forEach((resource) => dispatch<any>(openSshKeyRemoveDialog(resource.uuid)));
+                dispatch<any>(openSshKeyRemoveDialog(resources[0].uuid));
             },
         },
     ],
index 8b8b7c6e1918fea5bc3472c909a629504a6aef20..3e8f0cb647e38e8f73b35e33faf562ccc9caa155 100644 (file)
@@ -28,7 +28,7 @@ export const trashedCollectionActionSet: ContextMenuActionSet = [
             icon: AdvancedIcon,
             name: 'API Details',
             execute: (dispatch, resources) => {
-                resources.forEach((resource) => dispatch<any>(openAdvancedTabDialog(resource.uuid)));
+                dispatch<any>(openAdvancedTabDialog(resources[0].uuid));
             },
         },
         {
index 104402a726e3d292d2632d8ea39eed1793d68aac..0108ff7e50ec1a3cf164ba77019449b1039a0fb2 100644 (file)
@@ -32,28 +32,28 @@ export const userActionSet: ContextMenuActionSet = [
             name: 'Attributes',
             icon: AttributesIcon,
             execute: (dispatch, resources) => {
-                resources.forEach((resource) => dispatch<any>(openUserAttributes(resource.uuid)));
+                dispatch<any>(openUserAttributes(resources[0].uuid));
             },
         },
         {
             name: 'Project',
             icon: ProjectIcon,
             execute: (dispatch, resources) => {
-                resources.forEach((resource) => dispatch<any>(openUserProjects(resource.uuid)));
+                dispatch<any>(openUserProjects(resources[0].uuid));
             },
         },
         {
             name: 'API Details',
             icon: AdvancedIcon,
             execute: (dispatch, resources) => {
-                resources.forEach((resource) => dispatch<any>(openAdvancedTabDialog(resource.uuid)));
+                dispatch<any>(openAdvancedTabDialog(resources[0].uuid));
             },
         },
         {
             name: 'Account Settings',
             icon: UserPanelIcon,
             execute: (dispatch, resources) => {
-                resources.forEach((resource) => dispatch<any>(navigateToUserProfile(resource.uuid)));
+                dispatch<any>(navigateToUserProfile(resources[0].uuid));
             },
             filters: [needsUserProfileLink],
         },
@@ -63,7 +63,7 @@ export const userActionSet: ContextMenuActionSet = [
             name: 'Activate User',
             icon: ActiveIcon,
             execute: (dispatch, resources) => {
-                resources.forEach((resource) => dispatch<any>(openActivateDialog(resource.uuid)));
+                dispatch<any>(openActivateDialog(resources[0].uuid));
             },
             filters: [isAdmin, canActivateUser],
         },
@@ -71,7 +71,7 @@ export const userActionSet: ContextMenuActionSet = [
             name: 'Setup User',
             icon: AdminMenuIcon,
             execute: (dispatch, resources) => {
-                resources.forEach((resource) => dispatch<any>(openSetupDialog(resource.uuid)));
+                dispatch<any>(openSetupDialog(resources[0].uuid));
             },
             filters: [isAdmin, canSetupUser],
         },
@@ -79,7 +79,7 @@ export const userActionSet: ContextMenuActionSet = [
             name: 'Deactivate User',
             icon: DeactivateUserIcon,
             execute: (dispatch, resources) => {
-                resources.forEach((resource) => dispatch<any>(openDeactivateDialog(resource.uuid)));
+                dispatch<any>(openDeactivateDialog(resources[0].uuid));
             },
             filters: [isAdmin, canDeactivateUser],
         },
@@ -87,7 +87,7 @@ export const userActionSet: ContextMenuActionSet = [
             name: 'Login As User',
             icon: LoginAsIcon,
             execute: (dispatch, resources) => {
-                resources.forEach((resource) => dispatch<any>(loginAs(resource.uuid)));
+                dispatch<any>(loginAs(resources[0].uuid));
             },
             filters: [isAdmin, isOtherUser],
         },
index 7cb13bd2e747cb7f2310ef089738e34d8980c60e..a26cbe1368d4aa0c8b435af7db26f65b8c138b19 100644 (file)
@@ -13,21 +13,21 @@ export const virtualMachineActionSet: ContextMenuActionSet = [
             name: 'Attributes',
             icon: AttributesIcon,
             execute: (dispatch, resources) => {
-                resources.forEach((resource) => dispatch<any>(openVirtualMachineAttributes(resource.uuid)));
+                dispatch<any>(openVirtualMachineAttributes(resources[0].uuid));
             },
         },
         {
             name: 'API Details',
             icon: AdvancedIcon,
             execute: (dispatch, resources) => {
-                resources.forEach((resource) => dispatch<any>(openAdvancedTabDialog(resource.uuid)));
+                dispatch<any>(openAdvancedTabDialog(resources[0].uuid));
             },
         },
         {
             name: 'Remove',
             icon: RemoveIcon,
             execute: (dispatch, resources) => {
-                resources.forEach((resource) => dispatch<any>(openRemoveVirtualMachineDialog(resource.uuid)));
+                dispatch<any>(openRemoveVirtualMachineDialog(resources[0].uuid));
             },
         },
     ],
index dca06084f63bfeef74aedf896a411b7ac624f764..257eacfb294bde6b6b06c2e2aeeb0abca5a5b77d 100644 (file)
@@ -521,7 +521,6 @@ const renderResourceLink = (dispatch: Dispatch, item: Resource) => {
             color="primary"
             style={{ cursor: "pointer" }}
             onClick={() => {
-                console.log(item);
                 item.kind === ResourceKind.GROUP && (item as GroupResource).groupClass === "role"
                     ? dispatch<any>(navigateToGroupDetails(item.uuid))
                     : dispatch<any>(navigateTo(item.uuid));