[ARVADOS-WORKBENCH2] created: 2.3.0-161-gb6bcf00e
Git user
git at public.arvados.org
Tue Feb 15 19:25:31 UTC 2022
at b6bcf00e089f6f14f59a031ab0139b5420df9bdd (commit)
commit b6bcf00e089f6f14f59a031ab0139b5420df9bdd
Author: Lucas Di Pentima <lucas.dipentima at curii.com>
Date: Tue Feb 15 16:24:35 2022 -0300
18315: Only limit the fetchData() call on PDH changes.
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas.dipentima at curii.com>
diff --git a/src/components/collection-panel-files/collection-panel-files.tsx b/src/components/collection-panel-files/collection-panel-files.tsx
index 459d9d20..1ee6df30 100644
--- a/src/components/collection-panel-files/collection-panel-files.tsx
+++ b/src/components/collection-panel-files/collection-panel-files.tsx
@@ -278,13 +278,12 @@ export const CollectionPanelFiles = withStyles(styles)(connect((state: RootState
}
}, [rightKey]); // eslint-disable-line react-hooks/exhaustive-deps
+ const currentPDH = (collectionPanel.item || {}).portableDataHash;
React.useEffect(() => {
- const hash = (collectionPanel.item || {}).portableDataHash;
-
- if (hash && collectionAutofetchEnabled) {
+ if (currentPDH) {
fetchData([leftKey, rightKey], true);
}
- }, [(collectionPanel.item || {}).portableDataHash]); // eslint-disable-line react-hooks/exhaustive-deps
+ }, [currentPDH]); // eslint-disable-line react-hooks/exhaustive-deps
React.useEffect(() => {
if (rightData) {
commit 0a7823d45623c1472f0ddc9b3e1dfa5619be2353
Author: Lucas Di Pentima <lucas.dipentima at curii.com>
Date: Fri Feb 11 19:25:15 2022 -0300
18315: Adds test exposing bug in file browser.
The collection's file browser doesn't update when clicking on the Refresh
button.
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas.dipentima at curii.com>
diff --git a/cypress/integration/collection.spec.js b/cypress/integration/collection.spec.js
index 91f58904..a6146ba2 100644
--- a/cypress/integration/collection.spec.js
+++ b/cypress/integration/collection.spec.js
@@ -626,6 +626,35 @@ describe('Collection panel tests', function () {
});
});
+ it('updates the collection UI contents by using the Refresh button', function () {
+ const collName = `Test Collection ${Math.floor(Math.random() * 999999)}`;
+ const fileName = 'foobar'
+
+ cy.createCollection(adminUser.token, {
+ name: collName,
+ owner_uuid: activeUser.user.uuid,
+ }).as('testCollection');
+
+ cy.getAll('@testCollection').then(function ([testCollection]) {
+ cy.loginAs(activeUser);
+ cy.goToPath(`/collections/${testCollection.uuid}`);
+ cy.get('[data-cy=collection-files-panel]').should('contain', 'This collection is empty');
+ cy.get('[data-cy=collection-files-panel]').should('not.contain', fileName);
+ cy.get('[data-cy=collection-info-panel]').should('contain', collName);
+
+ cy.updateCollection(adminUser.token, testCollection.uuid, {
+ name: `${collName + ' updated'}`,
+ manifest_text: `. 37b51d194a7513e45b56f6524f2d51f2+3 0:3:${fileName}\n`,
+ }).as('updatedCollection');
+ cy.getAll('@updatedCollection').then(function ([updatedCollection]) {
+ cy.contains('Refresh').click();
+ expect(updatedCollection.name).to.equal(`${collName + ' updated'}`);
+ cy.get('[data-cy=collection-info-panel]').should('contain', updatedCollection.name);
+ cy.get('[data-cy=collection-files-panel]').should('contain', fileName);
+ });
+ });
+ })
+
it('makes a copy of an existing collection', function() {
const collName = `Test Collection ${Math.floor(Math.random() * 999999)}`;
const copyName = `Copy of: ${collName}`;
diff --git a/cypress/integration/side-panel.spec.js b/cypress/integration/side-panel.spec.js
index afe326e3..4c824d32 100644
--- a/cypress/integration/side-panel.spec.js
+++ b/cypress/integration/side-panel.spec.js
@@ -82,7 +82,6 @@ describe('Side panel tests', function() {
group_class: 'filter',
properties: {filters: []},
}).as('myFavoriteFilterGroup').then(function (myFavoriteFilterGroup) {
- cy.contains('Refresh').click();
cy.goToPath(`/projects/${myFavoriteFilterGroup.uuid}`);
cy.get('[data-cy=breadcrumb-last]').should('contain', 'my-favorite-filter-group');
diff --git a/src/components/collection-panel-files/collection-panel-files.tsx b/src/components/collection-panel-files/collection-panel-files.tsx
index 1ef6b5c9..459d9d20 100644
--- a/src/components/collection-panel-files/collection-panel-files.tsx
+++ b/src/components/collection-panel-files/collection-panel-files.tsx
@@ -567,7 +567,7 @@ export const CollectionPanelFiles = withStyles(styles)(connect((state: RootState
</div>
}
}
- </FixedSizeList> : <div className={classes.rowEmpty}>No data available</div>
+ </FixedSizeList> : <div className={classes.rowEmpty}>This collection is empty</div>
}}
</AutoSizer> : <div className={classes.row}><CircularProgress className={classes.loader} size={30} /></div>
}
diff --git a/tools/arvados_config.yml b/tools/arvados_config.yml
index 55dc8a02..b9bcfbe0 100644
--- a/tools/arvados_config.yml
+++ b/tools/arvados_config.yml
@@ -15,6 +15,8 @@ Clusters:
ForwardSlashNameSubstitution: /
ManagedProperties:
original_owner_uuid: {Function: original_owner, Protected: true}
+ WebDAVCache:
+ UUIDTTL: 0s
Login:
PAM:
Enable: true
commit efb6e397a2d9ec98c8a9fa1f47bea66d8651bb81
Author: Lucas Di Pentima <lucas.dipentima at curii.com>
Date: Fri Feb 11 18:04:16 2022 -0300
18315: Adds file upload test proving that the UI is correctly updated.
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas.dipentima at curii.com>
diff --git a/cypress/integration/collection.spec.js b/cypress/integration/collection.spec.js
index f6547aae..91f58904 100644
--- a/cypress/integration/collection.spec.js
+++ b/cypress/integration/collection.spec.js
@@ -890,17 +890,15 @@ describe('Collection panel tests', function () {
name: `Test collection ${Math.floor(Math.random() * 999999)}`,
owner_uuid: activeUser.user.uuid,
manifest_text: ". 37b51d194a7513e45b56f6524f2d51f2+3 0:3:bar\n"
- })
- .as('testCollection1');
+ }).as('testCollection1');
cy.createCollection(adminUser.token, {
name: `Test collection ${Math.floor(Math.random() * 999999)}`,
owner_uuid: adminUser.user.uuid,
manifest_text: ". 37b51d194a7513e45b56f6524f2d51f2+3 0:3:bar\n"
- })
- .as('testCollection2').then(function (testCollection2) {
- cy.shareWith(adminUser.token, activeUser.user.uuid, testCollection2.uuid, 'can_write');
- });
+ }).as('testCollection2').then(function (testCollection2) {
+ cy.shareWith(adminUser.token, activeUser.user.uuid, testCollection2.uuid, 'can_write');
+ });
cy.getAll('@testCollection1', '@testCollection2')
.then(function ([testCollection1, testCollection2]) {
@@ -922,8 +920,29 @@ describe('Collection panel tests', function () {
name: `Test collection ${Math.floor(Math.random() * 999999)}`,
owner_uuid: activeUser.user.uuid,
manifest_text: ". 37b51d194a7513e45b56f6524f2d51f2+3 0:3:bar\n"
- })
- .as('testCollection1');
+ }).as('testCollection1');
+ });
+
+ it('uploads a file and checks the collection UI to be fresh', () => {
+ cy.getAll('@testCollection1')
+ .then(function([testCollection1]) {
+ cy.loginAs(activeUser);
+ cy.goToPath(`/collections/${testCollection1.uuid}`);
+ cy.get('[data-cy=upload-button]').click();
+ cy.get('[data-cy=collection-files-panel]')
+ .contains('5mb_a.bin').should('not.exist');
+ cy.get('[data-cy=collection-file-count]').should('contain', '1');
+ cy.fixture('files/5mb.bin', 'base64').then(content => {
+ cy.get('[data-cy=drag-and-drop]').upload(content, '5mb_a.bin');
+ cy.get('[data-cy=form-submit-btn]').click();
+ cy.get('[data-cy=form-submit-btn]').should('not.exist');
+ });
+ // Confirm that the file browser has been updated.
+ cy.get('[data-cy=collection-files-panel]')
+ .contains('5mb_a.bin').should('exist');
+ // Confirm that the collection panel has been updated.
+ cy.get('[data-cy=collection-file-count]').should('contain', '2');
+ });
});
it('allows to cancel running upload', () => {
diff --git a/src/views/collection-panel/collection-panel.tsx b/src/views/collection-panel/collection-panel.tsx
index d513cfb4..dce8ef8f 100644
--- a/src/views/collection-panel/collection-panel.tsx
+++ b/src/views/collection-panel/collection-panel.tsx
@@ -323,7 +323,7 @@ export const CollectionDetailsAttributes = (props: CollectionDetailsProps) => {
</Grid>
<Grid item xs={12} md={mdSize}>
<DetailsAttribute classLabel={classes.label} classValue={classes.value}
- label='Number of files' value={item.fileCount} />
+ label='Number of files' value={<span data-cy='collection-file-count'>{item.fileCount}</span>} />
</Grid>
<Grid item xs={12} md={mdSize}>
<DetailsAttribute classLabel={classes.label} classValue={classes.value}
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list