17205: Fixed types 17205-render-owner-name
authorDaniel Kutyła <daniel.kutyla@contractors.roche.com>
Wed, 3 Feb 2021 19:29:08 +0000 (20:29 +0100)
committerDaniel Kutyła <daniel.kutyla@contractors.roche.com>
Wed, 3 Feb 2021 19:29:08 +0000 (20:29 +0100)
Arvados-DCO-1.1-Signed-off-by: Daniel Kutyła <daniel.kutyla@contractors.roche.com>

src/views-components/data-explorer/renderers.tsx
src/views-components/details-panel/project-details.tsx
src/views/collection-panel/collection-panel.tsx

index 7d870bc1058472e165360cda2dc1fdb65e5c3276..6cf29faecf444683540de031966273298fc19314 100644 (file)
@@ -20,7 +20,7 @@ import { WorkflowResource } from '~/models/workflow';
 import { ResourceStatus as WorkflowStatus } from '~/views/workflow-panel/workflow-panel-view';
 import { getUuidPrefix, openRunProcess } from '~/store/workflow-panel/workflow-panel-actions';
 import { openSharingDialog } from '~/store/sharing-dialog/sharing-dialog-actions';
-import { UserResource } from '~/models/user';
+import { getUserFullname, User, UserResource } from '~/models/user';
 import { toggleIsActive, toggleIsAdmin } from '~/store/users/users-actions';
 import { LinkResource } from '~/models/link';
 import { navigateTo } from '~/store/navigation/navigation-action';
@@ -440,10 +440,10 @@ export const ResourceOwnerWithName =
         connect(
             (state: RootState, props: { uuid: string }) => {
                 let ownerName = '';
-                const resource = getResource<GroupContentsResource>(props.uuid)(state.resources);
+                const resource = getResource<GroupContentsResource & UserResource>(props.uuid)(state.resources);
 
                 if (resource) {
-                    ownerName = (resource as any).fullName || resource.name;
+                    ownerName = getUserFullname(resource as User) || (resource as GroupContentsResource).name;
                 }
 
                 return { uuid: props.uuid, ownerName };
@@ -460,7 +460,7 @@ export const ResourceOwnerWithName =
             }
 
             return <Typography style={{ color: theme.palette.primary.main }} inline noWrap>
-                {uuid} ({ownerName})
+                {ownerName} ({uuid})
             </Typography>;
         });
 
index 34a372c9b692bc85fcfe71bc4c77185c7beec6f7..61797373b69a51ddb8dcd8039cf5180610ed5749 100644 (file)
@@ -61,7 +61,7 @@ const ProjectDetailsComponent = connect(null, mapDispatchToProps)(
         ({ classes, project, onClick }: ProjectDetailsComponentProps) => <div>
             <DetailsAttribute label='Type' value={resourceLabel(ResourceKind.PROJECT)} />
             <DetailsAttribute label='Owner' linkToUuid={project.ownerUuid}
-                uuidEnhancer={(uuid: string) => <ResourceOwnerWithName uuid={uuid} />} lowercaseValue={true} />
+                uuidEnhancer={(uuid: string) => <ResourceOwnerWithName uuid={uuid} />} />
             <DetailsAttribute label='Last modified' value={formatDate(project.modifiedAt)} />
             <DetailsAttribute label='Created at' value={formatDate(project.createdAt)} />
             <DetailsAttribute label='Project UUID' linkToUuid={project.uuid} value={project.uuid} />
index 32e37d46f05e528b0fb06ca50f4698abc582184c..7d54992ebd222eca77df3bfea7f877f258de5e1f 100644 (file)
@@ -289,7 +289,7 @@ export const CollectionDetailsAttributes = (props: { item: CollectionResource, t
         <Grid item xs={12} md={mdSize}>
             <DetailsAttribute classLabel={classes.label} classValue={classes.value}
                 label={isOldVersion ? "This version's UUID" : "Collection UUID"}
-                linkToUuid={`${item.uuid} AAAAAAAAAAAAAAAPortable data hash`} />
+                linkToUuid={item.uuid} />
         </Grid>
         <Grid item xs={12} md={mdSize}>
             <DetailsAttribute classLabel={classes.label} classValue={classes.value}