+
+ } type="text">
+ Roles
+
+
+ {role?.name}
+
+ }
+ >
+
+
+ ,
+ },
+ {
+ key: 'permissions',
+ label: 'Permissions',
+ children: ,
+ },
+ {
+ key: 'members',
+ label: 'Manage Members',
+ children: (
+
+ ),
+ },
+ ]}
+ />
+
+
+
+ );
};
export default Page;
diff --git a/src/management-system-v2/app/(dashboard)/[environmentId]/iam/roles/[roleId]/role-id-page.tsx b/src/management-system-v2/app/(dashboard)/[environmentId]/iam/roles/[roleId]/role-id-page.tsx
deleted file mode 100644
index 2210d1eed..000000000
--- a/src/management-system-v2/app/(dashboard)/[environmentId]/iam/roles/[roleId]/role-id-page.tsx
+++ /dev/null
@@ -1,63 +0,0 @@
-import Content from '@/components/content';
-import { Button, Card, Space, Tabs } from 'antd';
-import { LeftOutlined } from '@ant-design/icons';
-import RoleGeneralData from './roleGeneralData';
-import RolePermissions from './rolePermissions';
-import RoleMembers from './role-members';
-import { FC } from 'react';
-import { Role } from '@/lib/data/role-schema';
-import { AuthenticatedUser } from '@/lib/data/user-schema';
-import SpaceLink from '@/components/space-link';
-
-const RoleId: FC<{
- role: Role;
- usersInRole: AuthenticatedUser[];
- usersNotInRole: AuthenticatedUser[];
-}> = ({ role, usersInRole, usersNotInRole }) => {
- return (
-
-
- } type="text">
- Roles
-
-
- {role?.name}
-
- }
- >
-
-
- ,
- },
- {
- key: 'permissions',
- label: 'Permissions',
- children: ,
- },
- {
- key: 'members',
- label: 'Manage Members',
- children: (
-
- ),
- },
- ]}
- />
-
-
-
- );
-};
-
-export default RoleId;
diff --git a/src/management-system-v2/app/(dashboard)/[environmentId]/iam/roles/[roleId]/roleGeneralData.tsx b/src/management-system-v2/app/(dashboard)/[environmentId]/iam/roles/[roleId]/roleGeneralData.tsx
index b02cb9513..ba872d09d 100644
--- a/src/management-system-v2/app/(dashboard)/[environmentId]/iam/roles/[roleId]/roleGeneralData.tsx
+++ b/src/management-system-v2/app/(dashboard)/[environmentId]/iam/roles/[roleId]/roleGeneralData.tsx
@@ -1,42 +1,106 @@
'use client';
import { toCaslResource } from '@/lib/ability/caslAbility';
-import { Alert, App, Button, DatePicker, Form, Input } from 'antd';
-import { FC, useEffect, useState } from 'react';
+import { Alert, App, Button, DatePicker, Form, Input, Modal, Space } from 'antd';
+import { FC, useState } from 'react';
import dayjs from 'dayjs';
import germanLocale from 'antd/es/date-picker/locale/de_DE';
import { useAbilityStore } from '@/lib/abilityStore';
import { updateRole } from '@/lib/data/roles';
import { useRouter } from 'next/navigation';
-import { Role } from '@/lib/data/role-schema';
+import { Role, RoleInputSchema } from '@/lib/data/role-schema';
import { useEnvironment } from '@/components/auth-can';
+import useParseZodErrors, { antDesignInputProps } from '@/lib/useParseZodErrors';
+import FormSubmitButton from '@/components/form-submit-button';
+import { FolderTree } from '@/components/FolderTree';
+import { ProcessListItemIcon } from '@/components/process-list';
+import { Folder } from '@/lib/data/folder-schema';
import { wrapServerCall } from '@/lib/wrap-server-call';
-const RoleGeneralData: FC<{ role: Role }> = ({ role: _role }) => {
+const InputSchema = RoleInputSchema.omit({ environmentId: true, permissions: true });
+
+const FolderInput = ({
+ onChange,
+ defaultFolder,
+}: {
+ value?: string;
+ onChange?: (id: Role['parentId']) => void;
+ defaultFolder?: Folder;
+}) => {
+ const [modalOpen, setModalOpen] = useState(false);
+ const [selectedFolder, setSelectedFolder] = useState<{ type: string; name: string } | undefined>(
+ () =>
+ defaultFolder && {
+ type: 'folder',
+ name: defaultFolder.parentId ? defaultFolder.name : '< root >',
+ },
+ );
+
+ return (
+ <>
+