feat: library section and subsection page (#2032)

* Adds section and subsection library pages. 
* Refactors routing to support them and fix routing from collections page to other pages.
* Refactors library context to reliably set component, unit, and other container ids even when the url changes when user goes back in history rapidly.
This commit is contained in:
Navin Karkera
2025-06-04 17:32:29 +00:00
committed by GitHub
parent 99e11d3534
commit dd6780ff41
46 changed files with 1798 additions and 453 deletions

View File

@@ -3,6 +3,7 @@ import { getAuthenticatedHttpClient } from '@edx/frontend-platform/auth';
import type {
Filter, MeiliSearch, MultiSearchQuery,
} from 'meilisearch';
import { ContainerType } from '../../generic/key-utils';
export const getContentSearchConfigUrl = () => new URL(
'api/content_search/v2/studio/',
@@ -181,12 +182,14 @@ interface ContainerHitContent {
}
export interface ContainerHit extends BaseContentHit {
type: 'library_container';
blockType: 'unit'; // This should be expanded to include other container types
blockType: ContainerType; // This should be expanded to include other container types
numChildren?: number;
published?: ContentPublishedData;
publishStatus: PublishStatus;
formatted: BaseContentHit['formatted'] & { published?: ContentPublishedData, };
content?: ContainerHitContent;
sections?: { displayName?: string[], key?: string[] };
subsections?: { displayName?: string[], key?: string[] };
}
export type HitType = ContentHit | CollectionHit | ContainerHit;