Added name_starts_with_yaml_object edit field and result field - fixes #1269 - #1358
Open
philayres wants to merge 1 commit into
Open
Added name_starts_with_yaml_object edit field and result field - fixes #1269#1358philayres wants to merge 1 commit into
philayres wants to merge 1 commit into
Conversation
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
Implements an edit field and result field for
name_starts_with_yaml_object.Edit field
Adds
common_templates/edit_fields/_name_starts_with_yaml_object.html.erb, which renders a YAML CodeMirror editor (following the existing pattern used by the JSON edit fields) foryaml_object_*fields backed by a text/varchar column.Dynamic::FieldEditAs::Handlerresolvesyaml_object_*fields backed by text/varchar columns to a newyaml_objectedit_as field type, handled byDynamic::FieldEditAs::YamlObject, which validates that submitted text parses as a YAML Hash/Array (raisingFphsExceptionotherwise) and persists the original YAML text as-is.Result field
common_templates/_common_template_result_fields.html.erbparses the stored YAML text via theyaml_parseHandlebars helper and renders it through the existingtypeof objectstructured/collapsible view used for JSON object fields.Testing
Dynamic::FieldEditAs::HandlerandDynamic::FieldEditAs::YamlObjectyaml_parseHandlebars helperPart of #1251.
Fixes #1269