Compare commits
No commits in common. "6c768ef6a9ac3a6506e649ba2328712392b604b8" and "9a94f4e3a9e40e55af0d8f144873b252300a95f1" have entirely different histories.
6c768ef6a9
...
9a94f4e3a9
@ -1,7 +1,5 @@
|
||||
import { useEffect } from 'react';
|
||||
import { useSearchParams } from 'react-router-dom';
|
||||
import { Box } from '@mui/material';
|
||||
import { Heading, Text } from '@moex-vibe/design-system';
|
||||
import {
|
||||
BROKER_OPERATION_TYPE_OPTIONS,
|
||||
isBrokerOperationType,
|
||||
@ -34,9 +32,7 @@ export function BrokerOperationsPage() {
|
||||
}
|
||||
|
||||
const history = operations.error ? (
|
||||
<Text component="p" tone="negative" role="alert">
|
||||
Не удалось загрузить историю операций
|
||||
</Text>
|
||||
<p role="alert">Не удалось загрузить историю операций</p>
|
||||
) : (
|
||||
<BrokerOperationsTable
|
||||
title="История операций"
|
||||
@ -57,15 +53,13 @@ export function BrokerOperationsPage() {
|
||||
);
|
||||
|
||||
return (
|
||||
<Box component="section" aria-labelledby="broker-operations-heading">
|
||||
<Box
|
||||
sx={{ display: 'flex', alignItems: 'end', justifyContent: 'space-between', gap: 2, mb: 2 }}
|
||||
>
|
||||
<Heading level={2} id="broker-operations-heading">
|
||||
<section aria-labelledby="broker-operations-heading">
|
||||
<div className="broker-operations__toolbar">
|
||||
<h2 id="broker-operations-heading" style={{ fontSize: 20, margin: 0 }}>
|
||||
Операции
|
||||
</Heading>
|
||||
<Box component="label" sx={{ display: 'grid', gap: 0.5, color: 'text.secondary' }}>
|
||||
<Text variant="label">Тип операции</Text>
|
||||
</h2>
|
||||
<label>
|
||||
<span>Тип операции</span>
|
||||
<select value={selectedType} onChange={handleTypeChange}>
|
||||
<option value="">Все операции</option>
|
||||
{BROKER_OPERATION_TYPE_OPTIONS.map((option) => (
|
||||
@ -74,9 +68,9 @@ export function BrokerOperationsPage() {
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
</Box>
|
||||
</Box>
|
||||
</label>
|
||||
</div>
|
||||
{history}
|
||||
</Box>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
|
||||
@ -1,5 +1,3 @@
|
||||
import { Box } from '@mui/material';
|
||||
import { Heading, Text } from '@moex-vibe/design-system';
|
||||
import { useBrokerPositions } from '@/entities/broker-position';
|
||||
import { useBrokerAccountContext } from '@/widgets/broker-account-layout';
|
||||
import { BrokerPositionTable } from '@/widgets/broker-positions-table';
|
||||
@ -17,14 +15,14 @@ export function BrokerPositionsPage({ type, title }: BrokerPositionsPageProps) {
|
||||
|
||||
if (positions.error) {
|
||||
return (
|
||||
<Box component="section" aria-labelledby={`broker-${type}-heading`}>
|
||||
<Heading level={2} id={`broker-${type}-heading`}>
|
||||
<section aria-labelledby={`broker-${type}-heading`}>
|
||||
<h2 id={`broker-${type}-heading`} style={{ fontSize: 20, margin: 0 }}>
|
||||
{title}
|
||||
</Heading>
|
||||
<Text component="p" tone="negative" role="alert">
|
||||
</h2>
|
||||
<p role="alert">
|
||||
{type === 'share' ? 'Не удалось загрузить акции' : 'Не удалось загрузить облигации'}
|
||||
</Text>
|
||||
</Box>
|
||||
</p>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
20
apps/frontend/src/shared/ui/SkeletonBlock.tsx
Normal file
20
apps/frontend/src/shared/ui/SkeletonBlock.tsx
Normal file
@ -0,0 +1,20 @@
|
||||
export function SkeletonBlock({
|
||||
width,
|
||||
height,
|
||||
borderRadius = 4,
|
||||
}: {
|
||||
width?: string | number;
|
||||
height?: string | number;
|
||||
borderRadius?: number;
|
||||
}) {
|
||||
return (
|
||||
<div
|
||||
className="skeleton"
|
||||
style={{
|
||||
width: width ?? '100%',
|
||||
height: height ?? 16,
|
||||
borderRadius,
|
||||
}}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
import { Skeleton } from '@moex-vibe/design-system';
|
||||
import { SkeletonBlock } from '@/shared/ui/SkeletonBlock';
|
||||
|
||||
const tdStyle = {
|
||||
borderBottom: '1px solid #eeeeee',
|
||||
@ -15,7 +15,7 @@ export function TableSkeleton({ rows = 5, columns }: { rows?: number; columns: C
|
||||
<tr key={i}>
|
||||
{columns.map((col, j) => (
|
||||
<td key={j} style={tdStyle}>
|
||||
<Skeleton height={12} width={col.width} shape="text" />
|
||||
<SkeletonBlock height={12} width={col.width} />
|
||||
</td>
|
||||
))}
|
||||
</tr>
|
||||
|
||||
@ -1 +1,2 @@
|
||||
export { SkeletonBlock } from './SkeletonBlock';
|
||||
export { TableSkeleton } from './TableSkeleton';
|
||||
|
||||
@ -16,6 +16,12 @@
|
||||
--color-negative: #c62828;
|
||||
--border-radius: 8px;
|
||||
--shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
|
||||
--broker-overview-bg: linear-gradient(180deg, #f1f5ef 0%, #f7f2e8 100%);
|
||||
--broker-overview-panel: rgba(15, 51, 36, 0.93);
|
||||
--broker-overview-panel-soft: rgba(255, 255, 255, 0.09);
|
||||
--broker-overview-border: rgba(21, 61, 43, 0.12);
|
||||
--broker-overview-accent: #98c484;
|
||||
--broker-overview-gold: #d7b268;
|
||||
}
|
||||
|
||||
.pnl-cell {
|
||||
@ -88,6 +94,47 @@ a {
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.broker-allocation ul {
|
||||
list-style: none;
|
||||
display: grid;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.broker-allocation {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 20px;
|
||||
}
|
||||
|
||||
.broker-allocation svg {
|
||||
width: 160px;
|
||||
max-width: 40%;
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
|
||||
.broker-allocation figcaption {
|
||||
display: grid;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.broker-allocation li {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.broker-allocation__swatch {
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
border: 1px solid color-mix(in srgb, var(--color-text) 20%, transparent);
|
||||
border-radius: 2px;
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
|
||||
.broker-allocation__negative {
|
||||
color: var(--color-negative);
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.loading-spinner,
|
||||
.skeleton {
|
||||
@ -96,4 +143,42 @@ a {
|
||||
}
|
||||
}
|
||||
|
||||
.broker-operations__toolbar {
|
||||
display: flex;
|
||||
align-items: end;
|
||||
justify-content: space-between;
|
||||
gap: 16px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.broker-operations__toolbar label {
|
||||
display: grid;
|
||||
gap: 6px;
|
||||
color: var(--color-text-secondary);
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.broker-operations__toolbar select {
|
||||
min-width: 240px;
|
||||
padding: 8px 10px;
|
||||
border: 1px solid #d8d8d8;
|
||||
border-radius: var(--border-radius);
|
||||
background: var(--color-surface);
|
||||
color: var(--color-text);
|
||||
}
|
||||
|
||||
.broker-operations__toolbar select:focus-visible {
|
||||
outline: 3px solid color-mix(in srgb, var(--color-primary) 35%, transparent);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
@media (max-width: 720px) {
|
||||
.broker-operations__toolbar {
|
||||
align-items: stretch;
|
||||
flex-direction: column;
|
||||
}
|
||||
.broker-operations__toolbar select {
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,4 @@
|
||||
import type { BrokerPortfolio } from '@/shared/api/responses';
|
||||
import { Box } from '@mui/material';
|
||||
import { Text } from '@moex-vibe/design-system';
|
||||
import { buildBrokerAllocation } from '@/entities/broker-position';
|
||||
import { formatBrokerCurrencyValue } from '@/shared/lib/formatters';
|
||||
|
||||
@ -28,7 +26,7 @@ export function BrokerAllocationChart({ portfolio }: { portfolio: BrokerPortfoli
|
||||
});
|
||||
|
||||
return (
|
||||
<Box component="figure" sx={{ display: 'flex', alignItems: 'center', gap: 3 }}>
|
||||
<figure className="broker-allocation">
|
||||
<svg role="img" aria-label="Структура брокерского портфеля" viewBox="0 0 120 120">
|
||||
<title>Структура брокерского портфеля</title>
|
||||
{arcs.map((sector) => (
|
||||
@ -46,50 +44,40 @@ export function BrokerAllocationChart({ portfolio }: { portfolio: BrokerPortfoli
|
||||
/>
|
||||
))}
|
||||
</svg>
|
||||
<Box component="figcaption" sx={{ display: 'grid', gap: 1.5 }}>
|
||||
<figcaption>
|
||||
{sectors.length === 0 ? (
|
||||
<Text tone="muted">Нет данных для распределения</Text>
|
||||
<p>Нет данных для распределения</p>
|
||||
) : (
|
||||
<Box component="ul" sx={{ listStyle: 'none', display: 'grid', gap: 1 }}>
|
||||
<ul>
|
||||
{sectors.map((sector) => (
|
||||
<Box
|
||||
component="li"
|
||||
key={sector.key}
|
||||
sx={{ display: 'flex', alignItems: 'center', gap: 1 }}
|
||||
>
|
||||
<Box
|
||||
sx={{
|
||||
width: 2,
|
||||
height: 2,
|
||||
borderRadius: 0.25,
|
||||
background: sector.color,
|
||||
flexShrink: 0,
|
||||
}}
|
||||
<li key={sector.key}>
|
||||
<span
|
||||
className="broker-allocation__swatch"
|
||||
aria-hidden="true"
|
||||
style={{ background: sector.color }}
|
||||
/>
|
||||
<Box component="span">
|
||||
<span>
|
||||
{sector.label}: {formatBrokerCurrencyValue(currency, sector.value)} ·{' '}
|
||||
{sector.percent.toFixed(1)}%
|
||||
</Box>
|
||||
</Box>
|
||||
</span>
|
||||
</li>
|
||||
))}
|
||||
</Box>
|
||||
</ul>
|
||||
)}
|
||||
{negative.length > 0 && (
|
||||
<Box
|
||||
component="ul"
|
||||
<ul
|
||||
className="broker-allocation__negative"
|
||||
aria-label="Отрицательные значения распределения"
|
||||
sx={{ listStyle: 'none', display: 'grid', gap: 1 }}
|
||||
>
|
||||
{negative.map((item) => (
|
||||
<Box component="li" key={item.key}>
|
||||
<li key={item.key}>
|
||||
{item.label}: отрицательное значение{' '}
|
||||
{formatBrokerCurrencyValue(currency, item.value)}
|
||||
</Box>
|
||||
</li>
|
||||
))}
|
||||
</Box>
|
||||
</ul>
|
||||
)}
|
||||
</Box>
|
||||
</Box>
|
||||
</figcaption>
|
||||
</figure>
|
||||
);
|
||||
}
|
||||
|
||||
@ -1,8 +1,6 @@
|
||||
import { Link } from 'react-router-dom';
|
||||
import type { ReactNode } from 'react';
|
||||
import type { BrokerOperation, BrokerOperationsPage } from '@/shared/api/responses';
|
||||
import { Box } from '@mui/material';
|
||||
import { Button, Heading, Skeleton, Text } from '@moex-vibe/design-system';
|
||||
import { TableSkeleton } from '@/shared/ui/TableSkeleton';
|
||||
import {
|
||||
getBrokerOperationImpact,
|
||||
@ -12,33 +10,42 @@ import {
|
||||
import { getBrokerInstrumentPath } from '@/entities/broker-position';
|
||||
import { formatBrokerSignedMoney } from '@/shared/lib/formatters';
|
||||
|
||||
const tableSx = {
|
||||
const tableStyle = {
|
||||
width: '100%',
|
||||
borderCollapse: 'collapse',
|
||||
fontSize: 14,
|
||||
} as const;
|
||||
} satisfies React.CSSProperties;
|
||||
|
||||
const thSx = {
|
||||
borderBottom: '1px solid',
|
||||
borderColor: 'divider',
|
||||
color: 'text.secondary',
|
||||
const thStyle = {
|
||||
borderBottom: '1px solid #e0e0e0',
|
||||
color: 'var(--color-text-secondary)',
|
||||
fontWeight: 600,
|
||||
p: 1,
|
||||
textAlign: 'left',
|
||||
} as const;
|
||||
padding: '10px 8px',
|
||||
} satisfies React.CSSProperties;
|
||||
|
||||
const tdSx = {
|
||||
borderBottom: '1px solid',
|
||||
borderColor: 'divider',
|
||||
p: 1,
|
||||
const tdStyle = {
|
||||
borderBottom: '1px solid #eeeeee',
|
||||
padding: '10px 8px',
|
||||
verticalAlign: 'top',
|
||||
textAlign: 'left',
|
||||
} as const;
|
||||
} satisfies React.CSSProperties;
|
||||
|
||||
const tdSxRight = {
|
||||
...tdSx,
|
||||
textAlign: 'right',
|
||||
} as const;
|
||||
const pagButtonStyle = {
|
||||
padding: '6px 14px',
|
||||
borderRadius: 6,
|
||||
border: '1px solid #e0e0e0',
|
||||
background: 'var(--color-surface)',
|
||||
color: 'var(--color-text)',
|
||||
fontSize: 14,
|
||||
fontWeight: 600,
|
||||
cursor: 'pointer',
|
||||
lineHeight: 1.4,
|
||||
} satisfies React.CSSProperties;
|
||||
|
||||
const pagButtonDisabledStyle = {
|
||||
...pagButtonStyle,
|
||||
opacity: 0.35,
|
||||
cursor: 'not-allowed',
|
||||
} satisfies React.CSSProperties;
|
||||
|
||||
function formatDate(value: string | null) {
|
||||
if (!value) return '-';
|
||||
@ -46,10 +53,11 @@ function formatDate(value: string | null) {
|
||||
return new Date(value).toLocaleString('ru-RU');
|
||||
}
|
||||
|
||||
function operationTone(impact: BrokerOperationImpact) {
|
||||
if (impact === 'adds') return 'positive' as const;
|
||||
if (impact === 'reduces') return 'negative' as const;
|
||||
return 'primary' as const;
|
||||
function moneyColor(impact: BrokerOperationImpact): string {
|
||||
if (impact === 'adds') return 'var(--color-positive)';
|
||||
if (impact === 'reduces') return 'var(--color-negative)';
|
||||
|
||||
return 'var(--color-text)';
|
||||
}
|
||||
|
||||
function OperationInstrument({ operation }: { operation: BrokerOperation }) {
|
||||
@ -61,23 +69,19 @@ function OperationInstrument({ operation }: { operation: BrokerOperation }) {
|
||||
});
|
||||
const name = operation.name || operation.description;
|
||||
|
||||
if (!path && !name) return <Text>-</Text>;
|
||||
if (!path) return <Text>{name}</Text>;
|
||||
if (!path && !name) return <span>-</span>;
|
||||
if (!path) return <span>{name}</span>;
|
||||
if (!ticker || ticker === '-') return <Link to={path}>{name}</Link>;
|
||||
|
||||
return (
|
||||
<Box sx={{ display: 'grid', gap: 0.5 }}>
|
||||
<Link to={path}>
|
||||
<Box component="span" sx={{ fontWeight: 700 }}>
|
||||
<div style={{ display: 'grid', gap: 2 }}>
|
||||
<Link to={path} style={{ fontWeight: 700 }}>
|
||||
{ticker}
|
||||
</Box>
|
||||
</Link>
|
||||
{name && name !== ticker && (
|
||||
<Text variant="caption" tone="secondary">
|
||||
{name}
|
||||
</Text>
|
||||
<span style={{ color: 'var(--color-text-secondary)', fontSize: 12 }}>{name}</span>
|
||||
)}
|
||||
</Box>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@ -99,156 +103,146 @@ export function BrokerOperationsTable({
|
||||
|
||||
return (
|
||||
<section aria-busy={isFetching}>
|
||||
<Box
|
||||
sx={{
|
||||
<div
|
||||
style={{
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
gap: 1.5,
|
||||
gap: 12,
|
||||
justifyContent: 'space-between',
|
||||
mb: 1.5,
|
||||
marginBottom: 12,
|
||||
}}
|
||||
>
|
||||
<Heading level={2}>{title}</Heading>
|
||||
<h2 style={{ fontSize: 20, margin: 0 }}>{title}</h2>
|
||||
{headerAction}
|
||||
{pagination && (
|
||||
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1 }}>
|
||||
<Button
|
||||
variant="secondary"
|
||||
size="small"
|
||||
<div style={{ display: 'flex', alignItems: 'center', gap: 8 }}>
|
||||
<button
|
||||
type="button"
|
||||
aria-label="Предыдущая страница"
|
||||
onClick={onPrevious}
|
||||
disabled={!canGoBack || isFetching}
|
||||
style={canGoBack && !isFetching ? pagButtonStyle : pagButtonDisabledStyle}
|
||||
>
|
||||
{isFetching ? <Skeleton shape="circular" width={14} height={14} /> : '←'}
|
||||
</Button>
|
||||
<Box
|
||||
sx={{
|
||||
{isFetching ? (
|
||||
<span
|
||||
className="loading-spinner"
|
||||
style={{ width: 14, height: 14, display: 'block' }}
|
||||
/>
|
||||
) : (
|
||||
'←'
|
||||
)}
|
||||
</button>
|
||||
<span
|
||||
style={{
|
||||
minWidth: 20,
|
||||
textAlign: 'center',
|
||||
color: 'text.secondary',
|
||||
color: 'var(--color-text-secondary)',
|
||||
fontSize: 14,
|
||||
fontWeight: 600,
|
||||
}}
|
||||
>
|
||||
{pageNumber}
|
||||
</Box>
|
||||
<Button
|
||||
variant="secondary"
|
||||
size="small"
|
||||
</span>
|
||||
<button
|
||||
type="button"
|
||||
aria-label="Следующая страница"
|
||||
onClick={onNext}
|
||||
disabled={!canGoForward || isFetching}
|
||||
style={canGoForward && !isFetching ? pagButtonStyle : pagButtonDisabledStyle}
|
||||
>
|
||||
{isFetching ? <Skeleton shape="circular" width={14} height={14} /> : '→'}
|
||||
</Button>
|
||||
</Box>
|
||||
{isFetching ? (
|
||||
<span
|
||||
className="loading-spinner"
|
||||
style={{ width: 14, height: 14, display: 'block' }}
|
||||
/>
|
||||
) : (
|
||||
'→'
|
||||
)}
|
||||
</Box>
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{isLoading ? (
|
||||
<Box sx={{ overflowX: 'auto', bgcolor: 'surface.default' }}>
|
||||
<Box component="table" sx={tableSx}>
|
||||
<Box component="thead">
|
||||
<Box component="tr">
|
||||
<Box component="th" sx={thSx}>
|
||||
<div style={{ overflowX: 'auto', background: 'var(--color-surface)' }}>
|
||||
<table style={tableStyle}>
|
||||
<thead>
|
||||
<tr>
|
||||
<th align="left" style={thStyle}>
|
||||
Дата
|
||||
</Box>
|
||||
<Box component="th" sx={thSx}>
|
||||
</th>
|
||||
<th align="left" style={thStyle}>
|
||||
Тип
|
||||
</Box>
|
||||
<Box component="th" sx={thSx}>
|
||||
</th>
|
||||
<th align="left" style={thStyle}>
|
||||
Инструмент
|
||||
</Box>
|
||||
<Box component="th" sx={{ ...thSx, textAlign: 'right' }}>
|
||||
</th>
|
||||
<th align="right" style={thStyle}>
|
||||
Сумма
|
||||
</Box>
|
||||
</Box>
|
||||
</Box>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<TableSkeleton
|
||||
rows={5}
|
||||
columns={[{ width: '35%' }, { width: '30%' }, { width: '40%' }, { width: '25%' }]}
|
||||
/>
|
||||
</Box>
|
||||
</Box>
|
||||
</table>
|
||||
</div>
|
||||
) : operations.length === 0 && !isFetching ? (
|
||||
<Text component="p" tone="muted">
|
||||
{emptyMessage}
|
||||
</Text>
|
||||
<p style={{ color: 'var(--color-text-secondary)' }}>{emptyMessage}</p>
|
||||
) : (
|
||||
<Box sx={{ position: 'relative' }}>
|
||||
<Box sx={{ overflowX: 'auto', bgcolor: 'surface.default' }}>
|
||||
<Box component="table" sx={tableSx}>
|
||||
<Box component="thead">
|
||||
<Box component="tr">
|
||||
<Box component="th" sx={thSx}>
|
||||
<div className="table-container">
|
||||
<div style={{ overflowX: 'auto', background: 'var(--color-surface)' }}>
|
||||
<table style={tableStyle}>
|
||||
<thead>
|
||||
<tr>
|
||||
<th align="left" style={thStyle}>
|
||||
Дата
|
||||
</Box>
|
||||
<Box component="th" sx={thSx}>
|
||||
</th>
|
||||
<th align="left" style={thStyle}>
|
||||
Тип
|
||||
</Box>
|
||||
<Box component="th" sx={thSx}>
|
||||
</th>
|
||||
<th align="left" style={thStyle}>
|
||||
Инструмент
|
||||
</Box>
|
||||
<Box component="th" sx={{ ...thSx, textAlign: 'right' }}>
|
||||
</th>
|
||||
<th align="right" style={thStyle}>
|
||||
Сумма
|
||||
</Box>
|
||||
</Box>
|
||||
</Box>
|
||||
<Box component="tbody">
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{operations.map((operation) => {
|
||||
const impact = getBrokerOperationImpact(operation);
|
||||
return (
|
||||
<Box component="tr" key={operation.cursor || operation.id}>
|
||||
<Box component="td" sx={tdSx}>
|
||||
{formatDate(operation.date)}
|
||||
</Box>
|
||||
<Box component="td" sx={tdSx}>
|
||||
<Text>{getBrokerOperationTypeLabel(operation)}</Text>
|
||||
</Box>
|
||||
<Box component="td" sx={tdSx}>
|
||||
<tr key={operation.cursor || operation.id}>
|
||||
<td style={tdStyle}>{formatDate(operation.date)}</td>
|
||||
<td style={tdStyle}>
|
||||
<span>{getBrokerOperationTypeLabel(operation)}</span>
|
||||
</td>
|
||||
<td style={tdStyle}>
|
||||
<OperationInstrument operation={operation} />
|
||||
</Box>
|
||||
<Box
|
||||
component="td"
|
||||
sx={{
|
||||
...tdSxRight,
|
||||
color:
|
||||
operationTone(impact) === 'positive'
|
||||
? 'success.main'
|
||||
: operationTone(impact) === 'negative'
|
||||
? 'error.main'
|
||||
: 'text.primary',
|
||||
fontWeight: 700,
|
||||
}}
|
||||
</td>
|
||||
<td
|
||||
align="right"
|
||||
style={{ ...tdStyle, color: moneyColor(impact), fontWeight: 700 }}
|
||||
>
|
||||
{formatBrokerSignedMoney(operation.payment)}
|
||||
</Box>
|
||||
</Box>
|
||||
</td>
|
||||
</tr>
|
||||
);
|
||||
})}
|
||||
</Box>
|
||||
</Box>
|
||||
</Box>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{isFetching && (
|
||||
<Box
|
||||
sx={{
|
||||
position: 'absolute',
|
||||
inset: 0,
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
gap: 1,
|
||||
bgcolor: 'rgba(255,255,255,0.7)',
|
||||
}}
|
||||
>
|
||||
<Box className="loading-spinner" />
|
||||
<Text variant="caption" tone="secondary">
|
||||
<div className="table-loading-overlay" role="status">
|
||||
<div className="loading-spinner" aria-hidden="true" />
|
||||
<span style={{ fontSize: 13, color: 'var(--color-text-secondary)' }}>
|
||||
{pagination ? `Загрузка страницы ${pageNumber}…` : 'Обновление операций…'}
|
||||
</Text>
|
||||
</Box>
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
</Box>
|
||||
</div>
|
||||
)}
|
||||
</section>
|
||||
);
|
||||
|
||||
@ -1,36 +1,44 @@
|
||||
import type { BrokerPositionsPage as BrokerPositionsPageData } from '@/shared/api/responses';
|
||||
import { Box } from '@mui/material';
|
||||
import { Button, Heading, Skeleton, Text } from '@moex-vibe/design-system';
|
||||
import { TableSkeleton } from '@/shared/ui/TableSkeleton';
|
||||
import { formatBrokerMoney as formatMoney } from '@/shared/lib/formatters';
|
||||
import { PositionTicker } from './PositionTicker';
|
||||
|
||||
const tableSx = {
|
||||
const tableStyle = {
|
||||
width: '100%',
|
||||
borderCollapse: 'collapse',
|
||||
fontSize: 14,
|
||||
} as const;
|
||||
} satisfies React.CSSProperties;
|
||||
|
||||
const thSx = {
|
||||
borderBottom: '1px solid',
|
||||
borderColor: 'divider',
|
||||
color: 'text.secondary',
|
||||
const thStyle = {
|
||||
borderBottom: '1px solid #e0e0e0',
|
||||
color: 'var(--color-text-secondary)',
|
||||
fontWeight: 600,
|
||||
p: 1,
|
||||
textAlign: 'left',
|
||||
} as const;
|
||||
padding: '10px 8px',
|
||||
} satisfies React.CSSProperties;
|
||||
|
||||
const tdSx = {
|
||||
borderBottom: '1px solid',
|
||||
borderColor: 'divider',
|
||||
p: 1,
|
||||
const tdStyle = {
|
||||
borderBottom: '1px solid #eeeeee',
|
||||
padding: '10px 8px',
|
||||
verticalAlign: 'top',
|
||||
textAlign: 'right',
|
||||
} as const;
|
||||
} satisfies React.CSSProperties;
|
||||
|
||||
const tdSxLeft = {
|
||||
...tdSx,
|
||||
textAlign: 'left',
|
||||
} as const;
|
||||
const pagButtonStyle = {
|
||||
padding: '6px 14px',
|
||||
borderRadius: 6,
|
||||
border: '1px solid #e0e0e0',
|
||||
background: 'var(--color-surface)',
|
||||
color: 'var(--color-text)',
|
||||
fontSize: 14,
|
||||
fontWeight: 600,
|
||||
cursor: 'pointer',
|
||||
lineHeight: 1.4,
|
||||
} satisfies React.CSSProperties;
|
||||
|
||||
const pagButtonDisabledStyle = {
|
||||
...pagButtonStyle,
|
||||
opacity: 0.35,
|
||||
cursor: 'not-allowed',
|
||||
} satisfies React.CSSProperties;
|
||||
|
||||
function formatQuantity(value: number | null | undefined) {
|
||||
return value == null ? '-' : value.toLocaleString('ru-RU');
|
||||
@ -61,127 +69,127 @@ export function BrokerPositionTable({
|
||||
|
||||
return (
|
||||
<section aria-labelledby={`broker-${title.toLowerCase()}-heading`}>
|
||||
<Box
|
||||
sx={{
|
||||
<div
|
||||
style={{
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
gap: 1.5,
|
||||
gap: 12,
|
||||
justifyContent: 'space-between',
|
||||
mb: 1.5,
|
||||
marginBottom: 10,
|
||||
}}
|
||||
>
|
||||
<Heading level={2} id={`broker-${title.toLowerCase()}-heading`}>
|
||||
<h2 id={`broker-${title.toLowerCase()}-heading`} style={{ fontSize: 20, margin: 0 }}>
|
||||
{title}
|
||||
</Heading>
|
||||
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1 }}>
|
||||
<Button
|
||||
variant="secondary"
|
||||
size="small"
|
||||
</h2>
|
||||
<div style={{ display: 'flex', alignItems: 'center', gap: 8 }}>
|
||||
<button
|
||||
type="button"
|
||||
aria-label="Предыдущая страница"
|
||||
onClick={onPrevious}
|
||||
disabled={!canGoBack || isFetching}
|
||||
style={canGoBack && !isFetching ? pagButtonStyle : pagButtonDisabledStyle}
|
||||
>
|
||||
{isFetching ? <Skeleton shape="circular" width={14} height={14} /> : '←'}
|
||||
</Button>
|
||||
<Box
|
||||
sx={{
|
||||
{isFetching ? (
|
||||
<span
|
||||
className="loading-spinner"
|
||||
style={{ width: 14, height: 14, display: 'block' }}
|
||||
/>
|
||||
) : (
|
||||
'←'
|
||||
)}
|
||||
</button>
|
||||
<span
|
||||
style={{
|
||||
minWidth: 20,
|
||||
textAlign: 'center',
|
||||
color: 'text.secondary',
|
||||
color: 'var(--color-text-secondary)',
|
||||
fontSize: 14,
|
||||
fontWeight: 600,
|
||||
}}
|
||||
>
|
||||
{pageNumber}
|
||||
</Box>
|
||||
<Button
|
||||
variant="secondary"
|
||||
size="small"
|
||||
</span>
|
||||
<button
|
||||
type="button"
|
||||
aria-label="Следующая страница"
|
||||
onClick={onNext}
|
||||
disabled={!canGoForward || isFetching}
|
||||
style={canGoForward && !isFetching ? pagButtonStyle : pagButtonDisabledStyle}
|
||||
>
|
||||
{isFetching ? <Skeleton shape="circular" width={14} height={14} /> : '→'}
|
||||
</Button>
|
||||
</Box>
|
||||
</Box>
|
||||
{isFetching ? (
|
||||
<span
|
||||
className="loading-spinner"
|
||||
style={{ width: 14, height: 14, display: 'block' }}
|
||||
/>
|
||||
) : (
|
||||
'→'
|
||||
)}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{isLoading ? (
|
||||
<Box sx={{ overflowX: 'auto', bgcolor: 'surface.default' }}>
|
||||
<Box component="table" sx={tableSx}>
|
||||
<Box component="thead">
|
||||
<Box component="tr">
|
||||
<Box component="th" sx={thSx} align="left">
|
||||
<div style={{ overflowX: 'auto', background: 'var(--color-surface)' }}>
|
||||
<table style={tableStyle}>
|
||||
<thead>
|
||||
<tr>
|
||||
<th align="left" style={thStyle}>
|
||||
Тикер
|
||||
</Box>
|
||||
<Box component="th" sx={thSx} align="left">
|
||||
</th>
|
||||
<th align="left" style={thStyle}>
|
||||
Название
|
||||
</Box>
|
||||
<Box component="th" sx={thSx} align="right">
|
||||
</th>
|
||||
<th align="right" style={thStyle}>
|
||||
Количество
|
||||
</Box>
|
||||
<Box component="th" sx={thSx} align="right">
|
||||
</th>
|
||||
<th align="right" style={thStyle}>
|
||||
Цена
|
||||
</Box>
|
||||
<Box component="th" sx={thSx} align="right">
|
||||
</th>
|
||||
<th align="right" style={thStyle}>
|
||||
Стоимость
|
||||
</Box>
|
||||
</Box>
|
||||
</Box>
|
||||
<Box component="tbody">
|
||||
{[1, 2, 3, 4].map((row) => (
|
||||
<Box component="tr" key={row}>
|
||||
<Box component="td" sx={tdSxLeft}>
|
||||
<Skeleton height={12} width="30%" shape="text" />
|
||||
</Box>
|
||||
<Box component="td" sx={tdSxLeft}>
|
||||
<Skeleton height={12} width="50%" shape="text" />
|
||||
</Box>
|
||||
<Box component="td" sx={tdSx}>
|
||||
<Skeleton height={12} width="20%" shape="text" />
|
||||
</Box>
|
||||
<Box component="td" sx={tdSx}>
|
||||
<Skeleton height={12} width="25%" shape="text" />
|
||||
</Box>
|
||||
<Box component="td" sx={tdSx}>
|
||||
<Skeleton height={12} width="25%" shape="text" />
|
||||
</Box>
|
||||
</Box>
|
||||
))}
|
||||
</Box>
|
||||
</Box>
|
||||
</Box>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<TableSkeleton
|
||||
rows={4}
|
||||
columns={[
|
||||
{ width: '30%' },
|
||||
{ width: '50%' },
|
||||
{ width: '20%' },
|
||||
{ width: '25%' },
|
||||
{ width: '25%' },
|
||||
]}
|
||||
/>
|
||||
</table>
|
||||
</div>
|
||||
) : positions.length === 0 && !isFetching ? (
|
||||
<Text component="p" tone="secondary">
|
||||
{emptyMessage}
|
||||
</Text>
|
||||
<p style={{ color: 'var(--color-text-secondary)' }}>{emptyMessage}</p>
|
||||
) : (
|
||||
<Box sx={{ position: 'relative' }}>
|
||||
<Box sx={{ overflowX: 'auto', bgcolor: 'surface.default' }}>
|
||||
<Box component="table" sx={tableSx} aria-label={`Брокерские позиции: ${title}`}>
|
||||
<Box component="thead">
|
||||
<Box component="tr">
|
||||
<Box component="th" sx={thSx} align="left">
|
||||
<div className="table-container">
|
||||
<div style={{ overflowX: 'auto', background: 'var(--color-surface)' }}>
|
||||
<table aria-label={`Брокерские позиции: ${title}`} style={tableStyle}>
|
||||
<thead>
|
||||
<tr>
|
||||
<th align="left" style={thStyle}>
|
||||
Тикер
|
||||
</Box>
|
||||
<Box component="th" sx={thSx} align="left">
|
||||
</th>
|
||||
<th align="left" style={thStyle}>
|
||||
Название
|
||||
</Box>
|
||||
<Box component="th" sx={thSx} align="right">
|
||||
</th>
|
||||
<th align="right" style={thStyle}>
|
||||
Количество
|
||||
</Box>
|
||||
<Box component="th" sx={thSx} align="right">
|
||||
</th>
|
||||
<th align="right" style={thStyle}>
|
||||
Цена
|
||||
</Box>
|
||||
<Box component="th" sx={thSx} align="right">
|
||||
</th>
|
||||
<th align="right" style={thStyle}>
|
||||
Стоимость
|
||||
</Box>
|
||||
</Box>
|
||||
</Box>
|
||||
<Box component="tbody">
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{positions.map((position) => (
|
||||
<Box
|
||||
component="tr"
|
||||
<tr
|
||||
key={
|
||||
position.positionUid ||
|
||||
position.instrumentUid ||
|
||||
@ -189,45 +197,37 @@ export function BrokerPositionTable({
|
||||
position.figi
|
||||
}
|
||||
>
|
||||
<Box component="td" sx={tdSxLeft}>
|
||||
<td style={tdStyle}>
|
||||
<PositionTicker position={position} />
|
||||
</Box>
|
||||
<Box component="td" sx={tdSxLeft}>
|
||||
<Text tone="secondary">{position.name || '-'}</Text>
|
||||
</Box>
|
||||
<Box component="td" sx={tdSx}>
|
||||
</td>
|
||||
<td style={tdStyle}>
|
||||
<span style={{ color: 'var(--color-text-secondary)' }}>
|
||||
{position.name || '-'}
|
||||
</span>
|
||||
</td>
|
||||
<td align="right" style={tdStyle}>
|
||||
{formatQuantity(position.quantity)}
|
||||
</Box>
|
||||
<Box component="td" sx={tdSx}>
|
||||
</td>
|
||||
<td align="right" style={tdStyle}>
|
||||
{formatMoney(position.currentPrice)}
|
||||
</Box>
|
||||
<Box component="td" sx={tdSx}>
|
||||
</td>
|
||||
<td align="right" style={tdStyle}>
|
||||
{formatMoney(position.currentValue)}
|
||||
</Box>
|
||||
</Box>
|
||||
</td>
|
||||
</tr>
|
||||
))}
|
||||
</Box>
|
||||
</Box>
|
||||
</Box>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{isFetching && (
|
||||
<Box
|
||||
sx={{
|
||||
position: 'absolute',
|
||||
inset: 0,
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
gap: 1,
|
||||
bgcolor: 'rgba(255,255,255,0.7)',
|
||||
}}
|
||||
>
|
||||
<Box className="loading-spinner" />
|
||||
<Text variant="caption" tone="secondary">
|
||||
<div className="table-loading-overlay">
|
||||
<div className="loading-spinner" />
|
||||
<span style={{ fontSize: 13, color: 'var(--color-text-secondary)' }}>
|
||||
Загрузка страницы {pageNumber}…
|
||||
</Text>
|
||||
</Box>
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
</Box>
|
||||
</div>
|
||||
)}
|
||||
</section>
|
||||
);
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
import { Link } from 'react-router-dom';
|
||||
import { Box } from '@mui/material';
|
||||
import type { BrokerPosition } from '@/shared/api/responses';
|
||||
import { getBrokerInstrumentPath } from '@/entities/broker-position';
|
||||
|
||||
@ -12,18 +11,12 @@ export function PositionTicker({ position }: { position: BrokerPosition }) {
|
||||
});
|
||||
|
||||
if (!path || label === '-') {
|
||||
return (
|
||||
<Box component="span" sx={{ fontWeight: 700 }}>
|
||||
{label}
|
||||
</Box>
|
||||
);
|
||||
return <strong>{label}</strong>;
|
||||
}
|
||||
|
||||
return (
|
||||
<Link to={path}>
|
||||
<Box component="span" sx={{ fontWeight: 700 }}>
|
||||
<Link to={path} style={{ fontWeight: 700 }}>
|
||||
{label}
|
||||
</Box>
|
||||
</Link>
|
||||
);
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
# Дизайн-системный рефакторинг страниц брокерского счёта
|
||||
|
||||
Дата: 2026-06-21
|
||||
Статус: реализовано
|
||||
Статус: Draft
|
||||
|
||||
## Контекст
|
||||
|
||||
@ -55,31 +55,15 @@ Epic `Брокерский портфель` уже покрыт функцио
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
- [x] `BrokerAccountLayout` не содержит CSS-классов из `styles.css`; используется `<Heading>`, `<Text>`, `<Box>`.
|
||||
- [x] `BrokerAccountOverviewPage` и содержащиеся в нём `BrokerSummary`, `BrokerAssetCards` переведены на DS-компоненты.
|
||||
- [x] `BrokerOverviewSkeleton` использует DS `<Skeleton>`.
|
||||
- [x] `BrokerAllocationChart` обёртки (`<figure>`, `<figcaption>`) переведены на `<Box>`; текст легенды — на `<Text>`.
|
||||
- [x] `BrokerPositionTable` и `BrokerOperationsTable` используют `<Box>` для layout, `<Heading>` для заголовков, `<Button>` или `<Box>` для пагинации, пустые и loading-состояния — через DS.
|
||||
- [x] `TableSkeleton` переведён на DS `<Skeleton>`.
|
||||
- [x] `SkeletonBlock` удалён после замены всех потребителей.
|
||||
- [x] `BrokerPositionsPage` и `BrokerOperationsPage` переведены на `<Box>`, `<Heading>`, `<Text>`.
|
||||
- [x] `PositionTicker` — `<Link>` с `<Box component="span" sx={{ fontWeight: 700 }}>`.
|
||||
- [x] ESLint allowlist не нарушен (`no-restricted-imports` разрешает `Box`, `Stack`, `Grid` из `@mui/material` barrel).
|
||||
- [x] `npm run test:frontend && npm run lint -w apps/frontend && npm run build:frontend` проходят.
|
||||
- [x] CSS-классы, оставшиеся без потребителей, удалены из `styles.css` (но сохраняются градиенты hero-секций).
|
||||
|
||||
## Результаты реализации
|
||||
|
||||
Все 12 задач плана выполнены и закоммичены в ветку `codex/broker-accounts-page` (13 коммитов). Ключевые изменения:
|
||||
|
||||
- **Полностью мигрированы на DS:** `BrokerAccountLayout`, `BrokerAccountOverviewPage`, `BrokerSummary`, `BrokerAssetCards`, `BrokerOverviewSkeleton`, `BrokerAllocationChart`, `BrokerPositionTable`, `BrokerOperationsTable`, `BrokerPositionsPage`, `BrokerOperationsPage`, `PositionTicker`.
|
||||
- **Удалён legacy:** `SkeletonBlock` удалён из `shared/ui/SkeletonBlock.tsx` и `shared/ui/index.ts`.
|
||||
- **Очистка CSS:** все `broker-account__*`, `broker-overview__*`, `broker-allocation__*`, `broker-operations__toolbar*` классы и переменные удалены из `styles.css`. CSS уменьшился с 274 до 99 строк.
|
||||
- Верификация: 111 тестов PASS, lint чистый, build проходит без ошибок.
|
||||
|
||||
### Отклонения от плана
|
||||
|
||||
- `PositionTicker`: использован `<Box component="span">` вместо DS `<Text>` с `sx`, так как DS `Text` не поддерживает кастомный `sx`.
|
||||
- `TableSkeleton`: сохранён как shared компонент (вместо удаления), так как используется `BrokerOperationsTable`.
|
||||
- `loading-spinner`: оставлен как глобальный CSS-класс (генерируется через `<Box className="loading-spinner">`). DS `Skeleton shape="circular"` использован для inline-спиннеров в пагинации.
|
||||
- `TableSkeleton` type signature остался без изменений (все уже импортируют `Skeleton` из DS, не `SkeletonBlock`).
|
||||
- [ ] `BrokerAccountLayout` не содержит CSS-классов из `styles.css`; используется `<Heading>`, `<Text>`, `<Box>`.
|
||||
- [ ] `BrokerAccountOverviewPage` и содержащиеся в нём `BrokerSummary`, `BrokerAssetCards` переведены на DS-компоненты.
|
||||
- [ ] `BrokerOverviewSkeleton` использует DS `<Skeleton>`.
|
||||
- [ ] `BrokerAllocationChart` обёртки (`<figure>`, `<figcaption>`) переведены на `<Box>`; текст легенды — на `<Text>`.
|
||||
- [ ] `BrokerPositionTable` и `BrokerOperationsTable` используют `<Box>` для layout, `<Heading>` для заголовков, `<Button>` или `<Box>` для пагинации, пустые и loading-состояния — через DS.
|
||||
- [ ] `TableSkeleton` переведён на DS `<Skeleton>`.
|
||||
- [ ] `SkeletonBlock` удалён после замены всех потребителей.
|
||||
- [ ] `BrokerPositionsPage` и `BrokerOperationsPage` переведены на `<Box>`, `<Heading>`, `<Text>`.
|
||||
- [ ] `PositionTicker` — `<Link>` с `<Text>` (или оставляет `fontWeight: 700` если без `sx`).
|
||||
- [ ] ESLint allowlist не нарушен (`no-restricted-imports` разрешает `Box`, `Stack`, `Grid` из `@mui/material` barrel).
|
||||
- [ ] `npm run test:frontend && npm run lint -w apps/frontend && npm run build:frontend` проходят.
|
||||
- [ ] CSS-классы, оставшиеся без потребителей, удалены из `styles.css` (но сохраняются градиенты hero-секций).
|
||||
|
||||
@ -8,94 +8,93 @@
|
||||
|
||||
## Task 1: BrokerAccountLayout
|
||||
|
||||
- [x] Заменить `div.broker-account` на `<Box component="div">`
|
||||
- [x] Перевести `header` + `h1` на `<Box>` + `<Heading level={1}>`
|
||||
- [x] Перевести `nav` на `<Box component="nav">` + `<NavLink>` (Box component={NavLink} с `aria-current="page"`)
|
||||
- [x] Перевести `div.broker-account__workspace` на grid `<Box>`
|
||||
- [x] Перевести `div.broker-account__content` на `<Box>`
|
||||
- [x] Удалить соответствующие CSS-selectors из `styles.css`
|
||||
- [ ] Заменить `div.broker-account` на `<Box component="div">`
|
||||
- [ ] Перевести `header` + `h1` на `<Box>` + `<Heading level={1}>`
|
||||
- [ ] Перевести `nav` на `<Box component="nav">` + `<NavLink>` (оставить className callback)
|
||||
- [ ] Перевести `div.broker-account__workspace` на grid `<Box>`
|
||||
- [ ] Перевести `div.broker-account__content` на `<Box>`
|
||||
- [ ] Удалить соответствующие CSS-selectors из `styles.css`
|
||||
|
||||
## Task 2: BrokerAccountOverviewPage + BrokerSummary + BrokerAssetCards
|
||||
|
||||
- [x] Перевести `BrokerSummary` на `<Box>` + `<Text>`
|
||||
- [x] Перевести eyebrow/label на `<Text variant="label" tone="secondary">`
|
||||
- [x] Перевести `<strong>` значений на `<Box component="span" sx={{ fontWeight: 700 }}>`
|
||||
- [x] Перевести `<ul>` cash на `<Box component="ul">`
|
||||
- [x] Перевести `BrokerAssetCards` на `<Box>` + `<Link>` + `<Text>`
|
||||
- [x] Перевести `BrokerAccountOverviewPage` container на `<Box component="div">`
|
||||
- [x] Перевести `<p role="alert">` на `<Text component="p" tone="negative">`
|
||||
- [x] Оставить hero-gradient без изменений (Out of scope)
|
||||
- [ ] Перевести `BrokerSummary` на `<Box>` + `<Text>`
|
||||
- [ ] Перевести eyebrow/label на `<Text variant="label" tone="secondary">`
|
||||
- [ ] Перевести `<strong>` значений на `<Text sx={{ fontWeight: 700 }}>`
|
||||
- [ ] Перевести `<ul>` cash на `<Box component="ul">`
|
||||
- [ ] Перевести `BrokerAssetCards` на `<Box>` + `<Link>` + `<Text>`
|
||||
- [ ] Перевести `BrokerAccountOverviewPage` container на `<Box component="div">`
|
||||
- [ ] Оставить hero-gradient без изменений (Out of scope)
|
||||
|
||||
## Task 3: BrokerOverviewSkeleton
|
||||
|
||||
- [x] Заменить импорт `SkeletonBlock` на DS `<Skeleton>`
|
||||
- [x] Перевести контейнеры на `<Box>`
|
||||
- [x] Сделать circular skeleton для портфельной карточки
|
||||
- [x] Сделать text skeleton для текстовых placeholder'ей
|
||||
- [ ] Заменить импорт `SkeletonBlock` на DS `<Skeleton>`
|
||||
- [ ] Перевести контейнеры на `<Box>`
|
||||
- [ ] Сделать circular skeleton для портфельной карточки
|
||||
- [ ] Сделать text skeleton для текстовых placeholder'ей
|
||||
|
||||
## Task 4: BrokerAllocationChart (wrap only)
|
||||
|
||||
- [x] Перевести `<figure>` на `<Box component="figure">`
|
||||
- [x] Перевести `<figcaption>` на `<Box component="figcaption">`
|
||||
- [x] Перевести `<p>` пустого состояния на `<Text tone="muted">`
|
||||
- [x] Перевести `<ul>` / `<li>` легенды на `<Box component="ul">` + `<Box component="li">`
|
||||
- [x] Перевести swatch на `<Box>` с inline-цветом в `sx`
|
||||
- [x] Перевести тексты легенды на `<Box component="span">`
|
||||
- [x] Перевести negative-список на `<Box component="ul">`
|
||||
- [x] Удалить CSS для `.broker-allocation*` в `styles.css`
|
||||
- [ ] Перевести `<figure>` на `<Box component="figure">`
|
||||
- [ ] Перевести `<figcaption>` на `<Box component="figcaption">`
|
||||
- [ ] Перевести `<p>` пустого состояния на `<Text tone="muted">`
|
||||
- [ ] Перевести `<ul>` / `<li>` легенды на `<Box component="ul">` + `<Box component="li">`
|
||||
- [ ] Перевести swatch на `<Box>` с inline-цветом в `sx`
|
||||
- [ ] Перевести тексты легенды на `<Text>` / `<Box component="span">`
|
||||
- [ ] Перевести negative-список на `<Box component="ul">`
|
||||
- [ ] Удалить CSS для `.broker-allocation*` (кроме inline SVG) в `styles.css`
|
||||
|
||||
## Task 5: BrokerPositionTable + PositionTicker
|
||||
|
||||
- [x] Перевести вспомогательные стили на `<Box sx={{...}}>`
|
||||
- [x] Перевести `<h2>` на `<Heading level={2}>`
|
||||
- [x] Перевести alert-тексты на `<Text tone="negative">`
|
||||
- [x] Перевести пагинационные `<button>` на `<Button variant="secondary">`
|
||||
- [x] Перевести `loading-overlay` на `<Box>`
|
||||
- [x] Перевести `PositionTicker` ссылки на `<Box component="span" sx={{ fontWeight: 700 }}>`
|
||||
- [x] Сохранить `loading-spinner` (глобальный класс, пока без замены)
|
||||
- [ ] Перевести вспомогательные стили на `<Box sx={{...}}>`
|
||||
- [ ] Перевести `<h2>` на `<Heading level={2}>` с кастомной `sx`
|
||||
- [ ] Перевести alert-тексты на `<Text tone="negative">`
|
||||
- [ ] Перевести пагинационные `<button>` на `<Button variant="secondary">`
|
||||
- [ ] Перевести `loading-overlay` на `<Box>`
|
||||
- [ ] Перевести `PositionTicker` ссылки на `<Link>` + `<Text sx={{ fontWeight: 700 }}>`
|
||||
- [ ] Сохранить `loading-spinner` (глобальный класс, пока без замены)
|
||||
|
||||
## Task 6: TableSkeleton (DS Skeleton)
|
||||
|
||||
- [x] Убрать импорт `SkeletonBlock`
|
||||
- [x] Заменить на `<Skeleton height={12} width={col.width} shape="text" />`
|
||||
- [ ] Убрать импорт `SkeletonBlock`
|
||||
- [ ] Заменить на `<Skeleton height={12} width={col.width} shape="text" />`
|
||||
- [ ] Сделать прогон тестов, убедиться что нет предупреждений
|
||||
|
||||
## Task 7: BrokerOperationsTable
|
||||
|
||||
- [x] Перевести вспомогательные стили на `<Box sx={{...}}>`
|
||||
- [x] Перевести `<h2>` на `<Heading level={2}>`
|
||||
- [x] Перевести `headerAction` container на `<Box>`
|
||||
- [x] Перевести пагинационные `<button>` на `<Button variant="secondary">`
|
||||
- [x] Перевести alert-тексты на `<Text tone="negative">`
|
||||
- [x] Перевести empty-тексты на `<Text tone="muted">`
|
||||
- [x] Перевести `<label>` + `<select>` на `<Box component="label">` + `<select>`
|
||||
- [x] Оставить `loading-spinner` для overlay (глобальный класс)
|
||||
- [ ] Перевести вспомогательные стили на `<Box sx={{...}}>`
|
||||
- [ ] Перевести `<h2>` на `<Heading level={2}>`
|
||||
- [ ] Перевести `headerAction` container на `<Box>`
|
||||
- [ ] Перевести пагинационные `<button>` на `<Button variant="secondary">`
|
||||
- [ ] Перевести alert-тексты на `<Text tone="negative">`
|
||||
- [ ] Перевести empty-тексты на `<Text tone="muted">`
|
||||
- [ ] Перевести `<label>` + `<select>` на `<Box component="label">` + `<select>`
|
||||
- [ ] Оставить `loading-spinner` для overlay (глобальный класс)
|
||||
|
||||
## Task 8: BrokerPositionsPage + BrokerOperationsPage
|
||||
|
||||
- [x] Перевести `BrokerPositionsPage` на `<Box component="section">` + `<Heading>` + `<Text>`
|
||||
- [x] Перевести `BrokerOperationsPage` на `<Box>` + `<Heading>` + `<Box component="label">` + `<select>`
|
||||
- [x] Убедиться, что `role="alert"` сохраняется через `<Text tone="negative">`
|
||||
- [ ] Перевести `BrokerPositionsPage` на `<Box component="section">` + `<Heading>` + `<Text>`
|
||||
- [ ] Перевести `BrokerOperationsPage` на `<Box>` + `<Heading>` + `<Box component="label">` + `<select>`
|
||||
- [ ] Убедиться, что `role="alert"` сохраняется через `<Text tone="negative">`
|
||||
|
||||
## Task 9: SkeletonBlock удаление
|
||||
|
||||
- [x] Удалить `apps/frontend/src/shared/ui/SkeletonBlock.tsx`
|
||||
- [x] Удалить экспорт из `apps/frontend/src/shared/ui/index.ts`
|
||||
- [x] Проверить grep по `SkeletonBlock` — 0 совпадений
|
||||
- [ ] Удалить `apps/frontend/src/shared/ui/SkeletonBlock.tsx`
|
||||
- [ ] Удалить экспорт из `apps/frontend/src/shared/ui/index.ts`
|
||||
- [ ] Проверить grep по `SkeletonBlock` — 0 совпадений
|
||||
|
||||
## Task 10: Очистка `styles.css`
|
||||
|
||||
- [x] Удалить блоки `.broker-account__*`
|
||||
- [x] Удалить блоки `.broker-overview__*`
|
||||
- [x] Удалить блоки `.broker-allocation__*`
|
||||
- [x] Удалить блоки `.broker-operations__toolbar*`
|
||||
- [x] Удалить CSS-переменные `--broker-overview-*`
|
||||
- [x] Оставить `.loading-spinner`, `.skeleton`, `:root` общие переменные
|
||||
- [ ] Удалить блоки `.broker-account__*`
|
||||
- [ ] Удалить блоки `.broker-overview__*` (кроме SVG-связанных)
|
||||
- [ ] Удалить блоки `.broker-allocation__*` (кроме SVG-внутренних, если остались)
|
||||
- [ ] Удалить блоки `.broker-operations__toolbar*`
|
||||
- [ ] Оставить `.loading-spinner` и `:root` переменные
|
||||
|
||||
## Task 11: Финальная проверка
|
||||
|
||||
- [x] `npm run test:frontend` — 111 tests PASS
|
||||
- [x] `npm run lint -w apps/frontend` — без ошибок
|
||||
- [x] `npm run build:frontend` — без TypeScript/Vite ошибок
|
||||
- [x] grep по `broker-(account|overview|allocation)` в TSX — 0 совпадений
|
||||
- [x] grep по `SkeletonBlock` в TSX — 0 совпадений
|
||||
- [x] CSS: 274 → 99 строк
|
||||
- [ ] `npm run test:frontend`
|
||||
- [ ] `npm run lint -w apps/frontend`
|
||||
- [ ] `npm run build:frontend`
|
||||
- [ ] grep по `broker-(account|overview|allocation)` в TSX — 0 совпадений
|
||||
- [ ] grep по `SkeletonBlock` в TSX — 0 совпадений
|
||||
- [ ] `npm run format` для форматирования
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
## Status
|
||||
|
||||
Implemented — 2026-06-21.
|
||||
Draft
|
||||
|
||||
## Goal
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
## Status
|
||||
|
||||
Implemented — 2026-06-21.
|
||||
Approved — утверждена пользователем 2026-06-21.
|
||||
|
||||
## Goal
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user