Skip to content

Commit

Permalink
Merge pull request #89 from ansibleguy76/release/v4.0.12
Browse files Browse the repository at this point in the history
v4.0.12 into main
  • Loading branch information
ansibleguy76 authored Jul 15, 2023
2 parents 992dd8c + 8e2f41f commit e180462
Show file tree
Hide file tree
Showing 9 changed files with 113 additions and 45 deletions.
16 changes: 15 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@ 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

### 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
Expand Down Expand Up @@ -524,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

Expand Down
4 changes: 2 additions & 2 deletions app_versions.gradle
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
ext.version_code = 40011
ext.version_name = "4.0.11"
ext.version_code = 40012
ext.version_name = "4.0.12"
4 changes: 2 additions & 2 deletions client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ansible_forms_vue",
"version": "4.0.11",
"version": "4.0.12",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
Expand All @@ -12,7 +12,7 @@
"lint": "vue-cli-service lint"
},
"dependencies": {
"core-js": "~3.30.1",
"core-js": "~3.31.1",
"vue": "~2.6.14",
"axios": "~1.4.0",
"es6-promise": "~4.2.8",
Expand Down
3 changes: 2 additions & 1 deletion client/public/assets/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
$card-shadow: 0 0 0 1px $border;
$modal-content-width: 1024px;
11 changes: 11 additions & 0 deletions client/src/components/Form.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
10 changes: 5 additions & 5 deletions server/package.json
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -17,7 +17,7 @@
"clean": "rimraf dist"
},
"dependencies": {
"core-js": "~3.30.1",
"core-js": "~3.31.1",
"axios": "~1.4.0",
"cors": "~2.8.5",
"bcrypt": "~5.1.0",
Expand Down Expand Up @@ -46,14 +46,14 @@
"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",
"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": {
Expand Down
42 changes: 14 additions & 28 deletions server/schema/forms_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,7 @@
{
"properties": {
"type": {
"enum": ["expression"]
"enum": ["expression","local","local_out","credential"]
},
"values": {"not":{}},
"minValue": {"not":{}},
Expand All @@ -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": {
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -1128,7 +1104,12 @@
"help": {"type": "string"},
"values": {
"type": "array",
"items": {"type": "string"}
"items": {
"anyOf": [
{"type": "string"},
{"type": "object"}
]
}
},
"multiple": {
"type": "boolean",
Expand Down Expand Up @@ -1391,7 +1372,12 @@
},
"values": {
"type": "array",
"items": {"type": "string"}
"items": {
"anyOf": [{"type": "string"},
{"type": "integer"},
{"type": "boolean"}
]
}
},
"icon": {
"$ref": "/icon"
Expand Down
66 changes: 61 additions & 5 deletions server/schema/help.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down Expand Up @@ -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: |
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion server/src/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "[email protected]"
Expand Down

0 comments on commit e180462

Please sign in to comment.