-
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
Draft
richardTowers
wants to merge
16
commits into
editionable-landing-pages
Choose a base branch
from
editionable-landing-pages-monaco
base: editionable-landing-pages
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Replace the body textarea with a Monaco editor #9532
richardTowers
wants to merge
16
commits into
editionable-landing-pages
from
editionable-landing-pages-monaco
Conversation
This file contains 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
- 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).
- _form partial is required for editions - add resource route
- 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]>
- Add redirect to new_document_controller to allow it to bounce landing pages to their controller.
- 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?)
richardTowers
force-pushed
the
editionable-landing-pages-monaco
branch
from
October 17, 2024 13:41
7b7e861
to
50b2515
Compare
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.
richardTowers
force-pushed
the
editionable-landing-pages-monaco
branch
from
October 17, 2024 13:47
50b2515
to
fbd21c1
Compare
KludgeKML
force-pushed
the
editionable-landing-pages
branch
5 times, most recently
from
October 17, 2024 15:28
94bdaed
to
d4c80fa
Compare
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.
Follow these steps if you are doing a Rails upgrade.