feat(app): новый визуальный язык, верхняя навигация, портфели, создание счетов и ручные события
Тема и общие виджеты (AssetIcon, ServiceMark, HelpTip, глоссарий), верхняя панель TopNav и вкладки Аналитики вместо NavSidebar, иконки PWA. Экраны: портфели, создание брокерского счёта, ручное событие, правка инструмента, Обзор карточками по скоупам и таблица активов, пересчёт метрик с опросом /metrics/status. design-system.md обновлён.
This commit is contained in:
@@ -35,31 +35,47 @@ const eventStatusLabels = {
|
||||
'ignored': 'Игнорируется',
|
||||
};
|
||||
|
||||
String eventStatusLabel(EventStatus status) => eventStatusLabels[status.value] ?? status.value;
|
||||
String eventStatusLabel(EventStatus status) =>
|
||||
eventStatusLabels[status.value] ?? status.value;
|
||||
|
||||
/// Icon and colour per kind, on the same principle as the transaction list: money coming
|
||||
/// in is green, money leaving is the error colour, everything structural is neutral.
|
||||
(IconData, Color) eventKindIcon(EventKind kind, ColorScheme scheme) => switch (kind) {
|
||||
(IconData, Color) eventKindIcon(EventKind kind, ColorScheme scheme) =>
|
||||
switch (kind) {
|
||||
EventKind.buy => (Icons.add_shopping_cart, scheme.primary),
|
||||
EventKind.sell => (Icons.sell_outlined, Colors.deepPurple),
|
||||
EventKind.dividend || EventKind.coupon || EventKind.interest => (
|
||||
Icons.payments_outlined,
|
||||
Colors.green,
|
||||
),
|
||||
EventKind.dividend ||
|
||||
EventKind.coupon ||
|
||||
EventKind.interest => (Icons.payments_outlined, Colors.green),
|
||||
EventKind.taxRefund => (Icons.assignment_return_outlined, Colors.green),
|
||||
EventKind.tax || EventKind.commission => (Icons.receipt_outlined, scheme.error),
|
||||
EventKind.tax ||
|
||||
EventKind.commission => (Icons.receipt_outlined, scheme.error),
|
||||
EventKind.deposit => (Icons.arrow_circle_down_outlined, Colors.green),
|
||||
EventKind.withdrawal => (Icons.arrow_circle_up_outlined, scheme.error),
|
||||
EventKind.transferIn || EventKind.transferOut => (Icons.swap_horiz, scheme.primary),
|
||||
EventKind.transferIn ||
|
||||
EventKind.transferOut => (Icons.swap_horiz, scheme.primary),
|
||||
EventKind.fxExchange => (Icons.currency_exchange, Colors.amber),
|
||||
EventKind.split || EventKind.amortization || EventKind.repayment => (
|
||||
Icons.call_split,
|
||||
scheme.outline,
|
||||
),
|
||||
EventKind.other || EventKind.unknownDefaultOpenApi => (Icons.help_outline, scheme.outline),
|
||||
EventKind.split ||
|
||||
EventKind.amortization ||
|
||||
EventKind.repayment => (Icons.call_split, scheme.outline),
|
||||
EventKind.other ||
|
||||
EventKind.unknownDefaultOpenApi => (Icons.help_outline, scheme.outline),
|
||||
};
|
||||
|
||||
/// `'Покупка · SBER'`, the one-line identity of a row. Events with no instrument behind
|
||||
/// them (deposits, fees) keep just the kind.
|
||||
String eventTitle(EventKind kind, String? ticker) =>
|
||||
ticker == null || ticker.isEmpty ? eventKindLabel(kind) : '${eventKindLabel(kind)} · $ticker';
|
||||
ticker == null || ticker.isEmpty
|
||||
? eventKindLabel(kind)
|
||||
: '${eventKindLabel(kind)} · $ticker';
|
||||
|
||||
/// Where a ledger event came from, as a person reads it.
|
||||
const eventSourceLabels = {
|
||||
'tinvest': 'T-Invest',
|
||||
'report_sber': 'Отчёт Сбера',
|
||||
'report_vtb': 'Отчёт ВТБ',
|
||||
'csv': 'CSV',
|
||||
'manual': 'Введено вручную',
|
||||
};
|
||||
|
||||
String eventSourceLabel(String source) => eventSourceLabels[source] ?? source;
|
||||
|
||||
Reference in New Issue
Block a user