Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added multi-select for input parameters. Fixes #12017 #12579

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions api/jsonschema/schema.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions api/openapi-spec/swagger.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions docs/executor_swagger.md
Original file line number Diff line number Diff line change
Expand Up @@ -2867,6 +2867,7 @@ More info: http://kubernetes.io/docs/user-guide/identifiers#names | |
| enum | [][AnyString](#any-string)| `[]AnyString` | | | Enum holds a list of string values to choose from, for the actual value of the parameter | |
| globalName | string| `string` | | | GlobalName exports an output parameter to the global scope, making it available as
'{{workflow.outputs.parameters.XXXX}} and in workflow.status.outputs.parameters | |
| multi | boolean| `bool` | | | Multi is a boolean which decides whether value should be interpreted as a multi-select, or as a single-select | |
| name | string| `string` | | | Name is the parameter name | |
| value | [AnyString](#any-string)| `AnyString` | | | | |
| valueFrom | [ValueFrom](#value-from)| `ValueFrom` | | | | |
Expand Down
1 change: 1 addition & 0 deletions docs/fields.md
Original file line number Diff line number Diff line change
Expand Up @@ -2249,6 +2249,7 @@ Parameter indicate a passed string parameter to a service template with an optio
|`description`|`string`|Description is the parameter description|
|`enum`|`Array< string >`|Enum holds a list of string values to choose from, for the actual value of the parameter|
|`globalName`|`string`|GlobalName exports an output parameter to the global scope, making it available as '{{io.argoproj.workflow.v1alpha1.outputs.parameters.XXXX}} and in workflow.status.outputs.parameters|
|`multi`|`boolean`|Multi is a boolean which decides whether value should be interpreted as a multi-select, or as a single-select|
|`name`|`string`|Name is the parameter name|
|`value`|`string`|Value is the literal value to use for the parameter. If specified in the context of an input parameter, the value takes precedence over any passed values|
|`valueFrom`|[`ValueFrom`](#valuefrom)|ValueFrom is the source for the output parameter's value|
Expand Down
43 changes: 40 additions & 3 deletions docs/workflow-templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -373,9 +373,46 @@ spec:
- name: message
value: one
enum:
- one
- two
- three
- one
- two
- three
templates:
- name: argosay
inputs:
parameters:
- name: message
value: '{{workflow.parameters.message}}'
container:
name: main
image: 'argoproj/argosay:v2'
command:
- /argosay
args:
- echo
- '{{inputs.parameters.message}}'
```

In case the user would like to use a multi-select dropdown, the same setup as above remains, you just need to:

- Add a field named `multi: true`
- Using the value still as a string, but with a `,` delimiter with the options you choose, without spaces before or after the delimiter.

```yaml
apiVersion: argoproj.io/v1alpha1
kind: WorkflowTemplate
metadata:
name: workflow-template-with-enum-values
spec:
entrypoint: argosay
arguments:
parameters:
- name: message
multi: true
value: one,two
enum:
- one
- two
- three
templates:
- name: argosay
inputs:
Expand Down
20 changes: 20 additions & 0 deletions manifests/base/crds/full/argoproj.io_clusterworkflowtemplates.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions manifests/base/crds/full/argoproj.io_cronworkflows.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading