mirror of
https://github.com/outline/outline.git
synced 2026-11-22 05:51:43 +03:00
* chore: Move plugin-specific integration code into plugins Core no longer imports from or names the settings of individual plugins. Plugins now register mention providers, issue status icons, instance URLs, settings keys, settings and import schemas, and OAuth clients through hooks. * fix: Recompute embed instance URLs after plugins load and match legacy issue icons by URL * fix: Skip logo upload jobs queued without a settings path * chore: Choose issue status icons from the unfurl state
40 lines
1.2 KiB
TypeScript
40 lines
1.2 KiB
TypeScript
import type { IntegrationSettings, IntegrationType } from "@shared/types";
|
|
import { IntegrationService } from "@shared/types";
|
|
import { createLazyComponent } from "~/components/LazyLoad";
|
|
import { Hook, PluginManager } from "~/utils/PluginManager";
|
|
import config from "../plugin.json";
|
|
import { LinearUtils } from "../shared/LinearUtils";
|
|
import Icon from "./Icon";
|
|
|
|
PluginManager.add([
|
|
{
|
|
...config,
|
|
type: Hook.Settings,
|
|
value: {
|
|
group: "Integrations",
|
|
icon: Icon,
|
|
description:
|
|
"Connect your Linear account to Outline to enable rich, real-time issue previews inside documents.",
|
|
component: createLazyComponent(() => import("./Settings")),
|
|
},
|
|
},
|
|
{
|
|
...config,
|
|
type: Hook.MentionProvider,
|
|
value: {
|
|
service: IntegrationService.Linear,
|
|
isMentionable: (url, integration) => {
|
|
const settings =
|
|
integration.settings as IntegrationSettings<IntegrationType.Embed>;
|
|
|
|
// Ensure the installed workspace key matches the URL.
|
|
return (
|
|
url.hostname === "linear.app" &&
|
|
settings.linear?.workspace.key === url.pathname.split("/")[1]
|
|
);
|
|
},
|
|
mentionType: (url) => LinearUtils.mentionType(url),
|
|
},
|
|
},
|
|
]);
|