- widgets loaded
@@ -31,6 +31,7 @@
+
+
+
Image load fails. The following should happen:
+
+ - No Image
+ - Centered Message: Failed- SDSS: Area not covered
+ - Toolbar button active, when toolbar popup shown, toolbar should have "select image" button active
+
+
+
+
+
+
+
+
+
diff --git a/src/firefly/js/drawingLayers/WebGrid.js b/src/firefly/js/drawingLayers/WebGrid.js
index b377e830f5..6d6ae24108 100644
--- a/src/firefly/js/drawingLayers/WebGrid.js
+++ b/src/firefly/js/drawingLayers/WebGrid.js
@@ -121,12 +121,14 @@ function getDrawData(dataType, plotId, drawLayer, action, lastDataRet){
drawData= Object.assign({},drawLayer.drawData, {data});
return {drawData};
}
+ break;
case DrawLayerCntlr.MODIFY_CUSTOM_FIELD:
const {coordinate}= action.payload.changes;
if (coordinate !== drawLayer.coordinate ) {
const drawData= Object.assign({},drawLayer.drawData, {data:null});
return { coordinate, drawData};
}
+ break;
}
return null;
diff --git a/src/firefly/js/templates/fireflyviewer/FireflyViewer.js b/src/firefly/js/templates/fireflyviewer/FireflyViewer.js
index 793f687e19..f6689582f4 100644
--- a/src/firefly/js/templates/fireflyviewer/FireflyViewer.js
+++ b/src/firefly/js/templates/fireflyviewer/FireflyViewer.js
@@ -25,9 +25,7 @@ import {getWorkspaceConfig, initWorkspace} from '../../visualize/WorkspaceCntlr.
import {warningDivId} from '../../ui/LostConnection.jsx'
import FFTOOLS_ICO from 'html/images/fftools-logo-offset-small-75x75.png';
-
-// import {deepDiff} from '../util/WebUtil.js';
-
+import {startMasterTableWatcher} from '../../visualize/saga/MasterTableWatch';
/**
* This FireflyViewer is a generic application with some configurable behaviors.
@@ -51,6 +49,7 @@ export class FireflyViewer extends PureComponent {
getImageMasterData();
const views = LO_VIEW.get(props.views) || LO_VIEW.none;
this.state = this.getNextState();
+ startMasterTableWatcher([{}]);
dispatchAddSaga(watchCatalogs);
if (views.has(LO_VIEW.images) ) launchImageMetaDataSega();
dispatchAddSaga(layoutManager,{views: props.views});
diff --git a/src/firefly/js/visualize/PlotViewUtil.js b/src/firefly/js/visualize/PlotViewUtil.js
index 71cd089744..9fd3b92b1d 100644
--- a/src/firefly/js/visualize/PlotViewUtil.js
+++ b/src/firefly/js/visualize/PlotViewUtil.js
@@ -527,12 +527,12 @@ export function clonePvAryWithPv(ref, plotView) {
/**
* Find a plot by id in a PlotView
* @param {PlotView} plotView
- * @param {string} imagePlotId
+ * @param {string} plotImageId
* @return {WebPlot}
*/
-export function findPlot(plotView, imagePlotId) {
- if (!plotView) return null;
- return plotView.plots.find( (p) => imagePlotId===p.imagePlotId);
+export function findPlot(plotView, plotImageId) {
+ if (!plotView) return undefined;
+ return plotView.plots.find( (p) => plotImageId===p.plotImageId);
}
@@ -739,7 +739,7 @@ export function getFoV(pv, alternateZoomFactor) {
* @return {boolean} true if there are cubes or images
*/
export function isMultiImageFits(pv) {
- return Boolean(isMultiHDUFits(pv) || getNumberOfCubesInPV(pv)>0)
+ return Boolean(isMultiHDUFits(pv) || getNumberOfCubesInPV(pv)>0);
}
/**
diff --git a/src/firefly/js/visualize/__tests__/PlotViewUtil-test.js b/src/firefly/js/visualize/__tests__/PlotViewUtil-test.js
index 1a37cda309..9c3e5bb819 100644
--- a/src/firefly/js/visualize/__tests__/PlotViewUtil-test.js
+++ b/src/firefly/js/visualize/__tests__/PlotViewUtil-test.js
@@ -1,6 +1,7 @@
import {primePlot, getPlotViewById, isActivePlotView, getActivePlotView} from '../PlotViewUtil.js';
import {makePlotView} from '../reducer/PlotView.js';
import {WebPlotRequest} from '../WebPlotRequest.js'
+import {findPlot, primePlotType} from '../PlotViewUtil';
@@ -106,3 +107,19 @@ describe('Test PlotViewUtil active PlotView functions', () => {
expect(pv.plotId).toEqual(ACTIVE_ID);
});
});
+
+describe('Less used PlotViewUtil functions', () => {
+ test('primePlotType)', () => {
+ const pv= getPlotViewById(pvAry, 'testId-xxxx');
+ expect(primePlotType(pv)).toEqual('image');
+ });
+
+ test('findPlot)', () => {
+ debugger;
+ const pv= getPlotViewById(pvAry, 'testId1');
+ const plot= findPlot(pv, 'testId1-image1');
+ expect(plot).toBeDefined();
+ expect(plot.plotImageId).toEqual('testId1-image1');
+ });
+
+});
diff --git a/src/firefly/js/visualize/iv/ImageViewerDecorate.jsx b/src/firefly/js/visualize/iv/ImageViewerDecorate.jsx
index d05517e4c9..201e206816 100644
--- a/src/firefly/js/visualize/iv/ImageViewerDecorate.jsx
+++ b/src/firefly/js/visualize/iv/ImageViewerDecorate.jsx
@@ -179,7 +179,20 @@ const bgSlightGray= {background: 'rgba(255,255,255,.2)'};
const bgFFGray= {background: '#e3e3e3'};
function makeInlineRightToolbar(visRoot,pv,dlAry,mousePlotId, handleInlineTools, showDelete) {
+ const tb= !isExpanded && visRoot.useFloatToolbar;
+ const lVis= BrowserInfo.isTouchInput() || (visRoot.useFloatToolbar && pv && mousePlotId===pv.plotId);
+ const style= (lVis || tb) && handleInlineTools ? bgFFGray : bgSlightGray;
+ if (!pv && tb && handleInlineTools) {
+ return (
+
+
+
+ );
+
+ }
if (!pv) return false;
+
const useInlineToolbar = toolsAnno.includes(pv.plotViewCtx.annotationOps);
const isExpanded= visRoot.expandedMode!==ExpandType.COLLAPSE;
@@ -199,10 +212,7 @@ function makeInlineRightToolbar(visRoot,pv,dlAry,mousePlotId, handleInlineTools,
return false;
}
}
- const lVis= BrowserInfo.isTouchInput() || (visRoot.useFloatToolbar && mousePlotId===pv.plotId);
const exVis= BrowserInfo.isTouchInput() || mousePlotId===pv.plotId;
- const tb= !isExpanded && visRoot.useFloatToolbar;
- const style= (lVis || tb) && handleInlineTools ? bgFFGray : bgSlightGray;
return (
} tableWatcherDefList
+ */
+export function startMasterTableWatcher(tableWatcherDefList) {
+
+
+ const actions = [TABLE_SEARCH];
+
+ dispatchAddActionWatcher({
+ actions,
+ id: 'masterTableWatcher',
+ callback: masterTableWatcher,
+ params: {tableWatcherDefList}});
+
+}
+
+function masterTableWatcher(action, cancelSelf, params) {
+
+ const {tableWatcherDefList}= params;
+ const tbl_id = get(action.payload, 'request.tbl_id');
+ if (!tbl_id) return;
+
+ switch (action.type) {
+ case TABLE_SEARCH:
+ onTableLoaded(tbl_id).then( (table) =>
+ !table.error && evaluateTableAndStartWatchers(table, tableWatcherDefList));
+ break;
+
+ }
+
+}
+
+
+function evaluateTableAndStartWatchers(table, tableWatcherDefList) {
+
+ console.log(`new loaded table: ${table.tbl_id}`);
+}
diff --git a/src/firefly/js/visualize/ui/VisInlineToolbarView.jsx b/src/firefly/js/visualize/ui/VisInlineToolbarView.jsx
index 4575306db0..bfefbb8a5a 100644
--- a/src/firefly/js/visualize/ui/VisInlineToolbarView.jsx
+++ b/src/firefly/js/visualize/ui/VisInlineToolbarView.jsx
@@ -71,6 +71,7 @@ export class VisInlineToolbarView extends PureComponent {
render() {
const {pv, dlAry, showLayer, expandGrid, showExpand, showDelete, showToolbarButton, help_id}= this.props;
+ const shouldShowTools= Boolean((showToolbarButton && showExpand) || (showToolbarButton && !pv.plots.length));
return (
@@ -80,7 +81,7 @@ export class VisInlineToolbarView extends PureComponent {
tip='Show tools'
additionalStyle={{alignSelf:'flex-start'}}
horizontal={true}
- visible={Boolean(showToolbarButton && showExpand)}
+ visible={shouldShowTools}
onClick={showTools}/>
{help_id &&
}
}