File tree Expand file tree Collapse file tree 6 files changed +16
-11
lines changed Expand file tree Collapse file tree 6 files changed +16
-11
lines changed Original file line number Diff line number Diff line change @@ -107,7 +107,7 @@ class ClickhouseConnector extends AdminForthBaseConnector implements IAdminForth
107
107
}
108
108
return dayjs ( value ) . toISOString ( ) . split ( 'T' ) [ 0 ] ;
109
109
} else if ( field . type == AdminForthDataTypes . BOOLEAN ) {
110
- return ! ! value ;
110
+ return value === null ? null : ! ! value ;
111
111
} else if ( field . type == AdminForthDataTypes . JSON ) {
112
112
if ( field . _underlineType . startsWith ( 'String' ) || field . _underlineType . startsWith ( 'FixedString' ) ) {
113
113
try {
@@ -138,7 +138,7 @@ class ClickhouseConnector extends AdminForthBaseConnector implements IAdminForth
138
138
return iso ;
139
139
}
140
140
} else if ( field . type == AdminForthDataTypes . BOOLEAN ) {
141
- return value ? 1 : 0 ;
141
+ return value === null ? null : ( value ? 1 : 0 ) ;
142
142
} else if ( field . type == AdminForthDataTypes . JSON ) {
143
143
// check underline type is text or string
144
144
if ( field . _underlineType . startsWith ( 'String' ) || field . _underlineType . startsWith ( 'FixedString' ) ) {
Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ class MongoConnector extends AdminForthBaseConnector implements IAdminForthDataS
86
86
return dayjs ( Date . parse ( value ) ) . toISOString ( ) . split ( 'T' ) [ 0 ] ;
87
87
88
88
} else if ( field . type == AdminForthDataTypes . BOOLEAN ) {
89
- return ! ! value ;
89
+ return value === null ? null : ! ! value ;
90
90
} else if ( field . type == AdminForthDataTypes . DECIMAL ) {
91
91
return value ?. toString ( ) ;
92
92
}
@@ -108,7 +108,7 @@ class MongoConnector extends AdminForthBaseConnector implements IAdminForthDataS
108
108
return dayjs ( value ) . toISOString ( ) ;
109
109
}
110
110
} else if ( field . type == AdminForthDataTypes . BOOLEAN ) {
111
- return value ? true : false ;
111
+ return value === null ? null : ( value ? true : false ) ;
112
112
} else if ( field . type == AdminForthDataTypes . DECIMAL ) {
113
113
return Decimal128 . fromString ( value ?. toString ( ) ) ;
114
114
}
Original file line number Diff line number Diff line change @@ -130,7 +130,7 @@ class MysqlConnector extends AdminForthBaseConnector implements IAdminForthDataS
130
130
} else if ( field . type == AdminForthDataTypes . TIME ) {
131
131
return value || null ;
132
132
} else if ( field . type == AdminForthDataTypes . BOOLEAN ) {
133
- return ! ! value ;
133
+ return value === null ? null : ! ! value ;
134
134
} else if ( field . type == AdminForthDataTypes . JSON ) {
135
135
if ( typeof value === 'string' ) {
136
136
try {
@@ -158,7 +158,7 @@ class MysqlConnector extends AdminForthBaseConnector implements IAdminForthDataS
158
158
}
159
159
return dayjs ( value ) . format ( 'YYYY-MM-DD HH:mm:ss' ) ;
160
160
} else if ( field . type == AdminForthDataTypes . BOOLEAN ) {
161
- return value ? 1 : 0 ;
161
+ return value === null ? null : ( value ? 1 : 0 ) ;
162
162
} else if ( field . type == AdminForthDataTypes . JSON ) {
163
163
if ( field . _underlineType === 'json' ) {
164
164
return value ;
Original file line number Diff line number Diff line change @@ -157,6 +157,10 @@ class PostgresConnector extends AdminForthBaseConnector implements IAdminForthDa
157
157
return dayjs ( value ) . toISOString ( ) . split ( 'T' ) [ 0 ] ;
158
158
}
159
159
160
+ if ( field . type == AdminForthDataTypes . BOOLEAN ) {
161
+ return value === null ? null : ! ! value ;
162
+ }
163
+
160
164
if ( field . type == AdminForthDataTypes . JSON ) {
161
165
if ( typeof value == 'string' ) {
162
166
try {
@@ -188,7 +192,7 @@ class PostgresConnector extends AdminForthBaseConnector implements IAdminForthDa
188
192
return dayjs ( value ) . toISOString ( ) ;
189
193
}
190
194
} else if ( field . type == AdminForthDataTypes . BOOLEAN ) {
191
- return value ? 1 : 0 ;
195
+ return value === null ? null : ( value ? 1 : 0 ) ;
192
196
} else if ( field . type == AdminForthDataTypes . JSON ) {
193
197
if ( field . _underlineType == 'json' ) {
194
198
return value ;
Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ class SQLiteConnector extends AdminForthBaseConnector implements IAdminForthData
81
81
return dayjs ( value ) . toISOString ( ) . split ( 'T' ) [ 0 ] ;
82
82
83
83
} else if ( field . type == AdminForthDataTypes . BOOLEAN ) {
84
- return ! ! value ;
84
+ return value === null ? null : ! ! value ;
85
85
} else if ( field . type == AdminForthDataTypes . JSON ) {
86
86
if ( field . _underlineType == 'text' || field . _underlineType == 'varchar' ) {
87
87
try {
@@ -112,7 +112,7 @@ class SQLiteConnector extends AdminForthBaseConnector implements IAdminForthData
112
112
return value ;
113
113
}
114
114
} else if ( field . type == AdminForthDataTypes . BOOLEAN ) {
115
- return value ? 1 : 0 ;
115
+ return value === null ? null : ( value ? 1 : 0 ) ;
116
116
} else if ( field . type == AdminForthDataTypes . JSON ) {
117
117
// check underline type is text or string
118
118
if ( field . _underlineType == 'text' || field . _underlineType == 'varchar' ) {
Original file line number Diff line number Diff line change 27
27
</span >
28
28
29
29
<span v-else-if =" column.type === 'boolean'" >
30
- <span v-if =" record[column.name]" class =" bg-green-100 text-green-800 text-xs font-medium me-2 px-2.5 py-0.5 rounded dark:bg-gray-700 dark:text-green-400 border border-green-400" >{{ $t('Yes') }}</span >
31
- <span v-else class =" bg-red-100 text-red-800 text-xs font-medium me-2 px-2.5 py-0.5 rounded dark:bg-gray-700 dark:text-red-400 border border-red-400" >{{ $t('No') }}</span >
30
+ <span v-if =" record[column.name] === true" class =" bg-green-100 text-green-800 text-xs font-medium me-2 px-2.5 py-0.5 rounded dark:bg-gray-700 dark:text-green-400 border border-green-400" >{{ $t('Yes') }}</span >
31
+ <span v-else-if =" record[column.name] === false" class =" bg-red-100 text-red-800gg text-xs font-medium me-2 px-2.5 py-0.5 rounded dark:bg-gray-700 dark:text-red-400 border border-red-400" >{{ $t('No') }}</span >
32
+ <span v-else class =" bg-gray-100 text-gray-800 text-xs font-medium me-2 px-2.5 py-0.5 rounded dark:bg-gray-700 dark:text-gray-400 border border-gray-400" >{{ $t('Unset') }}</span >
32
33
</span >
33
34
<span
34
35
v-else-if =" column.type === 'json' && column.isArray?.enabled"
You can’t perform that action at this time.
0 commit comments