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