Skip to content
Closed
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
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ jobs:
MITOL_AXIOS_WITH_CREDENTIALS: true
CSRF_COOKIE_NAME: learn_csrftoken_ci
POSTHOG_API_HOST: https://app.posthog.com
POSTHOG_UI_HOST: https://us.posthog.com
POSTHOG_PROJECT_ID: fake-posthog-project-id
POSTHOG_API_KEY: fake-posthog-api-key
SENTRY_DSN: fake-sentry-dsn
Expand All @@ -173,6 +174,7 @@ jobs:
--build-arg NEXT_PUBLIC_MITOL_AXIOS_WITH_CREDENTIALS=$MITOL_AXIOS_WITH_CREDENTIALS \
--build-arg NEXT_PUBLIC_CSRF_COOKIE_NAME=$CSRF_COOKIE_NAME \
--build-arg NEXT_PUBLIC_POSTHOG_API_HOST=$POSTHOG_API_HOST \
--build-arg NEXT_PUBLIC_POSTHOG_UI_HOST=$POSTHOG_UI_HOST \
--build-arg NEXT_PUBLIC_POSTHOG_PROJECT_ID=$POSTHOG_PROJECT_ID \
--build-arg NEXT_PUBLIC_POSTHOG_API_KEY=$POSTHOG_API_KEY \
--build-arg NEXT_PUBLIC_SENTRY_DSN=$SENTRY_DSN \
Expand Down
7 changes: 7 additions & 0 deletions RELEASE.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Release Notes
=============

Version 0.56.8
--------------

