diff --git a/docs/testing/tips.rst b/docs/testing/tips.rst index 7e9562060..a66322713 100644 --- a/docs/testing/tips.rst +++ b/docs/testing/tips.rst @@ -2,9 +2,9 @@ Notes for Cypress testing ========================= "https" not "http" ---------------- +------------------ -When tests are run within GitHub's environments, calls to external urls must be https, otherwise they will not run. +When tests are run within GitHub's environments, calls to external URLs must be https, otherwise they will not run. This applies even to fixtures that don't even make external requests. diff --git a/docs/workflow/blocks/actions.rst b/docs/workflow/blocks/actions.rst index 5e4904ab5..0cab5b384 100644 --- a/docs/workflow/blocks/actions.rst +++ b/docs/workflow/blocks/actions.rst @@ -29,14 +29,9 @@ Supported properties - **label** (string) - the text for the button label - **id** (string) - the unique identifier for the button - - **color** (string) - passed as the “color” attribute to the material button. Use one of the supported - Material color values, such as “primary”, “warn”, “accent”. Leave as “default” to use the default button styling for a plain button. - - **enabledGetter** (string) - A value from the state or context. Based on this value, it generates an "enabled" property on the button. - The button will be shown as disabled (greyed out) or enabled accordingly. The default value of this property is `true`. After - the block is loaded, it will automatically add a property to the block json: `"enabled": true`. - If `enabledGetter` is set to `false` the automatic property will be then shown as `"enabled": false`. - - **valueGetters** (string) - A value that will be pass as context to whichever action is being executed. - This is a JMESPath mapping. + - **color** (string) - passed as the “color” attribute to the material button. Use one of the supported Material colour values, such as “primary”, “warn”, “accent”. Leave as “default” to use the default button styling for a plain button. + - **enabledGetter** (string) - A value from the state or context. Based on this value, it generates an "enabled" property on the button. The button will be shown as disabled (greyed out) or enabled accordingly. The default value of this property is `true`. After the block is loaded, it will automatically add a property to the block json: `"enabled": true`. If `enabledGetter` is set to `false` the automatic property will be then shown as `"enabled": false`. + - **valueGetters** (string) - A value that will be passed as context to whichever action is being executed. This is a JMESPath mapping. - **blocks** (array) - the list of workflow items to run when this button is pressed. Example @@ -47,6 +42,7 @@ This example shows two buttons. The first one dispatches an asynchronous command block in order to start the inner workflow so that it runs and signals completion to the outer workflow. .. code-block:: json + { "type": "actions", "buttons": [ diff --git a/docs/workflow/blocks/context_block.rst b/docs/workflow/blocks/context_block.rst index 7075423ff..69f774053 100644 --- a/docs/workflow/blocks/context_block.rst +++ b/docs/workflow/blocks/context_block.rst @@ -114,8 +114,8 @@ Security and access control There is currently no access control or protection in state. Any path in the global state is accessible (read and write) to any flow. In the future some form of restriction may be implemented. -Subroutines -+++++++++++ +Subroutines (also called Gosubs) +++++++++++++++++++++++++++++++++ Subroutines are Flows that are configured separately and used within a parent Flow. All data saved in a subroutine is stored in the context or state of the parent Flow. diff --git a/docs/workflow/blocks/gosub.rst b/docs/workflow/blocks/gosub.rst index 2aff5a6c6..50a01d87c 100644 --- a/docs/workflow/blocks/gosub.rst +++ b/docs/workflow/blocks/gosub.rst @@ -6,9 +6,85 @@ A Flow embedded within a Flow. This allows composition of larger building blocks to create Flows that are easier to manage, and DRY (don't repeat yourself). +Default config +-------------- + +.. code-block:: json + + { + "type": "gosub", + "adapterName": "", + "workflowId": "" + } + +Supported properties +-------------------- + +- **adapterName**:The namespace the embedded Flow belongs to (a name to group multiple Flows) +- **workflowId**: A text identifier of the Flow to be embedded. + Typical use-cases for this are creating custom form widgets that can -be referenced from a form's ``uiSchema``. Or, creating dashboards -that are made up of multiple other Flows combined with a ``multi`` +be referenced from a form's ``uiSchema``. +The form property's name must match the data property name. +In this way the data will be passed down to the embedded Flow. + + + + +.. code-block:: json + + // Parent Flow data + { + "asset_name": "Gioconda", + "location": "https://someimages.com", + "asset_manager_id": "1" + + } + + { + "type": "form", + "jsonSchema": { + "type": "object", + "properties": { + "asset_title": { + "title": "Asset", + "type": "string" + }, + "location": { + "title": "Location", + "type": "string" + }, + "asset_manager_id": { + "type": "string", + "title": "Asset Manager" + } + } + }, + "uiSchema": { + "location": { + "ui:widget": "remote-image" + }, + "asset_manager_id": { + "ui:widget": "blocks", + "blocksConfig": { + "blocks": [ + { + "type": "gosub", + "adapterName": "culturebanked", + "workflowId": "artist2-select-asset-manager" + } + ] + } + } + } + } + +In the example above, there are two Flows: the primary Flow, where the above configuration is written, and a secondary Flow with the Adapter "culturebanked" and Workflow ID "artist2-select-asset-manager". +The "artist2-select-asset-manager" Flow is rendered as part of the parent Flow and is initiated with the data { "asset_manager_id": "1" }. +If the property is modified in the uiSchema, the property name must be the same as the original data both in +the jsonSchema and in the uiSchema. + +Or, creating dashboards that are made up of multiple other Flows combined with a ``multi`` multiplex Flow block. All data saved in a gosub is stored in the context or state of the parent Flow. diff --git a/docs/workflow/blocks/mapping.rst b/docs/workflow/blocks/mapping.rst index 2986669a8..3e5f6876c 100644 --- a/docs/workflow/blocks/mapping.rst +++ b/docs/workflow/blocks/mapping.rst @@ -392,7 +392,7 @@ Examples: replace(data.email, '.', '') // Output: "johndoe@example.com" 8. replaceAll ------------ +------------- Returns a string replacing all instances of a substring with another substring. @@ -415,7 +415,7 @@ Examples: trim(' John Doe ') // Output: "John Doe" 10. now ------- +-------- Returns the current UTC timestamp in RFC 7231 format. @@ -441,7 +441,7 @@ Examples: 12. omit -------- -Creates an object composed of enumerable properties from the input objects omitting the properties named in the *names array. +Creates an object composed of enumerable properties from the input objects omitting the properties named in the *names* array. Examples: @@ -622,7 +622,7 @@ Examples: markdown('## Header') // Output: "