Skip to content

Commit 8b72a2e

Browse files
committed
feat: Start using typeHints when creating forms
1 parent 5c3a0b6 commit 8b72a2e

6 files changed

Lines changed: 21 additions & 7 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"tymly": "bin/tymly-cli.js"
2424
},
2525
"dependencies": {
26-
"@wmfs/tymly-scaffold": "1.21.0",
26+
"@wmfs/tymly-scaffold": "1.22.0",
2727
"ansi-colors": "3.2.3",
2828
"commander": "2.19.0",
2929
"enquirer": "2.3.0",

test/fixtures/add-editable/expected/one-model/card-templates/pizza-editing-form.json

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,18 @@
2525
},
2626
{
2727
"id": "vegetarian",
28-
"type": "Input.Toggle",
29-
"title": "Vegetarian"
28+
"type": "Input.ChoiceSet",
29+
"title": "Vegetarian",
30+
"choices": [
31+
{
32+
"title": "Yes",
33+
"value": "YES"
34+
},
35+
{
36+
"title": "No",
37+
"value": "NO"
38+
}
39+
]
3040
}
3141
],
3242
"actions": [

test/fixtures/add-editable/expected/one-model/models/pizza.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
"type": "integer"
1616
},
1717
"vegetarian": {
18-
"type": "boolean"
18+
"typeHint": "yesNo",
19+
"type": "string"
1920
}
2021
},
2122
"required": [

test/fixtures/add-editable/expected/two-models/models/pizza.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
"type": "integer"
1616
},
1717
"vegetarian": {
18-
"type": "boolean"
18+
"type": "boolean",
19+
"typeHint": "boolean"
1920
}
2021
},
2122
"required": [

test/fixtures/add-editable/initial/one-model/models/pizza.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
"type": "integer"
1616
},
1717
"vegetarian": {
18-
"type": "boolean"
18+
"typeHint": "yesNo",
19+
"type": "string"
1920
}
2021
},
2122
"required": [

test/fixtures/add-editable/initial/two-models/models/pizza.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
"type": "integer"
1616
},
1717
"vegetarian": {
18-
"type": "boolean"
18+
"type": "boolean",
19+
"typeHint": "boolean"
1920
}
2021
},
2122
"required": [

0 commit comments

Comments
 (0)