-
Notifications
You must be signed in to change notification settings - Fork 194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace the body textarea with a Monaco editor #9532
base: editionable-landing-pages
Are you sure you want to change the base?
Replace the body textarea with a Monaco editor #9532
Commits on Oct 17, 2024
-
Add Editionable LandingPage model
- LandingPage is a new document type rendered by Frontend which constructs its page using blocks specified in the details of the content item (not to be confused with the reusable content blocks project). - Here we add it as an editionable object, add a PublishingAPI presenter to allow it to be published, and update Whitehall's list of allowed rendering apps to include Frontend (this is the first, but the consolidation work means it won't be the last document type that will need this).
Configuration menu - View commit details
-
Copy full SHA for 49bd534 - Browse repository at this point
Copy the full SHA 49bd534View commit details -
- _form partial is required for editions - add resource route
Configuration menu - View commit details
-
Copy full SHA for de2428c - Browse repository at this point
Copy the full SHA de2428cView commit details -
Allow setting base_path on LandingPage creation
- Add additional_significant_fields partial - This handles editing the base_path the first time the document is created - allow the slug parameter in EditionsController - skip updating document slugs for landing pages. We want to be able to specify the base_path explicitly for these editions, so having them set automatically from the title is not desired. Co-authored-by: Richard Towers <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for a861eaf - Browse repository at this point
Copy the full SHA a861eafView commit details -
Add landing pages to new document options
- Add redirect to new_document_controller to allow it to bounce landing pages to their controller.
Configuration menu - View commit details
-
Copy full SHA for c96273a - Browse repository at this point
Copy the full SHA c96273aView commit details -
Configuration menu - View commit details
-
Copy full SHA for e66f84f - Browse repository at this point
Copy the full SHA e66f84fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 31318e8 - Browse repository at this point
Copy the full SHA 31318e8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7fba3b5 - Browse repository at this point
Copy the full SHA 7fba3b5View commit details -
Configuration menu - View commit details
-
Copy full SHA for f9f604a - Browse repository at this point
Copy the full SHA f9f604aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4559cf9 - Browse repository at this point
Copy the full SHA 4559cf9View commit details -
Add some validations to LandingPage
- base_path must exist and not already be taken - body must be valid YAML (and more, root element must be blocks: - we can expand this to stricter testing, but maybe that should be by schema?)
Configuration menu - View commit details
-
Copy full SHA for dc1a544 - Browse repository at this point
Copy the full SHA dc1a544View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8e109b4 - Browse repository at this point
Copy the full SHA 8e109b4View commit details -
Configuration menu - View commit details
-
Copy full SHA for a53508c - Browse repository at this point
Copy the full SHA a53508cView commit details -
Configuration menu - View commit details
-
Copy full SHA for f816ff3 - Browse repository at this point
Copy the full SHA f816ff3View commit details -
Configuration menu - View commit details
-
Copy full SHA for dc9a20d - Browse repository at this point
Copy the full SHA dc9a20dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5b0e85c - Browse repository at this point
Copy the full SHA 5b0e85cView commit details -
Replace the body textarea with a Monaco editor
This should provide a much better editing experience for YAML files. It gives us syntax highlighting, code folding, line numbers, and a whole bunch of other features. It does not yet provide schema validation, or schema-powered autocomplete, but that's a possible improvement for later. We're using ecmascript modules to load the third party javascript here, rather than installing it with npm. This is just because bundling the code and making the rails asset pipeline aware of it is a yak shave. Hopefully the YAML editor won't be a long term component, so this will be a temporary oddity.
Configuration menu - View commit details
-
Copy full SHA for fbd21c1 - Browse repository at this point
Copy the full SHA fbd21c1View commit details