@@ -83,6 +83,8 @@ export class CatalogSelectViewPanel extends PureComponent {
8383 width = 'auto' height = 'auto'
8484 groupKey = { [ gkey , gkeySpacial ] }
8585 onSubmit = { ( request ) => onSearchSubmit ( request ) }
86+ onError = { ( request ) => onSearchFail ( request ) }
87+ params = { { hideOnInvalid : false } }
8688 onCancel = { hideSearchPanel } >
8789 < CatalogSelectView fields = { fields } />
8890 </ FormPanel >
@@ -104,17 +106,25 @@ export function validateConstraints(groupKey) {
104106 return true ;
105107}
106108
109+ function onSearchFail ( ) {
110+ showInfoPopup ( 'One or more fields are not valid' ) ;
111+ }
112+
107113function onSearchSubmit ( request ) {
108- // console.log('original request <br />' + JSON.stringify(request));
109114
115+ if ( ! catmaster ) {
116+ showInfoPopup ( 'Error: Master table was not loaded.' ) ;
117+ return false ;
118+ }
110119 if ( request [ gkey ] . Tabs === 'catalog' ) {
111- const { spatial} = request [ gkeySpacial ] ;
112- const wp = parseWorldPt ( request [ gkeySpacial ] [ ServerParams . USER_TARGET_WORLD_PT ] ) ;
120+ const spacPart = request [ gkeySpacial ] || { } ;
121+ const { spatial} = spacPart ;
122+ const wp = parseWorldPt ( spacPart [ ServerParams . USER_TARGET_WORLD_PT ] ) ;
113123 if ( ! wp && ( spatial === SpatialMethod . Cone . value
114124 || spatial === SpatialMethod . Box . value
115125 || spatial === SpatialMethod . Elliptical . value ) ) {
116126 showInfoPopup ( 'Target is required' ) ;
117- return ;
127+ return false ;
118128 }
119129 if ( validateConstraints ( gkey ) ) {
120130 doCatalog ( request ) ;
@@ -130,8 +140,10 @@ function onSearchSubmit(request) {
130140 doVoSearch ( request [ gkey ] , 'NED' ) ;
131141 }
132142 else {
133- console . log ( 'request no supported' ) ;
143+ showInfoPopup ( 'Request not supported' ) ;
144+ return false ;
134145 }
146+ return true ;
135147}
136148function hideSearchPanel ( ) {
137149 dispatchHideDropDown ( ) ;
@@ -140,7 +152,7 @@ function hideSearchPanel() {
140152function doCatalog ( request ) {
141153
142154 const catPart = request [ gkey ] ;
143- const spacPart = request [ gkeySpacial ] ;
155+ const spacPart = request [ gkeySpacial ] || { } ;
144156 const { catalog, project, cattable} = catPart ;
145157 const { spatial= 'AllSky' } = spacPart ; // if there is no 'spatial' field (catalog with no position information case)
146158
0 commit comments