Skip to content
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

[Samples] Sample updates for Input Validation #4455

Merged
merged 5 commits into from
Jul 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
202 changes: 1 addition & 201 deletions samples/v1.0/Scenarios/Inputs.json
Original file line number Diff line number Diff line change
@@ -1,201 +1 @@
{
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"type": "AdaptiveCard",
"version": "1.0",
"body": [
{
"type": "TextBlock",
"size": "medium",
"weight": "bolder",
"text": "Input.Text elements",
"horizontalAlignment": "center"
},
{
"type": "Input.Text",
"placeholder": "Name",
"style": "text",
"maxLength": 0,
"id": "SimpleVal"
},
{
"type": "Input.Text",
"placeholder": "Homepage",
"style": "url",
"maxLength": 0,
"id": "UrlVal"
},
{
"type": "Input.Text",
"placeholder": "Email",
"style": "email",
"maxLength": 0,
"id": "EmailVal"
},
{
"type": "Input.Text",
"placeholder": "Phone",
"style": "tel",
"maxLength": 0,
"id": "TelVal"
},
{
"type": "Input.Text",
"placeholder": "Comments",
"style": "text",
"isMultiline": true,
"maxLength": 0,
"id": "MultiLineVal"
},
{
"type": "Input.Number",
"placeholder": "Quantity",
"min": -5,
"max": 5,
"value": 1,
"id": "NumVal"
},
{
"type": "Input.Date",
"placeholder": "Due Date",
"id": "DateVal",
"value": "2017-09-20"
},
{
"type": "Input.Time",
"placeholder": "Start time",
"id": "TimeVal",
"value": "16:59"
},
{
"type": "TextBlock",
"size": "medium",
"weight": "bolder",
"text": "Input.ChoiceSet",
"horizontalAlignment": "center"
},
{
"type": "TextBlock",
"text": "What color do you want? (compact)"
},
{
"type": "Input.ChoiceSet",
"id": "CompactSelectVal",
"style": "compact",
"value": "1",
"choices": [
{
"title": "Red",
"value": "1"
},
{
"title": "Green",
"value": "2"
},
{
"title": "Blue",
"value": "3"
}
]
},
{
"type": "TextBlock",
"text": "What color do you want? (expanded)"
},
{
"type": "Input.ChoiceSet",
"id": "SingleSelectVal",
"style": "expanded",
"value": "1",
"choices": [
{
"title": "Red",
"value": "1"
},
{
"title": "Green",
"value": "2"
},
{
"title": "Blue",
"value": "3"
}
]
},
{
"type": "TextBlock",
"text": "What colors do you want? (multiselect)"
},
{
"type": "Input.ChoiceSet",
"id": "MultiSelectVal",
"isMultiSelect": true,
"value": "1,3",
"choices": [
{
"title": "Red",
"value": "1"
},
{
"title": "Green",
"value": "2"
},
{
"title": "Blue",
"value": "3"
}
]
},
{
"type": "TextBlock",
"size": "medium",
"weight": "bolder",
"text": "Input.Toggle",
"horizontalAlignment": "center"
},
{
"type": "Input.Toggle",
"title": "I accept the terms and conditions (True/False)",
"valueOn": "true",
"valueOff": "false",
"id": "AcceptsTerms"
},
{
"type": "Input.Toggle",
"title": "Red cars are better than other cars",
"valueOn": "RedCars",
"valueOff": "NotRedCars",
"id": "ColorPreference"
}
],
"actions": [
{
"type": "Action.Submit",
"title": "Submit",
"data": {
"id": "1234567890"
}
},
{
"type": "Action.ShowCard",
"title": "Show Card",
"card": {
"type": "AdaptiveCard",
"body": [
{
"type": "Input.Text",
"placeholder": "enter comment",
"style": "text",
"maxLength": 0,
"id": "CommentVal"
}
],
"actions": [
{
"type": "Action.Submit",
"title": "OK"
}
]
}
}
]
}
{ "$schema": "http://adaptivecards.io/schemas/adaptive-card.json", "type": "AdaptiveCard", "version": "1.0", "body": [ { "type": "TextBlock", "size": "medium", "weight": "bolder", "text": "Input.Text elements", "horizontalAlignment": "center" }, { "type": "TextBlock", "text": "Name" }, { "type": "Input.Text", "style": "text", "id": "SimpleVal" }, { "type": "TextBlock", "text": "Homepage" }, { "type": "Input.Text", "style": "url", "id": "UrlVal" }, { "type": "TextBlock", "text": "Email" }, { "type": "Input.Text", "style": "email", "id": "EmailVal" }, { "type": "TextBlock", "text": "Phone" }, { "type": "Input.Text", "style": "tel", "id": "TelVal" }, { "type": "TextBlock", "text": "Comments" }, { "type": "Input.Text", "style": "text", "isMultiline": true, "id": "MultiLineVal" }, { "type": "TextBlock", "text": "Quantity" }, { "type": "Input.Number", "min": -5, "max": 5, "value": 1, "id": "NumVal" }, { "type": "TextBlock", "text": "Due Date" }, { "type": "Input.Date", "id": "DateVal", "value": "2017-09-20" }, { "type": "TextBlock", "text": "Start time" }, { "type": "Input.Time", "id": "TimeVal", "value": "16:59" }, { "type": "TextBlock", "size": "medium", "weight": "bolder", "text": "Input.ChoiceSet", "horizontalAlignment": "center" }, { "type": "TextBlock", "text": "What color do you want? (compact)" }, { "type": "Input.ChoiceSet", "id": "CompactSelectVal", "style": "compact", "value": "1", "choices": [ { "title": "Red", "value": "1" }, { "title": "Green", "value": "2" }, { "title": "Blue", "value": "3" } ] }, { "type": "TextBlock", "text": "What color do you want? (expanded)" }, { "type": "Input.ChoiceSet", "id": "SingleSelectVal", "style": "expanded", "value": "1", "choices": [ { "title": "Red", "value": "1" }, { "title": "Green", "value": "2" }, { "title": "Blue", "value": "3" } ] }, { "type": "TextBlock", "text": "What colors do you want? (multiselect)" }, { "type": "Input.ChoiceSet", "id": "MultiSelectVal", "isMultiSelect": true, "value": "1,3", "choices": [ { "title": "Red", "value": "1" }, { "title": "Green", "value": "2" }, { "title": "Blue", "value": "3" } ] }, { "type": "TextBlock", "size": "medium", "weight": "bolder", "text": "Input.Toggle", "horizontalAlignment": "center" }, { "type": "Input.Toggle", "title": "I accept the terms and conditions (True/False)", "valueOn": "true", "valueOff": "false", "id": "AcceptsTerms" }, { "type": "Input.Toggle", "title": "Red cars are better than other cars", "valueOn": "RedCars", "valueOff": "NotRedCars", "id": "ColorPreference" } ], "actions": [ { "type": "Action.Submit", "title": "Submit", "data": { "id": "1234567890" } }, { "type": "Action.ShowCard", "title": "Show Card", "card": { "type": "AdaptiveCard", "body": [ { "type": "TextBlock", "text": "Enter comment" }, { "type": "Input.Text", "style": "text", "id": "CommentVal" } ], "actions": [ { "type": "Action.Submit", "title": "OK" } ] } } ]}
Expand Down
139 changes: 1 addition & 138 deletions samples/v1.3/Elements/Input.ChoiceSet.Label.json
Original file line number Diff line number Diff line change
@@ -1,138 +1 @@
{
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"type": "AdaptiveCard",
"version": "1.0",
"body": [
{
"type": "Input.ChoiceSet",
"id": "input1",
"style": "compact",
"isMultiSelect": false,
"label": "Default Input.ChoiceSet label (compact)",
"choices": [
{
"title": "Option 1",
"value": "1"
},
{
"title": "Option 2",
"value": "2"
}
]
},
{
"type": "Input.ChoiceSet",
"id": "input2",
"style": "compact",
"isMultiSelect": false,
"label": "Required Input.ChoiceSet label (compact)",
"isRequired": true,
"errorMessage": "Required input",
"choices": [
{
"title": "Option 1",
"value": "1"
},
{
"title": "Option 2",
"value": "2"
}
]
},
{
"type": "Input.ChoiceSet",
"id": "input3",
"style": "expanded",
"isMultiSelect": false,
"label": "Default Input.ChoiceSet label (expanded)",
"choices": [
{
"title": "Option 1",
"value": "1"
},
{
"title": "Option 2",
"value": "2"
}
]
},
{
"type": "Input.ChoiceSet",
"id": "input4",
"style": "expanded",
"isMultiSelect": false,
"label": "Required Input.ChoiceSet label (expanded)",
"isRequired": true,
"errorMessage": "Required input",
"choices": [
{
"title": "Option 1",
"value": "1"
},
{
"title": "Option 2",
"value": "2"
}
]
},
{
"type": "Input.ChoiceSet",
"id": "input5",
"style": "expanded",
"isMultiSelect": true,
"label": "Default Input.ChoiceSet label (expanded, multiselect)",
"choices": [
{
"title": "Option 1",
"value": "1"
},
{
"title": "Option 2",
"value": "2"
}
]
},
{
"type": "Input.ChoiceSet",
"id": "input6",
"style": "expanded",
"isMultiSelect": true,
"isRequired": true,
"label": "Required Input.ChoiceSet label (expanded, multiselect)",
"errorMessage": "Required input",
"choices": [
{
"title": "Option 1",
"value": "1"
},
{
"title": "Option 2",
"value": "2"
}
]
},
{
"type": "Input.ChoiceSet",
"id": "input7",
"style": "compact",
"isMultiSelect": false,
"label": "Longer label to verify label wrapping for an Input.ChoiceSet. If that was not long enough, then this should make it long enough. Did you know that honeybees can flap their wings 200 times every second?",
"choices": [
{
"title": "Option 1",
"value": "1"
},
{
"title": "Option 2",
"value": "2"
}
]
}
],
"actions": [
{
"type": "Action.Submit",
"title": "OK"
}
]
}
{ "$schema": "http://adaptivecards.io/schemas/adaptive-card.json", "type": "AdaptiveCard", "version": "1.0", "body": [ { "type": "Input.ChoiceSet", "id": "input1", "style": "compact", "isMultiSelect": false, "label": "Default Input.ChoiceSet label (compact)", "choices": [ { "title": "Option 1", "value": "1" }, { "title": "Option 2", "value": "2" } ] }, { "type": "Input.ChoiceSet", "id": "input2", "style": "compact", "isMultiSelect": false, "label": "Required Input.ChoiceSet label (compact)", "isRequired": true, "errorMessage": "Required input", "choices": [ { "title": "Option 1", "value": "1" }, { "title": "Option 2", "value": "2" } ] }, { "type": "Input.ChoiceSet", "id": "input3", "style": "expanded", "isMultiSelect": false, "label": "Default Input.ChoiceSet label (expanded)", "choices": [ { "title": "Option 1", "value": "1" }, { "title": "Option 2", "value": "2" } ] }, { "type": "Input.ChoiceSet", "id": "input4", "style": "expanded", "isMultiSelect": false, "label": "Required Input.ChoiceSet label (expanded)", "isRequired": true, "errorMessage": "Required input", "choices": [ { "title": "Option 1", "value": "1" }, { "title": "Option 2", "value": "2" } ] }, { "type": "Input.ChoiceSet", "id": "input5", "style": "expanded", "isMultiSelect": true, "label": "Default Input.ChoiceSet label (expanded, multiselect)", "choices": [ { "title": "Option 1", "value": "1" }, { "title": "Option 2", "value": "2" } ] }, { "type": "Input.ChoiceSet", "id": "input6", "style": "expanded", "isMultiSelect": true, "isRequired": true, "label": "Required Input.ChoiceSet label (expanded, multiselect)", "errorMessage": "Required input", "choices": [ { "title": "Option 1", "value": "1" }, { "title": "Option 2", "value": "2" } ] } ], "actions": [ { "type": "Action.Submit", "title": "OK" } ]}
Expand Down
44 changes: 1 addition & 43 deletions samples/v1.3/Elements/Input.Date.ErrorMessage.json
Original file line number Diff line number Diff line change
@@ -1,43 +1 @@
{
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"type": "AdaptiveCard",
"version": "1.0",
"body": [
{
"type": "Input.Date",
"id": "input1",
"label": "This is a required Input.Date",
"isRequired": true,
"errorMessage": "This is a required input"
},
{
"type": "Input.Date",
"id": "input2",
"label": "Input.Date with valid min date of February 1st, 2012",
"min": "2012-02-01",
"errorMessage": "The input data must have a date on or after February 1st, 2012"
},
{
"type": "Input.Date",
"id": "input3",
"label": "Input.Date with valid max date of November 2nd, 2021",
"max": "2021-11-02",
"errorMessage": "The input data must have a date on or before November 2nd, 2021"
},
{
"type": "Input.Date",
"id": "input4",
"label": "Required Input.Date with valid value between April 1st, 2012 and January 7th, 2025",
"min": "2012-04-01",
"max": "2025-01-07",
"isRequired": true,
"errorMessage": "The input data must have a date between April 1st, 2012 and January 7th, 2025"
}
],
"actions": [
{
"type": "Action.Submit",
"title": "OK"
}
]
}
{ "$schema": "http://adaptivecards.io/schemas/adaptive-card.json", "type": "AdaptiveCard", "version": "1.0", "body": [ { "type": "Input.Date", "id": "input1", "label": "This is a required Input.Date", "isRequired": true, "errorMessage": "This date is required" }, { "type": "Input.Date", "id": "input2", "label": "Input.Date with valid min date of February 1st, 2012", "min": "2012-02-01", "errorMessage": "This date must be on or after February 1st, 2012" }, { "type": "Input.Date", "id": "input3", "label": "Input.Date with valid max date of November 2nd, 2021", "max": "2021-11-02", "errorMessage": "This date must be on or before November 2nd, 2021" }, { "type": "Input.Date", "id": "input4", "label": "Required Input.Date with valid value between April 1st, 2012 and January 7th, 2025", "min": "2012-04-01", "max": "2025-01-07", "isRequired": true, "errorMessage": "This date is required and must be between April 1st, 2012 and January 7th, 2025" } ], "actions": [ { "type": "Action.Submit", "title": "OK" } ]}
Expand Down
Loading