From b75d36a8c070c6fed11c178ac9da73abd45f57e6 Mon Sep 17 00:00:00 2001 From: Kamran Ahmed Date: Thu, 3 Apr 2025 17:41:46 +0100 Subject: [PATCH] Changes to the ai tutor URL --- src/components/Analytics/GoogleAd.astro | 2 +- .../AuthenticationFlow/GitHubButton.tsx | 2 +- .../AuthenticationFlow/GoogleButton.tsx | 10 +++------- .../AuthenticationFlow/LinkedInButton.tsx | 7 ++----- .../Dashboard/DashboardAiRoadmaps.tsx | 19 +++++-------------- .../Dashboard/ListDashboardCustomProgress.tsx | 11 +++-------- .../ExploreAIRoadmap/AIRoadmapsList.tsx | 2 +- .../ExploreAIRoadmap/EmptyRoadmaps.tsx | 2 +- src/components/GenerateCourse/AICourse.tsx | 2 +- .../GenerateCourse/AICourseActions.tsx | 2 +- .../GenerateCourse/AICourseCard.tsx | 2 +- .../GenerateCourse/AICourseContent.tsx | 6 +++--- .../GenerateCourse/GenerateAICourse.tsx | 2 +- src/components/GenerateCourse/GetAICourse.tsx | 2 +- .../GenerateRoadmap/GenerateRoadmap.tsx | 6 +++--- .../GenerateRoadmap/RoadmapSearch.tsx | 8 ++++---- .../GenerateRoadmap/RoadmapTopicDetail.tsx | 2 +- .../HeroSection/FavoriteRoadmaps.tsx | 10 ++++------ src/components/Navigation/Navigation.astro | 6 ++---- src/components/RoadmapAlert.tsx | 10 +++++----- .../RoadmapDropdownMenu.tsx | 6 +++--- .../changelogs/ai-tutor-cpp-java-roadmaps.md | 2 +- src/helper/generate-ai-course.ts | 2 +- src/layouts/BaseLayout.astro | 4 ++++ src/layouts/SkeletonLayout.astro | 1 + .../{ai => ai-roadmaps}/[aiRoadmapSlug].astro | 0 src/pages/{ai => ai-roadmaps}/explore.astro | 2 +- src/pages/ai-roadmaps/index.astro | 10 ++++++++++ src/pages/ai-tutor/index.astro | 17 ----------------- src/pages/{ai-tutor => ai}/[courseSlug].astro | 3 ++- src/pages/ai/index.astro | 14 +++++++++++--- src/pages/{ai-tutor => ai}/search.astro | 3 ++- 32 files changed, 80 insertions(+), 97 deletions(-) rename src/pages/{ai => ai-roadmaps}/[aiRoadmapSlug].astro (100%) rename src/pages/{ai => ai-roadmaps}/explore.astro (93%) create mode 100644 src/pages/ai-roadmaps/index.astro delete mode 100644 src/pages/ai-tutor/index.astro rename src/pages/{ai-tutor => ai}/[courseSlug].astro (89%) rename src/pages/{ai-tutor => ai}/search.astro (91%) diff --git a/src/components/Analytics/GoogleAd.astro b/src/components/Analytics/GoogleAd.astro index 34efd7927..a2ccae16f 100644 --- a/src/components/Analytics/GoogleAd.astro +++ b/src/components/Analytics/GoogleAd.astro @@ -10,8 +10,8 @@ 'roadmaps', 'community', 'start-here', + 'ai-roadmaps', 'ai', - 'ai-tutor', 'teams', 'about', 'account', diff --git a/src/components/AuthenticationFlow/GitHubButton.tsx b/src/components/AuthenticationFlow/GitHubButton.tsx index adba8132f..350b3807d 100644 --- a/src/components/AuthenticationFlow/GitHubButton.tsx +++ b/src/components/AuthenticationFlow/GitHubButton.tsx @@ -127,7 +127,7 @@ export function GitHubButton(props: GitHubButtonProps) { // For non authentication pages, we want to redirect back to the page // the user was on before they clicked the social login button if (!['/login', '/signup'].includes(window.location.pathname)) { - const pagePath = ['/respond-invite', '/befriend', '/r', '/ai'].includes( + const pagePath = ['/respond-invite', '/befriend', '/r', '/ai-roadmaps'].includes( window.location.pathname, ) ? window.location.pathname + window.location.search diff --git a/src/components/AuthenticationFlow/GoogleButton.tsx b/src/components/AuthenticationFlow/GoogleButton.tsx index 8655f68dd..cdd51a4fb 100644 --- a/src/components/AuthenticationFlow/GoogleButton.tsx +++ b/src/components/AuthenticationFlow/GoogleButton.tsx @@ -1,9 +1,6 @@ import { useEffect, useState } from 'react'; -import Cookies from 'js-cookie'; import { - FIRST_LOGIN_PARAM, - TOKEN_COOKIE_NAME, - setAuthToken, + FIRST_LOGIN_PARAM, setAuthToken } from '../../lib/jwt'; import { httpGet } from '../../lib/http'; import { COURSE_PURCHASE_PARAM } from '../../lib/jwt'; @@ -11,8 +8,7 @@ import { GoogleIcon } from '../ReactIcons/GoogleIcon.tsx'; import { Spinner } from '../ReactIcons/Spinner.tsx'; import { CHECKOUT_AFTER_LOGIN_KEY } from './CourseLoginPopup.tsx'; import { - getStoredUtmParams, - triggerUtmRegistration, + triggerUtmRegistration } from '../../lib/browser.ts'; import { cn } from '../../lib/classname.ts'; @@ -132,7 +128,7 @@ export function GoogleButton(props: GoogleButtonProps) { '/respond-invite', '/befriend', '/r', - '/ai', + '/ai-roadmaps', ].includes(window.location.pathname) ? window.location.pathname + window.location.search : window.location.pathname; diff --git a/src/components/AuthenticationFlow/LinkedInButton.tsx b/src/components/AuthenticationFlow/LinkedInButton.tsx index 6447f3e7d..b665c249e 100644 --- a/src/components/AuthenticationFlow/LinkedInButton.tsx +++ b/src/components/AuthenticationFlow/LinkedInButton.tsx @@ -1,10 +1,7 @@ import { useEffect, useState } from 'react'; -import Cookies from 'js-cookie'; import { FIRST_LOGIN_PARAM, - COURSE_PURCHASE_PARAM, - TOKEN_COOKIE_NAME, - setAuthToken, + COURSE_PURCHASE_PARAM, setAuthToken } from '../../lib/jwt'; import { cn } from '../../lib/classname.ts'; import { httpGet } from '../../lib/http'; @@ -131,7 +128,7 @@ export function LinkedInButton(props: LinkedInButtonProps) { '/respond-invite', '/befriend', '/r', - '/ai', + '/ai-roadmaps', ].includes(window.location.pathname) ? window.location.pathname + window.location.search : window.location.pathname; diff --git a/src/components/Dashboard/DashboardAiRoadmaps.tsx b/src/components/Dashboard/DashboardAiRoadmaps.tsx index bcc6ca597..45e183266 100644 --- a/src/components/Dashboard/DashboardAiRoadmaps.tsx +++ b/src/components/Dashboard/DashboardAiRoadmaps.tsx @@ -1,15 +1,6 @@ -import type { UserProgress } from '../TeamProgress/TeamProgressPage'; -import { DashboardCustomProgressCard } from './DashboardCustomProgressCard'; import { DashboardCardLink } from './DashboardCardLink'; -import { useState } from 'react'; -import { CreateRoadmapModal } from '../CustomRoadmap/CreateRoadmap/CreateRoadmapModal'; -import { Simulate } from 'react-dom/test-utils'; import { - ArrowUpRight, - Bot, - BrainCircuit, - Map, - PencilRuler, + BrainCircuit } from 'lucide-react'; type DashboardAiRoadmapsProps = { @@ -30,7 +21,7 @@ export function DashboardAiRoadmaps(props: DashboardAiRoadmapsProps) {

My AI Roadmaps

AI Generated Roadmaps @@ -41,7 +32,7 @@ export function DashboardAiRoadmaps(props: DashboardAiRoadmapsProps) { @@ -61,7 +52,7 @@ export function DashboardAiRoadmaps(props: DashboardAiRoadmapsProps) { {roadmaps.map((roadmap) => ( {roadmap.title} @@ -70,7 +61,7 @@ export function DashboardAiRoadmaps(props: DashboardAiRoadmapsProps) { + Generate New diff --git a/src/components/Dashboard/ListDashboardCustomProgress.tsx b/src/components/Dashboard/ListDashboardCustomProgress.tsx index 67febd891..f73c3fe5e 100644 --- a/src/components/Dashboard/ListDashboardCustomProgress.tsx +++ b/src/components/Dashboard/ListDashboardCustomProgress.tsx @@ -3,13 +3,8 @@ import { DashboardCustomProgressCard } from './DashboardCustomProgressCard'; import { DashboardCardLink } from './DashboardCardLink'; import { useState } from 'react'; import { CreateRoadmapModal } from '../CustomRoadmap/CreateRoadmap/CreateRoadmapModal'; -import { Simulate } from 'react-dom/test-utils'; import { - ArrowUpRight, - Bot, - BrainCircuit, - Map, - PencilRuler, + BrainCircuit, PencilRuler } from 'lucide-react'; type ListDashboardCustomProgressProps = { @@ -63,7 +58,7 @@ export function ListDashboardCustomProgress( @@ -99,7 +94,7 @@ export function ListDashboardCustomProgress( { if (!isAIGeneratedRoadmaps) { e.preventDefault(); diff --git a/src/components/ExploreAIRoadmap/AIRoadmapsList.tsx b/src/components/ExploreAIRoadmap/AIRoadmapsList.tsx index 7129410e6..a376c873c 100644 --- a/src/components/ExploreAIRoadmap/AIRoadmapsList.tsx +++ b/src/components/ExploreAIRoadmap/AIRoadmapsList.tsx @@ -26,7 +26,7 @@ export function AIRoadmapsList(props: AIRoadmapsListProps) { return (