From a5caa4e515d1652604281d5a21134939a3d21136 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Mrzyg=C5=82=C3=B3d?= Date: Thu, 26 Oct 2017 11:38:21 +0200 Subject: [PATCH 1/3] #36 - fixed adding multiple resources of the same type from the toolbox --- app/parsers/templateParser.js | 2 +- app/reducers/fileDialog.js | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/app/parsers/templateParser.js b/app/parsers/templateParser.js index 0825175..b62f7e4 100644 --- a/app/parsers/templateParser.js +++ b/app/parsers/templateParser.js @@ -31,7 +31,7 @@ export default class TemplateParser { parseTemplate(): Template { const parsedTemplate = { - schema: this.json.$schema, + schema: this.json.$schema || '', contentVersion: this.json.contentVersion, outputs: this.getOutputs(), parameters: this.getParameters(), diff --git a/app/reducers/fileDialog.js b/app/reducers/fileDialog.js index f9b6f9a..85a212d 100644 --- a/app/reducers/fileDialog.js +++ b/app/reducers/fileDialog.js @@ -102,13 +102,19 @@ export default function fileDialog(state: fileDialogStateType = initialState, ac isError: false }); case ADD_RESOURCE: { + var uuid = Uuid.uuidv4(); state.fileData.resources.push({ - id: `${action.resourceType}${Uuid.uuidv4()}`, - displayName: action.resourceType, - name: action.resourceType, + id: `${action.resourceType}${uuid}`, + displayName: `${action.resourceType}-${uuid}`, + name: `${action.resourceType}-${uuid}`, dependsOn: [], type: action.resourceType }); + + state.fileData.schema === '' ? + state.fileData.schema = 'http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#' : + state.fileData.schema = state.fileData.schema; + return Object.assign({}, state, { selectedFilename: 'EDITED TEMPLATE', fileData: state.fileData, From 16e36b45beb4d9f9e1a1ee4931ac6cfc4b7440ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Mrzyg=C5=82=C3=B3d?= Date: Thu, 26 Oct 2017 11:40:27 +0200 Subject: [PATCH 2/3] #36 - removed parameter state re-assign --- app/reducers/fileDialog.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app/reducers/fileDialog.js b/app/reducers/fileDialog.js index 85a212d..c06cb66 100644 --- a/app/reducers/fileDialog.js +++ b/app/reducers/fileDialog.js @@ -102,7 +102,7 @@ export default function fileDialog(state: fileDialogStateType = initialState, ac isError: false }); case ADD_RESOURCE: { - var uuid = Uuid.uuidv4(); + const uuid = Uuid.uuidv4(); state.fileData.resources.push({ id: `${action.resourceType}${uuid}`, displayName: `${action.resourceType}-${uuid}`, @@ -111,10 +111,6 @@ export default function fileDialog(state: fileDialogStateType = initialState, ac type: action.resourceType }); - state.fileData.schema === '' ? - state.fileData.schema = 'http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#' : - state.fileData.schema = state.fileData.schema; - return Object.assign({}, state, { selectedFilename: 'EDITED TEMPLATE', fileData: state.fileData, From 3233e732b367f2719ea8d140d7f6d34b447230cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Mrzyg=C5=82=C3=B3d?= Date: Thu, 26 Oct 2017 11:41:35 +0200 Subject: [PATCH 3/3] Bump version --- app/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/package.json b/app/package.json index dda8fab..345ba8f 100644 --- a/app/package.json +++ b/app/package.json @@ -1,7 +1,7 @@ { "name": "ARMata", "productName": "ARMata", - "version": "v1.0.0-beta4", + "version": "v1.0.0-beta5", "description": "ARM templates visualizer & editor", "main": "./main.prod.js", "author": {