[ARVADOS-WORKBENCH2] created: 2.4.0-55-g6cba13dd
Git user
git at public.arvados.org
Thu May 19 15:37:21 UTC 2022
at 6cba13dd33c09ab8255b847aa4a614d3cf6eee8a (commit)
commit 6cba13dd33c09ab8255b847aa4a614d3cf6eee8a
Author: Daniel Kutyła <daniel.kutyla at contractors.roche.com>
Date: Thu May 19 17:36:17 2022 +0200
19052: fixed wrong owner being displayed added test
Arvados-DCO-1.1-Signed-off-by: Daniel Kutyła <daniel.kutyla at contractors.roche.com>
diff --git a/cypress/integration/search.spec.js b/cypress/integration/search.spec.js
index 491292be..5434ca24 100644
--- a/cypress/integration/search.spec.js
+++ b/cypress/integration/search.spec.js
@@ -104,4 +104,26 @@ describe('Search tests', function() {
cy.get('[data-cy=element-path]').should('contain', `/ Projects / ${colName}`);
});
});
+
+ it('can display owner of the item', function() {
+ const colName = `Collection ${Math.floor(Math.random() * Math.floor(999999))}`;
+
+ cy.createCollection(adminUser.token, {
+ name: colName,
+ owner_uuid: activeUser.user.uuid,
+ preserve_version: true,
+ manifest_text: ". 37b51d194a7513e45b56f6524f2d51f2+3 0:3:bar\n"
+ }).then(function() {
+ cy.loginAs(activeUser);
+
+ cy.doSearch(colName);
+
+ cy.get('[data-cy=search-results]').should('contain', colName);
+
+ cy.get('[data-cy=search-results]').contains(colName).closest('tr')
+ .within(() => {
+ cy.get('p').contains(activeUser.user.uuid).should('contain', activeUser.user.full_name);
+ });
+ });
+ });
});
\ No newline at end of file
diff --git a/src/views-components/data-explorer/renderers.tsx b/src/views-components/data-explorer/renderers.tsx
index cd9f972e..3edce4f8 100644
--- a/src/views-components/data-explorer/renderers.tsx
+++ b/src/views-components/data-explorer/renderers.tsx
@@ -713,9 +713,18 @@ const userFromID =
return { uuid: props.uuid, userFullname };
});
+const ownerFromResourceId =
+ compose(
+ connect((state: RootState, props: { uuid: string }) => {
+ const childResource = getResource<GroupContentsResource & UserResource>(props.uuid)(state.resources);
+ return { uuid: childResource ? (childResource as Resource).ownerUuid : '' };
+ }),
+ userFromID
+ );
+
export const ResourceOwnerWithName =
compose(
- userFromID,
+ ownerFromResourceId,
withStyles({}, { withTheme: true }))
((props: { uuid: string, userFullname: string, dispatch: Dispatch, theme: ArvadosTheme }) => {
const { uuid, userFullname, dispatch, theme } = props;
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list