-
Notifications
You must be signed in to change notification settings - Fork 25
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
infoj_order mode #1252
infoj_order mode #1252
Conversation
1. Delete entry.run once running to prevent multiple runs 2. Add entry.hasRan = true to ensure warning if not fired incorrectly 3. Fix issue where a response with no value to set could not be skipNullValue : true 4. Only appendChild (replaceChildren was removing the title when using nullValue = 'none' for example)
when including a dataview object in the order I see the following error: |
@@ -114,7 +114,7 @@ function entryDefault(entry) { | |||
|
|||
function entryTitle(entry) { | |||
|
|||
if (entry.title) return; | |||
if (!entry.title) return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noticed an issue here where if the entry had a title it would return.
Was just missing the operator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested with @simon-leech - so throwing feedback here.
- Can we add
entry.type
to the options - as this enables plugins that add elements to the infoj to be ordered. entry.group
is not working correctly - this is possibly due to the fact that we aren't looping over the infoj and looking for every option that has that group - so it only returns one entry in each group.- dataviews in the infoj don't seem to be ordering
@KieronFerrey group won't work since the values are not unique. tyoe won't work neither for the same reason. we need to remove the group key since sorting requires a unique identifier. |
I just pushed a commit to this PR after chatting to @RobAndrewHurst. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, Can order dataviews as well!
I have removed group from the infoj_order lookup since this is by definition not unique. |
I just pushed a check on the mapview and locale - as is custom views called entries may not have a locale // Assign queryparams from layer, and locale.
entry.queryparams = Object.assign(
entry.queryparams || {},
entry.location.layer.queryparams || {},
entry.location.layer?.mapview?.locale?.queryparams || {}) |
Quality Gate passedIssues Measures |
@simon-leech Can you test whether this works using the spread operator? Aren't the locale queryparams already assigned to the layer somewhere else? |
@dbauszus-glx Yeah all seems to be working for me :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets go!
The infoj method has a second infoj_order argument. This argument can be an array of keys and entry objects.
layer.infoj entries will be filtered in the order of keys. It is checked whether the key matches the entry's key, field, query, or group key value.
The
key
key value is specifically used as an identifier for entries and serves no other purpose.The infoj_order argument can be a mix of entry objects and keys. Entry object are directly spliced into the infoj array and don't require to be in the layer.infoj array.
The infoj_order can be defined as an array in the layer json. The infoj_order plugin will be retired in favour of this.