{onOptionsSelected &&
diff --git a/src/firefly/js/core/layout/FireflyLayoutManager.js b/src/firefly/js/core/layout/FireflyLayoutManager.js
index 841e9c1af6..0829c1e583 100644
--- a/src/firefly/js/core/layout/FireflyLayoutManager.js
+++ b/src/firefly/js/core/layout/FireflyLayoutManager.js
@@ -32,7 +32,7 @@ export function* layoutManager({title, views='tables | images | xyPlots'}) {
SHOW_DROPDOWN, SET_LAYOUT_MODE
]);
- var {hasImages, hasTables, hasXyPlots, mode, ...others} = getLayouInfo();
+ var {hasImages, hasTables, hasXyPlots, mode, dropDown={}, ...others} = getLayouInfo();
// eslint-disable-next-line
var {images, tables, xyPlots} = others; //images, tables, and xyPlots are additional states relevant only to them.
var {expanded, standard} = mode || {};
@@ -67,26 +67,48 @@ export function* layoutManager({title, views='tables | images | xyPlots'}) {
if (ignore) continue; // ignores, don't update layout.
const count = filter([showTables, showXyPlots, showImages]).length;
- if (count === 1) {
- // set mode into expanded view when there is only 1 component visible.
- closeable = false;
- expanded = showImages ? LO_VIEW.images :
- showXyPlots ? LO_VIEW.xyPlots :
- showTables ? LO_VIEW.tables : expanded;
- } else {
- expanded = LO_VIEW.none;
+
+ // change mode when new UI elements are added or removed from results
+ switch (action.type) {
+ case TBL_RESULTS_ADDED:
+ case REPLACE_IMAGES :
+ case ImagePlotCntlr.PLOT_IMAGE :
+ case TABLE_REMOVE:
+ case ImagePlotCntlr.DELETE_PLOT_VIEW:
+ if (count === 1) {
+ // set mode into expanded view when there is only 1 component visible.
+ closeable = false;
+ expanded = showImages ? LO_VIEW.images :
+ showXyPlots ? LO_VIEW.xyPlots :
+ showTables ? LO_VIEW.tables : expanded;
+ } else {
+ expanded = LO_VIEW.none;
+ }
+ mode = {expanded, standard, closeable};
+ }
+
+ // calculate dropDown when new UI elements are added or removed from results
+ switch (action.type) {
+ case TBL_RESULTS_ADDED:
+ case REPLACE_IMAGES :
+ case ImagePlotCntlr.PLOT_IMAGE :
+ dropDown = {visible: count === 0};
+ break;
+ case TABLE_REMOVE:
+ case ImagePlotCntlr.DELETE_PLOT_VIEW:
+ if (!get(dropDown, 'visible', false)) {
+ dropDown = {visible: count === 0};
+ }
+ break;
}
- mode = {expanded, standard, closeable};
- const dropDown = {visible: count === 0};
dispatchUpdateLayoutInfo(omitBy({title, views, mode, searchDesc, dropDown, showTables, showImages, showXyPlots, images}, isNil));
}
}
function handleLayoutChanges(action) {
- if (action.type === SHOW_DROPDOWN && get(action, 'payload.visible', true)) {
- return true;
- } else if (action.type === SET_LAYOUT_MODE && get(action, 'payload.mode') === LO_MODE.expanded){
+ if ((action.type === SHOW_DROPDOWN && get(action, 'payload.visible', true)) ||
+ (action.type === SET_LAYOUT_MODE && get(action, 'payload.mode') === LO_MODE.expanded)) {
return true;
} else {
return false;
diff --git a/src/firefly/js/tables/TableConnector.js b/src/firefly/js/tables/TableConnector.js
index 3b7584b05d..7757bf7e32 100644
--- a/src/firefly/js/tables/TableConnector.js
+++ b/src/firefly/js/tables/TableConnector.js
@@ -51,7 +51,7 @@ export class TableConnector {
// not implemented yet
} else {
const filterInfoCls = FilterInfo.parse(request.filters);
- const filePath = get(tableModel, 'tableMeta.source');
+ const filePath = get(tableModel, 'tableMeta.tblFilePath');
if (filePath) {
getRowIdFor(filePath, selected).then( (selectedRowIdAry) => {
const value = selectedRowIdAry.reduce((rv, val, idx) => {
diff --git a/src/firefly/js/tables/ui/BasicTableView.jsx b/src/firefly/js/tables/ui/BasicTableView.jsx
index 3ad8648872..57d4838c6f 100644
--- a/src/firefly/js/tables/ui/BasicTableView.jsx
+++ b/src/firefly/js/tables/ui/BasicTableView.jsx
@@ -250,7 +250,7 @@ function makeColWidth(columns, showUnits) {
}, {});
}
-function makeColumns ({columns, columnWidths, data, selectable, showUnits, showFilters, renderers, bgColor,
+function makeColumns ({columns, columnWidths, data, selectable, showUnits, showFilters, renderers, bgColor='white',
selectInfoCls, filterInfo, sortInfo, onRowSelect, onSelectAll, onSort, onFilter, onFilterSelected}) {
if (!columns) return false;
@@ -259,7 +259,7 @@ function makeColumns ({columns, columnWidths, data, selectable, showUnits, showF
const HeadRenderer = get(renderers, [col.name, 'headRenderer'], HeaderCell);
const CellRenderer = get(renderers, [col.name, 'cellRenderer'], TextCell);
const fixed = col.fixed || false;
- const style = col.fixed && bgColor && {backgroundColor: bgColor};
+ const style = col.fixed && {backgroundColor: bgColor};
return (
}