Skip to content

Provide the first class support for the multi valued property #7968

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Apr 18, 2025
Merged
Show file tree
Hide file tree
Changes from 4 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
8 changes: 8 additions & 0 deletions .changeset/warm-geckos-agree.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@wso2is/console": minor
"@wso2is/admin.claims.v1": patch
"@wso2is/core": patch
"@wso2is/i18n": patch
---

Provide first class support to configure claims as multi valued
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,8 @@ export const EditBasicDetailsLocalClaims: FunctionComponent<EditBasicDetailsLoca
: claim?.displayName,
displayOrder: attributeConfig.editAttributes.getDisplayOrder(
claim.displayOrder, values.displayOrder?.toString()),
multiValued: values?.multiValued !== undefined
? !!values.multiValued : claim?.multiValued,
properties: claim?.properties,
readOnly: values?.readOnly !== undefined
? !!values.readOnly
Expand Down Expand Up @@ -573,6 +575,8 @@ export const EditBasicDetailsLocalClaims: FunctionComponent<EditBasicDetailsLoca
: claim?.displayName,
displayOrder: attributeConfig.editAttributes.getDisplayOrder(
claim.displayOrder, values.displayOrder?.toString()),
multiValued: values?.multiValued !== undefined
? !!values.multiValued : claim?.multiValued,
profiles: {
console: {
readOnly: values?.consoleReadOnly !== undefined ?
Expand Down Expand Up @@ -953,6 +957,18 @@ export const EditBasicDetailsLocalClaims: FunctionComponent<EditBasicDetailsLoca
hint={ t("claims:local.forms.descriptionHint") }
readOnly={ isSubOrganization() || isReadOnly }
/>

<Field.Checkbox
ariaLabel={ t("claims:local.forms.multiValued.label") }
name="multiValued"
label={ t("claims:local.forms.multiValued.label") }
required={ false }
defaultValue={ claim?.multiValued }
data-testid={ `${testId}-form-multi-valued-input` }
hint={ t("claims:local.forms.multiValuedHint") }
readOnly={ isReadOnly }
/>

{ !attributeConfig.localAttributes.createWizard.showRegularExpression && !hideSpecialClaims
&& (
<Field.Input
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ export const BasicDetailsLocalClaims = (props: BasicDetailsLocalClaimsPropsInter
description: values.get("description")?.toString(),
displayName: values.get("name").toString(),
displayOrder: values.get("displayOrder") ? parseInt(values.get("displayOrder")?.toString()) : 0,
multiValued: values.get("multiValued")?.length > 0,
readOnly: values.get("readOnly")?.length > 0,
regEx: values.get("regularExpression")?.toString(),
required: values.get("required")?.length > 0,
Expand Down
1 change: 1 addition & 0 deletions modules/core/src/models/claim.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export interface Claim {
dialectURI?: string;
description: string;
displayOrder: number;
multiValued: boolean;
displayName: string;
readOnly: boolean;
regEx: string;
Expand Down
5 changes: 5 additions & 0 deletions modules/i18n/src/models/namespaces/claims-ns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,11 @@ export interface ClaimsNS {
label: string;
placeholder: string;
};
multiValued: {
label: string;
placeholder: string;
};
multiValuedHint: string;
displayOrderHint: string;
required: {
label: string;
Expand Down
5 changes: 5 additions & 0 deletions modules/i18n/src/models/namespaces/console-ns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4275,6 +4275,11 @@ export interface ConsoleNS {
placeholder: string;
};
displayOrderHint: string;
multiValued: {
label: string;
placeholder: string;
};
multiValuedHint: string;
required: {
label: string;
};
Expand Down
5 changes: 5 additions & 0 deletions modules/i18n/src/translations/en-US/portals/claims.ts
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,11 @@ export const claims: ClaimsNS = {
disabledConfigInfo: "Please note that below section is disabled as there is no " +
"external claim mapping found for this claim attribute."
},
multiValued: {
label: "Allow multiple values for this attribute",
placeholder: "Select a user attribute"
},
multiValuedHint: "Select this option if the attribute can have multiple values.",
name: {
label: "Attribute Display Name",
placeholder: "Enter the display name",
Expand Down
5 changes: 5 additions & 0 deletions modules/i18n/src/translations/en-US/portals/console.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3576,6 +3576,11 @@ export const console: ConsoleNS = {
label: "Display Order",
placeholder: "Enter the display order"
},
multiValued: {
label: "Allow multiple values for this attribute",
placeholder: "Select a user attribute"
},
multiValuedHint: "Select this option if the attribute can have multiple values.",
displayOrderHint: "This determines the position at which this attribute is "
+ "displayed in the user profile and the user registration page",
infoMessages: {
Expand Down
Loading