Skip to content

Commit 44fc1d4

Browse files
committed
DM-6135: updates with review feedbacks
1 parent 74ab61a commit 44fc1d4

File tree

5 files changed

+67
-23
lines changed

5 files changed

+67
-23
lines changed

src/firefly/js/tables/TableUtil.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,20 @@ export function makeIrsaCatalogRequest(title, project, catalog, params={}, optio
118118
return omitBy(Object.assign(req, options, params, {id, tbl_id, META_INFO, UserTargetWorldPt, catalogProject, catalog}), isNil);
119119
}
120120

121+
export function makeVOCatalogRequest(title, params={}, options={}) {
122+
var req = {startIdx: 0, pageSize: 100};
123+
options.use = options.use || 'catalog_overlay';
124+
const tbl_id = options.tbl_id || uniqueTblId();
125+
const id = 'ConeSearchByURL';
126+
const UserTargetWorldPt = params.UserTargetWorldPt || params.position; // may need to convert to worldpt.
127+
var META_INFO = Object.assign(options.META_INFO || {}, {title, tbl_id});
128+
129+
options = omit(options, 'tbl_id');
130+
params = omit(params, 'position');
131+
132+
return omitBy(Object.assign(req, options, params, {id, tbl_id, META_INFO, UserTargetWorldPt}), isNil);
133+
}
134+
121135
/*---------------------------- creator functions >----------------------------*/
122136

123137

@@ -241,7 +255,7 @@ export function getTableUiById(tbl_ui_id) {
241255
}
242256

