Skip to content

Commit 65aa82f

Browse files
Merge pull request wso2#8842 from NutharaNR/dataType-mismatch
[bug-fix] UI side fix for dataType mismatch in claim-dialect and scim2 config for totpEnabled and backupCodeEnabled.
2 parents 2870b1d + 4675a05 commit 65aa82f

2 files changed

Lines changed: 16 additions & 2 deletions

File tree

.changeset/many-comics-bake.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@wso2is/admin.users.v1": patch
3+
"@wso2is/console": patch
4+
---
5+
6+
A fix to dataType mismatch for totpEnabled and backupCodeEnabled claims.

features/admin.users.v1/components/user-profile/fields/form-field-renderer.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,11 @@ const ProfileFormFieldRenderer: FunctionComponent<ProfileFormFieldRendererPropsI
435435
return (
436436
<FinalFormField
437437
component={ CheckboxFieldAdapter }
438-
initialValue={ initialValue ?? false }
438+
initialValue={
439+
typeof initialValue === "string"
440+
? initialValue.toLowerCase() === "true"
441+
: !!initialValue
442+
}
439443
ariaLabel={ fieldLabel }
440444
label={ fieldLabel }
441445
name={ fieldName }
@@ -449,7 +453,11 @@ const ProfileFormFieldRenderer: FunctionComponent<ProfileFormFieldRendererPropsI
449453
return (
450454
<FinalFormField
451455
component={ SwitchFieldAdapter }
452-
initialValue={ initialValue ?? false }
456+
initialValue={
457+
typeof initialValue === "string"
458+
? initialValue.toLowerCase() === "true"
459+
: !!initialValue
460+
}
453461
ariaLabel={ fieldLabel }
454462
label={ fieldLabel }
455463
name={ fieldName }

0 commit comments

Comments
 (0)