diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml index a75c144b7..a93cfe2f2 100644 --- a/.github/workflows/code-quality.yml +++ b/.github/workflows/code-quality.yml @@ -67,11 +67,33 @@ jobs: - name: Test run: pnpm test - - name: 'Report Coverage' + - name: "Report Coverage" # Set if: always() to also generate the report if tests are failing # Only works if you set `reportOnFailure: true` in your vite config as specified above - if: always() - uses: davelosert/vitest-coverage-report-action@v2 + if: always() + uses: davelosert/vitest-coverage-report-action@v2 + + e2e: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Setup + uses: ./tooling/github/setup + - name: Build docker image + id: build-docker-image + uses: docker/build-push-action@v6 + with: + platforms: linux/amd64 + context: . + push: false + tags: homarr-e2e + network: host + env: + SKIP_ENV_VALIDATION: true + - name: Run E2E Tests + shell: bash + run: pnpm test:e2e build: runs-on: ubuntu-latest diff --git a/.github/workflows/deployment-docker-image.yml b/.github/workflows/deployment-docker-image.yml index 35275a8da..f00513efd 100644 --- a/.github/workflows/deployment-docker-image.yml +++ b/.github/workflows/deployment-docker-image.yml @@ -33,9 +33,6 @@ jobs: deploy: name: Deploy docker image runs-on: ubuntu-latest - strategy: - matrix: - node-version: [20] steps: - name: Discord notification if: ${{ github.events.inputs.send-notifications != false }} @@ -57,21 +54,7 @@ jobs: DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} uses: Ilshidur/action-discord@master with: - args: "Semver computed next tag to be ${{ steps.semver.outputs.next }}. Current is ${{ steps.semver.outputs.current }}" - - uses: pnpm/action-setup@v2 - with: - version: 8 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node-version }} - - name: Discord notification - if: ${{ github.events.inputs.send-notifications != false }} - env: - DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} - uses: Ilshidur/action-discord@master - with: - args: "Built application artifacts. Building images..." + args: "Semver computed next tag to be ${{ steps.semver.outputs.next }}. Current is ${{ steps.semver.outputs.current }}. Building images..." - name: Log in to the Container registry uses: docker/login-action@v3 with: @@ -90,9 +73,9 @@ jobs: tags: | type=raw,value=alpha type=raw,value=early-adopters -# tags: | -# type=raw,value=latest -# type=raw,value=${{ steps.semver.outputs.next }} + # tags: | + # type=raw,value=latest + # type=raw,value=${{ steps.semver.outputs.next }} - name: Build and push id: buildPushAction uses: docker/build-push-action@v6 diff --git a/Dockerfile b/Dockerfile index 468e189e1..5e682f89b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -59,8 +59,6 @@ WORKDIR /app # gettext is required for envsubst RUN apk add --no-cache redis nginx bash gettext RUN mkdir /appdata -RUN mkdir /appdata/db -RUN mkdir /appdata/redis VOLUME /appdata RUN mkdir /secrets VOLUME /secrets diff --git a/apps/nextjs/package.json b/apps/nextjs/package.json index 90dc19a1d..f87b245ea 100644 --- a/apps/nextjs/package.json +++ b/apps/nextjs/package.json @@ -37,17 +37,17 @@ "@homarr/ui": "workspace:^0.1.0", "@homarr/validation": "workspace:^0.1.0", "@homarr/widgets": "workspace:^0.1.0", - "@mantine/colors-generator": "^7.13.4", - "@mantine/core": "^7.13.4", - "@mantine/hooks": "^7.13.4", - "@mantine/modals": "^7.13.4", - "@mantine/tiptap": "^7.13.4", + "@mantine/colors-generator": "^7.13.5", + "@mantine/core": "^7.13.5", + "@mantine/hooks": "^7.13.5", + "@mantine/modals": "^7.13.5", + "@mantine/tiptap": "^7.13.5", "@million/lint": "1.0.11", "@t3-oss/env-nextjs": "^0.11.1", "@tabler/icons-react": "^3.21.0", - "@tanstack/react-query": "^5.59.19", - "@tanstack/react-query-devtools": "^5.59.19", - "@tanstack/react-query-next-experimental": "5.59.19", + "@tanstack/react-query": "^5.59.20", + "@tanstack/react-query-devtools": "^5.59.20", + "@tanstack/react-query-next-experimental": "5.59.20", "@trpc/client": "next", "@trpc/next": "next", "@trpc/react-query": "next", @@ -63,7 +63,7 @@ "glob": "^11.0.0", "jotai": "^2.10.1", "mantine-react-table": "2.0.0-beta.7", - "next": "^14.2.16", + "next": "^14.2.17", "postcss-preset-mantine": "^1.17.0", "prismjs": "^1.29.0", "react": "^18.3.1", @@ -72,7 +72,7 @@ "react-simple-code-editor": "^0.14.1", "sass": "^1.80.6", "superjson": "2.2.1", - "swagger-ui-react": "^5.17.14", + "swagger-ui-react": "^5.18.2", "use-deep-compare-effect": "^1.8.1" }, "devDependencies": { @@ -80,7 +80,7 @@ "@homarr/prettier-config": "workspace:^0.1.0", "@homarr/tsconfig": "workspace:^0.1.0", "@types/chroma-js": "2.4.4", - "@types/node": "^22.8.7", + "@types/node": "^22.9.0", "@types/prismjs": "^1.26.5", "@types/react": "^18.3.12", "@types/react-dom": "^18.3.1", diff --git a/apps/nextjs/src/app/[locale]/manage/search-engines/_form.tsx b/apps/nextjs/src/app/[locale]/manage/search-engines/_form.tsx index e937cf503..4db3ba01a 100644 --- a/apps/nextjs/src/app/[locale]/manage/search-engines/_form.tsx +++ b/apps/nextjs/src/app/[locale]/manage/search-engines/_form.tsx @@ -1,8 +1,12 @@ "use client"; import Link from "next/link"; -import { Button, Grid, Group, Stack, Textarea, TextInput } from "@mantine/core"; +import type { SegmentedControlItem } from "@mantine/core"; +import { Button, Fieldset, Grid, Group, SegmentedControl, Stack, Textarea, TextInput } from "@mantine/core"; +import { WidgetIntegrationSelect } from "node_modules/@homarr/widgets/src/widget-integration-select"; +import { clientApi } from "@homarr/api/client"; +import { searchEngineTypes } from "@homarr/definitions"; import { useZodForm } from "@homarr/form"; import type { TranslationFunction } from "@homarr/translation"; import { useI18n } from "@homarr/translation/client"; @@ -25,6 +29,8 @@ export const SearchEngineForm = (props: SearchEngineFormProps) => { const { submitButtonTranslation, handleSubmit, initialValues, isPending, disableShort } = props; const t = useI18n(); + const [integrationData] = clientApi.integration.allThatSupportSearch.useSuspenseQuery(); + const form = useZodForm(validation.searchEngine.manage, { initialValues: initialValues ?? { name: "", @@ -32,6 +38,7 @@ export const SearchEngineForm = (props: SearchEngineFormProps) => { iconUrl: "", urlTemplate: "", description: "", + type: "generic", }, }); @@ -52,11 +59,40 @@ export const SearchEngineForm = (props: SearchEngineFormProps) => { - + +
+ + ({ + label: t(`search.engine.page.edit.searchEngineType.${type}`), + value: type, + }) satisfies SegmentedControlItem, + )} + {...form.getInputProps("type")} + fullWidth + /> + + {form.values.type === "generic" && ( + + )} + + {form.values.type === "fromIntegration" && ( + form.setFieldValue("integrationId", value[0])} + value={form.values.integrationId !== undefined ? [form.values.integrationId] : []} + withAsterisk + /> + )} +
+