mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-07-01 02:00:48 +02:00
fix: Remove advanced options toggle if enterprise features are not enabled (#4489)
* Only show advanced options for custom llm providers *if* the paid features are enabled * Change variable name
This commit is contained in:
@ -26,6 +26,7 @@ import { PopupSpec } from "@/components/admin/connectors/Popup";
|
|||||||
import * as Yup from "yup";
|
import * as Yup from "yup";
|
||||||
import isEqual from "lodash/isEqual";
|
import isEqual from "lodash/isEqual";
|
||||||
import { IsPublicGroupSelector } from "@/components/IsPublicGroupSelector";
|
import { IsPublicGroupSelector } from "@/components/IsPublicGroupSelector";
|
||||||
|
import { usePaidEnterpriseFeaturesEnabled } from "@/components/settings/usePaidEnterpriseFeaturesEnabled";
|
||||||
|
|
||||||
function customConfigProcessing(customConfigsList: [string, string][]) {
|
function customConfigProcessing(customConfigsList: [string, string][]) {
|
||||||
const customConfig: { [key: string]: string } = {};
|
const customConfig: { [key: string]: string } = {};
|
||||||
@ -91,6 +92,8 @@ export function CustomLLMProviderUpdateForm({
|
|||||||
deployment_name: Yup.string().nullable(),
|
deployment_name: Yup.string().nullable(),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const arePaidEnterpriseFeaturesEnabled = usePaidEnterpriseFeaturesEnabled();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Formik
|
<Formik
|
||||||
initialValues={initialValues}
|
initialValues={initialValues}
|
||||||
@ -422,8 +425,9 @@ export function CustomLLMProviderUpdateForm({
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
{arePaidEnterpriseFeaturesEnabled && (
|
||||||
|
<>
|
||||||
<Separator />
|
<Separator />
|
||||||
|
|
||||||
<AdvancedOptionsToggle
|
<AdvancedOptionsToggle
|
||||||
showAdvancedOptions={showAdvancedOptions}
|
showAdvancedOptions={showAdvancedOptions}
|
||||||
setShowAdvancedOptions={setShowAdvancedOptions}
|
setShowAdvancedOptions={setShowAdvancedOptions}
|
||||||
@ -437,6 +441,8 @@ export function CustomLLMProviderUpdateForm({
|
|||||||
enforceGroupSelection={true}
|
enforceGroupSelection={true}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
{/* NOTE: this is above the test button to make sure it's visible */}
|
{/* NOTE: this is above the test button to make sure it's visible */}
|
||||||
|
Reference in New Issue
Block a user