- update mitxonline client (#3020)
- Set the posthog UI host (#3011)
- fix: remove feature flag on detail and listing page (#3003)

Version 0.56.6 (Released March 05, 2026)
--------------

Expand Down
1 change: 1 addition & 0 deletions env/app_vars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ echo "YOUTUBE_CONFIG_URL=https://raw.githubusercontent.com/mitodl/open-video-dat
echo "POSTHOG_ENABLED=True" >>.env
echo "POSTHOG_TIMEOUT_MS=1000" >>.env
echo "POSTHOG_API_HOST=https://app.posthog.com" >>.env
echo "POSTHOG_UI_HOST=https://us.posthog.com" >>.env
echo "POSTHOG_PROJECT_ID=63497" >>.env
echo >>.env
echo "# Heroku Interopelated Vars" >>.env
Expand Down
1 change: 1 addition & 0 deletions env/frontend.env
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ NEXT_PUBLIC_MITX_ONLINE_CSRF_COOKIE_NAME=csrf_mitxonline
NEXT_PUBLIC_MITOL_SUPPORT_EMAIL=${MITOL_SUPPORT_EMAIL}

NEXT_PUBLIC_POSTHOG_API_KEY=${POSTHOG_PROJECT_API_KEY}
NEXT_PUBLIC_POSTHOG_UI_HOST=${POSTHOG_UI_HOST}

NEXT_PUBLIC_SITE_NAME="MIT Learn"
NEXT_PUBLIC_MITOL_AXIOS_WITH_CREDENTIALS=true
Expand Down
2 changes: 1 addition & 1 deletion frontends/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"ol-test-utilities": "0.0.0"
},
"dependencies": {
"@mitodl/mitxonline-api-axios": "^2026.3.3",
"@mitodl/mitxonline-api-axios": "^2026.3.5",
"@tanstack/react-query": "^5.66.0",
"axios": "^1.12.2",
"tiny-invariant": "^1.3.3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ const courseEnrollment: PartialFactory<CourseRunEnrollmentRequestV2> = (
price: faker.commerce.price(),
description: faker.lorem.sentence(),
is_active: faker.datatype.boolean(),
product_flexible_price: null,
},
],
course: {
Expand Down
2 changes: 2 additions & 0 deletions frontends/main/Dockerfile.web
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ ENV NEXT_PUBLIC_CSRF_COOKIE_NAME=$NEXT_PUBLIC_CSRF_COOKIE_NAME

ARG NEXT_PUBLIC_POSTHOG_API_HOST
ENV NEXT_PUBLIC_POSTHOG_API_HOST=$NEXT_PUBLIC_POSTHOG_API_HOST
ARG NEXT_PUBLIC_POSTHOG_UI_HOST
ENV NEXT_PUBLIC_POSTHOG_UI_HOST=$NEXT_PUBLIC_POSTHOG_UI_HOST
ARG NEXT_PUBLIC_POSTHOG_PROJECT_ID
ENV NEXT_PUBLIC_POSTHOG_PROJECT_ID=$NEXT_PUBLIC_POSTHOG_PROJECT_ID
ARG NEXT_PUBLIC_POSTHOG_API_KEY
Expand Down
2 changes: 1 addition & 1 deletion frontends/main/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@emotion/styled": "^11.11.0",
"@floating-ui/react": "^0.27.16",
"@mitodl/course-search-utils": "^3.5.1",
"@mitodl/mitxonline-api-axios": "^2026.3.3",
"@mitodl/mitxonline-api-axios": "^2026.3.5",
"@mitodl/smoot-design": "^6.24.0",
"@mui/material": "^6.4.5",
"@mui/material-nextjs": "^6.4.3",
Expand Down
13 changes: 2 additions & 11 deletions frontends/main/src/app-pages/Articles/ArticleDetailPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ import { useArticleDetailRetrieve } from "api/hooks/articles"
import { LoadingSpinner, styled } from "ol-components"
import { ArticleEditor } from "@/page-components/TiptapEditor/ArticleEditor"
import { notFound } from "next/navigation"
import { useFeatureFlagEnabled } from "posthog-js/react"
import { FeatureFlags } from "@/common/feature_flags"
import { useFeatureFlagsLoaded } from "@/common/useFeatureFlagsLoaded"
import { LearningResourceProvider } from "@/page-components/TiptapEditor/extensions/node/LearningResource/LearningResourceDataProvider"

const PageContainer = styled.div({
Expand All @@ -31,21 +28,15 @@ export const ArticleDetailPage = ({
learningResourceIds?: number[]
}) => {
const { data: article, isLoading } = useArticleDetailRetrieve(articleId)
const showArticleDetail = useFeatureFlagEnabled(FeatureFlags.ArticleView)
const flagsLoaded = useFeatureFlagsLoaded()

/* Ensure queries are accessed during loading/flag check.
* This prevents React Query warnings about prefetched queries not being accessed.
* We can remove the early LearningResourceProvider when we remove the feature flag.
*/
if (isLoading || (!flagsLoaded && showArticleDetail === undefined)) {
if (isLoading) {
return (
<LearningResourceProvider resourceIds={learningResourceIds}>
<Spinner color="inherit" loading size={32} />
</LearningResourceProvider>
)
}
if (!showArticleDetail || !article) {
if (!article) {
return notFound()
}

Expand Down
26 changes: 1 addition & 25 deletions frontends/main/src/app-pages/Articles/ArticleListingPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,11 @@ import {
} from "ol-components"
import Link from "next/link"
import { RiArrowLeftLine, RiArrowRightLine } from "@remixicon/react"
import { useQueryClient } from "@tanstack/react-query"
import {
useNewsEventsList,
NewsEventsListFeedTypeEnum,
newsEventsKeys,
} from "api/hooks/newsEvents"
import type { NewsFeedItem } from "api/v0"
import { notFound } from "next/navigation"
import { useFeatureFlagEnabled } from "posthog-js/react"
import { FeatureFlags } from "@/common/feature_flags"
import { useFeatureFlagsLoaded } from "@/common/useFeatureFlagsLoaded"
import { LocalDate } from "ol-utilities"
import { linkifyText } from "@/common/utils"
import { ArticleBanner } from "./ArticleBanner"
Expand Down Expand Up @@ -212,6 +206,7 @@ const StoryCard = styled.div`
border-radius: 8px;
padding: 16px 16px 16px 24px;
overflow: hidden;
border: 1px solid transparent;

&:hover {
border-radius: 8px;
Expand Down Expand Up @@ -563,18 +558,6 @@ const ArticleListingPage: React.FC = () => {
const [searchParams, setSearchParams] = useSearchParams()
const page = parseInt(searchParams.get("page") ?? "1", 10)

const showArticleList = useFeatureFlagEnabled(FeatureFlags.ArticleView)
const queryClient = useQueryClient()

const flagsLoaded = useFeatureFlagsLoaded()

// Invalidate cache when feature flag changes
React.useEffect(() => {
if (showArticleList) {
queryClient.invalidateQueries({ queryKey: newsEventsKeys.listRoot() })
}
}, [showArticleList, queryClient])

const { data: news, isLoading } = useNewsEventsList({
feed_type: [NewsEventsListFeedTypeEnum.News],
limit: PAGE_SIZE,
Expand All @@ -590,13 +573,6 @@ const ArticleListingPage: React.FC = () => {
page === 1 && stories.length > 0 ? (stories[0] as NewsFeedItem) : null
const gridStories = page === 1 ? stories.slice(1) : stories

if (!flagsLoaded && showArticleList === undefined) {
return <LoadingSpinner loading={!flagsLoaded} />
}
if (!showArticleList) {
return notFound()
}

return (
<>
<ArticleBannerStyled
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,6 @@ describe.each([
price: faker.commerce.price(),
description: faker.lorem.sentence(),
is_active: true,
product_flexible_price: null,
},
],
}),
Expand All @@ -369,7 +368,6 @@ describe.each([
price: faker.commerce.price(),
description: faker.lorem.sentence(),
is_active: true,
product_flexible_price: null,
},
],
}),
Expand Down Expand Up @@ -438,7 +436,6 @@ describe.each([
price: faker.commerce.price(),
description: faker.lorem.sentence(),
is_active: true,
product_flexible_price: null,
},
],
})
Expand Down Expand Up @@ -485,7 +482,6 @@ describe.each([
price: certificateUpgradePrice,
description: faker.lorem.sentence(),
is_active: true,
product_flexible_price: null,
},
],
})
Expand Down Expand Up @@ -530,7 +526,6 @@ describe.each([
price: certificateUpgradePrice,
description: faker.lorem.sentence(),
is_active: true,
product_flexible_price: null,
},
],
})
Expand Down Expand Up @@ -599,7 +594,6 @@ describe.each([
price: faker.commerce.price(),
description: faker.lorem.sentence(),
is_active: true,
product_flexible_price: null,
},
],
})
Expand Down Expand Up @@ -655,7 +649,6 @@ describe.each([
price: faker.commerce.price(),
description: faker.lorem.sentence(),
is_active: true,
product_flexible_price: null,
},
],
})
Expand Down
28 changes: 10 additions & 18 deletions frontends/main/src/app-pages/HomePage/NewsEventsSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ import type { NewsFeedItem, EventFeedItem } from "api/v0"
import { LocalDate } from "ol-utilities"
import { RiArrowRightSLine } from "@remixicon/react"
import Link from "next/link"
import { FeatureFlags } from "@/common/feature_flags"
import { useFeatureFlagEnabled } from "posthog-js/react"

const Section = styled.section`
background: ${theme.custom.colors.white};
Expand Down Expand Up @@ -222,8 +220,6 @@ export const Story: React.FC<{ item: NewsFeedItem; mobile: boolean }> = ({
}

const NewsEventsSection: React.FC = () => {
const showArticleList = useFeatureFlagEnabled(FeatureFlags.ArticleView)

const { data: news } = useNewsEventsList({
feed_type: [NewsEventsListFeedTypeEnum.News],
limit: 6,
Expand Down Expand Up @@ -292,13 +288,11 @@ const NewsEventsSection: React.FC = () => {
/>
))}
</NewsSlider>
{showArticleList && (
<HeadingContainer>
<SeeAllButton href="/news/" size="large" responsive>
See all news
</SeeAllButton>
</HeadingContainer>
)}
<HeadingContainer>
<SeeAllButton href="/news/" size="large" responsive>
See all news
</SeeAllButton>
</HeadingContainer>
</MobileContainer>
<MobileContainer>
<Typography component="h3" variant="h4">
Expand Down Expand Up @@ -331,13 +325,11 @@ const NewsEventsSection: React.FC = () => {
</Grid2>
))}
</Grid2>
{showArticleList && (
<HeadingContainer>
<SeeAllButton href="/news/" size="large" responsive>
See all news
</SeeAllButton>
</HeadingContainer>
)}
<HeadingContainer>
<SeeAllButton href="/news/" size="large" responsive>
See all news
</SeeAllButton>
</HeadingContainer>
</NewsContainer>
<EventsContainer>
<Typography component="h3" variant="h4">
Expand Down
1 change: 0 additions & 1 deletion frontends/main/src/common/feature_flags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ export enum FeatureFlags {
EnrollmentDashboard = "enrollment-dashboard",
VideoShorts = "video-shorts",
MitxOnlineProductPages = "mitxonline-product-pages",
ArticleView = "article-viewer",
}

/**
Expand Down
19 changes: 4 additions & 15 deletions frontends/main/src/common/mitxonline.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type {
BaseProduct,
CourseRunV2,
EnrollmentMode,
ProductFlexiblePrice,
Expand Down Expand Up @@ -72,17 +73,6 @@ const formatPrice = (
})
}

/**
* Returns certificate price as formatted string, or null if upgrade not available
*/
const formatProductPrice = (
product: ProductFlexiblePrice,
{ avoidCents = false } = {},
) => {
const amount = getFlexiblePriceForProduct(product)
return formatPrice(amount, { avoidCents })
}

type PriceWithDiscount = {
isDiscounted: boolean
/**
Expand All @@ -98,13 +88,13 @@ const priceWithDiscount = ({
flexiblePrice,
avoidCents = false,
}: {
product: ProductFlexiblePrice
product: BaseProduct
flexiblePrice?: ProductFlexiblePrice
avoidCents?: boolean
}): PriceWithDiscount => {
const originalPrice = formatProductPrice(product, { avoidCents })
const originalPrice = formatPrice(product.price, { avoidCents })
const finalPrice = flexiblePrice
? formatProductPrice(flexiblePrice, { avoidCents })
? formatPrice(getFlexiblePriceForProduct(flexiblePrice), { avoidCents })
: originalPrice
const isDiscounted = originalPrice !== finalPrice

Expand Down Expand Up @@ -135,7 +125,6 @@ const getEnrollmentType = (

export {
formatPrice,
formatProductPrice,
priceWithDiscount,
canPurchaseRun,
upgradeRunUrl,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { INTERNAL_BOOTSTRAPPING_FLAG } from "@/common/feature_flags"

const POSTHOG_API_KEY = process.env.NEXT_PUBLIC_POSTHOG_API_KEY
const POSTHOG_API_HOST = process.env.NEXT_PUBLIC_POSTHOG_API_HOST
const POSTHOG_UI_HOST = process.env.NEXT_PUBLIC_POSTHOG_UI_HOST
const FEATURE_FLAGS = process.env.FEATURE_FLAGS

const PosthogIdentifier = () => {
Expand Down Expand Up @@ -41,6 +42,7 @@ const ConfiguredPostHogProvider: React.FC<{ children: React.ReactNode }> = ({
if (POSTHOG_API_KEY) {
posthog.init(POSTHOG_API_KEY, {
api_host: POSTHOG_API_HOST,
ui_host: POSTHOG_UI_HOST,
bootstrap: {
featureFlags: FEATURE_FLAGS
? {
Expand Down
1 change: 1 addition & 0 deletions frontends/main/validateEnv.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const schema = yup.object().shape({
NEXT_PUBLIC_POSTHOG_API_KEY: yup.string(),
NEXT_PUBLIC_POSTHOG_FEATURE_PREFIX: yup.string(),
NEXT_PUBLIC_POSTHOG_API_HOST: yup.string(),
NEXT_PUBLIC_POSTHOG_UI_HOST: yup.string(),
})

const validateEnv = () => schema.validateSync(process.env)
Expand Down
2 changes: 1 addition & 1 deletion main/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
from main.settings_pluggy import * # noqa: F403
from openapi.settings_spectacular import open_spectacular_settings

VERSION = "0.56.6"
VERSION = "0.56.8"

log = logging.getLogger()

Expand Down
Loading
Loading