[WHIT-3171] - Add conditional logic to display the change note in controls#11233
Open
jamiestamp wants to merge 1 commit intomainfrom
Open
[WHIT-3171] - Add conditional logic to display the change note in controls#11233jamiestamp wants to merge 1 commit intomainfrom
jamiestamp wants to merge 1 commit intomainfrom
Conversation
Adds a boolean to standard_edition_publishing_controls defaulting to true so that we can have more control over when to display the change note field.
9e6ec20 to
933d17e
Compare
TonyGDS
reviewed
Mar 11, 2026
| published_edition = create(:published_standard_edition, :with_organisations, configurable_document_type: "test_type") | ||
| edition = create(:draft_standard_edition, :with_organisations, configurable_document_type: "test_type", document: published_edition.document) | ||
|
|
||
| assert edition.change_note_required?, "Expected change_note_required? to be true for this test" |
Contributor
There was a problem hiding this comment.
Can we add this guard into the "GET edit renders change notes on the documents tab" test as well?
TonyGDS
reviewed
Mar 11, 2026
| end | ||
|
|
||
| def standard_edition_publishing_controls(form, edition) | ||
| def standard_edition_publishing_controls(form, edition, allow_change_note: true) |
Contributor
There was a problem hiding this comment.
I think this should be fine for now. I'm wondering in future if we want to display more things conditionally based on the tab we can pass in something like is_on_default_tab? or even the tab context itself.
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.
Adds a boolean to standard_edition_publishing_controls defaulting to true so that we can have more control over when to display the change note field.
This will prevent dynamic forms from showing the change note field when the save button is rendered.