From c3d9b75df8ca4a91c182cfe104f2e5a6e5e95962 Mon Sep 17 00:00:00 2001
From: wmi <wmi@ipac.caltech.edu>
Date: Thu, 9 Mar 2023 10:53:44 -0800
Subject: [PATCH 1/5] IRSA-4902 NEOWISER yr9 release update.

---
 .../ibe/datasource/WiseIbeDataSource.java     |  4 +-
 .../ipac/firefly/data/WiseRequest.java        | 75 ++++++++++---------
 .../firefly/server/query/wise/QueryWise.java  |  6 +-
 3 files changed, 46 insertions(+), 39 deletions(-)

diff --git a/src/firefly/java/edu/caltech/ipac/astro/ibe/datasource/WiseIbeDataSource.java b/src/firefly/java/edu/caltech/ipac/astro/ibe/datasource/WiseIbeDataSource.java
index 0c475de49e..74755f90d8 100644
--- a/src/firefly/java/edu/caltech/ipac/astro/ibe/datasource/WiseIbeDataSource.java
+++ b/src/firefly/java/edu/caltech/ipac/astro/ibe/datasource/WiseIbeDataSource.java
@@ -413,8 +413,8 @@ private String processConstraints(Map<String, String> queryInfo) {
             }
 
             if (mergeImageSet.contains(DataProduct.NEOWISER_1B.dataset)) {
-                if (n>0) imageSetConstraint += ",6,7,8,9,10,11,12,13";
-                else imageSetConstraint += ",6,7,8,9,10,11,12,13";
+                if (n>0) imageSetConstraint += ",6,7,8,9,10,11,12,13,14";
+                else imageSetConstraint += ",6,7,8,9,10,11,12,13,14";
                 n++;
             }
 
diff --git a/src/firefly/java/edu/caltech/ipac/firefly/data/WiseRequest.java b/src/firefly/java/edu/caltech/ipac/firefly/data/WiseRequest.java
index a698b7bded..dd1b7f8c7c 100644
--- a/src/firefly/java/edu/caltech/ipac/firefly/data/WiseRequest.java
+++ b/src/firefly/java/edu/caltech/ipac/firefly/data/WiseRequest.java
@@ -73,7 +73,8 @@ public class WiseRequest extends TableServerRequest {
     public final static String NEOWISER_YR6 = "neowiser_yr6";
     public final static String NEOWISER_YR7 = "neowiser_yr7";
     public final static String NEOWISER_YR8 = "neowiser_yr8";
-    public final static String NEOWISER_YR9 = "neowiser_yr9";       //this is the on-going yr9 internal neowiser
+    public final static String NEOWISER_YR9 = "neowiser_yr9";       //yr9  neowiser going public
+    public final static String NEOWISER_YR10 = "neowiser_yr10";
     public final static String PASS2_4BAND = "pass2-4band";
     public final static String PASS2_3BAND = "pass2-3band";
     public final static String PASS2_2BAND = "pass2-2band";
@@ -99,8 +100,9 @@ public class WiseRequest extends TableServerRequest {
             put(NEOWISER_YR5,"neowiser_p1bs_psd");
             put(NEOWISER_YR6,"neowiser_p1bs_psd");
             put(NEOWISER_YR7,"neowiser_p1bs_psd");
-            put(NEOWISER_YR8,"neowiser_i1bs_psd");      //todo  change to pibs when year 8 goes public
-            put(NEOWISER_YR9,"neowiser_i1bs_psd");
+            put(NEOWISER_YR8,"neowiser_p1bs_psd");
+            put(NEOWISER_YR9,"neowiser_p1bs_psd");   //yr9  neowiser going public
+            put(NEOWISER_YR10,"neowiser_i1bs_psd");  //yr10 internal ongoing ingestion
 
         }
     };
