Skip to content

Commit 7b2a4ca

Browse files
committed
Improve the enterprise edition check logic
1 parent 9349c4b commit 7b2a4ca

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

packages/react-ui/src/app/features/ai/ai-settings-form.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { flagsHooks } from '@/app/common/hooks/flags-hooks';
12
import {
23
aiFormSchemaResolver,
34
AiSettingsFormSchema,
@@ -16,7 +17,7 @@ import {
1617
Label,
1718
Switch,
1819
} from '@openops/components/ui';
19-
import { AiConfig } from '@openops/shared';
20+
import { AiConfig, FlagId, OpsEdition } from '@openops/shared';
2021
import equal from 'fast-deep-equal';
2122
import { t } from 'i18next';
2223
import { CircleCheck } from 'lucide-react';
@@ -42,7 +43,8 @@ const AiSettingsForm = ({
4243
isSaving,
4344
}: AiSettingsFormProps) => {
4445
const assistantName = useAssistantName();
45-
const isEnterprise = assistantName === t('OpenOps Agent');
46+
const edition = flagsHooks.useFlag<OpsEdition>(FlagId.EDITION).data;
47+
const isEnterprise = edition !== OpsEdition.COMMUNITY;
4648

4749
const form = useForm<AiSettingsFormSchema>({
4850
resolver: aiFormSchemaResolver,
@@ -92,13 +94,13 @@ const AiSettingsForm = ({
9294
? t(
9395
'Enables {assistantName} and other AI-powered features such as the CLI command generation and chat interfaces.',
9496
{
95-
assistantName: assistantName,
97+
assistantName,
9698
},
9799
)
98100
: t(
99101
'Enables {assistantName} and other AI-powered features such as the CLI command generation.',
100102
{
101-
assistantName: assistantName,
103+
assistantName,
102104
},
103105
);
104106

0 commit comments

Comments
 (0)