fix(ci): add css module types and resolve typecheck/lint warnings in UI and modals
This commit is contained in:
7 files changed
+24
-12
No files matched your search
@@ -161,7 +161,7 @@ describe("Advanced Add App - Modal Subcomponents", () => {
|
|||||||
await act(async () =>
|
await act(async () =>
|
||||||
root.render(
|
root.render(
|
||||||
<MantineProvider>
|
<MantineProvider>
|
||||||
<WidgetItem item={item} isSelected={false} connectionStatus="ready" onSelect={onSelect} />
|
<WidgetItem item={item} disabled={false} loading={false} connectionStatus="ready" onSelect={onSelect} />
|
||||||
</MantineProvider>,
|
</MantineProvider>,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@@ -192,7 +192,13 @@ describe("Advanced Add App - Modal Subcomponents", () => {
|
|||||||
await act(async () =>
|
await act(async () =>
|
||||||
root.render(
|
root.render(
|
||||||
<MantineProvider>
|
<MantineProvider>
|
||||||
<WidgetItem item={item} isSelected={true} connectionStatus="noConnectionRequired" onSelect={vi.fn()} />
|
<WidgetItem
|
||||||
|
item={item}
|
||||||
|
disabled={false}
|
||||||
|
loading={false}
|
||||||
|
connectionStatus="noConnectionRequired"
|
||||||
|
onSelect={vi.fn()}
|
||||||
|
/>
|
||||||
</MantineProvider>,
|
</MantineProvider>,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { useEffect, useMemo, useRef, useState } from "react";
|
import { useMemo, useRef, useState } from "react";
|
||||||
import {
|
import {
|
||||||
Avatar,
|
Avatar,
|
||||||
Badge,
|
Badge,
|
||||||
@@ -66,7 +66,7 @@ interface ItemSelectModalContentProps {
|
|||||||
initialSearch?: string;
|
initialSearch?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface WidgetItemData {
|
export interface WidgetItemData {
|
||||||
kind: WidgetKind;
|
kind: WidgetKind;
|
||||||
supportedIntegrations: IntegrationKind[];
|
supportedIntegrations: IntegrationKind[];
|
||||||
icon: TablerIcon;
|
icon: TablerIcon;
|
||||||
@@ -556,7 +556,7 @@ export const WidgetItem = ({
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const ConnectionStatusBadge = ({ status }: { status: WidgetConnectionStatus }) => {
|
export const ConnectionStatusBadge = ({ status }: { status: WidgetConnectionStatus }) => {
|
||||||
if (status === "noConnectionRequired") return null;
|
if (status === "noConnectionRequired") return null;
|
||||||
const t = useI18n();
|
const t = useI18n();
|
||||||
const color = status === "ready" ? "green" : status === "needsSetup" ? "yellow" : "gray";
|
const color = status === "ready" ? "green" : status === "needsSetup" ? "yellow" : "gray";
|
||||||
@@ -568,7 +568,7 @@ const ConnectionStatusBadge = ({ status }: { status: WidgetConnectionStatus }) =
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const SupportedIntegrations = ({ integrations }: { integrations: IntegrationKind[] }) => {
|
export const SupportedIntegrations = ({ integrations }: { integrations: IntegrationKind[] }) => {
|
||||||
if (integrations.length === 0) {
|
if (integrations.length === 0) {
|
||||||
return (
|
return (
|
||||||
<Text size="xs" c="dimmed" fs="italic">
|
<Text size="xs" c="dimmed" fs="italic">
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
declare const classes: {
|
||||||
|
readonly root: string;
|
||||||
|
readonly header: string;
|
||||||
|
readonly body: string;
|
||||||
|
readonly footer: string;
|
||||||
|
};
|
||||||
|
export default classes;
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
import { act, createRef } from "react";
|
import { act, createRef } from "react";
|
||||||
import { createRoot } from "react-dom/client";
|
import { createRoot } from "react-dom/client";
|
||||||
import type { Root } from "react-dom/client";
|
import type { Root } from "react-dom/client";
|
||||||
import { Badge, MantineProvider, Text } from "@mantine/core";
|
import { Badge, MantineProvider } from "@mantine/core";
|
||||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||||
|
|
||||||
import { SelectableCard } from "./selectable-card";
|
import { SelectableCard } from "./selectable-card";
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import {
|
|||||||
factory,
|
factory,
|
||||||
Group,
|
Group,
|
||||||
LoadingOverlay,
|
LoadingOverlay,
|
||||||
Stack,
|
|
||||||
Text,
|
Text,
|
||||||
Tooltip,
|
Tooltip,
|
||||||
useProps,
|
useProps,
|
||||||
@@ -54,7 +53,8 @@ const varsResolver = createVarsResolver<SelectableCardFactory>((_theme, { radius
|
|||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
export const SelectableCard = factory<SelectableCardFactory>((_props, ref) => {
|
export const SelectableCard = factory<SelectableCardFactory>(
|
||||||
|
(_props: SelectableCardProps, ref: React.ForwardedRef<HTMLButtonElement>) => {
|
||||||
const props = useProps("SelectableCard", defaultProps, _props);
|
const props = useProps("SelectableCard", defaultProps, _props);
|
||||||
const {
|
const {
|
||||||
classNames,
|
classNames,
|
||||||
@@ -171,7 +171,8 @@ export const SelectableCard = factory<SelectableCardFactory>((_props, ref) => {
|
|||||||
)}
|
)}
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
});
|
},
|
||||||
|
);
|
||||||
|
|
||||||
SelectableCard.displayName = "@homarr/ui/SelectableCard";
|
SelectableCard.displayName = "@homarr/ui/SelectableCard";
|
||||||
SelectableCard.classes = classes;
|
SelectableCard.classes = classes;
|
||||||
@@ -13,7 +13,6 @@ import {
|
|||||||
IconBuildingBank,
|
IconBuildingBank,
|
||||||
IconBusStop,
|
IconBusStop,
|
||||||
IconCalendar,
|
IconCalendar,
|
||||||
IconCalendarWeek,
|
|
||||||
IconChartBar,
|
IconChartBar,
|
||||||
IconClock,
|
IconClock,
|
||||||
IconClockPlay,
|
IconClockPlay,
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ import {
|
|||||||
IconBuildingBank,
|
IconBuildingBank,
|
||||||
IconBusStop,
|
IconBusStop,
|
||||||
IconCalendar,
|
IconCalendar,
|
||||||
IconCalendarWeek,
|
|
||||||
IconChartAreaLine,
|
IconChartAreaLine,
|
||||||
IconChartBar,
|
IconChartBar,
|
||||||
IconClock,
|
IconClock,
|
||||||
|
|||||||
Reference in new issue
Block a user