@@ -126,6 +128,7 @@ public class WiseRequest extends TableServerRequest {
             put(NEOWISER_YR7,"NEOWISER YR7 (2 Bands)");
             put(NEOWISER_YR8,"NEOWISER YR8 (2 Bands)");
             put(NEOWISER_YR9,"NEOWISER YR9 (2 Bands)");
+            put(NEOWISER_YR10,"NEOWISER YR10 (2 Bands)");
             put(PASS2_4BAND,"Pass 2 (4 Bands)");
             put(PASS2_3BAND,"Pass 2 (3 Bands)");
             put(PASS2_2BAND, "Pass 2 (2 Bands)");
@@ -157,37 +160,7 @@ public class WiseRequest extends TableServerRequest {
             put(NEOWISER_YR7,"wise_neowiser_yr7");
             put(NEOWISER_YR8,"wise_neowiser_yr8");
             put(NEOWISER_YR9,"wise_neowiser_yr9");
-        }
-    };
-    // Scan ID ranges from Roc Cutri:
-    // prelim 00936a - 04125a
-    // pass 1 all 00712a - 12514a
-    // pass 2 4-bands 00712a - 07101a
-    // pass 2 3-bands 07101b - 08744a
-    // post-cryo 2-bands 08745a - 12514a
-    private static HashMap<String, Integer[]> SCANID_MAP = new HashMap<String, Integer[]>(){
-        {
-            put(PRELIM, new Integer[]{936, 4125});
-            put(PRELIM_POSTCRYO, new Integer[]{8745, 12514});
-            put(ALLSKY_4BAND, new Integer[]{712, 7101});
-            put(CRYO_3BAND, new Integer[]{7101, 8744});
-            put(POSTCRYO, new Integer[]{8745, 12514});
-            put(NEOWISER, new Integer[]{44212, 99799});  //public data to end of the yr5
-
-            put(PASS1, new Integer[]{712, 12514});
-            put(PASS2_4BAND, new Integer[]{712, 7101});
-            put(PASS2_3BAND, new Integer[]{7101, 8744});
-            put(PASS2_2BAND, new Integer[]{8745, 12514});
-            put(NEOWISER_PROV, new Integer[]{44212, 55289});
-            put(NEOWISER_YR1, new Integer[]{44212, 55289});
-            put(NEOWISER_YR2, new Integer[]{55290, 66418});   // 66418a is the last scan for yr2
-            put(NEOWISER_YR3, new Integer[]{66418, 77590});  // 66418b is the first scan for yr3 and 77509a is the last scan
-            put(NEOWISER_YR4, new Integer[]{77590, 88733}); // 77590b is the first scan for yr4 and 88733a is the last scan
-            put(NEOWISER_YR5, new Integer[]{88734, 99799}); // 88734a is the first scan for yr5
-            put(NEOWISER_YR6, new Integer[]{1090, 12253}); // 01090r is the first scan for yr6 , 12253r is the last scan
-            put(NEOWISER_YR7, new Integer[]{12254, 23446}); // 12254r is the first scan for yr7, 23446r is the last scan
-            put(NEOWISER_YR8, new Integer[]{23447, 34601}); // 23447r is the first scan for yr8, 34601r is the last scan
-            put(NEOWISER_YR9, new Integer[]{34601, 99999}); // 34601s is the first scan for yr9
+            put(NEOWISER_YR10,"wise_neowiser_yr10");
         }
     };
     // mappings of the dataset selected to the wise table and table source values.
@@ -220,6 +193,7 @@ public class WiseRequest extends TableServerRequest {
             put(NEOWISER_YR7 +"|1b", new String[]{"yr7_p1bm_frm", "yr7_p1bs_psd"});  //  yr7 goes public March 2021
             put(NEOWISER_YR8 +"|1b", new String[]{"yr8_i1bm_frm", "yr8_i1bs_psd"});  //  yr8 internal for iwise
             put(NEOWISER_YR9 +"|1b", new String[]{"yr9_i1bm_frm", "yr9_i1bs_psd"});  //  yr9 internal for iwise
+            put(NEOWISER_YR10 +"|1b", new String[]{"yr10_i1bm_frm", "yr10_i1bs_psd"});  //  yr10 internal for iwise
             put(MERGE_INT+"|1b", new String[]{"merge_i1bm_frm", "merge_i1bs_psd"});
             put(MERGE_INT+"|3a", new String[]{"merge_p3am_cdd", "merge_p3as_psd"});
             put(PASS2_4BAND+"|1b", new String[]{"4band_i1bm_frm", "4band_i1bs_psd"});
@@ -230,6 +204,39 @@ public class WiseRequest extends TableServerRequest {
           //put(PASS2_2BAND+"|3a",  new String[]{"notknown", "notknown"});
         }
     };
