Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(layers): fix default footertabid closes2299 #2309

Conversation

kaminderpal
Copy link
Contributor

@kaminderpal kaminderpal commented Jun 26, 2024

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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

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:

  • I have build (rush build) and deploy (rush host) my PR
  • I have connected the issues(s) to this PR
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have created new issue(s) related to the outcome of this PR is needed
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

This change is Reviewable

@kaminderpal kaminderpal marked this pull request as draft June 26, 2024 12:59
@kaminderpal kaminderpal marked this pull request as ready for review June 26, 2024 13:08
@kaminderpal kaminderpal requested review from cphelefu and jolevesq June 26, 2024 13:09
@cphelefu
Copy link
Contributor

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?

Copy link
Member

@jolevesq jolevesq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 2 of 6 files at r1.
Reviewable status: 2 of 6 files reviewed, 2 unresolved discussions (waiting on @cphelefu and @kaminderpal)


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

  const { getRootProps, getInputProps, isDragActive } = useDropzone({ onDrop });

  const dropAreaSx = {

Where is this style now?

Copy link
Contributor Author

@kaminderpal kaminderpal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 2 of 6 files reviewed, 2 unresolved discussions (waiting on @cphelefu and @jolevesq)


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

Previously, cphelefu (Christopher Phelefu) wrote…

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?

We have 2 cases now

  1. when no layers are present on the map, then legendLayers will be empty.
  2. when there are layers on the map, but legend doesnt exist in mapConfig file like below

Code snippet:

'footerBar': {
                'tabs': {
                  'core': ['layers', 'details', 'data-table']
                }
              },

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

Previously, jolevesq (Johann Levesque) wrote…

Where is this style now?

it was commented code, so i have remove it.

Copy link
Member

@jolevesq jolevesq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 2 of 6 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status: 5 of 6 files reviewed, 1 unresolved discussion (waiting on @cphelefu)


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

Previously, kaminderpal (Kamy) wrote…

We have 2 cases now

  1. when no layers are present on the map, then legendLayers will be empty.
  2. when there are layers on the map, but legend doesnt exist in mapConfig file like below

CAn you add a comment to explain this if

Copy link
Contributor

@cphelefu cphelefu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewable status: 5 of 6 files reviewed, 1 unresolved discussion (waiting on @jolevesq)

Copy link
Contributor Author

@kaminderpal kaminderpal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 5 of 6 files reviewed, 1 unresolved discussion (waiting on @cphelefu and @jolevesq)


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

Previously, jolevesq (Johann Levesque) wrote…

CAn you add a comment to explain this if

Done.

Copy link
Member

@jolevesq jolevesq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed all commit messages.
Reviewable status: 5 of 6 files reviewed, 1 unresolved discussion (waiting on @cphelefu)

Copy link
Member

@jolevesq jolevesq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 1 files at r3.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @cphelefu)

@jolevesq jolevesq merged commit 85e7df4 into Canadian-Geospatial-Platform:develop Jun 26, 2024
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] <Footerbar when no legend exist> [BUG] Layers Tab First in List
3 participants