From 0a8e9adef9c62961b8d22bb109710380f8d72212 Mon Sep 17 00:00:00 2001 From: Lisa Kim Date: Wed, 30 Oct 2024 21:50:37 -0700 Subject: [PATCH] Remove single toggler for kube resources --- .../RequestCheckout/KubeNamespaceSelector.tsx | 21 +++++++++++-------- .../RequestCheckout/RequestCheckout.tsx | 1 - 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/web/packages/shared/components/AccessRequests/NewRequest/RequestCheckout/KubeNamespaceSelector.tsx b/web/packages/shared/components/AccessRequests/NewRequest/RequestCheckout/KubeNamespaceSelector.tsx index 83172312f2a7d..2ba248d7afbcc 100644 --- a/web/packages/shared/components/AccessRequests/NewRequest/RequestCheckout/KubeNamespaceSelector.tsx +++ b/web/packages/shared/components/AccessRequests/NewRequest/RequestCheckout/KubeNamespaceSelector.tsx @@ -34,13 +34,11 @@ export function KubeNamespaceSelector({ kubeClusterItem, fetchKubeNamespaces, savedResourceItems, - toggleResource, bulkToggleKubeResources, }: { kubeClusterItem: PendingListItem; fetchKubeNamespaces(p: KubeNamespaceRequest): Promise; savedResourceItems: PendingListItem[]; - toggleResource: (resource: PendingListItem) => void; bulkToggleKubeResources: ( resources: PendingKubeResourceItem[], resource: PendingListItem @@ -83,13 +81,18 @@ export function KubeNamespaceSelector({ ); return; case 'remove-value': - toggleResource({ - kind: 'namespace', - id: kubeClusterItem.id, - subResourceName: actionMeta.removedValue.value, - clusterName: kubeClusterItem.clusterName, - name: actionMeta.removedValue.value, - }); + bulkToggleKubeResources( + [ + { + kind: 'namespace', + id: kubeClusterItem.id, + subResourceName: actionMeta.removedValue.value, + clusterName: kubeClusterItem.clusterName, + name: actionMeta.removedValue.value, + }, + ], + kubeClusterItem + ); return; } } diff --git a/web/packages/shared/components/AccessRequests/NewRequest/RequestCheckout/RequestCheckout.tsx b/web/packages/shared/components/AccessRequests/NewRequest/RequestCheckout/RequestCheckout.tsx index 0eef8fe799e57..99e4d239e0c5f 100644 --- a/web/packages/shared/components/AccessRequests/NewRequest/RequestCheckout/RequestCheckout.tsx +++ b/web/packages/shared/components/AccessRequests/NewRequest/RequestCheckout/RequestCheckout.tsx @@ -263,7 +263,6 @@ export function RequestCheckout({