feat(role-permissions-page): Admin-Page zum Anzeigen welche Permissions welche Rolle hat [tsc:fail]

This commit is contained in:
Dennis (via Claude+Gemma) 2026-05-23 08:46:36 +02:00
parent 1f83bb7148
commit 3ed9379e83
3 changed files with 145 additions and 2 deletions

View File

@ -1,9 +1,10 @@
{
"completed_features": [],
"current_feature": "holiday-calendar",
"current_feature": "role-permissions-page",
"started_at": "2026-05-23T08:41:41.344530",
"attempted_features": [
"working-hours-config",
"default-project-per-customer"
"default-project-per-customer",
"holiday-calendar"
]
}

View File

@ -2938,3 +2938,21 @@ src/index.ts(27,25): error TS2769: No overload matches this call.
Overload 1 of 3, '(plugin: FastifyPluginCallback<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>, opts?: FastifyRegisterOptions<...> | undefined): FastifyInstance<...> & PromiseLike<...>', gave the following error.
Argument of type 'Promise<FastifyMultipartPlugin>' is not assignable to parameter of type 'FastifyPluginCallback<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>'.
Type 'Promise<FastifyMultipartPlugin>' provides no match for the signature '(instance: FastifyInstance<RawServerDefault, IncomingMessage, ServerResponse<IncomingMessage>,
- `08:45:57` **INFO** Committed feature holiday-calendar
- `08:45:58` **INFO** Pushed: rc=0
## Phase-3 Feature: role-permissions-page (2026-05-23 08:45:58)
- `08:45:58` **INFO** Description: Admin-Page zum Anzeigen welche Permissions welche Rolle hat (Read-only Matrix)
- `08:45:58` **INFO** Generating apps/web/src/pages/RolePermissions.tsx (RolePermissions-Page (admin-only). Statische Tabelle: Spalten Admin/Us…)
- `08:46:34` **INFO** wrote 4181 chars in 36.4s (attempt 1)
- `08:46:34` **INFO** Running tsc --noEmit on api…
- `08:46:36` **WARN** tsc errors:
src/db/schema.ts(37,14): error TS7022: 'customers' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.
src/db/schema.ts(43,59): error TS7024: Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions.
src/db/schema.ts(47,14): error TS7022: 'projects' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.
src/db/schema.ts(51,56): error TS7024: Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions.
src/index.ts(27,25): error TS2769: No overload matches this call.
Overload 1 of 3, '(plugin: FastifyPluginCallback<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>, opts?: FastifyRegisterOptions<...> | undefined): FastifyInstance<...> & PromiseLike<...>', gave the following error.
Argument of type 'Promise<FastifyMultipartPlugin>' is not assignable to parameter of type 'FastifyPluginCallback<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>'.
Type 'Promise<FastifyMultipartPlugin>' provides no match for the signature '(instance: FastifyInstance<RawServerDefault, IncomingMessage, ServerResponse<IncomingMessage>,

View File

@ -0,0 +1,124 @@
import React from 'react';
import { createFileRoute } from '@tanstack/react-router';
import { ShieldCheck, Lock } from 'lucide-react';
type Permission = {
id: string;
label: string;
description: string;
roles: {
admin: boolean;
user: boolean;
};
};
const PERMISSIONS_DATA: Permission[] = [
{
id: 'view_dashboard',
label: 'View Dashboard',
description: 'Access to the main overview and statistics',
roles: { admin: true, user: true },
},
{
id: 'edit_own_entries',
label: 'Edit Own Entries',
description: 'Modify records created by the current user',
roles: { admin: true, user: true },
},
{
id: 'manage_users',
label: 'Manage Users',
description: 'Create, edit, and delete user accounts',
roles: { admin: true, user: false },
},
{
id: 'configure_settings',
label: 'Configure Settings',
description: 'Change global application configurations',
roles: { admin: true, user: false },
},
{
id: 'view_audit_log',
label: 'View Audit Log',
description: 'Access to system-wide activity logs',
roles: { admin: true, user: false },
},
];
export const Route = createFileRoute('/role-permissions')({
component: RolePermissionsPage,
});
function RolePermissionsPage() {
return (
<div className="p-6 max-w-5xl mx-auto">
<div className="mb-8 flex items-center gap-3">
<div className="p-2 bg-indigo-100 text-indigo-600 rounded-lg">
<ShieldCheck size={24} />
</div>
<div>
<h1 className="text-2xl font-bold text-slate-900">Role Permissions</h1>
<p className="text-slate-500 text-sm">Reference guide for system access levels</p>
</div>
</div>
<div className="bg-white border border-slate-200 rounded-xl overflow-hidden shadow-sm">
<table className="w-full text-left border-collapse">
<thead>
<tr className="bg-slate-50 border-b border-slate-200">
<th className="px-6 py-4 text-sm font-semibold text-slate-700">Permission</th>
<th className="px-6 py-4 text-sm font-semibold text-slate-700 text-center w-32">Admin</th>
<th className="px-6 py-4 text-sm font-semibold text-slate-700 text-center w-32">User</th>
</tr>
</thead>
<tbody className="divide-y divide-slate-200">
{PERMISSIONS_DATA.map((perm) => (
<tr key={perm.id} className="hover:bg-slate-50 transition-colors">
<td className="px-6 py-4">
<div className="font-medium text-slate-900">{perm.label}</div>
<div className="text-xs text-slate-500">{perm.description}</div>
</td>
<td className="px-6 py-4 text-center">
<PermissionCheck active={perm.roles.admin} />
</td>
<td className="px-6 py-4 text-center">
<PermissionCheck active={perm.roles.user} />
</td>
</tr>
))}
</tbody>
</table>
</div>
<div className="mt-6 p-4 bg-amber-50 border border-amber-200 rounded-lg flex gap-3 items-start">
<Lock size={18} className="text-amber-600 mt-0.5 shrink-0" />
<p className="text-sm text-amber-800">
<strong>Note:</strong> This is a read-only documentation view. Permissions are hard-coded
in the system core and cannot be modified via the UI.
</p>
</div>
</div>
);
}
function PermissionCheck({ active }: { active: boolean }) {
return (
<div className="flex justify-center">
{active ? (
<div className="w-5 h-5 rounded-full bg-green-100 flex items-center justify-center">
<svg
className="w-3.5 h-3.5 text-green-600"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
strokeWidth={3}
>
<path strokeLinecap="round" strokeLinejoin="round" d="M5 13l4 4L19 7" />
</svg>
</div>
) : (
<div className="w-5 h-5 rounded-full bg-slate-100 border border-slate-200" />
)}
</div>
);
}