Skip to content

Commit

Permalink
[GEN-2063]: open expanded view when selecting all sources (#2029)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
BenElferink authored Dec 19, 2024
1 parent 9b18997 commit 28b6138
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion frontend/webapp/hooks/sources/useSourceFormData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 28b6138

Please sign in to comment.