Skip to content

Commit 15d2677

Browse files
committed
use flag imports in gen-ai feature flag hooks
1 parent 828cf76 commit 15d2677

4 files changed

Lines changed: 8 additions & 4 deletions

File tree

packages/gen-ai/frontend/src/app/Chatbot/components/settingsPanelTabs/PromptTabContent.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import PromptAssistantFormGroup from '~/app/Chatbot/components/PromptAssistantFo
88
import { usePlaygroundStore } from '~/app/Chatbot/store/usePlaygroundStore';
99
import { useConfirmation } from '~/app/Chatbot/hooks/useConfirmation';
1010
import { usePromptEdited } from '~/app/Chatbot/hooks/usePromptEdited';
11+
import { PROMPT_MANAGEMENT } from '~/odh/extensions';
1112

1213
interface PromptTabContentProps {
1314
systemInstruction: string;
@@ -19,7 +20,7 @@ function PromptTabContent({
1920
onSystemInstructionChange,
2021
}: PromptTabContentProps): React.ReactNode {
2122
const { openModal } = usePlaygroundStore();
22-
const [promptManagementEnabled] = useFeatureFlag('promptManagement');
23+
const [promptManagementEnabled] = useFeatureFlag(PROMPT_MANAGEMENT);
2324
const isEdited = usePromptEdited();
2425
const { confirm, modal: confirmationModal } = useConfirmation(isEdited);
2526

packages/gen-ai/frontend/src/app/Chatbot/hooks/useGuardrailsEnabled.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { useFeatureFlag } from '@openshift/dynamic-plugin-sdk';
2+
import { GUARDRAILS } from '~/odh/extensions';
23

34
const useGuardrailsEnabled = (): boolean => {
4-
const [guardrailsEnabled] = useFeatureFlag('guardrails');
5+
const [guardrailsEnabled] = useFeatureFlag(GUARDRAILS);
56
return guardrailsEnabled;
67
};
78

packages/gen-ai/frontend/src/app/hooks/useAiAssetCustomEndpointsEnabled.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { useFeatureFlag } from '@openshift/dynamic-plugin-sdk';
2+
import { AI_ASSET_CUSTOM_ENDPOINTS } from '~/odh/extensions';
23

34
const useAiAssetCustomEndpointsEnabled = (): boolean => {
4-
const [aiAssetCustomEndpointsEnabled] = useFeatureFlag('aiAssetCustomEndpoints');
5+
const [aiAssetCustomEndpointsEnabled] = useFeatureFlag(AI_ASSET_CUSTOM_ENDPOINTS);
56
return aiAssetCustomEndpointsEnabled;
67
};
78

packages/gen-ai/frontend/src/app/hooks/useAiAssetModelAsServiceEnabled.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { useFeatureFlag } from '@openshift/dynamic-plugin-sdk';
2+
import { MODEL_AS_SERVICE_CAMEL } from '~/odh/extensions';
23

34
const useAiAssetModelAsServiceEnabled = (): boolean => {
4-
const [modelAsServiceEnabled] = useFeatureFlag('modelAsService');
5+
const [modelAsServiceEnabled] = useFeatureFlag(MODEL_AS_SERVICE_CAMEL);
56
return modelAsServiceEnabled;
67
};
78

0 commit comments

Comments
 (0)