Overview
Ensure segments have a weight.
Proposed resolution
- Ensure segments have a weight for sorting them.
- Check if segments need to be sorted by weight when exposed via API.
- This will be required for the negotiation of the segments, as the evaluation order matters.
User interface changes
Segments are sorted by weight.
Issue fork experience_builder-3541152
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
wim leersHow does this relate to #3541148: Provide a locked Default segment? Will that have a special reserved weight that no other
Segmentcan set?Comment #3
penyaskitoI'm guessing we will be giving that one a high value, or ensuring all locked segments come last?
Comment #6
thoward216 commentedI've created an MR for adding weight to Segments, I haven't addressed anything in the Drupal UI for weighting as I saw this issue: #3527086: Revisit segments UI: do we need a Drupal UI? and I assume it may get addressed there? (i.e you can't re-order in the UI, but they are ordered per their weight)
I've also not addressed discussion in #2/#3 as seems thats not currently confirmed. But we might need #3541148: Provide a locked Default segment to land first? Or it get handled in that ticket after this lands?
Comment #7
penyaskitoI think that's all we need. We can discuss how do we want to handle #2 in #3541148: Provide a locked Default segment.
Comment #8
wim leersLooks good!
Two bugs:
weightis not exposed by the HTTP API, which AFAICT will make the UI impossible to implement: https://git.drupalcode.org/project/experience_builder/-/merge_requests/1...weightshould either be updated via the HTTP API, or it should have a comment pointing to which issue will make it so: https://git.drupalcode.org/project/experience_builder/-/merge_requests/1...Comment #9
thoward216 commentedComment #10
penyaskitoAs Wim pointed out I missed we need to expose the weight to the client-side. Which means openapi.yml needs updates too.
Comment #11
thoward216 commentedComment #12
wim leersThis looks great now, thanks! 😊
Just one last bug in the OpenAPI spec: https://git.drupalcode.org/project/experience_builder/-/merge_requests/1...
Comment #13
thoward216 commentedComment #14
wim leersOne last bit was missing, fixed that. Awaiting green CI results 🤞
Comment #15
wim leersActually, as I was about to merge, all the
weight: 0lines that were deleted in https://git.drupalcode.org/project/experience_builder/-/merge_requests/1... should be restored 😅 They were totally right — without those, the examples do would not be valid against their (now updated) schema!Restored all deleted lines in https://git.drupalcode.org/project/experience_builder/-/merge_requests/1...
Again awaiting green CI results, then merging.
Comment #17
wim leers