fix: resolve frontend audit findings
Frontend security / security (push) Successful in 10s
Frontend verify / verify (push) Successful in 4m57s
Conventional commits / commits (pull_request) Successful in 28s
Frontend security / security (pull_request) Successful in 10s
Frontend verify / verify (pull_request) Successful in 5m10s
Frontend security / security (push) Successful in 10s
Frontend verify / verify (push) Successful in 4m57s
Conventional commits / commits (pull_request) Successful in 28s
Frontend security / security (pull_request) Successful in 10s
Frontend verify / verify (pull_request) Successful in 5m10s
Repair investment recovery, draft preservation, date validation, currency presentation, accessibility, and route error recovery. Correct Docker and dependency checks and consume explicit income roles.
This commit is contained in:
@@ -131,7 +131,7 @@
|
||||
},
|
||||
"muted": {
|
||||
"color": "gray",
|
||||
"shade": 6,
|
||||
"shade": 7,
|
||||
"description": "Вторичный текст; проверяйте контраст при выборе фона"
|
||||
},
|
||||
"border": {
|
||||
|
||||
@@ -4,7 +4,7 @@ import { assert, describe, expect, it } from "vitest";
|
||||
import { EntryCard } from "./EntryCard";
|
||||
|
||||
describe("EntryCard", () => {
|
||||
it("keeps the fallback after an image fails", () => {
|
||||
it("keeps a failed image fallback until a new source is supplied", () => {
|
||||
const props = {
|
||||
title: "Пример",
|
||||
metadata: "Описание",
|
||||
@@ -31,5 +31,15 @@ describe("EntryCard", () => {
|
||||
expect(container.querySelector("img")).toBeNull();
|
||||
expect(screen.getByText("У")).toBeInTheDocument();
|
||||
expect(screen.getByText("Обновлённый пример")).toBeInTheDocument();
|
||||
rerender(
|
||||
<MantineProvider>
|
||||
<EntryCard {...props} imageSrc="/replacement-logo.png" />
|
||||
</MantineProvider>,
|
||||
);
|
||||
expect(container.querySelector("img")).toHaveAttribute(
|
||||
"src",
|
||||
"/replacement-logo.png",
|
||||
);
|
||||
expect(screen.queryByText("У")).not.toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Avatar, Paper, Stack, Text } from "@mantine/core";
|
||||
import { type FC, type ReactNode, useState } from "react";
|
||||
import type { FC, ReactNode } from "react";
|
||||
import classes from "./EntryCard.module.css";
|
||||
|
||||
type EntryCardProps = {
|
||||
@@ -17,7 +17,6 @@ type EntryCardProps = {
|
||||
};
|
||||
|
||||
const EntryCard: FC<EntryCardProps> = (props) => {
|
||||
const [imageFailed, setImageFailed] = useState(false);
|
||||
return (
|
||||
<Paper
|
||||
className={classes.row}
|
||||
@@ -35,8 +34,7 @@ const EntryCard: FC<EntryCardProps> = (props) => {
|
||||
aria-hidden="true"
|
||||
radius="md"
|
||||
size={40}
|
||||
src={imageFailed ? null : props.imageSrc}
|
||||
onError={() => setImageFailed(true)}
|
||||
src={props.imageSrc}
|
||||
>
|
||||
{props.icon ?? props.initial}
|
||||
</Avatar>
|
||||
|
||||
@@ -25,5 +25,8 @@ describe("design theme adapter", () => {
|
||||
expect(Object.keys(variables)).toHaveLength(
|
||||
Object.keys(source.color.roles).length,
|
||||
);
|
||||
expect(cssVariablesResolver(resolved).light["--mantine-color-dimmed"]).toBe(
|
||||
variables["--wl-color-muted"],
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -79,7 +79,9 @@ const cssVariablesResolver: CSSVariablesResolver = (resolvedTheme) => ({
|
||||
getThemeColor(reference, resolvedTheme),
|
||||
]),
|
||||
),
|
||||
light: {},
|
||||
light: {
|
||||
"--mantine-color-dimmed": getThemeColor(colorRoles.muted, resolvedTheme),
|
||||
},
|
||||
dark: {},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user