Separator not showing in Adaptive Cards - botframework

I've been trying to get the "separator" property of Adaptive cards to work, but it does not seem to be rendering in the BotFramework Emulator.
Here are images to the Emulator and the Visualizer for the same code: Emulator Visualizer
The code in both places is the same, and is as follows:
{
"contentType": "application/vnd.microsoft.card.adaptive",
"content": {
'$schema': 'http://adaptivecards.io/schemas/adaptive-card.json',
'version': '1.0',
'type': 'AdaptiveCard',
'body': [
{
'type': 'TextBlock',
'text': 'Meeting Title',
'weight': 'bolder'
},
{
'type': 'TextBlock',
'text': 'Location',
'separator': true,
'isSubtle': true,
'size': 'small'
},
{
'type': 'TextBlock',
'text': 'Location',
'spacing': 'none'
},
{
'type': 'TextBlock',
'text': 'Organizer',
'separator': true,
'isSubtle': true,
'size': 'small'
},
{
'type': 'TextBlock',
'text': 'Organizer Name',
'spacing': 'none'
},
{
'type': 'TextBlock',
'text': 'Start Time',
'separator': true,
'isSubtle': true,
'size': 'small'
},
{
'type': 'ColumnSet',
'spacing': 'none',
'columns': [
{
'type': 'Column',
'width': 'auto',
'items': [
{
'type': 'TextBlock',
'text': '05:00 PM',
'isSubtle': false,
'weight': 'bolder'
}
]
},
{
'type': 'Column',
'width': 'auto',
'items': [
{
'type': 'TextBlock',
'text': 'May 21'
}
]
},
{
'type': 'Column',
'width': 'auto',
'items': [
{
'type': 'TextBlock',
'text': '2017',
'isSubtle': true,
'weight': 'bolder'
}
]
}
]
},
{
'type': 'TextBlock',
'text': 'End Time',
'separator': true,
'isSubtle': true,
'size': 'small'
},
{
'type': 'ColumnSet',
'spacing': 'none',
'columns': [
{
'type': 'Column',
'width': 'auto',
'items': [
{
'type': 'TextBlock',
'text': '05:30 PM',
'isSubtle': false,
'weight': 'bolder'
}
]
},
{
'type': 'Column',
'width': 'auto',
'items': [
{
'type': 'TextBlock',
'text': 'May 21'
}
]
},
{
'type': 'Column',
'width': 'auto',
'items': [
{
'type': 'TextBlock',
'text': '2017',
'isSubtle': true,
'weight': 'bolder'
}
]
}
]
}
],
'actions': [
{
'type': 'Action.Submit',
'title': 'Accept',
'data':{
'accept': true
}
},
{
'type': 'Action.Submit',
'title': 'Decline',
'data':{
'accept': false
}
}
]
}
}
As seen, The separators appear only in the visualizer, for the same code. Am I missing something?

Instead of separator you can use
Separation = SeparationStyle.Strong
this is working for me

