Structure and content of the configuration file
{
// General configuration of the form
"panels": [
{
"name": "Application for vacation leave",
"fields": [
// Fields on the form
]
}
],
"translations": {
"en": {
// Translations
},
"pl": {
// Translations
}
}
}
General configuration of the form
default_lang
Default form language. Here we enter the key from the translations section e.g. "en".
Remember that the form translations must be defined in the translations section!
redirect
The address of the redirection after the form has been correctly submitted. After clicking the send button.
custom_redirect
Custom redirect allows you to create your own redirection buttons after the form is correctly submitted.
check_session_id
This parameter can be either true or false.
True: The session will be checked on the backend side and if not correct, the form will not be added to the OTRS.
False: The session will not be verified on the backend side.
send_empty
Are you going to send blank fields. If this option is checked, the blank fields will also appear in the data sent by the form (which will lead to their display in the article).
name
Name of the form.
description
Description of the form.
nextStep
Content of the redirection button to the form.
icon
The icon... The dynamic forms mechanism uses icons compatible with materialDesign.
https://material.io/resources/icons/?style=baseline
disabled
active
Should the form be active and clickable.
hidden
The form is to be shown in the list of available forms
Fields on the form
Each form must have some fields :D Dynamic forms allow you to create multiple field types. Each form field has a set of standard configurations. Additionally, fields can contain their own configurations.
These are settings that you can activate in any field.
size
The size of the field is defined on the basis of blocks, divide the screen into 12 parts and determine the size of the field "filling in these parts".
12 will set the field size for the whole screen, 6 will set the field size for half the screen.
Screen sizes are defined by the letters s,m,l (small, medium, large). Setting s12 m6 l3 will set the value 12 for small screens, 6 for medium screens and 3 for large screens.
size: s12 m6
type
Field type, here we enter the specific field type you want to use e.g. select, text.
id
field identifier.
This value must be unique and must not contain spaces!
tooltip
When you hover over the field, a balloon will pop up, displaying any text or HTML.
label
Here you can enter the field title e.g. "Your name".
validate
Here we can enter a list of any field validations (we can also create our own regex). An example of a validator is "required".
//example
"validate": ["required", "email"]
Available validators
after
alpha - The field under validation may only contain alphabetic characters.
alpha_dash - The field under validation may contain alphabetic characters, numbers, dashes or underscores.
alpha_num - The field under validation may contain alphabetic characters or numbers.
alpha_spaces - The field under validation may contain alphabetic characters or spaces.
before - The field under validation must have a numeric value bounded by a minimum value and a maximum value.
between - The field under validation must have a numeric value bounded by a minimum value and a maximum value.
confirmed - The field under validation must have the same value as the confirmation field.
credit_card
date_between
date_format
decimal
digits - The field under validation must be numeric and have the specified number of digits.
dimensions - The file added to the field under validation must be an image (jpg,svg,jpeg,png,bmp,gif) having the exact specified dimension.
email - The field under validation must be a valid email.
ext - The file added to the field under validation must have one of the extensions specified.
image - The file added to the field under validation must have an image mime type (image/*).
in
integer - The field under validation must be a valid integer value. Doesn't accept exponentiale notation.
ip
is - The field under validation must match the given value, uses strict equality.
is_not - The field under validation must not match the given value, uses strict equality.
length - The field under validation must have exactly have the specified number of items, only works for iterables.
max - The field under validation length may not exceed the specified length.
max_value - The field under validation must be a numeric value and must not be greater than the specified value.
mimes - The file type added to the field under validation should have one of the specified mime types.
min - The field under validation length should not be less than the specified length.
min_value - The field under validation must be a numeric value and must not be less than the specified value.
not_in
numeric - The field under validation must only consist of numbers.
regex - The field under validation must match the specified regular expression.
required - The field under validation must have a non-empty value. By default, all validators pass the validation if they have "empty values" unless they are required. Those empty values are: empty strings, undefined
, null
, empty arrays.
size - The file size added to the field under validation must not exceed the specified size in kilobytes.
url
icon
Field icon. We can set any Material Design compatible icons here.
https://material.io/resources/icons/?style=baseline
hidden
Field display.
A field that is hidden still exists on the form (but is invisible) its values can be sent!
otrs_visible
...
placeholder
...
value
...
api
...
api_watcher
...
iconfields
...
api_add_lang
...
add_session_id_to_api
...