Overview
- #3491459: Implement the "Review N changes" button is implementing the "Review N changes" button, which when clicked shows the unpublished (autosaved but not yet published) entities.
- #3489994: Create an endpoint to publish all auto-saved entities added the backend endpoint for publishing all autosaved data.
- The goal of this issue is to add the "Publish All" button to what gets shown when "Review N changes" is clicked. And when the "Publish All" button is clicked, for it to call the backend endpoint mentioned above.
Proposed resolution
Create an api slice, publishAllPendingChanges that posts to the controller added in #3489994: Create an endpoint to publish all auto-saved entities.
Create a slice or extend an existing one to keep track of 'conflict ids'
The mutation can return a 409 when conflicts exist. In this case it will return the list of conflicted IDs and the new auto-save data. Use a manual cache update in the mutation to update the pending changes query data AND the conflict IDs
When conflict IDs exist, these will be marked up differently in the pending changes UI
The mutation will return a 200 on success, this should prompt the client to empty the pending changes and conflict IDs
User interface changes
Issue fork experience_builder-3497530
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
soaratul commentedWhat exact change we need to do in the UI for 👇?
When conflict IDs exist, these will be marked up differently in the pending changes UI
Comment #3
effulgentsia commentedI'd say for the scope of this issue, just make their text color red. We can defer a better design to a followup issue after this one is done. Better to get this one in sooner than hold it up on figuring out that design.
Comment #4
soaratul commentedI guess make text colour red for those that are not in the current list of redux store, but what about for the new items(I mean those are not in the redux store but are there in conflicts as additional item).
BTW it's very rare now we will get conflicts as clicking on Review N changes button now we are refetching pending changes also on every 10 seconds we are fetching.
Comment #6
larowlanThe blocker is in
Comment #7
wim leersComment #8
larowlanFrom a conversation in slack @soaratul noted there is no owner info in this
I think what we need to do is include the auto-save key in meta so that you can match it against the records from the pending changes API
I'll open a separate issue for that
Comment #9
larowlan#3499791: Errors returned from the publish all endpoint should include the autosave key in the meta
Comment #10
effulgentsia commentedUp until now, the XB team has been following a pseudo-scrum/pseudo-kanban process, but we're now shifting into more conventional scrum. We started a new 2-week sprint last Thursday (Jan 16). I'm tagging our current sprint's issues for visibility.
Comment #11
lauriiiComment #12
jessebaker commentedAssigning to me to continue from @soaratul
Comment #13
jessebaker commentedComment #14
jessebaker commentedClicking publish all should publish changes. It currently doesn't, but it will at least show you an error as to why it can't publish.
There are follow ups
Comment #15
wim leers#14: is this hard-blocked on #3503347: Unable to create URL aliases with XB enabled due to incorrect validation constraint addition?
Comment #16
wim leersI did a review (and spotted a few nits) to try to answer #15 myself. AFAICT the answer is "yes".
If so, I propose to postpone this issue on #3503347: Unable to create URL aliases with XB enabled due to incorrect validation constraint addition and I'll prioritize tackling that on Monday.
Comment #17
wim leersWell … that was easier than I thought! @longwave did the work, I did the research to prove his fix was correct: #3503347: Unable to create URL aliases with XB enabled due to incorrect validation constraint addition is in!
Comment #18
jessebaker commentedComment #19
hooroomooComment #21
hooroomooComment #23
hooroomoo🎉
Comment #24
wim leers🤩
But can we get a short screencast to share this with the world? 🫣🙏
Comment #25
effulgentsia commentedComment #26
wim leersNot pragmatic to await this screenshot anymore, so marking fixed. This'll have to be demonstrated as part of other issues landing, then.