Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/subject-domain-flags-independent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@wso2is/admin.applications.v1": patch
Comment thread
PasinduYeshan marked this conversation as resolved.
"@wso2is/console": patch
---

Persist the "Include organization name" and "Include user domain" options independently in the application subject identifier settings, so un-checking one no longer clears the other on save.
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ export const AdvanceAttributeSettings: FunctionComponent<AdvanceAttributeSetting
useState<boolean>(initialSubject?.useMappedLocalSubject);
const [ mandateLinkedLocalAccount, setMandateLinkedLocalAccount ] =
useState<boolean>(initialSubject?.mappedLocalSubjectMandatory);
const [ subjectIncludeUserDomain, setSubjectIncludeUserDomain ] =
useState<boolean>(initialSubject?.includeUserDomain);
const [ subjectIncludeTenantDomain, setSubjectIncludeTenantDomain ] =
useState<boolean>(initialSubject?.includeTenantDomain);

useEffect(() => {
if (claimMappingOn && dropDownOptions && dropDownOptions.length > 0) {
Expand Down Expand Up @@ -260,8 +264,8 @@ export const AdvanceAttributeSettings: FunctionComponent<AdvanceAttributeSetting
},
subject: {
claim: getSelectedDropDownValue(dropDownOptions, values.subjectAttribute),
includeTenantDomain: !!values.subjectIncludeTenantDomain,
includeUserDomain: !!values.subjectIncludeUserDomain,
includeTenantDomain: !!subjectIncludeTenantDomain,
includeUserDomain: !!subjectIncludeUserDomain,
mappedLocalSubjectMandatory: mandateLinkedLocalAccount,
useMappedLocalSubject: validateLinkedLocalAccount
}
Expand Down Expand Up @@ -353,6 +357,14 @@ export const AdvanceAttributeSettings: FunctionComponent<AdvanceAttributeSetting
setMandateLinkedLocalAccount(value);
};

const subjectIncludeUserDomainChangeHandler = (value: boolean) => {
setSubjectIncludeUserDomain(value);
};

const subjectIncludeTenantDomainChangeHandler = (value: boolean) => {
setSubjectIncludeTenantDomain(value);
};

/**
* To revert the selected subject identifier value to the default value when the checkbox is unchecked.
*/
Expand Down Expand Up @@ -543,13 +555,14 @@ export const AdvanceAttributeSettings: FunctionComponent<AdvanceAttributeSetting
>
<Grid.Column mobile={ 16 } tablet={ 16 } computer={ 16 }>
<Field.CheckboxLegacy
listen={ subjectIncludeUserDomainChangeHandler }
ariaLabel="Subject include user domain"
name="subjectIncludeUserDomain"
label={ t("applications:forms.advancedAttributeSettings." +
"sections.subject.fields.subjectIncludeUserDomain.label") }
required={ false }
value={
initialSubject?.includeUserDomain ? [ "includeUserDomain" ] : [] }
subjectIncludeUserDomain ? [ "includeUserDomain" ] : [] }
readOnly={ readOnly }
data-testid={ `${ componentId }-subject-iInclude-user-domain-checkbox` }
hint={
Expand All @@ -570,6 +583,7 @@ export const AdvanceAttributeSettings: FunctionComponent<AdvanceAttributeSetting
>
<Grid.Column mobile={ 16 } tablet={ 16 } computer={ 16 }>
<Field.CheckboxLegacy
listen={ subjectIncludeTenantDomainChangeHandler }
ariaLabel="Subject include tenant domain"
name="subjectIncludeTenantDomain"
label={
Expand All @@ -578,7 +592,7 @@ export const AdvanceAttributeSettings: FunctionComponent<AdvanceAttributeSetting
}
required={ false }
value={
initialSubject?.includeTenantDomain
subjectIncludeTenantDomain
? [ "includeTenantDomain" ]
: []
}
Expand Down
Loading