Fixed issue comment on PR (#694)
* Fixed issue comment on PR see: https://github.com/keycloak/keycloak-admin-ui/pull/657#issuecomment-857488393 * remove delete action on create
This commit is contained in:
parent
861d382621
commit
a03c8fc79b
2 changed files with 27 additions and 21 deletions
|
@ -13,6 +13,8 @@ import {
|
||||||
Switch,
|
Switch,
|
||||||
ActionGroup,
|
ActionGroup,
|
||||||
Button,
|
Button,
|
||||||
|
TextArea,
|
||||||
|
NumberInput,
|
||||||
} from "@patternfly/react-core";
|
} from "@patternfly/react-core";
|
||||||
|
|
||||||
import type ClientScopeRepresentation from "keycloak-admin/lib/defs/clientScopeRepresentation";
|
import type ClientScopeRepresentation from "keycloak-admin/lib/defs/clientScopeRepresentation";
|
||||||
|
@ -228,7 +230,7 @@ export const ScopeForm = ({ clientScope, save }: ScopeFormProps) => {
|
||||||
}
|
}
|
||||||
fieldId="kc-consent-screen-text"
|
fieldId="kc-consent-screen-text"
|
||||||
>
|
>
|
||||||
<TextInput
|
<TextArea
|
||||||
ref={register}
|
ref={register}
|
||||||
type="text"
|
type="text"
|
||||||
id="kc-consent-screen-text"
|
id="kc-consent-screen-text"
|
||||||
|
@ -273,23 +275,23 @@ export const ScopeForm = ({ clientScope, save }: ScopeFormProps) => {
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
fieldId="kc-gui-order"
|
fieldId="kc-gui-order"
|
||||||
helperTextInvalid={t("shouldBeANumber")}
|
|
||||||
validated={
|
|
||||||
errors.attributes && errors.attributes["gui_order"]
|
|
||||||
? ValidatedOptions.error
|
|
||||||
: ValidatedOptions.default
|
|
||||||
}
|
|
||||||
>
|
>
|
||||||
<TextInput
|
<Controller
|
||||||
ref={register({ pattern: /^([0-9]*)$/ })}
|
|
||||||
type="text"
|
|
||||||
id="kc-gui-order"
|
|
||||||
name="attributes.gui-order"
|
name="attributes.gui-order"
|
||||||
validated={
|
defaultValue={1}
|
||||||
errors.attributes && errors.attributes["gui_order"]
|
control={control}
|
||||||
? ValidatedOptions.error
|
render={({ onChange, value }) => (
|
||||||
: ValidatedOptions.default
|
<NumberInput
|
||||||
}
|
type="text"
|
||||||
|
id="kc-gui-order"
|
||||||
|
value={value}
|
||||||
|
onPlus={() => onChange(value + 1)}
|
||||||
|
onMinus={() => onChange(value - 1)}
|
||||||
|
onChange={(event) =>
|
||||||
|
onChange(Number((event.target as HTMLInputElement).value))
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
/>
|
/>
|
||||||
</FormGroup>
|
</FormGroup>
|
||||||
<ActionGroup>
|
<ActionGroup>
|
||||||
|
|
|
@ -205,11 +205,15 @@ export const ClientScopeForm = () => {
|
||||||
titleKey={
|
titleKey={
|
||||||
clientScope ? clientScope.name! : "client-scopes:createClientScope"
|
clientScope ? clientScope.name! : "client-scopes:createClientScope"
|
||||||
}
|
}
|
||||||
dropdownItems={[
|
dropdownItems={
|
||||||
<DropdownItem key="delete" onClick={() => toggleDeleteDialog()}>
|
clientScope
|
||||||
{t("common:delete")}
|
? [
|
||||||
</DropdownItem>,
|
<DropdownItem key="delete" onClick={() => toggleDeleteDialog()}>
|
||||||
]}
|
{t("common:delete")}
|
||||||
|
</DropdownItem>,
|
||||||
|
]
|
||||||
|
: undefined
|
||||||
|
}
|
||||||
badge={clientScope ? clientScope.protocol : undefined}
|
badge={clientScope ? clientScope.protocol : undefined}
|
||||||
divider={!id}
|
divider={!id}
|
||||||
/>
|
/>
|
||||||
|
|
Loading…
Reference in a new issue