Added permission type to scope based permissions (#2575)
This commit is contained in:
parent
1447a77dc1
commit
24ec9fd60a
1 changed files with 22 additions and 23 deletions
|
@ -242,27 +242,25 @@ export default function PermissionDetails() {
|
|||
validated={errors.description ? "error" : "default"}
|
||||
/>
|
||||
</FormGroup>
|
||||
{permissionType !== "scope" && (
|
||||
<FormGroup
|
||||
label={t("applyToResourceTypeFlag")}
|
||||
fieldId="applyToResourceTypeFlag"
|
||||
labelIcon={
|
||||
<HelpItem
|
||||
helpText="clients-help:applyToResourceTypeFlag"
|
||||
fieldLabelId="clients:applyToResourceTypeFlag"
|
||||
/>
|
||||
}
|
||||
>
|
||||
<Switch
|
||||
id="applyToResourceTypeFlag"
|
||||
name="applyToResourceTypeFlag"
|
||||
label={t("common:on")}
|
||||
labelOff={t("common:off")}
|
||||
isChecked={applyToResourceTypeFlag}
|
||||
onChange={setApplyToResourceTypeFlag}
|
||||
<FormGroup
|
||||
label={t("applyToResourceTypeFlag")}
|
||||
fieldId="applyToResourceTypeFlag"
|
||||
labelIcon={
|
||||
<HelpItem
|
||||
helpText="clients-help:applyToResourceTypeFlag"
|
||||
fieldLabelId="clients:applyToResourceTypeFlag"
|
||||
/>
|
||||
</FormGroup>
|
||||
)}
|
||||
}
|
||||
>
|
||||
<Switch
|
||||
id="applyToResourceTypeFlag"
|
||||
name="applyToResourceTypeFlag"
|
||||
label={t("common:on")}
|
||||
labelOff={t("common:off")}
|
||||
isChecked={applyToResourceTypeFlag}
|
||||
onChange={setApplyToResourceTypeFlag}
|
||||
/>
|
||||
</FormGroup>
|
||||
{applyToResourceTypeFlag ? (
|
||||
<FormGroup
|
||||
label={t("resourceType")}
|
||||
|
@ -273,11 +271,12 @@ export default function PermissionDetails() {
|
|||
fieldLabelId="resourceType"
|
||||
/>
|
||||
}
|
||||
isRequired={permissionType === "scope"}
|
||||
>
|
||||
<KeycloakTextInput
|
||||
id="resourceType"
|
||||
name="resourceType"
|
||||
ref={register}
|
||||
ref={register({ required: permissionType === "scope" })}
|
||||
/>
|
||||
</FormGroup>
|
||||
) : (
|
||||
|
@ -292,7 +291,7 @@ export default function PermissionDetails() {
|
|||
}
|
||||
helperTextInvalid={t("common:required")}
|
||||
validated={errors.resources ? "error" : "default"}
|
||||
isRequired
|
||||
isRequired={permissionType !== "scope"}
|
||||
>
|
||||
<ResourcesPolicySelect
|
||||
name="resources"
|
||||
|
@ -306,7 +305,7 @@ export default function PermissionDetails() {
|
|||
? SelectVariant.typeahead
|
||||
: SelectVariant.typeaheadMulti
|
||||
}
|
||||
isRequired
|
||||
isRequired={permissionType !== "scope"}
|
||||
/>
|
||||
</FormGroup>
|
||||
)}
|
||||
|
|
Loading…
Reference in a new issue