Skip to content
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

DM-4484: Catalogs Overlay #44

Merged
merged 1 commit into from
Mar 30, 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
11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"icepick" : "0.2.0",
"isomorphic-fetch": "2.2.1",
"local-storage" : "1.4.2",
"lodash" : "4.0.1",
"lodash" : "4.6.1",
"numeral" : "1.5.3",
"react" : "0.14.7",
"react-dom" : "0.14.7",
Expand All @@ -27,9 +27,12 @@
"react-highcharts": "5.0.6",
"react-redux": "3.1.2",
"react-split-pane": "0.1.22",
"redux" : "3.0.5",
"redux-thunk": "0.1.0",
"redux-logger": "1.0.9",

"redux" : "3.3.1",
"redux-thunk": "2.0.1",
"redux-logger": "2.6.1",
"redux-saga": "0.9.5",

"underscore.string": "3.2.3",
"uniq" : "1.0.1",
"validator" : "4.5.0",
Expand Down
12 changes: 11 additions & 1 deletion src/fftools/java/edu/caltech/ipac/fftools/resources/AppMenu.prop
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AppMenu.Items = AnyDataSetSearch IrsaCatalogDropDown ImageSelectDropDownCmd overviewHelp
AppMenu.Items = AnyDataSetSearch IrsaCatalogDropDown TestACatalog ImageSelectDropDownCmd overviewHelp exampleDialog



Expand Down Expand Up @@ -30,11 +30,21 @@ IrsaCatalogDropDown.Title= Catalogs CLASSIC
IrsaCatalogDropDown.ShortDescription= Choose a catalog to add to your results

about.Title=

overviewHelp.Title= Help
overviewHelp.ShortDescription= About IRSA view Tool
overviewHelp.ToolbarButtonType= COMMAND


exampleDialog.Title= Example Dialog
exampleDialog.ShortDescription= An example
exampleDialog.ToolbarButtonType= COMMAND


TestACatalog.Title = Cat Test
TestACatalog.ShortDescription= test...


