Skip to content

Commit

Permalink
Merge develop with YouTube fix and others PR #402
Browse files Browse the repository at this point in the history
Merge pull request  of develop into main
  • Loading branch information
lukestanley committed Oct 31, 2023
2 parents 129c3a8 + c9ee220 commit 1d187a0
Show file tree
Hide file tree
Showing 7 changed files with 145 additions and 15 deletions.
91 changes: 85 additions & 6 deletions docs/workflow/blocks/form.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,100 @@ not dependent on the form, then it is best to place them before the form in the

Config init
-----------
If can often be beneficial to initialiase the form data by creating an mapping of the default data.
The initial configuration will result in an empty form.
The fields of the form can be populated in two ways: manually writing fields or dynamically generating fields from given data.

.. code-block:: json
Here's an example of creating a form by manually writing fields and configuring it:

.. code-block:: json
{
"confirm": false
"type": "form",
"hasSubmit": "true",
"label": "Click to submit",
"jsonSchema": {
"type": "object",
"properties": {
"name": {
"type": "string",
"title": "Name",
"default": ""
},
"lastname": {
"type": "string",
"title": "Last name",
"default": ""
}
}
},
"uiSchema": {}
}
Dynamic data and field titles
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
To generate fields form given data, the data needs to be in a format readable by the form block.
It is possible to transform the data into the format that the form expects with the help of a mapping block.
Is also possible to use generated data to dynamically display the title of a field

.. code-block:: json
// generated data
{
"name": `John`,
"surname": `Doe`
}
// Form config
{
"type": "form",
"jsonSchema": {
"type": "object",
"properties": {
"title": {
"type": "string",
"title": "I am harcoded text"
},
"user_name": {
"type": "string",
"title": "name",
"default": "The title of this field comes from dynamic data"
},
"user_surname": {
"type": "string",
"title": "surname",
"default": "The title of this field comes from dynamic data"
}
}
},
"uiSchema": {}
}
Read-only
^^^^^^^^^
Display a field in read-only mode (not editable)

.. code-block:: json
{
"type": "form",
"label": "Search",
"jsonSchema": {
"type": "object",
"properties": {
"name": {
"type": "string",
"title": "Artist name",
"readOnly": true
}
}
},
"uiSchema": {}
}
Examples
---------
No submit button
^^^^^^^^^^^^^^^^

A simple search form without a submit button.

.. code-block:: json
Expand Down
42 changes: 40 additions & 2 deletions docs/workflow/blocks/mapping.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,38 @@ read from *filter*. Reading from *state.global.workflowCloud.listWorkflows.filt
Handy JMESPath patterns
-----------------------

Using a string as a value
^^^^^^^^^^^^^^^^^^^^^^^^^
To be valid JMESPath, keys and values must be wrapped in double quotes.
For a hardcoded string, the value must be wrapped in backticks, otherwise it will result `null` for undefined variables.
.. code-block:: json
{
"name": `John`,
"surname": `Doe`,
"iAmNull": "not showing"
}
Output will be:

.. code-block:: text
name: "John"
surname: "Doe"
iAmNull: null
We've seen that property values of object keys can be set using backticks, and it is also possible to wrap a whole JSON object in backticks.
The output will be the same as this:

.. code-block:: json
`{
"name": "John",
"surname": "Doe",
"iAmNotNull": "now this value is visible too"
}`
Not
^^^

When your data structuture holds the value that you wish to negate, you need to enclose the
path of your data in parentheses before you NOT it.

Expand Down Expand Up @@ -109,7 +138,14 @@ This will keep any item that has a "deleted" flag in the "tags" array. More usef
Adding a new key to an object
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

If you're wrangling data from one form to another, you may need to add new keys.
If you're wrangling data from one form to another, you may need to add new keys.

.. code-block:: text
data.merge(@, { key: value })
If your data is an array, you can iterate through its elements with ``[*]``.
In the below example, the new key/value pair is added to each element of the array.

.. code-block:: text
Expand Down Expand Up @@ -369,6 +405,8 @@ Examples:
formatDate('2020-01-01', 'dd/MM/yyyy') // Output: "01/01/2020"
formatDate('2020-01-01T14:50:00.000+01:00', 'dd/MM/yyyy') // Output: "01/01/2020"
10. omit
--------

Expand Down
8 changes: 4 additions & 4 deletions docs/workflow/blocks/variable_set.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ Save a value to local storage.

Supported properties
--------------------
**name**: The name of the variable
**showNotify** (boolean) (default=true): Display a notification that the variable has been set
**nameGetter** : Provide a location for the variable name
**valueGetter**: Provide a location for the variable value
- **name**: The name of the variable
- **showNotify** (boolean) (default=true): Display a notification that the variable has been set
- **nameGetter** : Provide a location for the variable name
- **valueGetter**: Provide a location for the variable value


Default config
Expand Down
2 changes: 1 addition & 1 deletion src/environments/environment.dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const environment = {
scope: 'openid profile'
},
workflowStoreUrl: 'https://app.kendra.io/api',
authProxyUrl: 'https://kendraio-auth0-proxy.now.sh/',
authProxyUrl: 'https://kendraio-auth0-proxy.vercel.app/',
uphold: {
proxy: 'https://uphold-proxy.kendra.io/',
apiRoot: 'https://api-sandbox.uphold.com/',
Expand Down
2 changes: 1 addition & 1 deletion src/environments/environment.prod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const environment = {
},
workflowStoreUrl: 'https://app.kendra.io/api',
// authProxyUrl: 'https://kendraio-auth0-proxy-qq0te0iza.now.sh/',
authProxyUrl: 'https://kendraio-auth0-proxy.now.sh/',
authProxyUrl: 'https://kendraio-auth0-proxy.vercel.app/',
uphold: {
proxy: 'https://uphold-proxy.kendra.io/',
apiRoot: 'https://api.uphold.com/',
Expand Down
2 changes: 1 addition & 1 deletion src/environments/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const environment = {
scope: 'openid profile'
},
workflowStoreUrl: 'https://app.kendra.io/api',
authProxyUrl: 'https://kendraio-auth0-proxy.now.sh/',
authProxyUrl: 'https://kendraio-auth0-proxy.vercel.app/',
// authProxyUrl: 'http://localhost:3000/',
uphold: {
proxy: 'https://uphold-proxy.kendra.io/',
Expand Down
13 changes: 13 additions & 0 deletions src/styles/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -262,4 +262,17 @@ formly-array-type {
content: "" !important;
}

.mdc-text-field--disabled,
.mdc-text-field--disabled .mat-mdc-input-element {
color: black !important;
}

.mdc-text-field--disabled .mdc-floating-label {
color: rgba(0, 0, 0, 0.6)
}

.mdc-text-field--disabled mat-label::after {
content: "(read-only)";
}

// Kendraio3ca31f6bcb87c68721363847192dbd57

0 comments on commit 1d187a0

Please sign in to comment.