+    // Scan ID ranges from Roc Cutri:
+    // prelim 00936a - 04125a
+    // pass 1 all 00712a - 12514a
+    // pass 2 4-bands 00712a - 07101a
+    // pass 2 3-bands 07101b - 08744a
+    // post-cryo 2-bands 08745a - 12514a
+    private static HashMap<String, Integer[]> SCANID_MAP = new HashMap<String, Integer[]>(){
+        {
+            put(PRELIM, new Integer[]{936, 4125});
+            put(PRELIM_POSTCRYO, new Integer[]{8745, 12514});
+            put(ALLSKY_4BAND, new Integer[]{712, 7101});
+            put(CRYO_3BAND, new Integer[]{7101, 8744});
+            put(POSTCRYO, new Integer[]{8745, 12514});
+            put(NEOWISER, new Integer[]{44212, 99799});  //public data to end of the yr5
+
+            put(PASS1, new Integer[]{712, 12514});
+            put(PASS2_4BAND, new Integer[]{712, 7101});
+            put(PASS2_3BAND, new Integer[]{7101, 8744});
+            put(PASS2_2BAND, new Integer[]{8745, 12514});
+            put(NEOWISER_PROV, new Integer[]{44212, 55289});
+            put(NEOWISER_YR1, new Integer[]{44212, 55289});
+            put(NEOWISER_YR2, new Integer[]{55290, 66418});   // 66418a is the last scan for yr2
+            put(NEOWISER_YR3, new Integer[]{66418, 77590});  // 66418b is the first scan for yr3 and 77509a is the last scan
+            put(NEOWISER_YR4, new Integer[]{77590, 88733}); // 77590b is the first scan for yr4 and 88733a is the last scan
+            put(NEOWISER_YR5, new Integer[]{88734, 99799}); // 88734a is the first scan for yr5
+            put(NEOWISER_YR6, new Integer[]{1090, 12253}); // 01090r is the first scan for yr6 , 12253r is the last scan
+            put(NEOWISER_YR7, new Integer[]{12254, 23446}); // 12254r is the first scan for yr7, 23446r is the last scan
+            put(NEOWISER_YR8, new Integer[]{23447, 34601}); // 23447r is the first scan for yr8, 34601r is the last scan
+            put(NEOWISER_YR9, new Integer[]{34601, 45803}); // 34601s is the first scan for yr9, 45803r is the last scan
+            put(NEOWISER_YR10, new Integer[]{45804, 99999}); // 45804r is the first scan for yr10
+
+        }
+    };
 
 //======================================================================
 //----------------------- Constructors ---------------------------------
diff --git a/src/firefly/java/edu/caltech/ipac/firefly/server/query/wise/QueryWise.java b/src/firefly/java/edu/caltech/ipac/firefly/server/query/wise/QueryWise.java
index 0d2bb4c693..32d1c97326 100644
--- a/src/firefly/java/edu/caltech/ipac/firefly/server/query/wise/QueryWise.java
+++ b/src/firefly/java/edu/caltech/ipac/firefly/server/query/wise/QueryWise.java
@@ -439,9 +439,9 @@ private String processConstraints(WiseRequest req) throws EndUserException {
                 n++;
             }
 
