@@ -35,10 +35,13 @@ function GatorProtocolPanelImpl({initArgs, lockedServiceUrl, lockedServiceName,
3535 const gpOps = getGatorProtoServiceOptions ( ) ;
3636 const servicesShowing = true ;
3737 const showWarning = ! serviceUrl ;
38+ const [ enterUrl , setEnterUrl ] = useFieldGroupValue ( 'enterUrl' ) ;
3839
3940 useEffect ( ( ) => {
4041 if ( ! serviceUrl ) {
41- setServiceUrl ( getInitServiceUrl ( initArgs , gpOps , lockedServiceUrl , lockedServiceName ) ) ;
42+ const initUrl = getInitServiceUrl ( initArgs , gpOps , lockedServiceUrl , lockedServiceName ) ;
43+ setServiceUrl ( initUrl ) ;
44+ if ( ! initUrl ) setEnterUrl ( true ) ;
4245 }
4346 } , [ ] ) ;
4447
@@ -49,7 +52,7 @@ function GatorProtocolPanelImpl({initArgs, lockedServiceUrl, lockedServiceName,
4952 setServiceUrl ( serviceUrl ) ;
5053 } ;
5154 const searchOptionsMask = serviceUrl ?
52- ( getGatorProtoService ( serviceUrl ) ?. searchOptionsMask ?? getAppOptions ( ) . gatorProtocol . searchOptionsMask ) : undefined ;
55+ ( getGatorProtoService ( serviceUrl ) ?. searchOptionsMask ?? getAppOptions ( ) ? .gatorProtocol ? .searchOptionsMask ) : undefined ;
5356 const showSqlSection = serviceUrl ? getGatorProtoService ( serviceUrl ) ?. showSqlSection : true ;
5457
5558 return (
@@ -115,14 +118,14 @@ function Services({serviceUrl, servicesShowing, gpOps, onGatorProtoServiceOption
115118 < Typography { ...{ level :'title-lg' , color :'primary' , sx :{ width :'17rem' , mr :1 } } } >
116119 Select Source
117120 </ Typography >
118- < SwitchInputField { ...{ size :'sm' , endDecorator :'Enter my URL' , fieldKey :'enterUrl' ,
121+ { Boolean ( gpOps ?. length ) && < SwitchInputField { ...{ size :'sm' , endDecorator :'Enter my URL' , fieldKey :'enterUrl' ,
119122 initState :{ value :false } ,
120123 sx : {
121124 alignSelf : 'flex-start' ,
122125 '--Switch-trackWidth' : '20px' ,
123126 '--Switch-trackHeight' : '12px' ,
124127 } ,
125- } } />
128+ } } /> }
126129 </ Stack >
127130 < Stack >
128131 { enterUrl ? (
@@ -142,7 +145,7 @@ function Services({serviceUrl, servicesShowing, gpOps, onGatorProtoServiceOption
142145 < ListBoxInputFieldView { ...{
143146 sx :{ '& .MuiSelect-root' :{ width :'46.5rem' } } ,
144147 options :gpOps , value :serviceUrl ,
145- placeholder :'Choose SIAv2 Service...' ,
148+ placeholder :'Choose LSDB Service...' ,
146149 startDecorator :! gpOps . length ? < Button loading = { true } /> : undefined ,
147150 onChange :( ev , value ) => {
148151 onGatorProtoServiceOptionSelect ( { value} ) ;
@@ -200,6 +203,6 @@ function getInitServiceUrl(initArgs,gpOps, lockedServiceUrl,lockedServiceName) {
200203 const url = gpOps . find ( ( { labelOnly} ) => labelOnly === lockedServiceName ) ?. value ;
201204 if ( url ) return url ;
202205 }
203- const { serviceUrl= gpOps [ 0 ] . value } = gpOps ;
206+ const { serviceUrl= gpOps ?. [ 0 ] ? .value } = gpOps ;
204207 return serviceUrl ;
205208}
0 commit comments