GWD Custom component - google-web-designer

I've created a custom component but the problem is that when I preview or export that component the image aren't exported
{
/* ... */
"attributes": [
{
"name": "bkgmap",
"label": "bkgmap",
"type": "string",
"required": true,
"description": "desc",
"gwdSpecific": {
"label": "bkgmapImg",
"sync": "src"
}
},
{
"name": "bkgback",
"label": "bkgback",
"type": "string",
"required": true,
"description": "desc",
"gwdSpecific": {
"label": "bkgbackImg",
"sync": "src"
}
},
{
"name": "bkgfore",
"label": "bkgfore",
"type": "string",
"required": true,
"description": "desc",
"gwdSpecific": {
"label": "bkgforeImg",
"sync": "src"
}
},
{
"name": "bar",
"label": "bar",
"type": "string",
"required": true,
"description": "desc",
"gwdSpecific": {
"label": "barImg",
"sync": "src"
}
} /* ... */
],
}
In this way, with the sync property I'm able to export only one image, someone know how is it possible to achieve the image inclusion? And also someone know how to set up a file upload type? the attributes type "file" works but isn't possibile to select any file, also if I specify the accept property.

{
"name": "dragIcon",
"label": "Drag Icon",
"type": "file",
"description": "Choose the images",
"required": true,
"accept": "image/*",
"bindable": false
},

Related

How to reference already existing Azure Portal created storage accounts in an ARM template

I want to create a function app with ARM template such that the ARM template references already existing storage accounts (inputstgdev and outputstgdev) which I have already parameterized. I would like the ARM template to use the inputstgdev storage account as its attached storage account such that it does not have to create a new storage account. The source control of the function app is referenced to a Gitrepo which I have also parameterized in the ARM template. Each time I run the ARM template I get the following error message
##[error]Deployment template validation failed: 'The resource '/subscriptions/bea8ac84-24a4-4e53-9198-e3b0107547d4/resourceGroups/dev-rgp/providers/Microsoft.Web/sites/functionapp/sourcecontrols/web' at line '1' and column '3069' doesn't depend on parent resource '/subscriptions/bea8ac84-24a4-4e53-9198-e3b0107547d4/resourceGroups/dev-rgp/providers/Microsoft.Web/sites/functionapp'. Please add dependency explicitly using the 'dependsOn' syntax. Please see aka.ms/arm-template/#resources for
Any suggestions what the issue might be or possible solutions.
I look forward to your response
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"InputstorageAccount": {
"defaultValue": "inputstgdev",
"type": "String"
},
"GitrepoBranch": {
"type": "string",
"defaultValue": "master",
"metadata": {
"description": "Name of the branch to use when deploying (Default = master)."
}
},
"GitrepoURL": {
"type": "string",
"defaultValue": "https://github.com/FBoucher/AzUnzipEverything.git",
"metadata": {
"description": "URL to repo (Default = master)."
}
},
"InputcontainerName": {
"type": "string",
"defaultValue": "inputcontainer",
"metadata": {
"description": "Specifies the name of the blob container."
}
},
"OutputstorageAccount": {
"defaultValue": "outputstgdev",
"type": "String"
},
"OutputcontainerName": {
"type": "string",
"defaultValue": "outputcontainer",
"metadata": {
"description": "Specifies the name of the blob container."
}
}
},
"variables": {},
"resources": [
{
"type": "Microsoft.Storage/storageAccounts/blobServices/containers",
"apiVersion": "2019-06-01",
"name": "[concat(parameters('InputstorageAccount'), '/default/', parameters('InputcontainerName'))]",
"properties": {
"publicAccess": "None"
}
},
{
"type": "Microsoft.Storage/storageAccounts/blobServices/containers",
"apiVersion": "2019-06-01",
"name": "[concat(parameters('OutputstorageAccount'), '/default/', parameters('OutputcontainerName'))]",
"properties": {
"publicAccess": "None"
}
},
{
"name": "serviceplan",
"type": "Microsoft.Web/serverfarms",
"apiVersion": "2018-02-01",
"location": "[resourceGroup().location]",
"sku": {
"name": "F1",
"capacity": 1
},
"tags": {
"displayName": "serviceplan"
},
"properties": {
"name": "serviceplan"
}
},
{
"name": "functionapp",
"type": "Microsoft.Web/sites",
"apiVersion": "2018-11-01",
"location": "[resourceGroup().location]",
"kind": "functionapp",
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms', 'serviceplan')]",
"[resourceId('Microsoft.Storage/storageAccounts', parameters('InputstorageAccount'))]"
],
"properties": {
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', 'serviceplan')]",
"siteConfig": {
"appSettings": [
{
"name": "AzureWebJobsDashboard",
"value": "[concat('DefaultEndpointsProtocol=https;AccountName=', parameters('InputstorageAccount'), ';AccountKey=', listKeys(parameters('InputcontainerName'),'2015-05-01-preview').key1)]"
},
{
"name": "AzureWebJobsStorage",
"value": "[concat('DefaultEndpointsProtocol=https;AccountName=', parameters('InputstorageAccount'), ';AccountKey=', listKeys(parameters('InputcontainerName'),'2015-05-01-preview').key1)]"
},
{
"name": "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING",
"value": "[concat('DefaultEndpointsProtocol=https;AccountName=', parameters('InputstorageAccount'), ';AccountKey=', listKeys(parameters('InputcontainerName'),'2015-05-01-preview').key1)]"
},
{
"name": "WEBSITE_CONTENTSHARE",
"value": "[toLower('functionapp')]"
},
{
"name": "FUNCTIONS_EXTENSION_VERSION",
"value": "~2"
},
{
"name": "APPINSIGHTS_INSTRUMENTATIONKEY",
"value": "[reference(resourceId('microsoft.insights/components/', 'applicationInsightsName'), '2015-05-01').InstrumentationKey]"
},
{
"name": "FUNCTIONS_WORKER_RUNTIME",
"value": "dotnet"
}
]
}
},
"resources":[
{
"apiVersion": "2015-08-01",
"name": "web",
"type": "sourcecontrols",
"dependsOn": [
"[resourceId('Microsoft.Web/sites/', parameters('InputstorageAccount'))]"
],
"properties": {
"RepoUrl": "[parameters('GitrepoURL')]",
"branch": "[parameters('GitrepoBranch')]",
"publishRunbook": true,
"IsManualIntegration": true
}
}
]
}
]
}
You encountered this error message due to the wrong dependency.
You should use "[resourceId('Microsoft.Web/sites/', 'functionapp')]" instead of "[resourceId('Microsoft.Web/sites/', parameters('InputstorageAccount'))]".
And you should delete the storage dependency.
"[resourceId('Microsoft.Storage/storageAccounts', parameters('InputstorageAccount'))]"
By the way, as you already have a storage account, you just need to paste your connection string in the value of AzureWebJobsStorage and AzureWebJobsDashboard.
Just like
{
"name": "AzureWebJobsDashboard",
"value": "{connectionstring}"
}

