Skip to content

Commit

Permalink
Remove single toggler for kube resources
Browse files Browse the repository at this point in the history
  • Loading branch information
kimlisa committed Oct 31, 2024
1 parent 130be68 commit 0bea852
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,11 @@ export function KubeNamespaceSelector({
kubeClusterItem,
fetchKubeNamespaces,
savedResourceItems,
toggleResource,
bulkToggleKubeResources,
}: {
kubeClusterItem: PendingListItem;
fetchKubeNamespaces(p: KubeNamespaceRequest): Promise<string[]>;
savedResourceItems: PendingListItem[];
toggleResource: (resource: PendingListItem) => void;
bulkToggleKubeResources: (
resources: PendingKubeResourceItem[],
resource: PendingListItem
Expand Down Expand Up @@ -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;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,6 @@ export function RequestCheckout<T extends PendingListItem>({
<KubeNamespaceSelector
kubeClusterItem={item}
savedResourceItems={pendingAccessRequests}
toggleResource={toggleResource}
fetchKubeNamespaces={fetchKubeNamespaces}
bulkToggleKubeResources={bulkToggleKubeResources}
/>
Expand Down

0 comments on commit 0bea852

Please sign in to comment.