Skip to content

Commit

Permalink
Update apps/nextjs/src/app/[locale]/manage/integrations/new/_integrat…
Browse files Browse the repository at this point in the history
…ion-new-form.tsx

Co-authored-by: Meier Lukas <[email protected]>
  • Loading branch information
manuel-rw and Meierschlumpf committed Dec 31, 2024
1 parent 938a772 commit 6d7e1b3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export const NewIntegrationForm = ({ searchParams }: NewIntegrationFormProps) =>
<Checkbox
label={t("integration.field.attemptSearchEngineCreation.label")}
description={t("integration.field.attemptSearchEngineCreation.description", {
kind: searchParams.kind.substring(0, 1).toUpperCase() + searchParams.kind.substring(1),
kind: getIntegrationName(searchParams.kind),
})}
{...form.getInputProps("attemptSearchEngineCreation", { type: "checkbox" })}
/>
Expand Down
3 changes: 1 addition & 2 deletions packages/api/src/router/integration/integration-router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import {
integrationKinds,
integrationSecretKindObject,
} from "@homarr/definitions";
import { getIconForNameAsync } from "@homarr/icons";
import { integrationCreator } from "@homarr/integrations";
import { validation, z } from "@homarr/validation";

Expand Down Expand Up @@ -434,7 +433,7 @@ const getNextValidShortNameForSearchEngineAsync = async (db: Database, integrati
},
});

const usedShortNames = searchEngines.flatMap((searchEngine) => searchEngine.short);
const usedShortNames = searchEngines.flatMap((searchEngine) => searchEngine.short.toLowerCase());
const nameByIntegrationName = integrationName.slice(0, 1).toLowerCase();

if (!usedShortNames.includes(nameByIntegrationName)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,9 @@ describe("create should create a new integration", () => {
expect(dbSearchEngine!.integrationId).toBe(dbIntegration!.id);
expect(dbSearchEngine!.short).toBe("j");
expect(dbSearchEngine!.name).toBe(input.name);
expect(dbSearchEngine!.iconUrl).toBe("https://cdn.jsdelivr.net/gh/walkxcode/dashboard-icons/svg/homarr.svg");
expect(dbSearchEngine!.iconUrl).toBe(
"https://cdn.jsdelivr.net/gh/walkxcode/dashboard-icons@master/png/jellyseerr.png",
);
});

test("without create integration access should throw permission error", async () => {
Expand Down

0 comments on commit 6d7e1b3

Please sign in to comment.