Skip to content

Commit

Permalink
fix(IDP management): allow extend range for extID field (#503)
Browse files Browse the repository at this point in the history
  • Loading branch information
oyo authored Feb 12, 2024
1 parent 69ecc07 commit 30d32cb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## unreleased 1.8.0-RC5

### Bugfix

- IDP Management
- Allow 6-36 alphanumeric characters for IDP extID

## 1.8.0-RC4

### Change
Expand Down
4 changes: 2 additions & 2 deletions src/components/overlays/OSPRegister/OSPRegisterContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {
isCityName,
isCompanyName,
isCountryCode,
isExtID,
isFirstName,
isID,
isLastName,
Expand All @@ -33,7 +34,6 @@ import {
isRegionNameOrEmpty,
isStreetName,
isStreetNumberOrEmpty,
isUUID,
isZipCodeOrEmpty,
} from 'types/Patterns'
import { useTranslation } from 'react-i18next'
Expand Down Expand Up @@ -103,7 +103,7 @@ const OSPRegisterForm = ({
name={'extid'}
label={t('field.extid.name')}
hint={t('field.extid.hint')}
validate={isUUID}
validate={isExtID}
onInvalid={invalidate}
onValid={(_key, value: string) => {
updateData({
Expand Down
3 changes: 3 additions & 0 deletions src/types/Patterns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export const Patterns = {
'i'
),
UUID: /^[a-f0-9]{8}(-[a-f0-9]{4}){4}[a-f0-9]{8}$/i,
EXTID: /^[a-z0-9]{6,36}$/i,
COMPANY_NAME:
/^\d*?[a-zÀ-ÿ]\d?([a-z0-9À-ÿ!?@&_£$¥\-.,:;'()*+#%=]\s?){2,40}$/i,
name: /^([A-Za-zÀ-ÿ-,.'](?!.*[-,.]{2})[A-Za-zÀ-ÿ-,.']{1,40} ?)[^ ]{1,40}$/,
Expand Down Expand Up @@ -102,6 +103,8 @@ export const isURL = (expr: string) => Patterns.URL.test(expr)
export const isKeycloakURL = (expr: string) =>
isURL(expr) && !expr.includes('#')
export const isUUID = (expr: string) => Patterns.UUID.test(expr)
export const isExtID = (expr: string) =>
Patterns.EXTID.test(expr) || isUUID(expr)
export const isCompanyName = (expr: string) => Patterns.COMPANY_NAME.test(expr)
export const isName = (expr: string) => Patterns.name.test(expr)
export const isCityName = isName
Expand Down

0 comments on commit 30d32cb

Please sign in to comment.