Draft
Conversation
9184c12 to
209e1b1
Compare
a8bfb83 to
e7e39e3
Compare
7c78d8c to
9e3b834
Compare
f172a71 to
1f4065e
Compare
- Adds way of expressing child doc relationship in the schemas - Adds "Child documents" section to parent edition UI - Reuses "Choose type" workflow (duplicated) to choose child doc to create - Reuses "New edition" page - with conditionals - to show UI for creating the child doc, omitting irrelevant sections like Associations/Settings, and adding a confirmation at the top of the form that we are creating a child document associated with a specific parent document. Screenshots: <img width="729" height="555" alt="Image" src="https://github.com/user-attachments/assets/c2c1c583-337b-4771-a630-d10e174d063c" /> <img width="518" height="257" alt="Image" src="https://github.com/user-attachments/assets/a6015e5f-021c-4fde-ba59-72de5d4f590d" /> <img width="1844" height="4694" alt="Image" src="https://github.com/user-attachments/assets/7ff08b5d-78fa-4eb8-804d-cae5ad4bc74b" />
We'll call this at various points in the UI and logic.
For now, we only want the option to create/edit drafts, delete drafts, and theoretically to unpublish/withdraw. But scheduling and publishing and submitting for 2i in isolation is not part of MVP.
No history section here (for MVP, child documents should inherit the history of their parents). And no fact checking either.
Just to show it can be done. Seems to work 🎉
This reverts commit 3d5bd1f. It feels unclean architecturally. The true fix is likely that we'll want to send the Organisations at publish time, inheriting at the PRESENTER level rather than trying to model it all before then.
This should really be done with configs too, e.g. `can_set_organisation: false`
These are VERY noisy and make it difficult to spot debug / puts statements when manually testing things. We should disable this by default and only re-enable it when debugging database queries / bottlenecks.
We know we want children documents to 'inherit' some of the associations of the parent. We could do this at presenter time but then we have to patch up all the parts of the workflow and UI where it is expected that the organisations have already been set. Doing it that way would also prevent us from being able to make child document associations configurable in future. So whilst the callback approach in this commit is "yet another callback" to have to maintain, it seems the least worst option.
Makes it much easier to read
It's not allowed in the schema. Shame, as it would have been nice to have something meaty to test.
Could change this in future.
1f4065e to
a61b656
Compare
We need to think about Scheduling too, but more widely. See https://gov-uk.atlassian.net/browse/WHIT-2347
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TODO:
Publish all draft child documents when publishing parent doc.
When creating new edition of parent (and its children), duplicate the EditionRelationships accordingly.
Currently, org associations are copied from parent to child when parent is updated. We need to also copy from parent to child on child instantiation.
Hide 'about' page from http://whitehall-admin.dev.gov.uk/government/admin/standard-editions/choose_type?group=all
Surface child page validation errors on parent page (maybe? But think perf issues if we're calling
valid?(:publish)on a doc with >10 child pages). We at least need to do this when publishing.Add callback to re-present parent page if child doc is updated (even just draft updates, so the draft preview of parent page will be updated)
Update the PR description below, accordingly.
Context
We need to support multi-page architectures for config-driven documents, in a way that scales for our requirements and in a way that solves the myriad of problems our existing implementations have.
MVP for multi-page architecture:
But built flexibly enough to accommodate a future where:
What this spike does
childrenandparent_editionattributes in StandardEdition::ChildDocumentsWhat it doesn't cover:
about, variable title.Screenshots
New section for child documents, on parent page:
Choosing child document screen;
Filling in the child document page:
Child document surfaced on the parent page:
Invalid child document making it impossible to publish the parent doc:
Why
We know we'll need to support topical event about pages in the near future. That will be our first foray into multi-page architecture in the config-driven world. This PR is a playground to explore some ideas / complexities to do with that.
This application is owned by the Whitehall Experience team. Please let us know in #govuk-whitehall-experience-tech when you raise any PRs.
Follow these steps if you are doing a Rails upgrade.