mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-09 07:42:39 +02:00
Revert "feat: implement Jira OAuth integration and connector routes"
This reverts commit bfed9a31f8.
This commit is contained in:
parent
bfed9a31f8
commit
f236110a08
14 changed files with 522 additions and 845 deletions
|
|
@ -1,6 +1,6 @@
|
|||
"use client";
|
||||
|
||||
import { Info, KeyRound } from "lucide-react";
|
||||
import { KeyRound } from "lucide-react";
|
||||
import type { FC } from "react";
|
||||
import { useEffect, useState } from "react";
|
||||
import { Input } from "@/components/ui/input";
|
||||
|
|
@ -12,9 +12,6 @@ export interface JiraConfigProps extends ConnectorConfigProps {
|
|||
}
|
||||
|
||||
export const JiraConfig: FC<JiraConfigProps> = ({ connector, onConfigChange, onNameChange }) => {
|
||||
// Check if this is an OAuth connector (has access_token or _token_encrypted flag)
|
||||
const isOAuth = !!(connector.config?.access_token || connector.config?._token_encrypted);
|
||||
|
||||
const [baseUrl, setBaseUrl] = useState<string>((connector.config?.JIRA_BASE_URL as string) || "");
|
||||
const [email, setEmail] = useState<string>((connector.config?.JIRA_EMAIL as string) || "");
|
||||
const [apiToken, setApiToken] = useState<string>(
|
||||
|
|
@ -22,18 +19,16 @@ export const JiraConfig: FC<JiraConfigProps> = ({ connector, onConfigChange, onN
|
|||
);
|
||||
const [name, setName] = useState<string>(connector.name || "");
|
||||
|
||||
// Update values when connector changes (only for legacy connectors)
|
||||
// Update values when connector changes
|
||||
useEffect(() => {
|
||||
if (!isOAuth) {
|
||||
const url = (connector.config?.JIRA_BASE_URL as string) || "";
|
||||
const emailVal = (connector.config?.JIRA_EMAIL as string) || "";
|
||||
const token = (connector.config?.JIRA_API_TOKEN as string) || "";
|
||||
setBaseUrl(url);
|
||||
setEmail(emailVal);
|
||||
setApiToken(token);
|
||||
}
|
||||
const url = (connector.config?.JIRA_BASE_URL as string) || "";
|
||||
const emailVal = (connector.config?.JIRA_EMAIL as string) || "";
|
||||
const token = (connector.config?.JIRA_API_TOKEN as string) || "";
|
||||
setBaseUrl(url);
|
||||
setEmail(emailVal);
|
||||
setApiToken(token);
|
||||
setName(connector.name || "");
|
||||
}, [connector.config, connector.name, isOAuth]);
|
||||
}, [connector.config, connector.name]);
|
||||
|
||||
const handleBaseUrlChange = (value: string) => {
|
||||
setBaseUrl(value);
|
||||
|
|
@ -72,34 +67,6 @@ export const JiraConfig: FC<JiraConfigProps> = ({ connector, onConfigChange, onN
|
|||
}
|
||||
};
|
||||
|
||||
// For OAuth connectors, show simple info message
|
||||
if (isOAuth) {
|
||||
const baseUrl = (connector.config?.base_url as string) || "Unknown";
|
||||
return (
|
||||
<div className="space-y-6">
|
||||
{/* OAuth Info */}
|
||||
<div className="rounded-xl border border-border bg-primary/5 p-4 flex items-start gap-3">
|
||||
<div className="flex h-8 w-8 items-center justify-center rounded-lg bg-primary/10 shrink-0 mt-0.5">
|
||||
<Info className="size-4" />
|
||||
</div>
|
||||
<div className="text-xs sm:text-sm">
|
||||
<p className="font-medium text-xs sm:text-sm">Connected via OAuth</p>
|
||||
<p className="text-muted-foreground mt-1 text-[10px] sm:text-sm">
|
||||
This connector is authenticated using OAuth 2.0. Your Jira instance is:
|
||||
</p>
|
||||
<p className="text-muted-foreground mt-1 text-[10px] sm:text-sm">
|
||||
<code className="bg-muted px-1 py-0.5 rounded text-[9px]">{baseUrl}</code>
|
||||
</p>
|
||||
<p className="text-muted-foreground mt-2 text-[10px] sm:text-sm">
|
||||
To update your connection, disconnect and reconnect through the OAuth flow.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
// For legacy API token connectors, show the form
|
||||
return (
|
||||
<div className="space-y-6">
|
||||
{/* Connector Name */}
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@ export const ConnectorConnectView: FC<ConnectorConnectViewProps> = ({
|
|||
CONFLUENCE_CONNECTOR: "confluence-connect-form",
|
||||
BOOKSTACK_CONNECTOR: "bookstack-connect-form",
|
||||
GITHUB_CONNECTOR: "github-connect-form",
|
||||
JIRA_CONNECTOR: "jira-connect-form",
|
||||
CLICKUP_CONNECTOR: "clickup-connect-form",
|
||||
LUMA_CONNECTOR: "luma-connect-form",
|
||||
CIRCLEBACK_CONNECTOR: "circleback-connect-form",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue