@@ -13,11 +13,8 @@ import {
1313 ConnectionDialogWebviewState ,
1414 IConnectionDialogProfile ,
1515} from "../../../sharedInterfaces/connectionDialog" ;
16- import {
17- SearchableDropdown ,
18- SearchableDropdownOptions ,
19- } from "../../common/searchableDropdown.component" ;
20- import { IConnectionGroup } from "../../../sharedInterfaces/connectionGroup" ;
16+ // import { SearchableDropdownOptions } from "../../common/searchableDropdown.component";
17+ // import { IConnectionGroup } from "../../../sharedInterfaces/connectionGroup";
2118import { ConnectButton } from "./components/connectButton.component" ;
2219import { locConstants } from "../../common/locConstants" ;
2320import { AdvancedOptionsDrawer } from "./components/advancedOptionsDrawer.component" ;
@@ -32,32 +29,32 @@ export const ConnectionFormPage = () => {
3229 }
3330
3431 // Helper to flatten group hierarchy for dropdown, excluding ROOT group
35- function getGroupOptions ( ) : SearchableDropdownOptions [ ] {
36- if ( ! context ?. state ?. connectionGroups ) return [ ] ;
37- // Find the root group id (assuming name is "ROOT")
38- const rootGroup = context . state . connectionGroups . find ( ( g ) => g . name === "ROOT" ) ;
39- const rootGroupId = rootGroup ?. id ;
40- // Recursively build hierarchical options, skipping ROOT
41- function buildOptions (
42- groups : IConnectionGroup [ ] ,
43- parentId ?: string ,
44- prefix : string = "" ,
45- ) : SearchableDropdownOptions [ ] {
46- return groups
47- . filter ( ( g ) => g . parentId === parentId && g . id !== rootGroupId && g . name !== "ROOT" )
48- . flatMap ( ( g ) => {
49- const label = prefix ? `${ prefix } / ${ g . name } ` : g . name ;
50- const children = buildOptions ( groups , g . id , label ) ;
51- return [ { key : g . id , text : label , value : g . id } , ...children ] ;
52- } ) ;
53- }
32+ // function getGroupOptions(): SearchableDropdownOptions[] {
33+ // if (!context?.state?.connectionGroups) return [];
34+ // // Find the root group id (assuming name is "ROOT")
35+ // const rootGroup = context.state.connectionGroups.find((g) => g.name === "ROOT");
36+ // const rootGroupId = rootGroup?.id;
37+ // // Recursively build hierarchical options, skipping ROOT
38+ // function buildOptions(
39+ // groups: IConnectionGroup[],
40+ // parentId?: string,
41+ // prefix: string = "",
42+ // ): SearchableDropdownOptions[] {
43+ // return groups
44+ // .filter((g) => g.parentId === parentId && g.id !== rootGroupId && g.name !== "ROOT")
45+ // .flatMap((g) => {
46+ // const label = prefix ? `${prefix} / ${g.name}` : g.name;
47+ // const children = buildOptions(groups, g.id, label);
48+ // return [{ key: g.id, text: label, value: g.id }, ...children];
49+ // });
50+ // }
5451
55- // Start from rootGroupId if available, otherwise undefined
56- return buildOptions ( context . state . connectionGroups , rootGroupId ?? undefined ) ;
57- }
52+ // // Start from rootGroupId if available, otherwise undefined
53+ // return buildOptions(context.state.connectionGroups, rootGroupId ?? undefined);
54+ // }
5855
5956 // Selected group state
60- const [ selectedGroup , setSelectedGroup ] = useState < string > ( getGroupOptions ( ) [ 0 ] ?. value ?? "" ) ;
57+ // const [selectedGroup, setSelectedGroup] = useState<string>(getGroupOptions()[0]?.value ?? "");
6158
6259 return (
6360 < div >
0 commit comments