it might be a little bit tricky because the separator documentation is a little bit vague (at least for me).
Take a look here - the syntax purposed to separator doesn't seem to work anywhere.
What I did find:
The spacing property works just fine (at least with these values "none" | "small" | "default" | "medium" | "large" | "extraLarge" | "padding")
It will only works when using in containers (Container, ColumnSet, Column, etc.)
It is also apply (as the name implies) on the outer area of the container (similar to CSS margin property)
Will not work for the first container
You may go to the adaptive cards classic editor and put spacing (let's say "spacing": "large") on the second Container section (there are only 2 of them) and observe the spacing impact by yourself

Related

Inserting data to elasticsearch according to mapping

I have created a mapping:
request_body = {
'settings': {
'number_of_shards': 3,
'number_of_replicas': 2
},
'mappings': {
'dynamic': 'strict',
'properties': {
'content': {'index': True, 'type': 'text'},
'location': {'type': 'geo_point'},
'retweet_count': {'type': 'integer'},
'favorite_count': {'type': 'integer'},
'happened_at': {'type': 'date'},
'author': {
'properties': {
'id': {'type': 'integer'},
'screen_name': {'type': 'text'},
'name': {'type': 'text'},
'description': {'index': True, 'type': 'text'},
'followers_count': {'type': 'integer'},
'friends_count': {'type': 'integer'},
'statuses_count': {'type': 'integer'}
}
},
'country': {
'properties': {
'id': {'type': 'integer'},
'code': {'type': 'text'},
'name': {'type': 'text'}
}
},
'parent_id': {'type': 'integer'},
'mentions': {
'type': 'nested',
'properties': {
'id': {'type': 'integer'},
'screen_name': {'type': 'text'},
'name': {'type': 'text'}
}
},
'hashtags': {
'type': 'nested',
'properties': {
'id': {'type': 'integer'},
'value': {'type': 'text'}
}
}
}
}
}
and then I create an index: es.indices.create(index='pdt', body=request_body), where es is instance of elasticsearch in python.
Then I want to insert a dictionary using bulk insert, the dictionary:
'_id' = {str} '1290712423939346432'
'_source' = {dict}
'content' = {str} 'RT #drfahrettinkoca: YENİ HASTA SAYISINDAKİ YÜKSELME CİDDİ. İki gün arasındaki fark, yakın zamanda ilk kez bu kadar belirgin. Bayram ve tat…'
'location' = {NoneType} None
'retweet_count' = {int} 9556
'favorite_count' = {int} 0
'happened_at' = {str} '2020-08-04 20:13:16+02:00'
'author' = {dict}
'parent_id' = {str} '1290699635003133953'
'mentions' = {list}
'hashtags' = {list}
The only item that is not present is the country, which can be None. I tried with both country = None and
'country': {
'id': None,
'code': None,
'name': None,
}
So I am not sure where the problem could be. Is passing an empty list a problem?
Here is the error code:
('1 document(s) failed to index.', [{'index': {'_index': 'pdt', '_type': 'tweet', '_id': '1290712423939346432', 'status': 400, 'error': {'type': 'illegal_argument_exception', 'reason': 'cannot change object mapping from nested to non-nested'}, 'data': {'content': 'RT #drfahrettinkoca: YENİ HASTA SAYISINDAKİ YÜKSELME CİDDİ. İki gün arasındaki fark, yakın zamanda ilk kez bu kadar belirgin. Bayram ve tat…', 'location': None, 'retweet_count': 9556, 'favorite_count': 0, 'happened_at': '2020-08-04 20:13:16+02:00', 'author': {'id': 794067571226066944, 'screen_name': 'zonguldak_ism', 'name': 'Zonguldak İSM', 'description': 'Adres:Yayla Mah. Ömer Karahasan Sok. No:6 Merkez/ZONGULDAK Telefon:+90 372 253 4607 Fax:+90 372 253 0667', 'followers_count': 703, 'friends_count': 91, 'statuses_count': 1446}, 'parent_id': '1290699635003133953', 'mentions': [{'id': 3679748, 'screen_name': 'drfahrettinkoca', 'name': 'Dr. Fahrettin Koca'}], 'hashtags': []}}}])

How to get data from multiple interactive blocks all at once?

I am creating a slack app where people can schedule when they are on call. I use two date pickers to specify the start date and the end date, and a button to submit the data. What I can't figure out is if the date picker selected_date data can be sent along with the button press, as only initial_date is shown in the block JSON.
Here is the response I get from pressing the button:
[{'action_id': 'hjy',
'action_ts': '1563202745.027278',
'block_id': 'uPBVi',
'text': {'emoji': True, 'text': 'Submit', 'type': 'plain_text'},
'type': 'button',
'value': 'yes'}],
'api_app_id': 'AKL2KTU75',
'channel': {'id': 'CKVM4FJM6', 'name': 'general'},
'container': {'channel_id': 'CKVM4FJM6',
'is_ephemeral': False,
'message_ts': '1563200576.002500',
'type': 'message'},
'message': {'blocks': [{'block_id': 'tgnS',
'text': {'text': 'Hello+<#UKVM4F04Q>!+select+the+days+you+will+be+available+through+below',
'type': 'mrkdwn',
'verbatim': False},
'type': 'section'},
{'block_id': 'bSu1B', 'type': 'divider'},
{'accessory': {'action_id': '5k6C',
'initial_date': '2019-7-15',
'placeholder': {'emoji': True,
'text': 'Select+a+date',
'type': 'plain_text'},
'type': 'datepicker'},
'block_id': 'CcW',
'text': {'text': 'Start+Date',
'type': 'mrkdwn',
'verbatim': False},
'type': 'section'},
{'accessory': {'action_id': 'D5UB',
'initial_date': '2019-7-15',
'placeholder': {'emoji': True,
'text': 'Select+a+date',
'type': 'plain_text'},
'type': 'datepicker'},
'block_id': 'Rpo5',
'text': {'text': 'End+Date',
'type': 'mrkdwn',
'verbatim': False},
'type': 'section'},
{'block_id': 'uPBVi',
'elements': [{'action_id': 'hjy',
'text': {'emoji': True,
'text': 'Submit',
'type': 'plain_text'},
'type': 'button',
'value': 'yes'},
{'action_id': '6t/g',
'text': {'emoji': True,
'text': 'Cancel',
'type': 'plain_text'},
'type': 'button',
'value': 'no'}],
'type': 'actions'}],
'bot_id': 'BKZJLQGG6',
'subtype': 'bot_message',
'text': "This+content+can't+be+displayed.",
'ts': '1563200576.002500',
'type': 'message',
'username': 'pythonapp'},
'response_url': 'https://hooks.slack.com/actions/TKV776BD2/688472980689/5Y52XBs2bUqdnOlwWLq0vWDp',
'team': {'domain': 'testing-o4a6006', 'id': 'TKV776BD2'},
'token': '[leaving out]',
'trigger_id': '694351571380.675245215444.f509bc26fc7ac4c230627e6b32fca516',
'type': 'block_actions',
'user': {'id': 'UKVM4F04Q',
'name': 'noahbraunfeld',
'team_id': 'TKV776BD2',
'username': 'noahbraunfeld'}}
And here is the response I get from the datepickers:
{'actions': [{'action_id': '5k6C',
'action_ts': '1563201722.414594',
'block_id': 'CcW',
'initial_date': '2019-7-15',
'selected_date': '2019-07-14',
'type': 'datepicker'}],
'api_app_id': 'AKL2KTU75',
'channel': {'id': 'CKVM4FJM6', 'name': 'general'},
'container': {'channel_id': 'CKVM4FJM6',
'is_ephemeral': False,
'message_ts': '1563200576.002500',
'type': 'message'},
'message': {'blocks': [{'block_id': 'tgnS',
'text': {'text': 'Hello+<#UKVM4F04Q>!+select+the+days+you+will+be+available+through+below',
'type': 'mrkdwn',
'verbatim': False},
'type': 'section'},
{'block_id': 'bSu1B', 'type': 'divider'},
{'accessory': {'action_id': '5k6C',
'initial_date': '2019-7-15',
'placeholder': {'emoji': True,
'text': 'Select+a+date',
'type': 'plain_text'},
'type': 'datepicker'},
'block_id': 'CcW',
'text': {'text': 'Start+Date',
'type': 'mrkdwn',
'verbatim': False},
'type': 'section'},
{'accessory': {'action_id': 'D5UB',
'initial_date': '2019-7-15',
'placeholder': {'emoji': True,
'text': 'Select+a+date',
'type': 'plain_text'},
'type': 'datepicker'},
'block_id': 'Rpo5',
'text': {'text': 'End+Date',
'type': 'mrkdwn',
'verbatim': False},
'type': 'section'},
{'block_id': 'uPBVi',
'elements': [{'action_id': 'hjy',
'text': {'emoji': True,
'text': 'Submit',
'type': 'plain_text'},
'type': 'button',
'value': 'yes'},
{'action_id': '6t/g',
'text': {'emoji': True,
'text': 'Cancel',
'type': 'plain_text'},
'type': 'button',
'value': 'no'}],
'type': 'actions'}],
'bot_id': 'BKZJLQGG6',
'subtype': 'bot_message',
'text': "This+content+can't+be+displayed.",
'ts': '1563200576.002500',
'type': 'message',
'username': 'pythonapp'},
'response_url': '[leaving out]',
'team': {'domain': 'testing-o4a6006', 'id': 'TKV776BD2'},
'token': '[leaving out]',
'trigger_id': '696646850567.675245215444.317894098ee3aa6938c5c40d4107fb68',
'type': 'block_actions',
'user': {'id': '[leaving out]',
'name': 'noahbraunfeld',
'team_id': 'TKV776BD2',
'username': 'noahbraunfeld'}}

