From 0b819275e04f5fa7f5d57baa124cbffd46b3aa09 Mon Sep 17 00:00:00 2001 From: "J.P. Roca" Date: Fri, 24 Sep 2021 19:46:47 -0700 Subject: [PATCH 01/12] Changed teams target version to 1.4 --- .../src/containers/teams/teams-container.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/nodejs/adaptivecards-designer/src/containers/teams/teams-container.ts b/source/nodejs/adaptivecards-designer/src/containers/teams/teams-container.ts index 6ed673b919..5ce2b2fdad 100644 --- a/source/nodejs/adaptivecards-designer/src/containers/teams/teams-container.ts +++ b/source/nodejs/adaptivecards-designer/src/containers/teams/teams-container.ts @@ -43,7 +43,7 @@ abstract class BaseTeamsContainer extends HostContainer { } get targetVersion(): Adaptive.Version { - return Adaptive.Versions.v1_2; + return Adaptive.Versions.v1_4; } } From 515b92a84b72fab7bd06a0450b7294a7e5c61ae0 Mon Sep 17 00:00:00 2001 From: "J.P. Roca" Date: Fri, 12 Nov 2021 07:43:33 -0800 Subject: [PATCH 02/12] added RTL scenario card --- .../Scenarios/InputFormWithRTL.data.json | 6 + .../Scenarios/InputFormWithRTL.template.json | 116 ++++++++++++++++++ 2 files changed, 122 insertions(+) create mode 100644 samples/Templates/Scenarios/InputFormWithRTL.data.json create mode 100644 samples/Templates/Scenarios/InputFormWithRTL.template.json diff --git a/samples/Templates/Scenarios/InputFormWithRTL.data.json b/samples/Templates/Scenarios/InputFormWithRTL.data.json new file mode 100644 index 0000000000..b51e425de5 --- /dev/null +++ b/samples/Templates/Scenarios/InputFormWithRTL.data.json @@ -0,0 +1,6 @@ +{ + "FormInfo":{ + "titleENG":"Registration Form", + "titleARA":"إستمارة تسجيل" + } +} diff --git a/samples/Templates/Scenarios/InputFormWithRTL.template.json b/samples/Templates/Scenarios/InputFormWithRTL.template.json new file mode 100644 index 0000000000..8512300b24 --- /dev/null +++ b/samples/Templates/Scenarios/InputFormWithRTL.template.json @@ -0,0 +1,116 @@ +{ + "$schema": "http://adaptivecards.io/schemas/adaptive-card.json", + "type": "AdaptiveCard", + "version": "1.5", + "body": [ + { + "type": "TextBlock", + "text": "Please select your language:" + } + ], + "actions": [ + { + "type": "Action.ShowCard", + "title": "English", + "card": { + "type": "AdaptiveCard", + "body": [ + { + "type": "TextBlock", + "size": "medium", + "weight": "bolder", + "text": " ${FormInfo.titleENG}", + "horizontalAlignment": "center", + "wrap": true, + "style": "heading" + }, + { + "type": "Input.Text", + "label": "Name", + "style": "text", + "id": "SimpleVal", + "isRequired": true, + "errorMessage": "Name is required" + }, + { + "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" + } + ], + "actions": [ + { + "type": "Action.Submit", + "title": "Submit" + } + ] + } + }, + { + "type": "Action.ShowCard", + "title": "عربي", + "card": { + "type": "AdaptiveCard", + "rtl": true, + "body": [ + { + "type": "TextBlock", + "size": "medium", + "weight": "bolder", + "text": " ${FormInfo.titleARA}", + "horizontalAlignment": "center", + "wrap": true, + "style": "heading" + }, + { + "type": "Input.Text", + "label": "اسم", + "style": "text", + "id": "SimpleVal", + "isRequired": true, + "errorMessage": "مطلوب اسم" + }, + { + "type": "Input.Text", + "label": "بريد الالكتروني", + "style": "email", + "id": "EmailVal" + }, + { + "type": "Input.Text", + "label": "هاتف", + "style": "tel", + "id": "TelVal" + }, + { + "type": "Input.Text", + "label": "تعليقات", + "style": "text", + "isMultiline": true, + "id": "MultiLineVal" + } + ], + "actions": [ + { + "type": "Action.Submit", + "title": "يقدم" + } + ] + } + } + ] +} \ No newline at end of file From deccdca47fcb3aced2056ac1feb940217efe068f Mon Sep 17 00:00:00 2001 From: "J.P. Roca" Date: Fri, 12 Nov 2021 07:58:08 -0800 Subject: [PATCH 03/12] Added scenario card for tooltip and isEnabled --- .../Scenarios/OrderDelivery.data.json | 18 +++++ .../Scenarios/OrderDelivery.template.json | 70 +++++++++++++++++++ 2 files changed, 88 insertions(+) create mode 100644 samples/Templates/Scenarios/OrderDelivery.data.json create mode 100644 samples/Templates/Scenarios/OrderDelivery.template.json diff --git a/samples/Templates/Scenarios/OrderDelivery.data.json b/samples/Templates/Scenarios/OrderDelivery.data.json new file mode 100644 index 0000000000..057b2deee9 --- /dev/null +++ b/samples/Templates/Scenarios/OrderDelivery.data.json @@ -0,0 +1,18 @@ +{ + "name": "Malt \u0026 Vine", + "address": { + "addressLocality": "Redmond", + "addressRegion": "WA", + "streetAddress": "16851 Redmond Way", + "postalCode": "98052", + "addressCountry": "US" + }, + "review": [{ + "reviewRating": { + "ratingValue": 4 + }, + "datePublished": "2014-11-28", + "description": "Great concept and a wide selection of beers both on tap and bottled! Smaller wine selection than I wanted, but the variety of beers certainly made up for that. Although I didn't order anything, my boyfriend got a beer and he loved it. Their prices are fair too. \n\nThe concept is really awesome. It's a bar/store that you can bring outside food into. The place was pretty packed tonight. I wish we had stayed for more than one drink. I would have loved to sample everything!", + "author": "Blaire S." + }] +} \ No newline at end of file diff --git a/samples/Templates/Scenarios/OrderDelivery.template.json b/samples/Templates/Scenarios/OrderDelivery.template.json new file mode 100644 index 0000000000..31cc1778e1 --- /dev/null +++ b/samples/Templates/Scenarios/OrderDelivery.template.json @@ -0,0 +1,70 @@ +{ + "$schema": "http://adaptivecards.io/schemas/adaptive-card.json", + "type": "AdaptiveCard", + "version": "1.5", + "body": [ + { + "type": "ColumnSet", + "columns": [ + { + "type": "Column", + "width": 2, + "items": [ + { + "type": "TextBlock", + "text": "${address.addressLocality}, ${address.addressRegion}", + "wrap": true + }, + { + "type": "TextBlock", + "text": "${name}", + "weight": "bolder", + "size": "extraLarge", + "spacing": "none", + "wrap": true + }, + { + "type": "TextBlock", + "text": "4.5 stars (176 reviews) · mid-priced", + "isSubtle": true, + "spacing": "none", + "wrap": true + }, + { + "type": "TextBlock", + "text": "**${review[0].author}** said \"${review[0].description}\"", + "size": "small", + "wrap": true, + "maxLines": 3 + } + ] + }, + { + "type": "Column", + "width": 1, + "items": [ + { + "type": "Image", + "url": "https://picsum.photos/300?image=882", + "size": "auto", + "altText": "Seated guest drinking a cup of coffee" + } + ] + } + ] + } + ], + "actions": [ + { + "type": "Action.Submit", + "title": "Pickup", + "tooltip": "Schedule order for pickup" + }, + { + "type": "Action.Submit", + "title": "Delivery", + "isEnabled": "false", + "tooltip": "Your location is too far for delivery" + } + ] +} From 30c7eb27dc22ca68c9ac509c9e578de7d957e061 Mon Sep 17 00:00:00 2001 From: "J.P. Roca" Date: Fri, 12 Nov 2021 08:11:22 -0800 Subject: [PATCH 04/12] Added order confirmation scenario --- .../Scenarios/OrderConfirmation.data.json | 9 +++ .../Scenarios/OrderConfirmation.template.json | 68 +++++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100644 samples/Templates/Scenarios/OrderConfirmation.data.json create mode 100644 samples/Templates/Scenarios/OrderConfirmation.template.json diff --git a/samples/Templates/Scenarios/OrderConfirmation.data.json b/samples/Templates/Scenarios/OrderConfirmation.data.json new file mode 100644 index 0000000000..4b7e4ef7d7 --- /dev/null +++ b/samples/Templates/Scenarios/OrderConfirmation.data.json @@ -0,0 +1,9 @@ +{ + "title": "Please confirm your order:", + "customer": [{ + "firstName": "John", + "lastName": "Smith", + "phone": "(555) 555-5555" + } + ] +} \ No newline at end of file diff --git a/samples/Templates/Scenarios/OrderConfirmation.template.json b/samples/Templates/Scenarios/OrderConfirmation.template.json new file mode 100644 index 0000000000..f96f961908 --- /dev/null +++ b/samples/Templates/Scenarios/OrderConfirmation.template.json @@ -0,0 +1,68 @@ +{ + "type": "AdaptiveCard", + "$schema": "http://adaptivecards.io/schemas/adaptive-card.json", + "version": "1.5", + "body": [ + { + "type": "TextBlock", + "text": "${title}", + "wrap": true, + "style": "heading" + }, + { + "type": "FactSet", + "facts": [ + { + "title": "Name", + "value": "${customer[0].firstName} ${customer[0].lastName}" + }, + { + "title": "Phone number", + "value": "${customer[0].phone}" + } + ] + }, + { + "type": "Container", + "items": [ + { + "type": "FactSet", + "facts": [ + { + "title": "1x", + "value": "Steak" + }, + { + "title": "2x", + "value": "Side Rice" + }, + { + "title": "1x", + "value": "Soft Drink" + } + ], + "spacing": "Small" + } + ], + "spacing": "Small" + } + ], + "actions": [ + { + "type": "Action.Execute", + "title": "Place Order" + }, + { + "type": "Action.Execute", + "title": "Edit Order", + "data": "edit", + "mode": "secondary" + }, + { + "type": "Action.Execute", + "title": "Save Order", + "data": "save", + "mode": "secondary" + } + ] +} From 3a2dbbfd2b05ee60e3c5f984c7cf58d29cea7d64 Mon Sep 17 00:00:00 2001 From: "J.P. Roca" Date: Fri, 12 Nov 2021 08:15:05 -0800 Subject: [PATCH 05/12] Added flight update table scenario --- .../Scenarios/FlightUpdateTable.data.json | 40 +++ .../Scenarios/FlightUpdateTable.template.json | 261 ++++++++++++++++++ 2 files changed, 301 insertions(+) create mode 100644 samples/Templates/Scenarios/FlightUpdateTable.data.json create mode 100644 samples/Templates/Scenarios/FlightUpdateTable.template.json diff --git a/samples/Templates/Scenarios/FlightUpdateTable.data.json b/samples/Templates/Scenarios/FlightUpdateTable.data.json new file mode 100644 index 0000000000..ec41d2bb08 --- /dev/null +++ b/samples/Templates/Scenarios/FlightUpdateTable.data.json @@ -0,0 +1,40 @@ +{ + "@context": "http://schema.org", + "@type": "FlightReservation", + "reservationId": "RXJ34P", + "reservationStatus": "http://schema.org/ReservationConfirmed", + "passengerPriorityStatus": "Fast Track", + "passengerSequenceNumber": "ABC123", + "securityScreening": "TSA PreCheck", + "underName": { + "@type": "Person", + "name": "Sarah Hum" + }, + "reservationFor": { + "@type": "Flight", + "flightNumber": "KL605", + "provider": { + "@type": "Airline", + "name": "KLM", + "iataCode": "KL", + "boardingPolicy": "http://schema.org/ZoneBoardingPolicy" + }, + "seller": { + "@type": "Airline", + "name": "KLM", + "iataCode": "KL" + }, + "departureAirport": { + "@type": "Airport", + "name": "Amsterdam Airport", + "iataCode": "AMS" + }, + "departureTime": "2017-03-04T09:20:00-01:00", + "arrivalAirport": { + "@type": "Airport", + "name": "San Francisco Airport", + "iataCode": "SFO" + }, + "arrivalTime": "2017-03-05T08:20:00+04:00" + } + } \ No newline at end of file diff --git a/samples/Templates/Scenarios/FlightUpdateTable.template.json b/samples/Templates/Scenarios/FlightUpdateTable.template.json new file mode 100644 index 0000000000..23f9d50199 --- /dev/null +++ b/samples/Templates/Scenarios/FlightUpdateTable.template.json @@ -0,0 +1,261 @@ +{ + "type": "AdaptiveCard", + "$schema": "http://adaptivecards.io/schemas/adaptive-card.json", + "version": "1.5", + "body": [ + { + "type": "Table", + "columns": [ + { + "width": 1 + }, + { + "width": 1 + }, + { + "width": 1 + } + ], + "rows": [ + { + "type": "TableRow", + "cells": [ + { + "type": "TableCell", + "items": [ + { + "type": "Image", + "size": "Small", + "url": "https://adaptivecards.io/content/airplane.png" + } + ] + }, + { + "type": "TableCell" + }, + { + "type": "TableCell", + "items": [ + { + "type": "TextBlock", + "text": "Flight Status", + "horizontalAlignment": "Right", + "isSubtle": true, + "wrap": true + }, + { + "type": "TextBlock", + "text": "DELAYED", + "horizontalAlignment": "Right", + "spacing": "None", + "size": "Large", + "color": "Attention", + "wrap": true + } + ] + } + ] + }, + { + "type": "TableRow", + "cells": [ + { + "type": "TableCell", + "items": [ + { + "type": "TextBlock", + "text": "Passengers", + "isSubtle": true, + "weight": "Bolder", + "wrap": true, + "spacing": "None" + }, + { + "type": "TextBlock", + "text": "${underName.name}", + "spacing": "Small", + "wrap": true + }, + { + "type": "TextBlock", + "text": "Jeremy Goldberg", + "spacing": "Small", + "wrap": true + }, + { + "type": "TextBlock", + "text": "Evan Litvak", + "spacing": "Small", + "wrap": true + } + ] + }, + { + "type": "TableCell" + }, + { + "type": "TableCell", + "items": [ + { + "type": "TextBlock", + "text": "Seat", + "horizontalAlignment": "Right", + "isSubtle": true, + "weight": "Bolder", + "wrap": true + }, + { + "type": "TextBlock", + "text": "14A", + "horizontalAlignment": "Right", + "spacing": "Small", + "wrap": true + }, + { + "type": "TextBlock", + "text": "14B", + "horizontalAlignment": "Right", + "spacing": "Small", + "wrap": true + }, + { + "type": "TextBlock", + "text": "14C", + "horizontalAlignment": "Right", + "spacing": "Small", + "wrap": true + } + ] + } + ] + }, + { + "type": "TableRow", + "cells": [ + { + "type": "TableCell", + "items": [ + { + "type": "TextBlock", + "text": "Flight", + "isSubtle": true, + "weight": "Bolder", + "wrap": true + }, + { + "type": "TextBlock", + "text": "${reservationFor.flightNumber}", + "spacing": "Small", + "wrap": true + } + ] + }, + { + "type": "TableCell", + "items": [ + { + "type": "TextBlock", + "text": "Departs", + "isSubtle": true, + "horizontalAlignment": "Center", + "weight": "Bolder", + "wrap": true + }, + { + "type": "TextBlock", + "text": "{{TIME(${string(reservationFor.departureTime)})}}", + "color": "Attention", + "weight": "Bolder", + "horizontalAlignment": "Center", + "spacing": "Small", + "wrap": true + } + ] + }, + { + "type": "TableCell", + "items": [ + { + "type": "TextBlock", + "text": "Arrives", + "isSubtle": true, + "horizontalAlignment": "Right", + "weight": "Bolder", + "wrap": true + }, + { + "type": "TextBlock", + "text": "{{TIME(${string(reservationFor.arrivalTime)})}}", + "color": "Attention", + "horizontalAlignment": "Right", + "weight": "Bolder", + "spacing": "Small", + "wrap": true + } + ] + } + ] + }, + { + "type": "TableRow", + "cells": [ + { + "type": "TableCell", + "items": [ + { + "type": "TextBlock", + "text": "${reservationFor.departureAirport.name}", + "isSubtle": true, + "wrap": true + }, + { + "type": "TextBlock", + "text": "${reservationFor.departureAirport.iataCode}", + "size": "ExtraLarge", + "color": "Accent", + "spacing": "None", + "wrap": true + } + ] + }, + { + "type": "TableCell", + "items": [ + { + "type": "Image", + "url": "https://adaptivecards.io/content/airplane.png", + "horizontalAlignment": "Center", + "size": "Small" + } + ], + "verticalContentAlignment": "Center" + }, + { + "type": "TableCell", + "items": [ + { + "type": "TextBlock", + "text": "${reservationFor.arrivalAirport.name}", + "isSubtle": true, + "horizontalAlignment": "Right", + "wrap": true + }, + { + "type": "TextBlock", + "text": "${reservationFor.arrivalAirport.iataCode}", + "horizontalAlignment": "Right", + "size": "ExtraLarge", + "color": "Accent", + "spacing": "None", + "wrap": true + } + ] + } + ], + "spacing": "None" + } + ], + "showGridLines": false + } + ] +} From 335e9ec140745805dee78e1e0ee2b0afd1cf7be0 Mon Sep 17 00:00:00 2001 From: "J.P. Roca" Date: Fri, 12 Nov 2021 08:18:42 -0800 Subject: [PATCH 06/12] Added restaurant order scenario card --- .../Scenarios/RestaurantOrder.data.json | 76 +++++++++++++++++++ .../Scenarios/RestaurantOrder.template.json | 68 +++++++++++++++++ 2 files changed, 144 insertions(+) create mode 100644 samples/Templates/Scenarios/RestaurantOrder.data.json create mode 100644 samples/Templates/Scenarios/RestaurantOrder.template.json diff --git a/samples/Templates/Scenarios/RestaurantOrder.data.json b/samples/Templates/Scenarios/RestaurantOrder.data.json new file mode 100644 index 0000000000..b7510ccbb9 --- /dev/null +++ b/samples/Templates/Scenarios/RestaurantOrder.data.json @@ -0,0 +1,76 @@ +{ + "FormInfo": { + "title": "Malt & Vine Order Form" + }, + "Order": { + "questions": [ + { + "question": "Which entree would you like?", + "items": [ + { + "choice": "Steak", + "value": "1" + }, + { + "choice": "Chicken", + "value": "2" + }, + { + "choice": "Tofu", + "value": "3" + } + ] + }, + { + "question": "Which side would you like?", + "items": [ + { + "choice": "Baked Potato", + "value": "1" + }, + { + "choice": "Rice", + "value": "2" + }, + { + "choice": "Vegetables", + "value": "3" + }, + { + "choice": "Noodles", + "value": "4" + }, + { + "choice": "No Side", + "value": "5" + } + ] + }, + { + "question": "Which drink would you like?", + "items": [ + { + "choice": "Water", + "value": "1" + }, + { + "choice": "Soft Drink", + "value": "2" + }, + { + "choice": "Coffee", + "value": "3" + }, + { + "choice": "Natural Juice", + "value": "4" + }, + { + "choice": "No Drink", + "value": "5" + } + ] + } + ] + } +} diff --git a/samples/Templates/Scenarios/RestaurantOrder.template.json b/samples/Templates/Scenarios/RestaurantOrder.template.json new file mode 100644 index 0000000000..88a41ff09b --- /dev/null +++ b/samples/Templates/Scenarios/RestaurantOrder.template.json @@ -0,0 +1,68 @@ +{ + "type": "AdaptiveCard", + "$schema": "http://adaptivecards.io/schemas/adaptive-card.json", + "version": "1.5", + "body": [ + { + "type": "TextBlock", + "text": "${FormInfo.title}", + "size": "Large", + "wrap": true, + "weight": "Bolder" + }, + { + "type": "Input.ChoiceSet", + "id": "EntreeSelectVal", + "label": "${Order.questions[0].question}", + "style": "filtered", + "isRequired": true, + "errorMessage": "This is a required input", + "placeholder": "Please choose", + "choices": [ + { + "$data": "${Order.questions[0].items}", + "title": "${choice}", + "value": "${value}" + } + ] + }, + { + "type": "Input.ChoiceSet", + "id": "SideVal", + "label": "${Order.questions[1].question}", + "style": "filtered", + "isRequired": true, + "errorMessage": "This is a required input", + "placeholder": "Please choose", + "choices": [ + { + "$data": "${Order.questions[1].items}", + "title": "${choice}", + "value": "${value}" + } + ] + }, + { + "type": "Input.ChoiceSet", + "id": "DrinkVal", + "label": "${Order.questions[2].question}", + "style": "filtered", + "isRequired": true, + "errorMessage": "This is a required input", + "placeholder": "Please choose", + "choices": [ + { + "$data": "${Order.questions[2].items}", + "title": "${choice}", + "value": "${value}" + } + ] + } + ], + "actions": [ + { + "type": "Action.Submit", + "title": "Place Order" + } + ] +} From f76e43dee8fb99f2b0cfec301c67fb76fd97160a Mon Sep 17 00:00:00 2001 From: "J.P. Roca" Date: Fri, 12 Nov 2021 08:25:12 -0800 Subject: [PATCH 07/12] Added app login scenario --- .../Scenarios/ApplicationLogin.data.json | 5 ++ .../Scenarios/ApplicationLogin.template.json | 47 +++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 samples/Templates/Scenarios/ApplicationLogin.data.json create mode 100644 samples/Templates/Scenarios/ApplicationLogin.template.json diff --git a/samples/Templates/Scenarios/ApplicationLogin.data.json b/samples/Templates/Scenarios/ApplicationLogin.data.json new file mode 100644 index 0000000000..656696940d --- /dev/null +++ b/samples/Templates/Scenarios/ApplicationLogin.data.json @@ -0,0 +1,5 @@ +{ + "ApplicationInfo": { + "title": "Application Login" + } +} \ No newline at end of file diff --git a/samples/Templates/Scenarios/ApplicationLogin.template.json b/samples/Templates/Scenarios/ApplicationLogin.template.json new file mode 100644 index 0000000000..171f17fa14 --- /dev/null +++ b/samples/Templates/Scenarios/ApplicationLogin.template.json @@ -0,0 +1,47 @@ +{ + "$schema": "http://adaptivecards.io/schemas/adaptive-card.json", + "type": "AdaptiveCard", + "version": "1.5", + "body": [ + { + "type": "TextBlock", + "size": "Medium", + "weight": "Bolder", + "text": " ${ApplicationInfo.title}", + "horizontalAlignment": "Center", + "wrap": true, + "style": "heading" + }, + { + "type": "TextBlock", + "text": "Username", + "wrap": true + }, + { + "type": "Input.Text", + "style": "text", + "id": "UserVal", + "isRequired": true + }, + { + "type": "TextBlock", + "text": "Password", + "wrap": true + }, + { + "type": "Input.Text", + "id": "PassVal", + "style": "password", + "isRequired": true + } + ], + "actions": [ + { + "type": "Action.Submit", + "title": "Login", + "data": { + "id": "LoginVal" + } + } + ] +} \ No newline at end of file From fd4f0fccf57c9d968232335e35f235b124994289 Mon Sep 17 00:00:00 2001 From: "J.P. Roca" Date: Fri, 12 Nov 2021 08:30:04 -0800 Subject: [PATCH 08/12] Fixed indentation in schema explorer --- .../themes/adaptivecards/source/css/style.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/nodejs/adaptivecards-site/themes/adaptivecards/source/css/style.css b/source/nodejs/adaptivecards-site/themes/adaptivecards/source/css/style.css index a35f7254de..182cedb6eb 100644 --- a/source/nodejs/adaptivecards-site/themes/adaptivecards/source/css/style.css +++ b/source/nodejs/adaptivecards-site/themes/adaptivecards/source/css/style.css @@ -320,7 +320,7 @@ ul.action-list { .toc-todo li, .toc-todo a { - padding-left: 30px; + padding-left: 15px; padding-top: 3px; padding-bottom: 3px; margin: 0; From b3c84fb9e16363b8170537a6fa5fd0d5d4d7bc14 Mon Sep 17 00:00:00 2001 From: "J.P. Roca" Date: Fri, 12 Nov 2021 10:20:22 -0800 Subject: [PATCH 09/12] Testing application login on the samples page --- samples/v1.5/Scenarios/ApplicationLogin.json | 47 ++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 samples/v1.5/Scenarios/ApplicationLogin.json diff --git a/samples/v1.5/Scenarios/ApplicationLogin.json b/samples/v1.5/Scenarios/ApplicationLogin.json new file mode 100644 index 0000000000..171f17fa14 --- /dev/null +++ b/samples/v1.5/Scenarios/ApplicationLogin.json @@ -0,0 +1,47 @@ +{ + "$schema": "http://adaptivecards.io/schemas/adaptive-card.json", + "type": "AdaptiveCard", + "version": "1.5", + "body": [ + { + "type": "TextBlock", + "size": "Medium", + "weight": "Bolder", + "text": " ${ApplicationInfo.title}", + "horizontalAlignment": "Center", + "wrap": true, + "style": "heading" + }, + { + "type": "TextBlock", + "text": "Username", + "wrap": true + }, + { + "type": "Input.Text", + "style": "text", + "id": "UserVal", + "isRequired": true + }, + { + "type": "TextBlock", + "text": "Password", + "wrap": true + }, + { + "type": "Input.Text", + "id": "PassVal", + "style": "password", + "isRequired": true + } + ], + "actions": [ + { + "type": "Action.Submit", + "title": "Login", + "data": { + "id": "LoginVal" + } + } + ] +} \ No newline at end of file From 5c99abdd2446b4dfd4defe36fd65c24f4c8b82a9 Mon Sep 17 00:00:00 2001 From: "J.P. Roca" Date: Fri, 12 Nov 2021 13:50:23 -0800 Subject: [PATCH 10/12] Added extended 1.5 scenario cards --- samples/v1.5/Scenarios/ApplicationLogin.json | 2 +- samples/v1.5/Scenarios/FlightUpdateTable.json | 261 ++++++++++++++++++ samples/v1.5/Scenarios/InputFormWithRTL.json | 116 ++++++++ samples/v1.5/Scenarios/OrderConfirmation.json | 68 +++++ samples/v1.5/Scenarios/OrderDelivery.json | 70 +++++ samples/v1.5/Scenarios/RestaurantOrder.json | 105 +++++++ 6 files changed, 621 insertions(+), 1 deletion(-) create mode 100644 samples/v1.5/Scenarios/FlightUpdateTable.json create mode 100644 samples/v1.5/Scenarios/InputFormWithRTL.json create mode 100644 samples/v1.5/Scenarios/OrderConfirmation.json create mode 100644 samples/v1.5/Scenarios/OrderDelivery.json create mode 100644 samples/v1.5/Scenarios/RestaurantOrder.json diff --git a/samples/v1.5/Scenarios/ApplicationLogin.json b/samples/v1.5/Scenarios/ApplicationLogin.json index 171f17fa14..cdd212e18c 100644 --- a/samples/v1.5/Scenarios/ApplicationLogin.json +++ b/samples/v1.5/Scenarios/ApplicationLogin.json @@ -7,7 +7,7 @@ "type": "TextBlock", "size": "Medium", "weight": "Bolder", - "text": " ${ApplicationInfo.title}", + "text": "Application Login", "horizontalAlignment": "Center", "wrap": true, "style": "heading" diff --git a/samples/v1.5/Scenarios/FlightUpdateTable.json b/samples/v1.5/Scenarios/FlightUpdateTable.json new file mode 100644 index 0000000000..6017a23ff3 --- /dev/null +++ b/samples/v1.5/Scenarios/FlightUpdateTable.json @@ -0,0 +1,261 @@ +{ + "type": "AdaptiveCard", + "$schema": "http://adaptivecards.io/schemas/adaptive-card.json", + "version": "1.5", + "body": [ + { + "type": "Table", + "columns": [ + { + "width": 1 + }, + { + "width": 1 + }, + { + "width": 1 + } + ], + "rows": [ + { + "type": "TableRow", + "cells": [ + { + "type": "TableCell", + "items": [ + { + "type": "Image", + "size": "Small", + "url": "https://adaptivecards.io/content/airplane.png" + } + ] + }, + { + "type": "TableCell" + }, + { + "type": "TableCell", + "items": [ + { + "type": "TextBlock", + "text": "Flight Status", + "horizontalAlignment": "Right", + "isSubtle": true, + "wrap": true + }, + { + "type": "TextBlock", + "text": "DELAYED", + "horizontalAlignment": "Right", + "spacing": "None", + "size": "Large", + "color": "Attention", + "wrap": true + } + ] + } + ] + }, + { + "type": "TableRow", + "cells": [ + { + "type": "TableCell", + "items": [ + { + "type": "TextBlock", + "text": "Passengers", + "isSubtle": true, + "weight": "Bolder", + "wrap": true, + "spacing": "None" + }, + { + "type": "TextBlock", + "text": "Sarah Hum", + "spacing": "Small", + "wrap": true + }, + { + "type": "TextBlock", + "text": "Jeremy Goldberg", + "spacing": "Small", + "wrap": true + }, + { + "type": "TextBlock", + "text": "Evan Litvak", + "spacing": "Small", + "wrap": true + } + ] + }, + { + "type": "TableCell" + }, + { + "type": "TableCell", + "items": [ + { + "type": "TextBlock", + "text": "Seat", + "horizontalAlignment": "Right", + "isSubtle": true, + "weight": "Bolder", + "wrap": true + }, + { + "type": "TextBlock", + "text": "14A", + "horizontalAlignment": "Right", + "spacing": "Small", + "wrap": true + }, + { + "type": "TextBlock", + "text": "14B", + "horizontalAlignment": "Right", + "spacing": "Small", + "wrap": true + }, + { + "type": "TextBlock", + "text": "14C", + "horizontalAlignment": "Right", + "spacing": "Small", + "wrap": true + } + ] + } + ] + }, + { + "type": "TableRow", + "cells": [ + { + "type": "TableCell", + "items": [ + { + "type": "TextBlock", + "text": "Flight", + "isSubtle": true, + "weight": "Bolder", + "wrap": true + }, + { + "type": "TextBlock", + "text": "KL605", + "spacing": "Small", + "wrap": true + } + ] + }, + { + "type": "TableCell", + "items": [ + { + "type": "TextBlock", + "text": "Departs", + "isSubtle": true, + "horizontalAlignment": "Center", + "weight": "Bolder", + "wrap": true + }, + { + "type": "TextBlock", + "text": "2:20 AM", + "color": "Attention", + "weight": "Bolder", + "horizontalAlignment": "Center", + "spacing": "Small", + "wrap": true + } + ] + }, + { + "type": "TableCell", + "items": [ + { + "type": "TextBlock", + "text": "Arrives", + "isSubtle": true, + "horizontalAlignment": "Right", + "weight": "Bolder", + "wrap": true + }, + { + "type": "TextBlock", + "text": "8:20 PM", + "color": "Attention", + "horizontalAlignment": "Right", + "weight": "Bolder", + "spacing": "Small", + "wrap": true + } + ] + } + ] + }, + { + "type": "TableRow", + "cells": [ + { + "type": "TableCell", + "items": [ + { + "type": "TextBlock", + "text": "Amsterdam Airport", + "isSubtle": true, + "wrap": true + }, + { + "type": "TextBlock", + "text": "AMS", + "size": "ExtraLarge", + "color": "Accent", + "spacing": "None", + "wrap": true + } + ] + }, + { + "type": "TableCell", + "items": [ + { + "type": "Image", + "url": "https://adaptivecards.io/content/airplane.png", + "horizontalAlignment": "Center", + "size": "Small" + } + ], + "verticalContentAlignment": "Center" + }, + { + "type": "TableCell", + "items": [ + { + "type": "TextBlock", + "text": "San Francisco Airport", + "isSubtle": true, + "horizontalAlignment": "Right", + "wrap": true + }, + { + "type": "TextBlock", + "text": "SFO", + "horizontalAlignment": "Right", + "size": "ExtraLarge", + "color": "Accent", + "spacing": "None", + "wrap": true + } + ] + } + ], + "spacing": "None" + } + ], + "showGridLines": false + } + ] +} diff --git a/samples/v1.5/Scenarios/InputFormWithRTL.json b/samples/v1.5/Scenarios/InputFormWithRTL.json new file mode 100644 index 0000000000..e0c83af50a --- /dev/null +++ b/samples/v1.5/Scenarios/InputFormWithRTL.json @@ -0,0 +1,116 @@ +{ + "$schema": "http://adaptivecards.io/schemas/adaptive-card.json", + "type": "AdaptiveCard", + "version": "1.5", + "body": [ + { + "type": "TextBlock", + "text": "Please select your language:" + } + ], + "actions": [ + { + "type": "Action.ShowCard", + "title": "English", + "card": { + "type": "AdaptiveCard", + "body": [ + { + "type": "TextBlock", + "size": "medium", + "weight": "bolder", + "text": "Registration Form", + "horizontalAlignment": "center", + "wrap": true, + "style": "heading" + }, + { + "type": "Input.Text", + "label": "Name", + "style": "text", + "id": "SimpleVal", + "isRequired": true, + "errorMessage": "Name is required" + }, + { + "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" + } + ], + "actions": [ + { + "type": "Action.Submit", + "title": "Submit" + } + ] + } + }, + { + "type": "Action.ShowCard", + "title": "عربي", + "card": { + "type": "AdaptiveCard", + "rtl": true, + "body": [ + { + "type": "TextBlock", + "size": "medium", + "weight": "bolder", + "text": "إستمارة تسجيل", + "horizontalAlignment": "center", + "wrap": true, + "style": "heading" + }, + { + "type": "Input.Text", + "label": "اسم", + "style": "text", + "id": "SimpleVal", + "isRequired": true, + "errorMessage": "مطلوب اسم" + }, + { + "type": "Input.Text", + "label": "بريد الالكتروني", + "style": "email", + "id": "EmailVal" + }, + { + "type": "Input.Text", + "label": "هاتف", + "style": "tel", + "id": "TelVal" + }, + { + "type": "Input.Text", + "label": "تعليقات", + "style": "text", + "isMultiline": true, + "id": "MultiLineVal" + } + ], + "actions": [ + { + "type": "Action.Submit", + "title": "يقدم" + } + ] + } + } + ] +} \ No newline at end of file diff --git a/samples/v1.5/Scenarios/OrderConfirmation.json b/samples/v1.5/Scenarios/OrderConfirmation.json new file mode 100644 index 0000000000..eb104c2ede --- /dev/null +++ b/samples/v1.5/Scenarios/OrderConfirmation.json @@ -0,0 +1,68 @@ +{ + "type": "AdaptiveCard", + "$schema": "http://adaptivecards.io/schemas/adaptive-card.json", + "version": "1.5", + "body": [ + { + "type": "TextBlock", + "text": "Please confirm your order:", + "wrap": true, + "style": "heading" + }, + { + "type": "FactSet", + "facts": [ + { + "title": "Name", + "value": "John Smith" + }, + { + "title": "Phone number", + "value": "(555) 555-5555" + } + ] + }, + { + "type": "Container", + "items": [ + { + "type": "FactSet", + "facts": [ + { + "title": "1x", + "value": "Steak" + }, + { + "title": "2x", + "value": "Side Rice" + }, + { + "title": "1x", + "value": "Soft Drink" + } + ], + "spacing": "Small" + } + ], + "spacing": "Small" + } + ], + "actions": [ + { + "type": "Action.Execute", + "title": "Place Order" + }, + { + "type": "Action.Execute", + "title": "Edit Order", + "data": "edit", + "mode": "secondary" + }, + { + "type": "Action.Execute", + "title": "Save Order", + "data": "save", + "mode": "secondary" + } + ] +} diff --git a/samples/v1.5/Scenarios/OrderDelivery.json b/samples/v1.5/Scenarios/OrderDelivery.json new file mode 100644 index 0000000000..d0ba766c6a --- /dev/null +++ b/samples/v1.5/Scenarios/OrderDelivery.json @@ -0,0 +1,70 @@ +{ + "$schema": "http://adaptivecards.io/schemas/adaptive-card.json", + "type": "AdaptiveCard", + "version": "1.5", + "body": [ + { + "type": "ColumnSet", + "columns": [ + { + "type": "Column", + "width": 2, + "items": [ + { + "type": "TextBlock", + "text": "Redmond, WA", + "wrap": true + }, + { + "type": "TextBlock", + "text": "Malt & Vine", + "weight": "bolder", + "size": "extraLarge", + "spacing": "none", + "wrap": true + }, + { + "type": "TextBlock", + "text": "4.5 stars (176 reviews) · mid-priced", + "isSubtle": true, + "spacing": "none", + "wrap": true + }, + { + "type": "TextBlock", + "text": "**Blaire S.** said \"Great concept and a wide selection of beers both on tap and bottled! Smaller wine selection than I wanted, but the variety of beers certainly made up for that. Although I didn't order anything, my boyfriend got a beer and he loved it. Their prices are fair too. \n\nThe concept is really awesome. It's a bar/store that you can bring outside food into. The place was pretty packed tonight. I wish we had stayed for more than one drink. I would have loved to sample everything!\"", + "size": "small", + "wrap": true, + "maxLines": 3 + } + ] + }, + { + "type": "Column", + "width": 1, + "items": [ + { + "type": "Image", + "url": "https://picsum.photos/300?image=882", + "size": "auto", + "altText": "Seated guest drinking a cup of coffee" + } + ] + } + ] + } + ], + "actions": [ + { + "type": "Action.Submit", + "title": "Pickup", + "tooltip": "Schedule order for pickup" + }, + { + "type": "Action.Submit", + "title": "Delivery", + "isEnabled": "false", + "tooltip": "Your location is too far for delivery" + } + ] +} diff --git a/samples/v1.5/Scenarios/RestaurantOrder.json b/samples/v1.5/Scenarios/RestaurantOrder.json new file mode 100644 index 0000000000..ffbd915679 --- /dev/null +++ b/samples/v1.5/Scenarios/RestaurantOrder.json @@ -0,0 +1,105 @@ +{ + "type": "AdaptiveCard", + "$schema": "http://adaptivecards.io/schemas/adaptive-card.json", + "version": "1.5", + "body": [ + { + "type": "TextBlock", + "text": "Malt & Vine Order Form", + "size": "Large", + "wrap": true, + "weight": "Bolder" + }, + { + "type": "Input.ChoiceSet", + "id": "EntreeSelectVal", + "label": "Which entree would you like?", + "style": "filtered", + "isRequired": true, + "errorMessage": "This is a required input", + "placeholder": "Please choose", + "choices": [ + { + "title": "Steak", + "value": "1" + }, + { + "title": "Chicken", + "value": "2" + }, + { + "title": "Tofu", + "value": "3" + } + ] + }, + { + "type": "Input.ChoiceSet", + "id": "SideVal", + "label": "Which side would you like?", + "style": "filtered", + "isRequired": true, + "errorMessage": "This is a required input", + "placeholder": "Please choose", + "choices": [ + { + "title": "Baked Potato", + "value": "1" + }, + { + "title": "Rice", + "value": "2" + }, + { + "title": "Vegetables", + "value": "3" + }, + { + "title": "Noodles", + "value": "4" + }, + { + "title": "No Side", + "value": "5" + } + ] + }, + { + "type": "Input.ChoiceSet", + "id": "DrinkVal", + "label": "Which drink would you like?", + "style": "filtered", + "isRequired": true, + "errorMessage": "This is a required input", + "placeholder": "Please choose", + "choices": [ + { + "title": "Water", + "value": "1" + }, + { + "title": "Soft Drink", + "value": "2" + }, + { + "title": "Coffee", + "value": "3" + }, + { + "title": "Natural Juice", + "value": "4" + }, + { + "title": "No Drink", + "value": "5" + } + ] + } + ], + "actions": [ + { + "type": "Action.Submit", + "title": "Place Order" + } + ] +} \ No newline at end of file From 8254ab5be27141070c1a3794d6a9115036c3ac65 Mon Sep 17 00:00:00 2001 From: "J.P. Roca" Date: Mon, 15 Nov 2021 11:35:09 -0800 Subject: [PATCH 11/12] Fixed boolean and duplicate id on cards --- .../Scenarios/InputFormWithRTL.template.json | 16 ++++++++-------- .../Scenarios/OrderDelivery.template.json | 2 +- samples/v1.5/Scenarios/InputFormWithRTL.json | 16 ++++++++-------- samples/v1.5/Scenarios/OrderDelivery.json | 2 +- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/samples/Templates/Scenarios/InputFormWithRTL.template.json b/samples/Templates/Scenarios/InputFormWithRTL.template.json index 8512300b24..5049729d99 100644 --- a/samples/Templates/Scenarios/InputFormWithRTL.template.json +++ b/samples/Templates/Scenarios/InputFormWithRTL.template.json @@ -28,7 +28,7 @@ "type": "Input.Text", "label": "Name", "style": "text", - "id": "SimpleVal", + "id": "SimpleValENG", "isRequired": true, "errorMessage": "Name is required" }, @@ -36,20 +36,20 @@ "type": "Input.Text", "label": "Email", "style": "email", - "id": "EmailVal" + "id": "EmailValENG" }, { "type": "Input.Text", "label": "Phone", "style": "tel", - "id": "TelVal" + "id": "TelValENG" }, { "type": "Input.Text", "label": "Comments", "style": "text", "isMultiline": true, - "id": "MultiLineVal" + "id": "MultiLineValENG" } ], "actions": [ @@ -80,7 +80,7 @@ "type": "Input.Text", "label": "اسم", "style": "text", - "id": "SimpleVal", + "id": "SimpleValARA", "isRequired": true, "errorMessage": "مطلوب اسم" }, @@ -88,20 +88,20 @@ "type": "Input.Text", "label": "بريد الالكتروني", "style": "email", - "id": "EmailVal" + "id": "EmailValARA" }, { "type": "Input.Text", "label": "هاتف", "style": "tel", - "id": "TelVal" + "id": "TelValARA" }, { "type": "Input.Text", "label": "تعليقات", "style": "text", "isMultiline": true, - "id": "MultiLineVal" + "id": "MultiLineValARA" } ], "actions": [ diff --git a/samples/Templates/Scenarios/OrderDelivery.template.json b/samples/Templates/Scenarios/OrderDelivery.template.json index 31cc1778e1..9c9f01c03e 100644 --- a/samples/Templates/Scenarios/OrderDelivery.template.json +++ b/samples/Templates/Scenarios/OrderDelivery.template.json @@ -63,7 +63,7 @@ { "type": "Action.Submit", "title": "Delivery", - "isEnabled": "false", + "isEnabled": false, "tooltip": "Your location is too far for delivery" } ] diff --git a/samples/v1.5/Scenarios/InputFormWithRTL.json b/samples/v1.5/Scenarios/InputFormWithRTL.json index e0c83af50a..3ef5ccecb6 100644 --- a/samples/v1.5/Scenarios/InputFormWithRTL.json +++ b/samples/v1.5/Scenarios/InputFormWithRTL.json @@ -28,7 +28,7 @@ "type": "Input.Text", "label": "Name", "style": "text", - "id": "SimpleVal", + "id": "SimpleValENG", "isRequired": true, "errorMessage": "Name is required" }, @@ -36,20 +36,20 @@ "type": "Input.Text", "label": "Email", "style": "email", - "id": "EmailVal" + "id": "EmailValENG" }, { "type": "Input.Text", "label": "Phone", "style": "tel", - "id": "TelVal" + "id": "TelValENG" }, { "type": "Input.Text", "label": "Comments", "style": "text", "isMultiline": true, - "id": "MultiLineVal" + "id": "MultiLineValENG" } ], "actions": [ @@ -80,7 +80,7 @@ "type": "Input.Text", "label": "اسم", "style": "text", - "id": "SimpleVal", + "id": "SimpleValARA", "isRequired": true, "errorMessage": "مطلوب اسم" }, @@ -88,20 +88,20 @@ "type": "Input.Text", "label": "بريد الالكتروني", "style": "email", - "id": "EmailVal" + "id": "EmailValARA" }, { "type": "Input.Text", "label": "هاتف", "style": "tel", - "id": "TelVal" + "id": "TelValARA" }, { "type": "Input.Text", "label": "تعليقات", "style": "text", "isMultiline": true, - "id": "MultiLineVal" + "id": "MultiLineValARA" } ], "actions": [ diff --git a/samples/v1.5/Scenarios/OrderDelivery.json b/samples/v1.5/Scenarios/OrderDelivery.json index d0ba766c6a..68aef928f6 100644 --- a/samples/v1.5/Scenarios/OrderDelivery.json +++ b/samples/v1.5/Scenarios/OrderDelivery.json @@ -63,7 +63,7 @@ { "type": "Action.Submit", "title": "Delivery", - "isEnabled": "false", + "isEnabled": false, "tooltip": "Your location is too far for delivery" } ] From a9268d97b44c809d0f826847a60975ea0a7bdbec Mon Sep 17 00:00:00 2001 From: "J.P. Roca" Date: Thu, 18 Nov 2021 16:16:14 -0800 Subject: [PATCH 12/12] added flightupdatetable and restaurant order to ignored cards for .NET tests --- source/dotnet/Test/AdaptiveCards.Test/XmlSerializationTests.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/dotnet/Test/AdaptiveCards.Test/XmlSerializationTests.cs b/source/dotnet/Test/AdaptiveCards.Test/XmlSerializationTests.cs index 4b3e38227a..74fc016d32 100644 --- a/source/dotnet/Test/AdaptiveCards.Test/XmlSerializationTests.cs +++ b/source/dotnet/Test/AdaptiveCards.Test/XmlSerializationTests.cs @@ -36,7 +36,8 @@ public void VerifySerializationForAllScenarioFiles() // After changing the default value of the TextBlock Text property this test doesn't succeed as xml can't // read a single space (even with xml:space=preserve), hence we skip this file(s) to avoid test failures. // The generated xml actually contains the empty space - string[] cardsToIgnore = { "FlightUpdate.json" }; + // v1.5 features are not implemented for .NET, therefore need to add the 1.5 scenario cards that are failing here + string[] cardsToIgnore = { "FlightUpdate.json", "FlightUpdateTable.json", "RestaurantOrder.json" }; XmlSerializer serializer = new XmlSerializer(typeof(AdaptiveCard)); foreach (var version in Directory.EnumerateDirectories(@"..\..\..\..\..\..\..\samples\", "v*"))