Define a task property as one that can change per platform

I am developing a VSCode extension that provide tasks, how can I specify that a property can change per platform, for example on "shell" task we can have this tasks.json:
"tasks": [
{
"type": "shell",
"windows": { "command": "wndCmd.exe" },
"linux": { "command": "lnxCmd" },
"osx": { "command": "osxCmd" }
}]
but for mine it is not possible.
From the sample on documentation, it is not possible create a task like:
"tasks": [
{
"type": "rake",
"task": "some",
"windows": { "file": "winFile" },
"linux": { "file": "linuxFile" },
"osx": { "file": "osxFile" }
}]
I don't really see a reason why you would need to do that for dynamically generated tasks, that only makes sense for declarative / static task declarations.
Just generate the version of the task that's appropriate for the current OS. You can check process.platform for that, see also:
How do I determine the current operating system with Node.js.
I can do it by hand:
"taskDefinitions": [
{
"type": "rake",
"required": [
"task"
],
"properties": {
"task": {
"type": "string",
"description": "The Rake task to customize"
},
"file": {
"type": "string",
"description": "The Rake file that provides the task. Can be omitted."
},
"windows: {
"type": "object",
"properties": {
"file": {
"type": "string",
"description": "..."
}
}
},
"linux: {
"type": "object",
"properties": {
"file": {
"type": "string",
"description": "..."
}
}
},
"osx: {
"type": "object",
"properties": {
"file": {
"type": "string",
"description": "..."
}
}
}
}
}
]

How to add extension settings schema on vscode?

