feat: reduce demo role switcher to Verwaltung + Bürosuche only
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -3,14 +3,10 @@ import { UserRole } from '../../domain/enums'
|
|||||||
import { authService } from '../../services/authService'
|
import { authService } from '../../services/authService'
|
||||||
import { useSessionStore } from '../../stores/sessionStore'
|
import { useSessionStore } from '../../stores/sessionStore'
|
||||||
|
|
||||||
const ROLE_LABELS: Record<UserRole, string> = {
|
const DEMO_ROLES: { role: UserRole; label: string }[] = [
|
||||||
[UserRole.SUPER_ADMIN]: 'Super Admin',
|
{ role: UserRole.PROPERTY_MANAGER, label: 'Verwaltung' },
|
||||||
[UserRole.ORGANIZATION_ADMIN]: 'Org Admin',
|
{ role: UserRole.DEMAND_USER, label: 'Bürosuche' },
|
||||||
[UserRole.PROPERTY_MANAGER]: 'Prop. Manager',
|
]
|
||||||
[UserRole.REVIEWER]: 'Reviewer',
|
|
||||||
[UserRole.OWNER_VIEWER]: 'Owner Viewer',
|
|
||||||
[UserRole.DEMAND_USER]: 'Demand User',
|
|
||||||
}
|
|
||||||
|
|
||||||
export function DemoRoleSwitcher() {
|
export function DemoRoleSwitcher() {
|
||||||
const { currentUser } = useSessionStore()
|
const { currentUser } = useSessionStore()
|
||||||
@@ -28,12 +24,12 @@ export function DemoRoleSwitcher() {
|
|||||||
Demo-Modus
|
Demo-Modus
|
||||||
</Typography>
|
</Typography>
|
||||||
<Box sx={{ display: 'flex', flexWrap: 'wrap', gap: 0.5 }}>
|
<Box sx={{ display: 'flex', flexWrap: 'wrap', gap: 0.5 }}>
|
||||||
{Object.values(UserRole).map((role) => {
|
{DEMO_ROLES.map(({ role, label }) => {
|
||||||
const active = currentUser?.role === role
|
const active = currentUser?.role === role
|
||||||
return (
|
return (
|
||||||
<Chip
|
<Chip
|
||||||
key={role}
|
key={role}
|
||||||
label={ROLE_LABELS[role]}
|
label={label}
|
||||||
size="small"
|
size="small"
|
||||||
clickable
|
clickable
|
||||||
onClick={() => handleSwitch(role)}
|
onClick={() => handleSwitch(role)}
|
||||||
|
|||||||
@@ -7,11 +7,7 @@ import { useToastStore } from '../../stores/toastStore'
|
|||||||
import { DemoRoleSwitcher } from '../auth/DemoRoleSwitcher'
|
import { DemoRoleSwitcher } from '../auth/DemoRoleSwitcher'
|
||||||
|
|
||||||
const ROLE_LABELS: Record<string, string> = {
|
const ROLE_LABELS: Record<string, string> = {
|
||||||
SUPER_ADMIN: 'Super Admin',
|
|
||||||
ORGANIZATION_ADMIN: 'Org Admin',
|
|
||||||
PROPERTY_MANAGER: 'Property Manager',
|
PROPERTY_MANAGER: 'Property Manager',
|
||||||
REVIEWER: 'Reviewer',
|
|
||||||
OWNER_VIEWER: 'Owner Viewer',
|
|
||||||
DEMAND_USER: 'Demand User',
|
DEMAND_USER: 'Demand User',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user