Saving Plugins Working!
This commit is contained in:
1 parent
cd791d84b0
commit
37c3a9e180
5 files changed
+12
-10
No files matched your search
@@ -1193,7 +1193,6 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE
|
||||
let folder = requestParameters[3]
|
||||
let fileName = requestParameters[4]
|
||||
let filePath = global.env.PATH_TO_PROJECTS + '/' + project + '/Plugins/' + folder
|
||||
createNewDir(filePath)
|
||||
let fileContent = JSON.stringify(plugin, undefined, 4)
|
||||
const fs = require('fs')
|
||||
fs.writeFileSync(filePath + '/' + fileName + '.json', fileContent)
|
||||
|
||||
@@ -153,7 +153,7 @@ function newFoundationsFunctionLibraryUiObjectsFromNodes() {
|
||||
name = config.fileName
|
||||
}
|
||||
if (config.folderName !== undefined) {
|
||||
folder = config.fileName
|
||||
folder = config.folderName
|
||||
}
|
||||
} catch (err) { }
|
||||
|
||||
|
||||
@@ -250,7 +250,7 @@ function newWorkspace() {
|
||||
folderName === undefined ||
|
||||
nodeType === undefined
|
||||
) {
|
||||
pluginFile.payload.uiObject.setWarningMessage('This Plugin could not be saved because some Config Properties were missing.',500)
|
||||
pluginFile.payload.uiObject.setWarningMessage('This Plugin could not be saved because some Config Properties were missing.', 500)
|
||||
continue
|
||||
}
|
||||
/*
|
||||
@@ -260,10 +260,13 @@ function newWorkspace() {
|
||||
let pluginToSave = getHierarchyHeadsByCodeNameAndNodeType(fileName, nodeType)
|
||||
|
||||
if (pluginToSave === undefined) {
|
||||
pluginFile.payload.uiObject.setWarningMessage('This Plugin could not be saved because it could not be found at the workspace.',500)
|
||||
pluginFile.payload.uiObject.setWarningMessage('This Plugin could not be saved because it could not be found at the workspace.', 500)
|
||||
continue
|
||||
}
|
||||
let fileContent = JSON.stringify(pluginToSave, undefined, 4)
|
||||
let fileContent = JSON.stringify(
|
||||
UI.projects.foundations.functionLibraries.protocolNode.getProtocolNode(pluginToSave, false, false, true, true, true),
|
||||
undefined,
|
||||
4)
|
||||
|
||||
httpRequest(fileContent, 'SavePlugin' + '/' + project + '/' + folderName + '/' + fileName, onResponse)
|
||||
|
||||
@@ -274,8 +277,8 @@ function newWorkspace() {
|
||||
pluginFile.payload.uiObject.setInfoMessage('Plugin Saved.')
|
||||
return
|
||||
}
|
||||
console.log('[ERROR] Saving Plugin File: ' + data)
|
||||
pluginFile.payload.uiObject.setErrorMessage('This Plugin Could not be Saved. ' + data)
|
||||
console.log('[ERROR] Saving Plugin File: ' + JSON.stringify(data))
|
||||
pluginFile.payload.uiObject.setErrorMessage('This Plugin Could not be Saved. ' + JSON.stringify(data), 500)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"type": "User Profile",
|
||||
"name": "Julian-Molina",
|
||||
"config": "{\n \"signature\": {\n \"message\": \"julian-molina\",\n \"messageHash\": \"0x34eae63163cc918a1a1fab82836b0f15e33051925812cf7d5f8ffe5ff0854f2c\",\n \"v\": \"0x1b\",\n \"r\": \"0x8560ff34239215408cb869d3c90c30ed11ab6634c4269b255d2b4159b7690fe5\",\n \"s\": \"0x017b2c5e080b0f340dcd09f8ba5c67119a3b62c375252d96f541c57db109a0b7\",\n \"signature\": \"0x8560ff34239215408cb869d3c90c30ed11ab6634c4269b255d2b4159b7690fe5017b2c5e080b0f340dcd09f8ba5c67119a3b62c375252d96f541c57db109a0b71b\"\n }\n}",
|
||||
"config": "{\"signature\":{\"message\":\"julian-molina\",\"messageHash\":\"0x34eae63163cc918a1a1fab82836b0f15e33051925812cf7d5f8ffe5ff0854f2c\",\"v\":\"0x1b\",\"r\":\"0x8560ff34239215408cb869d3c90c30ed11ab6634c4269b255d2b4159b7690fe5\",\"s\":\"0x017b2c5e080b0f340dcd09f8ba5c67119a3b62c375252d96f541c57db109a0b7\",\"signature\":\"0x8560ff34239215408cb869d3c90c30ed11ab6634c4269b255d2b4159b7690fe5017b2c5e080b0f340dcd09f8ba5c67119a3b62c375252d96f541c57db109a0b71b\"},\"codeName\":\"Julian-Molina\"}",
|
||||
"project": "Governance",
|
||||
"tokenPowerSwitch": {
|
||||
"type": "Token Power Switch",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"type": "User Profile",
|
||||
"name": "Luis-Fernando-Molina",
|
||||
"config": "{\n \"tokens\": 10000000,\n \"signature\": {\n \"message\": \"Luis-Fernando-Molina\",\n \"messageHash\": \"0x443abf3389e332a62d21b84dd12e271cb428d334195d3aeb986ca85ee53cccb9\",\n \"v\": \"0x1b\",\n \"r\": \"0x90293b042c180aa21b05f0356f31688c597be4ff2df136f63a2b8a899c658eb0\",\n \"s\": \"0x42abf909024d34217430e42ebadc96b7834218cc86a4c295a2ae419ff2fca6e3\",\n \"signature\": \"0x90293b042c180aa21b05f0356f31688c597be4ff2df136f63a2b8a899c658eb042abf909024d34217430e42ebadc96b7834218cc86a4c295a2ae419ff2fca6e31b\"\n }\n}",
|
||||
"config": "{\"tokens\":10000000,\"signature\":{\"message\":\"Luis-Fernando-Molina\",\"messageHash\":\"0x443abf3389e332a62d21b84dd12e271cb428d334195d3aeb986ca85ee53cccb9\",\"v\":\"0x1b\",\"r\":\"0x90293b042c180aa21b05f0356f31688c597be4ff2df136f63a2b8a899c658eb0\",\"s\":\"0x42abf909024d34217430e42ebadc96b7834218cc86a4c295a2ae419ff2fca6e3\",\"signature\":\"0x90293b042c180aa21b05f0356f31688c597be4ff2df136f63a2b8a899c658eb042abf909024d34217430e42ebadc96b7834218cc86a4c295a2ae419ff2fca6e31b\"},\"codeName\":\"Luis-Fernando-Molina\"}",
|
||||
"project": "Governance",
|
||||
"tokenPowerSwitch": {
|
||||
"type": "Token Power Switch",
|
||||
@@ -18,7 +18,7 @@
|
||||
"referralProgram": {
|
||||
"type": "Referral Program",
|
||||
"name": "New Referral Program",
|
||||
"config": "{\n \"percentage\": 50\n}",
|
||||
"config": "{\n \"percentage\": 60\n}",
|
||||
"project": "Governance",
|
||||
"userReferrers": [
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user