match : " + match[0] + "->" + match[1])
@@ -1398,9 +1401,8 @@
if(placeholderCheck.value!=undefined){ // expression is clean ?
// console.log(`[${item.name}] 2 : ${placeholderCheck.value}`)
// allow local run in browser
- if(item.runLocal){
+ if(item.runLocal || item.type=="html"){
// console.log("Running local expression : " + placeholderCheck.value)
-
var result
try{
// check if direct object attempt
@@ -1411,7 +1413,7 @@
result=eval(placeholderCheck.value)
}
- if(item.type=="expression") Vue.set(ref.form, item.name, result);
+ if(item.type=="expression" || item.type=="html") Vue.set(ref.form, item.name, result);
if((item.type=="query")||(item.type=="enum")) Vue.set(ref.queryresults, item.name, [].concat(result));
// table is special. if external data is passed. we take that instead of results.
if(item.type=="table" && !ref.defaults(item.name)){
diff --git a/server/schema/forms_schema.json b/server/schema/forms_schema.json
index fded66d8..278b72e6 100644
--- a/server/schema/forms_schema.json
+++ b/server/schema/forms_schema.json
@@ -829,6 +829,59 @@
},
"required": ["query", "dbConfig"]
},
+ {
+ "properties": {
+ "type": {
+ "enum": ["html"]
+ },
+ "label": {"not":{}},
+ "placeholder": {"not":{}},
+ "dateType": {"not":{}},
+ "asCredential": {"not":{}},
+ "required": {"not":{}},
+ "sameAs": {"not":{}},
+ "validIf": {"not":{}},
+ "validIfNot": {"not":{}},
+ "regex": {"not":{}},
+ "notIn": {"not":{}},
+ "in": {"not":{}},
+ "minValue": {"not":{}},
+ "maxValue": {"not":{}},
+ "minLength": {"not":{}},
+ "maxLength": {"not":{}},
+ "keydown": {"not":{}},
+ "refresh": {"not":{}},
+ "isHtml": {"not":{}},
+ "runLocal": {"not":{}},
+ "query": {"not":{}},
+ "outputObject": {"not":{}},
+ "columns": {"not":{}},
+ "pctColumns": {"not":{}},
+ "filterColumns": {"not":{}},
+ "allowDelete": {"not":{}},
+ "allowInsert": {"not":{}},
+ "deleteMarker": {"not":{}},
+ "insertMarker": {"not":{}},
+ "readonlyColumns": {"not":{}},
+ "insertColumns": {"not":{}},
+ "sticky": {"not":{}},
+ "horizontal": {"not":{}},
+ "editable": {"not":{}},
+ "valueColumn": {"not":{}},
+ "previewColumn": {"not":{}},
+ "placeholderColumn": {"not":{}},
+ "dbConfig": {"not":{}},
+ "model": {"not":{}},
+ "help": {"not":{}},
+ "values": {"not":{}},
+ "multiple": {"not":{}},
+ "size": {"not":{}},
+ "hide": {"not":{}},
+ "icon": {"not":{}},
+ "tableFields": {"not":{}}
+ },
+ "required": ["expression"]
+ },
{
"properties": {
"type": {
@@ -879,7 +932,7 @@
"properties": {
"type": {
"type": "string",
- "enum": ["text","textarea", "password", "checkbox", "enum", "query", "number", "radio", "expression", "table","datetime"]
+ "enum": ["text","textarea", "password", "checkbox", "enum", "query", "number", "radio", "expression", "table","datetime","html"]
},
"name": {
"$id": "/formfield",
@@ -1224,7 +1277,7 @@
"properties": {
"type": {
"type": "string",
- "enum": ["text","textarea", "password", "checkbox", "enum", "query", "number","datetime"]
+ "enum": ["text","textarea", "password", "checkbox", "enum", "query", "number","datetime","html"]
},
"name": {"type": "string"},
"label": {"type": "string"},
diff --git a/server/schema/help.yaml b/server/schema/help.yaml
index 867f9ec3..35163a23 100644
--- a/server/schema/help.yaml
+++ b/server/schema/help.yaml
@@ -1560,7 +1560,26 @@
label: Time
default: "13:01:00"
required: true
- help: A help message
+ help: A help message
+ - name: html
+ description: An HTML field
+ examples:
+ - name: Alert
+ code: |
+ - type: html
+ name: alert
+ expression: |
+ '
+ danger mister robinson !
+
'
+ - type: html
+ name: image
+ expression: |
+ ''
+ - name: header
+ type: html
+ expression: |
+ 'Your own title
'
- name: number
description: A number input field
examples:
@@ -2202,7 +2221,7 @@
When used in an `enum` field, the expression must return a flat array or array of flat objects, to make it presentable in a dropdown box.
An expression supports placeholders. Read more about placeholders here. [TODO]
Click here to find out more about the predefined functions. [TODO]
- with_types: enum, expression, table
+ with_types: enum, expression, table, html
examples:
- name: Get a list of users from a rest api
code: |
From c1dae3d49f82dcf98ab1da23bba93bc2e86969af Mon Sep 17 00:00:00 2001
From: GitHub Actions
Date: Sun, 7 May 2023 16:46:28 +0000
Subject: [PATCH 6/6] Prepare release 4.0.9
---
CHANGELOG.md | 6 +++++-
app_versions.gradle | 4 ++--
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3f1c128c..8b0055b4 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
+## [4.0.9] - 2023-05-07
+
### Added
- model can now be an array
@@ -497,7 +499,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.8...HEAD
+[Unreleased]: https://github.com/ansibleguy76/ansibleforms/compare/4.0.9...HEAD
+
+[4.0.9]: https://github.com/ansibleguy76/ansibleforms/compare/4.0.8...4.0.9
[4.0.8]: https://github.com/ansibleguy76/ansibleforms/compare/4.0.7...4.0.8
diff --git a/app_versions.gradle b/app_versions.gradle
index 6e64f9a0..063b341e 100644
--- a/app_versions.gradle
+++ b/app_versions.gradle
@@ -1,2 +1,2 @@
-ext.version_code = 40008
-ext.version_name = "4.0.8"
+ext.version_code = 40009
+ext.version_name = "4.0.9"