🐛 fix: Replace MarkdownEditor with HTMLEditor in EmailBroadcastForm; simplify content rendering in EmailTaskManager; disable eslint in service index files

This commit is contained in:
web 2025-09-08 03:24:21 -07:00
parent ab6f6a64c2
commit e2d83ec9e6
4 changed files with 16 additions and 9 deletions

View File

@ -31,7 +31,7 @@ import {
} from '@workspace/ui/components/sheet'; } from '@workspace/ui/components/sheet';
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@workspace/ui/components/tabs'; import { Tabs, TabsContent, TabsList, TabsTrigger } from '@workspace/ui/components/tabs';
import { Textarea } from '@workspace/ui/components/textarea'; import { Textarea } from '@workspace/ui/components/textarea';
import { MarkdownEditor } from '@workspace/ui/custom-components/editor'; import { HTMLEditor } from '@workspace/ui/custom-components/editor';
import { EnhancedInput } from '@workspace/ui/custom-components/enhanced-input'; import { EnhancedInput } from '@workspace/ui/custom-components/enhanced-input';
import { Icon } from '@workspace/ui/custom-components/icon'; import { Icon } from '@workspace/ui/custom-components/icon';
import { useTranslations } from 'next-intl'; import { useTranslations } from 'next-intl';
@ -286,7 +286,7 @@ export default function EmailBroadcastForm() {
<FormItem> <FormItem>
<FormLabel>{t('content')}</FormLabel> <FormLabel>{t('content')}</FormLabel>
<FormControl> <FormControl>
<MarkdownEditor <HTMLEditor
value={field.value} value={field.value}
onChange={(value) => { onChange={(value) => {
form.setValue(field.name, value || ''); form.setValue(field.name, value || '');

View File

@ -253,10 +253,7 @@ export default function EmailTaskManager() {
<h4 className='text-muted-foreground mb-2 text-sm font-medium'> <h4 className='text-muted-foreground mb-2 text-sm font-medium'>
{t('content')} {t('content')}
</h4> </h4>
<div <div dangerouslySetInnerHTML={{ __html: selectedTask.content }} />
className='prose prose-sm max-w-none'
dangerouslySetInnerHTML={{ __html: selectedTask.content }}
/>
</div> </div>
{selectedTask.additional && ( {selectedTask.additional && (
<div> <div>
@ -278,10 +275,11 @@ export default function EmailTaskManager() {
onClick={() => refreshTaskStatus(row.id)} onClick={() => refreshTaskStatus(row.id)}
disabled={refreshing[row.id]} disabled={refreshing[row.id]}
> >
{refreshing[row.id] && ( {refreshing[row.id] ? (
<Icon icon='mdi:loading' className='mr-2 h-3 w-3 animate-spin' /> <Icon icon='mdi:loading' className='mr-2 h-3 w-3 animate-spin' />
) : (
<Icon icon='mdi:refresh' className='mr-2 h-3 w-3' />
)} )}
<Icon icon='mdi:refresh' className='h-3 w-3' />
</Button>, </Button>,
...([0, 1].includes(row.status) ...([0, 1].includes(row.status)
? [ ? [

View File

@ -155,7 +155,6 @@ export default function PaymentForm<T>({
<ScrollArea className='-mx-6 h-[calc(100vh-48px-36px-36px-env(safe-area-inset-top))]'> <ScrollArea className='-mx-6 h-[calc(100vh-48px-36px-36px-env(safe-area-inset-top))]'>
<Form {...form}> <Form {...form}>
<form onSubmit={form.handleSubmit(handleSubmit)} className='space-y-6 px-6 pt-4'> <form onSubmit={form.handleSubmit(handleSubmit)} className='space-y-6 px-6 pt-4'>
{/* 基本信息分组 */}
<div className='space-y-4'> <div className='space-y-4'>
<div className='grid grid-cols-1 gap-4 sm:grid-cols-2'> <div className='grid grid-cols-1 gap-4 sm:grid-cols-2'>
<FormField <FormField

View File

@ -211,6 +211,16 @@ export function ProTable<
// eslint-disable-next-line react-hooks/exhaustive-deps // eslint-disable-next-line react-hooks/exhaustive-deps
}, [pagination.pageIndex, pagination.pageSize, columnFilters]); }, [pagination.pageIndex, pagination.pageSize, columnFilters]);
useEffect(() => {
if (initialFilters) {
const newFilters = Object.entries(initialFilters).map(([id, value]) => ({
id,
value,
})) as ColumnFiltersState;
setColumnFilters(newFilters);
}
}, [initialFilters]);
const selectedRows = table.getSelectedRowModel().flatRows.map((row) => row.original); const selectedRows = table.getSelectedRowModel().flatRows.map((row) => row.original);
const selectedCount = selectedRows.length; const selectedCount = selectedRows.length;