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
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:
@@ -29,8 +29,6 @@ const accounts = [
|
||||
{ id: "b", name: "ИИС" },
|
||||
];
|
||||
|
||||
/* eslint-disable unicorn/no-null -- Fixture preserves the production contract’s explicit null values. */
|
||||
|
||||
const position: Portfolio["positions"][number]
|
||||
= {
|
||||
absoluteReturn: null,
|
||||
@@ -45,7 +43,6 @@ const position: Portfolio["positions"][number]
|
||||
type: "STOCK",
|
||||
};
|
||||
|
||||
/* eslint-enable unicorn/no-null */
|
||||
const portfolio: Portfolio = {
|
||||
cashBalances: [],
|
||||
isStale: false,
|
||||
@@ -55,8 +52,6 @@ const portfolio: Portfolio = {
|
||||
totalsByCurrency: [{ currency: "RUB", value: "1200" }],
|
||||
};
|
||||
|
||||
/* eslint-disable unicorn/no-null -- Fixture preserves the production contract’s explicit null values. */
|
||||
|
||||
const receipt: BrokerageOperation
|
||||
= {
|
||||
accruedInterest: null,
|
||||
@@ -76,11 +71,8 @@ const receipt: BrokerageOperation
|
||||
type: "OPERATION_TYPE_COUPON",
|
||||
};
|
||||
|
||||
/* eslint-enable unicorn/no-null */
|
||||
const items = accounts.map(account => ({ ...receipt, account }));
|
||||
|
||||
/* eslint-disable unicorn/no-null -- Fixture preserves the production contract’s explicit null values. */
|
||||
|
||||
const analytics: IncomeAnalytics
|
||||
= {
|
||||
accountId: "all",
|
||||
@@ -118,7 +110,6 @@ const analytics: IncomeAnalytics
|
||||
yearComparison: null,
|
||||
};
|
||||
|
||||
/* eslint-enable unicorn/no-null */
|
||||
const CurrentLocation: FC = () => {
|
||||
const location = useLocation();
|
||||
|
||||
@@ -162,7 +153,7 @@ beforeEach(() => {
|
||||
HttpResponse.json(
|
||||
resource(
|
||||
accounts.map(
|
||||
/* eslint-disable unicorn/no-null -- Fixture preserves the production contract’s explicit null values. */
|
||||
|
||||
account =>
|
||||
({
|
||||
...account,
|
||||
@@ -170,7 +161,6 @@ beforeEach(() => {
|
||||
portfolioSummary: null,
|
||||
type: "BROKERAGE",
|
||||
}),
|
||||
/* eslint-enable unicorn/no-null */
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -182,7 +172,7 @@ beforeEach(() => {
|
||||
"*/api/v1/brokerage-accounts/:accountId/operations",
|
||||
({ params }) =>
|
||||
HttpResponse.json(
|
||||
/* eslint-disable unicorn/no-null -- Fixture preserves the production contract’s explicit null values. */
|
||||
|
||||
resource(
|
||||
{
|
||||
accountId: params.accountId,
|
||||
@@ -191,7 +181,6 @@ beforeEach(() => {
|
||||
nextCursor: null,
|
||||
observedAt: receipt.occurredAt,
|
||||
},
|
||||
/* eslint-enable unicorn/no-null */
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -204,7 +193,7 @@ beforeEach(() => {
|
||||
accountId: "all",
|
||||
calculatedAt: receipt.occurredAt,
|
||||
events: accounts.map(
|
||||
/* eslint-disable unicorn/no-null -- Fixture preserves the production contract’s explicit null values. */
|
||||
|
||||
account =>
|
||||
({
|
||||
account,
|
||||
@@ -219,7 +208,6 @@ beforeEach(() => {
|
||||
ticker: "BOND",
|
||||
type: "coupon",
|
||||
}),
|
||||
/* eslint-enable unicorn/no-null */
|
||||
),
|
||||
incomeTotalsByCurrency: [],
|
||||
}),
|
||||
@@ -278,7 +266,7 @@ describe("All accounts routes", () => {
|
||||
requests.push(url);
|
||||
|
||||
return HttpResponse.json(
|
||||
/* eslint-disable unicorn/no-null -- Fixture preserves the production contract’s explicit null values. */
|
||||
|
||||
resource(
|
||||
{
|
||||
accountId: params.accountId,
|
||||
@@ -294,7 +282,6 @@ describe("All accounts routes", () => {
|
||||
nextCursor: url.searchParams.has("cursor") ? null : "next",
|
||||
observedAt: receipt.occurredAt,
|
||||
},
|
||||
/* eslint-enable unicorn/no-null */
|
||||
),
|
||||
);
|
||||
},
|
||||
|
||||
@@ -104,7 +104,7 @@ describe("AppRoutes", () => {
|
||||
),
|
||||
http.get("*/api/v1/bank-cards", () => HttpResponse.json([])),
|
||||
http.get("*/api/v1/bank-cards/summary", () =>
|
||||
/* eslint-disable unicorn/no-null -- Fixture preserves the production contract’s explicit null values. */
|
||||
|
||||
HttpResponse.json(
|
||||
{
|
||||
cardId: null,
|
||||
@@ -114,7 +114,6 @@ describe("AppRoutes", () => {
|
||||
net: { currency: "RUB", value: "0" },
|
||||
refunds: { currency: "RUB", value: "0" },
|
||||
},
|
||||
/* eslint-enable unicorn/no-null */
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -106,12 +106,8 @@ const ProtectedDocumentTitle: FC = () => {
|
||||
if (stocks) return <DocumentTitle title={t("navigation.stocks")} />;
|
||||
|
||||
return settings
|
||||
? (
|
||||
<DocumentTitle title={t("navigation.settings")} />
|
||||
)
|
||||
: (
|
||||
<DocumentTitle title={t("navigation.accounts")} />
|
||||
);
|
||||
? <DocumentTitle title={t("navigation.settings")} />
|
||||
: <DocumentTitle title={t("navigation.accounts")} />;
|
||||
};
|
||||
|
||||
export { ProtectedDocumentTitle };
|
||||
|
||||
@@ -8,10 +8,10 @@ import { RouteErrorBoundary } from "./RouteErrorBoundary";
|
||||
|
||||
const session = { isAuthenticated: false };
|
||||
vi.mock("@/features/auth", () => ({
|
||||
/* eslint-disable unicorn/no-null -- Fixture preserves the production contract’s explicit null values. */
|
||||
|
||||
useAuth: () =>
|
||||
({ user: session.isAuthenticated ? {} : null }),
|
||||
/* eslint-enable unicorn/no-null */
|
||||
|
||||
}));
|
||||
|
||||
const ThrowingRoute: FC = () => {
|
||||
@@ -25,9 +25,7 @@ const HealthyRoute: FC = () => {
|
||||
? (
|
||||
"healthy route"
|
||||
)
|
||||
: (
|
||||
<ThrowingRoute />
|
||||
)}
|
||||
: <ThrowingRoute />}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -34,9 +34,7 @@ class Boundary extends Component<BoundaryProps, State> {
|
||||
|
||||
render() {
|
||||
return this.state.hasError
|
||||
? (
|
||||
<RouteErrorFallback authenticated={this.props.authenticated} />
|
||||
)
|
||||
? <RouteErrorFallback authenticated={this.props.authenticated} />
|
||||
: (
|
||||
this.props.children
|
||||
);
|
||||
|
||||
@@ -79,9 +79,7 @@ const LazyPage: FC<LazyPageProps> = (props) => {
|
||||
? (
|
||||
children
|
||||
)
|
||||
: (
|
||||
<RouteTransition>{children}</RouteTransition>
|
||||
)}
|
||||
: <RouteTransition>{children}</RouteTransition>}
|
||||
</Suspense>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -13,9 +13,7 @@ const Protected: FC<PropsWithChildren> = (props) => {
|
||||
if (!ready) return <RouteSkeleton variant="shell" />;
|
||||
|
||||
return user
|
||||
? (
|
||||
<>{children}</>
|
||||
)
|
||||
? <>{children}</>
|
||||
: (
|
||||
<Navigate
|
||||
replace
|
||||
|
||||
@@ -88,9 +88,7 @@ const AppBreadcrumbs: FC = () => {
|
||||
return <BreadcrumbTrail items={[{ label: t("breadcrumbs.accounts") }]} />;
|
||||
|
||||
return settings
|
||||
? (
|
||||
<BreadcrumbTrail items={[{ label: t("breadcrumbs.settings") }]} />
|
||||
)
|
||||
? <BreadcrumbTrail items={[{ label: t("breadcrumbs.settings") }]} />
|
||||
: undefined;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user