Skip to content

Commit fbe6a7d

Browse files
committed
Bug fix: getObsCoreProductType should return a string or undefined
1 parent f989be1 commit fbe6a7d

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

docs/release-notes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
- [Notes on next version](next-release-details.md)
88

99
## Version 2023.2
10-
- 2023.2.0 - (estimated: Aug 15, 2023)
10+
- 2023.2.0 - (Aug 25, 2023)
1111
- docker tag: `2023.2.0`
1212

1313
### _Notes_
@@ -22,7 +22,7 @@
2222
- Obscore data results shows search target [Firefly-1291](https://github.com/Caltech-IPAC/firefly/pull/1411)
2323

2424
#### Other changes
25-
- read FITS tables directly with `nom.tam.fits` (removed star table) [Firefly-1232](https://github.com/Caltech-IPAC/firefly/pull/1390)
25+
- Read FITS tables directly with `nom.tam.fits` (removed star table) [Firefly-1232](https://github.com/Caltech-IPAC/firefly/pull/1390)
2626
- improved DCE: [Firefly-1286](https://github.com/Caltech-IPAC/firefly/pull/1408), [Firefly-1250](https://github.com/Caltech-IPAC/firefly/pull/1391)
2727
- Firefly now uses React 18 [Firefly-1127](https://github.com/Caltech-IPAC/firefly/pull/1396)
2828
- Firefly now uses Mavin central [Firefly-1258](https://github.com/Caltech-IPAC/firefly/pull/1397)

src/firefly/js/util/VOAnalyzer.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* License information at https://github.com/Caltech-IPAC/firefly/blob/master/License.txt
33
*/
44

5-
import {get, has, isArray, isEmpty, isObject, isString, intersection, unset} from 'lodash';
5+
import {get, has, isArray, isEmpty, isObject, isString, intersection} from 'lodash';
66
import Enum from 'enum';
77
import {
88
getColumn,
@@ -19,6 +19,7 @@ import {getCornersColumns} from '../tables/TableInfoUtil.js';
1919
import {MetaConst} from '../data/MetaConst.js';
2020
import {CoordinateSys} from '../visualize/CoordSys.js';
2121
import {makeAnyPt, makeWorldPt} from '../visualize/Point';
22+
import {isDefined} from './WebUtil.js';
2223

2324

2425
export const UCDCoord = new Enum(['eq', 'ecliptic', 'galactic']);
@@ -1306,12 +1307,17 @@ export const getObsTitle= (tableOrId, rowIdx) => {
13061307
*/
13071308
export const getObsCoreAccessURL= (tableOrId, rowIdx) => getObsCoreCellValue(tableOrId,rowIdx, 'access_url');
13081309
/**
1309-
* return dataproduct_type cell data
1310+
* return dataproduct_type cell data.
1311+
* and
13101312
* @param {TableModel|String} tableOrId - a table model or a table id
13111313
* @param rowIdx
1314+
* @param alwaysLowerCaseString - if data is defined then always return data as a lowercase string
13121315
* @return {string}
13131316
*/
1314-
export const getObsCoreProdType= (tableOrId, rowIdx) => getObsCoreCellValue(tableOrId,rowIdx, 'dataproduct_type');
1317+
export function getObsCoreProdType(tableOrId, rowIdx, alwaysLowerCaseString=true) {
1318+
const v= getObsCoreCellValue(tableOrId,rowIdx, 'dataproduct_type');
1319+
return (isDefined(v) && alwaysLowerCaseString) ? (v+'').toLowerCase() : v;
1320+
}
13151321

13161322

13171323
export function getProdTypeGuess(tableOrId, rowIdx) {

0 commit comments

Comments
 (0)