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
5 changes: 5 additions & 0 deletions RELEASE.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Release Notes
=============

Version 0.55.2
--------------

- fix: remove the articles route and its relevant code (#2974)

Version 0.55.1 (Released February 24, 2026)
--------------

Expand Down
12 changes: 12 additions & 0 deletions frontends/main/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,18 @@ const nextConfig = {
destination: "/enrollmentcode/:code",
permanent: true,
},
{
// can be removed once fastly redirect is in place
source: "/articles/:slug*",
destination: "/news/:slug*",
permanent: true,
},
{
// can be removed once fastly redirect is in place
source: "/articles",
destination: "/news",
permanent: true,
},
]
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ import {
LoadingSpinner,
Typography,
} from "ol-components"
import { Permission, useUserHasPermission } from "api/hooks/user"
import { Permission } from "api/hooks/user"
import { useArticleList } from "api/hooks/articles"
import type { RichTextArticle } from "api/v1"
import { LocalDate } from "ol-utilities"
import { RiArrowLeftLine, RiArrowRightLine } from "@remixicon/react"
import { ArticleBanner, DEFAULT_BACKGROUND_IMAGE_URL } from "./ArticleBanner"
import { extractFirstImageFromArticle } from "@/common/articleUtils"
import { notFound } from "next/navigation"
import { articlesDraftView, articlesView } from "@/common/urls"
import RestrictedRoute from "@/components/RestrictedRoute/RestrictedRoute"

const PAGE_SIZE = 20

Expand Down Expand Up @@ -109,8 +109,6 @@ const ArticleDraftPage: React.FC = () => {
draft: true, // Filter for drafts only on the backend
})

const isArticleEditor = useUserHasPermission(Permission.ArticleEditor)

useEffect(() => {
if (page > 1 && scrollRef.current) {
scrollRef.current.scrollIntoView({ behavior: "smooth", block: "start" })
Expand All @@ -120,11 +118,11 @@ const ArticleDraftPage: React.FC = () => {
const draftArticles = articles?.results
const totalPages = articles?.count ? Math.ceil(articles.count / PAGE_SIZE) : 0

if (!isLoadingArticles && !isArticleEditor) {
return notFound()
if (isLoadingArticles) {
return <LoadingSpinner loading={isLoadingArticles} />
}
return (
<>
<RestrictedRoute requires={Permission.ArticleEditor}>
<ArticleBanner
title="Draft Articles"
description="Manage your unpublished articles that are currently in draft status."
Expand Down Expand Up @@ -179,7 +177,7 @@ const ArticleDraftPage: React.FC = () => {
)}
</Container>
</PageWrapper>
</>
</RestrictedRoute>
)
}

Expand Down
95 changes: 0 additions & 95 deletions frontends/main/src/app/articles/[slugOrId]/page.tsx

This file was deleted.

15 changes: 0 additions & 15 deletions frontends/main/src/app/articles/new/page.tsx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ export const generateMetadata = async () => {
})
}

const Page: React.FC<PageProps<"/articles/[slugOrId]/draft">> = async (
props,
) => {
const Page: React.FC<PageProps<"/news/[slugOrId]/draft">> = async (props) => {
const { slugOrId } = await props.params

// No prefetching for draft articles - the client-side component
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const metadata: Metadata = standardizeMetadata({
robots: "noindex, nofollow",
})

const Page: React.FC<PageProps<"/articles/draft">> = () => {
const Page: React.FC<PageProps<"/news/draft">> = () => {
return <ArticleDraftPage />
}

Expand Down
2 changes: 1 addition & 1 deletion frontends/main/src/common/urls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const programLetterView = (id: string) =>
generatePath(PROGRAMLETTER_VIEW, { id: String(id) })
export const ARTICLES_LISTING = "/news/"
export const ARTICLES_VIEW = "/news/[id]"
export const ARTICLES_DRAFT_VIEW = "/articles/[id]/draft"
export const ARTICLES_DRAFT_VIEW = "/news/[id]/draft"
export const ARTICLES_EDIT = "/news/[id]/edit"
export const ARTICLES_CREATE = "/news/new"
export const articlesView = (id: string) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ const ArticleEditor = ({ onSave, readOnly, article }: ArticleEditorProps) => {
<Spacer />
<ButtonLink
variant="secondary"
href="/articles/draft"
href="/news/draft"
size="small"
>
Drafts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export const ArticleByLineInfoBarContent = ({
title={article?.title ?? ""}
anchorEl={shareButtonRef.current}
onClose={() => setShareOpen(false)}
pageUrl={`${NEXT_PUBLIC_ORIGIN}/articles/${article?.slug}`}
pageUrl={`${NEXT_PUBLIC_ORIGIN}/news/${article?.slug}`}
/>
<InnerContainer noAuthor={!displayAuthorName && !isEditable}>
{(displayAuthorName || isEditable) && (
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.55.1"
VERSION = "0.55.2"

log = logging.getLogger()

Expand Down
Loading