Replies: 1 comment
-
|
A few quick thoughts:
(and any other fields that might be needed in the schema). If no schema is provided for a custom tag then I think maybe we just show a placeholder, e.g.
a. We could autoguess the fields I think I like (b) more than (a). (That's how other similar CMS work.) I would also add that in situations (1) and (2) saving the document should be non-destructive -- i.e. the original data should be preserved. But for both (1) and (2b) the data wouldn't be editable in the fields UI (which I think is OK). |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
There is an issue currently when trying to use yaml tags in places where the editor is expecting a primitive type. For example, the editor may be expecting a string value, but the yaml file uses a
!IfEnvironmenttag to determine which value to use. In the editor this comes across as an object instead of a string (ex:{ _type: 'IfEnvironment', _value: {...} }).Ideally the editor needs to be able to edit the custom yaml tags without knowing that it is editing a custom yaml tag.
There are a few considerations that need to be made:
IfEnvironment,String,IfLocale, etc in Amagaki project type).editor.yamlhow the different custom tags should behave? ex: define for theCustomTagthat it is amappingtype custom tag and to use thedefaultkey when editing as a string in the editor?scalar,mapping, andsequenceunknown yaml tags. But may limit how it would work in practice. For example, if the field provides a text field for editing, but the value is amapping, how do you convert themappingto a string value for editing?Initial fix idea is to abstract the value in editor so that all interactions with the value for displaying fields would go through helper methods (ex:
currentValue.toString()). There would be a default primitive class that would be used for normal values, but for things like custom tags the object would use the same interface but could change how the value was stored.Concept for the value interface:
Then it could be implemented as follows:
And when the value is used in a field type:
Thoughts?
Beta Was this translation helpful? Give feedback.
All reactions