Why the AMAPI misses some managed properties from my schema? - android-management-api

I have an Android application with some managed configurations. But when I ask the AMAPI for the schema of this application, not all restrictions are retrieved.
Here is the schema :
<restrictions xmlns:android="http://schemas.android.com/apk/res/android">
<restriction
android:description="#string/column_number_description"
android:key="column_number"
android:restrictionType="integer"
android:title="#string/column_number_title" />
<restriction
android:description="#string/status_bar_color_description"
android:key="status_bar_color"
android:restrictionType="string"
android:title="#string/status_bar_color_title" />
<restriction
android:description="#string/background_url_description"
android:key="background_url"
android:restrictionType="string"
android:title="#string/background_url_title" />
<restriction
android:description="#string/authorized_app_list_description"
android:key="authorized_app_list"
android:restrictionType="bundle_array"
android:title="#string/authorized_app_list_title">
<restriction
android:key="authorized_app"
android:restrictionType="bundle"
android:title="#string/authorized_app_title">
<restriction
android:key="package_name"
android:restrictionType="string"
android:title="#string/authorized_app_package_name_title" />
</restriction>
</restriction>
</restrictions>
And here is the the response from the AMAPI for the managed properties :
{
"managedProperties": [
{
"key": "column_number",
"type": "INTEGER",
"title": "Column number",
"description": "Set the number of column"
},
{
"key": "status_bar_color",
"type": "STRING",
"title": "Status bar color",
"description": "Set the color of the status bar"
},
{
"key": "background_url",
"type": "STRING",
"title": "Background url",
"description": "Url of the background to download to be displayed in the application"
},
{
"key": "authorized_app_list",
"type": "BUNDLE_ARRAY",
"title": "Authorized app list",
"description": "Set the list of app that will be displayed",
"nestedProperties": [
{
"key": "authorized_app",
"type": "BUNDLE",
"title": "Authorized app"
}
]
}
]
}
Do you have any idea why the AMAPI doesn't return the whole configuration for the bundle ?

It has been fixed by Google now the whole schema is sent.
{
"managedProperties": [
{
"key": "column_number",
"type": "INTEGER",
"title": "Column number",
"description": "Set the number of column"
},
{
"key": "status_bar_color",
"type": "STRING",
"title": "Status bar color",
"description": "Set the color of the status bar"
},
{
"key": "background_url",
"type": "STRING",
"title": "Background url",
"description": "Url of the background to download to be displayed in the application"
},
{
"key": "authorized_app_list",
"type": "BUNDLE_ARRAY",
"title": "Authorized app list",
"description": "Set the list of app that will be displayed",
"nestedProperties": [
{
"key": "authorized_app",
"type": "BUNDLE",
"title": "Authorized app",
"nestedProperties": [
{
"key": "package_name",
"type": "STRING",
"title": "App package name"
}
]
}
]
}
]
}

Related

Incoming Webhook for Microsoft Teams - Add to Planner (Task) Tab

Is there any way to create a new task within a Planner (Task) tab within a channel by using webhooks?
Either directly or having a button on the incoming message that then creates the task once the end user presses it?
I'm new to webhooks but having a look on Google, Power Automate is a way of doing it but not sure we have access to that.
I think I went down the wrong rabbit hole of task modules as I want to use what's already configured within the Planner tab and not create something bespoke. The button also doesn't work, comes up with an error message saying "This card action is disabled because it is not supported for Connectors". But this is what I have at the moment:
{
"type":"message",
"attachments":[
{
"contentType":"application/vnd.microsoft.card.adaptive",
"contentUrl":null,
"content":{
"$schema":"http://adaptivecards.io/schemas/adaptive-card.json",
"type":"AdaptiveCard",
"version":"1.2",
"body":[
{
"type": "Container",
"id": "066de76b-17da-e6f7-8ab3-81d36d8a6162",
"padding": "None",
"items": [
{
"type": "FactSet",
"id": "10eebecd-851c-2080-24f4-9b6044821d90",
"facts": [
{
"title": "**ID**",
"value": "EXAMPLE ID"
},
{
"title": "**Name**",
"value": "EXAMPLE NAME"
}
]
}
]
},
{
"type": "Container",
"id": "879303cd-81de-618a-8e99-e66be9f22ac1",
"padding": "None",
"items": [
{
"type": "TextBlock",
"id": "0833d313-657b-b587-d4d3-f4a961e6434a",
"text": "EXAMPLE ERROR MESSAGE.",
"wrap": true
},
{
"type": "Container",
"id": "de1d9a46-b8d4-443a-5afc-8843c445cf7b",
"padding": "None",
"items": [
{
"type": "ActionSet",
"id": "3b0c8763-dba8-3d88-98f5-7189ced1fe60",
"actions": [
{
"type": "Action.Submit",
"id": "btnCreateTask",
"title": "Create Task",
"card": {
"type": "AdaptiveCard",
"padding": "None",
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json"
}
}
]
}
]
}
]
}
]
}
}
]
}
Thanks in advance for any help/suggestions

