[ARVADOS-WORKBENCH2] updated: 2.1.0-114-g00f62631

Git user git at public.arvados.org
Wed Nov 25 17:54:57 UTC 2020


Summary of changes:
 cypress/integration/collection-panel.spec.js       | 15 +++++++++++++++
 .../details-panel/collection-details.tsx           | 22 ++++++++++++++++++++--
 2 files changed, 35 insertions(+), 2 deletions(-)

       via  00f6263122e23665b758b0182e9d478844713bf9 (commit)
       via  eda7767bc88b7a2a3dc582af47417937ff4de38a (commit)
       via  3c2e32130d4229eada68f21d4000da9a0f844ba4 (commit)
       via  306d28fed8af239094ca8eaf956d3410fafc031b (commit)
      from  673bf2ac4b09da2d868fdb99123d72f23d2f88cf (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 00f6263122e23665b758b0182e9d478844713bf9
Author: Lucas Di Pentima <lucas at di-pentima.com.ar>
Date:   Wed Nov 25 14:54:07 2020 -0300

    17098: Adjusts resourceUuidToContextMenuKind() call on version browser.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas at di-pentima.com.ar>

diff --git a/src/views-components/details-panel/collection-details.tsx b/src/views-components/details-panel/collection-details.tsx
index 6066a588..d31a83d1 100644
--- a/src/views-components/details-panel/collection-details.tsx
+++ b/src/views-components/details-panel/collection-details.tsx
@@ -14,8 +14,7 @@ import { Grid, ListItem, StyleRulesCallback, Typography, withStyles, WithStyles
 import { formatDate, formatFileSize } from '~/common/formatters';
 import { Dispatch } from 'redux';
 import { navigateTo } from '~/store/navigation/navigation-action';
-import { resourceKindToContextMenuKind, openContextMenu } from '~/store/context-menu/context-menu-actions';
-import { ContextMenuKind } from '../context-menu/context-menu';
+import { openContextMenu, resourceUuidToContextMenuKind } from '~/store/context-menu/context-menu-actions';
 
 export type CssRules = 'versionBrowserHeader' | 'versionBrowserItem';
 
@@ -67,7 +66,7 @@ interface CollectionVersionBrowserProps {
 
 interface CollectionVersionBrowserDispatchProps {
     showVersion: (c: CollectionResource) => void;
-    handleContextMenu: (event: React.MouseEvent<HTMLElement>, collection: CollectionResource, menuKind: ContextMenuKind | undefined) => void;
+    handleContextMenu: (event: React.MouseEvent<HTMLElement>, collection: CollectionResource) => void;
 }
 
 const mapStateToProps = (state: RootState): CollectionVersionBrowserProps => {
@@ -84,7 +83,8 @@ const mapStateToProps = (state: RootState): CollectionVersionBrowserProps => {
 const mapDispatchToProps = () =>
     (dispatch: Dispatch): CollectionVersionBrowserDispatchProps => ({
         showVersion: (collection) => dispatch<any>(navigateTo(collection.uuid)),
-        handleContextMenu: (event: React.MouseEvent<HTMLElement>, collection: CollectionResource, menuKind: ContextMenuKind) => {
+        handleContextMenu: (event: React.MouseEvent<HTMLElement>, collection: CollectionResource) => {
+            const menuKind = dispatch<any>(resourceUuidToContextMenuKind(collection.uuid));
             if (collection && menuKind) {
                 dispatch<any>(openContextMenu(event, {
                     name: collection.name,
@@ -125,14 +125,7 @@ const CollectionVersionBrowser = withStyles(styles)(
                             data-cy={`collection-version-browser-select-${item.version}`}
                             key={item.version}
                             onClick={e => showVersion(item)}
-                            onContextMenu={event => handleContextMenu(
-                                event,
-                                item,
-                                resourceKindToContextMenuKind(
-                                    item.uuid,
-                                    isAdmin,
-                                    (item.uuid === item.currentVersionUuid))
-                            )}
+                            onContextMenu={event => handleContextMenu(event, item)}
                             selected={isSelectedVersion}>
                             <Grid item xs={2}>
                                 <Typography variant="caption" className={classes.versionBrowserItem}>

commit eda7767bc88b7a2a3dc582af47417937ff4de38a
Merge: 673bf2ac 3c2e3213
Author: Lucas Di Pentima <lucas at di-pentima.com.ar>
Date:   Wed Nov 25 14:53:29 2020 -0300

    17098: Merge branch 'master' into 17098-old-version-as-head
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas at di-pentima.com.ar>

diff --cc cypress/integration/collection-panel.spec.js
index 59b80e67,377f11d9..9c5c656a
--- a/cypress/integration/collection-panel.spec.js
+++ b/cypress/integration/collection-panel.spec.js
@@@ -394,18 -382,20 +394,33 @@@ describe('Collection panel tests', func
              cy.get('[data-cy=collection-version-browser-select-3]')
                  .should('contain', '3').and('contain', '3 B');
  
+             // Check context menus on version browser
+             cy.get('[data-cy=collection-version-browser-select-3]').rightclick()
+             cy.get('[data-cy=context-menu]')
+                 .should('contain', 'Add to favorites')
+                 .and('contain', 'Make a copy')
+                 .and('contain', 'Edit collection');
+             cy.get('body').click();
+             // (and now an old version...)
+             cy.get('[data-cy=collection-version-browser-select-1]').rightclick()
+             cy.get('[data-cy=context-menu]')
 -                .should('contain', 'Add to favorites')
++                .should('not.contain', 'Add to favorites')
+                 .and('contain', 'Make a copy')
+                 .and('not.contain', 'Edit collection');
+             cy.get('body').click();
++
 +            // Recover 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=collection-info-panel]')
 +                .should('not.contain', 'This is an old version');
 +            cy.get('[data-cy=collection-version-number]').should('contain', '4');
 +            cy.get('[data-cy=collection-info-panel]').should('contain', colName);
 +            cy.get('[data-cy=collection-files-panel]')
 +                .should('contain', 'foo').and('contain', 'bar');
          });
      });
  })

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list