Skip to content
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
20 changes: 20 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,26 @@ jobs:
with:
file: ./coverage.xml

build-nextjs-frontend:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4

- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4
with:
node-version: "^20"
cache: yarn
cache-dependency-path: yarn.lock

- name: Install dependencies
run: yarn install

- name: Build Next.js frontend
run: yarn workspace main build

javascript-tests:
if: false #TODO
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
Expand Down Expand Up @@ -145,6 +164,7 @@ jobs:
file: coverage/lcov.info

build-storybook:
if: false #TODO
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down
1 change: 0 additions & 1 deletion frontends/main/.env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
NEXT_PUBLIC_ORIGIN=http://open.odl.local:8062
NEXT_PUBLIC_MITOL_API_BASE_URL=http://open.odl.local:8063
MITOL_API_BASE_URL=http://open.odl.local:8063

NEXT_PUBLIC_PUBLIC_URL=/
NEXT_PUBLIC_SITE_NAME=MIT Learn
Expand Down
6 changes: 6 additions & 0 deletions frontends/main/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,12 @@ const nextConfig = {
port: "",
pathname: "**",
},
{
protocol: "https",
hostname: "xpro-app-rc.s3.amazonaws.com",
port: "",
pathname: "**",
},
],
},
}
Expand Down
2 changes: 1 addition & 1 deletion frontends/main/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"dev": "PORT=${PORT:-8062} next dev",
"build": "next build",
"build:no-lint": "next build --no-lint",
"start": "next start",
Expand Down
77 changes: 39 additions & 38 deletions frontends/main/src/app-pages/DashboardPage/DashboardPage.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client"