Customizing Strapi field labels

I have a strapi model representing a collection, specified by the below JSON:
{
"kind": "collectionType",
"collectionName": "orgs",
"info": {
"name": "Organization",
"description": ""
},
"options": {
"increments": true,
"timestamps": true,
"draftAndPublish": false
},
"attributes": {
"backToTopButton": {
"type": "BackToTopButton",
"columnType": "object"
},
"relationNavigation": {
"type": "RelationNavigation",
"columnType": "object",
"entityUid": "communities",
"selectedIndex": 0,
"items": [
{
"relationEntityUid": "orgs",
"label": "Information",
"value": "Community",
"localKey": "communityId",
"foreignKey": "communityId",
"relationType": "OneToOne"
},
{
"relationEntityUid": "Connectorsetting",
"label": "",
"value": "Connectors",
"localKey": "communityId",
"foreignKey": "communityId",
"relationType": "OneToOne"
}
]
},
"yglId": {
"type": "number"
},
"name": {
"type": "string"
},
"segmentType": {
"type": "DropDown",
"columnType": "string",
"stretchType": "half",
"cssOverride": false,
"options": ["Strategic 1", "Strategic 2", "Strategic 3", "SBAM", "Self Serve"]
},
"reportingSuite": {
"type": "DropDown",
"columnType": "string",
"options": ["Strategic A", "Strategic B", "Strategic C", "Strategic D", "Strategic E", "Strategic F", "Strategic G", "Strategic H", "Strategic I", "Strategic J", "SBAM", "SBAM A", "SBAM B", "SBAM C"]
}
}
}
I have to have custom labels, for example, for the attribute - segmentType I would love to be able to write "organization segment".
Ideally, I am looking for a way to rewrite this similar to:
"segmentType": {
"type": "DropDown",
"columnType": "string",
"stretchType": "half",
"cssOverride": false,
"options": ["Strategic 1", "Strategic 2", "Strategic 3", "SBAM", "Self Serve"],
"label": "organization segment"
},
I could not find any examples of how to do this without coding [a plugin], using just the JSON.
Any assistance is appreciated.
You can achieve this through the View Configuration interface.
To get to this interface, just go to the Collection/Single type then click the “Configure the view” button.
See this Screenshot for Reference
When you are in the View Configuration interface, click the pencil icon on the field with which you want to edit the Label.
See this Screenshot for Reference

Update Teams Manifest - Object reference not set

We are currently build a MS Teams app, and we are in the POC phase.
When using the menu in Visual studio to update the Manifest with the latest changes from the manifest, I get the following error. Project -> TeamsFx -> Update Teams Manifest
System.NullReferenceException: Object reference not set to an instance of an object.
at TeamsFx.VisualStudio.Definitions.AppDefinitionBot.FromAppManifestBot(AppManifestBot appManifestBot)
at TeamsFx.VisualStudio.Commands.TeamsAppManifest.<>c.<MergeIntoTeamsAppDefinitionAsync>b__18_2(AppManifestBot bot)
at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at TeamsFx.VisualStudio.Commands.TeamsAppManifest.<MergeIntoTeamsAppDefinitionAsync>d__18.MoveNext()
The bot is defined as follows :
"bots": [
{
"botId": "someId",
"needsChannelSelector": false,
"isNotificationOnly": false,
"scopes": [
"team",
"personal",
"groupchat"
]
}
],
And then we only have composeExtensions to show cards, with 2 simple examples to test and see how it works.
"composeExtensions": [
{
"botId": "someId",
"canUpdateConfiguration": true,
"commands": [
{
"id": "createCard",
"type": "action",
"context": [ "message" ],
"description": "Command to run action to create a Card from Compose Box",
"title": "Create Card",
"parameters": [
{
"name": "title",
"title": "Card title",
"description": "Title for the card",
"inputType": "text"
},
{
"name": "subTitle",
"title": "Subtitle",
"description": "Subtitle for the card",
"inputType": "text"
},
{
"name": "text",
"title": "Text",
"description": "Text for the card",
"inputType": "textarea"
}
]
},
{
"id": "createAdaptiveCard",
"type": "action",
"context": [ "message" ],
"description": "Command to run action to create a Card from Compose Box",
"title": "Adaptive Card",
"parameters": [
{
"name": "title",
"title": "Name",
"description": "Name of the User",
"inputType": "text"
},
{
"name": "subTitle",
"title": "Designation",
"description": "Designation of the User",
"inputType": "text"
},
{
"name": "text",
"title": "Description",
"description": "Description",
"inputType": "textarea"
}
]
}
]
}
],
The end result is the app in MS Teams when running it, doesn't pull in the latest changes.
The TeamFx Validation pass with no errors. My assumption is something is wrong in the manifest file, although I can't find anything that is standing out.
Can anyone please advise if they had this before and how to resolve it?
Thanks in advance.
I found the solution was to include the following in the bots section of the manifest file:
"commandLists": []"
If that is isn't defined, it was throwing an exception. Defined, but with just an empty list, resolved it.

