Skip to content

Commit 812aa25

Browse files
committed
fixing bool
1 parent 0c27daf commit 812aa25

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

packages/tdb-documents-ui/diff/src/Output.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,11 @@ export const Output = () => {
142142
}
143143
},
144144
"@type": "Class",
145+
"m_like": "xsd:boolean",
146+
"like": {
147+
"@class": "xsd:boolean",
148+
"@type": "Optional"
149+
},
145150
"optMarkDown": {
146151
"@class": "xsd:string",
147152
"@type": "Optional"

packages/tdb-documents-ui/diff/src/diff.constants.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ export const oldData = {
33
"body": {
44
"@id": "body/6230f55d381076aa7f94b6b01a7a7ae1692ef40c44e233a52c1c280b5d339839",
55
"@type": "body",
6+
"m_like": true,
7+
"like": false,
68
"optMarkDown": "### opt",
79
"setMarkDown": [
810
"### set 1",
@@ -17,6 +19,8 @@ export const changedData = {
1719
"body": {
1820
"@id": "body/6230f55d381076aa7f94b6b01a7a7ae1692ef40c44e233a52c1c280b5d339839",
1921
"@type": "body",
22+
"m_like": true,
23+
"like": true,
2024
"optMarkDown": "### opt changed",
2125
"setMarkDown": [
2226
"### set 1 changed",

packages/tdb-documents-ui/src/templates.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const DisplayLabel = ({schema, id, label, formData}) => {
4747

4848
//console.log("props", id, props)
4949
// return empty div when no data available
50-
if(!formData && !uiSchema.hasOwnProperty("ui:field")) {
50+
//if(!formData && !uiSchema.hasOwnProperty("ui:field")) {
5151
// check for ui field - we use custom fields some times to represent null fields
5252
if(schema.info === CONST.DATA_TYPE && schema.type === CONST.BOOLEAN_TYPE) {
5353
// display a different widget for bool type
@@ -61,12 +61,13 @@ const DisplayLabel = ({schema, id, label, formData}) => {
6161
</label>
6262
<div className="checkbox disabled">
6363
<label>
64-
<input type="checkbox" id="root_transparent" disabled="" checked=""/>
64+
{formData && <input type="checkbox" id="root_transparent" disabled="" checked/>}
65+
{!formData && <input type="checkbox" id="root_transparent" disabled=""/>}
6566
<span>{schema.title}</span>
6667
</label>
6768
</div>
6869
</div>
69-
}
70+
//}
7071
return <div className="empty__field"/>
7172
}
7273

0 commit comments

Comments
 (0)