AnyDataSetSearch.Name = AnyDataSetSearch
AnyDataSetSearch.Title = Data Sets: Catalogs & Images
AnyDataSetSearch.Important = true
Expand Down
2 changes: 2 additions & 0 deletions src/fftools/js/fftools.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {LO_EXPANDED, LAYOUT_PATH, getActiveTableId, getExpandedMode, SHOW_DROPDO
import Menu from 'firefly/ui/Menu.jsx';
import Banner from 'firefly/ui/Banner.jsx';
import {SearchPanel} from 'firefly/ui/SearchPanel.jsx';
import {TestCatalog} from 'firefly/ui/TestCatalog.jsx';
import {DropDownContainer} from 'firefly/ui/DropDownContainer.jsx';
import {ResultsPanel} from 'firefly/ui/ResultsPanel.jsx';
import TestImagePanel from 'firefly/visualize/ui/TestImagePanel.jsx';
Expand Down Expand Up @@ -68,6 +69,7 @@ const App = React.createClass({
/>
<DropDownContainer>
<SearchPanel resultId={resultId} />
<TestCatalog resultId={resultId} />
</DropDownContainer>
</header>
<main>
Expand Down
2 changes: 1 addition & 1 deletion src/firefly/js/core/JsonUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/*eslint prefer-template:0 */
import { getRootURL, getRootPath, getHost, getPort } from '../util/BrowserUtil.js';
import { encodeServerUrl } from '../util/WebUtil.js';
import ServerParams from '../data/ServerParams.js';
import {ServerParams} from '../data/ServerParams.js';
import {fetchUrl} from '../util/WebUtil.js';

//var http= require('http');
Expand Down
36 changes: 36 additions & 0 deletions src/firefly/js/core/MasterSaga.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* License information at https://github.com/Caltech-IPAC/firefly/blob/master/License.txt
*/

import {flux} from '../Firefly.js';
import {fork, take} from 'redux-saga/effects';
import {watchCatalogs} from '../visualize/saga/CatalogWatcher.js';

export const ADD_SAGA= 'MasterSaga.addSaga';


/**
*
* @param saga a generator function that uses redux-saga
*/
export function dispatchAddSaga(saga) {
flux.process({ type: ADD_SAGA, payload: { saga }});
}


/**
* This saga launches all the predefined Sagas then loops and waits for any ADD_SAGA actions and launches those Segas
*/
export function* masterSaga() {
var saga;

// This section starts any predefined Sagas
yield fork( watchCatalogs);

// Start a saga from any action
while (true) {
var action= yield take(ADD_SAGA);
saga= action.payload.saga;
if (typeof saga === 'function') yield fork( saga);
}
}
22 changes: 15 additions & 7 deletions src/firefly/js/core/ReduxFlux.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@


import React from 'react';
import createSagaMiddleware from 'redux-saga';
import thunkMiddleware from 'redux-thunk';
import loggerMiddleware from 'redux-logger';
import { createStore, applyMiddleware, combineReducers } from 'redux';
Expand Down Expand Up @@ -32,6 +33,7 @@ import DrawLayerFactory from '../visualize/draw/DrawLayerFactory.js';
import DrawLayerCntlr, {makeDetachLayerActionCreator} from '../visualize/DrawLayerCntlr.js';
import MultiViewCntlr, {IMAGE_MULTI_VIEW_KEY} from '../visualize/MultiViewCntlr.js';
import DialogCntlr, {DIALOG_KEY} from '../core/DialogCntlr.js';
import {masterSaga} from './MasterSaga.js';

//--- import drawing Layers
import ActiveTarget from '../drawingLayers/ActiveTarget.js';
Expand All @@ -40,6 +42,9 @@ import DistanceTool from '../drawingLayers/DistanceTool.js';
import PointSelection from '../drawingLayers/PointSelection.js';
import StatsPoint from '../drawingLayers/StatsPoint.js';
import NorthUpCompass from '../drawingLayers/NorthUpCompass.js';
import Catalog from '../drawingLayers/Catalog.js';

import {showExampleDialog} from '../ui/ExampleDialog.jsx';

/**
* A map to rawAction.type to an ActionCreator
Expand All @@ -50,7 +55,8 @@ const actionCreators = new Map();


const drawLayerFactory= DrawLayerFactory.makeFactory(ActiveTarget,SelectArea,DistanceTool,
PointSelection, StatsPoint, NorthUpCompass );
PointSelection, StatsPoint, NorthUpCompass,
Catalog);


/**
Expand Down Expand Up @@ -104,6 +110,10 @@ actionCreators.set(XYPlotCntlr.LOAD_PLOT_DATA, XYPlotCntlr.loadPlotData);



actionCreators.set('exampleDialog', (rawAction) => {
showExampleDialog();
return rawAction;
});



Expand Down Expand Up @@ -158,11 +168,9 @@ var logger= loggerMiddleware({duration:true, predicate:logFilter, collapsed:coll
function createRedux() {
// create a rootReducer from all of the registered reducers
const rootReducer = combineReducers(reducers);

// redux is a store and more.. it manages reducers as well as thunk actions
// we'll call it redux for now.
// return applyMiddleware(actionSideEffectMiddleware, thunkMiddleware, logger)(createStore)(rootReducer);
return applyMiddleware(actionSideEffectMiddleware, thunkMiddleware)(createStore)(rootReducer);
const middleWare= applyMiddleware(actionSideEffectMiddleware, thunkMiddleware, createSagaMiddleware(masterSaga));

return createStore(rootReducer, middleWare);
}

function bootstrap() {
Expand All @@ -184,7 +192,7 @@ function bootstrap() {
*
* <i>Note: </i> Often it makes sense to have a utility function call <code>process</code>. In that case
* the utility function should meet the follow criteria. This is a good way to document and default the
* payload parameters. The utility function should implment the following standard:
* payload parameters. The utility function should implement the following standard:
* <ul>
* <li>The function name should start with "dispatch"</li>
* <li>The action type as the second part of the name</li>
Expand Down
20 changes: 20 additions & 0 deletions src/firefly/js/data/MetaConst.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* License information at https://github.com/Caltech-IPAC/firefly/blob/master/License.txt
*/

/**
* List of constants that are used in meta data of tables
*/
export const MetaConst = {
CENTER_COLUMN : 'CENTER_COLUMN',
ALL_CORNERS : 'ALL_CORNERS',
WORLD_PT_KEY : 'SearchByPosition.worldpt',
RADIUS_KEY : 'SearchByPosition.field.radius',
CATALOG_OVERLAY_TYPE : 'CatalogOverlayType',
CATALOG_HINTS : 'CatalogHints',
DATA_PRIMARY : 'DataPrimary',
CATALOG_TARGET_COL_NAME : 'CatalogTargetColName',
CATALOG_COORD_COLS : 'CatalogCoordColumns',
DATASET_CONVERTER : 'datasetInfoConverterId',
DEFAULT_COLOR : 'DEFAULT_COLOR'
};
14 changes: 1 addition & 13 deletions src/firefly/js/data/ServerParams.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,11 @@
/*
* License information at https://github.com/Caltech-IPAC/firefly/blob/master/License.txt
*/
/**
* User: roby
* Date: 2/7/12
* Time: 10:14 AM
*/


/**
* @author Trey Roby
*/

/**
* List of constants that are used as the names of parameters passed to the server.
*/
const ServerParams = {
export const ServerParams = {
COMMAND : 'cmd',
DO_JSONP : 'doJsonp',
RED_REQUEST : 'red',
Expand Down Expand Up @@ -154,5 +144,3 @@ const ServerParams = {

USER_TARGET_WORLD_PT : 'UserTargetWorldPt'
};

export default ServerParams;
Loading