From 63c6300ffad287666a4e5dc3899cd11c56405496 Mon Sep 17 00:00:00 2001 From: jolevesq Date: Thu, 12 Dec 2024 17:16:00 -0500 Subject: [PATCH] fix condition, rename file --- packages/geoview-core/src/core/app-start.tsx | 8 ++++---- .../src/core/components/details/details-panel.tsx | 10 ++++++---- .../details/{feature-info-new.tsx => feature-info.tsx} | 4 ++-- packages/geoview-core/src/geo/map/map-viewer.ts | 8 ++++---- 4 files changed, 16 insertions(+), 14 deletions(-) rename packages/geoview-core/src/core/components/details/{feature-info-new.tsx => feature-info.tsx} (97%) diff --git a/packages/geoview-core/src/core/app-start.tsx b/packages/geoview-core/src/core/app-start.tsx index e8f66964dfc..966775b9887 100644 --- a/packages/geoview-core/src/core/app-start.tsx +++ b/packages/geoview-core/src/core/app-start.tsx @@ -1,4 +1,4 @@ -import { createContext, Suspense, useMemo } from 'react'; +import { createContext, StrictMode, Suspense, useMemo } from 'react'; import './translation/i18n'; import i18n from 'i18next'; @@ -81,9 +81,9 @@ function AppStart(props: AppStartProps): JSX.Element { - {/* */} - - {/* */} + + + diff --git a/packages/geoview-core/src/core/components/details/details-panel.tsx b/packages/geoview-core/src/core/components/details/details-panel.tsx index cdbc462d711..262abaf5cdf 100644 --- a/packages/geoview-core/src/core/components/details/details-panel.tsx +++ b/packages/geoview-core/src/core/components/details/details-panel.tsx @@ -15,7 +15,7 @@ import { TypeFeatureInfoEntry, TypeGeometry, TypeLayerData } from '@/geo/map/map import { LayerListEntry, Layout } from '@/core/components/common'; import { getSxClasses } from './details-style'; -import { FeatureInfo } from './feature-info-new'; +import { FeatureInfo } from './feature-info'; import { FEATURE_INFO_STATUS, TABS } from '@/core/utils/constant'; import { DetailsSkeleton } from './details-skeleton'; @@ -428,10 +428,12 @@ export function DetailsPanel({ fullWidth = false }: DetailsPanelType): JSX.Eleme */ const renderContent = (): JSX.Element | null => { // If there is no layer, return null for the guide to show - if (memoLayersList && memoLayersList.length === 0) return null; + if ((memoLayersList && memoLayersList.length === 0) || selectedLayerPath === '') { + return null; + } - // Until process, return skeleton - if (!memoIsAllLayersQueryStatusProcessed() || !(memoSelectedLayerDataFeatures && memoSelectedLayerDataFeatures.length > 0)) { + // Until process or something found for selected layerPath, return skeleton + if (!memoIsAllLayersQueryStatusProcessed() && !(memoSelectedLayerDataFeatures && memoSelectedLayerDataFeatures.length > 0)) { return ; } diff --git a/packages/geoview-core/src/core/components/details/feature-info-new.tsx b/packages/geoview-core/src/core/components/details/feature-info.tsx similarity index 97% rename from packages/geoview-core/src/core/components/details/feature-info-new.tsx rename to packages/geoview-core/src/core/components/details/feature-info.tsx index b42b0d9b308..c6f0b005515 100644 --- a/packages/geoview-core/src/core/components/details/feature-info-new.tsx +++ b/packages/geoview-core/src/core/components/details/feature-info.tsx @@ -80,7 +80,7 @@ const FeatureHeader = memo(function FeatureHeader({ iconSrc, name, hasGeometry, }); export function FeatureInfo({ feature }: FeatureInfoProps): JSX.Element | null { - logger.logTraceRender('components/details/feature-info-new'); + logger.logTraceRender('components/details/feature-info'); // Hooks const theme = useTheme(); @@ -171,7 +171,7 @@ export function FeatureInfo({ feature }: FeatureInfoProps): JSX.Element | null { // Effects useEffect(() => { - logger.logTraceUseEffect('FEATURE-INFO-NEW - checkedFeatures', checkedFeatures); + logger.logTraceUseEffect('FEATURE-INO - checkedFeatures', checkedFeatures); if (!featureData?.uid) return; diff --git a/packages/geoview-core/src/geo/map/map-viewer.ts b/packages/geoview-core/src/geo/map/map-viewer.ts index b5459648cac..12365f032ac 100644 --- a/packages/geoview-core/src/geo/map/map-viewer.ts +++ b/packages/geoview-core/src/geo/map/map-viewer.ts @@ -547,7 +547,7 @@ export class MapViewer { }); } } - }, 1000); + }, 250); } /** @@ -692,7 +692,7 @@ export class MapViewer { this.#checkMapLayersLoaded(); } } - }, 1000); + }, 250); } /** @@ -726,7 +726,7 @@ export class MapViewer { this.#emitMapLayersLoaded(); } } - }, 1000); + }, 250); } /** @@ -761,7 +761,7 @@ export class MapViewer { resolve(); } } - }, 1000); + }, 250); }); }