JS Grid not showing data in table

I forced to change my nearly finished project developed on Filemaker to Open Source due to licensing issues. So I have to learn PHP, Javascript and all that stuff while programming. I am struggling now for 2 weeks with this issue. I have a php file with my JS Grid table which is also visible:
My code for the table:
$(document).ready(function() {
$('#contacts_table').jsGrid({
width: "100%",
height: "457px",
pageLoading: false,
filtering: true,
inserting: true,
editing: true,
sorting: true,
paging: true,
autoload: true,
pageSize: 10,
pageButtonCount: 2,
confirmDeleting: true,
noDataContent: "Not found",
deleteConfirm: "Do you really want to delete data?",
controller: {
loadData: function (filter) {
return $.ajax({
type: "GET",
url: "fetch_contacts_supplier_JS_Grid.php",
data: filter,
dataType: "json"
});
},
},
fields: [
{name: "Id", type: "number", width: 10, visible: false},
{name: "SupplierId",type: "number", width: 10, visible: false},
{name: "Title", type: "text", width: 10, validate: "required"},
{name: "Name", type: "text", width: 30, validate: "required"},
{name: "Surname", type: "text", width: 30, validate: "required"},
{name: "Position", type: "text", width: 20, validate: "required"},
{name: "Phone", type: "text", width: 30},
{name: "Mobile", type: "text", width: 30},
{name: "Fax", type: "text", width: 30},
{name: "Email", type: "text", width: 30},
{name: "Active", type: "checkbox", width: 10, validate: "required"},
{ type: "control", width: 10}
]
});
});
My code for the DB select (which works) fetch_contacts_supplier_JS_Grid.php:
if($method == 'GET') {
If ($statement = $link->prepare("SELECT * FROM suppliers_contacts WHERE _fk_SuppliersID = 1")) {
if ($statement->execute()) {
$result = $statement->get_result(); // fetchAll(PDO::FETCH_ASSOC);
while($row = $result->fetch_assoc()) {
$new_array[] = array(
'Id' => $row['_pk_SuppliersContactsID'],
'SupplierId' => $row['_fk_SuppliersID'],
'Title' => $row['Title'],
'Name' => $row['Name'],
'Surname' => $row['Surname'],
'Position' => $row['Job_Position'],
'Phone' => $row['PhoneFixed'],
'Mobile' => $row['PhoneCell'],
'Fax' => $row['PhoneFax'],
'Email' => $row['Email'],
'Active' => $row['Active']
);
}
}
header("Content-Type: application/json");
echo json_encode($new_array);
} ELSE {
echo $link->error;
}
}
The array I get in the console:
[{"Id":1,"SupplierId":1,"Title":"Mr.","Name":"Jens","Surname":"Dietzel","Position":"Owner","Phone":"145754","Mobile":"86868","Fax":"4368843","Email":"jens#jd-sd.com.na","Active":"checked"},{"Id":2,"SupplierId":1,"Title":"Mrs.","Name":"Karen","Surname":"Mann","Position":"Manager","Phone":"24525","Mobile":"745754","Fax":"544","Email":"karen#test.de","Active":"checked"}]
But the table shows not found. What am I doing wrong?

