Skip to content

Commit 5f4e25c

Browse files
authored
Merge pull request #1457 from Caltech-IPAC/FIREFLY-1335
Firefly Multi ticket: Firefly-1335,Firefly-1321,Firefly-1361
2 parents bb9ae2b + b9ab49a commit 5f4e25c

File tree

2 files changed

+23
-8
lines changed

2 files changed

+23
-8
lines changed

src/firefly/js/drawingLayers/HiPSMOCUI.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const options= [ {label: 'Outline', value: Style.DESTINATION_OUTLINE.key},
1818
export const getUIComponent = (drawLayer,pv) => <HiPSMOCUI drawLayer={drawLayer} pv={pv}/>;
1919

2020
function HiPSMOCUI({drawLayer,pv}) {
21-
const style = drawLayer?.mocStyle[pv.plotId] ?? drawLayer.drawingDef?.style ?? Style.DESTINATION_OUTLINE;
21+
const style = drawLayer?.mocStyle?.[pv.plotId] ?? drawLayer.drawingDef?.style ?? Style.DESTINATION_OUTLINE;
2222

2323
return (
2424
<div style={{display: 'inline-flex', padding: '2px 3px 2px 3px',

src/firefly/js/ui/dynamic/ServiceDefTools.js

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import {isArray, isNumber, isString} from 'lodash';
22
import {ReservedParams} from '../../api/WebApi.js';
33
import {sprintf} from '../../externalSource/sprintf.js';
4+
import {sortInfoString} from '../../tables/SortInfo.js';
45
import {makeFileRequest, makeTblRequest, setNoCache} from '../../tables/TableRequestUtil.js';
56
import {cisxAdhocServiceUtype, standardIDs} from '../../voAnalyzer/VoConst.js';
67
import {splitByWhiteSpace, tokenSub} from '../../util/WebUtil.js';
@@ -308,20 +309,34 @@ export function makeSearchAreaInfo(cisxUI) {
308309
let tblCnt=1;
309310

310311
export function makeServiceDescriptorSearchRequest(request, serviceDescriptor, extraMeta={}) {
311-
const {standardID = '', accessURL, utype, serDefParams, title} = serviceDescriptor;
312+
const {standardID = '', accessURL, utype, serDefParams, title, cisxUI=[]} = serviceDescriptor;
313+
const hiddenColumns= cisxUI.find( (e) => e.name==='hidden_columns')?.value;
314+
const tblSortOrder= cisxUI.find( (e) => e.name==='table_sort_order')?.value;
312315
const MAXREC = 50000;
313316
const tblTitle= `${title} - ${tblCnt++}`;
314317

318+
const hideObj= hiddenColumns ?
319+
Object.fromEntries(hiddenColumns.split(',').map((c) => [ `col.${c}.visibility`, 'hide'] )) : {};
320+
321+
const sAry= tblSortOrder?.split(',');
322+
let sortObj= {};
323+
if (sAry?.length>1) {
324+
const dir= sAry.shift();
325+
sortObj= {sortInfo: sortInfoString(sAry, dir?.toUpperCase()==='ASC')};
326+
}
327+
328+
const options= {...sortObj, META_INFO: { ...hideObj, ...extraMeta }};
329+
315330
if (isSIAStandardID(standardID)) {
316331
// we know this is a table so make a table request
317332
const url = accessURL + '?' + new URLSearchParams(request).toString();
318-
return makeFileRequest(tblTitle, url, undefined, {META_INFO: extraMeta}); //todo- figure out title
333+
return makeFileRequest(tblTitle, url, undefined, options); //todo- figure out title
319334
}
320335
else if (isSSAStandardID(standardID)) {
321336
const url = accessURL + '?' + new URLSearchParams(request).toString();
322-
return makeFileRequest(tblTitle, url, undefined, {META_INFO:extraMeta}); //todo- figure out title
337+
return makeFileRequest(tblTitle, url, undefined, options); //todo- figure out title
323338
}
324-
else if (isCisxTapStandardID(standardID, utype, undefined, {META_INFO:extraMeta})) {
339+
else if (isCisxTapStandardID(standardID, utype)) {
325340
// we know this is a table so make a table request either sync or async
326341
const doAsync = standardID.toLowerCase().includes('async');
327342
const query = serDefParams.find(({name}) => name === 'QUERY')?.value;
@@ -332,20 +347,20 @@ export function makeServiceDescriptorSearchRequest(request, serviceDescriptor, e
332347

333348
if (!query) return;
334349
if (doAsync) {
335-
const asyncReq = makeTblRequest('AsyncTapQuery', tblTitle, {serviceUrl, QUERY: finalQuery, MAXREC, META_INFO:extraMeta});
350+
const asyncReq = makeTblRequest('AsyncTapQuery', tblTitle, {serviceUrl, QUERY: finalQuery, MAXREC}, options);
336351
setNoCache(asyncReq);
337352
return asyncReq;
338353
} else {
339354
const serParam = new URLSearchParams({QUERY: finalQuery, REQUEST: 'doQuery', LANG: 'ADQL', MAXREC});
340355
const completeUrl = serviceUrl + '/sync?' + serParam.toString();
341-
return makeFileRequest(title, completeUrl,undefined, {META_INFO:extraMeta}); //todo- figure out title
356+
return makeFileRequest(title, completeUrl,undefined, options); //todo- figure out title
342357
}
343358

344359
}
345360
else {
346361
//todo: we should to call file analysis first
347362
const url = accessURL + '?' + new URLSearchParams(request).toString();
348-
return makeFileRequest(tblTitle, url); //todo- figure out title
363+
return makeFileRequest(tblTitle, url, undefined,options); //todo- figure out title
349364
}
350365
}
351366

0 commit comments

Comments
 (0)