From a6fbf201203931786a9f691cdc83fa2616356061 Mon Sep 17 00:00:00 2001 From: loi Date: Thu, 3 Mar 2016 14:50:08 -0800 Subject: [PATCH 1/2] DM-5163 support for expanded view. --- src/fftools/js/fftools.js | 17 +- src/firefly/js/core/AppDataCntlr.js | 23 ++- src/firefly/js/core/reducers/LayoutReducer.js | 20 +-- src/firefly/js/tables/ui/BasicTable.jsx | 2 +- src/firefly/js/tables/ui/TablePanel.css | 2 +- src/firefly/js/tables/ui/TablePanel.jsx | 163 +++++++++-------- .../js/tables/ui/TablePanelOptions.jsx | 2 +- src/firefly/js/ui/ResultsPanel.jsx | 165 +++++++++--------- src/firefly/js/ui/panel/DockLayoutPanel.jsx | 9 +- src/firefly/js/visualize/iv/ExpandedTools.jsx | 4 +- .../js/visualize/ui/VisInlineToolbarView.jsx | 3 +- 11 files changed, 233 insertions(+), 177 deletions(-) diff --git a/src/fftools/js/fftools.js b/src/fftools/js/fftools.js index da01652c65..92ec61c734 100644 --- a/src/fftools/js/fftools.js +++ b/src/fftools/js/fftools.js @@ -5,12 +5,14 @@ import React from 'react'; import ReactDOM from 'react-dom'; +import {get} from 'lodash'; + import {flux, firefly} from 'firefly/Firefly.js'; -import AppDataCntlr, {dispatchUpdateLayout} from 'firefly/core/AppDataCntlr.js'; +import AppDataCntlr, {dispatchUpdateLayout, LO_XPD_MODE} from 'firefly/core/AppDataCntlr.js'; import Menu from 'firefly/ui/Menu.jsx'; import Banner from 'firefly/ui/Banner.jsx'; import SearchPanel from 'firefly/ui/SearchPanel.jsx'; -import ResultsPanel from 'firefly/ui/ResultsPanel.jsx'; +import {ResultsPanel} from 'firefly/ui/ResultsPanel.jsx'; import FormPanel from 'firefly/ui/FormPanel.jsx'; import TestImagePanel from 'firefly/visualize/ui/TestImagePanel.jsx'; import {ExpandedModeDisplay} from 'firefly/visualize/iv/ExpandedModeDisplay.jsx'; @@ -61,6 +63,7 @@ const App = React.createClass({ appData : React.PropTypes.object.isRequired, title : React.PropTypes.string, table : React.PropTypes.object, + expandedMode : React.PropTypes.string, activeTbl : React.PropTypes.object, tblStatsData : React.PropTypes.object, xyPlotData : React.PropTypes.object, @@ -90,7 +93,7 @@ const App = React.createClass({ render() { - var {appData, title, table} = this.props; + var {appData, title, table, expandedMode} = this.props; const tblId = table ? table.tbl_id : undefined; @@ -146,12 +149,13 @@ const App = React.createClass({
: } visToolbar = {} xyPlot = {
} - tables = {tblId && } + tables = {tblId && } layoutInfo = { appData.layoutInfo } />
@@ -166,7 +170,8 @@ function connector(state) { return { appData: state[AppDataCntlr.APP_DATA_PATH], title: 'FFTools entry point', - table : TblUtil.findTblById(activeTblId) + table : TblUtil.findTblById(activeTblId), + expandedMode : get(state, [AppDataCntlr.APP_DATA_PATH,'layoutInfo','mode','expanded']) }; } const container = flux.createSmartComponent(connector, App); diff --git a/src/firefly/js/core/AppDataCntlr.js b/src/firefly/js/core/AppDataCntlr.js index 3d9e4f901d..ef1eb46eb1 100644 --- a/src/firefly/js/core/AppDataCntlr.js +++ b/src/firefly/js/core/AppDataCntlr.js @@ -42,6 +42,19 @@ const REMOVE_PREF = `${APP_DATA_PATH}.removePreference`; //const HELP_LOAD = `${APP_DATA_PATH}.helpLoad`; const HELP_LOAD = `overviewHelp`; //note: consistent with AppMenu.prop +export const LO_STD_MODE = { + triview: {mode: {standard: 'tri-view'}}, + image_xyplot: {mode: {standard: 'image-xyplot'}}, + image_table: {mode: {standard: 'image-table'}}, + xyplot_table: {mode: {standard: 'xyplot-table'}} + }; +export const LO_XPD_MODE = { + tables: {mode: {expanded: 'tables'}}, + images: {mode: {expanded: 'images'}}, + xy_plots: {mode: {expanded: 'xyPlots'}}, + none: {mode: {expanded: undefined}} + }; + /*---------------------------- CREATORS ----------------------------*/ const showDialog= function(dialogId,ownerId=undefined) { @@ -249,10 +262,10 @@ function reducer(state=getInitState(), action={}) { history.add(state, action); - var newState = addDataReducer(state, action); + var newState = appDataReducer(state, action); var menu = menuRenderer.reducer(newState.menu, action); - var layoutInfo = layoutReducer.reducer(newState.layoutInfo, action, menu); + var layoutInfo = layoutReducer.reducer(newState.layoutInfo, action); return mergeAll(state, newState, {menu, layoutInfo}); } @@ -265,7 +278,7 @@ function mergeAll(orig, newval, updates) { return hasChanged ? Object.assign({}, newval, updates) : orig; } -function addDataReducer(state, action={}) { +function appDataReducer(state, action={}) { switch (action.type) { case APP_LOAD : return getInitState(); @@ -341,7 +354,9 @@ function dispatchRemovePreference(name) { * i.e. search panel, results panel... * @param search boolean. show the search panel. defaults to false. * @param results boolean. show the results panel. defaults to true. - * @param mode enum, one of ["auto", "tri", "sbs", "tb"]. defaults to "auto". + * @param mode {expanded: string, + * standard: string, // enum of ['tri-view', 'image-table', 'image-xyplot', 'table-xyplot'] + * } * @param views array of enum ["tables", "images", "xyPlots"]. Used in conjunction with mode to define what to show. * @param hasTables boolean. Table data available. * @param hasImages boolean. Image data available. diff --git a/src/firefly/js/core/reducers/LayoutReducer.js b/src/firefly/js/core/reducers/LayoutReducer.js index 0e398fa6d3..f725dd8bff 100644 --- a/src/firefly/js/core/reducers/LayoutReducer.js +++ b/src/firefly/js/core/reducers/LayoutReducer.js @@ -2,30 +2,24 @@ * License information at https://github.com/Caltech-IPAC/firefly/blob/master/License.txt */ -import {pick, isEqual} from 'lodash'; +import {get} from 'lodash'; import cntlr from '../AppDataCntlr.js'; +import {smartMerge} from '../../tables/TableUtil.js'; -function reducer(state={}, action={}, menu) { - var nState = state; +function reducer(state={}, action={}) { switch (action.type) { case cntlr.SHOW_SEARCH : - const nSearch = action.payload && action.payload.search; - if (nSearch !== state.search) { - nState = Object.assign({}, state, {search: nSearch}); - } - return nState; + const nState = {search: get(action, 'payload.search')}; + return smartMerge(state, nState); case cntlr.UPDATE_LAYOUT : - if (! isEqual(pick(state, Object.keys(action.payload)), action.payload) ) { - nState = Object.assign(state, action.payload); - } - return nState; + return smartMerge(state, action.payload); default: - return nState; + return state; } } diff --git a/src/firefly/js/tables/ui/BasicTable.jsx b/src/firefly/js/tables/ui/BasicTable.jsx index 7bc093d3fc..8b05670e35 100644 --- a/src/firefly/js/tables/ui/BasicTable.jsx +++ b/src/firefly/js/tables/ui/BasicTable.jsx @@ -46,7 +46,7 @@ export class BasicTable extends React.Component { } onColumnResizeEndCallback(newColumnWidth, columnKey) { - var columnWidths = Object.assign(this.state.columnWidths, {[columnKey]: newColumnWidth}); + var columnWidths = Object.assign({}, this.state.columnWidths, {[columnKey]: newColumnWidth}); this.setState({columnWidths}); } diff --git a/src/firefly/js/tables/ui/TablePanel.css b/src/firefly/js/tables/ui/TablePanel.css index f55bb77bee..1dc9294c29 100644 --- a/src/firefly/js/tables/ui/TablePanel.css +++ b/src/firefly/js/tables/ui/TablePanel.css @@ -19,8 +19,8 @@ } .TablePanel__wrapper { + flex: auto; position: relative; - width: 100%; background-color: #a5a5a5; border: 1px solid #8c8c8c; padding: 0 3px 3px 3px; diff --git a/src/firefly/js/tables/ui/TablePanel.jsx b/src/firefly/js/tables/ui/TablePanel.jsx index 7836e0fdd6..7b0cd1b505 100644 --- a/src/firefly/js/tables/ui/TablePanel.jsx +++ b/src/firefly/js/tables/ui/TablePanel.jsx @@ -15,9 +15,12 @@ import {SelectInfo} from '../SelectInfo.js'; import {InputField} from '../../ui/InputField.jsx'; import {intValidator} from '../../util/Validate.js'; import {ToolbarButton} from '../../ui/ToolbarButton.jsx'; +import {LO_XPD_MODE, LO_STD_MODE, dispatchUpdateLayout} from '../../core/AppDataCntlr.js'; +import {CloseButton} from '../../ui/CloseButton.jsx'; import LOADING from 'html/images/gxt/loading.gif'; import FILTER from 'html/images/icons-2014/24x24_Filter.png'; +import OUTLINE_EXPAND from 'html/images/icons-2014/24x24_ExpandArrowsWhiteOutline.png'; export class TablePanel extends Component { constructor(props) { @@ -25,7 +28,6 @@ export class TablePanel extends Component { this.storeUpdate = this.storeUpdate.bind(this); this.toggleOptions = this.toggleOptions.bind(this); this.onOptionUpdate = this.onOptionUpdate.bind(this); - this.onPageChange = this.onPageChange.bind(this); if (props.tbl_id) { this.tableStore = RemoteTableStore.newInstance(props.tbl_id, this.storeUpdate); @@ -73,86 +75,69 @@ export class TablePanel extends Component { this.setState({showOptions: !this.state.showOptions}); } - onPageChange (pageNum) { - if (pageNum.valid) { - this.tableStore.gotoPage(pageNum.value); - } - }; - render() { var {tableModel, columns, showOptions, showUnits, showFilters, textView} = this.state; - const {selectable} = this.props; + const {selectable, expandedMode} = this.props; + const {tableStore} = this; if (isEmpty(columns) || isEmpty(tableModel)) return false; const {startIdx, hlRowIdx, currentPage, pageSize, totalPages, tableRowCount, selectInfo, filterInfo, filterCount, sortInfo, data} = prepareTableData(tableModel); - - const selectInfoCls = SelectInfo.newInstance(selectInfo, startIdx); - const showLoading = !TblUtil.isTableLoaded(tableModel); - const rowFrom = startIdx + 1; - const rowTo = startIdx+tableRowCount; const viewIcoStyle = 'tablepanel ' + (textView ? 'tableView' : 'textView'); return ( -
-
-
- -
-
- +
+ + + +
+ {filterCount > 0 && + } +
-
- {filterCount > 0 &&
- -
- - {showOptions && - } -
-
); } @@ -165,6 +150,7 @@ TablePanel.propTypes = { showUnits: PropTypes.bool, showFilters: PropTypes.bool, selectable: PropTypes.bool, + expandedMode: PropTypes.bool, showToolbar: PropTypes.bool }; @@ -172,6 +158,7 @@ TablePanel.defaultProps = { showUnits: false, showFilters: false, selectable: true, + expandedMode: false, showToolbar: true, pageSize: 50 }; @@ -197,3 +184,41 @@ function ensureColumns(tableModel, columns) { } } +const Expanded = ({}) => { + return ( +
dispatchUpdateLayout(LO_XPD_MODE.none)}/>
+ ); +}; + +const PagingBar = ({currentPage, totalPages, startIdx, tableRowCount, tableModel, tableStore}) => { + const rowFrom = startIdx + 1; + const rowTo = startIdx + tableRowCount; + const showLoading = !TblUtil.isTableLoaded(tableModel); + + const onPageChange = (pageNum) => { + if (pageNum.valid) { + tableStore.gotoPage(pageNum.value); + } + }; + + return ( +
+
+ ); +}; \ No newline at end of file diff --git a/src/firefly/js/tables/ui/TablePanelOptions.jsx b/src/firefly/js/tables/ui/TablePanelOptions.jsx index e2fa5f4d2d..28bc0c626f 100644 --- a/src/firefly/js/tables/ui/TablePanelOptions.jsx +++ b/src/firefly/js/tables/ui/TablePanelOptions.jsx @@ -17,7 +17,7 @@ function prepareOptionData(columns) { var data = columns.map( (v, idx) => { return [v.name]; } ); - var cols = [{name: 'Column', visibility: 'show', prefWidth: 21}]; + var cols = [{name: 'Column', visibility: 'show', prefWidth: 20}]; var selectInfoCls = SelectInfo.newInstance({}); selectInfoCls.data.rowCount = data.length; columns.forEach( (v, idx) => { diff --git a/src/firefly/js/ui/ResultsPanel.jsx b/src/firefly/js/ui/ResultsPanel.jsx index 2484a187f4..056ee617c7 100644 --- a/src/firefly/js/ui/ResultsPanel.jsx +++ b/src/firefly/js/ui/ResultsPanel.jsx @@ -3,103 +3,110 @@ */ import React from 'react'; +import {get, pick} from 'lodash'; + import DockLayoutPanel from './panel/DockLayoutPanel.jsx'; -import appDataCntlr, {dispatchUpdateLayout} from '../core/AppDataCntlr.js'; +import {dispatchUpdateLayout} from '../core/AppDataCntlr.js'; +import {LO_STD_MODE} from '../core/AppDataCntlr.js'; +import {LO_XPD_MODE} from '../core/AppDataCntlr.js'; +const wrapperStyle = { flex: 'auto', display: 'flex', flexFlow: 'column'}; -function generateLayout(results, layoutInfo) { - var layout = {}; - const mode = layoutInfo.mode || 'auto'; - if (mode === 'auto') { - if ( results.length === 3 ) { - layout = { east: {index: 0}, west: {index: 1}, south: {index: 2, defaultSize: 'calc(100% - 300px)'} }; - } else if (results.length === 2 ) { - layout = {east: {index: 0, defaultSize: '50%'}, west: {index: 1} }; - } else if ( results.length === 1 ) { - layout = {center: {index: 0, defaultSize: '50%'}, resize: false }; - } - } else if ( mode === 'tri') { - layout = { east: {index: 0}, west: {index: 1}, south: {index: 2, defaultSize: 'calc(100% - 300px)'} }; - } else if ( mode === 'sbs') { - layout = {east: {index: 0, defaultSize: '50%'}, west: {index: 1} }; - } else if ( mode === 'tb') { - layout = {north: {index: 0, defaultSize: '50%'}, south: {index: 1} }; - } else if ( mode === 'expand') { - layout = {center: {index: 0} }; - } +export const ResultsPanel = function (props) { + const expandedView = get(props, 'layoutInfo.mode.expanded'); + return ( + expandedView + ? + : + ); +}; - return layout; -} -function resolveComponents(imagePlot, xyPlot, tables, layoutInfo) { - const views = layoutInfo.views || []; - var components = [imagePlot, tables, xyPlot]; - if (views.length > 0) { - components = views.reduce( (res, v) => { - if (v === 'tables' && layoutInfo.hasTables && tables) { - res.push(tables); - } else if (v === 'images' && layoutInfo.hasImages && imagePlot) { - res.push(imagePlot); - } else if (v === 'xyPlots' && layoutInfo.hasXyPlots && xyPlot) { - res.push(xyPlot); - } +ResultsPanel.propTypes = { + visToolbar: React.PropTypes.element, + searchDesc: React.PropTypes.element, + title: React.PropTypes.string, + imagePlot: React.PropTypes.element, + xyPlot: React.PropTypes.element, + tables: React.PropTypes.element, + layoutInfo: React.PropTypes.object +}; - }, [] ); - } - return components; -} -function renderResults(imagePlot, xyPlot, tables, layoutInfo) { +const ExpandedView = ({expandedView, imagePlot, xyPlot, tables}) => { + const view = expandedView === LO_XPD_MODE.tables.mode.expanded ? tables + : expandedView === LO_XPD_MODE.xy_plots.mode.expanded ? xyPlot + : imagePlot; + return ( +
+ {view} +
+ ); +}; + + +const StandardView = ({visToolbar, title, searchDesc, imagePlot, xyPlot, tables, layoutInfo}) => { const components = resolveComponents(imagePlot, xyPlot, tables, layoutInfo); const layout = generateLayout(components, layoutInfo); - return ( - - {components} - +
+ {visToolbar} + + title &&

{title}

+ + {components} + +
); -} +}; -function renderSearchDesc(searchDesc) { - const SearchDesc = searchDesc &&
{searchDesc}
; +const SearchDesc = ({searchDesc}) => { return (
- {SearchDesc ||
>>Search description not provided..
} + {searchDesc ?
{searchDesc}
+ :
>>Search description not provided..
}
-   -   -   - +   +   +   +
); -} -const ResultsPanel = function (props) { - var {visToolbar,searchDesc,title, imagePlot, xyPlot, tables, layoutInfo} = props; - const Title = title && (

{title}

); - const SearchDesc = renderSearchDesc(searchDesc); - - return ( -
- {visToolbar} - {SearchDesc} - {Title} - {renderResults(imagePlot, xyPlot, tables, layoutInfo)} -
- ); }; -ResultsPanel.propTypes = { - visToolbar: React.PropTypes.element, - searchDesc: React.PropTypes.element, - title: React.PropTypes.string, - imagePlot: React.PropTypes.element, - xyPlot: React.PropTypes.element, - tables: React.PropTypes.element, - layoutInfo: React.PropTypes.object -}; - - -export default ResultsPanel; - +function generateLayout(results, layoutInfo) { + const mode = get(layoutInfo, 'mode.standard', LO_STD_MODE.triview.mode.standard); + if (mode === LO_STD_MODE.image_table.mode.standard) { + return {east: {index: 0, defaultSize: '50%'}, west: {index: 1} }; + } else if (mode === LO_STD_MODE.image_xyplot.mode.standard) { + return {north: {index: 0, defaultSize: '50%'}, south: {index: 1} }; + } else if (mode === LO_STD_MODE.xyplot_table.mode.standard) { + return {north: {index: 0, defaultSize: '50%'}, south: {index: 1} }; + } else { + if ( results.length === 3 ) { + return {east: {index: 0}, west: {index: 1}, south: {index: 2, defaultSize: 'calc(100% - 300px)'}}; + } else if (results.length === 2 ) { + return {east: {index: 0, defaultSize: '50%'}, west: {index: 1} }; + } else { + return {center: {index: 0, defaultSize: '50%'}, resize: false }; + } + } +} +function resolveComponents(imagePlot, xyPlot, tables, layoutInfo) { + const mode = get(layoutInfo, 'mode.standard', LO_STD_MODE.triview.mode.standard); + if (mode === LO_STD_MODE.image_table.mode.standard) { + return [imagePlot, tables]; + } else if (mode === LO_STD_MODE.image_xyplot.mode.standard) { + return [imagePlot, xyPlot]; + } else if (mode === LO_STD_MODE.xyplot_table.mode.standard) { + return [tables, xyPlot]; + } else { + return [imagePlot, tables, xyPlot]; + } +} diff --git a/src/firefly/js/ui/panel/DockLayoutPanel.jsx b/src/firefly/js/ui/panel/DockLayoutPanel.jsx index 8e73d2a480..dc93394c43 100644 --- a/src/firefly/js/ui/panel/DockLayoutPanel.jsx +++ b/src/firefly/js/ui/panel/DockLayoutPanel.jsx @@ -1,4 +1,5 @@ import React from 'react'; +import {uniqueId, isEqual} from 'lodash'; import SplitPane from 'react-split-pane'; function createContentWrapper(children, index) { @@ -108,12 +109,18 @@ function layoutDom(layout, items) { } } +var prev = {}; + const DockLayoutPanel = function (props) { var {layout, children} = props; + if (!isEqual(prev.layout, layout)) { + prev.dpid = uniqueId('dpid-'); + prev.layout = layout; + } return (
-
+
{layoutDom(layout, children)}
diff --git a/src/firefly/js/visualize/iv/ExpandedTools.jsx b/src/firefly/js/visualize/iv/ExpandedTools.jsx index 6a6041cf77..6b8c3ed5b6 100644 --- a/src/firefly/js/visualize/iv/ExpandedTools.jsx +++ b/src/firefly/js/visualize/iv/ExpandedTools.jsx @@ -5,12 +5,14 @@ import React, {PropTypes} from 'react'; import {ExpandType, dispatchChangeExpandedMode, dispatchExpandedAutoPlay} from '../ImagePlotCntlr.js'; +import {dispatchUpdateLayout} from '../../core/AppDataCntlr.js'; import {primePlot, expandedPlotViewAry} from '../PlotViewUtil.js'; import {ToolbarButton} from '../../ui/ToolbarButton.jsx'; import {PlotTitle, TitleType} from './PlotTitle.jsx'; import {CloseButton} from '../../ui/CloseButton.jsx'; import {showExpandedOptionsPopup} from '../ui/ExpandedOptionsPopup.jsx'; import { dispatchChangeActivePlotView} from '../ImagePlotCntlr.js'; +import {LO_XPD_MODE} from '../../core/AppDataCntlr.js'; import './ExpandedTools.css'; @@ -127,7 +129,7 @@ export function ExpandedTools({visRoot}) { } return (
- console.log('ExpandedTools: back button')}/> + dispatchUpdateLayout(LO_XPD_MODE.none)}/> {plotTitle}
diff --git a/src/firefly/js/visualize/ui/VisInlineToolbarView.jsx b/src/firefly/js/visualize/ui/VisInlineToolbarView.jsx index 61369abf21..326dac1cea 100644 --- a/src/firefly/js/visualize/ui/VisInlineToolbarView.jsx +++ b/src/firefly/js/visualize/ui/VisInlineToolbarView.jsx @@ -8,6 +8,7 @@ import {ToolbarButton} from '../../ui/ToolbarButton.jsx'; import {LayerButton} from './VisToolbarView.jsx'; import {dispatchUpdateLayout} from '../../core/AppDataCntlr.js'; import {dispatchChangeExpandedMode, ExpandType} from '../ImagePlotCntlr.js'; +import {LO_XPD_MODE} from '../../core/AppDataCntlr.js'; import OUTLINE_EXPAND from 'html/images/icons-2014/24x24_ExpandArrowsWhiteOutline.png'; import DELETE from 'html/images/blue_delete_10x10.png'; @@ -17,7 +18,7 @@ import DELETE from 'html/images/blue_delete_10x10.png'; function expand(pv) { //console.log('todo- expand:' + primePlot(pv).title); - dispatchUpdateLayout( {mode: 'expand' }); + dispatchUpdateLayout( LO_XPD_MODE.images ); dispatchChangeExpandedMode(true); } From 02b76295ec655d396523b3a1777cf7bf52977ca7 Mon Sep 17 00:00:00 2001 From: loi Date: Thu, 3 Mar 2016 15:45:59 -0800 Subject: [PATCH 2/2] DM-5163 support for expanded view... response to comments --- src/firefly/js/core/AppDataCntlr.js | 9 +++------ src/firefly/js/tables/ui/BasicTable.jsx | 8 ++++---- src/firefly/js/tables/ui/TablePanel.jsx | 6 +++--- src/firefly/js/tables/ui/TablePanelOptions.jsx | 9 ++++----- 4 files changed, 14 insertions(+), 18 deletions(-) diff --git a/src/firefly/js/core/AppDataCntlr.js b/src/firefly/js/core/AppDataCntlr.js index ef1eb46eb1..3d8d204fa5 100644 --- a/src/firefly/js/core/AppDataCntlr.js +++ b/src/firefly/js/core/AppDataCntlr.js @@ -354,16 +354,13 @@ function dispatchRemovePreference(name) { * i.e. search panel, results panel... * @param search boolean. show the search panel. defaults to false. * @param results boolean. show the results panel. defaults to true. - * @param mode {expanded: string, - * standard: string, // enum of ['tri-view', 'image-table', 'image-xyplot', 'table-xyplot'] - * } - * @param views array of enum ["tables", "images", "xyPlots"]. Used in conjunction with mode to define what to show. + * @param mode see constant LO_STD_MODE and LO_XPD_MODE declaration from above * @param hasTables boolean. Table data available. * @param hasImages boolean. Image data available. * @param hasXyPlots boolean. XY Plot data available. */ -export function dispatchUpdateLayout({search, results, mode, views, hasTables, hasImages, hasXyPlots}) { - flux.process({type: UPDATE_LAYOUT, payload: pickBy({search, results, mode, views, hasTables, hasImages, hasXyPlots}, (v)=>(!isUndefined(v)))}); +export function dispatchUpdateLayout({search, results, mode, hasTables, hasImages, hasXyPlots}) { + flux.process({type: UPDATE_LAYOUT, payload: pickBy({search, results, mode, hasTables, hasImages, hasXyPlots}, (v)=>(!isUndefined(v)))}); } diff --git a/src/firefly/js/tables/ui/BasicTable.jsx b/src/firefly/js/tables/ui/BasicTable.jsx index 8b05670e35..7d0ebb79cd 100644 --- a/src/firefly/js/tables/ui/BasicTable.jsx +++ b/src/firefly/js/tables/ui/BasicTable.jsx @@ -11,7 +11,7 @@ import {debounce, get, isEmpty, pick} from 'lodash'; import {SelectInfo} from '../SelectInfo.js'; import {FilterInfo, FILTER_TTIPS} from '../FilterInfo.js'; import {InputField} from '../../ui/InputField.jsx'; -import {SORT_ASC, SORT_DESC, UNSORTED, SortInfo} from '../SortInfo'; +import {SORT_ASC, UNSORTED, SortInfo} from '../SortInfo'; import {tableToText} from '../TableUtil.js'; import './TablePanel.css'; @@ -187,7 +187,7 @@ const HeaderCell = ({col, showUnits, showFilters, filterInfoCls, sortInfoCls, on onChange = {(v) => onFilter(v)} actOn={['blur','enter']} showWarning={false} - width={'100%'} + width='100%' /> }
@@ -245,7 +245,7 @@ function makeColumns ({columns, columnWidths, data, selectable, showUnits, showF }; var cbox = 0 &&