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

refactor: remove dataAccessPath from initial layer configs #2583

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

DamonU2
Copy link
Member

@DamonU2 DamonU2 commented Nov 6, 2024

Closes #2537

Description

Removes the dataAccessPath from the source in the inital layer config source.

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?

https://damonu2.github.io/geoview/demos-navigator.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

@DamonU2 DamonU2 requested a review from jolevesq November 6, 2024 19:36
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 15 of 44 files at r1, all commit messages.
Reviewable status: 15 of 44 files reviewed, 2 unresolved discussions (waiting on @DamonU2)


packages/geoview-core/schema.json line 1493 at r1 (raw file):

        }
      },
      "required": ["geoviewLayerType", "metadataAccessPath", "listOfLayerEntryConfig"]

Is it mandatory? geocore doesn not have it


packages/geoview-core/public/templates/demos/demo-cgdi.html line 70 at r1 (raw file):

              'listOfLayerEntryConfig': [
                {
                  'layerId': 'items?f=json',

This looks weird..... should it stay hydrometric-stations for layerId but having the metadtaAccessPAth like the dataAccesssPath?

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.

Reviewable status: 15 of 44 files reviewed, 3 unresolved discussions (waiting on @DamonU2)


packages/geoview-core/public/templates/demos/demo-gsc.html line 71 at r1 (raw file):

              'listOfLayerEntryConfig': [
                {
                  'layerId': '46E.JSON',

Here as well... medataDataAccesssPAth it root and layerId is last section but in this case it is duplicated

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.

Reviewable status: 15 of 44 files reviewed, 4 unresolved discussions (waiting on @DamonU2)


packages/geoview-core/public/templates/demos/demo-osdp-non-currated.html line 114 at r1 (raw file):

            'geoviewLayerId': 'geojsonlyr3',
            'geoviewLayerName': 'Multi Polygon Layer',
            'metadataAccessPath': './configs/OSDP/datasets/DDFO-CURATED-1-03336A72-E5AD-4EEE-803D-E70B7FDE9FCB_en.json',

Should it be metada.. ./configs/OSDP/datasets/ and layerId DDFO...

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 44 files at r1.
Reviewable status: 16 of 44 files reviewed, 5 unresolved discussions (waiting on @DamonU2)


packages/geoview-core/public/templates/layers/csv.html line 75 at r1 (raw file):

              'geoviewLayerId': 'csvLYR1',
              'geoviewLayerName': 'NPRI',
              'metadataAccessPath': './datasets/csv-files/',

re is it good compared to the json sample


packages/geoview-core/public/templates/layers/csv.html line 90 at r1 (raw file):

              'geoviewLayerId': 'csvLYR2',
              'geoviewLayerName': 'Station List MELCC',
              'metadataAccessPath': './datasets/csv-files/Station_List_Minus_HQ-MELCC.csv',

Here we have duplication again. What is the difference with the item above?

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 17 of 44 files at r1.
Reviewable status: 33 of 44 files reviewed, 9 unresolved discussions (waiting on @DamonU2)


packages/geoview-core/public/templates/layers/geojson.html line 172 at r1 (raw file):

          geoviewLayerId: 'geoJsonSample',
          geoviewLayerName: 'Historical Flood',
          metadataAccessPath: './datasets/geojson/historical_flood_0.geojson',

duplication again


packages/geoview-core/src/core/utils/config/validation-classes/raster-validation-classes/esri-dynamic-layer-entry-config.ts line 30 at r1 (raw file):

    // We assign the metadataAccessPath of the GeoView layer to dataAccessPath.
    if (!this.source) this.source = {};
    this.source.dataAccessPath = this.geoviewLayerConfig.metadataAccessPath;

workaround to keep dataAccessPath internal but remove from schema? If so we need a GV comment.

If we need some tweeking, because each class has it, we may do it here. In new config, this is not there anymore, we need comment implement behaviour in new structure when we progress in the refactor. Please add TODO comment in each class


packages/geoview-core/src/core/utils/config/validation-classes/raster-validation-classes/xyz-layer-entry-config.ts line 19 at r1 (raw file):

    if (!this.source.dataAccessPath.endsWith('{z}/{y}/{x}'))
      this.source.dataAccessPath = this.source.dataAccessPath!.endsWith('/')
        ? `${this.source.dataAccessPath}tile/{z}/{y}/{x}`

I like the way we tweak it so config is clean and internal stuff if added after


packages/geoview-core/src/geo/map/map-schema-types.ts line 79 at r1 (raw file):

   */
  nameField?: string;
  /** Array of the outfield objects. */

Have you looked at the map-schema type in config api to see if it need to be modify as well

@DamonU2 DamonU2 self-assigned this Nov 7, 2024
Copy link
Member

@Alex-NRCan Alex-NRCan left a comment

Choose a reason for hiding this comment

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

General question. Was this PR tested with HYBRID_MODE = true? It should(?) be transparent, so I understand it wasn't, but I'd like to make sure we don't hit an unforeseen issue, notably with the 'source' property being removed and whatnot.

Reviewed 44 of 44 files at r1, all commit messages.
Reviewable status: all files reviewed, 9 unresolved discussions (waiting on @DamonU2)

Copy link
Member Author

@DamonU2 DamonU2 left a comment

Choose a reason for hiding this comment

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

It was

Reviewable status: all files reviewed, 9 unresolved discussions (waiting on @jolevesq)


packages/geoview-core/schema.json line 1493 at r1 (raw file):

Previously, jolevesq (Johann Levesque) wrote…

Is it mandatory? geocore doesn not have it

Oops, good catch

Copy link
Member Author

@DamonU2 DamonU2 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: all files reviewed, 9 unresolved discussions (waiting on @jolevesq)


packages/geoview-core/public/templates/demos/demo-cgdi.html line 70 at r1 (raw file):

Previously, jolevesq (Johann Levesque) wrote…

This looks weird..... should it stay hydrometric-stations for layerId but having the metadtaAccessPAth like the dataAccesssPath?

It can't. The first path has the metadata and needs "items" added to fetch the layer data


packages/geoview-core/public/templates/demos/demo-gsc.html line 71 at r1 (raw file):

Previously, jolevesq (Johann Levesque) wrote…

Here as well... medataDataAccesssPAth it root and layerId is last section but in this case it is duplicated

Done.


packages/geoview-core/public/templates/demos/demo-osdp-non-currated.html line 114 at r1 (raw file):

Previously, jolevesq (Johann Levesque) wrote…

Should it be metada.. ./configs/OSDP/datasets/ and layerId DDFO...

Done.


packages/geoview-core/public/templates/layers/csv.html line 90 at r1 (raw file):

Previously, jolevesq (Johann Levesque) wrote…

Here we have duplication again. What is the difference with the item above?

Just testing to make sure it worked if entered either way


packages/geoview-core/public/templates/layers/geojson.html line 172 at r1 (raw file):

Previously, jolevesq (Johann Levesque) wrote…

duplication again

Done.

@DamonU2 DamonU2 force-pushed the 2537-remove-dataAccessPath branch 2 times, most recently from c359efb to bf3cd10 Compare November 13, 2024 17:06
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 4 of 44 files at r1, 26 of 26 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @DamonU2)

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.

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @DamonU2)

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.

[REFACTOR] Remove localize string for metadata url and layer name.
3 participants