fix: add inactive page title and message to form entry context - #26
Merged
Conversation
Contributor
Reviewer's guide (collapsed on small PRs)Reviewer's GuideExpose inactive form page title and message in the form entry context returned by the get_form_fields API so clients can render appropriate messaging when a form is inactive. Sequence diagram for get_form_fields including inactive page messagingsequenceDiagram
participant Client
participant API as GetFormFieldsAPI
participant FormEntryModel
Client->>API: GET /api/forms/{slug}/fields
API->>FormEntryModel: load_form_entry(slug)
FormEntryModel-->>API: form_entry
API->>API: build context
API->>API: set active_date_from, active_date_to
API->>API: set success_page_title, success_page_message
API->>API: set inactive_page_title, inactive_page_message
API-->>Client: JSON context with fields and inactive messaging
Class diagram for updated form entry context structureclassDiagram
class FormEntryContext {
string slug
datetime active_date_from
datetime active_date_to
string success_page_title
string success_page_message
string inactive_page_title
string inactive_page_message
string csrf_token
list fields
}
class GetFormFieldsView {
dict get_form_fields(request, slug)
}
GetFormFieldsView --> FormEntryContext : returns
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Summary by Sourcery
New Features: