mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-09-18 19:43:26 +02:00
small linear connector improvements (#3929)
* small linear connector improvements * add todo for url handling
This commit is contained in:
@@ -91,6 +91,7 @@ class LinearConnector(LoadConnector, PollConnector, OAuthConnector):
|
||||
f"&response_type=code"
|
||||
f"&scope=read"
|
||||
f"&state={state}"
|
||||
f"&prompt=consent" # prompts user for access; allows choosing workspace
|
||||
)
|
||||
|
||||
@classmethod
|
||||
|
@@ -179,12 +179,10 @@ def oauth_callback(
|
||||
db_session=db_session,
|
||||
)
|
||||
|
||||
# TODO: use a library for url handling
|
||||
sep = "&" if "?" in desired_return_url else "?"
|
||||
return CallbackResponse(
|
||||
redirect_url=(
|
||||
f"{desired_return_url}?credentialId={credential.id}"
|
||||
if "?" not in desired_return_url
|
||||
else f"{desired_return_url}&credentialId={credential.id}"
|
||||
)
|
||||
redirect_url=f"{desired_return_url}{sep}credentialId={credential.id}"
|
||||
)
|
||||
|
||||
|
||||
|
@@ -18,7 +18,11 @@ import AdvancedFormPage from "./pages/Advanced";
|
||||
import DynamicConnectionForm from "./pages/DynamicConnectorCreationForm";
|
||||
import CreateCredential from "@/components/credentials/actions/CreateCredential";
|
||||
import ModifyCredential from "@/components/credentials/actions/ModifyCredential";
|
||||
import { ConfigurableSources, oauthSupportedSources } from "@/lib/types";
|
||||
import {
|
||||
ConfigurableSources,
|
||||
oauthSupportedSources,
|
||||
ValidSources,
|
||||
} from "@/lib/types";
|
||||
import {
|
||||
Credential,
|
||||
credentialTemplates,
|
||||
@@ -444,7 +448,7 @@ export default function AddConnector({
|
||||
<CardSection>
|
||||
<Title className="mb-2 text-lg">Select a credential</Title>
|
||||
|
||||
{connector == "gmail" ? (
|
||||
{connector == ValidSources.Gmail ? (
|
||||
<GmailMain />
|
||||
) : (
|
||||
<>
|
||||
|
@@ -772,7 +772,7 @@ For example, specifying .*-support.* as a "channel" will cause the connector to
|
||||
advanced_values: [],
|
||||
},
|
||||
linear: {
|
||||
description: "Configure Dropbox connector",
|
||||
description: "Configure Linear connector",
|
||||
values: [],
|
||||
advanced_values: [],
|
||||
},
|
||||
|
@@ -114,7 +114,7 @@ export interface LoopioCredentialJson {
|
||||
}
|
||||
|
||||
export interface LinearCredentialJson {
|
||||
linear_api_key: string;
|
||||
linear_access_token: string;
|
||||
}
|
||||
|
||||
export interface HubSpotCredentialJson {
|
||||
@@ -250,7 +250,7 @@ export const credentialTemplates: Record<ValidSources, any> = {
|
||||
gong_access_key_secret: "",
|
||||
} as GongCredentialJson,
|
||||
zulip: { zuliprc_content: "" } as ZulipCredentialJson,
|
||||
linear: { linear_api_key: "" } as LinearCredentialJson,
|
||||
linear: { linear_access_token: "" } as LinearCredentialJson,
|
||||
hubspot: { hubspot_access_token: "" } as HubSpotCredentialJson,
|
||||
document360: {
|
||||
portal_id: "",
|
||||
@@ -404,7 +404,7 @@ export const credentialDisplayNames: Record<string, string> = {
|
||||
loopio_client_token: "Loopio Client Token",
|
||||
|
||||
// Linear
|
||||
linear_api_key: "Linear API Key",
|
||||
linear_access_token: "Linear Access Token",
|
||||
|
||||
// HubSpot
|
||||
hubspot_access_token: "HubSpot Access Token",
|
||||
|
Reference in New Issue
Block a user