The settings in VS Code supports graphic panel like below:
I am developing an extension in vscode but I couldn't find a document or example to show how to add these settings. Is there any tutorial I can read for doing that?
I tried below configuration but the GUI doesn't show panel for these fields:
"configuration": [
{
"type": "object",
"title": "MongoDB Runner Configuration",
"properties": {
"mongoRunner": {
"type": "object",
"default": {},
"description": "Complete connection configuration for your MongoDB.",
"properties": {
"connection": {
"title": "MongoDB Runner Configuration",
"type": "object",
"properties": {
"url": {
"type": "string",
"default": "mongodb://",
"description": "MongoDB URI"
},
"activeOnStartUp": {
"type": "boolean",
"default": false,
"description": "whether launch mongodb runner on start up"
}
}
}
}
}
}
}
]
below is the json file format I need to support:
"mongoRunner": {
"connection": {
"activeOnStartUp": true,
"url": "mongodb://localhost:27017"
}
},
Is this what you're looking for?
You can use markdown in the description (property markdownDescription), and the checkbox appears by using type boolean.
Example:
"configuration": {
"type": "object",
"title": "Test configuration",
"properties": {
"test.usingUI": {
"type": "boolean",
"default": false,
"markdownDescription": "**Some bold text**\nYes or no?"
},
"test.text": {
"type": ["string", "null"],
"default": null,
"description": "You can't edit me now!"
}
}
},
Looking in the UI like
this
Edit - 2:
In this case your syntax is malformed, try this:
"configuration": {
"type": "object",
"title": "MongoDB Runner Configuration",
"properties": {
"mongoRunner.url": {
"type": "string",
"default": "mongodb://",
"description": "MongoDB URI"
},
"mongoRunner.activeOnStartUp": {
"type": "boolean",
"default": false,
"description": "whether launch mongodb runner on start up"
}
}
},
-> UI

Authoratative Source Dcoumentation for Azure ARM Template Schema

I am looking for the official documentation for Azure Desired State Configuration JSON schemas. Documentation and examples I find online go back quite a while and I feel the schemas I am using are not current. I am currently seeking the most current schema and a description of the fields for Microsoft.Powershell.DSC. This is the schema Visual Studio provides but I would like to have a complete understanding of each field and values they expect.
{
"name": "Microsoft.Powershell.DSC",
"type": "extensions",
"location": "[parameters('location')]",
"apiVersion": "2015-06-15",
"dependsOn": [
"[resourceId('Microsoft.Compute/virtualMachines', parameters('vm-SP1-Name'))]"
],
"tags": {
"displayName": "test"
},
"properties": {
"publisher": "Microsoft.Powershell",
"type": "DSC",
"typeHandlerVersion": "2.9",
"autoUpgradeMinorVersion": true,
"forceUpdateTag": "[parameters('testUpdateTagVersion')]",
"settings": {
"configuration": {
"url": "[concat(parameters('_artifactsLocation'), '/', variables('testArchiveFolder'), '/', variables('testArchiveFileName'))]",
"script": "test.ps1",
"function": "Main"
},
"configurationArguments": {
"nodeName": "[parameters('vm-SP1-Name')]"
}
},
"protectedSettings": {
"configurationUrlSasToken": "[parameters('_artifactsLocationSasToken')]"
}
}
}
The official schema definition for the ARM PowerShell Desired State Configuration (DSC) JSON Schema can be found at the link below:
Schema Json
"dscExtension": {
"type": "object",
"properties": {
"publisher": {
"enum": ["Microsoft.Powershell"]
},
"type": {
"enum": ["DSC"]
},
"typeHandlerVersion": {
"type": "string",
"minLength": 1
},
"autoUpgradeMinorVersion": {
"type": "boolean"
},
"settings": {
"type": "object",
"properties": {
"modulesUrl": {
"type": "string"
},
"configurationFunction": {
"type": "string"
},
"properties": {
"type": "string"
},
"wmfVersion": {
"type": "string"
},
"privacy": {
"type": "object",
"properties": {
"dataCollection": {
"type": "string"
}
}
}
},
"required": ["modulesUrl", "configurationFunction"]
},
"protectedSettings": {
"type": "object",
"properties": {
"dataBlobUri": {
"type": "string"
}
}
}
},
"required": ["publisher", "type", "typeHandlerVersion", "autoUpgradeMinorVersion", "settings", "protectedSettings"]
},
The schema was documented in this blog. Feel free to ping me on the PowerShell slack (preferred) or twitter if you have any questions, #TravisPlunk. If I don't know, I can direct them to the right place.

How do I change the schema of a postgres data source in strongloop?

I'm trying to tell strongloop that my gallery table has moved to the products schema. Adding it to the model definition in common/models/gallery.json seemingly has no effect. New to strongloop. What am I doing wrong?
My current schema. "schema": "products" is the only thing added.
{
"name": "gallery",
"plural": "galleries",
"base": "PersistedModel",
"idInjection": true,
"options": {
"validateUpsert": true,
"schema": "products"
},
"properties": {
"id": {
"type": "number"
},
"name": {
"type": "string",
"required": true
},
"description": {
"type": "string"
},
"uuid": {
"type": "uuid"
},
"test": {
"type": "string"
},
"order": {
"type": "number"
}
},
"validations": [],
"relations": {},
"acls": [],
"methods": {}
}
uuid is a placeholder
Answer is here: https://docs.strongloop.com/display/public/LB/PostgreSQL+connector
Correct options value:
"options": {
"validateUpsert": true,
"postgresql": {
"schema": "products"
}
}