Skip to content
This repository was archived by the owner on Mar 9, 2023. It is now read-only.

Commit 12d16b9

Browse files
committed
fix: swap schema
1 parent 68e571f commit 12d16b9

3 files changed

Lines changed: 55 additions & 91 deletions

File tree

examples/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
"private": true,
44
"root": true,
55
"scripts": {
6-
"build": "parcel build index.html",
7-
"start": "parcel serve index.html"
6+
"build": "parcel build --no-cache index.html",
7+
"start": "parcel serve --no-cache index.html"
88
},
99
"dependencies": {
1010
"@patternfly/react-core": "4.45.1",
1111
"@patternfly/react-icons": "4.7.2",
1212
"ajv": "6.10.2",
13-
"react": "^16.13.1",
14-
"react-dom": "16.9.0",
13+
"react": "16.13.1",
14+
"react-dom": "16.13.1",
1515
"react-scripts": "3.1.1",
1616
"simpl-schema": "1.5.7",
1717
"uniforms": "3.0.0-rc.3",

examples/schema/json-schema.js

Lines changed: 47 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -14,106 +14,68 @@ function createValidator(schema) {
1414
}
1515

1616
const schema = {
17-
'phases': [
18-
'complete',
19-
'release'
20-
],
21-
'properties': {
22-
'traveller': {
23-
'properties': {
24-
'address': {
25-
'properties': {
26-
'city': {
27-
'type': 'string'
28-
},
29-
'country': {
30-
'type': 'string'
31-
},
32-
'street': {
33-
'type': 'string'
34-
},
35-
'zipCode': {
36-
'type': 'string'
37-
}
38-
},
39-
'type': 'object'
17+
type: 'object',
18+
properties: {
19+
flight: {
20+
type: 'object',
21+
properties: {
22+
flightNumber: {
23+
type: 'string'
4024
},
41-
'email': {
42-
'format': 'email',
43-
'type': 'string'
25+
seat: {
26+
type: 'string'
4427
},
45-
'firstName': {
46-
'type': 'string'
28+
gate: {
29+
type: 'string'
4730
},
48-
'lastName': {
49-
'type': 'string'
31+
departure: {
32+
type: 'string',
33+
format: 'date-time'
5034
},
51-
'nationality': {
52-
'type': 'string'
35+
arrival: {
36+
type: 'string',
37+
format: 'date-time'
5338
}
5439
},
55-
'required': [
56-
'firstName',
57-
'lastName'
58-
],
59-
'type': 'object'
40+
disabled: true
6041
},
61-
'trip': {
62-
'properties': {
63-
'begin': {
64-
'format': 'date-time',
65-
'type': 'string'
66-
},
67-
'city': {
68-
'type': 'string'
42+
hotel: {
43+
type: 'object',
44+
properties: {
45+
name: {
46+
type: 'string'
6947
},
70-
'country': {
71-
'type': 'string'
72-
},
73-
'end': {
74-
'format': 'date-time',
75-
'type': 'string'
76-
},
77-
'visaRequired': {
78-
'type': 'boolean'
79-
}
80-
},
81-
'type': 'object',
82-
'uniforms': {
83-
'disabled': true
84-
}
85-
},
86-
'visaApplication': {
87-
'properties': {
88-
'city': {
89-
'type': 'string'
90-
},
91-
'country': {
92-
'type': 'string'
93-
},
94-
'duration': {
95-
'type': 'integer'
96-
},
97-
'firstName': {
98-
'type': 'string'
48+
address: {
49+
type: 'object',
50+
properties: {
51+
street: {
52+
type: 'string'
53+
},
54+
city: {
55+
type: 'string'
56+
},
57+
zipCode: {
58+
type: 'string'
59+
},
60+
country: {
61+
type: 'string'
62+
}
63+
}
9964
},
100-
'lastName': {
101-
'type': 'string'
65+
phone: {
66+
type: 'string'
10267
},
103-
'nationality': {
104-
'type': 'string'
68+
bookingNumber: {
69+
type: 'string'
10570
},
106-
'passportNumber': {
107-
'type': 'string'
71+
room: {
72+
type: 'string'
10873
}
10974
},
110-
'type': 'object',
111-
'uniforms': {
112-
'disabled': true
113-
}
75+
disabled: true
11476
}
11577
},
116-
'type': 'object'
78+
phases: ['complete', 'release']
11779
};
11880

11981
const schemaValidator = createValidator(schema);

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
{
22
"name": "uniforms-patternfly",
3-
"version": "4.0.0",
3+
"version": "4.0.1-dev.1",
44
"description": "Patternfly forms for uniforms",
55
"repository": "git@github.com:aerogear/uniforms-patternfly.git",
66
"author": "Gianluca <gzuccare@redhat.com>",
7-
"license": "Apache-2.0",
7+
"license": "Apache-2.0",
88
"main": "dist/index.js",
99
"types": "dist/index.d.ts",
1010
"scripts": {
1111
"build": "tsc --build --incremental",
12+
"buildProd": "tsc --build",
13+
"watch": "tsc --watch --incremental",
1214
"clean": "rimraf dist coverage tsconfig.tsbuildinfo && tsc",
1315
"coverage": "jest --coverage",
1416
"lint": "eslint --ext js,ts,tsx src",

0 commit comments

Comments
 (0)