From 047c70bc25b9a85301dba24be8217ef95e47e752 Mon Sep 17 00:00:00 2001 From: Sachin Chaurasiya Date: Wed, 20 Oct 2021 11:35:23 +0530 Subject: [PATCH] Fixed #868 For Owner already set to a team, "Select owner" list should open with teams tab as active. (#870) --- .../ui/src/components/dropdown/DropDownList.tsx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/catalog-rest-service/src/main/resources/ui/src/components/dropdown/DropDownList.tsx b/catalog-rest-service/src/main/resources/ui/src/components/dropdown/DropDownList.tsx index 9272183e3e2..211f41aa674 100644 --- a/catalog-rest-service/src/main/resources/ui/src/components/dropdown/DropDownList.tsx +++ b/catalog-rest-service/src/main/resources/ui/src/components/dropdown/DropDownList.tsx @@ -70,6 +70,15 @@ const DropDownList: FunctionComponent = ({ ); }; + const setCurrentTabOnMount = () => { + const owner = dropDownList.find((l) => l.value === value); + if (owner) { + const index = listGroups.indexOf(owner.group as string); + + setActiveTab(index >= 0 ? index + 1 : 1); + } + }; + useEffect(() => { setSearchText(searchString); }, [searchString]); @@ -100,6 +109,7 @@ const DropDownList: FunctionComponent = ({ useEffect(() => { isMounted.current = true; + setCurrentTabOnMount(); }, []); return (