Radar chart mi and max axis values

How to limit my Radar chart from 0 to 10?
I have tried to set minimum and maximum keys, but this did not work.
am4core.useTheme(am4themes_animated);
const chart = am4core.createFromConfig({
'xAxes': [{
'type': 'CategoryAxis',
'minimum': 0,
'maximum': 10,
'dataFields': {
'category': 'category'
},
'tooltip': {
'disabled': true
},
'renderer': {
'labels': {
'fill': '#757575',
'fontSize': 12
}
}
}],
'yAxes': [{
'type': 'ValueAxis',
'minimum': 0,
'maximum': 10,
'tooltip': {
'disabled': true
},
'renderer': {
'labels': {
'fill': '#757575',
'fontSize': 12
}
}
}],
'legend': {
'position': 'bottom',
'fontSize': '1rem',
'fontWeight': '400'
},
'cursor': {},
'series': [
{
'type': 'RadarSeries',
'dataFields': {
'valueY': 'value1',
'categoryX': 'category'
},
'fill': '#4a90e2',
'stroke': '#4a90e2',
'strokeWidth': 3,
'tooltipText': '{valueY}',
'renderer': {
'tooltip': {
'fill': '#fff'
}
},
'tooltip': {
'getFillFromObject': false,
'background': {
'fill': '#4a90e2'
}
},
'name': 'Средняя оценка',
'bullets': [{
'type': 'CircleBullet'
}]
}],
'data': data.map(el => {
return {
'category': el.sLabel,
'value1': el.iRating
};
})
}, 'radar-chart', am4charts.RadarChart);
I expect my chart axis to always start at 0 and end at 10.

