Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
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 RELEASE.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
Release Notes
=============

Version 0.47.13
---------------

- making sure ingestion succeeds even without xml (#2704)
- Ab/hybrid search (#2663)
- replacing underscore with dashes for bootstrap featureflags (#2703)
- add error message for enrollment code issues (#2685)
- Fix hydration error, remove prefetch helper (#2697)
- rename views cache (#2700)
- more dashboard CTA adjustments (#2701)
- Ensure re-indexing and re-embedding operations include all non-course learning resource types (#2695)
- Article editor refactor for reuse and layout updates (#2699)
- feat: incorporating the tiptap in articles CRUD operations (#2693)
- fix(deps): update dependency litellm to v1.79.3 (#2618)
- limit offered by facet to specific offerors (#2692)
- chore(deps): update dependency ruff to v0.14.4 (#2666)
- Avoid n+1 queries on video.playlists serializer field (#2662)
- chore(deps): update nginx docker tag to v1.29.3 (#2667)
- fix(deps): update dependency django to v4.2.26 [security] (#2678)

Version 0.47.12 (Released November 17, 2025)
---------------

Expand Down
8 changes: 4 additions & 4 deletions articles/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from articles.models import Article
from articles.serializers import RichTextArticleSerializer
from main.constants import VALID_HTTP_METHODS
from main.utils import cache_page_for_all_users, clear_search_cache
from main.utils import cache_page_for_all_users, clear_views_cache

# Create your views here.

Expand Down Expand Up @@ -43,16 +43,16 @@ class ArticleViewSet(viewsets.ModelViewSet):

@method_decorator(
cache_page_for_all_users(
settings.SEARCH_PAGE_CACHE_DURATION, cache="redis", key_prefix="search"
settings.REDIS_VIEW_CACHE_DURATION, cache="redis", key_prefix="articles"
)
)
def list(self, request, *args, **kwargs):
return super().list(request, *args, **kwargs)

def create(self, request, *args, **kwargs):
clear_search_cache()
clear_views_cache()
return super().create(request, *args, **kwargs)

def destroy(self, request, *args, **kwargs):
clear_search_cache()
clear_views_cache()
return super().destroy(request, *args, **kwargs)
2 changes: 1 addition & 1 deletion channels/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def get_queryset(self):

@method_decorator(
cache_page_for_all_users(
settings.SEARCH_PAGE_CACHE_DURATION, cache="redis", key_prefix="search"
settings.REDIS_VIEW_CACHE_DURATION, cache="redis", key_prefix="channels"
)
)
def list(self, request, *args, **kwargs):
Expand Down
1 change: 1 addition & 0 deletions env/shared.env
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ NGINX_PORT=8063
APISIX_PORT=8065
KEYCLOAK_PORT=8066
KEYCLOAK_SSL_PORT=8067
REDIS_VIEW_CACHE_DURATION=0
18 changes: 18 additions & 0 deletions frontends/api/src/generated/v0/api.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

75 changes: 51 additions & 24 deletions frontends/api/src/generated/v1/api.ts

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion frontends/api/src/hooks/articles/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ describe("Article CRUD", () => {
const { id, ...patchData } = article
expect(makeRequest).toHaveBeenCalledWith("patch", url, patchData)
expect(queryClient.invalidateQueries).toHaveBeenCalledWith({
queryKey: articleKeys.root,
queryKey: articleKeys.detail(article.id),
})
})

Expand Down
6 changes: 3 additions & 3 deletions frontends/api/src/hooks/articles/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const useArticleList = (
}

/**
* Query is diabled if id is undefined.
* Query is disabled if id is undefined.
*/
const useArticleDetail = (id: number | undefined) => {
return useQuery({
Expand Down Expand Up @@ -58,8 +58,8 @@ const useArticlePartialUpdate = () => {
PatchedRichTextArticleRequest: data,
})
.then((response) => response.data),
onSuccess: (_data) => {
client.invalidateQueries({ queryKey: articleKeys.root })
onSuccess: (article: Article) => {
client.invalidateQueries({ queryKey: articleKeys.detail(article.id) })
},
})
}
Expand Down
8 changes: 7 additions & 1 deletion frontends/api/src/mitxonline/hooks/organizations/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,13 @@ const organizationQueries = {
const useB2BAttachMutation = (opts: B2bApiB2bAttachCreateRequest) => {
const queryClient = useQueryClient()
return useMutation({
mutationFn: () => b2bApi.b2bAttachCreate(opts),
mutationFn: async () => {
const response = await b2bApi.b2bAttachCreate(opts)
// 200 (already attached) indicates user already attached to all contracts
// 201 (successfully attached) is success
// 404 (invalid or expired code) will be thrown as error by axios
return response
},
onSuccess: () => {
queryClient.invalidateQueries({ queryKey: ["mitxonline"] })
},
Expand Down
31 changes: 0 additions & 31 deletions frontends/api/src/ssr/prefetch.ts

This file was deleted.

76 changes: 0 additions & 76 deletions frontends/api/src/ssr/serverQueryClient.ts

This file was deleted.

2 changes: 1 addition & 1 deletion frontends/main/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const processFeatureFlags = () => {
for (const [key, value] of Object.entries(process.env)) {
if (key.startsWith(`NEXT_PUBLIC_${featureFlagPrefix}`)) {
bootstrapFeatureFlags[
key.replace(`NEXT_PUBLIC_${featureFlagPrefix}`, "")
key.replace(`NEXT_PUBLIC_${featureFlagPrefix}`, "").replaceAll("_", "-")
] = value === "True" ? true : JSON.stringify(value)
}
}
Expand Down
36 changes: 0 additions & 36 deletions frontends/main/src/app-pages/ArticlePage/NewArticlePage.tsx

This file was deleted.

59 changes: 11 additions & 48 deletions frontends/main/src/app-pages/Articles/ArticleDetailPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,64 +2,27 @@

import React from "react"
import { useArticleDetail } from "api/hooks/articles"
import { Container, LoadingSpinner, styled, Typography } from "ol-components"
import { ButtonLink } from "@mitodl/smoot-design"
import { LoadingSpinner, ArticleEditor } from "ol-components"
import { notFound } from "next/navigation"
import { Permission } from "api/hooks/user"
import RestrictedRoute from "@/components/RestrictedRoute/RestrictedRoute"
import { articlesEditView } from "@/common/urls"

const Page = styled(Container)({
marginTop: "40px",
marginBottom: "40px",
})

const ControlsContainer = styled.div({
display: "flex",
justifyContent: "flex-end",
margin: "10px",
})
const WrapperContainer = styled.div({
borderBottom: "1px solid rgb(222, 208, 208)",
paddingBottom: "10px",
})

const PreTag = styled.pre({
background: "#f6f6f6",
padding: "16px",
borderRadius: "8px",
fontSize: "14px",
overflowX: "auto",
})

export const ArticleDetailPage = ({ articleId }: { articleId: number }) => {
const id = Number(articleId)
const { data, isLoading } = useArticleDetail(id)

const editUrl = articlesEditView(id)

if (isLoading) {
return <LoadingSpinner color="inherit" loading={isLoading} size={32} />
const {
data: article,
isLoading,
isFetching,
} = useArticleDetail(Number(articleId))

if (isLoading || isFetching) {
return <LoadingSpinner color="inherit" loading size={32} />
}
if (!data) {
if (!article) {
return notFound()
}
return (
<RestrictedRoute requires={Permission.ArticleEditor}>
<Page>
<WrapperContainer>
<Typography variant="h3" component="h1">
{data?.title}
</Typography>

<ControlsContainer>
<ButtonLink href={editUrl} variant="primary">
Edit
</ButtonLink>
</ControlsContainer>
</WrapperContainer>
<PreTag>{JSON.stringify(data.content, null, 2)}</PreTag>
</Page>
<ArticleEditor article={article} readOnly />
</RestrictedRoute>
)
}
Loading
Loading