[arvados-workbench2] updated: 2.6.0-11-g4710b791
git repository hosting
git at public.arvados.org
Mon May 1 18:38:22 UTC 2023
Summary of changes:
cypress/integration/collection.spec.js | 179 ++++++++++++++++++++-
.../collections/collection-partial-copy-actions.ts | 16 +-
.../collections/collection-partial-move-actions.ts | 2 +-
3 files changed, 187 insertions(+), 10 deletions(-)
via 4710b7919dcdc3435bab7bd7e706169175991cf5 (commit)
via f526bdc34a4815fd0e0978b879c6fca70c0887c8 (commit)
from 0de2dbbdaa1c0906e105cfc685affdb3d03dc9e7 (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 4710b7919dcdc3435bab7bd7e706169175991cf5
Author: Stephen Smith <stephen at curii.com>
Date: Mon May 1 14:38:00 2023 -0400
20031: Add tests for copy/move files to existing/new/separate collections
Arvados-DCO-1.1-Signed-off-by: Stephen Smith <stephen at curii.com>
diff --git a/cypress/integration/collection.spec.js b/cypress/integration/collection.spec.js
index 977a28c2..a49c18db 100644
--- a/cypress/integration/collection.spec.js
+++ b/cypress/integration/collection.spec.js
@@ -905,7 +905,7 @@ describe('Collection panel tests', function () {
});
});
- it('creates collection from selected files of another collection', () => {
+ it('copies selected files into new collection', () => {
cy.createCollection(adminUser.token, {
name: `Test Collection ${Math.floor(Math.random() * 999999)}`,
owner_uuid: activeUser.user.uuid,
@@ -934,6 +934,183 @@ describe('Collection panel tests', function () {
});
});
+ it('copies selected files into existing collection', () => {
+ cy.createCollection(adminUser.token, {
+ name: `Test Collection ${Math.floor(Math.random() * 999999)}`,
+ owner_uuid: activeUser.user.uuid,
+ preserve_version: true,
+ manifest_text: ". 37b51d194a7513e45b56f6524f2d51f2+3 0:3:foo 0:3:bar\n"
+ }).as('sourceCollection')
+
+ cy.createCollection(adminUser.token, {
+ name: `Destination Collection ${Math.floor(Math.random() * 999999)}`,
+ owner_uuid: activeUser.user.uuid,
+ preserve_version: true,
+ manifest_text: ""
+ }).as('destinationCollection');
+
+ cy.getAll('@sourceCollection', '@destinationCollection').then(function ([sourceCollection, destinationCollection]) {
+ // Visit collection, check basic information
+ cy.loginAs(activeUser)
+ cy.goToPath(`/collections/${sourceCollection.uuid}`);
+
+ cy.get('[data-cy=collection-files-panel]').within(() => {
+ cy.get('input[type=checkbox]').first().click();
+ });
+
+ cy.get('[data-cy=collection-files-panel-options-btn]').click();
+ cy.get('[data-cy=context-menu]').contains('Copy selected into existing collection').click();
+
+ cy.get('[data-cy=form-dialog]').contains(destinationCollection.name).click();
+
+ cy.get('[data-cy=form-submit-btn]').click();
+ cy.wait(2000);
+
+ cy.goToPath(`/collections/${destinationCollection.uuid}`);
+
+ cy.get('main').contains(destinationCollection.name).should('exist');
+ cy.get('[data-cy=collection-files-panel]')
+ .and('contain', 'bar');
+ });
+ });
+
+ it('copies selected files into separate collections', () => {
+ cy.createCollection(adminUser.token, {
+ name: `Test Collection ${Math.floor(Math.random() * 999999)}`,
+ owner_uuid: activeUser.user.uuid,
+ preserve_version: true,
+ manifest_text: ". 37b51d194a7513e45b56f6524f2d51f2+3 0:3:foo 0:3:bar\n"
+ }).as('sourceCollection')
+
+ cy.getAll('@sourceCollection').then(function ([sourceCollection]) {
+ // Visit collection, check basic information
+ cy.loginAs(activeUser)
+ cy.goToPath(`/collections/${sourceCollection.uuid}`);
+
+ cy.get('[data-cy=collection-files-panel]').within(() => {
+ cy.get('input[type=checkbox]').first().click();
+ });
+
+ cy.get('[data-cy=collection-files-panel-options-btn]').click();
+ cy.get('[data-cy=context-menu]').contains('Copy selected into separate collections').click();
+
+ cy.get('[data-cy=form-dialog]').contains('Projects').click();
+ cy.get('[data-cy=form-submit-btn]').click();
+
+ cy.waitForDom().get('.layout-pane-primary', { timeout: 12000 }).contains('Projects').click();
+
+ // cy.goToPath(`/collections/${destinationCollection.uuid}`);
+
+ cy.get('main').contains(`File copied from collection ${sourceCollection.name}/bar`).click();
+ cy.get('[data-cy=collection-files-panel]')
+ .and('contain', 'bar');
+ });
+ });
+
+ it('moves selected files into new collection', () => {
+ cy.createCollection(adminUser.token, {
+ name: `Test Collection ${Math.floor(Math.random() * 999999)}`,
+ owner_uuid: activeUser.user.uuid,
+ preserve_version: true,
+ manifest_text: ". 37b51d194a7513e45b56f6524f2d51f2+3 0:3:foo 0:3:bar\n"
+ })
+ .as('collection').then(function () {
+ // Visit collection, check basic information
+ cy.loginAs(activeUser)
+ cy.goToPath(`/collections/${this.collection.uuid}`);
+
+ cy.get('[data-cy=collection-files-panel]').within(() => {
+ cy.get('input[type=checkbox]').first().click();
+ });
+
+ cy.get('[data-cy=collection-files-panel-options-btn]').click();
+ cy.get('[data-cy=context-menu]').contains('Move selected into new collection').click();
+
+ cy.get('[data-cy=form-dialog]').contains('Projects').click();
+
+ cy.get('[data-cy=form-submit-btn]').click();
+
+ cy.waitForDom().get('.layout-pane-primary', { timeout: 12000 }).contains('Projects').click();
+
+ cy.get('main').contains(`Files moved from: ${this.collection.name}`).click();
+ cy.get('[data-cy=collection-files-panel]')
+ .and('contain', 'bar');
+ });
+ });
+
+ it('moves selected files into existing collection', () => {
+ cy.createCollection(adminUser.token, {
+ name: `Test Collection ${Math.floor(Math.random() * 999999)}`,
+ owner_uuid: activeUser.user.uuid,
+ preserve_version: true,
+ manifest_text: ". 37b51d194a7513e45b56f6524f2d51f2+3 0:3:foo 0:3:bar\n"
+ }).as('sourceCollection')
+
+ cy.createCollection(adminUser.token, {
+ name: `Destination Collection ${Math.floor(Math.random() * 999999)}`,
+ owner_uuid: activeUser.user.uuid,
+ preserve_version: true,
+ manifest_text: ""
+ }).as('destinationCollection');
+
+ cy.getAll('@sourceCollection', '@destinationCollection').then(function ([sourceCollection, destinationCollection]) {
+ // Visit collection, check basic information
+ cy.loginAs(activeUser)
+ cy.goToPath(`/collections/${sourceCollection.uuid}`);
+
+ cy.get('[data-cy=collection-files-panel]').within(() => {
+ cy.get('input[type=checkbox]').first().click();
+ });
+
+ cy.get('[data-cy=collection-files-panel-options-btn]').click();
+ cy.get('[data-cy=context-menu]').contains('Move selected into existing collection').click();
+
+ cy.get('[data-cy=form-dialog]').contains(destinationCollection.name).click();
+
+ cy.get('[data-cy=form-submit-btn]').click();
+ cy.wait(2000);
+
+ cy.goToPath(`/collections/${destinationCollection.uuid}`);
+
+ cy.get('main').contains(destinationCollection.name).should('exist');
+ cy.get('[data-cy=collection-files-panel]')
+ .and('contain', 'bar');
+ });
+ });
+
+ it('moves selected files into separate collections', () => {
+ cy.createCollection(adminUser.token, {
+ name: `Test Collection ${Math.floor(Math.random() * 999999)}`,
+ owner_uuid: activeUser.user.uuid,
+ preserve_version: true,
+ manifest_text: ". 37b51d194a7513e45b56f6524f2d51f2+3 0:3:foo 0:3:bar\n"
+ }).as('sourceCollection')
+
+ cy.getAll('@sourceCollection').then(function ([sourceCollection]) {
+ // Visit collection, check basic information
+ cy.loginAs(activeUser)
+ cy.goToPath(`/collections/${sourceCollection.uuid}`);
+
+ cy.get('[data-cy=collection-files-panel]').within(() => {
+ cy.get('input[type=checkbox]').first().click();
+ });
+
+ cy.get('[data-cy=collection-files-panel-options-btn]').click();
+ cy.get('[data-cy=context-menu]').contains('Move selected into separate collections').click();
+
+ cy.get('[data-cy=form-dialog]').contains('Projects').click();
+ cy.get('[data-cy=form-submit-btn]').click();
+
+ cy.waitForDom().get('.layout-pane-primary', { timeout: 12000 }).contains('Projects').click();
+
+ // cy.goToPath(`/collections/${destinationCollection.uuid}`);
+
+ cy.get('main').contains(`File moved from collection ${sourceCollection.name}/bar`).click();
+ cy.get('[data-cy=collection-files-panel]')
+ .and('contain', 'bar');
+ });
+ });
+
it('creates new collection with properties on home project', function () {
cy.loginAs(activeUser);
cy.goToPath(`/projects/${activeUser.user.uuid}`);
commit f526bdc34a4815fd0e0978b879c6fca70c0887c8
Author: Stephen Smith <stephen at curii.com>
Date: Mon May 1 14:36:45 2023 -0400
20031: Fix incorect const used for closing dialog, tweak copy/move file wording
Arvados-DCO-1.1-Signed-off-by: Stephen Smith <stephen at curii.com>
diff --git a/src/store/collections/collection-partial-copy-actions.ts b/src/store/collections/collection-partial-copy-actions.ts
index 5da7c8f1..4005098f 100644
--- a/src/store/collections/collection-partial-copy-actions.ts
+++ b/src/store/collections/collection-partial-copy-actions.ts
@@ -175,8 +175,8 @@ export const copyCollectionPartialToSeparateCollections = ({ name, projectUuid }
if (sourceCollection) {
try {
- dispatch(startSubmit(COLLECTION_PARTIAL_COPY_FORM_NAME));
- dispatch(progressIndicatorActions.START_WORKING(COLLECTION_PARTIAL_COPY_FORM_NAME));
+ dispatch(startSubmit(COLLECTION_PARTIAL_COPY_TO_SEPARATE_COLLECTIONS));
+ dispatch(progressIndicatorActions.START_WORKING(COLLECTION_PARTIAL_COPY_TO_SEPARATE_COLLECTIONS));
// Get selected files
const paths = filterCollectionFilesBySelection(state.collectionPanelFiles, true)
@@ -188,7 +188,7 @@ export const copyCollectionPartialToSeparateCollections = ({ name, projectUuid }
sourceCollection.portableDataHash,
[path],
{
- name: `File split from collection ${name}${path}`,
+ name: `File copied from collection ${name}${path}`,
ownerUuid: projectUuid,
uuid: undefined,
},
@@ -198,26 +198,26 @@ export const copyCollectionPartialToSeparateCollections = ({ name, projectUuid }
));
dispatch(updateResources(collections));
- dispatch(dialogActions.CLOSE_DIALOG({ id: COLLECTION_PARTIAL_COPY_FORM_NAME }));
+ dispatch(dialogActions.CLOSE_DIALOG({ id: COLLECTION_PARTIAL_COPY_TO_SEPARATE_COLLECTIONS }));
dispatch(snackbarActions.OPEN_SNACKBAR({
message: 'New collections created.',
hideDuration: 2000,
kind: SnackbarKind.SUCCESS
}));
- dispatch(progressIndicatorActions.STOP_WORKING(COLLECTION_PARTIAL_COPY_FORM_NAME));
+ dispatch(progressIndicatorActions.STOP_WORKING(COLLECTION_PARTIAL_COPY_TO_SEPARATE_COLLECTIONS));
} catch (e) {
const error = getCommonResourceServiceError(e);
console.log(e, error);
if (error === CommonResourceServiceError.UNIQUE_NAME_VIOLATION) {
dispatch(snackbarActions.OPEN_SNACKBAR({ message: 'Collection from one or more files already exists', hideDuration: 2000, kind: SnackbarKind.ERROR }));
} else if (error === CommonResourceServiceError.UNKNOWN) {
- dispatch(dialogActions.CLOSE_DIALOG({ id: COLLECTION_PARTIAL_COPY_FORM_NAME }));
+ dispatch(dialogActions.CLOSE_DIALOG({ id: COLLECTION_PARTIAL_COPY_TO_SEPARATE_COLLECTIONS }));
dispatch(snackbarActions.OPEN_SNACKBAR({ message: 'Could not create a copy of collection', hideDuration: 2000, kind: SnackbarKind.ERROR }));
} else {
- dispatch(dialogActions.CLOSE_DIALOG({ id: COLLECTION_PARTIAL_COPY_FORM_NAME }));
+ dispatch(dialogActions.CLOSE_DIALOG({ id: COLLECTION_PARTIAL_COPY_TO_SEPARATE_COLLECTIONS }));
dispatch(snackbarActions.OPEN_SNACKBAR({ message: 'Collection has been copied but may contain incorrect files.', hideDuration: 2000, kind: SnackbarKind.ERROR }));
}
- dispatch(progressIndicatorActions.STOP_WORKING(COLLECTION_PARTIAL_COPY_FORM_NAME));
+ dispatch(progressIndicatorActions.STOP_WORKING(COLLECTION_PARTIAL_COPY_TO_SEPARATE_COLLECTIONS));
}
}
};
diff --git a/src/store/collections/collection-partial-move-actions.ts b/src/store/collections/collection-partial-move-actions.ts
index 8b4492ef..afd35461 100644
--- a/src/store/collections/collection-partial-move-actions.ts
+++ b/src/store/collections/collection-partial-move-actions.ts
@@ -185,7 +185,7 @@ export const moveCollectionPartialToSeparateCollections = ({ name, projectUuid }
sourceCollection.portableDataHash,
[path],
{
- name: `File split from collection ${name}${path}`,
+ name: `File moved from collection ${name}${path}`,
ownerUuid: projectUuid,
uuid: undefined,
},
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list