Skip to content

Commit a065d2c

Browse files
authored
Merge pull request #451 from Caltech-IPAC/IRSA-464-LCPhaseTable
IRSA-464:LC phase folded table doesn't get updated after the LC table is filtered out the first time
2 parents c72afc7 + 8e243fa commit a065d2c

File tree

2 files changed

+22
-7
lines changed

2 files changed

+22
-7
lines changed

src/firefly/js/templates/lightcurve/LcManager.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {get, has, isEmpty, isNil, cloneDeep, defer} from 'lodash';
55
import {take, fork} from 'redux-saga/effects';
66
import {SHOW_DROPDOWN, SET_LAYOUT_MODE, getLayouInfo,
77
dispatchUpdateLayoutInfo, dropDownManager} from '../../core/LayoutCntlr.js';
8-
import {TBL_RESULTS_ADDED, TABLE_LOADED, TBL_RESULTS_ACTIVE, TABLE_HIGHLIGHT, TABLE_SEARCH, TABLE_FETCH,
8+
import {TBL_RESULTS_ADDED, TABLE_LOADED, TBL_RESULTS_ACTIVE, TABLE_HIGHLIGHT, TABLE_SEARCH, TABLE_FETCH,TABLE_FILTER,
99
dispatchTableRemove, dispatchTableHighlight, dispatchTableFetch, dispatchTableSort} from '../../tables/TablesCntlr.js';
1010
import {getCellValue, getTblById, getTblIdsByGroup, getActiveTableId, smartMerge, getColumnIdx, removeTablesFromGroup} from '../../tables/TableUtil.js';
1111
import {updateSet, updateMerge, logError} from '../../util/WebUtil.js';
@@ -509,6 +509,12 @@ function handleTableLoad(layoutInfo, action) {
509509
layoutInfo = handleRawTableLoad(layoutInfo, tbl_id);
510510
layoutInfo = updateSet(layoutInfo, ['periodRange', 'period'], '' );
511511
}
512+
else if (invokedBy === TABLE_FILTER){
513+
//update the raw table row number here
514+
const rawTable = getTblById(tbl_id);
515+
//layoutInfo.rawTable = rawTable;
516+
//layoutInfo = handleRawTableLoad(layoutInfo, tbl_id);
517+
}
512518

513519

514520
layoutInfo = handleTableActive(layoutInfo, action); // because table_active happened before loaded.. we'll handle it here.

src/firefly/js/templates/lightcurve/LcResult.jsx

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ import CompleteButton from '../../ui/CompleteButton.jsx';
2323
import {HelpIcon} from '../../ui/HelpIcon.jsx';
2424
import {getTblById, doFetchTable, isTblDataAvail, MAX_ROW} from '../../tables/TableUtil.js';
2525
import {dispatchMultiValueChange, dispatchRestoreDefaults} from '../../fieldGroup/FieldGroupCntlr.js';
26-
import {logError} from '../../util/WebUtil.js';
27-
import {getConverter, getMissionName, defaultDownloaderOptPanel, DL_DATA_TAG} from './LcConverterFactory.js';
26+
import {logError,updateSet} from '../../util/WebUtil.js';
27+
import {getConverter, getMissionName, DL_DATA_TAG} from './LcConverterFactory.js';
2828
import {ERROR_MSG_KEY} from '../lightcurve/generic/errorMsg.js';
2929
import {convertAngle} from '../../visualize/VisUtil.js';
3030

@@ -283,7 +283,7 @@ function setViewerFail() {
283283
}
284284

285285
function updateFullRawTable(callback) {
286-
const layoutInfo = getLayouInfo();
286+
var layoutInfo = getLayouInfo();
287287
const tableItems = ['tableData', 'tableMeta'];
288288

289289
// fullRawTable for the derivation of other table, like phase folded table
@@ -302,7 +302,7 @@ function updateFullRawTable(callback) {
302302
var max = 365;
303303
var min = Math.pow(10, -3); // 0.001
304304

305-
// var period = get( FieldGroupUtils.getGroupFields(LC.FG_PERIOD_FINDER), ['period', 'value'], '');
305+
// var period = get( FieldGroupUtils.getGroupFields(LC.FG_PERIOD_FINDER), ['period', 'value'], '');
306306

307307
const period = '';
308308
var fields = FieldGroupUtils.getGroupFields(LC.FG_PERIOD_FINDER);
@@ -325,17 +325,26 @@ function updateFullRawTable(callback) {
325325
dispatchRestoreDefaults(LC.FG_PERIODOGRAM_FINDER);
326326
}
327327

328+
//IRSA-464: the smartMerge does not replace array component. It updates the array. Therefore, setting it
329+
//null first to force the new fullRawTable is updated to the layout
330+
dispatchUpdateLayoutInfo(Object.assign({}, layoutInfo, {
331+
fullRawTable:null,
332+
periodRange: {min, max, tzero, tzeroMax, period}
333+
}));
334+
//add the fullRawtable into the layout
328335
dispatchUpdateLayoutInfo(Object.assign({}, layoutInfo, {
329336
fullRawTable,
330337
periodRange: {min, max, tzero, tzeroMax, period}
331338
}));
339+
340+
332341
callback && callback();
333342
};
334343

335-
if (layoutInfo.fullRawTable) {
344+
var rawTable = getTblById(LC.RAW_TABLE);
345+
if (layoutInfo.fullRawTable && layoutInfo.fullRawTable.totalRows===rawTable) {
336346
callback && callback();
337347
} else {
338-
var rawTable = getTblById(LC.RAW_TABLE);
339348

340349
if (isTblDataAvail(0, rawTable.totalRows, rawTable)) {
341350
setTableData(rawTable);

0 commit comments

Comments
 (0)