Skip to content

Instantly share code, notes, and snippets.

@DeeJayTC
Created April 19, 2020 10:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DeeJayTC/9d05cdc4a43f0943e83c71ce4ba5e726 to your computer and use it in GitHub Desktop.
Save DeeJayTC/9d05cdc4a43f0943e83c71ce4ba5e726 to your computer and use it in GitHub Desktop.
{
"type": "AdaptiveCard",
"body": [
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"width": "auto",
"items": [
{
"type": "Image",
"url": "{$root.icon}",
"size": "Small",
"width": "60px",
"height": "70px"
}
],
"horizontalAlignment": "Center"
},
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "TextBlock",
"text": "{$root.name}",
"size": "Medium",
"weight": "Bolder"
},
{
"type": "TextBlock",
"text": "Version: {$root.version}",
"height": "stretch",
"wrap": true,
"size": "Small",
"spacing": "None"
},
{
"type": "ActionSet",
"actions": [
{
"title": "Unlock",
"type": "Action.Submit",
"style": "blue",
"id":"unlock",
"$when": "{$root.fileLocked == '1'}",
"iconUrl": "{$root.keyIcon}"
},
{
"title": "Edit",
"id":"edit",
"type": "Action.Submit"
}
],
"horizontalAlignment": "Right"
}
],
"spacing": "Medium",
"verticalContentAlignment": "Center"
}
]
},
{
"$when": "{$root.hasRelated}",
"separator": true,
"type": "Container",
"spacing": "Medium",
"items": [
{
"type": "ColumnSet",
"spacing": "Medium",
"columns": [
{
"type": "Column",
"spacing": "Medium",
"items": [
{
"type": "TextBlock",
"text": "Attached to:",
"spacing": "Medium",
"separator": true,
"weight": "Bolder"
}
],
"width": "stretch",
"verticalContentAlignment": "Center"
}
]
},
{
"type": "Container",
"items": [
{
"type": "ColumnSet",
"$data": "{$root['related']}",
"columns": [
{
"type": "Column",
"width": "15px",
"items": [
{
"type": "Image",
"url": "{$data.icon}",
"size": "Small",
"height": "20px"
}
]
},
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "TextBlock",
"text": " [{$data['url']}]({$data['url']})",
"wrap": true
}
]
}
]
}
]
}
]
},
{
"type": "Container",
"spacing": "Medium",
"items": [
{
"type": "ColumnSet",
"spacing": "Medium",
"columns": [
{
"spacing": "Medium",
"type": "Column",
"items": [
{
"type": "TextBlock",
"text": "Comments:",
"separator": true,
"weight": "Bolder"
}
],
"width": "stretch"
}
]
}
],
"separator": true
},
{
"type": "Container",
"$when": "{$root['comments-count'] > 0}",
"$data": "{$root.comments}",
"items": [
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"items": [
{
"type": "Image",
"style": "Person",
"url": "{$data['author-avatar-url']}",
"size": "Small"
}
],
"width": "auto"
},
{
"type": "Column",
"items": [
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"items": [
{
"type": "TextBlock",
"weight": "Bolder",
"text": " [{$data['author-firstname']} {$data['author-lastname']}]({$root.rootUrl}/people/{$data['author_id']}) ( {$data['author-company']} )",
"isSubtle": true,
"wrap": true
}
],
"width": "auto"
},
{
"type": "Column",
"items": [
{
"type": "TextBlock",
"spacing": "None",
"text": "{{DATE({$data['datetime']},SHORT)}} {{TIME({$data['datetime']})}}",
"isSubtle": true,
"wrap": true
}
],
"width": "stretch"
}
]
}
],
"width": "stretch"
}
]
},
{
"type": "TextBlock",
"text": "{$data.body}",
"wrap": true
}
]
},
{
"type": "ActionSet",
"actions": [
{
"type": "Action.ShowCard",
"title": "Add a comment",
"card": {
"type": "AdaptiveCard",
"version": "1.0",
"body": [
{
"type": "TextBlock",
"text": "Comment"
},
{
"type": "Input.Text",
"id": "comment",
"placeholder": "Add your comment",
"isMultiline": true
}
],
"actions": [
{
"type": "Action.Submit",
"title": "Add Comment",
"data": {
"fileId": "{$root['version-id']}",
"type": "comment"
}
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json"
}
}
]
},
{
"separator": true,
"type": "Container",
"spacing": "Medium",
"items": [
{
"type": "ColumnSet",
"spacing": "Medium",
"columns": [
{
"type": "Column",
"spacing": "Medium",
"items": [
{
"type": "TextBlock",
"text": "Versions:",
"spacing": "Medium",
"separator": true,
"weight": "Bolder"
}
],
"width": "stretch",
"verticalContentAlignment": "Center"
}
]
},
{
"type": "Container",
"items": [
{
"$data": "{$root.versions}",
"type": "TextBlock",
"text": "{$data.version} - {{DATE({$root['uploaded-date']},SHORT)}} {{TIME({$data['uploaded-date']})}}, by [{$root['uploaded-by-user-first-name']} {$root['uploaded-by-user-last-name']}]({$root.rootUrl}/people/{$root['uploaded-by-userId']})",
"isSubtle": true,
"wrap": true,
"id": "version"
}
]
}
]
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.2"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment