diff --git a/CHANGELOG.md b/CHANGELOG.md index 348b4502..a2ad79db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [4.0.15] - 2023-08-09 + +### Added + +- Installation video to documentation +- add fnGetNumberedName as local function + +### Fixed + +- Table expression issue fixed + ## [4.0.14] - 2023-08-03 ### Added @@ -559,7 +570,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Allow change password for current local user - Start tracking versions -[Unreleased]: https://github.com/ansibleguy76/ansibleforms/compare/4.0.14...HEAD +[Unreleased]: https://github.com/ansibleguy76/ansibleforms/compare/4.0.15...HEAD + +[4.0.15]: https://github.com/ansibleguy76/ansibleforms/compare/4.0.14...4.0.15 [4.0.14]: https://github.com/ansibleguy76/ansibleforms/compare/4.0.13...4.0.14 diff --git a/app_versions.gradle b/app_versions.gradle index a3d1b02c..7fb326b0 100644 --- a/app_versions.gradle +++ b/app_versions.gradle @@ -1,2 +1,2 @@ -ext.version_code = 40014 -ext.version_name = "4.0.14" +ext.version_code = 40015 +ext.version_name = "4.0.15" diff --git a/client/package.json b/client/package.json index 0ac3f2a4..eb0e8167 100644 --- a/client/package.json +++ b/client/package.json @@ -1,12 +1,12 @@ { "name": "ansible_forms_vue", - "version": "4.0.14", + "version": "4.0.15", "private": true, "scripts": { "serve": "vue-cli-service serve", "start": "nodemon --exec 'vue-cli-service serve --mode development'", "remove": "rm -rdf ./../server/views || exit 0", - "copy": "cp -R dist ../server/views", + "copy": "cp -R dist ../server/views && cp ./../docs/_data/help.yaml ../server", "bundle": "npm run build && npm run remove && npm run copy", "build": "vue-cli-service build", "lint": "vue-cli-service lint" diff --git a/client/src/components/Form.vue b/client/src/components/Form.vue index da3a0bf8..a52972ab 100644 --- a/client/src/components/Form.vue +++ b/client/src/components/Form.vue @@ -904,6 +904,7 @@ // instead of taking the default value, see if it needs to be evaluated // allowing dynamic defaults getDefaultValue(fieldname,value){ + if(value!=undefined){ var _value = this.replacePlaceholderInString(value).value @@ -911,7 +912,7 @@ if(this.fieldOptions[fieldname].evalDefault){ var r=undefined try{ - r=eval(_value) + r=Helpers.evalSandbox(_value) return r }catch(e){ console.log(`Error evaluating default value : ${e}`) @@ -1301,100 +1302,6 @@ //---------------------------------------------------------------- startDynamicFieldsLoop() { // this.$toast("Start eval") - function matchRuleShort(str, rule) { - var escapeRegex = (str) => str.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1"); // eslint-disable-line - return new RegExp("^" + rule.split("*").map(escapeRegex).join(".*") + "$").test(str); // eslint-disable-line - } - - function compareProps(x1,x2,p){ - for(let i=0;i b[property]) ? 1 : 0; - return result * sortOrder; - } - } - - function dynamicSortMultiple() { - /* - * save the arguments object as it will be overwritten - * note that arguments object is an array-like object - * consisting of the names of the properties to sort by - */ - var props = arguments; - return function (obj1, obj2) { - var i = 0, result = 0, numberOfProperties = props.length; - /* try getting a different result from 0 (equal) - * as long as we have extra properties to compare - */ - while(result === 0 && i < numberOfProperties) { - result = dynamicSort(props[i])(obj1, obj2); - i++; - } - return result; - } - } - - class fnArray extends Array { - sortBy(...args) { - return this.sort(dynamicSortMultiple(...args)); - } - distinctBy(...args) { - return this.filter((a, i) => this.findIndex((s) => compareProps(a,s,args)) === i) - } - filterBy(...args) { - let props=Object.keys(args[0]) - return this.filter((x)=>{ - return compareProps(x,args[0],props) - }) - } - regexBy(...args) { - let props=Object.keys(args[0]) - return this.filter((x)=>{ - return comparePropsRegex(x,args[0],props) - }) - } - selectAttr(...args) { - let props=Object.keys(args[0]) - - return this.map((x)=>{ - let o = {} - for(let i=0;i{ + var regexp=new RegExp(regex,"g"); + var matches=regexp.exec(item) + if(matches && matches.length==2){ + return parseInt(matches[1]) + }else{ + null + } + }).filter((item)=>(item)) + var gaps=nrs.reduce(function(acc, cur, ind, arr) { + var diff = cur - arr[ind-1]; + if (diff > 1) { + var i = 1; + while (i < diff) { + acc.push(arr[ind-1]+i); + i++; + } + } + return acc; + }, []); + var max=(nrs.length>0)?Math.max(...nrs):null + var gap=(gaps.length>0)?Math.min(...gaps):null + if(max){ + nr=max+1 + } + if(fillgap && gap){ + nr=gap + } + if(nr){ + var tmp = pattern.replace(nrsequence,nr.toString().padStart(nrsequence.length,"0")) + return tmp + }else{ + console.log("fnGetNumberedName, no pattern matches found in the list") + return value + } + }else{ + console.log("fnGetNumberedName, no pattern found, use ### for numbers") + return value + } + } + function matchRuleShort(str, rule) { + var escapeRegex = (str) => str.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1"); // eslint-disable-line + return new RegExp("^" + rule.split("*").map(escapeRegex).join(".*") + "$").test(str); // eslint-disable-line + } + + function compareProps(x1,x2,p){ + for(let i=0;i b[property]) ? 1 : 0; + return result * sortOrder; + } + } + + function dynamicSortMultiple() { + /* + * save the arguments object as it will be overwritten + * note that arguments object is an array-like object + * consisting of the names of the properties to sort by + */ + var props = arguments; + return function (obj1, obj2) { + var i = 0, result = 0, numberOfProperties = props.length; + /* try getting a different result from 0 (equal) + * as long as we have extra properties to compare + */ + while(result === 0 && i < numberOfProperties) { + result = dynamicSort(props[i])(obj1, obj2); + i++; + } + return result; + } + } + + + class fnArray extends Array { + sortBy(...args) { + return this.sort(dynamicSortMultiple(...args)); + } + distinctBy(...args) { + return this.filter((a, i) => this.findIndex((s) => compareProps(a,s,args)) === i) + } + filterBy(...args) { + let props=Object.keys(args[0]) + return this.filter((x)=>{ + return compareProps(x,args[0],props) + }) + } + regexBy(...args) { + let props=Object.keys(args[0]) + return this.filter((x)=>{ + return comparePropsRegex(x,args[0],props) + }) + } + selectAttr(...args) { + let props=Object.keys(args[0]) + + return this.map((x)=>{ + let o = {} + for(let i=0;iAll rights reserved. - social_list: - #- network_name: facebook - # profile_url: '#' - #- network_name: twitter - # profile_url: '#' - #- network_name: instagram - # profile_url: '#' - #- network_name: youtube - # profile_url: '#' + social: + - item_icon: github + item_name: Ansible Forms on Github + item_url: https://github.com/ansibleguy76 + - item_icon: docker + item_name: Ansible Forms on Docker Hub + item_url: https://hub.docker.com/r/ansibleguy/ansibleforms + - item_icon: youtube + item_name: Video's about ansible and Ansible Forms + item_url: https://www.youtube.com/@ansibleguy76/videos google_analytics: - tracking_code: # Add your Google Analytics tracking code to activate Google Analytics + tracking_code: G-P2KE4SYQ47 comments: disqus_forum_shortname: # Add your disqus forum shortname to activate comments diff --git a/docs/doks-theme/_includes/google-analytics.html b/docs/doks-theme/_includes/google-analytics.html index d8521845..b71ffe9c 100644 --- a/docs/doks-theme/_includes/google-analytics.html +++ b/docs/doks-theme/_includes/google-analytics.html @@ -1,11 +1,11 @@ {% if jekyll.environment == "production" and site.doks.google_analytics.tracking_code %} + + {% endif %} diff --git a/docs/doks-theme/_includes/site-footer.html b/docs/doks-theme/_includes/site-footer.html index ef551b6a..c0fbec0a 100644 --- a/docs/doks-theme/_includes/site-footer.html +++ b/docs/doks-theme/_includes/site-footer.html @@ -1,4 +1,4 @@ -{% if site.doks.footer.content.logo.image or site.doks.footer.content.logo.text or site.doks.footer.content.copyright or site.doks.footer.social_list %} +{% if site.doks.footer.content.logo.image or site.doks.footer.content.logo.text or site.doks.footer.content.copyright or site.doks.footer.social %}