Overview

Once #3487484: Save page data form values in application state with support for undo/redo and #3488368: Also convert metadata (page data) fields in ClientDataToEntityConverter are in, we can store page (entity) fields in autostore

Proposed resolution

Send page data from Frontend to Drupal in preview controller calls.

User interface changes

Command icon 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

larowlan created an issue. See original summary.

larowlan’s picture

larowlan changed the visibility of the branch 3495752-pp-1-send-page to hidden.

larowlan’s picture

Assigned: Unassigned » larowlan

larowlan’s picture

Title: [PP-1] Send page data to Drupal for storage in auto-save store » [PP-3] Send page data to Drupal for storage in auto-save store

#3493941: Maintain a per-component set of prop expressions/sources and #3493943: SDC+JS Component Sources: split default values into `resolved` and `source` also block this as they prevent removing the hard-coded tree item used by preview controller.
Without removing that, we can't see changes to dynamic fields based off the node/entity fields in the preview.

I'll start on those next

larowlan’s picture

Title: [PP-3] Send page data to Drupal for storage in auto-save store » Send page data to Drupal for storage in auto-save store
Assigned: larowlan » wim leers
Status: Postponed (maintainer needs more info) » Needs review

#3487484: Save page data form values in application state with support for undo/redo is in.

@effulgentsia indicated we can do this without seeing updates to dynamic components in the preview, so this no-longer depends on #3493941: Maintain a per-component set of prop expressions/sources and #3493943: SDC+JS Component Sources: split default values into `resolved` and `source`

I've moved the new e2e test to #3493941: Maintain a per-component set of prop expressions/sources for that.

That now means this is ready for review 🙌

tedbow’s picture

Status: Needs review » Needs work

This looks good but when I try to manually test it I get errors. Investigating

tedbow’s picture

tedbow’s picture

Assigned: wim leers » tedbow

working this

tedbow’s picture

Assigned: tedbow » wim leers
Status: Needs work » Needs review

I have fixed the bugs I found in manual tests. Now in manual testing change update the page data fields(at least have tried title and body) the "Publish" button works, and when I view the node outside of experience builder I see both the XB and other field changes.🎉

Assigning back to @wim leers since @larowlan assigned to him but I will continue to review.

tedbow’s picture

Assigned: wim leers » tedbow
Status: Needs review » Needs work

I have idea why the test is failing. Will work on it

tedbow’s picture

Assigned: tedbow » wim leers
Status: Needs work » Needs review

PHPUnit tests are passing now, the e2e contextual-panel.cy.js test failed, Hoping was just a fluke so retesting

UPDATE: yep green now

tedbow’s picture

I think this is good now, I started this and @larowlan did a lot of the work too, so I can't approve

effulgentsia’s picture

Priority: Normal » Critical
wim leers’s picture

Assigned: wim leers » tedbow
Status: Needs review » Needs work

I didn't get to this today, between tying up the many loose ends that #3486203: Integrate saving sections with the backend: (de)normalize Pattern config entities using the client-side data model revealed, which I finished up just now in #3484678: Simplify ComponentSourceInterface::getClientSideInfo(), introduce ClientSideRepresentation value object, and leverage it (thanks, @longwave!).

I had deprioritized reviewing this issue in favor of other issues: because I need to see the big picture to be able to properly review this, and pretty much all of this infrastructure landed while I was on paternity leave with no involvement from me. That's why I've been asking @tedbow to update https://www.drupal.org/project/experience_builder/issues/3455753#save-dr..., which he has been doing! 👏

I promise a thorough review tomorrow.


Meanwhile, this seems to have conflicted with #3499774: Cannot save Page in XB when content_moderation is installed, so a rebase would be appreciated 🙏😊

larowlan’s picture

Assigned: tedbow » wim leers
Status: Needs work » Needs review

This is ready for review again @Wim

wim leers’s picture

Assigned: wim leers » Unassigned
Status: Needs review » Reviewed & tested by the community
Issue tags: +Needs followup
Related issues: +#3497530: Implement the "Publish All" button

Thanks!

(Also thanks to @tedbow for getting https://www.drupal.org/project/experience_builder/issues/3455753#save-dr... in good shape!)

Posthumously reviewed the predecessor

Reviewed the #3487484: Save page data form values in application state with support for undo/redo MR to be able to review this one. High-level observations from there:

Review

  1. Some really impressive work here, @larowlan and @tedbow! 😄👏 It looks pretty hacky at this point, but that's because we're bootstrapping all this. I'm confident it'll get better over time. 👍
  2. Bug #1: When the server responds with validation errors, those are not displayed anywhere: not in the Publish button (that's in scope for #3497530: Implement the "Publish All" button, and not in the form. I cannot find an issue for that.
  3. Bug #2: Buggy behavior for boolean fields, as described in detail at https://git.drupalcode.org/project/experience_builder/-/merge_requests/5....

Can you please create a follow-up issue for those 2? 🙏

Given how important this is for https://www.drupal.org/project/experience_builder/issues/3455753#save-dr..., and that this definitely gets us to a better place than HEAD: merging :)

  • wim leers committed 2ebfc723 on 0.x authored by tedbow
    Issue #3495752 by larowlan, tedbow, wim leers: Send page data to Drupal...
wim leers’s picture

Assigned: Unassigned » larowlan
Status: Reviewed & tested by the community » Patch (to be ported)
larowlan’s picture

Status: Patch (to be ported) » Fixed
Issue tags: -Needs followup
wim leers’s picture

Assigned: larowlan » Unassigned

Thanks for those! 🙏

I quite liked/was impressed with that "hacky dance" 😅🙈 IDK what that says about me 🤣

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.