diff --git a/packages/frontend/admin/src/modules/accounts/components/columns.tsx b/packages/frontend/admin/src/modules/accounts/components/columns.tsx index 83e3e36b48..67e5937154 100644 --- a/packages/frontend/admin/src/modules/accounts/components/columns.tsx +++ b/packages/frontend/admin/src/modules/accounts/components/columns.tsx @@ -5,16 +5,10 @@ import { } from '@affine/admin/components/ui/avatar'; import type { UserType } from '@affine/graphql'; import { FeatureType } from '@affine/graphql'; +import { AccountIcon, LockIcon, UnlockIcon } from '@blocksuite/icons/rc'; import type { ColumnDef } from '@tanstack/react-table'; import { cssVarV2 } from '@toeverything/theme/v2'; -import clsx from 'clsx'; -import { - LockIcon, - MailIcon, - MailWarningIcon, - UnlockIcon, - UserIcon, -} from 'lucide-react'; +import { MailIcon } from 'lucide-react'; import type { ReactNode } from 'react'; import { Checkbox } from '../../../components/ui/checkbox'; @@ -35,10 +29,10 @@ const StatusItem = ({ textFalse: string; }) => (
{condition ? ( <> @@ -89,7 +83,7 @@ export const columns: ColumnDef[] = [ - +
@@ -97,7 +91,7 @@ export const columns: ColumnDef[] = [ {row.original.name} {row.original.features.includes(FeatureType.Admin) && ( [] = [ )}
-
+
{row.original.email}
@@ -141,20 +140,29 @@ export const columns: ColumnDef[] = [ cell: ({ row: { original: user } }) => (
-
{user.id}
-
+
{user.id}
+
} - IconFalse={} + IconTrue={ + + } + IconFalse={} textTrue="Password Set" textFalse="No Password" /> - } - IconFalse={} + IconTrue={ + + } + IconFalse={} textTrue="Email Verified" textFalse="Email Not Verified" /> diff --git a/packages/frontend/admin/src/modules/accounts/components/data-table-row-actions.tsx b/packages/frontend/admin/src/modules/accounts/components/data-table-row-actions.tsx index 170ac091c4..a71c13bd25 100644 --- a/packages/frontend/admin/src/modules/accounts/components/data-table-row-actions.tsx +++ b/packages/frontend/admin/src/modules/accounts/components/data-table-row-actions.tsx @@ -170,25 +170,21 @@ export function DataTableRowActions({ user }: DataTableRowActionsProps) { -
- {user.name} -
- Reset Password Edit {user.disabled && ( Enable Email @@ -197,14 +193,14 @@ export function DataTableRowActions({ user }: DataTableRowActionsProps) { {!user.disabled && ( Disable & Delete data )} Delete diff --git a/packages/frontend/admin/src/modules/accounts/components/data-table.tsx b/packages/frontend/admin/src/modules/accounts/components/data-table.tsx index b11b9b9f00..0b924b2b75 100644 --- a/packages/frontend/admin/src/modules/accounts/components/data-table.tsx +++ b/packages/frontend/admin/src/modules/accounts/components/data-table.tsx @@ -69,9 +69,9 @@ export function DataTable({ }, [data]); return ( -
+
-
+
{table.getHeaderGroups().map(headerGroup => ( @@ -107,49 +107,54 @@ export function DataTable({ ))} - - {table.getRowModel().rows?.length ? ( - table.getRowModel().rows.map(row => ( - - {row.getVisibleCells().map(cell => { - let columnClassName = ''; - if (cell.column.id === 'select') { - columnClassName = 'w-[40px] flex-shrink-0'; - } else if (cell.column.id === 'info') { - columnClassName = 'flex-1'; - } else if (cell.column.id === 'property') { - columnClassName = 'flex-1'; - } else if (cell.column.id === 'actions') { - columnClassName = - 'w-[40px] flex-shrink-0 justify-center mr-6'; - } - - return ( - - {flexRender( - cell.column.columnDef.cell, - cell.getContext() - )} - - ); - })} - - )) - ) : ( - - - No results. - - - )} -
+ +
+ + + {table.getRowModel().rows?.length ? ( + table.getRowModel().rows.map(row => ( + + {row.getVisibleCells().map(cell => { + let columnClassName = ''; + if (cell.column.id === 'select') { + columnClassName = 'w-[40px] flex-shrink-0'; + } else if (cell.column.id === 'info') { + columnClassName = 'flex-1'; + } else if (cell.column.id === 'property') { + columnClassName = 'flex-1'; + } else if (cell.column.id === 'actions') { + columnClassName = + 'w-[40px] flex-shrink-0 justify-center mr-6'; + } + + return ( + + {flexRender( + cell.column.columnDef.cell, + cell.getContext() + )} + + ); + })} + + )) + ) : ( + + + No results. + + + )} + +
+
diff --git a/packages/frontend/admin/src/modules/accounts/components/delete-account.tsx b/packages/frontend/admin/src/modules/accounts/components/delete-account.tsx index 1a4b32ae2e..a7506d8f24 100644 --- a/packages/frontend/admin/src/modules/accounts/components/delete-account.tsx +++ b/packages/frontend/admin/src/modules/accounts/components/delete-account.tsx @@ -56,7 +56,7 @@ export const DeleteAccountDialog = ({ className="placeholder:opacity-50" /> -
+
diff --git a/packages/frontend/admin/src/modules/accounts/components/disable-account.tsx b/packages/frontend/admin/src/modules/accounts/components/disable-account.tsx index 19c92702ec..df4e9f7845 100644 --- a/packages/frontend/admin/src/modules/accounts/components/disable-account.tsx +++ b/packages/frontend/admin/src/modules/accounts/components/disable-account.tsx @@ -56,7 +56,7 @@ export const DisableAccountDialog = ({ className="placeholder:opacity-50" /> -
+
diff --git a/packages/frontend/admin/src/modules/accounts/components/discard-changes.tsx b/packages/frontend/admin/src/modules/accounts/components/discard-changes.tsx index 2038a09d09..fd7182bc62 100644 --- a/packages/frontend/admin/src/modules/accounts/components/discard-changes.tsx +++ b/packages/frontend/admin/src/modules/accounts/components/discard-changes.tsx @@ -23,13 +23,13 @@ export const DiscardChanges = ({ - Discard Changes - + Discard Changes + Changes to this user will not be saved. -
+
diff --git a/packages/frontend/admin/src/modules/accounts/components/enable-account.tsx b/packages/frontend/admin/src/modules/accounts/components/enable-account.tsx index 9ca8422777..9ffe9075f3 100644 --- a/packages/frontend/admin/src/modules/accounts/components/enable-account.tsx +++ b/packages/frontend/admin/src/modules/accounts/components/enable-account.tsx @@ -33,7 +33,7 @@ export const EnableAccountDialog = ({ -
+
diff --git a/packages/frontend/admin/src/modules/accounts/components/import-users-dialog.tsx b/packages/frontend/admin/src/modules/accounts/components/import-users-dialog.tsx index cd2a924943..bc97ee69e7 100644 --- a/packages/frontend/admin/src/modules/accounts/components/import-users-dialog.tsx +++ b/packages/frontend/admin/src/modules/accounts/components/import-users-dialog.tsx @@ -2,6 +2,7 @@ import { Button } from '@affine/admin/components/ui/button'; import { Dialog, DialogContent, + DialogDescription, DialogFooter, DialogHeader, DialogTitle, @@ -198,7 +199,9 @@ export function ImportUsersDialog({ return ( @@ -211,35 +214,32 @@ export function ImportUsersDialog({ : 'Import'} - - {isFormatError ? ( -
-

- You need to import the accounts by importing a CSV file in the - correct format. Please download the CSV template. -

-
- ) : isPreviewMode ? ( -
-

- {parsedUsers.length} users detected from the CSV file. Please - confirm the user list below and import. -

- -
- ) : ( -
-

- You need to import the accounts by importing a CSV file in the - correct format. Please download the CSV template. -

- - -
- )} + + {isFormatError ? ( + 'You need to import the accounts by importing a CSV file in the correct format. Please download the CSV template.' + ) : isPreviewMode ? ( +
+ {isImported ? null : ( +

+ {parsedUsers.length} users detected from the CSV file. Please + confirm the user list below and import. +

+ )} + +
+ ) : ( +
+

+ You need to import the accounts by importing a CSV file in the + correct format. Please download the CSV template. +

+ +
+ )} +
diff --git a/packages/frontend/admin/src/modules/layout.tsx b/packages/frontend/admin/src/modules/layout.tsx index b9ffa46c51..7ea3a11b23 100644 --- a/packages/frontend/admin/src/modules/layout.tsx +++ b/packages/frontend/admin/src/modules/layout.tsx @@ -216,7 +216,7 @@ export const LeftPanel = ({ onExpand={onExpand} onCollapse={onCollapse} className={cn( - isCollapsed ? 'min-w-[56px] max-w-[56px]' : 'min-w-56 max-w-56', + isCollapsed ? 'min-w-[57px] max-w-[57px]' : 'min-w-56 max-w-56', 'border-r h-dvh' )} style={{ overflow: 'visible' }} @@ -231,11 +231,18 @@ export const LeftPanel = ({ >
- + + + {!isCollapsed && 'AFFiNE'}