mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-09-26 11:58:28 +02:00
Move is_public from Credential to ConnectorCredentialPair (#523)
This commit is contained in:
@@ -321,7 +321,8 @@ const Main = () => {
|
||||
| Credential<GoogleDriveCredentialJson>
|
||||
| undefined = credentialsData.find(
|
||||
(credential) =>
|
||||
credential.credential_json?.google_drive_tokens && credential.public_doc
|
||||
credential.credential_json?.google_drive_tokens &&
|
||||
credential.user_id === null
|
||||
);
|
||||
const googleDriveServiceAccountCredential:
|
||||
| Credential<GoogleDriveServiceAccountCredentialJson>
|
||||
|
@@ -152,7 +152,7 @@ function Main() {
|
||||
<ConnectorTitle
|
||||
ccPairName={connectorIndexingStatus.name}
|
||||
connector={connectorIndexingStatus.connector}
|
||||
isPublic={connectorIndexingStatus.credential.public_doc}
|
||||
isPublic={connectorIndexingStatus.public_doc}
|
||||
owner={connectorIndexingStatus.owner}
|
||||
/>
|
||||
),
|
||||
|
@@ -20,8 +20,9 @@ export const GoogleDriveCard = ({
|
||||
const existingCredential: Credential<GoogleDriveCredentialJson> | undefined =
|
||||
userCredentials?.find(
|
||||
(credential) =>
|
||||
// user_id is set => credential is not a public credential
|
||||
credential.credential_json?.google_drive_tokens !== undefined &&
|
||||
!credential.public_doc
|
||||
credential.user_id !== null
|
||||
);
|
||||
|
||||
const credentialIsLinked =
|
||||
|
@@ -57,7 +57,7 @@ export function CredentialForm<T extends Yup.AnyObject>({
|
||||
formikHelpers.setSubmitting(true);
|
||||
submitCredential<T>({
|
||||
credential_json: values,
|
||||
public_doc: true,
|
||||
is_admin: true,
|
||||
}).then(({ message, isSuccess }) => {
|
||||
setPopup({ message, type: isSuccess ? "success" : "error" });
|
||||
formikHelpers.setSubmitting(false);
|
||||
|
@@ -139,7 +139,7 @@ export interface ConnectorIndexingStatus<
|
||||
// CREDENTIALS
|
||||
export interface CredentialBase<T> {
|
||||
credential_json: T;
|
||||
public_doc: boolean;
|
||||
is_admin: boolean;
|
||||
}
|
||||
|
||||
export interface Credential<T> extends CredentialBase<T> {
|
||||
|
Reference in New Issue
Block a user