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

Allow for layer entry without query [featureSet / featureLookup] configuration #1793

Open
wants to merge 13 commits into
base: minor
Choose a base branch
from

Conversation

dbauszus-glx
Copy link
Member

The layer entry method as the sucessor to the mvt_clone method should not be limited to featureSet or featureLookup entries.

The featureSet and featureLookup require data to be provided as an array from either a field, inside the entry configuration, or from a [parameterised] query.

A layer entry without the featureSet or featureLookup flag should show the all features as defined by the layer filter.

{
  "type": "layer",
  "name": "OA Layer",
  "layer": "oa"
},
{
  "type": "layer",
  "name": "featureSet Layer",
  "layer": "oa",
  "featureSet": true,
  "field": "oas"
},
{
  "type": "layer",
  "name": "featureLookup Query Layer",
  "layer": "oa",
  "featureLookup": true,
  "query": "oa_featurelookup",
  "queryparams": {
    "id": true
  },
  "template": {
    "key": "oa_featurelookup",
    "template": "select oas[1] as id from public.points where id = ${id}"
  }
}
Screencast.from.2025-01-03.12-40-54.webm

@dbauszus-glx dbauszus-glx self-assigned this Jan 3, 2025
@dbauszus-glx dbauszus-glx added the Feature New feature requests or changes to the behaviour or look of existing application features. label Jan 3, 2025
@dbauszus-glx dbauszus-glx linked an issue Jan 3, 2025 that may be closed by this pull request
@dbauszus-glx dbauszus-glx changed the title Allow for layer entry without featureSet / featureLookup configuration Allow for layer entry without query [featureSet / featureLookup] configuration Jan 3, 2025
@cityremade
Copy link
Member

I need this documented better. When I recreate this setup with retail places I see errors and errors.
What is "field" in the second setup?

@dbauszus-glx
Copy link
Member Author

@cityremade I updated the layer entries method documentation.

http://localhost:3000/xyz/mapp/module-_ui_locations_entries_layer.html

image

In the example the field is an array field which has an array of feature ids for only those features to be rendered.

image

image

@cityremade
Copy link
Member

Regarding use cases,
should layer entry still appear if no response is returned from the related query?
Example is no intersecting non-seamless zone like retail place or pitch.

@dbauszus-glx
Copy link
Member Author

Regarding use cases, should layer entry still appear if no response is returned from the related query? Example is no intersecting non-seamless zone like retail place or pitch.

No; The layer toggle should be disabled. I will make a change to method to disable the toggle.

@dbauszus-glx
Copy link
Member Author

Screencast.from.2025-01-07.17-34-52.webm

@cityremade can you give this another test. The display toggle should be disabled when there is a featureSet or featureLookup but no data.

@GEOLYTIX GEOLYTIX deleted a comment from gitguardian bot Jan 8, 2025
Copy link
Member

@cityremade cityremade left a comment

Choose a reason for hiding this comment

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

thanks, I am happy with this.

Copy link

gitguardian bot commented Jan 9, 2025

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

Since your pull request originates from a forked repository, GitGuardian is not able to associate the secrets uncovered with secret incidents on your GitGuardian dashboard.
Skipping this check run and merging your pull request will create secret incidents on your GitGuardian dashboard.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
1293524 Triggered Generic Password d75bd51 public/views/login/_login.js View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@AlexanderGeere
Copy link
Contributor

@dbauszus-glx The toggle seems to remain enabled if featureLookUp is true and a query is supplied but the query returns no data,
Screenshot 2025-01-09 114506
should line 111 maybe be || instead of &&.

If you check id=1 on bugs_testing/infoj/layer_entry.json on the points layer you will see the toggle remains active even though the query doesn't return any data.

@dbauszus-glx
Copy link
Member Author

@AlexanderGeere This should now be fixed in the last commit. 159d2c9

Copy link
Contributor

@AlexanderGeere AlexanderGeere left a comment

Choose a reason for hiding this comment

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

Good With me now.

Copy link
Contributor

@simon-leech simon-leech left a comment

Choose a reason for hiding this comment

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

I see a few issues with this I think:

  1. A layer that is a direct clone does not have the dataviews that are on the original layer.
    IE if the original layer was OA and had an OA tableview, its not show in the entry version of this layer. Should it be?
  2. When selecting a location from the cloned whole layer, queries in the infoj fail as they aren't passing the right layer param.
    http://localhost:3000/x/api/query?id=1020001287&template=query&locale=UK&layer=oa%7Csites!796
    You see here it adds the layer param as oa|sites!796 which then fails the layer lookup on the query.

@dbauszus-glx
Copy link
Member Author

@simon-leech Dataviews are not supported, editing is not yet supported. We will look at editing in the future but I think dataviews in layer in location from another layer is too much nesting.

I will look at the selection issue.

@dbauszus-glx
Copy link
Member Author

@simon-leech
The issue with selection and highlight should be resolved in the last commit. The Key with capital K will be assigned as key in the location get.

The key for multiple layers from the same mapview layer will be assigned from the OL UID which is guaranteed to be unique in the layer entry method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New feature requests or changes to the behaviour or look of existing application features.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

layer entry without query
4 participants