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
@@ -100,7 +100,6 @@ describe("Upcoming event date filters", () => {
return HttpResponse.json(
resource(
/* eslint-disable unicorn/no-null -- Fixture preserves the production contract’s explicit null values. */
null,
{
sync: {
@@ -109,7 +108,6 @@ describe("Upcoming event date filters", () => {
state: "failed",
},
},
/* eslint-enable unicorn/no-null */
),
);
}),
@@ -37,7 +37,7 @@ function renderPage() {
describe("AccountEventsPage", () => {
beforeEach(() => {
refresh.mockClear();
/* eslint-disable unicorn/no-null -- Fixture preserves the production contract’s explicit null values. */
query.mockReturnValue(
{
data: {
@@ -52,7 +52,7 @@ describe("AccountEventsPage", () => {
sync: { errorCode: null, id: null, state: "idle" },
},
refetch: vi.fn(),
} as /* eslint-enable unicorn/no-null */ never,
} as never,
);
});
@@ -73,7 +73,6 @@ describe("AccountEventsPage", () => {
});
it("keeps the loading fallback when no result or account is available", () => {
/* eslint-disable unicorn/no-null -- Fixture preserves the production contract’s explicit null values. */
query.mockReturnValue(
{
data: undefined,
@@ -84,7 +83,7 @@ describe("AccountEventsPage", () => {
sync: { errorCode: null, id: null, state: "idle" },
},
refetch: vi.fn(),
} as /* eslint-enable unicorn/no-null */ never,
} as never,
);
renderPage();
expect(query).toHaveBeenCalledWith("", {});
@@ -95,7 +94,6 @@ describe("AccountEventsPage", () => {
});
it("renders events and marks an offer without an amount", () => {
/* eslint-disable unicorn/no-null -- Fixture preserves the production contract’s explicit null values. */
query.mockReturnValue(
{
data: {
@@ -135,7 +133,7 @@ describe("AccountEventsPage", () => {
sync: { errorCode: null, id: null, state: "idle" },
},
refetch: vi.fn(),
} as /* eslint-enable unicorn/no-null */ never,
} as never,
);
renderPage();
expect(screen.getByText("1 250 ₽")).toBeInTheDocument();
@@ -183,7 +181,6 @@ describe("AccountEventsPage", () => {
});
it("shows a structural busy state before events are available", () => {
/* eslint-disable unicorn/no-null -- Fixture preserves the production contract’s explicit null values. */
query.mockReturnValue(
{
data: undefined,
@@ -194,7 +191,7 @@ describe("AccountEventsPage", () => {
sync: { errorCode: null, id: null, state: "idle" },
},
refetch: vi.fn(),
} as /* eslint-enable unicorn/no-null */ never,
} as never,
);
renderPage();
@@ -12,12 +12,8 @@ const AccountEventsPage: FC<AccountEventsPageProps> = (props) => {
if (viewModel.state === "loading") return <AccountEventsPageLoading />;
return viewModel.state === "error"
? (
<AccountEventsPageError {...viewModel} />
)
: (
<AccountEventsPageLoaded {...viewModel} />
);
? <AccountEventsPageError {...viewModel} />
: <AccountEventsPageLoaded {...viewModel} />;
};
export { AccountEventsPage };
@@ -41,11 +41,11 @@ function useAccountEventsPageViewModel(
const appliedFrom = isValidUrlPeriod
? urlFrom
: null; // eslint-disable-line unicorn/no-null -- Preserve the nullable domain value consumed by this view model.
: null;
const appliedTo = isValidUrlPeriod
? urlTo
: null; // eslint-disable-line unicorn/no-null -- Preserve the nullable domain value consumed by this view model.
: null;
const [draftFrom, setDraftFrom] = useState<null | string>(appliedFrom);
const [draftTo, setDraftTo] = useState<null | string>(appliedTo);
@@ -6,9 +6,7 @@ import { useTranslation } from "react-i18next";
const AccountEventsPageEmpty: FC = () => {
const { t } = useTranslation();
return (
<StateView text={t("events.emptyText")} title={t("events.emptyTitle")} />
);
return <StateView text={t("events.emptyText")} title={t("events.emptyTitle")} />;
};
export { AccountEventsPageEmpty };
@@ -74,13 +74,9 @@ const AccountEventsPageLoaded: FC<AccountEventsPageLoadedProps> = (props) => {
{t("investment.refresh")}
</Button>
{!!props.partial && (
<Alert role="status">{t("investment.partial")}</Alert>
)}
{!!props.partial && <Alert role="status">{t("investment.partial")}</Alert>}
{!!props.refreshing && (
<Progress animated aria-label={t("accounts.refreshing")} value={100} />
)}
{!!props.refreshing && <Progress animated aria-label={t("accounts.refreshing")} value={100} />}
{!!props.refreshError && (
<Alert aria-live="polite" color="yellow" role="status">
@@ -27,9 +27,7 @@ const AccountEventsPageLoading: FC = () => {
<Skeleton height={36} width={108} />
</Group>
{skeletonRowIds.map(id => (
<Skeleton height={82} key={id} radius="md" />
))}
{skeletonRowIds.map(id => <Skeleton height={82} key={id} radius="md" />)}
</LoadingSkeleton>
);
};