import React from "react"
import React, { Suspense } from "react"
import {
RiAccountCircleFill,
RiDashboardLine,
Expand Down Expand Up @@ -43,7 +43,6 @@ import UserListDetailsTab from "./UserListDetailsTab"
import { SettingsPage } from "./SettingsPage"
import { DASHBOARD_HOME, MY_LISTS, PROFILE, SETTINGS } from "@/common/urls"
import LearningResourceDrawer from "@/page-components/LearningResourceDrawer/LearningResourceDrawer"
// import MetaTags from "@/page-components/MetaTags/MetaTags"

/**
*
Expand Down Expand Up @@ -441,52 +440,54 @@ const DashboardPage: React.FC = () => {
</ButtonLink>
</HomeHeaderRight>
</HomeHeader>
<StyledResourceCarousel
titleComponent="h2"
title="Top picks for you"
isLoading={isLoadingProfile}
config={TopPicksCarouselConfig(profile)}
data-testid="top-picks-carousel"
/>
{topics?.map((topic, index) => (
<Suspense>
<StyledResourceCarousel
key={index}
titleComponent="h2"
title={`Popular courses in ${topic}`}
title="Top picks for you"
isLoading={isLoadingProfile}
config={TopicCarouselConfig(topic)}
data-testid={`topic-carousel-${topic}`}
config={TopPicksCarouselConfig(profile)}
data-testid="top-picks-carousel"
/>
))}
{certification === true ? (
{topics?.map((topic, index) => (
<StyledResourceCarousel
key={index}
titleComponent="h2"
title={`Popular courses in ${topic}`}
isLoading={isLoadingProfile}
config={TopicCarouselConfig(topic)}
data-testid={`topic-carousel-${topic}`}
/>
))}
{certification === true ? (
<StyledResourceCarousel
titleComponent="h2"
title="Courses with Certificates"
isLoading={isLoadingProfile}
config={CERTIFICATE_COURSES_CAROUSEL}
data-testid="certification-carousel"
/>
) : (
<StyledResourceCarousel
titleComponent="h2"
title="Free courses"
isLoading={isLoadingProfile}
config={FREE_COURSES_CAROUSEL}
data-testid="free-carousel"
/>
)}
<StyledResourceCarousel
titleComponent="h2"
title="Courses with Certificates"
isLoading={isLoadingProfile}
config={CERTIFICATE_COURSES_CAROUSEL}
data-testid="certification-carousel"
title="New"
config={NEW_LEARNING_RESOURCES_CAROUSEL}
data-testid="new-learning-resources-carousel"
/>
) : (
<StyledResourceCarousel
titleComponent="h2"
title="Free courses"
isLoading={isLoadingProfile}
config={FREE_COURSES_CAROUSEL}
data-testid="free-carousel"
title="Popular"
config={POPULAR_LEARNING_RESOURCES_CAROUSEL}
data-testid="popular-learning-resources-carousel"
/>
)}
<StyledResourceCarousel
titleComponent="h2"
title="New"
config={NEW_LEARNING_RESOURCES_CAROUSEL}
data-testid="new-learning-resources-carousel"
/>
<StyledResourceCarousel
titleComponent="h2"
title="Popular"
config={POPULAR_LEARNING_RESOURCES_CAROUSEL}
data-testid="popular-learning-resources-carousel"
/>
</Suspense>
</TabPanelStyled>
<TabPanelStyled value={MY_LISTS}>
<UserListListingComponent title="My Lists" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client"

import React from "react"
import { styled } from "ol-components"
import { useProgramLettersDetail } from "api/hooks/programLetters"
Expand Down
10 changes: 0 additions & 10 deletions frontends/main/src/app/c/[channelType]/[name]/ClientWrapper.tsx

This file was deleted.

4 changes: 2 additions & 2 deletions frontends/main/src/app/c/[channelType]/[name]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from "react"
import PageWrapper from "./ClientWrapper"
import ChannelPage from "@/app-pages/ChannelPage/ChannelPage"

const Page: React.FC = () => {
return <PageWrapper />
return <ChannelPage />
}

export default Page
16 changes: 0 additions & 16 deletions frontends/main/src/app/dashboard/ClientWrapper.tsx

This file was deleted.

16 changes: 0 additions & 16 deletions frontends/main/src/app/dashboard/[tab]/ClientWrapper.tsx

This file was deleted.

16 changes: 0 additions & 16 deletions frontends/main/src/app/dashboard/[tab]/[id]/ClientWrapper.tsx

This file was deleted.

4 changes: 2 additions & 2 deletions frontends/main/src/app/dashboard/[tab]/[id]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from "react"
import PageWrapper from "./ClientWrapper"
import DashboardPage from "@/app-pages/DashboardPage/DashboardPage"

const Page: React.FC = () => {
return <PageWrapper />
return <DashboardPage />
}

export default Page
4 changes: 2 additions & 2 deletions frontends/main/src/app/dashboard/[tab]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from "react"
import PageWrapper from "./ClientWrapper"
import DashboardPage from "@/app-pages/DashboardPage/DashboardPage"

const Page: React.FC = () => {
return <PageWrapper />
return <DashboardPage />
}

export default Page
4 changes: 2 additions & 2 deletions frontends/main/src/app/dashboard/page.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import React from "react"
import { Metadata } from "next"
import { getMetadata } from "@/common/metadata"
import PageWrapper from "./ClientWrapper"
import DashboardPage from "@/app-pages/DashboardPage/DashboardPage"

export const metadata: Metadata = getMetadata({
title: "Your MIT Learning Journey",
social: false,
})

const Page: React.FC = () => {
return <PageWrapper />
return <DashboardPage />
}

export default Page
16 changes: 0 additions & 16 deletions frontends/main/src/app/learningpaths/[id]/ClientWrapper.tsx

This file was deleted.

4 changes: 2 additions & 2 deletions frontends/main/src/app/learningpaths/[id]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from "react"
import PageWrapper from "./ClientWrapper"
import LearningPathDetailsPage from "@/app-pages/LearningPathDetailsPage/LearningPathDetailsPage"

const Page: React.FC = () => {
return <PageWrapper />
return <LearningPathDetailsPage />
}

export default Page
16 changes: 0 additions & 16 deletions frontends/main/src/app/onboarding/ClientWrapper.tsx

This file was deleted.

4 changes: 2 additions & 2 deletions frontends/main/src/app/onboarding/page.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import React from "react"
import { Metadata } from "next"
import { getMetadata } from "@/common/metadata"
import PageWrapper from "./ClientWrapper"
import OnboardingPage from "@/app-pages/OnboardingPage/OnboardingPage"

export const metadata: Metadata = getMetadata({
title: "Onboarding",
social: false,
})

const Page: React.FC = () => {
return <PageWrapper />
return <OnboardingPage />
}

export default Page
16 changes: 0 additions & 16 deletions frontends/main/src/app/program_letter/[id]/view/ClientWrapper.tsx

This file was deleted.

4 changes: 2 additions & 2 deletions frontends/main/src/app/program_letter/[id]/view/page.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from "react"
import PageWrapper from "./ClientWrapper"
import ProgramLetterPage from "@/app-pages/ProgramLetterPage/ProgramLetterPage"

const Page: React.FC = () => {
return <PageWrapper />
return <ProgramLetterPage />
}

export default Page
2 changes: 1 addition & 1 deletion frontends/main/src/app/providers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import React from "react"
import getQueryClient from "./getQueryClient"
import { QueryClientProvider } from "api/ssr"
import { ThemeProvider, NextJsAppRouterCacheProvider } from "ol-components"
import { Provider as NiceModalProvider } from "@/libraries/@ebay/nice-modal-react"
import { Provider as NiceModalProvider } from "@ebay/nice-modal-react"

export default function Providers({ children }: { children: React.ReactNode }) {
const queryClient = getQueryClient()
Expand Down
Loading