Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 17 additions & 5 deletions frontend/src/components/input-output/add-source/AddSource.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { getDefaultFormState } from "@rjsf/utils";
import validator from "@rjsf/validator-ajv8";
import { Typography } from "antd";
import PropTypes from "prop-types";
import { useEffect, useMemo, useState } from "react";
Expand Down Expand Up @@ -121,12 +123,22 @@ function AddSource({
axiosPrivate(requestOptions)
.then((res) => {
const data = res?.data;
setFormData(metadata || {});
const jsonSchema = isLLMWPaidSchema
? transformLlmWhispererJsonSchema(data?.json_schema || {})
: data?.json_schema || {};
Comment thread
kirtimanmishrazipstack marked this conversation as resolved.

if (isLLMWPaidSchema) {
setSpec(transformLlmWhispererJsonSchema(data?.json_schema || {}));
setSpec(jsonSchema);

if (metadata && Object.keys(metadata).length > 0) {
setFormData(metadata);
} else {
setSpec(data?.json_schema || {});
const defaults = getDefaultFormState(
validator,
jsonSchema,
{},
jsonSchema,
);
Comment thread
kirtimanmishrazipstack marked this conversation as resolved.
setFormData(defaults || {});
}

if (data?.oauth) {
Expand All @@ -142,7 +154,7 @@ function AddSource({
.finally(() => {
setIsLoading(false);
});
}, [selectedSourceId]);
}, [selectedSourceId, isLLMWPaidSchema]);

useEffect(() => {
if (editItemId?.length && metadata && Object.keys(metadata)?.length) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,11 @@ def _get_onedrive_drive(self, ctx: Any) -> Any:
if self.client_secret:
if not self.user_email:
error_msg = (
"OneDrive client credentials require user email. Provide either \n"
"- user_email (e.g., user@company.onmicrosoft.com) \n"
"- OR use OAuth with access_token instead."
"No Site URL provided. "
"To access a SharePoint site, provide the Site URL "
"(e.g., https://contoso.sharepoint.com/sites/mysite). "
"To access OneDrive, provide the User Email "
"(e.g., user@company.onmicrosoft.com)."
)
raise ConnectorError(
error_msg,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@
"default": "SharePoint / OneDrive Connector",
"description": "A friendly name to identify this connector"
},
"is_personal": {
"type": "boolean",
"title": "Personal Account",
"default": false,
"description": "Enable for OneDrive Personal (consumer Microsoft accounts). Leave disabled for SharePoint or OneDrive for Business (work/school accounts)."
},
"site_url": {
"type": "string",
"title": "Site URL",
Expand All @@ -27,7 +21,7 @@
},
"drive_id": {
"type": "string",
"title": "Drive ID (Optional)",
"title": "Drive ID",
"description": "Specific Drive/Document Library ID. Leave empty to use the default drive."
},
"auth_type": {
Expand Down