Skip to content

Conversation

@ahmedyacinfarah
Copy link
Contributor

@ahmedyacinfarah ahmedyacinfarah commented Mar 27, 2025

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
Added custom legend schema and built info sec component Date :2025-04-17 11:00 am
https://ahmedyacinfarah.github.io/geoview/demos-navigator.html?config=./configs/navigator/30-package-custom-legend.json
Fixes # (issue)

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!

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

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 r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @ahmedyacinfarah)

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 r2, all commit messages.
Reviewable status: 3 of 7 files reviewed, 5 unresolved discussions


packages/geoview-custom-legend/src/infosection.tsx line 2 at r2 (raw file):

/* eslint-disable react/function-component-definition */
import React from 'react';

We so not import REact from package, we use the one provided by cgpv


packages/geoview-custom-legend/default-config-custom-legend.json line 5 at r2 (raw file):

  "id": "custom-legend",
  "enabled": true,
  "footerBar": {

Why is there footer-bar inside the default json. Does respect the schema?


packages/geoview-custom-legend/default-config-custom-legend.json line 12 at r2 (raw file):

  "isOpen": true,
  "version": "1.0"
  

Trailing white space


packages/geoview-custom-legend/src/custom-legend.tsx line 3 at r2 (raw file):

/* eslint-disable react/no-array-index-key */
/* eslint-disable react/jsx-no-useless-fragment */
import { Key } from 'react';

Use cgpv react, not import. Why are you importing key?


packages/geoview-custom-legend/src/custom-legend.tsx line 22 at r2 (raw file):

  // Get layers from the map
  const layers = api.maps[mapId]?.layer?.layers || [];

Use store to access layers like in time-slider-panel const visibleLayers = useMapVisibleLayers() as string[];

Copy link
Contributor Author

@ahmedyacinfarah ahmedyacinfarah 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: 3 of 7 files reviewed, 5 unresolved discussions (waiting on @jolevesq)


packages/geoview-custom-legend/default-config-custom-legend.json line 5 at r2 (raw file):

Previously, jolevesq (Johann Levesque) wrote…

Why is there footer-bar inside the default json. Does respect the schema?

pour lire les layers


packages/geoview-custom-legend/default-config-custom-legend.json line 12 at r2 (raw file):

Previously, jolevesq (Johann Levesque) wrote…

Trailing white space

Done.


packages/geoview-custom-legend/src/custom-legend.tsx line 3 at r2 (raw file):

Previously, jolevesq (Johann Levesque) wrote…

Use cgpv react, not import. Why are you importing key?

Done.


packages/geoview-custom-legend/src/custom-legend.tsx line 22 at r2 (raw file):

Previously, jolevesq (Johann Levesque) wrote…

Use store to access layers like in time-slider-panel const visibleLayers = useMapVisibleLayers() as string[];

Done.


packages/geoview-custom-legend/src/infosection.tsx line 2 at r2 (raw file):

Previously, jolevesq (Johann Levesque) wrote…

We so not import REact from package, we use the one provided by cgpv

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 1 of 6 files at r2, 4 of 4 files at r3, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @ahmedyacinfarah)


packages/geoview-custom-legend/default-config-custom-legend.json line 5 at r2 (raw file):

Previously, ahmedyacinfarah wrote…

pour lire les layers

You should not reference footer in your custom config as user may not have footer in their main config.


packages/geoview-custom-legend/src/custom-legend.tsx line 2 at r3 (raw file):

/* eslint-disable react/no-array-index-key */
/* eslint-disable react/jsx-no-useless-fragment */

Do not create global eslint disable, do it by line when needed


packages/geoview-custom-legend/src/infosection.tsx line 2 at r3 (raw file):

/* eslint-disable react/no-unused-prop-types */
/* eslint-disable react/function-component-definition */

Do not use global, eslint. Use them on line disable when needed

@jolevesq
Copy link
Member

Not mergeable, will redo this work within another PR

@jolevesq jolevesq closed this May 13, 2025
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.

2 participants