Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: Add document link to generate onedrive link #745

Merged
merged 1 commit into from
Dec 3, 2024
Merged
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
81 changes: 51 additions & 30 deletions ui/admin/app/components/knowledge/AddSourceModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,36 +85,57 @@ const AddSourceModal: FC<AddSourceModalProps> = ({
</DialogTitle>
<div className="mb-4">
{sourceType !== KnowledgeSourceType.Notion && (
<div className="w-full grid grid-cols-2 items-center justify-center gap-2 mb-8">
<Label
htmlFor="site"
className="block text-sm font-medium text-center"
>
{sourceType === KnowledgeSourceType.Website &&
"Site"}
{sourceType === KnowledgeSourceType.OneDrive &&
"Link URL"}
</Label>
<Input
id="site"
type="text"
value={
sourceType === KnowledgeSourceType.Website
? newWebsite
: newLink
}
onChange={(e) =>
sourceType === KnowledgeSourceType.Website
? setNewWebsite(e.target.value)
: setNewLink(e.target.value)
}
placeholder={
sourceType === KnowledgeSourceType.Website
? "Enter website URL"
: "Enter OneDrive folder link"
}
className="w-[250px] dark:bg-secondary"
/>
<div className="flex flex-col items-center justify-center mb-8">
<div className="w-full grid grid-cols-2 items-center justify-center gap-2">
<Label
htmlFor="site"
className="block text-sm font-medium text-center"
>
{sourceType ===
KnowledgeSourceType.Website && "Site"}
{sourceType ===
KnowledgeSourceType.OneDrive &&
"Link URL"}
</Label>
<Input
id="site"
type="text"
value={
sourceType ===
KnowledgeSourceType.Website
? newWebsite
: newLink
}
onChange={(e) =>
sourceType ===
KnowledgeSourceType.Website
? setNewWebsite(e.target.value)
: setNewLink(e.target.value)
}
placeholder={
sourceType ===
KnowledgeSourceType.Website
? "Enter website URL"
: "Enter OneDrive folder link"
}
className="w-[250px] dark:bg-secondary"
/>
</div>
{sourceType === KnowledgeSourceType.OneDrive && (
<p className="text-xs text-gray-500 mt-4">
For instructions on obtaining a OneDrive
link, see{" "}
<a
href="https://support.microsoft.com/en-us/office/share-onedrive-files-and-folders-9fcc2f7d-de0c-4cec-93b0-a82024800c07#ID0EDBJ=Share_with_%22Copy_link%22"
target="_blank"
rel="noopener noreferrer"
className="underline"
>
this document
</a>
.
</p>
)}
</div>
)}
<div className="flex justify-end gap-2">
Expand Down