Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: launch #61

Merged
merged 6 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions apps/nextjs/src/app/aila/[id]/download/DownloadView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,8 @@ import { useDownloadView } from "./useDownloadView";

type DownloadViewProps = Readonly<{
chat: AilaPersistedChat;
featureFlag: boolean;
}>;
export function DownloadView({
chat,
featureFlag,
}: Readonly<DownloadViewProps>) {
export function DownloadView({ chat }: Readonly<DownloadViewProps>) {
const { lessonPlan } = chat;
const {
lessonSlidesExport,
Expand All @@ -37,7 +33,7 @@ export function DownloadView({
const isLessonComplete = totalSectionsComplete >= totalSections;

return (
<Layout featureFlag={featureFlag}>
<Layout>
<DialogRoot>
<DialogContents
chatId={chat.id}
Expand Down
5 changes: 1 addition & 4 deletions apps/nextjs/src/app/aila/[id]/download/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { auth } from "@clerk/nextjs/server";
import { type Metadata } from "next";

import { getChatById } from "@/app/actions";
import { serverSideFeatureFlag } from "@/utils/serverSideFeatureFlag";

import { DownloadView } from "./DownloadView";

Expand Down Expand Up @@ -45,7 +44,5 @@ export default async function DownloadPage({
return notFound();
}

const featureFlag = await serverSideFeatureFlag("lesson-planning-assistant");

return <DownloadView chat={chat} featureFlag={featureFlag} />;
return <DownloadView chat={chat} />;
}
1 change: 0 additions & 1 deletion apps/nextjs/src/app/aila/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ export default function ChatPage({ params }: Readonly<ChatPageProps>) {
isShared={chat.isShared}
initialMessages={chat.messages}
initialLessonPlan={chat.lessonPlan}
featureFlag={true}
initialModerations={moderations ?? []}
startingMessage={chat.startingMessage}
/>
Expand Down
6 changes: 2 additions & 4 deletions apps/nextjs/src/app/aila/page-contents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { ChatProvider } from "@/components/ContextProviders/ChatProvider";
import LessonPlanTrackingProvider from "@/lib/analytics/lessonPlanTrackingContext";

const ChatPageContents = ({
featureFlag,
id,
isShared,
startingMessage,
Expand All @@ -24,11 +23,10 @@ const ChatPageContents = ({
initialLessonPlan?: object;
id: string;
isShared: boolean | undefined;
featureFlag: boolean;
initialModerations: Moderation[];
}) => {
return (
<Layout featureFlag={featureFlag}>
<Layout>
<LessonPlanTrackingProvider chatId={id}>
<ChatProvider
key={`chat-${id}`}
Expand All @@ -38,7 +36,7 @@ const ChatPageContents = ({
initialModerations={initialModerations}
startingMessage={startingMessage}
>
<Chat featureFlag={featureFlag} isShared={isShared} />
<Chat isShared={isShared} />
</ChatProvider>
</LessonPlanTrackingProvider>
</Layout>
Expand Down
16 changes: 3 additions & 13 deletions apps/nextjs/src/app/aila/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,20 @@ import { redirect } from "next/navigation";

import { ChatStart } from "@/components/AppComponents/Chat/chat-start";
import Layout from "@/components/AppComponents/Layout";
import { serverSideFeatureFlag } from "@/utils/serverSideFeatureFlag";

export default async function IndexPage() {
const userCanViewFeature = await serverSideFeatureFlag(
"lesson-planning-assistant",
);
const clerkAuthentication = auth();
const { userId }: { userId: string | null } = clerkAuthentication;
if (!userId) {
redirect(`/sign-in?next=/aila`);
}

if (!userCanViewFeature) {
redirect("/?redirect-reason=feature-flag-disabled");
}

return (
<>
<SignedIn>
{userCanViewFeature && (
<Layout featureFlag={userCanViewFeature}>
<ChatStart />
</Layout>
)}
<Layout>
<ChatStart />
</Layout>
</SignedIn>
<SignedOut></SignedOut>
</>
Expand Down
109 changes: 0 additions & 109 deletions apps/nextjs/src/app/comparative-judgement/index.tsx

This file was deleted.

9 changes: 0 additions & 9 deletions apps/nextjs/src/app/comparative-judgement/page.tsx

This file was deleted.

13 changes: 0 additions & 13 deletions apps/nextjs/src/app/comparative-judgement/preview/[slug]/page.tsx

This file was deleted.

This file was deleted.

4 changes: 2 additions & 2 deletions apps/nextjs/src/app/faqs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import GetInTouchBox from "@/components/AppComponents/GetInTouchBox";
import Layout from "@/components/Layout";
import { OakBoxCustomMaxWidth } from "@/components/OakBoxCustomMaxWidth";

const FAQPage = (featureFlag) => {
const FAQPage = () => {
const startingRef = useRef(null);
const featuresRef = useRef(null);
const supportRef = useRef(null);
Expand All @@ -36,7 +36,7 @@ const FAQPage = (featureFlag) => {
}
};
return (
<Layout featureFlag={featureFlag}>
<Layout>
<OakMaxWidth>
<OakFlex $justifyContent="space-between">
<OakBox $display={["none", "block"]}>
Expand Down
Loading
Loading