19294: Display first/last on participant select chips
authorStephen Smith <stephen@curii.com>
Wed, 1 Feb 2023 14:49:50 +0000 (09:49 -0500)
committerStephen Smith <stephen@curii.com>
Wed, 1 Feb 2023 14:49:50 +0000 (09:49 -0500)
Arvados-DCO-1.1-Signed-off-by: Stephen Smith <stephen@curii.com>

src/views-components/sharing-dialog/participant-select.tsx

index a826fcd59aaa9f6be62f0e5979861c679031474d..ac5d6c2d9309c56978583090710d3526c4fb522c 100644 (file)
@@ -43,10 +43,10 @@ interface ParticipantSelectState {
     suggestions: ParticipantResource[];
 }
 
-const getDisplayName = (item: GroupResource | UserResource) => {
+const getDisplayName = (item: GroupResource | UserResource, detailed: boolean) => {
     switch (item.kind) {
         case ResourceKind.USER:
-            return getUserDisplayName(item, true, true);
+            return getUserDisplayName(item, detailed, detailed);
         case ResourceKind.GROUP:
             return item.name + `(${`(${(item as Resource).uuid})`})`;
         default:
@@ -91,7 +91,7 @@ export const ParticipantSelect = connect()(
         renderSuggestion(item: ParticipantResource) {
             return (
                 <ListItemText>
-                    <Typography noWrap>{getDisplayName(item)}</Typography>
+                    <Typography noWrap>{getDisplayName(item, true)}</Typography>
                 </ListItemText>
             );
         }
@@ -117,7 +117,7 @@ export const ParticipantSelect = connect()(
             const { onSelect = noop } = this.props;
             this.setState({ value: '', suggestions: [] });
             onSelect({
-                name: getDisplayName(selection),
+                name: getDisplayName(selection, false),
                 uuid,
             });
         }