19049: Only show active users in add login participant select 19049-vm-admin-rough-edges
authorStephen Smith <stephen@curii.com>
Fri, 13 May 2022 18:25:15 +0000 (14:25 -0400)
committerStephen Smith <stephen@curii.com>
Fri, 13 May 2022 18:25:15 +0000 (14:25 -0400)
Arvados-DCO-1.1-Signed-off-by: Stephen Smith <stephen@curii.com>

src/views-components/sharing-dialog/participant-select.tsx
src/views-components/virtual-machines-dialog/add-login-dialog.tsx

index eb7e8d1010afeb096fe33f4c81621fc674435d14..a826fcd59aaa9f6be62f0e5979861c679031474d 100644 (file)
@@ -28,6 +28,7 @@ interface ParticipantSelectProps {
     label?: string;
     autofocus?: boolean;
     onlyPeople?: boolean;
     label?: string;
     autofocus?: boolean;
     onlyPeople?: boolean;
+    onlyActive?: boolean;
     disabled?: boolean;
 
     onBlur?: (event: React.FocusEvent<HTMLInputElement>) => void;
     disabled?: boolean;
 
     onBlur?: (event: React.FocusEvent<HTMLInputElement>) => void;
@@ -133,6 +134,7 @@ export const ParticipantSelect = connect()(
 
             const filterUsers = new FilterBuilder()
                 .addILike('any', value)
 
             const filterUsers = new FilterBuilder()
                 .addILike('any', value)
+                .addEqual('is_active', this.props.onlyActive || undefined)
                 .addNotIn('uuid', this.props.excludedParticipants)
                 .getFilters();
             const userItems: ListResults<any> = await userService.list({ filters: filterUsers, limit, count: "none" });
                 .addNotIn('uuid', this.props.excludedParticipants)
                 .getFilters();
             const userItems: ListResults<any> = await userService.list({ filters: filterUsers, limit, count: "none" });
index 93fe84858248e5b22d0dc255571064f82624e7ad..1654452bf493b656b031c648fa1faf96a1275e1a 100644 (file)
@@ -55,6 +55,7 @@ const ParticipantField = Field as new () => GenericField<UserFieldProps>;
 const UserSelect = (props) =>
     <ParticipantSelect
         onlyPeople
 const UserSelect = (props) =>
     <ParticipantSelect
         onlyPeople
+        onlyActive
         label='Search for user to grant login permission'
         items={props.input.value ? [props.input.value] : []}
         excludedParticipants={props.excludedParticipants}
         label='Search for user to grant login permission'
         items={props.input.value ? [props.input.value] : []}
         excludedParticipants={props.excludedParticipants}
@@ -64,6 +65,7 @@ const UserSelect = (props) =>
 const ReadOnlyUserSelect = (props) =>
         <ParticipantSelect
             onlyPeople
 const ReadOnlyUserSelect = (props) =>
         <ParticipantSelect
             onlyPeople
+            onlyActive
             label='User'
             items={props.input.value ? [props.input.value] : []}
             disabled={true} />;
             label='User'
             items={props.input.value ? [props.input.value] : []}
             disabled={true} />;