Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
with
493 additions
and 207 deletions.
- +36 −18 action/ActionProcessor.js
- +159 −0 action/expense_approved.json
- +159 −0 action/expense_declined.json
- +1 −1 action/index.js
- +138 −188 action/instruction.html
| @@ -0,0 +1,159 @@ | ||
| { | ||
| "$schema":"http://adaptivecards.io/schemas/adaptive-card.json", | ||
| "type":"AdaptiveCard", | ||
| "originator":"{originator}", | ||
| "version":"1.0", | ||
| "body":[ | ||
| { | ||
| "type":"ColumnSet", | ||
| "columns":[ | ||
| { | ||
| "width":6, | ||
| "items":[ | ||
| { | ||
| "type":"Container", | ||
| "padding":{ | ||
| "left":"small" | ||
| }, | ||
| "items":[ | ||
| { | ||
| "type":"Image", | ||
| "url":"https://filedepot.blob.core.windows.net/build/logo.png" | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "type":"Container", | ||
| "backgroundImage":"https://filedepot.blob.core.windows.net/build/header.png", | ||
| "spacing":"small", | ||
| "items":[ | ||
| { | ||
| "type":"TextBlock", | ||
| "text":"Expense Report (ER-321377) for 1179 USD is available", | ||
| "size":"medium", | ||
| "color":"light", | ||
| "horizontalAlignment":"left", | ||
| "wrap":true | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "type":"Container", | ||
| "padding":"small", | ||
| "items":[ | ||
| { | ||
| "type":"ColumnSet", | ||
| "columns":[ | ||
| { | ||
| "type":"Column", | ||
| "width":"auto", | ||
| "items": [ | ||
| { | ||
| "type":"Image", | ||
| "id":"action_image", | ||
| "url":"https://filedepot.blob.core.windows.net/build/approved.png" | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "type":"Column", | ||
| "width":"auto", | ||
| "items": [ | ||
| { | ||
| "type":"TextBlock", | ||
| "text":"by {user}" | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "type":"ColumnSet", | ||
| "columns":[ | ||
| { | ||
| "type":"Column", | ||
| "width":"auto", | ||
| "items":[ | ||
| { | ||
| "type":"Image", | ||
| "url":"https://filedepot.blob.core.windows.net/profile/9.png", | ||
| "style":"person" | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "type":"Column", | ||
| "width":"stretch", | ||
| "items":[ | ||
| { | ||
| "type":"TextBlock", | ||
| "text":"**Miguel Garcia** submitted on 8th May" | ||
| }, | ||
| { | ||
| "type":"TextBlock", | ||
| "text":"Travel & stay expenses for customer visit", | ||
| "spacing":"none", | ||
| "size":"small" | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "type":"Column", | ||
| "width":"auto", | ||
| "items":[ | ||
| { | ||
| "type":"TextBlock", | ||
| "text":"$1179", | ||
| "size":"medium", | ||
| "weight":"bolder" | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "type":"ActionSet", | ||
| "id":"expenseActions", | ||
| "horizontalAlignment":"left", | ||
| "actions":[ | ||
| { | ||
| "type":"Action.Http", | ||
| "method":"post", | ||
| "url":"{actionUrl}", | ||
| "title":"Approve", | ||
| "body":"{\"action\": \"approve\", \"id\": \"ER-321377\", \"comment\":\"{{comment.value}}\", \"actionUrl\": \"{actionUrl}\", \"originator\": \"{originator}\"}" | ||
| }, | ||
| { | ||
| "type":"Action.ShowCard", | ||
| "title":"Decline", | ||
| "card":{ | ||
| "type":"AdaptiveCard", | ||
| "body":[ | ||
| { | ||
| "type":"Input.Text", | ||
| "id":"comment", | ||
| "isMultiline":true, | ||
| "placeholder":"Comment (optional)" | ||
| } | ||
| ], | ||
| "actions":[ | ||
| { | ||
| "type":"Action.Http", | ||
| "method":"post", | ||
| "url":"{actionUrl}", | ||
| "title":"OK", | ||
| "body":"{\"action\": \"decline\", \"id\": \"ER-321377\", \"comment\":\"{{comment.value}}\", \"actionUrl\": \"{actionUrl}\", \"originator\": \"{originator}\"}" | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } |
| @@ -0,0 +1,159 @@ | ||
| { | ||
| "$schema":"http://adaptivecards.io/schemas/adaptive-card.json", | ||
| "type":"AdaptiveCard", | ||
| "originator":"{originator}", | ||
| "version":"1.0", | ||
| "body":[ | ||
| { | ||
| "type":"ColumnSet", | ||
| "columns":[ | ||
| { | ||
| "width":6, | ||
| "items":[ | ||
| { | ||
| "type":"Container", | ||
| "padding":{ | ||
| "left":"small" | ||
| }, | ||
| "items":[ | ||
| { | ||
| "type":"Image", | ||
| "url":"https://filedepot.blob.core.windows.net/build/logo.png" | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "type":"Container", | ||
| "backgroundImage":"https://filedepot.blob.core.windows.net/build/header.png", | ||
| "spacing":"small", | ||
| "items":[ | ||
| { | ||
| "type":"TextBlock", | ||
| "text":"Expense Report (ER-321377) for 1179 USD is available", | ||
| "size":"medium", | ||
| "color":"light", | ||
| "horizontalAlignment":"left", | ||
| "wrap":true | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "type":"Container", | ||
| "padding":"small", | ||
| "items":[ | ||
| { | ||
| "type":"ColumnSet", | ||
| "columns":[ | ||
| { | ||
| "type":"Column", | ||
| "width":"auto", | ||
| "items": [ | ||
| { | ||
| "type":"Image", | ||
| "id":"action_image", | ||
| "url":"https://filedepot.blob.core.windows.net/build/declined.png" | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "type":"Column", | ||
| "width":"auto", | ||
| "items": [ | ||
| { | ||
| "type":"TextBlock", | ||
| "text":"by {user} with comment: {comment}" | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "type":"ColumnSet", | ||
| "columns":[ | ||
| { | ||
| "type":"Column", | ||
| "width":"auto", | ||
| "items":[ | ||
| { | ||
| "type":"Image", | ||
| "url":"https://filedepot.blob.core.windows.net/profile/9.png", | ||
| "style":"person" | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "type":"Column", | ||
| "width":"stretch", | ||
| "items":[ | ||
| { | ||
| "type":"TextBlock", | ||
| "text":"**Miguel Garcia** submitted on 8th May" | ||
| }, | ||
| { | ||
| "type":"TextBlock", | ||
| "text":"Travel & stay expenses for customer visit", | ||
| "spacing":"none", | ||
| "size":"small" | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "type":"Column", | ||
| "width":"auto", | ||
| "items":[ | ||
| { | ||
| "type":"TextBlock", | ||
| "text":"$1179", | ||
| "size":"medium", | ||
| "weight":"bolder" | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "type":"ActionSet", | ||
| "id":"expenseActions", | ||
| "horizontalAlignment":"left", | ||
| "actions":[ | ||
| { | ||
| "type":"Action.Http", | ||
| "method":"post", | ||
| "url":"{actionUrl}", | ||
| "title":"Approve", | ||
| "body":"{\"action\": \"approve\", \"id\": \"ER-321377\", \"comment\":\"{{comment.value}}\", \"actionUrl\": \"{actionUrl}\", \"originator\": \"{originator}\"}" | ||
| }, | ||
| { | ||
| "type":"Action.ShowCard", | ||
| "title":"Decline", | ||
| "card":{ | ||
| "type":"AdaptiveCard", | ||
| "body":[ | ||
| { | ||
| "type":"Input.Text", | ||
| "id":"comment", | ||
| "isMultiline":true, | ||
| "placeholder":"Comment (optional)" | ||
| } | ||
| ], | ||
| "actions":[ | ||
| { | ||
| "type":"Action.Http", | ||
| "method":"post", | ||
| "url":"{actionUrl}", | ||
| "title":"OK", | ||
| "body":"{\"action\": \"decline\", \"id\": \"ER-321377\", \"comment\":\"{{comment.value}}\", \"actionUrl\": \"{actionUrl}\", \"originator\": \"{originator}\"}" | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } |
Oops, something went wrong.