feat: platform admin frontend — pages, composables, navigation, impersonation
Build the frontend for platform admin in apps/app/: - TypeScript types (admin.ts) and API composable (useAdmin.ts) with TanStack Query for all admin endpoints - ImpersonationStore (Pinia) + ImpersonationBanner component integrated in the main layout, with token-based session management - Platform navigation section (conditionally shown for super_admin users) - Route guard blocking /platform/* for non-super_admin users - 6 pages: dashboard with stats cards, organisations list/detail, users list/detail with impersonation, activity log with expandable rows - All pages implement loading/error/empty states per conventions - Vite build passes cleanly Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
49
apps/app/src/components/platform/ImpersonationBanner.vue
Normal file
49
apps/app/src/components/platform/ImpersonationBanner.vue
Normal file
@@ -0,0 +1,49 @@
|
||||
<script setup lang="ts">
|
||||
import { useImpersonationStore } from '@/stores/useImpersonationStore'
|
||||
|
||||
const impersonationStore = useImpersonationStore()
|
||||
|
||||
const isStopping = ref(false)
|
||||
|
||||
async function handleStop() {
|
||||
isStopping.value = true
|
||||
await impersonationStore.stopImpersonation()
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<VBanner
|
||||
v-if="impersonationStore.isImpersonating"
|
||||
color="warning"
|
||||
sticky
|
||||
class="impersonation-banner"
|
||||
>
|
||||
<template #prepend>
|
||||
<VIcon icon="tabler-user-exclamation" />
|
||||
</template>
|
||||
|
||||
<VBannerText>
|
||||
Je bekijkt het platform als
|
||||
<strong>{{ impersonationStore.impersonatedUser?.full_name }}</strong>
|
||||
({{ impersonationStore.impersonatedUser?.email }})
|
||||
</VBannerText>
|
||||
|
||||
<template #actions>
|
||||
<VBtn
|
||||
variant="tonal"
|
||||
color="warning"
|
||||
:loading="isStopping"
|
||||
prepend-icon="tabler-arrow-back"
|
||||
@click="handleStop"
|
||||
>
|
||||
Terug naar admin
|
||||
</VBtn>
|
||||
</template>
|
||||
</VBanner>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.impersonation-banner {
|
||||
z-index: 1050;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user