-
Notifications
You must be signed in to change notification settings - Fork 0
feat: PRSDM-9506 frontmatter spike #65
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
Draft
FabioSol
wants to merge
16
commits into
main
Choose a base branch
from
PRSDM-9506-frontmatter-spike
base: main
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
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
4d5895b
feat: new config file
FabioSol 60b125a
fix: change to hugo.yml for consistency
FabioSol 061fa53
fix: remove non basic fields
FabioSol 2460df3
fix: use email type
FabioSol a05915f
schemas presented version
FabioSol e86be35
fix: change number attribute multiple_of to interger flag
FabioSol 9007e80
feat: add sample
FabioSol ecacf16
fix: address feedback on arrays and enums
FabioSol 8e9cd14
feat: required, optional and default annotations
FabioSol 51aeb7e
fix: address feedback, required validation and placeholder text
FabioSol 2bf8899
chore: update frontmatter config to match latest changes (provisional)
FabioSol 145cba6
fix: address feedback
FabioSol ad3af5f
feat: add object data type
FabioSol 534f913
fix: added fields for clarity
FabioSol 809a826
chore: update samples to showcase ticket requirements
FabioSol 6556f1b
fix: make optional the validation message
FabioSol File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| frontmatter: | ||
| title: | ||
| type: string | ||
| required: true | ||
| placeholder_message: Enter a title | ||
| validation_message: Please ensure your article has a title | ||
| author: | ||
| type: email | ||
| required: true | ||
| placeholder_message: Enter author email | ||
| validation_message: Please ensure your article has an author email address | ||
|
|
46 changes: 46 additions & 0 deletions
46
frontmatter-config-design/samples/frontmatter-config-1.yaml
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| author: | ||
| type: email | ||
| required: true | ||
| placeholder_message: Enter author email | ||
| validation_message: Please ensure your article has an author email address | ||
|
|
||
| title: | ||
| type: string | ||
| required: true | ||
| placeholder_message: Enter a title | ||
| validation_message: Please ensure your article has a title | ||
| max_length: 100 | ||
|
|
||
| status: | ||
| type: option | ||
| required: true | ||
| placeholder_message: Select status | ||
| validation_message: Please select a valid status from the dropdown | ||
| items_type: string | ||
| items: | ||
| - Draft | ||
| - Review | ||
| - Published | ||
| - Deprecated | ||
|
|
||
| slug: | ||
| type: string | ||
| required: true | ||
| placeholder_message: eg. example-slug | ||
| validation_message: Invalid slug format. Use lowercase letters, numbers, underscores and hyphens only (e.g. "validate" or "solution-definition") | ||
| pattern: ^[a-z]+(-[a-z]+)*$ | ||
|
|
||
| URL: | ||
| type: string | ||
| required: true | ||
| placeholder_message: https://example.com | ||
| validation_message: Please enter a valid URL (e.g. https://example.com) | ||
| pattern: ^(\/[a-zA-Z0-9-._~]+)*\/?$ | ||
|
|
||
| weight: | ||
| type: number | ||
| required: true | ||
| placeholder_message: eg. 5 | ||
| validation_message: Weight must be a non-negative integer | ||
| integer: true | ||
| minimum: 1 | ||
FabioSol marked this conversation as resolved.
Show resolved
Hide resolved
|
||
60 changes: 60 additions & 0 deletions
60
frontmatter-config-design/samples/frontmatter-config-2.yaml
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| # object example (PRSDM-9766 example) | ||
| persona: | ||
| type: object | ||
| required: true | ||
| placeholder_message: Enter persona details | ||
| validation_message: Please provide all the required persona information | ||
| properties: | ||
| name: | ||
| type: string | ||
| required: true | ||
| placeholder_message: Enter the persona's name | ||
| validation_message: Name is required | ||
| role: | ||
| type: string | ||
| required: true | ||
| placeholder_message: Enter the persona's role | ||
| validation_message: Role is required | ||
|
|
||
| # array of objects example 1 (PRSDM-9766 example) | ||
| attributes: | ||
| type: array | ||
| required: true | ||
| items_type: object | ||
| items_properties: | ||
| name: | ||
| type: string | ||
| required: true | ||
| placeholder_message: Enter attribute name | ||
| validation_message: Attribute name is required | ||
| key-role: | ||
| type: string | ||
| required: true | ||
| placeholder_message: Enter key role | ||
| validation_message: Key role is required | ||
| optionality: | ||
| type: string | ||
| required: true | ||
| placeholder_message: Enter optionality | ||
| validation_message: Optionality is required | ||
| description: | ||
| type: string | ||
| required: true | ||
| placeholder_message: Enter description | ||
| validation_message: Description is required | ||
|
|
||
| # array of objects example 2 | ||
| related_articles: | ||
| type: array | ||
| required: false | ||
| items_type: object | ||
| items_properties: | ||
| title: | ||
| type: string | ||
| required: true | ||
| url: | ||
| type: string | ||
| required: true | ||
| description: | ||
| type: string | ||
| required: false |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| string: | ||
| extends: root # Inherits attributes from root type | ||
| pattern: string # [Optional] - Regex pattern for validation | ||
| min_length: number # [Default: 0] - Minimum length of the string | ||
| max_length: number # [Optional] - Maximum length of the string | ||
|
|
||
| #number: probably needed in future | ||
| # extends: root # Inherits attributes from root type | ||
| # minimum: number # [Optional] - Minimum value | ||
| # maximum: number # [Optional] - Maximum value | ||
| # integer: boolean # [Default: false] - Whether the number should be an integer | ||
|
|
||
| boolean: | ||
| extends: root # Inherits attributes from root type | ||
|
|
||
| array: | ||
| extends: root # Inherits attributes from root type | ||
| items_type: string # [Required] - Type of items in the array | ||
| items: array # [Optional] - List of allowed items | ||
| min_items: number # [Default: 0] - Minimum number of items | ||
| items_properties: # [required | items_type: object] - Properties of each item if items_type is object | ||
| key: # Property name | ||
| type: string # Type of the property | ||
| required: boolean # Whether the property is required | ||
| placeholder_message: string # [Required] - Placeholder message | ||
| validation_message: string # [Optional] - Custom validation message | ||
|
|
||
| object: | ||
| extends: root # Inherits attributes from root type | ||
| properties: # [Required] - Properties of the object | ||
| key: # Property name | ||
| type: string # Type of the property | ||
| required: boolean # Whether the property is required | ||
| placeholder_message: string # [Required] - Placeholder message | ||
| validation_message: string # [Optional] - Custom validation message |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| text: | ||
| extends: string | ||
| rows: number # [Optional] - Number of rows for textarea | ||
|
|
||
| email: | ||
| extends: string | ||
| pattern: '^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$' # predefined Email regex pattern | ||
|
|
||
| date: | ||
| extends: string | ||
| pattern: '^\d{4}-\d{2}-\d{2}$' # YYYY-MM-DD format | ||
|
|
||
| datetime: | ||
| extends: string | ||
| pattern: '^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(Z|[+-]\d{2}:\d{2})$' # ISO 8601 format | ||
|
|
||
| option: | ||
| extends: array |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| root: | ||
| type: string # [Required] - The type name | ||
| required: boolean # [Default: false] - Whether field is mandatory | ||
| placeholder_message: string # [Required] - Placeholder message | ||
| validation_message: string # [Optional] - Custom validation message |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.