chore: remove Language objects (#23866)

This commit is contained in:
Kayla はな
2026-03-31 15:26:59 -06:00
committed by GitHub
parent 7f7b13f0ab
commit b9f140e53e
38 changed files with 251 additions and 486 deletions
@@ -6,7 +6,7 @@ import {
} from "#/components/DropdownMenu/DropdownMenu";
import { MockUserOwner } from "#/testHelpers/entities";
import { render, waitForLoaderToBeRemoved } from "#/testHelpers/renderHelpers";
import { Language, UserDropdownContent } from "./UserDropdownContent";
import { UserDropdownContent } from "./UserDropdownContent";
const renderUserDropdownContent = (props: { onSignOut: () => void }) => {
return render(
@@ -28,7 +28,7 @@ describe("UserDropdownContent", () => {
renderUserDropdownContent({ onSignOut: vi.fn() });
await waitForLoaderToBeRemoved();
const link = screen.getByText(Language.accountLabel).closest("a");
const link = screen.getByText("Account").closest("a");
if (!link) {
throw new Error("Anchor tag not found for the account menu item");
}
@@ -40,7 +40,7 @@ describe("UserDropdownContent", () => {
const onSignOut = vi.fn();
renderUserDropdownContent({ onSignOut });
await waitForLoaderToBeRemoved();
screen.getByText(Language.signOutLabel).click();
screen.getByText("Sign Out").click();
expect(onSignOut).toBeCalledTimes(1);
});
});
@@ -21,12 +21,6 @@ import {
import { useClipboard } from "#/hooks/useClipboard";
import { SupportIcon } from "../SupportIcon";
export const Language = {
accountLabel: "Account",
signOutLabel: "Sign Out",
copyrightText: `\u00a9 ${new Date().getFullYear()} Coder Technologies, Inc.`,
};
interface UserDropdownContentProps {
user: TypesGen.User;
buildInfo?: TypesGen.BuildInfoResponse;
@@ -126,7 +120,7 @@ export const UserDropdownContent: FC<UserDropdownContentProps> = ({
</Tooltip>
)}
<DropdownMenuItem className="text-xs" disabled>
<span>{Language.copyrightText}</span>
<span>&copy; {new Date().getFullYear()} Coder Technologies, Inc.</span>
</DropdownMenuItem>
</>
);
@@ -8,11 +8,6 @@ import {
TooltipTrigger,
} from "#/components/Tooltip/Tooltip";
const Language = {
showLabel: "Show value",
hideLabel: "Hide value",
};
interface SensitiveValueProps {
value: string;
}
@@ -20,7 +15,7 @@ interface SensitiveValueProps {
export const SensitiveValue: FC<SensitiveValueProps> = ({ value }) => {
const [shouldDisplay, setShouldDisplay] = useState(false);
const displayValue = shouldDisplay ? value : "••••••••";
const buttonLabel = shouldDisplay ? Language.hideLabel : Language.showLabel;
const buttonLabel = shouldDisplay ? "Hide value" : "Show value";
const icon = shouldDisplay ? (
<EyeOffIcon className="size-icon-xs" />
) : (
@@ -13,10 +13,6 @@ import { DEFAULT_LOG_LINE_SIDE_PADDING, Logs } from "#/components/Logs/Logs";
import { BODY_FONT_FAMILY } from "#/theme/constants";
import { cn } from "#/utils/cn";
const Language = {
seconds: "seconds",
};
type Stage = ProvisionerJobLog["stage"];
type LogsGroupedByStage = Record<Stage, ProvisionerJobLog[]>;
type GroupLogsByStageFn = (logs: ProvisionerJobLog[]) => LogsGroupedByStage;
@@ -98,9 +94,7 @@ export const WorkspaceBuildLogs: FC<WorkspaceBuildLogsProps> = ({
>
<div>{stage}</div>
{shouldDisplayDuration && (
<div css={styles.duration}>
{duration} {Language.seconds}
</div>
<div css={styles.duration}>{duration} seconds</div>
)}
</div>
{!isEmpty && <Logs hideTimestamps={hideTimestamps} lines={lines} />}