@@ -35,7 +35,7 @@ import {CIRCLE, POINT, POSITION, RANGE} from './DynamicDef.js';
3535import { convertRequest , findTargetFromRequest } from './DynamicUISearchPanel.jsx' ;
3636import { getSpacialSearchType , hasValidSpacialSearch } from './DynComponents.jsx' ;
3737import { confirmDLMenuItem } from './FetchDatalinkTable.js' ;
38- import { getStandardIdType , ingestInitArgs , makeFieldDefs , makeSearchAreaInfo } from './ServiceDefTools.js' ;
38+ import { getStandardIdType , ingestInitArgs , makeFieldDefsWithOptions , makeSearchAreaInfo } from './ServiceDefTools.js' ;
3939
4040
4141export const DL_UI_LIST = 'DL_UI_LIST' ;
@@ -128,7 +128,7 @@ export function DLGeneratedDropDown({initArgs={},
128128 const currentIdx = useStoreConnector ( ( ) => getTblById ( registryTblId ) ?. highlightedRow ?? - 1 ) ;
129129 const [ url , setUrl ] = useState ( ) ;
130130 const [ searchAttributes , setSearchAttributes ] = useState ( { } ) ;
131- const { makeRegistryRequest, findUrlInReg, getCollectionUrl, getCollectionAttributes} =
131+ const { makeRegistryRequest, findUrlInReg, getCollectionUrl, getCollectionAttributes, defaultMaxMOCFetchDepth } =
132132 { ...defaultRegistrySearchDef , ...registrySearchDef } ;
133133
134134 registryData [ name ] ??= { regLoaded : false , hasRegistry :true , regLoading : false , loadedTblIdCache :undefined , savedUrl : undefined } ;
@@ -192,7 +192,7 @@ export function DLGeneratedDropDown({initArgs={},
192192 }
193193
194194 return ( < DLGeneratedDropDownTables { ...{ registryTblId, regLoaded, loadedTblIds, setLoadedTblIds, url,
195- searchAttributes, groupKey, slotProps, findUrlInReg, initArgs, hasRegistry} } /> ) ;
195+ searchAttributes, groupKey, slotProps, findUrlInReg, initArgs, hasRegistry, defaultMaxMOCFetchDepth } } /> ) ;
196196}
197197
198198DLGeneratedDropDown . propTypes = {
@@ -230,7 +230,8 @@ DLGeneratedDropDown.propTypes= {
230230
231231
232232function DLGeneratedDropDownTables ( { registryTblId, regLoaded, loadedTblIds, setLoadedTblIds, url, hasRegistry,
233- searchAttributes, groupKey, slotProps, findUrlInReg, initArgs} ) {
233+ searchAttributes, groupKey, slotProps,
234+ findUrlInReg, initArgs, defaultMaxMOCFetchDepth} ) {
234235
235236 const [ sideBarShowing , setSideBarShowing ] = useState ( true ) ;
236237 const currentTblId = loadedTblIds ?. [ url ] ;
@@ -265,7 +266,9 @@ function DLGeneratedDropDownTables({registryTblId, regLoaded, loadedTblIds, setL
265266 const qAna = analyzeQueries ( currentTblId ) ;
266267 return (
267268 < Sheet sx = { { display :'flex' , flexDirection : 'row' , width :1 , height :1 , minWidth :800 , minHeight :400 } } >
268- < DLGeneratedTableSearch { ...{ currentTblId, qAna, groupKey, initArgs, sideBar, regHasUrl, url, regLoaded, slotProps, sideBarShowing, setSideBarShowing} } />
269+ < DLGeneratedTableSearch { ...{ currentTblId, qAna, groupKey, initArgs, sideBar, regHasUrl, url,
270+ regLoaded, slotProps, sideBarShowing,
271+ setSideBarShowing, defaultMaxMOCFetchDepth} } />
269272 </ Sheet >
270273 ) ;
271274}
@@ -277,7 +280,8 @@ const executeInitTargetOnce= makeSearchOnce(false);
277280
278281
279282function DLGeneratedTableSearch ( { currentTblId, qAna, groupKey, initArgs, sideBar, regHasUrl, url,
280- sideBarShowing, slotProps, regLoaded, setSideBarShowing} ) {
283+ sideBarShowing, slotProps, regLoaded,
284+ setSideBarShowing, defaultMaxMOCFetchDepth} ) {
281285 const [ , setCallId ] = useState ( 'none' ) ;
282286 const [ { onClick} , setClickFuncImpl ] = useState ( { } ) ;
283287 const tabsKey = 'Tabs-' + currentTblId ;
@@ -300,7 +304,7 @@ function DLGeneratedTableSearch({currentTblId, qAna, groupKey, initArgs, sideBar
300304 }
301305 } , [ onClick , initArgs ?. urlApi ?. callId , matchUrl ] ) ;
302306
303- const fdAry = makePrimarySearchFieldDefAry ( qAna , initArgs ) ;
307+ const fdAry = makePrimarySearchFieldDefAry ( qAna , initArgs , defaultMaxMOCFetchDepth ) ;
304308
305309 const searchObjFds = fdAry
306310 ?. map ( ( fds , idx ) => {
@@ -404,20 +408,27 @@ function getCisxUI(qAnaOrSd) {
404408 *
405409 * @param {QueryAnalysis } qAna - the description of all the searches to do for this table
406410 * @param {Object } initArgs
411+ * @param {number } defaultMaxMOCFetchDepth
407412 * @return {Array.<Array.<FieldDef>> }
408413 */
409- function makePrimarySearchFieldDefAry ( qAna , initArgs ) {
414+ function makePrimarySearchFieldDefAry ( qAna , initArgs , defaultMaxMOCFetchDepth ) {
410415 return qAna ?. primarySearchDef . map ( ( fd ) => {
411416 const { serviceDef} = fd ; //todo handle case with only an access url
412417 if ( ! serviceDef ) return ;
413418 const standId = getStandardId ( serviceDef ) ;
414419 const utype = getUtype ( serviceDef ) ;
415420 let fdEntryAry ;
416421 if ( utype === cisxAdhocServiceUtype && standId . startsWith ( standardIDs . tap ) && serviceDef . cisxTokenSub ) {
417- fdEntryAry = makeFieldDefs ( serviceDef . cisxTokenSub , undefined , makeSearchAreaInfo ( getCisxUI ( serviceDef ) ) , false ) ;
422+ fdEntryAry = makeFieldDefsWithOptions ( {
423+ serDefParams :serviceDef . cisxTokenSub ,
424+ searchAreaInfo :makeSearchAreaInfo ( getCisxUI ( serviceDef ) , defaultMaxMOCFetchDepth ) ,
425+ hidePredefinedStringFields :false } ) ;
418426 }
419427 else {
420- fdEntryAry = makeFieldDefs ( serviceDef . serDefParams , undefined , makeSearchAreaInfo ( getCisxUI ( serviceDef ) ) , true ) ;
428+ fdEntryAry = makeFieldDefsWithOptions ( {
429+ serDefParams :serviceDef . serDefParams ,
430+ searchAreaInfo :makeSearchAreaInfo ( getCisxUI ( serviceDef ) , defaultMaxMOCFetchDepth )
431+ } ) ;
421432 }
422433 if ( ! isEmpty ( initArgs . urlApi ) ) {
423434 const originalWp = fdEntryAry . find ( ( fd ) => fd . type === POSITION ) ?. initValue ?? fdEntryAry . find ( ( fd ) => fd . type === CIRCLE ) ?. targetDetails ?. centerPt ;
0 commit comments