-            if (imageSets.contains(WiseRequest.NEOWISER)) {    // public merge upto yr8
-                if (n > 0) imageSetConstraint += ",6,7,8,9,10,11,12,13";
-                else imageSetConstraint += "6,7,8,9,10,11,12,13";
+            if (imageSets.contains(WiseRequest.NEOWISER)) {    // public merge upto yr9
+                if (n > 0) imageSetConstraint += ",6,7,8,9,10,11,12,13,14";
+                else imageSetConstraint += "6,7,8,9,10,11,12,13,14";
                 n++;
             }
 

From d74c037019f3f33c76a37779189a4fd364643ef3 Mon Sep 17 00:00:00 2001
From: wmi <wmi@ipac.caltech.edu>
Date: Mon, 13 Mar 2023 13:19:44 -0700
Subject: [PATCH 2/5] IRSA-4902 image view icon tooltips change requested in
 IRSA-5111

---
 src/firefly/js/visualize/ui/ImageMetaDataToolbarView.jsx | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/firefly/js/visualize/ui/ImageMetaDataToolbarView.jsx b/src/firefly/js/visualize/ui/ImageMetaDataToolbarView.jsx
index 002fe42bf7..4ff48900da 100644
--- a/src/firefly/js/visualize/ui/ImageMetaDataToolbarView.jsx
+++ b/src/firefly/js/visualize/ui/ImageMetaDataToolbarView.jsx
@@ -70,13 +70,13 @@ export function ImageMetaDataToolbarView({viewerId, viewerPlotIds=[], layoutType
                                horizontal={true}
                                onClick={() => dispatchChangeViewerLayout(viewerId,SINGLE, undefined, activeTable?.tbl_id)}/>}
 
-                {converter.canGrid && <ToolbarButton icon={FULL_GRID} tip={'Show full grid'}
+                {converter.canGrid && <ToolbarButton icon={FULL_GRID} tip={'Tile all images in the search result table'}
                                enabled={true} visible={true} horizontal={true}
                                imageStyle={{width:24,height:24, flex: '0 0 auto'}}
                                onClick={() => dispatchChangeViewerLayout(viewerId,GRID,GRID_FULL,activeTable?.tbl_id)}/>}
 
                 {converter.hasRelatedBands  &&
-                            <ToolbarButton icon={GRID_GROUP} tip={'View all images from this image set, tiled'}
+                            <ToolbarButton icon={GRID_GROUP} tip={'Tile all data products associated with the highlighted table row'}
                                enabled={true} visible={true} horizontal={true}
                                imageStyle={{width:24,height:24, flex: '0 0 auto'}}
                                style={{marginLeft: 20}}

From d7de68d19f9e1d56abeb2f1b734db51e285d100b Mon Sep 17 00:00:00 2001
From: roby <roby@ipac.caltech.edu>
Date: Thu, 16 Mar 2023 16:48:48 -0600
Subject: [PATCH 3/5] Firefly-1182: fixed

---
 .../js/visualize/saga/DataProductsWatcher.js  |  1 +
 .../ui/MultProductViewerContainer.jsx         | 35 +++++++++++++++----
 2 files changed, 29 insertions(+), 7 deletions(-)

diff --git a/src/firefly/js/visualize/saga/DataProductsWatcher.js b/src/firefly/js/visualize/saga/DataProductsWatcher.js
index 6c6c73fd6e..243de72797 100644
--- a/src/firefly/js/visualize/saga/DataProductsWatcher.js
+++ b/src/firefly/js/visualize/saga/DataProductsWatcher.js
@@ -104,6 +104,7 @@ function watchDataProductsTable(tbl_id, action, cancelSelf, params) {
             return;
         }
         if (paused && imView && dpView) paused= false;
+        if (paused && imView?.mounted) paused= false;
     }
     else {
         if (getActiveTableId()!==tbl_id) return {...params, firstTime};
diff --git a/src/firefly/js/visualize/ui/MultProductViewerContainer.jsx b/src/firefly/js/visualize/ui/MultProductViewerContainer.jsx
index 599c23084d..9e68556cf2 100644
--- a/src/firefly/js/visualize/ui/MultProductViewerContainer.jsx
+++ b/src/firefly/js/visualize/ui/MultProductViewerContainer.jsx
@@ -2,9 +2,9 @@
  * License information at https://github.com/Caltech-IPAC/firefly/blob/master/License.txt
  */
 
-import React, {useEffect} from 'react';
+import React from 'react';
 import PropTypes from 'prop-types';
-import {getActiveTableId} from '../../tables/TableUtil.js';
+import {getActiveTableId, getTblById} from '../../tables/TableUtil.js';
 import {useStoreConnector} from '../../ui/SimpleComponent.jsx';
 import {isDataProductsTable} from '../../util/VOAnalyzer.js';
 import {ImageExpandedMode} from '../iv/ImageExpandedMode.jsx';
@@ -13,6 +13,31 @@ import {MetaDataMultiProductViewer} from './MetaDataMultiProductViewer';
 
 const closeExpanded= () => dispatchSetLayoutMode(LO_MODE.expanded, LO_VIEW.none);
 
+let lastMetaDataTbls=[];
+
+function getMetaDataTbl() {
+    const tbl_id= getActiveTableId('main');
+    const tblAry= lastMetaDataTbls;
+    if (!tbl_id && tblAry.length===0) return;
+    if (isDataProductsTable(tbl_id)) {
+        if (tblAry[0]!==tbl_id) { //make sure it is the first entry
+            lastMetaDataTbls= tblAry.filter( (id) => id!==tbl_id);
+            lastMetaDataTbls.unshift(tbl_id);
+        }
+        return tbl_id;
+    }
+    else {
+        const newTblId= tblAry.find( (id) => {
+            return Boolean(getTblById(id));
+        });
+        if (newTblId!==tblAry[0]) { // filter out any dead tables
+            lastMetaDataTbls= tblAry.filter( (id) => Boolean(getTblById(id)));
+        }
+        return newTblId;
+    }
+}
+
+
 /**
  * A wrapper component for MultiImageViewer where expended mode is supported.
  */
@@ -22,11 +47,7 @@ export function MultiProductViewerContainer({ tbl_id= undefined, imageExpandedMo
                                                 noProductMessage= 'No Data Products Available'}) {
 
 
-    const dataProductsTblId= useStoreConnector((lastTblId=undefined) => {
-        const tbl_id= getActiveTableId('main');
-        if (tbl_id===lastTblId) return tbl_id;
-        return isDataProductsTable(tbl_id) ? tbl_id : lastTblId;
-    });
+    const dataProductsTblId= useStoreConnector(() => getMetaDataTbl() );
     const dpTbl= tbl_id ?? dataProductsTblId;
 
     if (imageExpandedMode) {

From 9f43fff42391cbed4b4cc39d27be696e1cd3ee3f Mon Sep 17 00:00:00 2001
From: roby <roby@ipac.caltech.edu>
Date: Fri, 17 Mar 2023 08:48:47 -0600
Subject: [PATCH 4/5] Firefly-1182: fixed DataProductsWatcher not changing
 layout correctly

---
 src/firefly/js/ui/PagingBar.jsx                      | 2 +-
 src/firefly/js/visualize/saga/DataProductsWatcher.js | 9 ++++++---
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/firefly/js/ui/PagingBar.jsx b/src/firefly/js/ui/PagingBar.jsx
index 02a530561f..be450fa3bf 100644
--- a/src/firefly/js/ui/PagingBar.jsx
+++ b/src/firefly/js/ui/PagingBar.jsx
@@ -22,7 +22,7 @@ export function PagingBar(props) {
     const nchar = totalPages.toString().length;
 
     const pagestr = (totalRows === 0) ? '' :
-                    `(${(startIdx+1).toLocaleString()} - ${endIdx.toLocaleString()} of ${totalRows.toLocaleString()})`;
+                    `(${(startIdx+1).toLocaleString()} - ${endIdx.toLocaleString()} of ${totalRows?.toLocaleString()??''})`;
     const showingLabel = (  <div style={{fontSize: 'smaller', marginLeft: 3, display: 'inline-flex', alignItems: 'center', width: `${3 * nchar + 7}ch`}} >
                                 {pagestr}
                             </div>
diff --git a/src/firefly/js/visualize/saga/DataProductsWatcher.js b/src/firefly/js/visualize/saga/DataProductsWatcher.js
index 243de72797..5e40b0fa5e 100644
--- a/src/firefly/js/visualize/saga/DataProductsWatcher.js
+++ b/src/firefly/js/visualize/saga/DataProductsWatcher.js
@@ -93,10 +93,11 @@ function watchDataProductsTable(tbl_id, action, cancelSelf, params) {
 
     if (payload.viewerId && payload.viewerId!==imageViewerId) return {...params,firstTime};
 
+    const payloadTblId= payload.tbl_id ?? payload.associatedTblId;
 
 
-    if (payload.tbl_id) {
-        if (payload.tbl_id!==tbl_id) return {...params,firstTime};
+    if (payloadTblId) {
+        if (payloadTblId!==tbl_id) return {...params,firstTime};
         if (action.type===TABLE_REMOVE) {
             removeAllProducts(activateParams,tbl_id);
             // todo might need to remove other stuff as well: charts, images, jpeg
@@ -107,7 +108,9 @@ function watchDataProductsTable(tbl_id, action, cancelSelf, params) {
         if (paused && imView?.mounted) paused= false;
     }
     else {
-        if (getActiveTableId()!==tbl_id) return {...params, firstTime};
+        if (getActiveTableId()!==tbl_id) {
+            return {...params, firstTime};
+        }
     }
 
 

From d4e1df2433049967889df1ecf8acd4c368f17677 Mon Sep 17 00:00:00 2001
From: roby <roby@ipac.caltech.edu>
Date: Mon, 20 Mar 2023 09:35:41 -0600
Subject: [PATCH 5/5] Release 2022.3.2: document updates

---
 docs/release-notes.md | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/docs/release-notes.md b/docs/release-notes.md
index 61d161b7f4..5197a018ea 100644
--- a/docs/release-notes.md
+++ b/docs/release-notes.md
@@ -8,9 +8,11 @@
 
 
 ## Version 2022.3 
-- 2022.3.1 (Jan 2022)
+- 2022.3.2 (March 2023)
+  - docker tag: `2022.3`, `2022.3.2`
+- 2022.3.1 (Jan 2023)
   - docker tag: `2022.3`, `2022.3.1`
-- 2022.3.0 - (Dec 2023)
+- 2022.3.0 - (Dec 2022)
   - docker tag: `latest`, `2022.3`, `2022.3.0`
 
 ### _Notes_
@@ -33,16 +35,17 @@
 - Plot.ly updated to 2.18.0 [Firefly-1079](https://github.com/Caltech-IPAC/firefly/pull/1272)
 - Improved status page with version [Firefly-1116](https://github.com/Caltech-IPAC/firefly/pull/1295)
 
-
+##### _Patches 2022.3_
+- 2022.3.1
+  - fixed an undefined exception when SearchActions are empty
+- 2022.3.2
+  - Updates for neowise year 9 release [PR](https://github.com/Caltech-IPAC/firefly/pull/1329)
+  - fixed: in certain cases multi-product view navigation not working when non-dataproduct tables are showing [Firefly-1182](https://github.com/Caltech-IPAC/firefly/pull/1329)
 
 ##### _Pull Requests in this release_
 - [All Bug Fixes](https://github.com/caltech-ipac/firefly/pulls?q=is%3apr+milestone%3a2022.3+label%3abug)
 - [All PRs](https://github.com/caltech-ipac/firefly/pulls?q=is%3apr++milestone%3a2022.3+)
 
-##### _Patches 2022.3_
-- 2022.3.1
-  - fixed an undefined exception when SearchActions are empty
-
 
 ## Version 2022.2 
 - 2022.2.6 (Dec 2022)