mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-09-19 03:58:30 +02:00
Cleanup connector form (#2849)
* move "advanced options" to the bottom of the form and cleanup curator frontend * troll
This commit is contained in:
@@ -431,10 +431,8 @@ export default function AddConnector({
|
||||
config={configuration}
|
||||
setSelectedFiles={setSelectedFiles}
|
||||
selectedFiles={selectedFiles}
|
||||
connector={connector}
|
||||
/>
|
||||
|
||||
<AccessTypeForm connector={connector} />
|
||||
<AccessTypeGroupSelector />
|
||||
</Card>
|
||||
)}
|
||||
|
||||
|
@@ -10,12 +10,16 @@ import { TextFormField } from "@/components/admin/connectors/Field";
|
||||
import ListInput from "./ConnectorInput/ListInput";
|
||||
import FileInput from "./ConnectorInput/FileInput";
|
||||
import { AdvancedOptionsToggle } from "@/components/AdvancedOptionsToggle";
|
||||
import { AccessTypeForm } from "@/components/admin/connectors/AccessTypeForm";
|
||||
import { AccessTypeGroupSelector } from "@/components/admin/connectors/AccessTypeGroupSelector";
|
||||
import { ConfigurableSources } from "@/lib/types";
|
||||
|
||||
export interface DynamicConnectionFormProps {
|
||||
config: ConnectionConfiguration;
|
||||
selectedFiles: File[];
|
||||
setSelectedFiles: Dispatch<SetStateAction<File[]>>;
|
||||
values: any;
|
||||
connector: ConfigurableSources;
|
||||
}
|
||||
|
||||
const DynamicConnectionForm: FC<DynamicConnectionFormProps> = ({
|
||||
@@ -23,6 +27,7 @@ const DynamicConnectionForm: FC<DynamicConnectionFormProps> = ({
|
||||
selectedFiles,
|
||||
setSelectedFiles,
|
||||
values,
|
||||
connector,
|
||||
}) => {
|
||||
const [showAdvancedOptions, setShowAdvancedOptions] = useState(false);
|
||||
|
||||
@@ -96,6 +101,9 @@ const DynamicConnectionForm: FC<DynamicConnectionFormProps> = ({
|
||||
|
||||
{config.values.map((field) => !field.hidden && renderField(field))}
|
||||
|
||||
<AccessTypeForm connector={connector} />
|
||||
<AccessTypeGroupSelector />
|
||||
|
||||
{config.advanced_values.length > 0 && (
|
||||
<>
|
||||
<AdvancedOptionsToggle
|
||||
|
@@ -57,39 +57,30 @@ export function AccessTypeForm({
|
||||
|
||||
return (
|
||||
<>
|
||||
{isPaidEnterpriseEnabled && (
|
||||
{isPaidEnterpriseEnabled && isAdmin && (
|
||||
<>
|
||||
<div>
|
||||
<div className="flex gap-x-2 items-center">
|
||||
<label className="text-text-950 font-medium">
|
||||
Document Access
|
||||
</label>
|
||||
</div>
|
||||
<p className="text-sm text-text-500 mb-2">
|
||||
Control who has access to the documents indexed by this connector.
|
||||
</p>
|
||||
|
||||
{isAdmin && (
|
||||
<>
|
||||
<DefaultDropdown
|
||||
options={options}
|
||||
selected={access_type.value}
|
||||
onSelect={(selected) =>
|
||||
access_type_helpers.setValue(selected as AccessType)
|
||||
}
|
||||
includeDefault={false}
|
||||
/>
|
||||
|
||||
{access_type.value === "sync" && isAutoSyncSupported && (
|
||||
<div>
|
||||
<AutoSyncOptions
|
||||
connectorType={connector as ValidAutoSyncSources}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
<div className="flex gap-x-2 items-center">
|
||||
<label className="text-text-950 font-medium">Document Access</label>
|
||||
</div>
|
||||
<p className="text-sm text-text-500 mb-2">
|
||||
Control who has access to the documents indexed by this connector.
|
||||
</p>
|
||||
<DefaultDropdown
|
||||
options={options}
|
||||
selected={access_type.value}
|
||||
onSelect={(selected) =>
|
||||
access_type_helpers.setValue(selected as AccessType)
|
||||
}
|
||||
includeDefault={false}
|
||||
/>
|
||||
|
||||
{access_type.value === "sync" && isAutoSyncSupported && (
|
||||
<div>
|
||||
<AutoSyncOptions
|
||||
connectorType={connector as ValidAutoSyncSources}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
</>
|
||||
|
Reference in New Issue
Block a user