Skip to content

Commit 6b6c336

Browse files
author
Zabilsya
committed
[DOP-21974] add search to ManagedSelect
1 parent 61e2f20 commit 6b6c336

File tree

33 files changed

+357
-39
lines changed

33 files changed

+357
-39
lines changed

src/app/styles/antd.less

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
}
2828

2929
.ant-avatar,
30-
.ant-modal-close-x {
30+
.ant-modal-close-x,
31+
.ant-select-item-empty {
3132
display: flex;
3233
justify-content: center;
3334
align-items: center;

src/features/connection/ConnectionList/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export const ConnectionList = memo(({ group, onUpdateRowClick, onDeleteRowClick
1313
queryKey={[ConnectionQueryKey.GET_CONNECTIONS, group.data.id]}
1414
queryFunction={(params) => connectionService.getConnections({ ...params, group_id: group.data.id })}
1515
columns={CONNECTION_LIST_COLUMNS}
16+
isHiddenRowActions={!hasAccessByUserRole(UserRole.Developer, group.role)}
1617
isRenderUpdateRowAction={() => hasAccessByUserRole(UserRole.Developer, group.role)}
1718
isRenderDeleteRowAction={() => hasAccessByUserRole(UserRole.Maintainer, group.role)}
1819
onUpdateRowClick={onUpdateRowClick}

src/features/group/AddGroupUser/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ export const AddGroupUser = ({ groupId, onSuccess, onCancel }: AddGroupUserProps
2323
size="large"
2424
queryKey={[UserQueryKey.GET_USERS]}
2525
queryFunction={userService.getUsers}
26-
renderOptionValue={(user) => user.id}
2726
renderOptionLabel={(user) => user.username}
27+
renderOptionValue={(user) => user.id}
28+
detailQueryKey={[UserQueryKey.GET_USER]}
29+
detailQueryFunction={(value) => userService.getUser({ id: value })}
2830
/>
2931
</Form.Item>
3032

src/features/group/GroupUserList/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export const GroupUserList = memo(({ group, onUpdateRowClick, onDeleteRowClick }
2121
queryKey={[GroupQueryKey.GET_GROUP_USERS, group.data.id]}
2222
queryFunction={handleGetGroupUsers}
2323
columns={GROUP_USER_LIST_COLUMNS}
24+
isHiddenRowActions={!hasAccessByUserRole(UserRole.Owner, group.role)}
2425
isRenderUpdateRowAction={isRenderRowAction}
2526
isRenderDeleteRowAction={isRenderRowAction}
2627
onUpdateRowClick={onUpdateRowClick}

src/features/group/SelectGroup/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ export const SelectGroup = () => {
1717
onSelect={handleSelectGroup}
1818
renderOptionLabel={(group) => group.data.name}
1919
renderOptionValue={(group) => group.data.id}
20+
detailQueryKey={[GroupQueryKey.GET_GROUP]}
21+
detailQueryFunction={(value) => groupService.getGroup({ id: value })}
2022
placeholder="Select group"
2123
/>
2224
);

src/features/group/UpdateGroup/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ export const UpdateGroup = ({ group }: UpdateGroupProps) => {
4949
queryFunction={userService.getUsers}
5050
renderOptionValue={(user) => user.id}
5151
renderOptionLabel={(user) => user.username}
52+
detailQueryKey={[UserQueryKey.GET_USER]}
53+
detailQueryFunction={(value) => userService.getUser({ id: value })}
5254
//TODO: [DOP-20030] Need to delete prop "disabled" when the backend leaves the user with access to the group, even after changing the owner
5355
disabled
5456
/>

src/features/queue/QueueList/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export const QueueList = memo(({ group, onUpdateRowClick, onDeleteRowClick }: Qu
1313
queryKey={[QueueQueryKey.GET_QUEUES, group.data.id]}
1414
queryFunction={(params) => queueService.getQueues({ ...params, group_id: group.data.id })}
1515
columns={QUEUE_LIST_COLUMNS}
16+
isHiddenRowActions={!hasAccessByUserRole(UserRole.Maintainer, group.role)}
1617
isRenderUpdateRowAction={() => hasAccessByUserRole(UserRole.Maintainer, group.role)}
1718
isRenderDeleteRowAction={() => hasAccessByUserRole(UserRole.Maintainer, group.role)}
1819
onUpdateRowClick={onUpdateRowClick}

src/features/transfer/MutateTransferForm/components/SourceParams/SourceParams.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ export const SourceParams = ({ groupId, initialSourceConnectionType }: SourcePar
2525
renderOptionValue={(connection) => connection.id}
2626
renderOptionLabel={(connection) => connection.name}
2727
onSelect={handleSelectConnection}
28+
detailQueryKey={[ConnectionQueryKey.GET_CONNECTION]}
29+
detailQueryFunction={(value) => connectionService.getConnection({ id: value })}
2830
placeholder="Select source connection"
2931
/>
3032
</Form.Item>

src/features/transfer/MutateTransferForm/components/TargetParams/TargetParams.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ export const TargetParams = ({ groupId, initialTargetConnectionType }: TargetPar
2525
renderOptionValue={(connection) => connection.id}
2626
renderOptionLabel={(connection) => connection.name}
2727
onSelect={handleSelectConnection}
28+
detailQueryKey={[ConnectionQueryKey.GET_CONNECTION]}
29+
detailQueryFunction={(value) => connectionService.getConnection({ id: value })}
2830
placeholder="Select target connection"
2931
/>
3032
</Form.Item>

src/features/transfer/MutateTransferForm/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ export const MutateTransferForm = ({
3030
queryFunction={(params) => queueService.getQueues({ group_id: group.id, ...params })}
3131
renderOptionValue={(queue) => queue.id}
3232
renderOptionLabel={(queue) => queue.name}
33+
detailQueryKey={[QueueQueryKey.GET_QUEUE]}
34+
detailQueryFunction={(value) => queueService.getQueue({ id: value })}
3335
placeholder="Select queue"
3436
/>
3537
</Form.Item>

0 commit comments

Comments
 (0)