Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

Commit

Permalink
add pattern to groupname (#339)
Browse files Browse the repository at this point in the history
* add pattern to groupname

* adjust groupname pattern, fix routing

* adjust pattern

* adjust name max length

* fix: regex

---------

Co-authored-by: Andreas Scheibal <[email protected]>
  • Loading branch information
ggrund-tsi and ascheibal authored Feb 27, 2023
1 parent 3c88ec3 commit 6e559cd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/components/modals/group-modal.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,8 @@ const GroupModal = (props: any) => {
updateGroupProp('name', evt.target.value);
props.resetError();
}}
maxLength={45}
pattern={'^[A-Za-z0-9\\säöüÄÜÖß\\-_]*$'}
maxLength={50}
isInvalid={props.isCreationError}
InvalidText={t('translation:group-conflict-error')}
/>
Expand Down
6 changes: 3 additions & 3 deletions src/components/modules/private-route.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import AppContext from '../../store/app-context';

interface PrivateRouteProps {
roles?: string[];
enabled?: boolean;
disabled?: boolean;
}

const PrivateRoute = (props: PrivateRouteProps) => {
Expand All @@ -38,7 +38,7 @@ const PrivateRoute = (props: PrivateRouteProps) => {
const [isInit, setIsInit] = React.useState(false);
const [isAuthorized, setIsAuthorized] = React.useState(false);

const { roles, enabled } = props;
const { roles, disabled } = props;

React.useEffect(() => {
if (keycloak) {
Expand Down Expand Up @@ -66,7 +66,7 @@ const PrivateRoute = (props: PrivateRouteProps) => {
return (
<>
{isInit &&
(isAuthorized && enabled ? (
(isAuthorized && !disabled ? (
<Outlet />
) : (
<Navigate
Expand Down
2 changes: 1 addition & 1 deletion src/routing.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ const Routing = () => {
element={
<PrivateRoute
roles={['c19_quick_test_admin']}
enabled={userManagementRouteIsEnabled}
disabled={!userManagementRouteIsEnabled}
/>
}
>
Expand Down

0 comments on commit 6e559cd

Please sign in to comment.