Skip to content

Instantly share code, notes, and snippets.

@DeeJayTC
Created February 8, 2020 00:19
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/27d0c32e72c523f167086c215b559dcf to your computer and use it in GitHub Desktop.
Save DeeJayTC/27d0c32e72c523f167086c215b559dcf to your computer and use it in GitHub Desktop.
{
"type": "AdaptiveCard",
"body": [
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"width": "20px",
"items": [
{
"type": "Image",
"altText": "",
"url": "{$root.icon}",
"size": "Small"
}
],
"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",
"horizontalAlignment": "Left",
"spacing": "None"
}
]
}
]
},
{
"$when": "{$root.hasRelated}",
"separator": true,
"type": "Container",
"spacing": "Medium",
"items": [
{
"type": "ColumnSet",
"spacing": "Medium",
"columns": [
{
"type": "Column",
"spacing": "Medium",
"items": [
{
"type": "Image",
"spacing": "Medium",
"url": "https://tw-synthesiscore.us.teamworkops.com/img/projects/task.png"
}
],
"width": "auto",
"verticalContentAlignment": "Center",
"horizontalAlignment": "Left"
},
{
"type": "Column",
"spacing": "Medium",
"items": [
{
"type": "TextBlock",
"text": "Related:",
"spacing": "Medium",
"separator": true,
"weight": "Bolder"
}
],
"width": "stretch",
"verticalContentAlignment": "Center",
"horizontalAlignment": "Left"
}
]
},
{
"type": "Container",
"items": [
{
"type": "ColumnSet",
"$data": "{$root['related']}",
"columns": [
{
"type": "Column",
"width": "15px",
"items": [
{
"type": "Image",
"altText": "",
"url": "{$data.icon}",
"size": "Small",
"height": "15px"
}
]
},
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "TextBlock",
"text": "{$data.url}",
"wrap": true
}
]
}
]
}
]
}
]
},
{
"type": "Container",
"spacing": "Medium",
"items": [
{
"type": "ColumnSet",
"spacing": "Medium",
"columns": [
{
"spacing": "Medium",
"type": "Column",
"height": "stretch",
"items": [
{
"type": "Image",
"url": "https://tw-synthesiscore-beta.us.teamworkops.com/img/projects/comment.png"
}
],
"width": "auto"
},
{
"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
}
],
"style": "emphasis"
},
{
"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": "Image",
"spacing": "Medium",
"url": "https://tw-synthesiscore.us.teamworkops.com/img/projects/event.png"
}
],
"width": "auto",
"horizontalAlignment": "Center",
"verticalContentAlignment": "Center"
},
{
"type": "Column",
"spacing": "Medium",
"items": [
{
"type": "TextBlock",
"text": "Versions:",
"spacing": "Medium",
"separator": true,
"weight": "Bolder"
}
],
"width": "stretch",
"verticalContentAlignment": "Center",
"horizontalAlignment": "Left"
}
]
},
{
"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.0"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment