-
Notifications
You must be signed in to change notification settings - Fork 561
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated samples and added Elements cards
- Loading branch information
Showing
19 changed files
with
673 additions
and
542 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
samples/Templates/Elements/Template.ConditionalLayout.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ | ||
"type": "AdaptiveCard", | ||
"version": "1.2", | ||
"body": [ | ||
{ | ||
"type": "TextBlock", | ||
"text": "If the price in the data is higher than 500, red text will apper, otherwise green text", | ||
"wrap": true | ||
}, | ||
{ | ||
"type": "Container", | ||
"$data": "${requests}", | ||
"items": [ | ||
{ | ||
"type": "TextBlock", | ||
"text": "Item Requested Type: ${type}" | ||
}, | ||
{ | ||
"type": "TextBlock", | ||
"text": "Price:$${string(price)}" | ||
}, | ||
{ | ||
"type": "TextBlock", | ||
"$when": "${price > 500}", | ||
"text": "This thing is pricy!", | ||
"color": "attention" | ||
}, | ||
{ | ||
"type": "TextBlock", | ||
"$when": "${price <= 100}", | ||
"text": "Dang, this thing is cheap!", | ||
"color": "good" | ||
} | ||
] | ||
} | ||
] | ||
} |
33 changes: 33 additions & 0 deletions
33
samples/Templates/Elements/Template.DataBinding.Inline.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"type": "AdaptiveCard", | ||
"version" : "1.2", | ||
"$data": { | ||
"employee": { | ||
"name": "Matt", | ||
"manager": { "name": "Thomas" }, | ||
"peers": [{ | ||
"name": "Andrew" | ||
}, { | ||
"name": "Lei" | ||
}, { | ||
"name": "Mary Anne" | ||
}, { | ||
"name": "Adam" | ||
}] | ||
} | ||
}, | ||
"body": [ | ||
{ | ||
"type": "TextBlock", | ||
"text": "Hi ${employee.name}! Here's a bit about your org..." | ||
}, | ||
{ | ||
"type": "TextBlock", | ||
"text": "Your manager is: ${employee.manager.name}" | ||
}, | ||
{ | ||
"type": "TextBlock", | ||
"text": "3 of your peers are: ${employee.peers[0].name}, ${employee.peers[1].name}, ${employee.peers[2].name}" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"type": "AdaptiveCard", | ||
"version" : "1.2", | ||
"body": [ | ||
{ | ||
"type": "TextBlock", | ||
"text": "Hi ${employee.name}! Here's a bit about your org..." | ||
}, | ||
{ | ||
"type": "TextBlock", | ||
"text": "Your manager is: ${employee.manager.name}" | ||
}, | ||
{ | ||
"type": "TextBlock", | ||
"text": "3 of your peers are: ${employee.peers[0].name}, ${employee.peers[1].name}, ${employee.peers[2].name}" | ||
} | ||
] | ||
} |
40 changes: 40 additions & 0 deletions
40
samples/Templates/Elements/Template.Functions.DataManipulation.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"type": "AdaptiveCard", | ||
"version": "1.2", | ||
"body": [ | ||
{ | ||
"type": "Container", | ||
"items": [ | ||
{ | ||
"type": "TextBlock", | ||
"text": "This card created a json instance from commit message in the data and used it to set data context", | ||
"wrap":true, | ||
"color": "good" | ||
}, | ||
{ | ||
"type": "FactSet", | ||
"$data": "${json(commitMessage)}", | ||
"facts": [ | ||
{ | ||
"title": "Type", | ||
"value": "${type}" | ||
}, | ||
{ | ||
"title": "Build ID", | ||
"value": "${buildID}" | ||
}, | ||
{ | ||
"title": "Release ID", | ||
"value": "${releaseID}" | ||
}, | ||
{ | ||
"title": "Build Number", | ||
"value": "${buildNumber}" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
], | ||
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json" | ||
} |
32 changes: 32 additions & 0 deletions
32
samples/Templates/Elements/Template.Functions.DateFunctions.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"type": "AdaptiveCard", | ||
"version": "1.2", | ||
"body": [ | ||
{ | ||
"type": "TextBlock", | ||
"text": "Convert ${date} to 'yyyy-MM-ddTHH:mm:ss' format", | ||
"wrap": true | ||
}, | ||
{ | ||
"type": "TextBlock", | ||
"text": "**${formatDateTime(date, 'yyyy-MM-ddTHH:mm:ss')}**" | ||
}, | ||
{ | ||
"type": "TextBlock", | ||
"text": "Expressed in AdaptiveCards DATE Function Short" | ||
}, | ||
{ | ||
"type": "TextBlock", | ||
"text": "**{{DATE(${formatDateTime(date, 'yyyy-MM-ddTHH:mm:ssZ')}, SHORT)}}**" | ||
}, | ||
{ | ||
"type": "TextBlock", | ||
"text": "Expressed in AdaptiveCards TIME Function" | ||
}, | ||
{ | ||
"type": "TextBlock", | ||
"text": "**{{TIME(${formatDateTime(date, 'yyyy-MM-ddTHH:mm:ssZ')})}}**" | ||
} | ||
], | ||
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json" | ||
} |
31 changes: 31 additions & 0 deletions
31
samples/Templates/Elements/Template.Functions.LogicalComparison.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"type": "AdaptiveCard", | ||
"version": "1.2", | ||
"body": [ | ||
{ | ||
"type": "Container", | ||
"$data": "${requests}", | ||
"items": [ | ||
{ | ||
"$when":"${exists(type)}", | ||
"type": "TextBlock", | ||
"text": "Presence of type text in the data context was checked using **exists** function that returns true if requested entry exists, and this TextBlock is shown with type: '${type}'", | ||
"wrap": true | ||
}, | ||
{ | ||
"$when":"${!exists(type)}", | ||
"type": "TextBlock", | ||
"text": "If **type** text doesn't appear, this TextBlock will appear", | ||
"color": "attention", | ||
"wrap": true | ||
}, | ||
{ | ||
"type": "TextBlock", | ||
"text": "${string(price)}", | ||
"color": "${if(price <= 500, 'good', 'attention')}" | ||
} | ||
] | ||
} | ||
], | ||
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"type": "AdaptiveCard", | ||
"version": "1.2", | ||
"body": [ | ||
{ | ||
"type": "TextBlock", | ||
"text": "Lowest Price: ${min(select(requests, iter, iter.price))}" | ||
}, | ||
{ | ||
"type": "TextBlock", | ||
"text": "Highest Price: ${max(select(requests, iter, iter.price))}" | ||
}, | ||
{ | ||
"type": "TextBlock", | ||
"text": "Sum of Price: ${sum(select(requests, iter, iter.price))}" | ||
} | ||
], | ||
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"type": "AdaptiveCard", | ||
"version": "1.2", | ||
"body": [ | ||
{ | ||
"type": "TextBlock", | ||
"text": "Name in lower case: ${toLower(employee.name)}" | ||
}, | ||
{ | ||
"type": "TextBlock", | ||
"text": "Name in upper case: ${toUpper(employee.name)}" | ||
}, | ||
{ | ||
"type": "TextBlock", | ||
"text": "Length of name: ${string(length(employee.name))}" | ||
}, | ||
{ | ||
"type": "TextBlock", | ||
"text": "Retrieved the last name, ${substring(employee.peers[2].name, 5, 4)} using substring() from ${employee.peers[2].name}", | ||
"wrap": true | ||
}, | ||
{ | ||
"type": "TextBlock", | ||
"text": "Index of 'r' in '${employee.peers[0].name}': ${indexOf(employee.peers[0].name, 'r')}" | ||
} | ||
], | ||
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"type": "AdaptiveCard", | ||
"version": "1.2", | ||
"body": [ | ||
{ | ||
"type": "TextBlock", | ||
"text": "Data context is set with employee.manager, and the usage of name in template will refer to employee.manager's name", | ||
"wrap": true | ||
}, | ||
{ | ||
"type": "Container", | ||
"$data": "${employee.manager}", | ||
"items": [ | ||
{ | ||
"type": "TextBlock", | ||
"text": "name: ${name}" | ||
}, | ||
{ | ||
"type": "Container", | ||
"items": [ | ||
{ | ||
"type": "TextBlock", | ||
"text": "Root keyword allows to access root data context " | ||
}, | ||
{ | ||
"type": "TextBlock", | ||
"text": "name: ${$root.employee.name}" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"type": "AdaptiveCard", | ||
"version": "1.2", | ||
"body": [ | ||
{ | ||
"type": "Container", | ||
"items": [ | ||
{ | ||
"type": "TextBlock", | ||
"text": "Setting a data context that is a json array type will cause entire json obj that encloses the array to repeat by the size of the array", | ||
"wrap": true | ||
}, | ||
{ | ||
"type": "TextBlock", | ||
"text": "List of Peers" | ||
}, | ||
{ | ||
"$data": "${employee.peers}", | ||
"type": "TextBlock", | ||
"text": "${string($index + 1)}. ${name}" | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ | ||
"employee": { | ||
"name": "Matt", | ||
"manager": | ||
{ | ||
"name": "Thomas" | ||
}, | ||
"peers": [ | ||
{ | ||
"name": "Andrew" | ||
}, | ||
{ | ||
"name": "Lei" | ||
}, | ||
{ | ||
"name": "Mary Anne" | ||
}, | ||
{ | ||
"name": "Adam" | ||
} | ||
] | ||
}, | ||
"date" : "03/15/2018 12:00:00", | ||
"requests" : [ | ||
{ | ||
"type": "monitor", | ||
"price": 100 | ||
}, | ||
{ | ||
"type": "laptop", | ||
"price": 2000 | ||
}, | ||
{ | ||
"price": 2000 | ||
} | ||
], | ||
"commitMessage": "{\"type\":\"Deployment\",\"buildId\":\"9542982\",\"releaseId\":\"129\",\"buildNumber\":\"20180504.3\",\"releaseName\":\"Release-104\",\"repoProvider\":\"GitHub\"}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.