How to add location background in manifest.json - zendesk-app

From the default app setup manifest.json contains this
"location": { "zendesk":
{ "ticket_sidebar": "assets/iframe.html" }
}
I want part of the script run in background. So how to add background location in this manifest.json?
Like I tried
"location": { "zendesk":
{ "ticket_sidebar": "assets/iframe.html" },
{ "background": "assets/iframe.html" }
}
but not work.

Looks like you are using Zendesk App Framework version 2. Try using the following snippet:
"location":{"support":{"ticket_sidebar": "assets/iframe.html"},{"background": "assets/iframe.html"}}
In case you are using Zendesk Framework version 1 you would need to specify location as: "location": ["ticket_sidebar","background"]

Related

Visual Studio templating - conditionally hide parameter

I am attempting to create a custom Visual Studio project template and I have a template.json. What I am trying to achieve is to hide / disable the DoStuff parameter from the Visual Studio create project wizard if another parameter (in my case, ProjectType) was equal to something specific. It would essentially be something like the Docker OS parameter from the default Visual Studio API template.
As you can see, by default the dropdown (in my case, it would be a checkbox) is hidden / disabled, but if I check Enable Docker, it can be selected.
Below is my current template.json file which I can't seem to get right to have this feature.
{
"$schema": "http://json.schemastore.org/template",
"symbols": {
"ProjectType": {
"type": "parameter",
"datatype": "choice",
"choices": [
{
"choice": "Console"
},
{
"choice": "API"
}
],
"defaultValue": "API",
"description": "The type of the project you are building."
},
"DoStuff": {
"type": "parameter",
"datatype": "bool",
"defaultValue": "false",
// hide if ProjectType == API
}
}
}
I tried to combine it with ide.host.json to achieve this, but it's not working at all.
{
"$schema": "https://json.schemastore.org/ide.host.json",
"defaultSymbolVisibility": true,
"order": 2,
"icon": "icon.png",
"symbolInfo": [
{
"id": "DoStuff",
"isVisible": "(ProjectType == \"API\")"
}
]
}
After some more investigation and contacting Sayed Ibrahim Hashimi (sayedihashimi) on Twitter, it turns out this is currently not supported and there's likely no way to achieve it right now in .NET 6 and prior releases.
However, as per Chet Husk's (#ChetHusk) template engine upgrades comment (which redirects you to Github:dotnet/templating/docs/Conditions.md), templating conditions will be a feature added to .NET 7. The dotnet new cli already supports it, but the Visual Studio support has not yet been started on.

How to know if there are changes to promote on Heroku pipeline platform?

My objective is to write a script that promotes a "stage" application in our Heroku pipeline to production, but only if there are any changes to promote.
I can promote without issues by using:
// POST /pipeline-promotions
{
"pipeline": {
"id": "<pipeline-id>"
},
"source": {
"app": {
"id": "<stage-app-id>"
}
},
"targets": [
{
"app": {
"id": "<production-id>"
}
}
]
}
My issues is that if I execute this, without any changes are present, the release actions are still started on the production application.
In other words, how can I determine if any changes are available for promotion - just like heroku does in their GUI?
Thanks to Heroku support, I managed to figure this out.
It can be done by comparing the slug id's when looking at pipelines/<pipeline-id>/latest-releases.
If the slug-ids are the same, there are no changes to promote.

gaction test caller has no permission

