feat(MED-97): fix missing breadcrumbs, consistent layouts
This commit is contained in:
@@ -4,6 +4,7 @@ import { AdminAccountPage } from '@kit/admin/components/admin-account-page';
|
||||
import { AdminGuard } from '@kit/admin/components/admin-guard';
|
||||
|
||||
import { getAccount } from '~/lib/services/account.service';
|
||||
import { withI18n } from '~/lib/i18n/with-i18n';
|
||||
|
||||
interface Params {
|
||||
params: Promise<{
|
||||
@@ -27,6 +28,6 @@ async function AccountPage(props: Params) {
|
||||
return <AdminAccountPage account={account} />;
|
||||
}
|
||||
|
||||
export default AdminGuard(AccountPage);
|
||||
export default withI18n(AdminGuard(AccountPage));
|
||||
|
||||
const loadAccount = cache(getAccount);
|
||||
|
||||
@@ -8,6 +8,7 @@ import { getSupabaseServerClient } from '@kit/supabase/server-client';
|
||||
import { AppBreadcrumbs } from '@kit/ui/app-breadcrumbs';
|
||||
import { Button } from '@kit/ui/button';
|
||||
import { PageBody, PageHeader } from '@kit/ui/page';
|
||||
import { withI18n } from '~/lib/i18n/with-i18n';
|
||||
|
||||
interface SearchParams {
|
||||
page?: string;
|
||||
@@ -30,7 +31,7 @@ async function AccountsPage(props: AdminAccountsPageProps) {
|
||||
|
||||
return (
|
||||
<>
|
||||
<PageHeader description={<AppBreadcrumbs />}>
|
||||
<PageHeader description={<AppBreadcrumbs />} title="Accounts">
|
||||
<div className="flex justify-end gap-2">
|
||||
<AdminCreateUserDialog>
|
||||
<Button data-test="admin-create-user-button">
|
||||
@@ -84,4 +85,4 @@ async function AccountsPage(props: AdminAccountsPageProps) {
|
||||
);
|
||||
}
|
||||
|
||||
export default AdminGuard(AccountsPage);
|
||||
export default withI18n(AdminGuard(AccountsPage));
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { AdminDashboard } from '@kit/admin/components/admin-dashboard';
|
||||
import { AdminGuard } from '@kit/admin/components/admin-guard';
|
||||
import { PageBody, PageHeader } from '@kit/ui/page';
|
||||
import { withI18n } from '~/lib/i18n/with-i18n';
|
||||
|
||||
function AdminPage() {
|
||||
return (
|
||||
@@ -14,4 +15,4 @@ function AdminPage() {
|
||||
);
|
||||
}
|
||||
|
||||
export default AdminGuard(AdminPage);
|
||||
export default withI18n(AdminGuard(AdminPage));
|
||||
|
||||
@@ -170,6 +170,7 @@ async function TeamAccountPage(props: {
|
||||
<>
|
||||
<PageHeader
|
||||
className="border-b"
|
||||
title={'Account'}
|
||||
description={
|
||||
<AppBreadcrumbs
|
||||
values={{
|
||||
|
||||
@@ -18,8 +18,8 @@ export async function AdminDashboard() {
|
||||
' xl:grid-cols-4'
|
||||
}
|
||||
>
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<Card className="flex flex-col">
|
||||
<CardHeader className="flex-1">
|
||||
<CardTitle>Users</CardTitle>
|
||||
|
||||
<CardDescription>
|
||||
@@ -34,8 +34,8 @@ export async function AdminDashboard() {
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<Card className="flex flex-col">
|
||||
<CardHeader className="flex-1">
|
||||
<CardTitle>Company Accounts</CardTitle>
|
||||
|
||||
<CardDescription>
|
||||
|
||||
@@ -7,6 +7,7 @@ import { ColumnDef } from '@tanstack/react-table';
|
||||
import { Database } from '@kit/supabase/database';
|
||||
import { DataTable } from '@kit/ui/enhanced-data-table';
|
||||
import { ProfileAvatar } from '@kit/ui/profile-avatar';
|
||||
import { formatDateAndTime } from '@kit/shared/utils';
|
||||
|
||||
type Memberships =
|
||||
Database['medreport']['Functions']['get_account_members']['Returns'][number];
|
||||
@@ -17,10 +18,6 @@ export function AdminMembersTable(props: { members: Memberships[] }) {
|
||||
|
||||
function getColumns(): ColumnDef<Memberships>[] {
|
||||
return [
|
||||
{
|
||||
header: 'User ID',
|
||||
accessorKey: 'user_id',
|
||||
},
|
||||
{
|
||||
header: 'Name',
|
||||
cell: ({ row }) => {
|
||||
@@ -58,10 +55,16 @@ function getColumns(): ColumnDef<Memberships>[] {
|
||||
{
|
||||
header: 'Created At',
|
||||
accessorKey: 'created_at',
|
||||
cell: ({ row }) => {
|
||||
return formatDateAndTime(row.original.created_at);
|
||||
},
|
||||
},
|
||||
{
|
||||
header: 'Updated At',
|
||||
accessorKey: 'updated_at',
|
||||
cell: ({ row }) => {
|
||||
return formatDateAndTime(row.original.updated_at);
|
||||
},
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
@@ -82,7 +82,9 @@
|
||||
"profile": "Profile",
|
||||
"pickTime": "Pick time",
|
||||
"preferences": "Preferences",
|
||||
"security": "Security"
|
||||
"security": "Security",
|
||||
"admin": "Admin",
|
||||
"accounts": "Accounts"
|
||||
},
|
||||
"roles": {
|
||||
"owner": {
|
||||
|
||||
@@ -82,7 +82,9 @@
|
||||
"profile": "Profiil",
|
||||
"pickTime": "Vali aeg",
|
||||
"preferences": "Eelistused",
|
||||
"security": "Turvalisus"
|
||||
"security": "Turvalisus",
|
||||
"admin": "Admin",
|
||||
"accounts": "Kontod"
|
||||
},
|
||||
"roles": {
|
||||
"owner": {
|
||||
|
||||
@@ -82,7 +82,9 @@
|
||||
"profile": "Профиль",
|
||||
"pickTime": "Выбрать время",
|
||||
"preferences": "Предпочтения",
|
||||
"security": "Безопасность"
|
||||
"security": "Безопасность",
|
||||
"admin": "Админ",
|
||||
"accounts": "Аккаунты"
|
||||
},
|
||||
"roles": {
|
||||
"owner": {
|
||||
|
||||
Reference in New Issue
Block a user