Custom Configurations
Some complex components require some more setup.
Schema
string_enum_multi_input:
items:
options:
- label: Option 1 label
value: option1
- label: Option 2 label
value: option2
- label: Option 2 label
value: option2
In the above example,
string_enum_multi_input
is the name of the config. When presented to the end-user they will see a select box allowing them to choose multiple enum values. The labels will be customer facing and the values will be used in runs. When a Run happens this config will be injected into the Environment as PAN_CFG_STRING_ENUM_MULTI_INPUT
UiSchema
type: MultiSelectControl
label: A Multiselect Dropdown
scope: "#/properties/string_enum_multi_input"
In this example, the
type
informs the platform to render a custom component.
Dynamic Configs
The setup to populate the multiselect from values from your integration is slightly different (See Dynamic Configs for more info). Our multiselect component in the schema must reference a definitions property like this:
string_enum_multi_input:
$ref: "#/definitions/my_multiselect_def"
definitions:
my_multiselect_def:
items:
options:
- label: Default
value: def123
Then your integration script must print a list of dictionaries with a label and value to stdout. Example dictionary to print to stdout to support this component's dynamic configs:
"my_multiselect_def": [{"label": "Red Label", "value": "red123"},
{"label": "Black Label", "value": "black123"}]
Schema
labeled_enum:
oneOf:
- title: Option 1 label
const: option1
- title: Option 2 label
const: option2
- title: Option 2 label
const: option2
In the above example,
labeled_enum
is the name of the config. When presented to the end-user they will see a select box with labeled values.UiSchema
type: Control
label: A Labeled Dropdown
scope: "#/properties/labeled_enum"
Dynamic Configs
The setup to populate the labeled enums with values from your integration is slightly different.
labeled_enum:
$ref: "#/definitions/my_labeled_enum_def"
definitions:
my_labeled_enum_def:
oneOf:
- title: Default
const: def123
Then your integration script must print a list of dictionaries with a title and const to stdout. Example dictionary to print to stdout to support this component's dynamic configs:
"my_labeled_enum_def": [{"title": "Red Label", "const": "red123"},
{"title": "Black Label", "const": "black123"}]
Last modified 1yr ago