I am trying to setup custom commands on my raspberry pi 3 with google assistant SDK. I was following this guide to setup my custom command. Whenever I run gactions test ti would get the following error:
Pushing the app for the Assistant for testing...
ERROR: Failed to test the app for the Assistant
ERROR: The caller does not have permission
2019/05/16 17:50:23 Server did not return HTTP 200
I have used gactions update to upload my action definition json file, with the google account that owns the Google Action project, and it was updated successfully. Therefore I'm not sure why I would have no permission on a project I owned and with a successfully updated action json.
There is the json I had for my custom action.
{
"manifest": {
"displayName": "DJ Roomba",
"invocationName": "DJ Roomba",
"category": "PRODUCTIVITY"
},
"actions": [
{
"description": "Thanos Snap",
"name": "djroomba.name.ThanosSnap",
"availability": {
"deviceClasses": [
{
"assistantSdkDevice": {}
}
]
},
"fulfillment": {
"staticFulfillment": {
"templatedResponse": {
"items": [
{
"simpleResponse": {
"textToSpeech": "You should have gone for the head"
}
},
{
"deviceExecution": {
"command": "action.devices.commands.ThanosSnap"
}
}
]
}
}
},
"intent": {
"name": "djroomba.intent.ThanosSnap",
"trigger": {
"queryPatterns": [
"Thanos snap"
]
}
}
}
],
"locale": "en"
}
I'm not sure if this will help, but I'm using Raspbian Jessie(since snowboy only supports up to that)
So, it turns out to be that I'll have to at least publish my action in alpha or beta version, otherwise the gactions test will not work

How to customize the color of custom syntax tokens in VSCode extension

TLDR; How can I have an extension colorize the syntax the extension is defining without it actually being a color theme the user has to enable?
I'm attempting to port this Sublime Text plugin (ToDone) to VSCode.
It creates a grammar for todo lists and then uses syntax highlighting to emphasize important tasks, mute completed tasks, etc.
I found "editor.tokenColorCustomizations", via Customize a Color Theme. It works with the new syntax when I use it in my user settings, but fails when I use it in the package.json#contributes portion of the extension manifest.
{
"contributes": {
"languages": [
{
"id": "todone",
"aliases": [
"ToDone",
"To-Done"
],
"extensions": [
".todone",
".todo"
]
}
],
"grammars": [
{
"language": "todone",
"scopeName": "text.todone",
"path": "./todone.tmLanguage"
}
],
"configurationDefaults": {
"[todone]": {
"editor.insertSpaces": false,
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": "symbol.definition.task-heading.todone",
"settings": {
"foreground": "#ff8800"
}
}
]
}
}
}
}
}
So far, the syntax seems ok — it's exactly what is being used by the Sublime plugin and the colors from the user-settings are applied correctly. Also, the format of the settings seems ok because "editor.insertSpaces" is being applied and the colors are working when present in the user-settings.
Lastly, I get a very disappointing 'Warning' 'Unknown editor configuration setting' message on the "editor.tokenColorCustomizations" setting in the extension package.json.
So, sounds like this setting is not enabled for extensions?
Another possible route I saw was to use decorators. But, I didn't see anything on inspecting the syntax tokens associated with a portion of text in the docs, e.g. some way to iterate through the syntax tokens of the document to apply decorators. So, the decorator route sounds like the hard-way compared to "editor.tokenColorCustomizations".
Any suggestions on how to make this work would be greatly appreciated.
Edit: The code, so far, is on GitHub: tiffon/vscode-todone
It only fails if you specify a specific language. It is working for me if I do not specify the todone extension.
"configurationDefaults": {
"editor.insertSpaces": false,
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": "symbol.definition.task-heading.todone",
"settings": {
"foreground": "#ff8800"
}
}
]
}
}

Serilog Appsettings and setting filters

Using the Serilog.Settings.AppSettings project I am having difficulty setting a filter to exclude certain namespaces from a configured sink.
In code I would do something like this:
[...].Filter.ByExcluding(Matching.FromSource<MyNameSpace>())
However I don't seem able to do it using the app settings.
Is this supported and if so how can I achieve this using configuration?
Thanks
Vincent
Make sure you have the package.
Install-Package Serilog.Filters.Expressions
Then follow the example here: https://github.com/serilog/serilog-filters-expressions and https://github.com/serilog/serilog-settings-configuration/blob/dev/sample/Sample/appsettings.json#L64
"Using": ["Serilog.Settings.Configuration"],
"Filter": [
{
"Name": "ByIncludingOnly",
"Args": {
"expression": "SourceContext = 'MyNameSpace'"
}
}
]

Resources