diff --git a/app/hooks/useSettingsConfig.ts b/app/hooks/useSettingsConfig.ts index 89935f8c80..ef169eda8f 100644 --- a/app/hooks/useSettingsConfig.ts +++ b/app/hooks/useSettingsConfig.ts @@ -40,7 +40,6 @@ const Notifications = lazy(() => import("~/scenes/Settings/Notifications")); const Preferences = lazy(() => import("~/scenes/Settings/Preferences")); const Profile = lazy(() => import("~/scenes/Settings/Profile")); const Security = lazy(() => import("~/scenes/Settings/Security")); -const SelfHosted = lazy(() => import("~/scenes/Settings/SelfHosted")); const Shares = lazy(() => import("~/scenes/Settings/Shares")); const Templates = lazy(() => import("~/scenes/Settings/Templates")); const Zapier = lazy(() => import("~/scenes/Settings/Zapier")); @@ -177,14 +176,6 @@ const useSettingsConfig = () => { icon: ExportIcon, }, // Integrations - { - name: t("Self Hosted"), - path: integrationSettingsPath("self-hosted"), - component: SelfHosted, - enabled: can.update && !isCloudHosted, - group: t("Integrations"), - icon: BuildingBlocksIcon, - }, { name: "Zapier", path: integrationSettingsPath("zapier"), diff --git a/app/scenes/Settings/SelfHosted.tsx b/app/scenes/Settings/SelfHosted.tsx deleted file mode 100644 index bc836d218d..0000000000 --- a/app/scenes/Settings/SelfHosted.tsx +++ /dev/null @@ -1,140 +0,0 @@ -import find from "lodash/find"; -import { observer } from "mobx-react"; -import { BuildingBlocksIcon } from "outline-icons"; -import * as React from "react"; -import { useForm } from "react-hook-form"; -import { useTranslation } from "react-i18next"; -import { toast } from "sonner"; -import { IntegrationService, IntegrationType } from "@shared/types"; -import Integration from "~/models/Integration"; -import Button from "~/components/Button"; -import Heading from "~/components/Heading"; -import Input from "~/components/Input"; -import Scene from "~/components/Scene"; -import useStores from "~/hooks/useStores"; -import SettingRow from "./components/SettingRow"; - -type FormData = { - drawIoUrl: string; - gristUrl: string; -}; - -function SelfHosted() { - const { integrations } = useStores(); - const { t } = useTranslation(); - - const integrationDiagrams = find(integrations.orderedData, { - type: IntegrationType.Embed, - service: IntegrationService.Diagrams, - }) as Integration | undefined; - - const integrationGrist = find(integrations.orderedData, { - type: IntegrationType.Embed, - service: IntegrationService.Grist, - }) as Integration | undefined; - - const { - register, - reset, - handleSubmit: formHandleSubmit, - formState, - } = useForm({ - mode: "all", - defaultValues: { - drawIoUrl: integrationDiagrams?.settings.url, - gristUrl: integrationGrist?.settings.url, - }, - }); - - React.useEffect(() => { - void integrations.fetchPage({ - type: IntegrationType.Embed, - }); - }, [integrations]); - - React.useEffect(() => { - reset({ - drawIoUrl: integrationDiagrams?.settings.url, - gristUrl: integrationGrist?.settings.url, - }); - }, [integrationDiagrams, integrationGrist, reset]); - - const handleSubmit = React.useCallback( - async (data: FormData) => { - try { - if (data.drawIoUrl) { - await integrations.save({ - id: integrationDiagrams?.id, - type: IntegrationType.Embed, - service: IntegrationService.Diagrams, - settings: { - url: data.drawIoUrl, - }, - }); - } else { - await integrationDiagrams?.delete(); - } - - if (data.gristUrl) { - await integrations.save({ - id: integrationGrist?.id, - type: IntegrationType.Embed, - service: IntegrationService.Grist, - settings: { - url: data.gristUrl, - }, - }); - } else { - await integrationGrist?.delete(); - } - - toast.success(t("Settings saved")); - } catch (err) { - toast.error(err.message); - } - }, - [integrations, integrationDiagrams, integrationGrist, t] - ); - - return ( - }> - {t("Self Hosted")} - -
- - - - - - - - - -
-
- ); -} - -export default observer(SelfHosted); diff --git a/package.json b/package.json index d6f7eacb6d..6c9513b8d1 100644 --- a/package.json +++ b/package.json @@ -377,5 +377,6 @@ "rollup": "^4.5.1", "prismjs": "1.30.0" }, - "version": "0.83.0" + "version": "0.83.0", + "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e" }