bug fixes

This commit is contained in:
Matthias Hochmeister
2026-03-03 14:45:46 +01:00
parent 004b141cab
commit 5dfaf7db54
11 changed files with 166 additions and 35 deletions

View File

@@ -41,6 +41,8 @@ function Profile() {
});
};
const dashboardGroups = (user.groups ?? []).filter((g) => g.startsWith('dashboard_'));
return (
<DashboardLayout>
<Container maxWidth="lg">
@@ -93,7 +95,7 @@ function Profile() {
<Divider sx={{ my: 2 }} />
{/* Groups/Roles */}
{user.groups && user.groups.length > 0 && (
{dashboardGroups.length > 0 && (
<Box sx={{ mt: 2 }}>
<Typography
variant="subtitle2"
@@ -105,9 +107,11 @@ function Profile() {
Gruppen
</Typography>
<Box sx={{ display: 'flex', flexWrap: 'wrap', gap: 1, mt: 1 }}>
{user.groups.map((group) => (
<Chip key={group} label={group} size="small" color="primary" />
))}
{dashboardGroups.map((group) => {
const name = group.replace(/^dashboard_/, '');
const label = name.charAt(0).toUpperCase() + name.slice(1);
return <Chip key={group} label={label} size="small" color="primary" />;
})}
</Box>
</Box>
)}