fix: restore ArchiveTeam Warrior as a proper integration
The widget-only integrations refactor incorrectly removed the ArchiveTeam Warrior integration entirely. It only needed to be excluded from auto-seeding (by removing defaultUrl), not deleted. This restores the integration class, reverts the widget/router/handler to use integration middleware, and removes archiveTeamWarrior from the widget-only-integrations migration.
This commit is contained in:
18 files changed
+573
-388
No files matched your search
@@ -4,33 +4,41 @@ import { Avatar, Badge, Card, Group, SimpleGrid, Stack, Text } from "@mantine/co
|
||||
|
||||
import { clientApi } from "@homarr/api/client";
|
||||
import { humanFileSize } from "@homarr/common";
|
||||
import { getIconUrl } from "@homarr/definitions";
|
||||
|
||||
import type { WidgetComponentProps } from "../definition";
|
||||
|
||||
const archiveTeamWarriorIconUrl = "https://cdn.jsdelivr.net/gh/selfhst/icons/png/archiveteam-warrior.png";
|
||||
export default function ArchiveTeamWarriorWidget({
|
||||
integrationIds,
|
||||
options,
|
||||
}: WidgetComponentProps<"archiveTeamWarrior">) {
|
||||
const integrationId = integrationIds[0];
|
||||
|
||||
export default function ArchiveTeamWarriorWidget({ options }: WidgetComponentProps<"archiveTeamWarrior">) {
|
||||
return <ArchiveTeamWarriorWidgetContent url={options.url} options={options} />;
|
||||
if (!integrationId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return <ArchiveTeamWarriorWidgetContent integrationId={integrationId} options={options} />;
|
||||
}
|
||||
|
||||
const ArchiveTeamWarriorWidgetContent = ({
|
||||
url,
|
||||
integrationId,
|
||||
options,
|
||||
}: {
|
||||
url: string;
|
||||
integrationId: string;
|
||||
options: WidgetComponentProps<"archiveTeamWarrior">["options"];
|
||||
}) => {
|
||||
const [data] = clientApi.widget.archiveTeamWarrior.getStatus.useSuspenseQuery({
|
||||
url,
|
||||
integrationId,
|
||||
});
|
||||
|
||||
const utils = clientApi.useUtils();
|
||||
|
||||
clientApi.widget.archiveTeamWarrior.subscribeStatus.useSubscription(
|
||||
{ url },
|
||||
{ integrationId },
|
||||
{
|
||||
onData: (next) => {
|
||||
utils.widget.archiveTeamWarrior.getStatus.setData({ url }, next);
|
||||
utils.widget.archiveTeamWarrior.getStatus.setData({ integrationId }, next);
|
||||
},
|
||||
},
|
||||
);
|
||||
@@ -42,7 +50,7 @@ const ArchiveTeamWarriorWidgetContent = ({
|
||||
<Stack p="xs" gap="xs" h="100%">
|
||||
<Group justify="space-between" align="center" wrap="nowrap">
|
||||
<Group gap="xs" wrap="nowrap" miw={0}>
|
||||
<Avatar size="sm" radius="md" src={archiveTeamWarriorIconUrl} />
|
||||
<Avatar size="sm" radius="md" src={getIconUrl("archiveTeamWarrior")} />
|
||||
<Text size="sm" c="dimmed" lineClamp={1}>
|
||||
{projectName}
|
||||
</Text>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { IconArchive } from "@tabler/icons-react";
|
||||
import { z } from "zod/v4";
|
||||
|
||||
import { createWidgetDefinition } from "../definition";
|
||||
import { optionsBuilder } from "../options";
|
||||
@@ -8,13 +7,10 @@ export const { definition, componentLoader } = createWidgetDefinition("archiveTe
|
||||
icon: IconArchive,
|
||||
createOptions() {
|
||||
return optionsBuilder.from((factory) => ({
|
||||
url: factory.text({
|
||||
defaultValue: "http://localhost:8001",
|
||||
validate: z.string().url(),
|
||||
}),
|
||||
showBroadcastMessage: factory.switch({
|
||||
defaultValue: true,
|
||||
}),
|
||||
}));
|
||||
},
|
||||
supportedIntegrations: ["archiveTeamWarrior"],
|
||||
}).withDynamicImport(() => import("./component"));
|
||||
@@ -531,7 +531,7 @@ const ExpandedDisplay = ({
|
||||
p={10}
|
||||
>
|
||||
<Group className="releases-repository-expanded-header" justify="space-between" align="center" gap="xs">
|
||||
<Text className="releases-repository-expanded-header-identifier" size="xs" c="iconColor" ff="monospace">
|
||||
<Text className="releases-repository-expanded-header-identifier" size="xs" c="dimmed" ff="monospace">
|
||||
{repository.identifier}
|
||||
</Text>
|
||||
|
||||
@@ -549,7 +549,7 @@ const ExpandedDisplay = ({
|
||||
<Text
|
||||
className="releases-repository-expanded-header-provider-name"
|
||||
size="xs"
|
||||
c="iconColor"
|
||||
c="dimmed"
|
||||
ff="monospace"
|
||||
>
|
||||
{repository.providerMetadata.name}
|
||||
@@ -616,7 +616,7 @@ const ExpandedDisplay = ({
|
||||
{repository.error && (
|
||||
<>
|
||||
<Divider className="releases-repository-expanded-error-divider" mx="30%" />
|
||||
<Title className="releases-repository-expanded-error-title" order={4} ta="center">
|
||||
<Title className="releases-repository-expanded-error-title" order={4} ta="center" c="red">
|
||||
{t("error.label")}
|
||||
</Title>
|
||||
<Text
|
||||
|
||||
Reference in new issue
Block a user