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

Input and internal schema validation plus default maxExtent issue #2124

Conversation

ychoquet
Copy link
Member

@ychoquet ychoquet commented May 10, 2024

Description

This PR groups two issues:

  • The creation and activation of two schemas (input/internal) that validate hte configuration provided by the user and the the structure of the internal representation of the map and layer instances.
  • The correction of the default maxExtent according to the projection code used.

Fixes #2121, 2122

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?

Using Chrome Devtools to trace and debug the code.

Deploy URL: https://ychoquet.github.io/GeoView/config-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

@ychoquet ychoquet self-assigned this May 10, 2024
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: 0 of 3 files reviewed, 1 unresolved discussion (waiting on @ychoquet)


packages/geoview-core/src/api/config/types/config-constants.ts line 9 at r1 (raw file):

  TypeAppBarProps,
  TypeBasemapId,
  TypeBasemapOptions,

Why all those type diseapred from this file

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 3 files at r1.
Reviewable status: 1 of 3 files reviewed, 2 unresolved discussions (waiting on @ychoquet)


packages/geoview-core/src/api/config/types/config-validation-schema.json line 1125 at r1 (raw file):

      },
      "if": {
        "properties": {

Because most property of all layer are similar, can we have a type defiition reusable and have one specific by source?

Copy link
Member Author

@ychoquet ychoquet 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: 1 of 3 files reviewed, 2 unresolved discussions (waiting on @jolevesq and @ychoquet)


packages/geoview-core/src/api/config/types/config-constants.ts line 9 at r1 (raw file):

Previously, jolevesq (Johann Levesque) wrote…

Why all those type diseapred from this file

I used a trick proposed by Alex that minimize the as SomeOtherType usage. So, all these types I had to use before are not needed anymore. I use the Cast function which does basically a 'as unknown as newType'. The drawback of this methode is if The object in the Cast does not define a field in the targetted newType, you will not get an error flaged.


packages/geoview-core/src/api/config/types/config-validation-schema.json line 1125 at r1 (raw file):

Previously, jolevesq (Johann Levesque) wrote…

Because most property of all layer are similar, can we have a type defiition reusable and have one specific by source?

Yes we can, I will do that in my next PR.

@ychoquet ychoquet force-pushed the Input_and_internal_schema_validation_plus_default_maxExtent_issue branch from c0e809d to b5b9676 Compare May 10, 2024 21:23
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 3 files at r1, 2 of 2 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @ychoquet)

@jolevesq jolevesq merged commit daaaff7 into Canadian-Geospatial-Platform:develop May 14, 2024
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-maxExtent default value
2 participants