From 426bafffe2b2312d4ee51c1ff29e336256aa85c2 Mon Sep 17 00:00:00 2001 From: Mirko Van Colen Date: Fri, 10 Nov 2023 11:27:35 +0100 Subject: [PATCH] bugfix + new netapp collection 22.8.2 --- CHANGELOG.md | 5 +++++ client/package.json | 2 +- client/src/components/Form.vue | 10 +++++----- server/package.json | 2 +- server/src/swagger.json | 2 +- 5 files changed, 13 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cc4c2157..d7d5d965 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed + +- javascript replace error with defaults +- Newer Netapp collection 22.8.2 + ## [4.0.17] - 2023-11-07 ### Fixed diff --git a/client/package.json b/client/package.json index 26f7d74f..b11e90e6 100644 --- a/client/package.json +++ b/client/package.json @@ -1,6 +1,6 @@ { "name": "ansible_forms_vue", - "version": "4.0.17", + "version": "4.0.18", "private": true, "scripts": { "serve": "vue-cli-service serve", diff --git a/client/src/components/Form.vue b/client/src/components/Form.vue index 4971e0fb..bde69e04 100644 --- a/client/src/components/Form.vue +++ b/client/src/components/Form.vue @@ -1088,7 +1088,7 @@ }else{ // console.log("found no in " + foundfield + " in " + field) } - foundfield=foundfield.replace(/\[[0-9]*\]/,'') // xxx[y] => xxx + foundfield=foundfield?.replace(/\[[0-9]*\]/,'') // xxx[y] => xxx if(fields.includes(foundfield)){ // does field xxx exist in our form ? //console.log(foundfield + " is a real field") if(foundfield in ref.dynamicFieldDependencies){ // did we declare it before ? @@ -1270,7 +1270,7 @@ // console.log("item = " + value) // console.log(typeof value) // console.log(testRegex) - value = value.replace(/\n+/g, '') // put everything in 1 line. + value = value?.replace(/\n+/g, ' ') // put everything in 1 line. matches=[...value.matchAll(testRegex)] // force match array for(match of matches){ // console.log("-> match : " + match[0] + "->" + match[1]) @@ -1286,7 +1286,7 @@ column=ref.fieldOptions[foundfield].placeholderColumn||"" // get placeholder column } } - foundfield=foundfield.replace(/\[[0-9]*\]/,'') // make xxx[y] => xxx + foundfield=foundfield?.replace(/\[[0-9]*\]/,'') // make xxx[y] => xxx fieldvalue = undefined targetflag = undefined // mark the field as a dependent field @@ -1302,7 +1302,7 @@ fieldvalue=JSON.stringify(Helpers.replacePlaceholders(match[1],ref.form)) // allow full object reference // drop wrapping quotes if(typeof fieldvalue=="string"){ // drop quotes if string - fieldvalue=fieldvalue.replace(/^\"+/, '').replace(/\"+$/, ''); // eslint-disable-line + fieldvalue=fieldvalue?.replace(/^\"+/, '').replace(/\"+$/, ''); // eslint-disable-line }else{ // console.log(typeof fieldvalue) } @@ -1332,7 +1332,7 @@ } fieldvalue=ref.stringifyValue(fieldvalue) // console.log("replacing placeholder") - value=value.replace(foundmatch,fieldvalue); // replace the placeholder with the value + value=value?.replace(foundmatch,fieldvalue); // replace the placeholder with the value // console.log("replaced") // console.log(foundmatch + " -> " + fieldvalue) }else{ diff --git a/server/package.json b/server/package.json index 05bd4655..0d80370e 100644 --- a/server/package.json +++ b/server/package.json @@ -1,6 +1,6 @@ { "name": "ansible_forms", - "version": "4.0.17", + "version": "4.0.18", "repository": { "type": "git", "url": "git://github.com/ansibleguy76/ansibleforms.git" diff --git a/server/src/swagger.json b/server/src/swagger.json index 3e2df630..e76a106d 100644 --- a/server/src/swagger.json +++ b/server/src/swagger.json @@ -2,7 +2,7 @@ "swagger": "2.0", "info": { "description": "This is the swagger interface for AnsibleForms.\r\nUse the `/auth/login` api with basic authentication to obtain a JWT token.\r\nThen use the access token, prefixed with the word '**Bearer**' to use all other api's.\r\nNote that the access token is limited in time. You can then either login again and get a new set of tokens or use the `/token` api and the refresh token to obtain a new set (preferred).", - "version": "4.0.17", + "version": "4.0.18", "title": "AnsibleForms", "contact": { "email": "info@ansibleforms.com"