Add DateProperty and EmailProperty components#961
Open
Devesh0129 wants to merge 4 commits intodevelopfrom
Open
Add DateProperty and EmailProperty components#961Devesh0129 wants to merge 4 commits intodevelopfrom
Devesh0129 wants to merge 4 commits intodevelopfrom
Conversation
…ithub.com/MetaConfigurator/meta-configurator into 305-components-depending-on-string-format
Logende
reviewed
May 3, 2026
Collaborator
There was a problem hiding this comment.
The DateProperty.vue is perfect! Regarding the EmailProperty.vue, it looks to me as if it is the same as the normal string property, except it additionally has a placeholder. If that is the case, to avoid duplication a better approach would be:
- No new EmailProperty.vue
- In resolveCorrespondingComponent.ts, if the type has string and format is email, then IF the schema does not have any
examples(undefined or an array of length 0), set node.schema.examples to[ "[email protected]" ] - the email-condition block should not return anything, just modify the schema. Then in the next check, the code would go into the normal StringProperty block and create a StringProperty, but with the newly added example (if no example was provided by the user). Examples are rendered as placeholders, in the same way as you put your custom placeholder.
@Devesh0129
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.
Paste this schema in Schema → Text View
{
"type": "object",
"properties": {
"name": {
"type": "string"
},
"birthDate": {
"type": "string",
"format": "date"
},
"email": {
"type": "string",
"format": "email"
}
}
}
Then switch to Data → GUI View and verify: