From a0ac289d36cab9fb914d472c7dabaf7b577813fa Mon Sep 17 00:00:00 2001 From: Rebecca Muraira Date: Mon, 20 Jul 2020 17:36:17 -0700 Subject: [PATCH] Sample updates --- samples/v1.0/Scenarios/Inputs.json | 202 +----------------- .../v1.3/Elements/Input.ChoiceSet.Label.json | 139 +----------- .../Elements/Input.Date.ErrorMessage.json | 44 +--- samples/v1.3/Elements/Input.Date.Label.json | 5 - .../Elements/Input.Number.ErrorMessage.json | 44 +--- samples/v1.3/Elements/Input.Number.Label.json | 5 - .../Elements/Input.Text.ErrorMessage.json | 34 +-- samples/v1.3/Elements/Input.Text.Label.json | 6 - .../Elements/Input.Time.ErrorMessage.json | 43 +--- samples/v1.3/Elements/Input.Time.Label.json | 15 +- .../Elements/Input.Toggle.ErrorMessage.json | 25 +-- samples/v1.3/Elements/Input.Toggle.Label.json | 25 +-- samples/v1.3/Elements/InputBehaviour.json | 144 ------------- samples/v1.3/Scenarios/Inputs (v1.3).json | 1 + .../Input.Text.InlineAction.ErrorMessage.json | 0 .../Input.Text.InlineAction.Label.json | 11 - samples/v1.3/Tests/InputBehaviour.json | 144 +++++++++++++ samples/v1.3/Tests/LongLabels.json | 1 + .../Visualizer/AdaptiveCardVisualizer.csproj | 11 +- .../HostConfigs/DefaultHostConfig.json | 6 +- source/uwp/Visualizer/MainPage.xaml | 2 +- 21 files changed, 178 insertions(+), 729 deletions(-) delete mode 100644 samples/v1.3/Elements/InputBehaviour.json create mode 100644 samples/v1.3/Scenarios/Inputs (v1.3).json rename samples/v1.3/{Elements => Tests}/Input.Text.InlineAction.ErrorMessage.json (100%) rename samples/v1.3/{Elements => Tests}/Input.Text.InlineAction.Label.json (65%) create mode 100644 samples/v1.3/Tests/InputBehaviour.json create mode 100644 samples/v1.3/Tests/LongLabels.json diff --git a/samples/v1.0/Scenarios/Inputs.json b/samples/v1.0/Scenarios/Inputs.json index 57f3ff7af6..dd45136054 100644 --- a/samples/v1.0/Scenarios/Inputs.json +++ b/samples/v1.0/Scenarios/Inputs.json @@ -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" } ] } } ] } \ No newline at end of file diff --git a/samples/v1.3/Elements/Input.ChoiceSet.Label.json b/samples/v1.3/Elements/Input.ChoiceSet.Label.json index 93cd1f8c42..8500e75d4f 100644 --- a/samples/v1.3/Elements/Input.ChoiceSet.Label.json +++ b/samples/v1.3/Elements/Input.ChoiceSet.Label.json @@ -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" } ] } \ No newline at end of file diff --git a/samples/v1.3/Elements/Input.Date.ErrorMessage.json b/samples/v1.3/Elements/Input.Date.ErrorMessage.json index d4d9be9951..7ebca0c382 100644 --- a/samples/v1.3/Elements/Input.Date.ErrorMessage.json +++ b/samples/v1.3/Elements/Input.Date.ErrorMessage.json @@ -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" } ] } \ No newline at end of file diff --git a/samples/v1.3/Elements/Input.Date.Label.json b/samples/v1.3/Elements/Input.Date.Label.json index 4f15e11e12..e87ddbd0ba 100644 --- a/samples/v1.3/Elements/Input.Date.Label.json +++ b/samples/v1.3/Elements/Input.Date.Label.json @@ -14,11 +14,6 @@ "label": "Required Input.Date label", "isRequired": true, "errorMessage": "Required input" - }, - { - "type": "Input.Date", - "id": "input3", - "label": "Longer label to verify label wrapping for an Input.Date. If that was not long enough, then this should make it long enough. Did you know a snail can sleep for three years?" } ], "actions": [ diff --git a/samples/v1.3/Elements/Input.Number.ErrorMessage.json b/samples/v1.3/Elements/Input.Number.ErrorMessage.json index 9b43b744a0..fd3e541104 100644 --- a/samples/v1.3/Elements/Input.Number.ErrorMessage.json +++ b/samples/v1.3/Elements/Input.Number.ErrorMessage.json @@ -1,43 +1 @@ -{ - "$schema": "http://adaptivecards.io/schemas/adaptive-card.json", - "type": "AdaptiveCard", - "version": "1.0", - "body": [ - { - "type": "Input.Number", - "id": "input1", - "label": "Required Input.Number", - "isRequired": true, - "errorMessage": "This is a required input" - }, - { - "type": "Input.Number", - "id": "input2", - "label": "Input.Number with valid min of 5", - "min": 5, - "errorMessage": "The input data must be greater than 5" - }, - { - "type": "Input.Number", - "id": "input3", - "label": "Input.Number with valid max of 10", - "max": 10, - "errorMessage": "The input data must be smaller than 10" - }, - { - "type": "Input.Number", - "id": "input4", - "label": "Required Input.Number with valid range between 0 and 100", - "isRequired": true, - "min": 0, - "max": 100, - "errorMessage": "The input data must be between 0 and 100" - } - ], - "actions": [ - { - "type": "Action.Submit", - "title": "Submit" - } - ] -} +{ "$schema": "http://adaptivecards.io/schemas/adaptive-card.json", "type": "AdaptiveCard", "version": "1.0", "body": [ { "type": "Input.Number", "id": "input1", "label": "Required Input.Number", "isRequired": true, "errorMessage": "This number is required" }, { "type": "Input.Number", "id": "input2", "label": "Input.Number with valid min of 5", "min": 5, "errorMessage": "This number must be greater than 5" }, { "type": "Input.Number", "id": "input3", "label": "Input.Number with valid max of 10", "max": 10, "errorMessage": "This number must be smaller than 10" }, { "type": "Input.Number", "id": "input4", "label": "Required Input.Number with valid range between 0 and 100", "isRequired": true, "min": 0, "max": 100, "errorMessage": "This number is required and must be between 0 and 100" } ], "actions": [ { "type": "Action.Submit", "title": "Submit" } ] } \ No newline at end of file diff --git a/samples/v1.3/Elements/Input.Number.Label.json b/samples/v1.3/Elements/Input.Number.Label.json index b2bb3acc06..a22f1d1cde 100644 --- a/samples/v1.3/Elements/Input.Number.Label.json +++ b/samples/v1.3/Elements/Input.Number.Label.json @@ -14,11 +14,6 @@ "label": "Require Input.Number label", "isRequired": true, "errorMessage": "Required input" - }, - { - "type": "Input.Number", - "id": "input3", - "label": "Longer label to verify label wrapping for an Input.Number. If that was not long enough, then this should make it long enough. Did you know that slugs have four noses?" } ], "actions": [ diff --git a/samples/v1.3/Elements/Input.Text.ErrorMessage.json b/samples/v1.3/Elements/Input.Text.ErrorMessage.json index ed94be70d7..530f97cf02 100644 --- a/samples/v1.3/Elements/Input.Text.ErrorMessage.json +++ b/samples/v1.3/Elements/Input.Text.ErrorMessage.json @@ -1,33 +1 @@ -{ - "type": "AdaptiveCard", - "version": "1.3", - "body": [ - { - "label": "Required Input.Text", - "type": "Input.Text", - "id": "id1", - "isRequired": true, - "errorMessage": "This is a required input" - }, - { - "label": "Input.Text with regex: ^\\w{5,10}$", - "type": "Input.Text", - "id": "id2", - "regex": "^\\w{5,50}$", - "errorMessage": "Input must contain between 5 and 10 characters long." - }, - { - "label": "Input.Text with maxLength of 6", - "type": "Input.Text", - "id": "id3", - "maxLength": 6, - "errorMessage": "Input must contain 6 characters or less." - } - ], - "actions": [ - { - "type": "Action.Submit", - "title": "Submit" - } - ] -} +{ "type": "AdaptiveCard", "version": "1.3", "body": [ { "label": "Required Input.Text", "type": "Input.Text", "id": "id1", "isRequired": true, "errorMessage": "This is a required input" }, { "label": "Input.Text with regex: ([A-Z])\\w+", "type": "Input.Text", "id": "id2", "regex": "([A-Z])\\w+", "errorMessage": "This input must begin with a capital letter and contain only alphanumeric characters." }, { "label": "Input.Text with maxLength of 6", "type": "Input.Text", "id": "id3", "maxLength": 6, "errorMessage": "This input must contain 6 characters or less." } ], "actions": [ { "type": "Action.Submit", "title": "Submit" } ] } \ No newline at end of file diff --git a/samples/v1.3/Elements/Input.Text.Label.json b/samples/v1.3/Elements/Input.Text.Label.json index 03853b3d99..9d483b8597 100644 --- a/samples/v1.3/Elements/Input.Text.Label.json +++ b/samples/v1.3/Elements/Input.Text.Label.json @@ -16,12 +16,6 @@ "label": "Required Input.Text label", "isRequired": true, "errorMessage": "Required input" - }, - { - "type": "Input.Text", - "id": "input3", - "style": "text", - "label": "Longer label to verify label wrapping for an Input.Text. If that was not long enough, then this should make it long enough. Did you know that elephants are the only animal that cannot jump?" } ], "actions": [ diff --git a/samples/v1.3/Elements/Input.Time.ErrorMessage.json b/samples/v1.3/Elements/Input.Time.ErrorMessage.json index 17d387887a..5dd60a7de1 100644 --- a/samples/v1.3/Elements/Input.Time.ErrorMessage.json +++ b/samples/v1.3/Elements/Input.Time.ErrorMessage.json @@ -1,42 +1 @@ -{ - "$schema": "http://adaptivecards.io/schemas/adaptive-card.json", - "type": "AdaptiveCard", - "version": "1.0", - "body": [ - { - "type": "Input.Time", - "id": "input1", - "label": "Required Input.Time", - "isRequired": true, - "errorMessage": "This is a required input" - }, - { - "type": "Input.Time", - "id": "input2", - "label": "Input.Time with valid min time of 6:00 am", - "min": "06:00", - "errorMessage": "Please provide a time after 6:00 am" - }, - { - "type": "Input.Time", - "id": "input3", - "label": "Input.Time with valid max time of 8:00 pm", - "max": "20:00", - "errorMessage": "Please provide a time before 8:00 pm" - }, - { - "type": "Input.Time", - "id": "input4", - "label": "Required Input.Time with valid value between 9:00 am and 5:00 pm", - "min": "09:00", - "max": "17:00", - "errorMessage": "Please provide a time between 9:00 am and 5:00 pm" - } - ], - "actions": [ - { - "type": "Action.Submit", - "title": "OK" - } - ] -} +{ "$schema": "http://adaptivecards.io/schemas/adaptive-card.json", "type": "AdaptiveCard", "version": "1.0", "body": [ { "type": "Input.Time", "id": "input1", "label": "Required Input.Time", "isRequired": true, "errorMessage": "This time is required" }, { "type": "Input.Time", "id": "input2", "label": "Input.Time with valid min time of 6:00 am", "min": "06:00", "errorMessage": "This time must be after 6:00 am" }, { "type": "Input.Time", "id": "input3", "label": "Input.Time with valid max time of 8:00 pm", "max": "20:00", "errorMessage": "This time must be before 8:00 pm" }, { "type": "Input.Time", "id": "input4", "label": "Required Input.Time with valid value between 9:00 am and 5:00 pm", "min": "09:00", "max": "17:00", "isRequired": true, "errorMessage": "This time is required and must be between 9:00 am and 5:00 pm" } ], "actions": [ { "type": "Action.Submit", "title": "OK" } ] } \ No newline at end of file diff --git a/samples/v1.3/Elements/Input.Time.Label.json b/samples/v1.3/Elements/Input.Time.Label.json index 19a97a5cc8..cd9b1826a6 100644 --- a/samples/v1.3/Elements/Input.Time.Label.json +++ b/samples/v1.3/Elements/Input.Time.Label.json @@ -6,19 +6,14 @@ { "type": "Input.Time", "id": "input1", - "label": "Default Input.Time label" - }, - { - "type": "Input.Time", - "id": "input2", - "label": "Required Input.Time label", - "isRequired": true, - "errorMessage": "Required input" + "label": "Default Input.Time label" }, { "type": "Input.Time", - "id": "input3", - "label": "Longer label to verify label wrapping for an Input.Time. If that was not long enough, then this should make it long enough. Did you know bats always turn left when leaving a cave?" + "id": "input2", + "label": "Required Input.Time label", + "isRequired": true, + "errorMessage": "Required input" } ], "actions": [ diff --git a/samples/v1.3/Elements/Input.Toggle.ErrorMessage.json b/samples/v1.3/Elements/Input.Toggle.ErrorMessage.json index 8b28dcd531..a5204b76ca 100644 --- a/samples/v1.3/Elements/Input.Toggle.ErrorMessage.json +++ b/samples/v1.3/Elements/Input.Toggle.ErrorMessage.json @@ -1,24 +1 @@ -{ - "$schema": "http://adaptivecards.io/schemas/adaptive-card.json", - "type": "AdaptiveCard", - "version": "1.0", - "body": [ - { - "type": "Input.Toggle", - "id": "input2", - "title": "I accept the terms and agreements", - "value": "false", - "valueOn": "true", - "valueOff": "false", - "label": "Required Input.Toggle", - "isRequired": true, - "errorMessage": "This is a required input" - } - ], - "actions": [ - { - "type": "Action.Submit", - "title": "OK" - } - ] -} +{ "$schema": "http://adaptivecards.io/schemas/adaptive-card.json", "type": "AdaptiveCard", "version": "1.0", "body": [ { "type": "Input.Toggle", "id": "input2", "title": "I accept the terms and agreements", "value": "false", "valueOn": "true", "valueOff": "false", "label": "Required Input.Toggle", "isRequired": true, "errorMessage": "You must accept the terms and conditions" } ], "actions": [ { "type": "Action.Submit", "title": "OK" } ] } \ No newline at end of file diff --git a/samples/v1.3/Elements/Input.Toggle.Label.json b/samples/v1.3/Elements/Input.Toggle.Label.json index 6d6874eb34..29e87b15bb 100644 --- a/samples/v1.3/Elements/Input.Toggle.Label.json +++ b/samples/v1.3/Elements/Input.Toggle.Label.json @@ -6,32 +6,23 @@ { "type": "Input.Toggle", "id": "input1", - "title": "I accept the terms and agreements", + "title": "I accept the terms and agreements", "value": "false", "valueOn": "true", - "valueOff": "false", - "label": "Default Input.Toggle label" - }, - { + "valueOff": "false", + "label": "Default Input.Toggle label" + }, + { "type": "Input.Toggle", "id": "input2", - "title": "I accept the terms and agreements", + "title": "I accept the terms and agreements", "value": "false", "valueOn": "true", - "valueOff": "false", - "label": "Required Input.Toggle label", + "valueOff": "false", + "label": "Required Input.Toggle label", "isRequired": true, "errorMessage": "Required input" } - { - "type": "Input.Toggle", - "id": "input3", - "title": "I accept the terms and agreements", - "value": "false", - "valueOn": "true", - "valueOff": "false", - "label": "Longer label to verify label wrapping for an Input.Toggle. If that was not long enough, then this should make it long enough. Did you know octopuses have three hearts?" - } ], "actions": [ { diff --git a/samples/v1.3/Elements/InputBehaviour.json b/samples/v1.3/Elements/InputBehaviour.json deleted file mode 100644 index 3e9202d438..0000000000 --- a/samples/v1.3/Elements/InputBehaviour.json +++ /dev/null @@ -1,144 +0,0 @@ -{ - "type": "AdaptiveCard", - "$schema": "http://adaptivecards.io/schemas/adaptive-card.json", - "version": "1.2", - "body": [ - { - "type": "TextBlock", - "text": "Card A", - "size": "extraLarge" - }, - { - "type": "TextBlock", - "text": "If you click the Sumit button in this card you'll retrieve **input1** and **input2**", - "wrap": true - }, - { - "type": "Input.Text", - "label": "Input1", - "id": "input1" - }, - { - "type": "Input.Text", - "label": "Input2", - "id": "input2" - } - ], - "actions": [ - { - "type": "Action.Submit", - "title": "Submit" - }, - { - "type": "Action.ShowCard", - "title": "Show Card B", - "card": { - "type": "AdaptiveCard", - "$schema": "http://adaptivecards.io/schemas/adaptive-card.json", - "version": "1.2", - "body": [ - { - "type": "TextBlock", - "text": "Card B", - "size": "extraLarge" - }, - { - "type": "TextBlock", - "text": "If you click the Sumit button in this card you'll retrieve **input3**, **input4**, **input1** and **input2**", - "wrap": true - }, - { - "type": "Input.Text", - "label": "Input3", - "id": "input3" - }, - { - "type": "Input.Text", - "label": "Input4", - "id": "input4" - } - ], - "actions": [ - { - "type": "Action.Submit", - "title": "Submit" - } - ] - } - }, - { - "type": "Action.ShowCard", - "title": "Show Card C", - "card": { - "type": "AdaptiveCard", - "$schema": "http://adaptivecards.io/schemas/adaptive-card.json", - "version": "1.2", - "body": [ - { - "type": "TextBlock", - "text": "Card C", - "size": "extraLarge" - }, - { - "type": "TextBlock", - "text": "If you click the Sumit button in this card you'll retrieve **input5**, **input6**, **input1** and **input2**", - "wrap": true - }, - { - "type": "Input.Text", - "label": "Input5", - "id": "input5" - }, - { - "type": "Input.Text", - "label": "Input6", - "id": "input6" - } - ], - "actions": [ - { - "type": "Action.Submit", - "title": "Submit" - }, - { - "type": "Action.ShowCard", - "title": "Show Card D", - "card": { - "type": "AdaptiveCard", - "$schema": "http://adaptivecards.io/schemas/adaptive-card.json", - "version": "1.2", - "body": [ - { - "type": "TextBlock", - "text": "Card D", - "size": "extraLarge" - }, - { - "type": "TextBlock", - "text": "If you click the Sumit button in this card you'll retrieve **input7**, **input8**, **input5**, **input6**, **input1** and **input2**", - "wrap": true - }, - { - "type": "Input.Text", - "label": "Input7", - "id": "input7" - }, - { - "type": "Input.Text", - "label": "Input8", - "id": "input8" - } - ], - "actions": [ - { - "type": "Action.Submit", - "title": "Submit" - } - ] - } - } - ] - } - } - ] -} \ No newline at end of file diff --git a/samples/v1.3/Scenarios/Inputs (v1.3).json b/samples/v1.3/Scenarios/Inputs (v1.3).json new file mode 100644 index 0000000000..092a018b87 --- /dev/null +++ b/samples/v1.3/Scenarios/Inputs (v1.3).json @@ -0,0 +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", "label": "Name", "style": "text", "id": "SimpleVal", "isRequired": true, "errorMessage": "Name is required" }, { "type": "Input.Text", "label": "Homepage", "style": "url", "id": "UrlVal" }, { "type": "Input.Text", "label": "Email", "style": "email", "id": "EmailVal" }, { "type": "Input.Text", "label": "Phone", "style": "tel", "id": "TelVal" }, { "type": "Input.Text", "label": "Comments", "style": "text", "isMultiline": true, "id": "MultiLineVal" }, { "type": "Input.Number", "label": "Quantity", "min": -5, "max": 5, "value": 1, "id": "NumVal", "errorMessage": "The quantity must be between -5 and 5" }, { "type": "Input.Date", "label": "Due Date", "id": "DateVal", "value": "2017-09-20" }, { "type": "Input.Time", "label": "Start time", "id": "TimeVal", "value": "16:59" }, { "type": "TextBlock", "size": "medium", "weight": "bolder", "text": "Input.ChoiceSet", "horizontalAlignment": "center" }, { "type": "Input.ChoiceSet", "id": "CompactSelectVal", "label": "What color do you want? (compact)", "style": "compact", "value": "1", "choices": [ { "title": "Red", "value": "1" }, { "title": "Green", "value": "2" }, { "title": "Blue", "value": "3" } ] }, { "type": "Input.ChoiceSet", "id": "SingleSelectVal", "label": "What color do you want? (expanded)", "style": "expanded", "value": "1", "choices": [ { "title": "Red", "value": "1" }, { "title": "Green", "value": "2" }, { "title": "Blue", "value": "3" } ] }, { "type": "Input.ChoiceSet", "id": "MultiSelectVal", "label": "What colors do you want? (multiselect)", "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", "label": "Please accept the terms and conditions:", "title": "I accept the terms and conditions (True/False)", "valueOn": "true", "valueOff": "false", "id": "AcceptsTerms", "isRequired": true, "errorMessage": "Accepting the terms and conditions is required" }, { "type": "Input.Toggle", "label": "How do you feel about red cars?", "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", "label": "enter comment", "style": "text", "id": "CommentVal" } ], "actions": [ { "type": "Action.Submit", "title": "OK" } ] } } ] } \ No newline at end of file diff --git a/samples/v1.3/Elements/Input.Text.InlineAction.ErrorMessage.json b/samples/v1.3/Tests/Input.Text.InlineAction.ErrorMessage.json similarity index 100% rename from samples/v1.3/Elements/Input.Text.InlineAction.ErrorMessage.json rename to samples/v1.3/Tests/Input.Text.InlineAction.ErrorMessage.json diff --git a/samples/v1.3/Elements/Input.Text.InlineAction.Label.json b/samples/v1.3/Tests/Input.Text.InlineAction.Label.json similarity index 65% rename from samples/v1.3/Elements/Input.Text.InlineAction.Label.json rename to samples/v1.3/Tests/Input.Text.InlineAction.Label.json index c2ec54d7ee..ff0657b9ed 100644 --- a/samples/v1.3/Elements/Input.Text.InlineAction.Label.json +++ b/samples/v1.3/Tests/Input.Text.InlineAction.Label.json @@ -24,17 +24,6 @@ "iconUrl": "http://adaptivecards.io/content/cats/1.png", "title": "Inline Action" } - }, - { - "type": "Input.Text", - "id": "input3", - "style": "text", - "label": "Longer label to verify label wrapping for an Input.Text. If that was not long enough, then this should make it long enough. Did you know that wild dolphins call each other by name?", - "inlineAction": { - "type": "Action.Submit", - "iconUrl": "http://adaptivecards.io/content/cats/1.png", - "title": "Inline Action" - } } ], "actions": [ diff --git a/samples/v1.3/Tests/InputBehaviour.json b/samples/v1.3/Tests/InputBehaviour.json new file mode 100644 index 0000000000..9a2fd0df49 --- /dev/null +++ b/samples/v1.3/Tests/InputBehaviour.json @@ -0,0 +1,144 @@ +{ + "type": "AdaptiveCard", + "$schema": "http://adaptivecards.io/schemas/adaptive-card.json", + "version": "1.2", + "body": [ + { + "type": "TextBlock", + "text": "Card A", + "size": "extraLarge" + }, + { + "type": "TextBlock", + "text": "If you click the Sumit button in this card you'll retrieve **input1** and **input2**", + "wrap": true + }, + { + "type": "Input.Text", + "label": "Input1", + "id": "input1" + }, + { + "type": "Input.Text", + "label": "Input2", + "id": "input2" + } + ], + "actions": [ + { + "type": "Action.Submit", + "title": "Submit" + }, + { + "type": "Action.ShowCard", + "title": "Show Card B", + "card": { + "type": "AdaptiveCard", + "$schema": "http://adaptivecards.io/schemas/adaptive-card.json", + "version": "1.2", + "body": [ + { + "type": "TextBlock", + "text": "Card B", + "size": "extraLarge" + }, + { + "type": "TextBlock", + "text": "If you click the Sumit button in this card you'll retrieve **input3**, **input4**, **input1** and **input2**", + "wrap": true + }, + { + "type": "Input.Text", + "label": "Input3", + "id": "input3" + }, + { + "type": "Input.Text", + "label": "Input4", + "id": "input4" + } + ], + "actions": [ + { + "type": "Action.Submit", + "title": "Submit" + } + ] + } + }, + { + "type": "Action.ShowCard", + "title": "Show Card C", + "card": { + "type": "AdaptiveCard", + "$schema": "http://adaptivecards.io/schemas/adaptive-card.json", + "version": "1.2", + "body": [ + { + "type": "TextBlock", + "text": "Card C", + "size": "extraLarge" + }, + { + "type": "TextBlock", + "text": "If you click the Sumit button in this card you'll retrieve **input5**, **input6**, **input1** and **input2**", + "wrap": true + }, + { + "type": "Input.Text", + "label": "Input5", + "id": "input5" + }, + { + "type": "Input.Text", + "label": "Input6", + "id": "input6" + } + ], + "actions": [ + { + "type": "Action.Submit", + "title": "Submit" + }, + { + "type": "Action.ShowCard", + "title": "Show Card D", + "card": { + "type": "AdaptiveCard", + "$schema": "http://adaptivecards.io/schemas/adaptive-card.json", + "version": "1.2", + "body": [ + { + "type": "TextBlock", + "text": "Card D", + "size": "extraLarge" + }, + { + "type": "TextBlock", + "text": "If you click the Sumit button in this card you'll retrieve **input7**, **input8**, **input5**, **input6**, **input1** and **input2**", + "wrap": true + }, + { + "type": "Input.Text", + "label": "Input7", + "id": "input7" + }, + { + "type": "Input.Text", + "label": "Input8", + "id": "input8" + } + ], + "actions": [ + { + "type": "Action.Submit", + "title": "Submit" + } + ] + } + } + ] + } + } + ] +} diff --git a/samples/v1.3/Tests/LongLabels.json b/samples/v1.3/Tests/LongLabels.json new file mode 100644 index 0000000000..fea1084ea6 --- /dev/null +++ b/samples/v1.3/Tests/LongLabels.json @@ -0,0 +1 @@ +{ "$schema": "http://adaptivecards.io/schemas/adaptive-card.json", "type": "AdaptiveCard", "version": "1.0", "body": [ { "type": "Input.ChoiceSet", "id": "choiceSet", "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" } ] }, { "type": "Input.Toggle", "id": "toggle", "title": "I accept the terms and agreements", "value": "false", "valueOn": "true", "valueOff": "false", "label": "Longer label to verify label wrapping for an Input.Toggle. If that was not long enough, then this should make it long enough. Did you know octopuses have three hearts?" }, { "type": "Input.Time", "id": "time", "label": "Longer label to verify label wrapping for an Input.Time. If that was not long enough, then this should make it long enough. Did you know bats always turn left when leaving a cave?" }, { "type": "Input.Text", "id": "text", "style": "text", "label": "Longer label to verify label wrapping for an Input.Text. If that was not long enough, then this should make it long enough. Did you know that elephants are the only animal that cannot jump?" }, { "type": "Input.Text", "id": "textWithInline", "style": "text", "label": "Longer label to verify label wrapping for an Input.Text. If that was not long enough, then this should make it long enough. Did you know that wild dolphins call each other by name?", "inlineAction": { "type": "Action.Submit", "iconUrl": "http://adaptivecards.io/content/cats/1.png", "title": "Inline Action" } }, { "type": "Input.Number", "id": "number", "label": "Longer label to verify label wrapping for an Input.Number. If that was not long enough, then this should make it long enough. Did you know that slugs have four noses?" }, { "type": "Input.Date", "id": "date", "label": "Longer label to verify label wrapping for an Input.Date. If that was not long enough, then this should make it long enough. Did you know a snail can sleep for three years?" } ], "actions": [ { "type": "Action.Submit", "title": "OK" } ] } \ No newline at end of file diff --git a/source/uwp/Visualizer/AdaptiveCardVisualizer.csproj b/source/uwp/Visualizer/AdaptiveCardVisualizer.csproj index 0c61a8727e..4fcf9d590d 100644 --- a/source/uwp/Visualizer/AdaptiveCardVisualizer.csproj +++ b/source/uwp/Visualizer/AdaptiveCardVisualizer.csproj @@ -76,7 +76,16 @@ Designer - + + Samples\%(Filename).json + + + Samples\%(Filename).json + + + Samples\%(Filename).json + + Samples\%(Filename).json diff --git a/source/uwp/Visualizer/HostConfigs/DefaultHostConfig.json b/source/uwp/Visualizer/HostConfigs/DefaultHostConfig.json index f2d0f618f2..11ac085027 100644 --- a/source/uwp/Visualizer/HostConfigs/DefaultHostConfig.json +++ b/source/uwp/Visualizer/HostConfigs/DefaultHostConfig.json @@ -275,13 +275,9 @@ "label": { "inputSpacing": "small", "requiredInputs": { - "suffix": " *", - "weight": "bolder", - "color": "attention", - "size": "medium" + "suffix": " *" }, "optionalInputs": { - "color": "good", "isSubtle": true, "weight": "lighter" } diff --git a/source/uwp/Visualizer/MainPage.xaml b/source/uwp/Visualizer/MainPage.xaml index 3035f3c18c..82312be3f5 100644 --- a/source/uwp/Visualizer/MainPage.xaml +++ b/source/uwp/Visualizer/MainPage.xaml @@ -59,7 +59,7 @@ - +