From 1c4b39ebf7d35ab9b880278e4159012c6bee9e07 Mon Sep 17 00:00:00 2001 From: anovis Date: Wed, 2 Jun 2021 10:36:55 -0400 Subject: [PATCH 1/5] adding example for arrays Signed-off-by: anovis --- .../software-templates/writing-templates.md | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/docs/features/software-templates/writing-templates.md b/docs/features/software-templates/writing-templates.md index f58db3ae91..81189f22a1 100644 --- a/docs/features/software-templates/writing-templates.md +++ b/docs/features/software-templates/writing-templates.md @@ -142,6 +142,12 @@ this: "type": "string", "title": "Last name" }, + "nicknames":{ + "type": "array", + "items": { + "type": "string" + } + }, "telephone": { "type": "string", "title": "Telephone", @@ -161,6 +167,11 @@ this: "ui:emptyValue": "", "ui:autocomplete": "given-name" }, + "nicknames": { + "ui:options":{ + "orderable": false + } + } "telephone": { "ui:options": { "inputType": "tel" @@ -202,6 +213,12 @@ spec: title: Last name ui:emptyValue: '' ui:autocomplete: given-name + nicknames: + type: array + items: + type: string + ui:options: + orderable: false telephone: type: string title: Telephone @@ -304,7 +321,8 @@ You might have noticed in the examples that there are `{{ }}`, and these are a `yaml` together. All the form inputs from the `parameters` section, when passed to the steps will be available by using the template syntax `{{ parameters.something }}`. This is great for passing the values from the form -into different steps and reusing these input variables. +into different steps and reusing these input variables. To pass arrays or objects +use the syntax `{{ json paramaters.something }}`. As you can see above in the `Outputs` section, `actions` and `steps` can also output things. So you can grab that output by using From 3dacab3c9b4d30e15439099b34f11d185eb7912f Mon Sep 17 00:00:00 2001 From: anovis Date: Wed, 2 Jun 2021 10:37:54 -0400 Subject: [PATCH 2/5] fix syntax error Signed-off-by: anovis --- docs/features/software-templates/writing-templates.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/features/software-templates/writing-templates.md b/docs/features/software-templates/writing-templates.md index 81189f22a1..3a06b27ec2 100644 --- a/docs/features/software-templates/writing-templates.md +++ b/docs/features/software-templates/writing-templates.md @@ -171,7 +171,7 @@ this: "ui:options":{ "orderable": false } - } + }, "telephone": { "ui:options": { "inputType": "tel" From f20a6547bdab3367c801b88665e4a226e9e09e55 Mon Sep 17 00:00:00 2001 From: anovis Date: Wed, 2 Jun 2021 11:25:56 -0400 Subject: [PATCH 3/5] update based on comments Signed-off-by: anovis --- docs/features/software-templates/writing-templates.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/features/software-templates/writing-templates.md b/docs/features/software-templates/writing-templates.md index 3a06b27ec2..44812ee0b3 100644 --- a/docs/features/software-templates/writing-templates.md +++ b/docs/features/software-templates/writing-templates.md @@ -322,7 +322,9 @@ You might have noticed in the examples that there are `{{ }}`, and these are a to the steps will be available by using the template syntax `{{ parameters.something }}`. This is great for passing the values from the form into different steps and reusing these input variables. To pass arrays or objects -use the syntax `{{ json paramaters.something }}`. +use the syntax `{{ json paramaters.something }}` where `paramaters.something` is +of type `object` or `array` in the jsonSchema, such as the nicknames paramter +in the previous example. As you can see above in the `Outputs` section, `actions` and `steps` can also output things. So you can grab that output by using From 5292d453b483ecfc6b0ae62c4a87f906bbb9d55b Mon Sep 17 00:00:00 2001 From: Austen Date: Thu, 3 Jun 2021 09:07:37 -0400 Subject: [PATCH 4/5] Update docs/features/software-templates/writing-templates.md Co-authored-by: Ben Lambert Signed-off-by: anovis --- docs/features/software-templates/writing-templates.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/features/software-templates/writing-templates.md b/docs/features/software-templates/writing-templates.md index 44812ee0b3..4f42489244 100644 --- a/docs/features/software-templates/writing-templates.md +++ b/docs/features/software-templates/writing-templates.md @@ -323,7 +323,7 @@ to the steps will be available by using the template syntax `{{ parameters.something }}`. This is great for passing the values from the form into different steps and reusing these input variables. To pass arrays or objects use the syntax `{{ json paramaters.something }}` where `paramaters.something` is -of type `object` or `array` in the jsonSchema, such as the nicknames paramter +of type `object` or `array` in the `jsonSchema`, such as the `nicknames` parameter in the previous example. As you can see above in the `Outputs` section, `actions` and `steps` can also From 047658256e80f06c36d51b59604c35cd5c4abc2a Mon Sep 17 00:00:00 2001 From: anovis Date: Thu, 3 Jun 2021 13:30:13 -0400 Subject: [PATCH 5/5] prettify Signed-off-by: anovis --- .../features/software-templates/writing-templates.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/features/software-templates/writing-templates.md b/docs/features/software-templates/writing-templates.md index 4f42489244..f9c11edea3 100644 --- a/docs/features/software-templates/writing-templates.md +++ b/docs/features/software-templates/writing-templates.md @@ -215,8 +215,8 @@ spec: ui:autocomplete: given-name nicknames: type: array - items: - type: string + items: + type: string ui:options: orderable: false telephone: @@ -321,10 +321,10 @@ You might have noticed in the examples that there are `{{ }}`, and these are a `yaml` together. All the form inputs from the `parameters` section, when passed to the steps will be available by using the template syntax `{{ parameters.something }}`. This is great for passing the values from the form -into different steps and reusing these input variables. To pass arrays or objects -use the syntax `{{ json paramaters.something }}` where `paramaters.something` is -of type `object` or `array` in the `jsonSchema`, such as the `nicknames` parameter -in the previous example. +into different steps and reusing these input variables. To pass arrays or +objects use the syntax `{{ json paramaters.something }}` where +`paramaters.something` is of type `object` or `array` in the `jsonSchema`, such +as the `nicknames` parameter in the previous example. As you can see above in the `Outputs` section, `actions` and `steps` can also output things. So you can grab that output by using