Skip to content

Commit 79312da

Browse files
committed
DM-7406: light curve; response to reviews.
- move FireflyViewer related code into templates - create template mappings object in FFEntryPoint.js
1 parent 20d8286 commit 79312da

File tree

5 files changed

+30
-30
lines changed

5 files changed

+30
-30
lines changed

src/firefly/js/FFEntryPoint.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import ReactDOM from 'react-dom';
88
import {get} from 'lodash';
99

1010
import {firefly} from './Firefly.js';
11-
import {FireflyViewer} from './core/FireflyViewer.js';
11+
import {FireflyViewer} from './templates/fireflyviewer/FireflyViewer.js';
1212
import {LcViewer} from './templates/lightcurve/LcViewer.jsx';
1313
import {initApi} from './api/ApiBuild.js';
1414
import {HELP_LOAD} from './core/AppDataCntlr.js';
@@ -20,14 +20,13 @@ firefly.bootstrap();
2020
* A list of available templates
2121
* @enum {string}
2222
*/
23-
// eslint-disable-next-line
24-
const Template = {
23+
const Templates = {
2524
/**
2625
* This templates has multiple views: 'images', 'tables', and 'xyPlots'.
2726
* They can be combined with ' | ', i.e. 'images | tables'
2827
*/
29-
FFV: 'FireflyViewer',
30-
LCV: 'LightCurveViewer'
28+
FireflyViewer: FireflyViewer,
29+
LightCurveViewer : LcViewer
3130
};
3231

3332

@@ -36,7 +35,7 @@ const Template = {
3635
* what this application should do
3736
* @namespace firefly
3837
* @type {object}
39-
* @prop {Template} template the name of the template to use. defaults to 'FireflyViewer'
38+
* @prop {Templates} template the name of the template to use. defaults to 'FireflyViewer'
4039
* @prop {string} appTitle title of this application.
4140
* @prop {string} div the div to load this application into. defaults to 'app'
4241
* @prop {Object} menu custom menu bar
@@ -57,6 +56,7 @@ const app = get(window, 'firefly.app');
5756
if (app) {
5857
const defaults = {
5958
div: 'app',
59+
template: 'FireflyViewer',
6060
menu: [ {label:'Data Sets: Catalogs & Images', action:'AnyDataSetSearch'},
6161
{label:'Catalogs CLASSIC', action:'IrsaCatalogDropDown'},
6262
{label:'Test Searches', action:'TestSearches'},
@@ -67,7 +67,7 @@ if (app) {
6767
]
6868
};
6969
const props = Object.assign(defaults, app);
70-
const viewer = app.template === Template.LCV ? LcViewer : FireflyViewer;
70+
const viewer = Templates[props.template];
7171

7272
ReactDOM.render(React.createElement(viewer, props),
7373
document.getElementById(props.div));

src/firefly/js/core/layout/FireflyLayoutManager.js renamed to src/firefly/js/templates/fireflyviewer/FireflyLayoutManager.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import {take} from 'redux-saga/effects';
66
import {get, filter, omitBy, isNil, isEmpty} from 'lodash';
77

8-
import {LO_VIEW, LO_MODE, SHOW_DROPDOWN, SET_LAYOUT_MODE, getLayouInfo, dispatchUpdateLayoutInfo} from '../LayoutCntlr.js';
8+
import {LO_VIEW, LO_MODE, SHOW_DROPDOWN, SET_LAYOUT_MODE, getLayouInfo, dispatchUpdateLayoutInfo} from '../../core/LayoutCntlr.js';
99
import {clone} from '../../util/WebUtil.js';
1010
import {findGroupByTblId, getTblIdsByGroup,getActiveTableId} from '../../tables/TableUtil.js';
1111
import {TBL_RESULTS_ADDED, TABLE_LOADED, TABLE_REMOVE, TBL_RESULTS_ACTIVE} from '../../tables/TablesCntlr.js';

src/firefly/js/core/FireflyViewer.js renamed to src/firefly/js/templates/fireflyviewer/FireflyViewer.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,19 @@ import React, {Component, PropTypes} from 'react';
77
import sCompare from 'react-addons-shallow-compare';
88
import {pickBy} from 'lodash';
99

10-
import {flux, firefly} from '../Firefly.js';
11-
import {getMenu, isAppReady, dispatchSetMenu, dispatchOnAppReady} from '../core/AppDataCntlr.js';
12-
import {LO_VIEW, getLayouInfo, SHOW_DROPDOWN} from '../core/LayoutCntlr.js';
13-
import {layoutManager} from '../core/layout/FireflyLayoutManager.js';
14-
import {Menu} from '../ui/Menu.jsx';
15-
import {Banner} from '../ui/Banner.jsx';
16-
import {DropDownContainer} from '../ui/DropDownContainer.jsx';
17-
import {TriViewPanel} from '../ui/TriViewPanel.jsx';
18-
import {VisHeader} from '../visualize/ui/VisHeader.jsx';
19-
import {getActionFromUrl} from '../core/History.js';
20-
import {launchImageMetaDataSega} from '../visualize/ui/TriViewImageSection.jsx';
21-
import {dispatchAddViewer} from '../visualize/MultiViewCntlr.js';
22-
import {dispatchAddSaga} from '../core/MasterSaga.js';
10+
import {flux, firefly} from '../../Firefly.js';
11+
import {getMenu, isAppReady, dispatchSetMenu, dispatchOnAppReady} from '../../core/AppDataCntlr.js';
12+
import {LO_VIEW, getLayouInfo, SHOW_DROPDOWN} from '../../core/LayoutCntlr.js';
13+
import {layoutManager} from './FireflyLayoutManager.js';
14+
import {Menu} from '../../ui/Menu.jsx';
15+
import {Banner} from '../../ui/Banner.jsx';
16+
import {DropDownContainer} from '../../ui/DropDownContainer.jsx';
17+
import {TriViewPanel} from './TriViewPanel.jsx';
18+
import {VisHeader} from '../../visualize/ui/VisHeader.jsx';
19+
import {getActionFromUrl} from '../../core/History.js';
20+
import {launchImageMetaDataSega} from '../../visualize/ui/TriViewImageSection.jsx';
21+
import {dispatchAddViewer} from '../../visualize/MultiViewCntlr.js';
22+
import {dispatchAddSaga} from '../../core/MasterSaga.js';
2323

2424
// import {deepDiff} from '../util/WebUtil.js';
2525

src/firefly/js/ui/ResultsPanel.jsx renamed to src/firefly/js/templates/fireflyviewer/ResultsPanel.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import React, {Component, PropTypes} from 'react';
66
import sCompare from 'react-addons-shallow-compare';
77
import {pick, filter} from 'lodash';
88

9-
import DockLayoutPanel from './panel/DockLayoutPanel.jsx';
10-
import {LO_VIEW} from '../core/LayoutCntlr.js';
9+
import DockLayoutPanel from '../../ui/panel/DockLayoutPanel.jsx';
10+
import {LO_VIEW} from '../../core/LayoutCntlr.js';
1111
// import {deepDiff} from '../util/WebUtil.js';
1212

1313
const wrapperStyle = { flex: 'auto', display: 'flex', flexFlow: 'column', overflow: 'hidden'};

src/firefly/js/ui/TriViewPanel.jsx renamed to src/firefly/js/templates/fireflyviewer/TriViewPanel.jsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ import React, {Component} from 'react';
66
import sCompare from 'react-addons-shallow-compare';
77

88
import {pick} from 'lodash';
9-
import {flux} from '../Firefly.js';
10-
import {LO_VIEW, LO_MODE, getLayouInfo, dispatchSetLayoutMode} from '../core/LayoutCntlr.js';
11-
import {ResultsPanel} from '../ui/ResultsPanel.jsx';
12-
import {TablesContainer} from '../tables/ui/TablesContainer.jsx';
13-
import {ChartsContainer} from '../charts/ui/ChartsContainer.jsx';
14-
import {VisToolbar} from '../visualize/ui/VisToolbar.jsx';
15-
import {TriViewImageSection} from '../visualize/ui/TriViewImageSection.jsx';
9+
import {flux} from '../../Firefly.js';
10+
import {LO_VIEW, LO_MODE, getLayouInfo, dispatchSetLayoutMode} from '../../core/LayoutCntlr.js';
11+
import {ResultsPanel} from './ResultsPanel.jsx';
12+
import {TablesContainer} from '../../tables/ui/TablesContainer.jsx';
13+
import {ChartsContainer} from '../../charts/ui/ChartsContainer.jsx';
14+
import {VisToolbar} from '../../visualize/ui/VisToolbar.jsx';
15+
import {TriViewImageSection} from '../../visualize/ui/TriViewImageSection.jsx';
1616

1717
export class TriViewPanel extends Component {
1818

0 commit comments

Comments
 (0)