diff --git a/src/firefly/html/css/global.css b/src/firefly/html/css/global.css index a6e33953b9..3b068579f1 100644 --- a/src/firefly/html/css/global.css +++ b/src/firefly/html/css/global.css @@ -239,25 +239,7 @@ display: inline-block; position: relative; text-shadow: 0 1px 0 #fff; - width: 12px; - height: 14px; -} -.btn-close:hover { - background-color: #949494; - border-radius: 50%; - cursor: pointer; -} -.btn-close:after { - content: '×'; /* UTF-8 symbol */ -} - -.btn-close { - color: #666; - font-size: 10px; - display: inline-block; - position: relative; - text-shadow: 0 1px 0 #fff; - width: 12px; + width: 14px; height: 14px; } .btn-close:hover { @@ -267,6 +249,10 @@ } .btn-close:after { content: '×'; /* UTF-8 symbol */ + left: 50%; + position: absolute; + transform: translate(-50%, 0); + font-weight: bold; } /*-------------------< loading mask ---------------------*/ diff --git a/src/firefly/java/edu/caltech/ipac/firefly/data/TableServerRequest.java b/src/firefly/java/edu/caltech/ipac/firefly/data/TableServerRequest.java index 1cd9b6d14f..e36ed90bdd 100644 --- a/src/firefly/java/edu/caltech/ipac/firefly/data/TableServerRequest.java +++ b/src/firefly/java/edu/caltech/ipac/firefly/data/TableServerRequest.java @@ -15,6 +15,7 @@ public class TableServerRequest extends ServerRequest implements Serializable, DataEntry, Cloneable { public static final String DECIMATE_INFO = "decimate"; + public static final String TBL_FILE_PATH = "tblFilePath"; public static final String TBL_ID = "tbl_id"; public static final String TITLE = "tbl_table"; public static final String FILTERS = "filters"; diff --git a/src/firefly/java/edu/caltech/ipac/firefly/server/query/IpacTablePartProcessor.java b/src/firefly/java/edu/caltech/ipac/firefly/server/query/IpacTablePartProcessor.java index 7f041805bc..5b3de0e93f 100644 --- a/src/firefly/java/edu/caltech/ipac/firefly/server/query/IpacTablePartProcessor.java +++ b/src/firefly/java/edu/caltech/ipac/firefly/server/query/IpacTablePartProcessor.java @@ -200,7 +200,7 @@ public DataGroupPart getData(ServerRequest sr) throws DataAccessException { dgFile = postProcessData(dgFile, request); page = IpacTableParser.getData(dgFile, request.getStartIndex(), request.getPageSize()); page.getTableDef().ensureStatus(); // make sure there's a status line so - page.getTableDef().setSource(ServerContext.replaceWithPrefix(dgFile)); // set table meta source to file it came from. + page.getTableDef().setAttribute(TableServerRequest.TBL_FILE_PATH, ServerContext.replaceWithPrefix(dgFile)); // set table's meta tblFilePath to the file it came from. } catch (Exception e) { LOGGER.error(e, "Fail to parse ipac table file: " + dgFile); throw e; @@ -243,13 +243,6 @@ public void onComplete(ServerRequest request, DataGroupPart results) throws Data } public String getUniqueID(ServerRequest request) { - - String uid = request.getRequestId() + "-"; - if ( useWorkspace || (isSecurityAware() && - ServerContext.getRequestOwner().isAuthUser()) ) { - uid = uid + ServerContext.getRequestOwner().getUserKey(); - } - // parameters to get original data (before filter, sort, etc.) List srvParams = new ArrayList<>(); for (Param p : request.getParams()) { @@ -257,40 +250,36 @@ public String getUniqueID(ServerRequest request) { srvParams.add(p); } } - - // sort by parameter name - Collections.sort(srvParams, (p1, p2) -> p1.getName().compareTo(p2.getName())); - - for (Param p : srvParams) { - uid += "|" + p.toString(); - } - - return uid; + return createUniqueId(request.getRequestId(), srvParams); } // unique key without page info public String getDataKey(ServerRequest request) { - String uid = request.getRequestId() + "-"; + List srvParams = new ArrayList<>(); + for (Param p : request.getParams()) { + if (!SYS_PARAMS.contains("|" + p.getName() + "|") && + !PAGE_PARAMS.contains(p.getName())) { + srvParams.add(p); + } + } + return createUniqueId(request.getRequestId(), srvParams); + } + + private String createUniqueId(String reqId, List params) { + String uid = reqId + "-"; if ( useWorkspace || (isSecurityAware() && ServerContext.getRequestOwner().isAuthUser()) ) { uid = uid + ServerContext.getRequestOwner().getUserKey(); } - /* - java.util.Collections.sort(request.getParams(), new Comparator(){ - @Override - public int compare(Param o1, Param o2) { - return o1.getName().compareTo(o2.getName()); - } - }); - */ + // sort by parameter name + Collections.sort(params, (p1, p2) -> p1.getName().compareTo(p2.getName())); - for (Param p : request.getParams()) { - if (!PAGE_PARAMS.contains(p.getName())) { - uid += "|" + p.toString(); - } + for (Param p : params) { + uid += "|" + p.toString(); } + return uid; } diff --git a/src/firefly/java/edu/caltech/ipac/firefly/server/util/ipactable/DataGroupWriter.java b/src/firefly/java/edu/caltech/ipac/firefly/server/util/ipactable/DataGroupWriter.java index 95f500ff6a..3585dad49a 100644 --- a/src/firefly/java/edu/caltech/ipac/firefly/server/util/ipactable/DataGroupWriter.java +++ b/src/firefly/java/edu/caltech/ipac/firefly/server/util/ipactable/DataGroupWriter.java @@ -80,20 +80,7 @@ public void start() throws IOException { writer = new PrintWriter(new BufferedWriter(new FileWriter(this.outf), IpacTableUtil.FILE_IO_BUFFER_SIZE)); - // combine meta with file attributes ArrayList attributes = new ArrayList<>(source.getKeywords()); - if (meta == null) { - meta = new HashMap<>(attributes.size()); - } else { - for (String k : meta.keySet()) { - attributes.add(new DataGroup.Attribute(k, meta.get(k))); - } - } - for (DataGroup.Attribute at : attributes) { - meta.put(at.getKey(), at.getValue()); - } - - writeStatus(writer, DataGroupPart.State.INPROGRESS); IpacTableUtil.writeAttributes(writer, attributes, DataGroupPart.LOADING_STATUS); List headers = Arrays.asList(source.getDataDefinitions()); @@ -118,7 +105,9 @@ private void close() { insertStatus(outf, DataGroupPart.State.COMPLETED); writer.flush(); writer.close(); - IpacTableUtil.sendLoadStatusEvents(meta, outf, rowCount, DataGroupPart.State.COMPLETED); + if (meta != null) { + IpacTableUtil.sendLoadStatusEvents(meta, outf, rowCount, DataGroupPart.State.COMPLETED); + } } } } @@ -130,8 +119,10 @@ public void run() { while(itr.hasNext()) { DataObject row = itr.next(); IpacTableUtil.writeRow(writer, headers, row); - if (++rowCount % 5000 == 0) { - IpacTableUtil.sendLoadStatusEvents(meta, outf, rowCount, DataGroupPart.State.INPROGRESS); + if (meta != null) { + if (++rowCount % 5000 == 0) { + IpacTableUtil.sendLoadStatusEvents(meta, outf, rowCount, DataGroupPart.State.INPROGRESS); + } } } } finally { diff --git a/src/firefly/java/edu/caltech/ipac/firefly/server/util/ipactable/JsonTableUtil.java b/src/firefly/java/edu/caltech/ipac/firefly/server/util/ipactable/JsonTableUtil.java index 575206938e..b5e24158f1 100644 --- a/src/firefly/java/edu/caltech/ipac/firefly/server/util/ipactable/JsonTableUtil.java +++ b/src/firefly/java/edu/caltech/ipac/firefly/server/util/ipactable/JsonTableUtil.java @@ -36,7 +36,7 @@ public class JsonTableUtil { */ public static JSONObject toJsonTableModel(DataGroupPart page, TableServerRequest request) throws IOException { - TableDef meta = page.getTableDef(); + TableDef meta = page.getTableDef().clone(); if (request != null && request.getMeta() != null) { for (String key : request.getMeta().keySet()) { meta.setAttribute(key, request.getMeta(key)); diff --git a/src/firefly/java/edu/caltech/ipac/firefly/server/util/ipactable/TableDef.java b/src/firefly/java/edu/caltech/ipac/firefly/server/util/ipactable/TableDef.java index 873a056cd5..49aa63e69f 100644 --- a/src/firefly/java/edu/caltech/ipac/firefly/server/util/ipactable/TableDef.java +++ b/src/firefly/java/edu/caltech/ipac/firefly/server/util/ipactable/TableDef.java @@ -124,12 +124,11 @@ public void setMetaTo(TableMeta meta) { if (contains("fileSize")) { meta.setFileSize(Long.parseLong(getAttribute("fileSize").getValue())); } - if (getSource() != null) { - meta.setSource(getSource()); - } meta.setIsLoaded(Boolean.parseBoolean(getAttribute("isFullyLoaded").getValue())); for (String key : meta.getAttributes().keySet()) { - setAttribute(key, meta.getAttribute(key)); + if (!key.equals("source")) { + setAttribute(key, meta.getAttribute(key)); + } } } @@ -144,14 +143,23 @@ public void getMetaFrom(TableMeta meta) { if (meta.getFileSize() > 0) { setAttribute("fileSize", String.valueOf( meta.getFileSize()) ); } - if (meta.getSource() != null) { - setSource(meta.getSource()); - } setAttribute("isFullyLoaded", String.valueOf(meta.isLoaded())); for (String key : meta.getAttributes().keySet()) { - setAttribute(key, meta.getAttribute(key)); + if (!key.equals("source")) { + setAttribute(key, meta.getAttribute(key)); + } } } + public TableDef clone() { + TableDef copy = new TableDef(); + copy.cols = new ArrayList<>(cols); + copy.attributes = new HashMap<>(attributes); + copy.lineWidth = lineWidth; + copy.rowCount = rowCount; + copy.rowStartOffset = rowStartOffset; + copy.lineSepLength = lineSepLength; + return copy; + } } /* * THIS SOFTWARE AND ANY RELATED MATERIALS WERE CREATED BY THE CALIFORNIA diff --git a/src/firefly/java/edu/caltech/ipac/util/IpacTableUtil.java b/src/firefly/java/edu/caltech/ipac/util/IpacTableUtil.java index 17b197765a..8601fb241f 100644 --- a/src/firefly/java/edu/caltech/ipac/util/IpacTableUtil.java +++ b/src/firefly/java/edu/caltech/ipac/util/IpacTableUtil.java @@ -389,14 +389,11 @@ public static TableDef getMetaInfo(BufferedReader reader, File src) throws IOExc public static void sendLoadStatusEvents(Map meta, File outf, int crows, DataGroupPart.State state) { if (meta == null || StringUtils.isEmpty(meta.get("tbl_id"))) return; - String source = ServerContext.replaceWithPrefix(outf); String tblId = String.valueOf( meta.get("tbl_id") ); - FluxAction action = new FluxAction("table.update"); action.setValue(tblId, "tbl_id"); action.setValue(crows, "totalRows"); action.setValue(state.name(), "tableMeta", DataGroupPart.LOADING_STATUS); - action.setValue(source, "tableMeta", "source"); ServerEventManager.fireAction(action); } diff --git a/src/firefly/js/charts/HistogramCntlr.js b/src/firefly/js/charts/HistogramCntlr.js index 9f99ab086f..e146cc6969 100644 --- a/src/firefly/js/charts/HistogramCntlr.js +++ b/src/firefly/js/charts/HistogramCntlr.js @@ -69,7 +69,7 @@ export const loadColData = function(rawAction) { return (dispatch) => { const {chartId, histogramParams, tblId} = rawAction.payload; - const tblSource = get(getTblById(tblId), 'tableMeta.source'); + const tblSource = get(getTblById(tblId), 'tableMeta.tblFilePath'); const chartModel = get(getChartSpace(HISTOGRAM), chartId); let serverCallNeeded = !chartModel || !chartModel.tblSource || chartModel.tblSource !== tblSource; @@ -186,7 +186,7 @@ function fetchColData(dispatch, tblId, histogramParams, chartId) { const activeTableModel = getTblById(tblId); const activeTableServerRequest = activeTableModel['request']; - const tblSource = get(activeTableModel, 'tableMeta.source'); + const tblSource = get(activeTableModel, 'tableMeta.tblFilePath'); const sreq = Object.assign({}, omit(activeTableServerRequest, ['tbl_id', 'META_INFO']), {'startIdx' : 0, 'pageSize' : 1000000}); diff --git a/src/firefly/js/charts/XYPlotCntlr.js b/src/firefly/js/charts/XYPlotCntlr.js index 3405c27878..4ede959b94 100644 --- a/src/firefly/js/charts/XYPlotCntlr.js +++ b/src/firefly/js/charts/XYPlotCntlr.js @@ -137,7 +137,7 @@ export function loadPlotData (rawAction) { return (dispatch) => { let xyPlotParams = rawAction.payload.xyPlotParams; const {chartId, tblId} = rawAction.payload; - const tblSource = get(getTblById(tblId), 'tableMeta.source'); + const tblSource = get(getTblById(tblId), 'tableMeta.tblFilePath'); const chartModel = get(getChartSpace(SCATTER), chartId); let serverCallNeeded = !chartModel || !chartModel.tblSource || chartModel.tblSource !== tblSource; @@ -303,7 +303,7 @@ function fetchPlotData(dispatch, tblId, xyPlotParams, chartId) { const activeTableModel = getTblById(tblId); const activeTableServerRequest = activeTableModel['request']; - const tblSource = get(activeTableModel, 'tableMeta.source'); + const tblSource = get(activeTableModel, 'tableMeta.tblFilePath'); if (!xyPlotParams) { xyPlotParams = getDefaultXYPlotParams(tblId); } diff --git a/src/firefly/js/charts/ui/ChartsTableViewPanel.jsx b/src/firefly/js/charts/ui/ChartsTableViewPanel.jsx index 83e955c037..402573c021 100644 --- a/src/firefly/js/charts/ui/ChartsTableViewPanel.jsx +++ b/src/firefly/js/charts/ui/ChartsTableViewPanel.jsx @@ -5,33 +5,24 @@ import './ChartPanel.css'; import React, {Component, PropTypes} from 'react'; import sCompare from 'react-addons-shallow-compare'; -// import {deepDiff} from '../util/WebUtil.js'; - import {get, debounce, defer, isBoolean} from 'lodash'; import Resizable from 'react-component-resizable'; - - import {flux} from '../../Firefly.js'; import * as TablesCntlr from '../../tables/TablesCntlr.js'; import * as TblUtil from '../../tables/TableUtil.js'; import {SelectInfo} from '../../tables/SelectInfo.js'; import {FilterInfo} from '../../tables/FilterInfo.js'; - import * as TableStatsCntlr from '../TableStatsCntlr.js'; import * as HistogramCntlr from '../HistogramCntlr.js'; import * as XYPlotCntlr from '../XYPlotCntlr.js'; import {dispatchChartExpanded, dispatchDelete, dispatchChartMounted, dispatchChartUnmounted} from '../ChartsCntlr.js'; - import {LO_MODE, LO_VIEW, dispatchSetLayoutMode} from '../../core/LayoutCntlr.js'; - import {SCATTER, HISTOGRAM, getChartSpace, getHighlighted, getTblIdForChartId, numRelatedCharts} from '../ChartUtil.js'; import {XYPlotOptions} from './XYPlotOptions.jsx'; import {XYPlot} from './XYPlot.jsx'; import {HistogramOptions} from './HistogramOptions.jsx'; import {Histogram} from './Histogram.jsx'; - import {showInfoPopup} from '../../ui/PopupUtil.jsx'; - import DELETE from 'html/images/blue_delete_10x10.png'; import OUTLINE_EXPAND from 'html/images/icons-2014/24x24_ExpandArrowsWhiteOutline.png'; import SETTINGS from 'html/images/icons-2014/24x24_GearsNEW.png'; @@ -42,6 +33,7 @@ import UNSELECT_ROWS from 'html/images/icons-2014/24x24_CheckmarkOff_Circle.png' import FILTER_IN from 'html/images/icons-2014/24x24_FilterAdd.png'; import CLEAR_FILTERS from 'html/images/icons-2014/24x24_FilterOff_Circle.png'; import LOADING from 'html/images/gxt/loading.gif'; +// import {deepDiff} from '../util/WebUtil.js'; class ChartsPanel extends React.Component { @@ -452,7 +444,8 @@ class ChartsPanel extends React.Component { if (optionsShown) { return (
- +
); } @@ -597,37 +590,48 @@ export class OptionsWrapper extends React.Component { // } render() { - const { chartId, tableModel, tblStatsData, chartType, tblPlotData, tblHistogramData} = this.props; + const { chartId, tableModel, tblStatsData, chartType, tblPlotData, tblHistogramData, toggleOptions} = this.props; + + var options; - if (get(tblStatsData,'isColStatsReady')) { + if (get(tblStatsData, 'isColStatsReady')) { const formName = 'ChartOpt_' + chartType + chartId; if (chartType === SCATTER) { - return ( - { + options = ( { XYPlotCntlr.dispatchLoadPlotData(chartId, xyPlotParams, tableModel.tbl_id); } - }/> - ); + }/>); } else { - return ( - { + options = ( { HistogramCntlr.dispatchLoadColData(chartId, histogramParams, tableModel.tbl_id); } - }/> - ); + }/>); } } else { - return (); + options = (); } + + return ( +
+ {toggleOptions && +
+
toggleOptions()}/> +
+ } + {options} +
+ ); } } @@ -637,6 +641,7 @@ OptionsWrapper.propTypes = { tblStatsData : PropTypes.object, tblPlotData : PropTypes.object, tblHistogramData: PropTypes.object, + toggleOptions: PropTypes.func, chartType: PropTypes.string }; diff --git a/src/firefly/js/charts/ui/HistogramOptions.jsx b/src/firefly/js/charts/ui/HistogramOptions.jsx index df097ea7ef..b65bf0540e 100644 --- a/src/firefly/js/charts/ui/HistogramOptions.jsx +++ b/src/firefly/js/charts/ui/HistogramOptions.jsx @@ -124,7 +124,7 @@ export class HistogramOptions extends React.Component { render() { const { colValStats, groupKey, histogramParams, onOptionsSelected}= this.props; return ( -
+
{onOptionsSelected &&
diff --git a/src/firefly/js/charts/ui/XYPlotOptions.jsx b/src/firefly/js/charts/ui/XYPlotOptions.jsx index 2229c7a934..5191d08a84 100644 --- a/src/firefly/js/charts/ui/XYPlotOptions.jsx +++ b/src/firefly/js/charts/ui/XYPlotOptions.jsx @@ -261,7 +261,7 @@ export class XYPlotOptions extends React.Component { }; return ( -
+
{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 ( }
@@ -255,7 +256,7 @@ function TableTitle({tbl_id, title, removable}) {
{truncate(title)}
{removable && -
dispatchTableRemove(tbl_id)}/> } diff --git a/src/firefly/js/tables/ui/TablePanelOptions.jsx b/src/firefly/js/tables/ui/TablePanelOptions.jsx index a34f4387ad..18faebc67f 100644 --- a/src/firefly/js/tables/ui/TablePanelOptions.jsx +++ b/src/firefly/js/tables/ui/TablePanelOptions.jsx @@ -29,7 +29,7 @@ export class TablePanelOptions extends React.Component { // } render() { - const {columns, origColumns, pageSize, showUnits, showFilters, onChange, optSortInfo, filterInfo} = this.props; + const {columns, origColumns, pageSize, showUnits, showFilters, onChange, optSortInfo, filterInfo, toggleOptions} = this.props; if (isEmpty(columns)) return false; const {onPageSize, onPropChanged, onReset} = makeCallbacks(onChange, columns, origColumns); @@ -64,6 +64,14 @@ export class TablePanelOptions extends React.Component {
+
toggleOptions()}/> + @@ -89,7 +97,8 @@ TablePanelOptions.propTypes = { pageSize: React.PropTypes.number, showUnits: React.PropTypes.bool, showFilters: React.PropTypes.bool, - onChange: React.PropTypes.func + onChange: React.PropTypes.func, + toggleOptions: React.PropTypes.func }; function makeCallbacks(onChange, columns, origColumns, data) { diff --git a/src/firefly/js/tables/ui/TableRenderer.js b/src/firefly/js/tables/ui/TableRenderer.js index 4d6434602f..6f08d196d2 100644 --- a/src/firefly/js/tables/ui/TableRenderer.js +++ b/src/firefly/js/tables/ui/TableRenderer.js @@ -181,7 +181,7 @@ export class TextCell extends React.Component { const lineHeight = this.props.height - 6 + 'px'; // 6 is the top/bottom padding. val = (val.search && val.search(html_regex) >= 0) ?
: val; return ( -
{val}
+
{val}
); } } diff --git a/src/firefly/js/ui/panel/TabPanel.jsx b/src/firefly/js/ui/panel/TabPanel.jsx index ce61369b72..928c60c9bd 100644 --- a/src/firefly/js/ui/panel/TabPanel.jsx +++ b/src/firefly/js/ui/panel/TabPanel.jsx @@ -202,7 +202,7 @@ export class Tab extends Component { {name}
{removable && -
onTabRemove && onTabRemove(name)}/> } diff --git a/src/firefly/js/util/WebUtil.js b/src/firefly/js/util/WebUtil.js index f47f3c7535..2117eda879 100644 --- a/src/firefly/js/util/WebUtil.js +++ b/src/firefly/js/util/WebUtil.js @@ -91,6 +91,9 @@ export function decodeParams(queryStr) { if (val.includes('&')) { val = decodeParams(val); } + if (isBooleanString(val)) { + val = toBoolean(val); + } rval[parts[0]] = val; return rval; }, {}); @@ -452,3 +455,13 @@ export function toBoolean(val, def=undefined) { typeof val === 'boolean'? val : String(val).toLowerCase() === 'true'; } + +/** + * return true if val is 'true' or 'fase' case-insensitive + * @param val the string value to check. + * @returns {*} + */ +export function isBooleanString(val) { + const s = String(val).toLowerCase(); + return s === 'true' || s === 'false'; +} diff --git a/src/firefly/js/visualize/saga/ChartsSync.js b/src/firefly/js/visualize/saga/ChartsSync.js index 7ebd5592ec..938e5d6921 100644 --- a/src/firefly/js/visualize/saga/ChartsSync.js +++ b/src/firefly/js/visualize/saga/ChartsSync.js @@ -93,7 +93,7 @@ export function* syncCharts() { function updateChartDataIfNeeded(tblId, chartId, chartType) { - const tblSource = get(TableUtil.getTblById(tblId), 'tableMeta.source'); + const tblSource = get(TableUtil.getTblById(tblId), 'tableMeta.tblFilePath'); const chartSpace = getChartSpace(chartType); const chartTblSource = get(chartSpace,[chartId,'tblSource']); if (tblSource && (!chartTblSource || chartTblSource !== tblSource)) { diff --git a/src/firefly/js/visualize/saga/CoverageWatcher.js b/src/firefly/js/visualize/saga/CoverageWatcher.js index 97d4cbd6e4..02ecb4a4c8 100644 --- a/src/firefly/js/visualize/saga/CoverageWatcher.js +++ b/src/firefly/js/visualize/saga/CoverageWatcher.js @@ -189,7 +189,7 @@ function updateCoverage(tbl_id, viewerId, decimatedTables, options) { const req = Object.assign({}, table.request, params); req.tbl_id = tbl_id; - if (decimatedTables[tbl_id] /*&& decimatedTables[tbl_id].tableMeta.source===table.tableMeta.source*/) { //todo support decimated data + if (decimatedTables[tbl_id] /*&& decimatedTables[tbl_id].tableMeta.tblFilePath===table.tableMeta.tblFilePath*/) { //todo support decimated data updateCoverageWithData(table, options, tbl_id, decimatedTables[tbl_id], decimatedTables); } else {