17098: Improves wording on the "Restore version" action. 17098-old-version-as-head
authorLucas Di Pentima <lucas@di-pentima.com.ar>
Tue, 1 Dec 2020 21:26:32 +0000 (18:26 -0300)
committerLucas Di Pentima <lucas@di-pentima.com.ar>
Tue, 1 Dec 2020 21:26:32 +0000 (18:26 -0300)
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas@di-pentima.com.ar>

cypress/integration/collection-panel.spec.js
src/components/icon/icon.tsx
src/store/collection-panel/collection-panel-files/collection-panel-files-actions.ts
src/store/collections/collection-version-actions.ts
src/views-components/collections-dialog/restore-version-dialog.ts [moved from src/views-components/collections-dialog/recover-version-dialog.ts with 70% similarity]
src/views-components/context-menu/action-sets/collection-action-set.ts
src/views/workbench/workbench.tsx

index 183a363613ad384b48e2ba4799693dbff12178f8..980c55056530bea82c80e4dc0bb2713e2d2f6f97 100644 (file)
@@ -355,7 +355,7 @@ describe('Collection panel tests', function() {
             // Check that only old collection action are available on context menu
             cy.get('[data-cy=collection-panel-options-btn]').click();
             cy.get('[data-cy=context-menu]')
-                .should('contain', 'Recover version')
+                .should('contain', 'Restore version')
                 .and('not.contain', 'Add to favorites');
             cy.get('body').click(); // Collapse the menu avoiding details panel expansion
 
@@ -371,7 +371,7 @@ describe('Collection panel tests', function() {
 
             // Check that old collection action isn't available on context menu
             cy.get('[data-cy=collection-panel-options-btn]').click()
-            cy.get('[data-cy=context-menu]').should('not.contain', 'Recover version')
+            cy.get('[data-cy=context-menu]').should('not.contain', 'Restore version')
             cy.get('body').click(); // Collapse the menu avoiding details panel expansion
 
             // Make another change, confirm new version.
@@ -409,13 +409,13 @@ describe('Collection panel tests', function() {
                 .and('not.contain', 'Edit collection');
             cy.get('body').click();
 
-            // Recover first version
+            // Restore first version
             cy.get('[data-cy=collection-version-browser]').within(() => {
                 cy.get('[data-cy=collection-version-browser-select-1]').click();
             });
             cy.get('[data-cy=collection-panel-options-btn]').click()
-            cy.get('[data-cy=context-menu]').contains('Recover version').click();
-            cy.get('[data-cy=confirmation-dialog]').should('contain', 'Recover version');
+            cy.get('[data-cy=context-menu]').contains('Restore version').click();
+            cy.get('[data-cy=confirmation-dialog]').should('contain', 'Restore version');
             cy.get('[data-cy=confirmation-dialog-ok-btn]').click();
             cy.get('[data-cy=collection-info-panel]')
                 .should('not.contain', 'This is an old version');
index dbb4ccec2851b73495b247033e1d0a6dd100dc2c..ffba2876843ef4ce06de9708398cbb926f01e366 100644 (file)
@@ -130,7 +130,7 @@ export const RemoveIcon: IconType = (props) => <Delete {...props} />;
 export const RemoveFavoriteIcon: IconType = (props) => <Star {...props} />;
 export const PublicFavoriteIcon: IconType = (props) => <Public {...props} />;
 export const RenameIcon: IconType = (props) => <Edit {...props} />;
-export const RecoverVersionIcon: IconType = (props) => <FlipToFront {...props} />;
+export const RestoreVersionIcon: IconType = (props) => <FlipToFront {...props} />;
 export const RestoreFromTrashIcon: IconType = (props) => <RestoreFromTrash {...props} />;
 export const ReRunProcessIcon: IconType = (props) => <Cached {...props} />;
 export const SearchIcon: IconType = (props) => <Search {...props} />;
index 3f9948fca034e3915e9bcebddd56d64bd4109e1a..80d61ea04cb3efbf42c1904a223d5165c45c7d44 100644 (file)
@@ -42,10 +42,10 @@ export const loadCollectionFiles = (uuid: string) =>
             const mapped = mapTreeValues(services.collectionService.extendFileURL)(sorted);
             dispatch(collectionPanelFilesAction.SET_COLLECTION_FILES(mapped));
             dispatch(progressIndicatorActions.STOP_WORKING(COLLECTION_PANEL_LOAD_FILES));
-        }).catch(e => {
+        }).catch(() => {
             dispatch(progressIndicatorActions.STOP_WORKING(COLLECTION_PANEL_LOAD_FILES));
             dispatch(snackbarActions.OPEN_SNACKBAR({
-                message: `Error getting file list: ${e.errors[0]}`,
+                message: `Error getting file list`,
                 hideDuration: 2000,
                 kind: SnackbarKind.ERROR }));
         });
index fe8bd2d18cbe54437b694e275c480683445224cc..5bf474979a92178c8a042f73453f0140e9dd8e65 100644 (file)
@@ -10,22 +10,22 @@ import { resourcesActions } from "../resources/resources-actions";
 import { navigateTo } from "../navigation/navigation-action";
 import { dialogActions } from "../dialog/dialog-actions";
 
-export const COLLECTION_RECOVER_VERSION_DIALOG = 'collectionRecoverVersionDialog';
+export const COLLECTION_RESTORE_VERSION_DIALOG = 'collectionRestoreVersionDialog';
 
-export const openRecoverCollectionVersionDialog = (uuid: string) =>
+export const openRestoreCollectionVersionDialog = (uuid: string) =>
     (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
         dispatch(dialogActions.OPEN_DIALOG({
-            id: COLLECTION_RECOVER_VERSION_DIALOG,
+            id: COLLECTION_RESTORE_VERSION_DIALOG,
             data: {
-                title: 'Recover version',
-                text: "Do you want to make this the new collection's head version? If you don't want to modify the current head version, you can just make a copy.",
-                confirmButtonLabel: 'Recover',
+                title: 'Restore version',
+                text: "This will copy the content of the selected version to the head. To make a new collection with the content of the selected version, use 'Make a copy' instead.",
+                confirmButtonLabel: 'Restore',
                 uuid
             }
         }));
     };
 
-export const recoverVersion = (resourceUuid: string) =>
+export const restoreVersion = (resourceUuid: string) =>
     async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
         try {
             // Request que entire record because stored old versions usually
@@ -40,7 +40,7 @@ export const recoverVersion = (resourceUuid: string) =>
             dispatch<any>(navigateTo(headVersion.uuid));
         } catch (e) {
             dispatch(snackbarActions.OPEN_SNACKBAR({
-                message: `Couldn't recover version: ${e.errors[0]}`,
+                message: `Couldn't restore version: ${e.errors[0]}`,
                 hideDuration: 2000,
                 kind: SnackbarKind.ERROR
             }));
similarity index 70%
rename from src/views-components/collections-dialog/recover-version-dialog.ts
rename to src/views-components/collections-dialog/restore-version-dialog.ts
index 0da9ed1707fa4b8ec5535be8db736f796f20b921..efd7989548e29388438d5e8473fda665574acc10 100644 (file)
@@ -6,16 +6,16 @@ import { Dispatch, compose } from 'redux';
 import { connect } from "react-redux";
 import { ConfirmationDialog } from "~/components/confirmation-dialog/confirmation-dialog";
 import { withDialog, WithDialogProps } from "~/store/dialog/with-dialog";
-import { COLLECTION_RECOVER_VERSION_DIALOG, recoverVersion } from '~/store/collections/collection-version-actions';
+import { COLLECTION_RESTORE_VERSION_DIALOG, restoreVersion } from '~/store/collections/collection-version-actions';
 
 const mapDispatchToProps = (dispatch: Dispatch, props: WithDialogProps<any>) => ({
     onConfirm: () => {
         props.closeDialog();
-        dispatch<any>(recoverVersion(props.data.uuid));
+        dispatch<any>(restoreVersion(props.data.uuid));
     }
 });
 
-export const RecoverCollectionVersionDialog = compose(
-    withDialog(COLLECTION_RECOVER_VERSION_DIALOG),
+export const RestoreCollectionVersionDialog = compose(
+    withDialog(COLLECTION_RESTORE_VERSION_DIALOG),
     connect(null, mapDispatchToProps)
 )(ConfirmationDialog);
\ No newline at end of file
index d32eaa3f82d216f0de5ee59c6611ddf38b698a54..4a6c910b5f3b5b9f4b9720e360f60369fff948fd 100644 (file)
@@ -17,7 +17,7 @@ import {
     AdvancedIcon,
     OpenIcon,
     Link,
-    RecoverVersionIcon
+    RestoreVersionIcon
 } from "~/components/icon/icon";
 import { openCollectionUpdateDialog } from "~/store/collections/collection-update-actions";
 import { favoritePanelActions } from "~/store/favorite-panel/favorite-panel-action";
@@ -29,7 +29,7 @@ import { openSharingDialog } from '~/store/sharing-dialog/sharing-dialog-actions
 import { openAdvancedTabDialog } from "~/store/advanced-tab/advanced-tab";
 import { toggleDetailsPanel } from '~/store/details-panel/details-panel-action';
 import { copyToClipboardAction, openInNewTabAction } from "~/store/open-in-new-tab/open-in-new-tab.actions";
-import { openRecoverCollectionVersionDialog } from "~/store/collections/collection-version-actions";
+import { openRestoreCollectionVersionDialog } from "~/store/collections/collection-version-actions";
 import { TogglePublicFavoriteAction } from "../actions/public-favorite-action";
 import { togglePublicFavorite } from "~/store/public-favorites/public-favorites-actions";
 import { publicFavoritePanelActions } from "~/store/public-favorites-panel/public-favorites-action";
@@ -139,10 +139,10 @@ export const oldCollectionVersionActionSet: ContextMenuActionSet = [
     [
         ...commonActionSet.reduce((prev, next) => prev.concat(next), []),
         {
-            icon: RecoverVersionIcon,
-            name: 'Recover version',
+            icon: RestoreVersionIcon,
+            name: 'Restore version',
             execute: (dispatch, { uuid }) => {
-                dispatch<any>(openRecoverCollectionVersionDialog(uuid));
+                dispatch<any>(openRestoreCollectionVersionDialog(uuid));
             }
         },
     ]
index 8e47a739a023862ea540becdf7192dccd8244362..9f4a5cb5e09a08c22d7499ea02d3a309a7551a1e 100644 (file)
@@ -99,7 +99,7 @@ import { CollectionsContentAddressPanel } from '~/views/collection-content-addre
 import { AllProcessesPanel } from '../all-processes-panel/all-processes-panel';
 import { NotFoundPanel } from '../not-found-panel/not-found-panel';
 import { AutoLogout } from '~/views-components/auto-logout/auto-logout';
-import { RecoverCollectionVersionDialog } from '~/views-components/collections-dialog/recover-version-dialog';
+import { RestoreCollectionVersionDialog } from '~/views-components/collections-dialog/restore-version-dialog';
 
 type CssRules = 'root' | 'container' | 'splitter' | 'asidePanel' | 'contentWrapper' | 'content';
 
@@ -236,7 +236,7 @@ export const WorkbenchPanel =
             <ProcessCommandDialog />
             <ProcessInputDialog />
             <ProjectPropertiesDialog />
-            <RecoverCollectionVersionDialog />
+            <RestoreCollectionVersionDialog />
             <RemoveApiClientAuthorizationDialog />
             <RemoveComputeNodeDialog />
             <RemoveGroupDialog />