feat(records): accent businessKey + remove redundant Export CSV from bulk bar
Per user feedback: - "поле Бизнес-ключ выделен цветом" — businessKey column TableCell теперь `text-mono text-accent` (было plain text-mono). Matches prototype 03 где RES-P-1, KAN-V-3, SNT-1A показаны в accent orange — primary identifier для каждой row. - "Экспорт CSV в bulk bar лишний как повтор Экспорт кнопки в InfoPanel" — убрал Export button из BulkSelectionToolbar. ExportModal pre-picks scope=selected когда selection.size > 0, поэтому workflow: select rows → click "↓ Экспорт..." в InfoPanel → modal с pre-selected scope. Бэк endpoint тот же, UX cleaner — один путь к export'у. - Removed handleBulkExport callback + DownloadSimpleIcon import (теперь unused).
This commit is contained in:
@@ -21,7 +21,7 @@ import {
|
|||||||
TableRow,
|
TableRow,
|
||||||
TextInput,
|
TextInput,
|
||||||
} from '@/ui'
|
} from '@/ui'
|
||||||
import { PlusIcon, PencilSimpleIcon, XCircleIcon, GearIcon, ClockCounterClockwiseIcon, TrashIcon, CheckCircleIcon, WarningIcon, XIcon, DownloadSimpleIcon, CaretLeftIcon, CaretRightIcon } from '@phosphor-icons/react'
|
import { PlusIcon, PencilSimpleIcon, XCircleIcon, GearIcon, ClockCounterClockwiseIcon, TrashIcon, CheckCircleIcon, WarningIcon, XIcon, CaretLeftIcon, CaretRightIcon } from '@phosphor-icons/react'
|
||||||
import {
|
import {
|
||||||
useAudit,
|
useAudit,
|
||||||
useDictionaryDetail,
|
useDictionaryDetail,
|
||||||
@@ -421,10 +421,8 @@ function DictionaryDetail() {
|
|||||||
setBulkOpen(true)
|
setBulkOpen(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleBulkExport = () => {
|
// handleBulkExport больше не нужен — bulk export через InfoPanel "Экспорт..."
|
||||||
if (selection.size === 0) return
|
// → ExportModal автоматически pre-picks scope=selected когда selection непуст.
|
||||||
bulkExportMut.mutate(Array.from(selection))
|
|
||||||
}
|
|
||||||
|
|
||||||
const handleBulkClose = () => {
|
const handleBulkClose = () => {
|
||||||
if (selection.size === 0) return
|
if (selection.size === 0) return
|
||||||
@@ -836,9 +834,7 @@ function DictionaryDetail() {
|
|||||||
count={selection.size}
|
count={selection.size}
|
||||||
totalVisible={filteredCount}
|
totalVisible={filteredCount}
|
||||||
onBulkClose={openBulkClose}
|
onBulkClose={openBulkClose}
|
||||||
onBulkExport={handleBulkExport}
|
|
||||||
onClear={clearSelection}
|
onClear={clearSelection}
|
||||||
isExporting={bulkExportMut.isPending}
|
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
<Panel>
|
<Panel>
|
||||||
@@ -882,7 +878,9 @@ function DictionaryDetail() {
|
|||||||
)}
|
)}
|
||||||
<TableCell>
|
<TableCell>
|
||||||
<div className="flex items-center gap-1.5">
|
<div className="flex items-center gap-1.5">
|
||||||
<span className="text-mono">{r.businessKey}</span>
|
{/* Business key — accent color per prototype (mono accent,
|
||||||
|
* primary identifier для каждой row). */}
|
||||||
|
<span className="text-mono text-accent">{r.businessKey}</span>
|
||||||
{pendingByKey.has(r.businessKey) ? (
|
{pendingByKey.has(r.businessKey) ? (
|
||||||
<span title={t('dict.pendingReview.tooltip')}>
|
<span title={t('dict.pendingReview.tooltip')}>
|
||||||
<Badge variant="warning">{t('dict.pendingReview.label')}</Badge>
|
<Badge variant="warning">{t('dict.pendingReview.label')}</Badge>
|
||||||
@@ -1265,18 +1263,23 @@ type BulkSelectionToolbarProps = {
|
|||||||
count: number
|
count: number
|
||||||
totalVisible: number
|
totalVisible: number
|
||||||
onBulkClose: () => void
|
onBulkClose: () => void
|
||||||
onBulkExport: () => void
|
|
||||||
onClear: () => void
|
onClear: () => void
|
||||||
isExporting: boolean
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* BulkSelectionToolbar — sticky bar появляется когда selection.size > 0.
|
||||||
|
*
|
||||||
|
* <p>Per user feedback: "Экспорт CSV в bulk bar лишний — повтор Экспорт
|
||||||
|
* кнопки в InfoPanel". Bulk export достижим через InfoPanel "↓ Экспорт..."
|
||||||
|
* → ExportModal с scope=selected (модал автоматически выбирает selected
|
||||||
|
* если selection непустой). Чтобы не дублировать, в bulk bar оставляем
|
||||||
|
* только destructive action — Закрыть выбранные.
|
||||||
|
*/
|
||||||
function BulkSelectionToolbar({
|
function BulkSelectionToolbar({
|
||||||
count,
|
count,
|
||||||
totalVisible,
|
totalVisible,
|
||||||
onBulkClose,
|
onBulkClose,
|
||||||
onBulkExport,
|
|
||||||
onClear,
|
onClear,
|
||||||
isExporting,
|
|
||||||
}: BulkSelectionToolbarProps) {
|
}: BulkSelectionToolbarProps) {
|
||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
return (
|
return (
|
||||||
@@ -1300,15 +1303,6 @@ function BulkSelectionToolbar({
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-2">
|
||||||
<Button
|
|
||||||
type="button"
|
|
||||||
variant="secondary"
|
|
||||||
leftIcon={<DownloadSimpleIcon weight="bold" size={14} />}
|
|
||||||
onClick={onBulkExport}
|
|
||||||
loading={isExporting}
|
|
||||||
>
|
|
||||||
{t('dict.bulk.exportAction')}
|
|
||||||
</Button>
|
|
||||||
<Button
|
<Button
|
||||||
type="button"
|
type="button"
|
||||||
variant="danger"
|
variant="danger"
|
||||||
|
|||||||
Reference in New Issue
Block a user