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