From b3ec40ff286b5b2a187c5684714634be7b6d76ce Mon Sep 17 00:00:00 2001 From: Jimmy Date: Tue, 4 Jun 2024 16:41:15 -0700 Subject: [PATCH 1/6] Feature/demo uwg june2024 - bug fixes (#109) * /version v1.0.0-rc.1 * /version v1.0.0-rc.2 * Pull in recent changes to 1.0.0 * /version v1.0.0-rc.3 * Fix umm-t record * /version v1.0.0-rc.4 * Fix umm-t record * /version v1.0.0-rc.5 * Fix umm-t record * /version v1.0.0-rc.6 * /version v1.0.0-rc.7 * issue/manual-granule-input-hotfix: fixed how ranged of scenes are processed (#86) Co-authored-by: jbyrne * Issues/swodlr UI 72 essential UI bug fixes (#87) * issues/swodlr-ui-72: fix cps url params bug * issues/swodlr-ui-72 * issues/swodlr-ui-75: fixed a couple bugs * issues/swodlr-ui-72: fixed map movement, adjust options, data page limit, etc * issues/swodlr-ui-72: changed spatial search beginning date in range * issues/swodlr-ui-72-essential-fixes: cleaned up comments --------- Co-authored-by: jbyrne * /version v1.0.0-rc.8 * feature/demo-uwg-june2024: fix tutorial popup * feature/demo-uwg-june2024: fix my data page loading bug * feature/demo-uwg-june2024: fix my data page no data navigation --------- Co-authored-by: frankinspace Co-authored-by: Frank Greguska Co-authored-by: Jonathan M Smolenski Co-authored-by: jonathansmolenski Co-authored-by: jbyrne --- src/components/app/App.css | 12 +++++-- .../history/GeneratedProductHistory.tsx | 33 ++++++++++--------- src/components/history/HistoryFilters.tsx | 9 +++-- .../GranuleSelectionAndConfigurationView.tsx | 12 +++---- .../sidebar/actions/productSlice.ts | 8 ++++- 5 files changed, 45 insertions(+), 29 deletions(-) diff --git a/src/components/app/App.css b/src/components/app/App.css index a624a4c..51a5113 100644 --- a/src/components/app/App.css +++ b/src/components/app/App.css @@ -229,7 +229,8 @@ CUSTOMIZE PRODUCT CONTAINER left: 0; z-index: 1000; padding-top: 125px; - padding-bottom: 58px + padding-bottom: 58px; + /* overflow-y: auto; */ } .sidebar-resize { @@ -419,7 +420,14 @@ ABOUT PAGE .about-page { max-height: 82vh; - /* overflow-y: auto; */ + background-color: #3d5d82; + overflow-y: scroll; +} + +.my-data-page { + max-height: 82vh; + background-color: #3d5d82; + /* overflow-y: scroll; */ } .about-card { diff --git a/src/components/history/GeneratedProductHistory.tsx b/src/components/history/GeneratedProductHistory.tsx index a6acd37..729617f 100644 --- a/src/components/history/GeneratedProductHistory.tsx +++ b/src/components/history/GeneratedProductHistory.tsx @@ -11,7 +11,7 @@ import HistoryFilters from "./HistoryFilters"; import { Adjust, FilterParameters, OutputGranuleExtentFlagOptions, OutputSamplingGridType, RasterResolution } from "../../types/historyPageTypes"; import { setShowReGenerateProductModalTrue } from "../sidebar/actions/modalSlice"; import ReGenerateProductsModal from "./ReGenerateProductsModal"; -import { setAllUserProducts, setGranulesToReGenerate, setUserProducts, setWaitingForMyDataFiltering } from "../sidebar/actions/productSlice"; +import { setAllUserProducts, setGranulesToReGenerate, setUserProducts, setWaitingForMyDataFiltering, setWaitingForProductsToLoad } from "../sidebar/actions/productSlice"; export const productPassesFilterCheck = (currentFilters: FilterParameters, cycle: number, pass: number, scene: number, outputGranuleExtentFlag: boolean, status: string, outputSamplingGridType: string, rasterResolution: number, dateGenerated: string, utmZoneAdjust?: number, mgrsBandAdjust?: number): boolean => { let productPassesFilter = true @@ -58,6 +58,8 @@ const GeneratedProductHistory = () => { const colorModeClass = useAppSelector((state) => state.navbar.colorModeClass) const userProducts = useAppSelector((state) => state.product.userProducts) const currentFilters = useAppSelector((state) => state.product.currentFilters) + const waitingForProductsToLoad = useAppSelector((state) => state.product.waitingForProductsToLoad) + const waitingForMyDataFiltering = useAppSelector((state) => state.product.waitingForMyDataFiltering) const { search } = useLocation() const navigate = useNavigate() const [totalNumberOfProducts, setTotalNumberOfProducts] = useState(0) @@ -66,11 +68,12 @@ const GeneratedProductHistory = () => { const [allChecked, setAllChecked] = useState(false) useEffect(() => { - dispatch(setWaitingForMyDataFiltering(true)) // get the data for the first page // go through all the user product data to get the id of each one so that const fetchData = async () => { + if(!waitingForMyDataFiltering) dispatch(setWaitingForProductsToLoad(true)) await getUserProducts({limit: '1000000'}).then(response => { + dispatch(setWaitingForProductsToLoad(false)) // filter products for what is in the filter const allProducts = response.products as Product[] setTotalNumberOfProducts(allProducts.length) @@ -161,16 +164,12 @@ const GeneratedProductHistory = () => { const downloadUrlList = checkedProducts.map(product => product.granules.map(granule => granule.uri)).flat() return ( - {} - - + {}
{ - totalNumberOfProducts === 0 ? - {productHistoryAlert()} - :<> + <> {checkedProducts.length} Actions}> @@ -226,21 +225,23 @@ const GeneratedProductHistory = () => { }
{} + {!waitingForProductsToLoad && userProducts.length === 0 ? {productHistoryAlert()} : null} + {waitingForProductsToLoad ? waitingForProductsToLoadSpinner() : null}
) - } + } const productHistoryAlert = () => { - const alertMessage = 'No products have been generated. Go to the Product Customization page to generate products.' - return navigate(`/generatedProductHistory${search}`)} style={{cursor: 'pointer'}}>{alertMessage} + const alertMessage = 'No products generated with these filters. Click here or go to the Product Customization page to generate products.' + return navigate(`/customizeProduct/configureOptions${search}`)} style={{cursor: 'pointer'}}>{alertMessage} } const waitingForProductsToLoadSpinner = () => { return (
-
Loading Data Table...
+
Loading Product Data...
Loading... @@ -258,10 +259,10 @@ const GeneratedProductHistory = () => { return ( <> -

Generated Products Data

- - {totalNumberOfProducts === 0 ? waitingForProductsToLoadSpinner() : renderProductHistoryViews()} - +

Generated Products Data

+ + {renderProductHistoryViews()} + ); } diff --git a/src/components/history/HistoryFilters.tsx b/src/components/history/HistoryFilters.tsx index dbbf17c..bdb748f 100644 --- a/src/components/history/HistoryFilters.tsx +++ b/src/components/history/HistoryFilters.tsx @@ -1,7 +1,7 @@ import { Accordion, Button, Col, Form, Row, Spinner } from "react-bootstrap"; import { ProductState } from "../../types/graphqlTypes"; import { useAppDispatch, useAppSelector } from "../../redux/hooks"; -import { setCurrentFilter } from "../sidebar/actions/productSlice"; +import { setCurrentFilter, setWaitingForMyDataFiltering } from "../sidebar/actions/productSlice"; import { defaultFilterParameters, defaultSpatialSearchEndDate, defaultSpatialSearchStartDate, inputBounds, parameterOptionValues, rasterResolutionOptions } from "../../constants/rasterParameterConstants"; import { useState } from "react"; import { OutputGranuleExtentFlagOptions, OutputSamplingGridType, RasterResolution, Adjust, FilterParameters, FilterAction } from "../../types/historyPageTypes"; @@ -124,6 +124,11 @@ const HistoryFilters = () => { setCurrentFilters(currentFiltersToModify) } + const handleApplyFilters = () => { + dispatch(setCurrentFilter(currentFilters)) + dispatch(setWaitingForMyDataFiltering(true)) + } + const statusOptions = ['NEW', 'UNAVAILABLE', 'GENERATING', 'ERROR', 'READY', 'AVAILABLE'] const outputGranuleExtentFlagOptions = ['128 x 128', '256 x 128'] const outputSamplingGridTypeOptions = parameterOptionValues.outputSamplingGridType.values.map(value => { @@ -314,7 +319,7 @@ const HistoryFilters = () => { -