From 088058af7413be042ef5c91ccc328503cc19230c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eduardo=20Fraz=C3=A3o?= Date: Mon, 16 Nov 2020 19:22:07 -0300 Subject: [PATCH] Initial Commit --- snippets-vitruvio.json | 101 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 snippets-vitruvio.json diff --git a/snippets-vitruvio.json b/snippets-vitruvio.json new file mode 100644 index 0000000..b347a7a --- /dev/null +++ b/snippets-vitruvio.json @@ -0,0 +1,101 @@ +{ + "Engine debug": { + "prefix": "debug", + "body": ["engine.debug(${1});"], + "description": "Log output to debug" + }, + "Get field": { + "prefix": "getField", + "body": [ + "engine.getField('${1:FieldName}').${2|getValue,getConvertedValue,getCaptionValue,focus,setValue,setRequired,setEnabled,refresh|}(${3});" + ], + "description": "Engine get field" + }, + "Set global variable": { + "prefix": "setGlobal", + "body": ["engine.setGlobalVariable('$1', $2);"], + "description": "Engine set the global variable" + }, + "Get global variable": { + "prefix": "getGlobal", + "body": ["engine.getGlobalVariable('${1:VariableName}');"], + "description": "Engine get the global variable" + }, + "Get layout": { + "prefix": "getLayout", + "body": [ + "engine.getLayout('${1:LayoutName}').getRootComposition().setVisible(${2|true,false|});" + ], + "description": "Engine get the layout" + }, + "Get process ID": { + "prefix": "getProcessInstanceId", + "body": ["execution.getProcessInstanceId(${1});"], + "description": "Engine get the process Id" + }, + "Get form data": { + "prefix": "getFormData", + "body": ["vFormService.getFormData(${1:ProcessID}, '${2:FormKey}');"], + "description": "Engine get the form data" + }, + "Load services": { + "prefix": "loadScript", + "body": ["var ${1} = libService.loadScript('${1:ScriptName}');"], + "description": "Load scripts" + }, + "function run": { + "prefix": "run", + "body": ["function run() { ", "\t$1", "}"], + "description": "function run" + }, + "function validator": { + "prefix": "validator", + "body": [ + "function validator() { ", + "\tthis.getMessage = function() {", + "\t\treturn '${1:MessageValidation}';", + "\t}", + "", + "\tthis.isValid = function() {", + "\t\treturn true;", + "\t}", + "}", + "var script = new validator();" + ], + "description": "function validator" + }, + "Get variable": { + "prefix": "getVariable", + "body": ["execution.getVariable('${1:FormName_VariableName}');"], + "description": "execution get the variable" + }, + "Execute on Server": { + "prefix": "executeOnServer", + "body": [ + "vCommunicationService.executeOnServer('${1:BridgeName}', params).then(result=>{", + "\tconsole.log(result);", + "}).catch(error=>{", + "\tconsole.log('Erro retornado da execução no servidor do vitruvio', error);", + "});" + ], + "description": "execution bridge" + }, + "Create panel-form": { + "prefix": "!panel-form", + "body": [ + "", + "", + "\t
", + "\t\t${2}", + "\t\t${3}", + "\t\t", + "\t\t\t", + "\t\t\t\t${0}", + "\t\t\t", + "\t\t", + "\t
", + "
" + ] + } + } +