bug fixes
This commit is contained in:
@@ -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>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user