-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbasic_fields.yaml
192 lines (192 loc) · 6.58 KB
/
basic_fields.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
apiVersion: scaffolder.backstage.io/v1beta3
kind: Template
metadata:
name: basic-fields-template.1
title: Basic Fields
spec:
owner: agilelab
type: template
parameters:
- title: Basic fields
properties:
stringFields:
title: String fields
type: object
required:
- requiredStringField
properties:
basicStringField:
title: Basic String Field
type: string
defaultStringField:
title: Basic String Field + Default + Max Length
type: string
default: A value890
ui:options:
minLength: 3
maxLength: 10
requiredStringField:
title: Required field
type: string
description: This field will prevent you from going to the next section until filled
disabledField:
title: Disabled field
type: string
default: Non-editable value
ui:disabled: true
hiddenField:
title: Hidden field
type: string
default: I am hidden!
ui:widget: hidden
multilineField:
title: Multiline field
type: string
description: Text area field
ui:options:
multiline: true
rows: 5
codeStyleField:
title: Code-like style field
type: string
description: Usage of ui:style to give a different look to the field
ui:options:
multiline: true
rows: 5
ui:style:
font-family: Consolas
color: "#111"
enumField:
title: Closed list field
type: string
enum:
- Option 1
- Option 2
- Option 3
enumNamesField:
title: Closed list field with underlying values
type: string
description: You can decouple the label and the actual value saved on the form
enum:
- "1"
- "2"
- "3"
enumNames:
- Option 1
- Option 2
- Option 3
stringValidation:
title: String validation
type: object
properties:
emailStringField:
title: String field with email validation
type: string
format: email
regexPicker:
title: String field with RegEx validation (RegexPicker)
type: string
ui:field: RegexPicker
description: Sets a regular expression and validates the input when proceeding to the next section
# This field can contain the placeholder for the text area in the regex picker
ui:placeholder: ''
validation:
errorMessage: "Error message: This field accepts only the best food"
regularExpression: ^pizza$
flags: i
urlPicker:
title: String field with URL validation (UrlPicker)
type: string
description: Accepts only inputs which are valid URLs
ui:field: UrlPicker
fileSystemPicker:
title: String field with filesystem path validation (PathPicker)
type: string
description: Accepts only inputs with are valid filesystem paths, matching Linux/MacOS and Windows paths
ui:field: PathPicker
numberFields:
title: Number fields
type: object
description: Number fields are a way to enforce an input to accept only integer values
properties:
numberField:
title: Integer field
type: number
constrainedNumberField:
title: Number field with constraint 0 <= x <= 10
type: number
minimum: 0
maximum: 10
booleanFields:
title: Boolean true/false fields
type: object
properties:
checkboxField:
title: Checkbox field
description: Description is not shown
type: boolean
radioField:
title: Radio field
description: If no default is set, the field will be null unless user checks and unchecks it to make it `false`
type: boolean
ui:widget: radio
checkboxDefaultField:
title: Checkbox field - Default false
description: By adding false as a default value, if the user doesn't checks it, its value will be set as false
type: boolean
default: false
selectField:
title: Yes/No field
type: boolean
ui:widget: select
selectWithNamesField:
title: Custom names boolean select field
type: boolean
ui:widget: select
oneOf:
- const: true
title: "This is the true option"
- const: false
title: "This is the false option"
dateFields:
title: Date fields
type: object
properties:
dateTimeField:
title: Date-time
type: string
"format": "date-time"
dateField:
title: Date
type: string
"format": "date"
arrayFields:
title: Array fields
type: object
required: [ constrainedArray ]
properties:
stringArray:
type: array
title: Free-form string array
items:
title: Basic String Field
type: string
enumStringArray:
type: array
title: Enum string array
uniqueItems: true
items:
title: Basic String Field
type: string
enum:
- "Option A"
- "Option B"
- "Option C"
constrainedArray:
type: array
title: Constrained string array
minItems: 2
maxItems: 10
items:
title: Basic String Field
type: string