Skip to content

Commit

Permalink
Added ff for experiment (#2767)
Browse files Browse the repository at this point in the history
* added feature flag config

* added feature flag for experiment
  • Loading branch information
chitalian authored Oct 11, 2024
1 parent ab0b43d commit 29f3342
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions web/components/templates/prompts/id/promptIdPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ import { Button } from "../../../ui/button";
import ExperimentPanel from "./experimentPanel";
import { useUser } from "@supabase/auth-helpers-react";
import { IslandContainer } from "../../../ui/islandContainer";
import { useFeatureFlags } from "@/services/hooks/featureFlags";
import { useOrg } from "@/components/layout/organizationContext";

interface PromptIdPageProps {
id: string;
Expand Down Expand Up @@ -471,6 +473,13 @@ const PromptIdPage = (props: PromptIdPageProps) => {
promptVersionId: string,
promptData: string
) => {
if (!experimentFlags?.hasFlag) {
notification.setNotification(
"Experiment feature is not enabled - sign up for the waitlist to use it",
"error"
);
return;
}
const dataset = await jawn.POST("/v1/helicone-dataset", {
body: {
datasetName: "Dataset for Experiment",
Expand Down Expand Up @@ -617,6 +626,9 @@ const PromptIdPage = (props: PromptIdPageProps) => {
refetchPrompt();
};
const user = useUser();
const org = useOrg();

const experimentFlags = useFeatureFlags("experiment", org?.currentOrg.id);

return (
<IslandContainer>
Expand Down

0 comments on commit 29f3342

Please sign in to comment.