[ARVADOS-WORKBENCH2] updated: 2.1.0-109-gc345c171

Git user git at public.arvados.org
Wed Nov 25 16:08:51 UTC 2020


Summary of changes:
 cypress/integration/collection-panel.spec.js       |  8 ++--
 .../action-sets/collection-action-set.ts           | 45 +++++++++++++++-------
 2 files changed, 37 insertions(+), 16 deletions(-)

       via  c345c171d74d5855d400a8559620f69a87fdb04c (commit)
      from  3b2372cd1ce9528803e32393132b16645aff25f7 (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 c345c171d74d5855d400a8559620f69a87fdb04c
Author: Lucas Di Pentima <lucas at di-pentima.com.ar>
Date:   Wed Nov 25 13:08:19 2020 -0300

    17098: Avoids offering the 'Add to favorites' action on old versions.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas at di-pentima.com.ar>

diff --git a/cypress/integration/collection-panel.spec.js b/cypress/integration/collection-panel.spec.js
index a44edd7e..0a127db7 100644
--- a/cypress/integration/collection-panel.spec.js
+++ b/cypress/integration/collection-panel.spec.js
@@ -352,9 +352,11 @@ describe('Collection panel tests', function() {
             cy.get('[data-cy=collection-files-panel]')
                 .should('contain', 'foo').and('contain', 'bar');
 
-            // Check that old collection action is available on context menu
-            cy.get('[data-cy=collection-panel-options-btn]').click()
-            cy.get('[data-cy=context-menu]').should('contain', 'Recover version')
+            // 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')
+                .and('not.contain', 'Add to favorites');
             cy.get('body').click(); // Collapse the menu avoiding details panel expansion
 
             // Click on "head version" link, confirm that it's the latest version.
diff --git a/src/views-components/context-menu/action-sets/collection-action-set.ts b/src/views-components/context-menu/action-sets/collection-action-set.ts
index 7e4c7b98..a870a813 100644
--- a/src/views-components/context-menu/action-sets/collection-action-set.ts
+++ b/src/views-components/context-menu/action-sets/collection-action-set.ts
@@ -2,10 +2,23 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import { ContextMenuActionSet } from "../context-menu-action-set";
+import {
+    ContextMenuAction,
+    ContextMenuActionSet
+} from "../context-menu-action-set";
 import { ToggleFavoriteAction } from "../actions/favorite-action";
 import { toggleFavorite } from "~/store/favorites/favorites-actions";
-import { RenameIcon, ShareIcon, MoveToIcon, CopyIcon, DetailsIcon, AdvancedIcon, OpenIcon, Link, RecoverVersionIcon } from "~/components/icon/icon";
+import {
+    RenameIcon,
+    ShareIcon,
+    MoveToIcon,
+    CopyIcon,
+    DetailsIcon,
+    AdvancedIcon,
+    OpenIcon,
+    Link,
+    RecoverVersionIcon
+} from "~/components/icon/icon";
 import { openCollectionUpdateDialog } from "~/store/collections/collection-update-actions";
 import { favoritePanelActions } from "~/store/favorite-panel/favorite-panel-action";
 import { openMoveCollectionDialog } from '~/store/collections/collection-move-actions';
@@ -21,16 +34,17 @@ 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";
 
-export const readOnlyCollectionActionSet: ContextMenuActionSet = [[
-    {
-        component: ToggleFavoriteAction,
-        name: 'ToggleFavoriteAction',
-        execute: (dispatch, resource) => {
-            dispatch<any>(toggleFavorite(resource)).then(() => {
-                dispatch<any>(favoritePanelActions.REQUEST_ITEMS());
-            });
-        }
-    },
+const toggleFavoriteAction: ContextMenuAction = {
+    component: ToggleFavoriteAction,
+    name: 'ToggleFavoriteAction',
+    execute: (dispatch, resource) => {
+        dispatch<any>(toggleFavorite(resource)).then(() => {
+            dispatch<any>(favoritePanelActions.REQUEST_ITEMS());
+        });
+    }
+};
+
+const commonActionSet: ContextMenuActionSet = [[
     {
         icon: OpenIcon,
         name: "Open in new tab",
@@ -69,6 +83,11 @@ export const readOnlyCollectionActionSet: ContextMenuActionSet = [[
     },
 ]];
 
+export const readOnlyCollectionActionSet: ContextMenuActionSet = [[
+    ...commonActionSet.reduce((prev, next) => prev.concat(next), []),
+    toggleFavoriteAction,
+]];
+
 export const collectionActionSet: ContextMenuActionSet = [
     [
         ...readOnlyCollectionActionSet.reduce((prev, next) => prev.concat(next), []),
@@ -118,7 +137,7 @@ export const collectionAdminActionSet: ContextMenuActionSet = [
 
 export const oldCollectionVersionActionSet: ContextMenuActionSet = [
     [
-        ...readOnlyCollectionActionSet.reduce((prev, next) => prev.concat(next), []),
+        ...commonActionSet.reduce((prev, next) => prev.concat(next), []),
         {
             icon: RecoverVersionIcon,
             name: 'Recover version',

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list