Skip to content

Commit e6a3ab1

Browse files
committed
breaking(renderer): validator word is not used anymore
1 parent 69ff45b commit e6a3ab1

20 files changed

Lines changed: 53 additions & 48 deletions

File tree

packages/parsers/src/parsers/miq.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const miqParser = (
3838
if (field.validator_rule) {
3939
newField.validate = [
4040
{
41-
type: validatorTypes.PATTERN_VALIDATOR,
41+
type: validatorTypes.PATTERN,
4242
pattern: field.validator_rule
4343
}
4444
];

packages/parsers/src/parsers/mozilla/mozilla-helpers.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ export const validatorBuilder = ({ schema, fields = {}, key }) => {
2121
}
2222

2323
if (fields[key] && fields[key].pattern) {
24-
result.push({ type: validatorTypes.PATTERN_VALIDATOR, pattern: fields[key].pattern });
24+
result.push({ type: validatorTypes.PATTERN, pattern: fields[key].pattern });
2525
}
2626

2727
if (schema.minItems) {
28-
result.push({ type: validatorTypes.MIN_ITEMS_VALIDATOR, threshold: schema.minItems });
28+
result.push({ type: validatorTypes.MIN_ITEMS, threshold: schema.minItems });
2929
}
3030

3131
return result;

packages/parsers/src/tests/miq/miq-schemas/output.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ const output = {
6363
title: 'Text Box with validator',
6464
validate: [
6565
{
66-
type: validatorTypes.PATTERN_VALIDATOR,
66+
type: validatorTypes.PATTERN,
6767
pattern: '[0-9]'
6868
}
6969
],

packages/parsers/src/tests/mozilla/expected-parser-results.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export const simpleSchemaResult = {
1313
isRequired: true,
1414
validate: [
1515
{
16-
type: 'required-validator'
16+
type: 'required'
1717
}
1818
]
1919
},
@@ -26,7 +26,7 @@ export const simpleSchemaResult = {
2626
isRequired: true,
2727
validate: [
2828
{
29-
type: 'required-validator'
29+
type: 'required'
3030
}
3131
],
3232
type: 'text',
@@ -64,7 +64,7 @@ export const simpleSchemaResult = {
6464
helperText: 'Hint: Make it strong!',
6565
validate: [
6666
{
67-
type: 'min-length-validator',
67+
type: 'min-length',
6868
threshold: 3
6969
}
7070
]
@@ -79,7 +79,7 @@ export const simpleSchemaResult = {
7979
type: 'tel',
8080
validate: [
8181
{
82-
type: 'min-length-validator',
82+
type: 'min-length',
8383
threshold: 10
8484
}
8585
]
@@ -97,7 +97,7 @@ export const nestedSchemaResult = {
9797
isRequired: true,
9898
validate: [
9999
{
100-
type: 'required-validator'
100+
type: 'required'
101101
}
102102
],
103103
label: 'Task list title',
@@ -126,7 +126,7 @@ export const nestedSchemaResult = {
126126
isRequired: true,
127127
validate: [
128128
{
129-
type: 'required-validator'
129+
type: 'required'
130130
}
131131
],
132132
autoFocus: false
@@ -269,7 +269,7 @@ export const arraySchemaResult = {
269269
title: 'A list with a minimal number of items',
270270
validate: [
271271
{
272-
type: 'min-items-validator',
272+
type: 'min-items',
273273
threshold: 3
274274
}
275275
],
@@ -297,7 +297,7 @@ export const arraySchemaResult = {
297297
itemDefault: 'unidentified',
298298
validate: [
299299
{
300-
type: 'min-items-validator',
300+
type: 'min-items',
301301
threshold: 5
302302
}
303303
],

packages/parsers/src/tests/mozilla/mozilla-schema-parser.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,10 @@ describe('Mozilla json schema parser', () => {
147147
name: 'url',
148148
validate: [
149149
{
150-
type: 'required-validator'
150+
type: 'required'
151151
},
152152
{
153-
type: 'pattern-validator',
153+
type: 'pattern',
154154
pattern: '^(http|https)://*'
155155
}
156156
]

packages/pf3-component-mapper/demo/demo-schemas/sandbox.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ const output = {
202202
title: 'Text Box with validator',
203203
validate: [
204204
{
205-
type: validators.PATTERN_VALIDATOR,
205+
type: validators.PATTERN,
206206
pattern: '[0-9]'
207207
}
208208
],

packages/pf3-component-mapper/demo/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ const selectSchema = {
6565
isSearchable: true,
6666
placeholder: 'Placeholder',
6767
validate: [{
68-
type: 'required-validator'
68+
type: 'required'
6969
}],
7070
options: [{
7171
label: 'foo',
@@ -88,7 +88,7 @@ const selectSchema = {
8888
isSearchable: true,
8989
placeholder: 'Placeholder',
9090
validate: [{
91-
type: 'required-validator'
91+
type: 'required'
9292
}],
9393
options: [{
9494
label: 'foo',

packages/pf4-component-mapper/demo/demo-schemas/sandbox.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ const output = {
9696
title: 'Text Box with validator',
9797
validate: [
9898
{
99-
type: validators.PATTERN_VALIDATOR,
99+
type: validators.PATTERN,
100100
pattern: '[0-9]'
101101
}
102102
],

packages/pf4-component-mapper/demo/demo-schemas/widget-schema.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ export const arraySchemaDDF = {
397397
isRequired: true,
398398
validate: [
399399
{
400-
type: 'required-validator'
400+
type: 'required'
401401
}
402402
]
403403
},
@@ -413,7 +413,7 @@ export const arraySchemaDDF = {
413413
component: 'field-array',
414414
name: 'minItems',
415415
label: 'A list with a minimal number of items',
416-
validate: [{ type: 'min-items-validator', threshold: 3 }],
416+
validate: [{ type: 'min-items', threshold: 3 }],
417417
fields: [
418418
{
419419
component: 'text-field',
@@ -446,7 +446,7 @@ export const arraySchemaDDF = {
446446
isRequired: true,
447447
validate: [
448448
{
449-
type: 'required-validator'
449+
type: 'required'
450450
}
451451
]
452452
}

packages/react-form-renderer/demo/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ const asyncValidatorSchema = {
3838
label: 'Async validation field',
3939
validate: [
4040
{ type: 'asyncValidator' },
41-
{ type: 'required-validator' },
41+
{ type: 'required' },
4242
{
43-
type: validatorTypes.PATTERN_VALIDATOR,
43+
type: validatorTypes.PATTERN,
4444
pattern: '^Foo$',
4545
flags: 'i'
4646
}

0 commit comments

Comments
 (0)