Canadian-Geospatial-Platform / geoview

Canadian Geospatial Platform Viewer / Visualiseur de la Plateforme Géospatiale Canadienne
Other
22 stars 32 forks source link

fix(layers): fix default footertabid closes2299 #2309

Closed kaminderpal closed 3 months ago

kaminderpal commented 3 months ago

Description

1) Fix default footer tab id when no legend is present in config file. 2) Selection of View as default layers toolbar when no legend exist.

Fixes #2299 Fixes #2301

Type of change

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.

Add the URL for your deploy! https://kaminderpal.github.io/geoview/sandbox.html

Checklist:


This change is Reviewable

cphelefu commented 3 months ago

packages/geoview-core/src/core/components/layers/left-panel/left-panel.tsx line 41 at r1 (raw file):


  useEffect(() => {
    if (displayState !== 'add' && !legendLayers.length && mapConfig?.footerBar?.tabs.core.includes('legend')) {

Not sure why we need this change in this file. Whether legend is added or not it should not affect layers tab or this functionality. Is there a reason for this?