Skip to content

DM-7520: XY plot is not shown after closing one of the catalog tab #175

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 13, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion buildScript/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ export default function makeWebpackConfig(config) {
`${config.firefly_root}/node_modules/react-component-resizable/`],
loader: 'babel',
query: {
presets: ['es2015', 'react', 'stage-2']
presets: ['es2015', 'react', 'stage-2'],
plugins: ['transform-runtime']
}
},
{ test : /\.css$/,
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"babel-preset-react": "6.11.1",
"babel-preset-stage-2": "6.13.0",
"babel-runtime" : "6.9.2",
"babel-plugin-transform-runtime": "6.12.0",
"babel-plugin-react-transform": "2.0.2",
"enum": "2.3.0",
"fixed-data-table": "0.6.3",
Expand Down
2 changes: 1 addition & 1 deletion src/firefly/js/tables/FilterInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export class FilterInfo {
* validate the filterInfo string
* @param {string} filterInfo
* @param {TableColumn[]} columns array of column definitions
* @returns {[boolean, string]} isValid plus an error message if isValid is false.
* @returns {Array.<boolean, string>} isValid plus an error message if isValid is false.
*/
static isValid(filterInfo, columns = []) {
const rval = [true, ''];
Expand Down
21 changes: 9 additions & 12 deletions src/firefly/js/tables/SelectInfo.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
/**
* Created by loi on 1/15/16.
*/


/*
* License information at https://github.com/Caltech-IPAC/firefly/blob/master/License.txt
*/

import {isEmpty} from 'lodash';

import {getTblById} from './TableUtil.js';
Expand Down Expand Up @@ -35,7 +31,7 @@ export class SelectInfo {
exceptions.delete(idx);
} else {
exceptions.add(idx);
if (exceptions.size == rowCount) {
if (exceptions.size === rowCount) {
this.setSelectAll(true);
}
}
Expand Down Expand Up @@ -85,7 +81,7 @@ export class SelectInfo {
}

isSelectAll() {
return this.data.selectAll && (this.data.exceptions.size == 0);
return this.data.selectAll && (this.data.exceptions.size === 0);
}

toString() {
Expand All @@ -95,7 +91,7 @@ export class SelectInfo {
parse(s) {
var selecInfo = {};
var parts = s.split('-');
if (parts.length == 3) {
if (parts.length === 3) {
selecInfo.selectAll = Boolean(parts[0]);
if (!isEmpty(parts[1])) {
selecInfo.exceptions = parts[1].reduce( (res, cval) => {
Expand All @@ -109,10 +105,11 @@ export class SelectInfo {

/**
* Destructing of the SelectInfo's data.
* @param {number=0} rowCount IMPORTANT!!. Total number of rows in the table. defaults to zero.
* @param {boolean} [selectAll] boolean. Indicates selectAll mode. defaults to false.
* @param {Set} [exceptions] A set of exceptions based on selectAll mode.
* @param {number} [offset] All indices passed into this class's funtion will be offsetted by this given value.
* @param {Object} p
* @param {number} p.rowCount IMPORTANT!!. Total number of rows in the table. defaults to zero.
* @param {boolean} p.selectAll boolean. Indicates selectAll mode. defaults to false.
* @param {Set} p.exceptions A set of exceptions based on selectAll mode.
* @param {number} offset All indices passed into this class's funtion will be offsetted by this given value.
* @returns {SelectInfo}
*/
static newInstance({selectAll=false, exceptions=(new Set()), rowCount=0}, offset) {
Expand Down
5 changes: 2 additions & 3 deletions src/firefly/js/tables/reducer/TableUiReducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* License information at https://github.com/Caltech-IPAC/firefly/blob/master/License.txt
*/

import {set, has, get, isEmpty, cloneDeep, findKey} from 'lodash';
import {set, has, get, isEmpty, cloneDeep, findKey, omit} from 'lodash';

import {updateSet, updateMerge} from '../../util/WebUtil.js';
import * as Cntlr from '../TablesCntlr.js';
Expand Down Expand Up @@ -58,8 +58,7 @@ function removeTable(root, action) {
Object.keys(root).filter( (ui_id) => {
return get(root, [ui_id, 'tbl_id']) === tbl_id;
}).forEach( (ui_id) => {
root = Object.assign({}, root);
Reflect.deleteProperty(root, [ui_id]);
root = omit(root, [ui_id]);
});
return root;
}
Expand Down
7 changes: 5 additions & 2 deletions src/firefly/js/ui/panel/TabPanel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -194,15 +194,18 @@ export class Tab extends Component {
const textStyle = maxTitleWidth ? {float: 'left', width: maxTitleWidth-(removable?14:0)} : {};

return (
<li className={tabClassName} onClick={() => onSelect(id,name)}>
<li className={tabClassName} onClick={() => !this.removed && onSelect(id,name)}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, clicking tab remove button triggered tab selection!

I wonder why it did not create issues for more than 2 tables.

<div>
<div style={textStyle} className='text-ellipsis' title={name}>
{name}
</div>
{removable &&
<div style={{right: -4, top: -2}} className='btn-close'
title='Remove Tab'
onClick={() => onTabRemove && onTabRemove(name)}/>
onClick={() => {
onTabRemove && onTabRemove(name);
this.removed = true;
}}/>
}
</div>
</li>);
Expand Down