243257
/**
244-
* get table's expanded information.
258+
* get table's expanded information.
245259
* @returns {object}
246260
*/
247261
export function getTblExpandedInfo() {

src/firefly/js/ui/CatalogSearchMethodType.jsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ function sizeArea(searchType, max) {
131131
return (
132132
<div
133133
style={{padding:5, display:'flex', flexDirection:'column', flexWrap:'no-wrap', alignItems:'center', border:'solid #a3aeb9 1px' }}>
134-
{radiusInField({label:'Semi-major Axis:', tooltip:'Enter the semi-major axis of the search'})}
134+
{radiusInField({label: 'Semi-major Axis:', tooltip: 'Enter the semi-major axis of the search'})}
135135
<ValidationField fieldKey='posangle'
136136
forceReinit={true}
137137
initialState={{
@@ -158,7 +158,12 @@ function sizeArea(searchType, max) {
158158

159159
return (
160160
<div style={{border: '1px solid #a3aeb9'}}>
161-
{radiusInField({label:'Side:', tooltip:'Enter side size of the box search', min:1 / 3600, max:7200 / 3600})}
161+
{radiusInField({
162+
label: 'Side:',
163+
tooltip: 'Enter side size of the box search',
164+
min: 1 / 3600,
165+
max: 7200 / 3600
166+
})}
162167
</div>
163168

164169
);
@@ -251,7 +256,7 @@ export const SpatialMethod = new Enum({
251256
);
252257

253258
var initRadiusArcSec = (max) => {
254-
if (max >= 10/3600) {
259+
if (max >= 10 / 3600) {
255260
return parseFloat(10 / 3600).toString();
256261
} else {
257262
return parseFloat(1 / 3600).toString();

src/firefly/js/ui/VoSearchPanel.jsx

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import React from 'react';
66
import {TargetPanel} from '../ui/TargetPanel.jsx';
7-
import {SizeInputFields, sizeFromDeg} from './SizeInputField.jsx';
7+
import {SizeInputFields} from './SizeInputField.jsx';
88
import {ValidationField} from './ValidationField.jsx';
99
import FieldGroupUtils from '../fieldGroup/FieldGroupUtils.js';
1010
import {ListBoxInputField} from './ListBoxInputField.jsx';
@@ -56,15 +56,20 @@ export class VoSearchPanel extends React.Component {
5656
function targetPanelArea() {
5757
return (
5858
<div className={'intarget'}>
59-
<TargetPanel groupKey={gkey}/>
59+
<TargetPanel groupKey={gkey} labelWidth={120}/>
6060
<ListBoxInputField
6161
fieldKey='targettry'
62+
initialState={{
63+
fieldKey:'targettry',
64+
label : '',
65+
labelWidth: 0
66+
}}
67+
label={''}
6268
options={[
6369
{label: 'Try NED then Simbad', value: 'NED'},
6470
{label: 'Try Simbad then NED', value: 'simbad'}
6571
]}
6672
multiple={false}
67-
labelWidth={3}
6873
/>
6974
</div>
7075
);
@@ -88,14 +93,19 @@ var sizeArea = () => {
8893
var voSearchArea = () => {
8994
return (
9095
<ValidationField
91-
fieldKey={'vourl'}
92-
/*validator={urlValidator}*/
93-
tooltip='Enter the VO cone search URL directly (or use the link below to open external NVO search and find the VO cone search URL)'
94-
label='VO URL:'
95-
size={75}
96+
fieldKey='vourl'
97+
initialState={{
98+
fieldKey: 'vourl',
99+
value: '',
100+
tooltip:'Enter the VO cone search URL directly (or use the link below to open external NVO search and find the VO cone search URL)',
101+
label:'Cone Search URL:',
102+
labelWidth : 90,
103+
nullAllowed:false,
104+
/*validator: {urlValidator}*/
105+
}}
106+
size={60}
96107
actOn={['blur','enter']}
97108
wrapperStyle={{margin: '5px 0'}}
98-
labelWidth={50}
99109
/>
100110
);
101111
};

src/firefly/js/visualize/ui/CatalogConstraintsPanel.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,8 @@ function ConstraintPanel({tableModel, fieldKey, onChange, ontablechanged}) {
275275
constraints:
276276
{ cellRenderer:
277277
createInputCell(
278-
15,
279278
FILTER_TTIPS,
279+
15,
280280
FilterInfo.validator,
281281
onChange
282282
)
@@ -322,7 +322,7 @@ function handleOnTableChanged(ev, params, fireValueChange) {
322322
let sqlTxt = '';
323323

324324
tbl_data.forEach((d) => {
325-
if (d[1].trim().length > 0) {
325+
if (d[1] && d[1].trim().length > 0) {
326326
const filterString = d[1].trim();
327327
const colName = d[0];
328328
//const filterInfoCls = FilterInfo.parse(d[0] + d[1]);

src/firefly/js/visualize/ui/CatalogSelectViewPanel.jsx

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import FormPanel from '../../ui/FormPanel.jsx';
88
import { get, merge, isEmpty} from 'lodash';
99
import {updateMerge} from '../../util/WebUtil.js';
1010
import {ListBoxInputField} from '../../ui/ListBoxInputField.jsx';
11-
import {doFetchTable, makeTblRequest, makeIrsaCatalogRequest, getTblById} from '../../tables/TableUtil.js';
11+
import {doFetchTable, makeTblRequest, makeIrsaCatalogRequest, makeVOCatalogRequest, getTblById} from '../../tables/TableUtil.js';
1212
import {CatalogTableListField} from './CatalogTableListField.jsx';
1313
import {CatalogConstraintsPanel} from './CatalogConstraintsPanel.jsx';
1414
import {FieldGroup} from '../../ui/FieldGroup.jsx';
@@ -212,18 +212,33 @@ function validateSql(sqlTxt) {
212212

213213
import {FilterInfo} from '../../tables/FilterInfo.js';
214214

215+
/**
216+
* VO search using 'ConeSearchByURL' search processor
217+
* N.B.: radius in degree!
218+
* TODO: doesn't trigger a coverage default image nor overlay compared to OPS usage of 'ConeSearchByURL' search processor
219+
* @param request
220+
*/
215221
function doVoSearch(request) {
216222
//VO url that work http://vizier.u-strasbg.fr/viz-bin/votable/-A?-source=J/A+A/402/549
217-
const radius = convertAngle('deg', 'arcsec', request.conesize);
218-
const accessUrl = request.vourl.trim().replace('&', 'URL_PARAM_SEP');
223+
const radius = convertAngle('deg', 'arcsec', request.conesize);//arcsec
224+
const accessUrl = request.vourl.trim();//.replace('&', 'URL_PARAM_SEP');
219225
const wp = parseWorldPt(request[ServerParams.USER_TARGET_WORLD_PT]);
220-
var tReq = makeTblRequest('ConeSearchByURL', `${wp.getObjName()} (VO SCS ${radius}")`,
226+
const nameUsed = wp.getObjName() || wp.toString();
227+
const name = `${nameUsed} (VO SCS ${radius}")`;
228+
var tReq = makeVOCatalogRequest(name,
221229
{
222230
[ServerParams.USER_TARGET_WORLD_PT]: request[ServerParams.USER_TARGET_WORLD_PT],
223-
SearchMethod: 'ConeSearchByURL',
224-
radius,
225-
accessUrl
226-
});
231+
SearchMethod: 'Cone',
232+
radius: request.conesize, //degree!
233+
accessUrl,
234+
/* radunits: 'DEGREE',
235+
displayUnits: 'ARCSEC',
236+
META_INFO: {
237+
POS_EQ_RA_MAIN:'_RA' //Shouldn't be needing this.
238+
POS_EQ_DE_MAIN:'_DE'
239+
}*/
240+
}
241+
);
227242
dispatchTableSearch(tReq);
228243
}
229244

0 commit comments

Comments
 (0)