fix: unable to select integration on board page (#450)

This commit is contained in:
Meier Lukas
2024-05-06 21:12:55 +02:00
committed by GitHub
parent dc0184af07
commit c88464498f
6 changed files with 78 additions and 11 deletions

View File

@@ -18,4 +18,8 @@ export const validation = {
icons: iconsSchemas,
};
export { createSectionSchema, sharedItemSchema } from "./shared";
export {
createSectionSchema,
sharedItemSchema,
type BoardItemIntegration,
} from "./shared";

View File

@@ -11,6 +11,8 @@ export const integrationSchema = z.object({
url: z.string(),
});
export type BoardItemIntegration = z.infer<typeof integrationSchema>;
export const sharedItemSchema = z.object({
id: z.string(),
xOffset: z.number(),

View File

@@ -5,6 +5,7 @@ import { Button, Group, Stack } from "@mantine/core";
import type { WidgetKind } from "@homarr/definitions";
import { createModal } from "@homarr/modals";
import { useI18n } from "@homarr/translation/client";
import type { BoardItemIntegration } from "@homarr/validation";
import { widgetImports } from "..";
import { getInputForType } from "../_inputs";
@@ -15,7 +16,7 @@ import { WidgetIntegrationSelect } from "../widget-integration-select";
export interface WidgetEditModalState {
options: Record<string, unknown>;
integrations: string[];
integrations: BoardItemIntegration[];
}
interface ModalProps<TSort extends WidgetKind> {