From 28b61384160ee8c7b53114428b3740a6d7a5238f Mon Sep 17 00:00:00 2001 From: Ben Elferink Date: Thu, 19 Dec 2024 17:33:33 +0200 Subject: [PATCH] [GEN-2063]: open expanded view when selecting all sources (#2029) This pull request includes a small change to the `frontend/webapp/hooks/sources/useSourceFormData.ts` file. The change comments out a line of code that sets the selected namespace, providing an alternative approach if the goal is to select all without opening the expanded view. Code change: * [`frontend/webapp/hooks/sources/useSourceFormData.ts`](diffhunk://#diff-cd2bc3c9473adfb41833260ef193384279ed75ef4b6c6866290ca78a174471e7L125-R128): Commented out the line that sets the selected namespace and added a note explaining an alternative approach. --- frontend/webapp/hooks/sources/useSourceFormData.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/webapp/hooks/sources/useSourceFormData.ts b/frontend/webapp/hooks/sources/useSourceFormData.ts index c2d4e5265..8e16d1399 100644 --- a/frontend/webapp/hooks/sources/useSourceFormData.ts +++ b/frontend/webapp/hooks/sources/useSourceFormData.ts @@ -122,7 +122,10 @@ export const useSourceFormData = (params?: UseSourceFormDataParams): UseSourceFo } else { setSelectedSources((prev) => ({ ...prev, [namespace]: bool ? nsAvailableSources : [] })); setSelectAllForNamespace(''); - if (!!nsAvailableSources.length && !namespaceWasSelected.current) setSelectedNamespace(''); + + // Note: if we want to select all, but not open the expanded view, we can use the following: + // if (!!nsAvailableSources.length && !namespaceWasSelected.current) setSelectedNamespace(''); + namespaceWasSelected.current = false; } } else {