now validates if gui order is a number (#338)

This commit is contained in:
Erik Jan de Wit 2021-02-09 10:35:38 +01:00 committed by GitHub
parent 32a3ff150b
commit 4edcf233f3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 2 deletions

View file

@ -284,12 +284,23 @@ export const ClientScopeForm = () => {
/>
}
fieldId="kc-gui-order"
helperTextInvalid={t("shouldBeANumber")}
validated={
errors.attributes && errors.attributes["gui_order"]
? ValidatedOptions.error
: ValidatedOptions.default
}
>
<TextInput
ref={register}
type="number"
ref={register({ pattern: /^([0-9]*)$/ })}
type="text"
id="kc-gui-order"
name="attributes.gui_order"
validated={
errors.attributes && errors.attributes["gui_order"]
? ValidatedOptions.error
: ValidatedOptions.default
}
/>
</FormGroup>
<ActionGroup>

View file

@ -54,6 +54,7 @@
"displayOnConsentScreen": "Display on consent screen",
"consentScreenText": "Consent screen text",
"guiOrder": "Display Order",
"shouldBeANumber": "Should be a number",
"chooseAMapperType": "Choose a mapper type",
"predefinedMappingDescription": "Choose one of the predefined mappings from this table",
"mappingTable": "Table with predefined mapping",