Kendo MVVM Grid, filtering multicheckbox

I'm trying to do something similar to this:
https://demos.telerik.com/kendo-ui/grid/filter-multi-checkboxes
I'm using something like this with kendo MVVM:
<div id="grid"></div>
<div class="box wide">
<div data-role="grid"
data-filterable="{ mode: 'row' , cell: { showOperators: false, operator: 'contains' } }"
data-sortable="true"
data-columns="[
{ 'field': 'TaskId', 'title': 'Actions', 'width': 100, filterable: false, template: viewModel.GenerateEditTemplate, sortable: false },
{ 'field': 'IsCompleted', 'title': 'Completed', 'type' : 'boolean', 'width': 125, filterable: { messages: { isFalse: 'No', isTrue: 'Yes' } } },
{ 'field': 'Title', 'title': 'Title', 'width': 250, 'type' : 'string', filterable: { multi: true, dataSource: [{ Title: 'title1' }, { Title: 'title2' }] } },
{ 'field': 'Hours', 'title': 'Estimated Hours', 'width': 110, 'type' : 'number', filterable: { cell: { showOperators: false, operator: 'contains' } } },
{ 'field': 'CreatedBy', 'title': 'Created By', 'width': 150, filterable: { cell: { showOperators: false, operator: 'contains', template: viewModel.UserFilter } } }
]"
data-bind="source: TaskDataSource, events: { dataBound: OnDataBound }">
</div>
</div>
After that, the only filter displayed in the header is the input that allows me to filter the column but not the expected dropdown with the given data source.
Does anyone know if there is a limitation with KendoMVVM that doesn't allow me to use the multi-option into the filterable but it works on that KendoGrid configuration?
Thanks a lot

Resources