feat: remove onboarding's feature flag (#1501)

# Description

US: #1490
This commit is contained in:
Matthieu Jacq 2023-10-26 15:41:12 +02:00 committed by GitHub
parent c73529885f
commit 202daac77a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 23 deletions

View File

@ -1,5 +1,4 @@
"use client";
import { useFeatureIsOn } from "@growthbook/growthbook-react";
import { useTranslation } from "react-i18next";
import { PiPaperclipFill } from "react-icons/pi";
@ -23,11 +22,10 @@ export const ChatInput = ({
const { t } = useTranslation(["chat"]);
const { setShouldDisplayFeedCard } = useKnowledgeToFeedContext();
const shouldDisplayOnboarding = useFeatureIsOn("onboarding");
return (
<>
{shouldDisplayOnboarding && <OnboardingQuestions />}
{<OnboardingQuestions />}
<div className="flex mt-1 flex-col w-full shadow-md dark:shadow-primary/25 hover:shadow-xl transition-shadow rounded-xl bg-white dark:bg-black border border-black/10 dark:border-white/25 p-2">
<form
data-testid="chat-input-form"

View File

@ -1,6 +1,5 @@
import { useFeatureIsOn } from "@growthbook/growthbook-react";
import { useChatContext } from "@/lib/context";
import { useOnboarding } from "@/lib/hooks/useOnboarding";
import { ChatDialogue } from "./components/ChatDialogue";
import { ShortCuts } from "./components/ShortCuts";
@ -13,10 +12,9 @@ export const ChatDialogueArea = (): JSX.Element => {
messages,
notifications
);
const shouldDisplayOnboarding = useFeatureIsOn("onboarding");
const { isOnboarding } = useOnboarding();
const shouldDisplayShortcuts =
chatItems.length === 0 && !shouldDisplayOnboarding;
const shouldDisplayShortcuts = chatItems.length === 0 && !isOnboarding;
if (!shouldDisplayShortcuts) {
return <ChatDialogue chatItems={chatItems} />;

View File

@ -1,6 +1,4 @@
import { useFeatureIsOn } from "@growthbook/growthbook-react";
import Link from "next/link";
import { Fragment } from "react";
import { useTranslation } from "react-i18next";
import { RiDownloadLine } from "react-icons/ri";
@ -19,8 +17,6 @@ export const Onboarding = (): JSX.Element => {
const step2 = t("onboarding.step_2");
const step3 = t("onboarding.step_3");
const shouldStepBeDisplayed = useFeatureIsOn("onboarding");
const { trackOnboardingEvent } = useOnboardingTracker();
const { streamingText: titleStream, isDone: isTitleDisplayed } =
@ -49,10 +45,6 @@ export const Onboarding = (): JSX.Element => {
enabled: isStep2Done,
});
if (!shouldStepBeDisplayed) {
return <Fragment />;
}
return (
<div className="flex flex-col gap-2 mb-3">
<MessageRow speaker={"assistant"} brainName={"Quivr"}>

View File

@ -1,4 +1,3 @@
import { useFeatureIsOn } from "@growthbook/growthbook-react";
import { useQuery, useQueryClient } from "@tanstack/react-query";
import { useParams } from "next/navigation";
@ -9,7 +8,6 @@ import { Onboarding } from "../types/Onboarding";
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
export const useOnboarding = () => {
const isOnboardingFeatureActivated = useFeatureIsOn("onboarding");
const { getOnboarding } = useOnboardingApi();
const params = useParams();
const { updateOnboarding } = useOnboardingApi();
@ -38,13 +36,10 @@ export const useOnboarding = () => {
await queryClient.invalidateQueries({ queryKey: [ONBOARDING_DATA_KEY] });
};
const shouldDisplayWelcomeChat =
isOnboardingFeatureActivated && onboarding.onboarding_a;
const shouldDisplayWelcomeChat = onboarding.onboarding_a;
const shouldDisplayOnboardingAInstructions =
isOnboardingFeatureActivated &&
chatId === undefined &&
shouldDisplayWelcomeChat;
chatId === undefined && shouldDisplayWelcomeChat;
return {
onboarding,