From 0cee9148cf9b2436de67e9f95cc2e963bdfcee2c Mon Sep 17 00:00:00 2001 From: vcmirko <37864434+wfaguy@users.noreply.github.com> Date: Thu, 8 Jun 2023 19:06:18 +0200 Subject: [PATCH 1/4] bump versions --- client/package.json | 2 +- server/package.json | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/client/package.json b/client/package.json index 8312e162..6c7ec22e 100644 --- a/client/package.json +++ b/client/package.json @@ -12,7 +12,7 @@ "lint": "vue-cli-service lint" }, "dependencies": { - "core-js": "~3.30.1", + "core-js": "~3.30.2", "vue": "~2.6.14", "axios": "~1.4.0", "es6-promise": "~4.2.8", diff --git a/server/package.json b/server/package.json index 13b6acc4..c0d2984a 100644 --- a/server/package.json +++ b/server/package.json @@ -17,7 +17,7 @@ "clean": "rimraf dist" }, "dependencies": { - "core-js": "~3.30.1", + "core-js": "~3.30.2", "axios": "~1.4.0", "cors": "~2.8.5", "bcrypt": "~5.1.0", @@ -52,8 +52,8 @@ "ldap-authentication": "~2.3.3", "ldapjs": "~2.3.3", "read-last-lines": "~1.8.0", - "swagger-ui-express": "~4.6.2", - "nodemailer": "~6.9.1", + "swagger-ui-express": "~4.6.3", + "nodemailer": "~6.9.3", "nanoid": "~3.3.6" }, "devDependencies": { From b4ed92803772c618a04d0054f3e2f8855e5bdf3f Mon Sep 17 00:00:00 2001 From: vcmirko <37864434+wfaguy@users.noreply.github.com> Date: Fri, 14 Jul 2023 14:17:17 +0200 Subject: [PATCH 2/4] bump versions --- CHANGELOG.md | 10 +++++ client/package.json | 2 +- client/public/assets/_variables.scss | 3 +- client/src/components/Form.vue | 11 +++++ server/package.json | 2 +- server/schema/forms_schema.json | 42 ++++++------------ server/schema/help.yaml | 66 +++++++++++++++++++++++++--- server/src/swagger.json | 2 +- 8 files changed, 101 insertions(+), 37 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0239293d..98318466 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- Modals are now 1024px + +### Added + +- Allow enum array-of-objects values. +- New alias local_out (=> hidden local expression) +- New alias credential (=> hidden local expression with asCredential true) + ## [4.0.11] - 2023-06-08 ### Added diff --git a/client/package.json b/client/package.json index 6c7ec22e..544f5d4d 100644 --- a/client/package.json +++ b/client/package.json @@ -1,6 +1,6 @@ { "name": "ansible_forms_vue", - "version": "4.0.11", + "version": "4.0.12", "private": true, "scripts": { "serve": "vue-cli-service serve", diff --git a/client/public/assets/_variables.scss b/client/public/assets/_variables.scss index 6f1d8fb4..9723660f 100644 --- a/client/public/assets/_variables.scss +++ b/client/public/assets/_variables.scss @@ -50,4 +50,5 @@ $navbar-dropdown-arrow: $navbar-item-color; $bulmaswatch-import-font: true !default; $box-shadow: 0 0 0 1px $border; -$card-shadow: 0 0 0 1px $border; \ No newline at end of file +$card-shadow: 0 0 0 1px $border; +$modal-content-width: 1024px; \ No newline at end of file diff --git a/client/src/components/Form.vue b/client/src/components/Form.vue index dd4d2aae..47763cf3 100644 --- a/client/src/components/Form.vue +++ b/client/src/components/Form.vue @@ -1989,6 +1989,17 @@ item.type="expression" item.runLocal=true } + if(item.type=="local_out"){ + item.hide=item.hide??true + item.type="expression" + item.runLocal=true + } + if(item.type=="credential"){ + item.hide=item.hide??true + item.asCredential=true + item.type="expression" + item.runLocal=true + } }) // initialize defaults this.currentForm.fields.forEach((item, i) => { diff --git a/server/package.json b/server/package.json index c0d2984a..21f0d498 100644 --- a/server/package.json +++ b/server/package.json @@ -1,6 +1,6 @@ { "name": "ansible_forms", - "version": "4.0.11", + "version": "4.0.12", "repository": { "type": "git", "url": "git://github.com/ansibleguy76/ansibleforms.git" diff --git a/server/schema/forms_schema.json b/server/schema/forms_schema.json index f71aaf0f..44e2c05a 100644 --- a/server/schema/forms_schema.json +++ b/server/schema/forms_schema.json @@ -801,7 +801,7 @@ { "properties": { "type": { - "enum": ["expression"] + "enum": ["expression","local","local_out","credential"] }, "values": {"not":{}}, "minValue": {"not":{}}, @@ -822,30 +822,6 @@ }, "required": ["expression"] }, - { - "properties": { - "type": { - "enum": ["local"] - }, - "values": {"not":{}}, - "minValue": {"not":{}}, - "maxValue": {"not":{}}, - "sticky": {"not":{}}, - "horizontal": {"not":{}}, - "pctColumns": {"not":{}}, - "filterColumns": {"not":{}}, - "dbConfig": {"not":{}}, - "multiple": {"not":{}}, - "allowDelete": {"not":{}}, - "allowInsert": {"not":{}}, - "deleteMarker": {"not":{}}, - "insertMarker": {"not":{}}, - "readonlyColumns": {"not":{}}, - "keydown": {"not":{}}, - "outputObject": {"not":{}} - }, - "required": ["expression"] - }, { "properties": { "type": { @@ -974,7 +950,7 @@ "properties": { "type": { "type": "string", - "enum": ["text","textarea", "password", "checkbox", "enum", "query", "number", "radio", "expression","local", "table","datetime","html"] + "enum": ["text","textarea", "password", "checkbox", "enum", "query", "number", "radio", "expression","local","local_out","credential", "table","datetime","html"] }, "name": { "$id": "/formfield", @@ -1128,7 +1104,12 @@ "help": {"type": "string"}, "values": { "type": "array", - "items": {"type": "string"} + "items": { + "anyOf": [ + {"type": "string"}, + {"type": "object"} + ] + } }, "multiple": { "type": "boolean", @@ -1391,7 +1372,12 @@ }, "values": { "type": "array", - "items": {"type": "string"} + "items": { + "anyOf": [{"type": "string"}, + {"type": "integer"}, + {"type": "boolean"} + ] + } }, "icon": { "$ref": "/icon" diff --git a/server/schema/help.yaml b/server/schema/help.yaml index 02d4823a..67eed13b 100644 --- a/server/schema/help.yaml +++ b/server/schema/help.yaml @@ -1675,12 +1675,17 @@ * **database query** : you can use the query and dbConfig property to query a mysql, mssql server, postgres or mongodb. * **expression** : you can use the expression property to create or retrieve data. in this case the output of the expression can be any type. - The expression itself is pure javascript. You can do inline javascript or you can use a function. Read more on security concerns about expressions You can extend the functions with your own in the custom.js file. You can have synchronous and asynchronous functions. This allows you to retrieve any kind of data, whether it's reading a file or accessing a rest-api, or querying a foreign database. You can run the expression locally (`runLocal`) in the browser for simple expressions. This is faster and there is no limitation on the expression. Use the alias type `local` to quickly make an expression type with runLocal, hide and noOutput. + The expression itself is pure javascript. You can do inline javascript or you can use a function. Read more on security concerns about expressions You can extend the functions with your own in the custom.js file. You can have synchronous and asynchronous functions. This allows you to retrieve any kind of data, whether it's reading a file or accessing a rest-api, or querying a foreign database. You can run the expression locally (`runLocal`) in the browser for simple expressions. This is faster and there is no limitation on the expression. + Use the alias type `local` to quickly make an expression type with runLocal, hide and noOutput. + Use the alias type `local_out` to quickly make an expression type with runLocal, hide + Use the alias type `credential` to quickly make an expression type with runLocal, hide, asCredential Advanced helper functions (local and remote) are available, to query from rest for example. Explore the separate section on Expressions for multiple demo's. Alias : `local` (type='expression', runLocal=true, hide=true, noOutput=true) // since version 4.0.10 + Alias : `local_out` (type='expression', runLocal=true, hide=true) // since version 4.0.12 + Alias : `credential` (type='expression', runLocal=true, hide=true, asCredential=true) // since version 4.0.10 examples: - name: Expressions code: | @@ -1915,7 +1920,7 @@ changelog: - version: 4.0.0 type: added - description: Add an exlamation mark `!` before the referencing field's name, to invert the match. + description: Add an exlamation mark `!` before the referencing field's name, to invert the match. Wrap it in quotes because the `!` mark has special meaning in YAML. examples: - name: Show a field based on a checkbox code: | @@ -1954,6 +1959,18 @@ - name: has_private_office values: - true + - name: office_name2 + type: text + label: What's the name of the office + dependencyFn: or + dependencies: + - name: "!job_type" # this will invert/negate + values: + - IT + - HR + - name: has_private_office + values: + - true - name: keydown type: boolean short: Enable responsiveness @@ -1985,6 +2002,31 @@ description: | Enable multiple select with dropdown boxes. with_types: enum + - name: values + type: array + short: A list of values + description: | + To manually populate an enum field + with_types: enum + examples: + - name: list of cities + code: | + - name: cities + type: enum + values: + - Rome + - Paris + - name: cities2 + type: enum + values: + - name: Rome + short: RO + - name: Paris + short: PA + - name: your_choice + type: local + expression: "'You chose $(cities2.name) or just short $(cities2.short)'" + - name: default type: many short: Default value @@ -2200,6 +2242,9 @@ type: expression expression: "'vcenter'" asCredential: true + - name: vcenter_creds2 + type: credential # alias for cleaner code + expression: "'vcenter'" # in the backend following will happen : # - lookup credential call 'vcenter' @@ -2231,7 +2276,9 @@ An expression supports placeholders. Read more about placeholders here. [TODO] Click here to find out more about the predefined functions. [TODO] - **tip** : use the alias `local` (type='expression',runLocal=true,hide=true,noOutput=true) + **tip** : use the alias `local` (type='expression',runLocal=true,hide=true,noOutput=true) + **tip** : use the alias `local_out` (type='expression',runLocal=true,hide=true) + **tip** : use the alias `credential` (type='expression',runLocal=true,hide=true,asCredential=true) with_types: enum, expression, table, html examples: - name: Get a list of users from a rest api @@ -2263,7 +2310,14 @@ runLocal: true // this is default with type=local hide: true // this is default with type=local noOutput: true // this is default with type=local - + - name: Use the alias `local_out` + code: | + - name: uppercase + type: local + expression: "'test'.toUpperCase()" + runLocal: true // this is default with type=local + hide: true // this is default with type=local + - name: runLocal type: boolean default: false @@ -3164,7 +3218,9 @@ The following example are assumed to run with the field property `runLocal` true. They are ran in the sandbox of the browser and can leverage the full javascript engine. - **Tip** : use the type `local` as an alias for 'type=expression, runLocal=true, hide=true, noOutput=true' + **Tip** : use the type `local` as an alias for 'type=expression, runLocal=true, hide=true, noOutput=true' + **Tip** : use the type `local_out` as an alias for 'type=expression, runLocal=true, hide=true' + **Tip** : use the type `credential` as an alias for 'type=expression, runLocal=true, hide=true, asCredential: true' examples: - name: naming convention description: Use string manipulations to apply naming conventions diff --git a/server/src/swagger.json b/server/src/swagger.json index 96e87917..adce3f05 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.11", + "version": "4.0.12", "title": "AnsibleForms", "contact": { "email": "info@ansibleforms.com" From b0ff2f77ab458d358f4606cbf53a60ae8e97fb33 Mon Sep 17 00:00:00 2001 From: vcmirko <37864434+wfaguy@users.noreply.github.com> Date: Sat, 15 Jul 2023 16:49:33 +0200 Subject: [PATCH 3/4] update a few base packages --- client/package.json | 2 +- server/package.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/client/package.json b/client/package.json index 544f5d4d..7a230bca 100644 --- a/client/package.json +++ b/client/package.json @@ -12,7 +12,7 @@ "lint": "vue-cli-service lint" }, "dependencies": { - "core-js": "~3.30.2", + "core-js": "~3.31.1", "vue": "~2.6.14", "axios": "~1.4.0", "es6-promise": "~4.2.8", diff --git a/server/package.json b/server/package.json index 21f0d498..a013d2ff 100644 --- a/server/package.json +++ b/server/package.json @@ -17,7 +17,7 @@ "clean": "rimraf dist" }, "dependencies": { - "core-js": "~3.30.2", + "core-js": "~3.31.1", "axios": "~1.4.0", "cors": "~2.8.5", "bcrypt": "~5.1.0", @@ -46,7 +46,7 @@ "mongodb":"~4.11.0", "pg":"~8.10.0", "ip":"1.1.8", - "dayjs": "1.11.7", + "dayjs": "1.11.9", "fs-extra":"~10.1.0", "node-cache":"~5.1.2", "ldap-authentication": "~2.3.3", From 8e2f41fc1ff68ddceb4282143e17700e5847b964 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Sat, 15 Jul 2023 14:55:35 +0000 Subject: [PATCH 4/4] Prepare release 4.0.12 --- CHANGELOG.md | 8 ++++++-- app_versions.gradle | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 98318466..522545d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,9 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [4.0.12] - 2023-07-15 + ### Changed -- Modals are now 1024px +- Modals are now 1024px ### Added @@ -534,7 +536,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.11...HEAD +[Unreleased]: https://github.com/ansibleguy76/ansibleforms/compare/4.0.12...HEAD + +[4.0.12]: https://github.com/ansibleguy76/ansibleforms/compare/4.0.11...4.0.12 [4.0.11]: https://github.com/ansibleguy76/ansibleforms/compare/4.0.10...4.0.11 diff --git a/app_versions.gradle b/app_versions.gradle index 84001783..b37e644c 100644 --- a/app_versions.gradle +++ b/app_versions.gradle @@ -1,2 +1,2 @@ -ext.version_code = 40011 -ext.version_name = "4.0.11" +ext.version_code = 40012 +ext.version_name = "4.0.12"