VSC validation with $schema and usage of additionalProperties = false

i have a dataobject.json and a corresponding example.json. I like to compare both if everything what is in the example is the same notation as in the dataobject.
I added in the exampe the dataobject file as a schema to validate against. This works, but only for the required field, not for the optional properties. - there the validation doesn't find a problem, even if there are some.
To validate these I added the "additionalProperties": false line. This works in general, so I find all the deviations, but I also get a problem that property §schema is not allowed.
How can I solve this?
the dataobject
{
"$schema": "http://json-schema.org/draft-07/schema",
"type": "object",
"title": "GroupDO",
"required": [
"id",
"name"
],
"additionalProperties": false,
"properties": {
"id": {
"type": "string",
"format": "uuid",
"example": "5dd6c80a-3376-4bce-bc47-8t41b3565325",
"description": "Unique id ."
},
"name": {
"type": "string",
"example": "ABD",
"description": "The name."
},
"GroupSort": {
"type": "integer",
"format": "int32",
"example": 1,
"description": "Defines in which order the groups should appear."
},
"GroupTextList": {
"type": "array",
"description": "A descriptoin in multiple languages.",
"items": {
"$ref": "../../common/dataobjects/Description_1000_DO.json"
}
},
"parentGroupId": {
"type": "string",
"format": "uuid",
"example": "8e590f93-1ab6-40e4-a5f4-aa1eeb2b6a80",
"description": "Unique id for the parent group."
}
},
"description": "DO representing a group object. "}
the example
{ "$schema": "../dataobjects/GroupDO.json",
"id": "18694b46-0833-4790-b780-c7897ap08500",
"version": 1,
"lastChange": "2020-05-12T13:57:39.935305",
"sort": 3,
"name": "STR",
"parentGroupId": "b504273e-61fb-48d1-aef8-c289jk779709",
"GroupTexts": [
{
"id": "7598b668-d9b7-4d27-a489-19e45h2bdad0",
"version": 0,
"lastChange": "2020-03-09T14:14:25.491787",
"languageIsoCode": "de_DE",
"description": "Tasche"
},
{
"id": "376e82f8-837d-4bb2-a21f-a9e0ebd59e23",
"version": 0,
"lastChange": "2020-03-09T14:14:25.491787",
"languageIsoCode": "en_GB",
"description": "Bag"
}
]
}
the problem messages:
property $schema is not allowed
Thanks in advance for your help.

How to display images in imageset dynamically from an array object in adaptiev cards?

I have an array object like this:
{
"Items":[
{
"ShortName":"Product short name",
"Image":"https://www.andrew.cmu.edu/user/cfperron/cats/images/cat8.jpg",
"ManufacturerName":"MMM",
"CatalogName":"cats"
},
{
"ShortName":"Product2 short name",
"Image":"https://www.andrew.cmu.edu/user/cfperron/cats/images/cat7.jpg",
"ManufacturerName":"SSS",
"CatalogName":"Dogs"
}
]
}
how to get Images in ImageSet dynamically in adaptive cards? I was able to get rest of the values in FactSet. But stuck with images.
Ok I figured it out.
{
"type": "AdaptiveCard",
"body": [
{
"type": "TextBlock",
"size": "medium",
"weight": "bolder",
"text": "Search Results"
},
{
"type": "Container",
"items": [
{
"type": "ImageSet",
"imageSize": "medium",
"images": [
{
"type": "Image",
"url": "${Image}",
"size": "Medium"
}
]
},
{
"type": "FactSet",
"facts": [
{
"title": "Short Name",
"value": "${ShortName}"
},
{
"title": "Supplier Name",
"value": "${SupplierName} "
},
{
"title": "Price ",
"value": "${PriceAmount} "
}
]
}
],
"$data": "${$root['Items']}"
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.2"
}
But next issue I am facing is if image url is empty, it throws an error "Adaptive Card Rendered error:
{
"message": "Cannot read property 'style' of null"
}"
How can we give a null check inside adaptive card for Image property?

Resources