refactor: address frontend review feedback
Frontend verify / commits (pull_request) Successful in 29s
Frontend verify / security (pull_request) Successful in 9s
Frontend verify / verify (pull_request) Successful in 8m54s
Frontend verify / commits (push) Skipped
Frontend verify / security (push) Successful in 12s
Frontend verify / verify (push) Successful in 9m59s

This commit was merged in pull request #43.
This commit is contained in:
2026-09-28 19:20:32 +03:00
parent ca0ad4f824
commit a4046dbe87
139 changed files with 1549 additions and 941 deletions
@@ -37,7 +37,7 @@ describe("useBrokerageEvents", () => {
server.use(
http.get("*/api/v1/brokerage-accounts/account-1/events", () =>
HttpResponse.json(
/* eslint-disable unicorn/no-null -- Fixture preserves the production contract’s explicit null values. */
resource(
{
accountId: "account-1",
@@ -56,7 +56,6 @@ describe("useBrokerageEvents", () => {
},
],
},
/* eslint-enable unicorn/no-null */
),
),
),
@@ -67,7 +66,7 @@ describe("useBrokerageEvents", () => {
});
await waitFor(() => expect(result.current.isSuccess).toBe(true));
/* eslint-disable unicorn/no-null -- Fixture preserves the production contract’s explicit null values. */
expect(result.current.data?.events).toEqual([
{
date: "2026-09-01",
@@ -80,7 +79,7 @@ describe("useBrokerageEvents", () => {
ticker: "SBER",
type: "dividend",
},
/* eslint-enable unicorn/no-null */
]);
});
});
@@ -19,7 +19,7 @@ const BrokerageEventCard: FC<BrokerageEventCardProps> = (props) => {
date,
event.dateKind === "registry"
? t("events.dateKind.registry")
: null, // eslint-disable-line unicorn/no-null -- Preserve the nullable domain value consumed by this view model.
: null,
event.isin,
event.account?.name,
]
@@ -6,8 +6,6 @@ import type { BrokerageEvent } from "../../api/useBrokerageEvents";
import { BrokerageEventsPreview } from "./BrokerageEventsPreview";
/* eslint-disable unicorn/no-null -- Fixture preserves the production contract’s explicit null values. */
const syntheticEvent
= {
date: "2026-10-15",
@@ -20,7 +18,7 @@ const syntheticEvent
projectedAmount: { currency: "RUB", value: "850.50" },
ticker: "DEMO",
type: "coupon",
} satisfies /* eslint-enable unicorn/no-null */ BrokerageEvent;
} satisfies BrokerageEvent;
const eventsPath = "/accounts/storybook-account/events";
@@ -121,8 +119,6 @@ export const Empty: Story = {
},
};
/* eslint-disable unicorn/no-null -- Fixture preserves the production contract’s explicit null values. */
export const MissingAmount: Story
= {
args: {
@@ -142,9 +138,6 @@ export const MissingAmount: Story
},
},
};
/* eslint-enable unicorn/no-null */
/* eslint-disable unicorn/no-null -- Fixture preserves the production contract’s explicit null values. */
export const LongEvent: Story
= {
@@ -165,4 +158,3 @@ export const LongEvent: Story
},
name: "Длинное название на узком экране",
};
/* eslint-enable unicorn/no-null */
@@ -46,31 +46,21 @@ const BrokerageEventsPreview: FC<BrokerageEventsPreviewProps> = (props) => {
{!!events.stale && <Text size="xs">{t("investment.stale")}</Text>}
{!!events.refreshError && (
<Text role="status">{t("accounts.refreshError")}</Text>
)}
{!!events.refreshError && <Text role="status">{t("accounts.refreshError")}</Text>}
</>
)}
{events.state === "loading" && (
<LoadingSkeleton label={t("events.recentLoading")}>
{["first", "second", "third"].map(placeholder => (
<Skeleton height={48} key={placeholder} radius="sm" />
))}
{["first", "second", "third"].map(placeholder => <Skeleton height={48} key={placeholder} radius="sm" />)}
</LoadingSkeleton>
)}
{events.state === "error" && (
<Alert color="red">{t("events.recentError")}</Alert>
)}
{events.state === "error" && <Alert color="red">{t("events.recentError")}</Alert>}
{events.state === "empty" && (
<Text c="dimmed">{t("events.recentEmpty")}</Text>
)}
{events.state === "empty" && <Text c="dimmed">{t("events.recentEmpty")}</Text>}
{events.state === "partial" && (
<Text role="status">{t("investment.partial")}</Text>
)}
{events.state === "partial" && <Text role="status">{t("investment.partial")}</Text>}
{(events.state === "loaded" || events.state === "partial")
&& events.items.map(event => (