Open
Conversation
4601eb6 to
3be459e
Compare
…idebar files - Create LifecycleModal: wraps LifecycleBadge + LifecycleActionButtons + BlockCommentsPanel in a Paragon ModalDialog (no sidebar dependency) - Update CardHeader: add lifecycleState + onClickLifecycle props; render clickable LifecycleBadge next to status badges in each card header - Update SectionCard / SubsectionCard / UnitCard: open LifecycleModal on badge click; modal is only rendered when blockLifecycleState is available - Add LifecycleSection to old unit-page PublishControls sidebar (no new deps) - Add CourseLifecycleSection to OutlineSidebar for course-level review state - Delete backported info-sidebar files (SectionInfoSidebar, SubsectionInfoSidebar, UnitInfoSidebar, CourseInfoSidebar) and backported unit-sidebar files — the modal approach has zero dependency on the new sidebar system fix: improve course review status sidebar styling and unit section margins - CourseLifecycleSection: add labeled sub-sections (Current Status, Block Breakdown, Actions) with uppercase muted headings for better scannability - OutlineSidebar: rename heading to 'Course Review Status' - PublishControls: wrap LifecycleSection in px-3 to match sidebar side margins fix: hide standard publish button when lifecycle system is active on unit page When a unit is enrolled in the review workflow (useBlockState returns data), pass hidePublishButton=true to SidebarFooter so the native Publish button is suppressed — publishing is handled exclusively through LifecycleSection. fix: invalidate all lifecycle queries on course-level mutations Course-level mutations were only invalidating lifecycleQueryKeys.courseState, leaving every block's cached state stale. Switching to queryKey: ['lifecycle'] matches what block-level mutations already do, so all block badges in card headers re-fetch immediately after Submit All / Approve All / Publish Course. fix: refresh Redux outline state after lifecycle publish Lifecycle publish mutations only invalidated React Query caches, but the course outline's section/subsection/unit published state (yellow draft badges, hasChanges) lives in Redux and was not updated without a reload. - LifecycleModal: accept onPublishSuccess prop and call it alongside onClose - SectionCard / SubsectionCard / UnitCard: pass onPublishSuccess that dispatches fetchCourseSectionQuery([section.id]) to pull fresh Redux state - CourseLifecycleSection: dispatch fetchCourseOutlineIndexQuery after Publish Course to refresh the entire outline tree in Redux - usePublishCourse: accept options.onSuccess callback (mirrors usePublishBlock) fix: use reactive useEffect to refresh Redux outline after lifecycle publish The previous approach of threading an onPublishSuccess callback through LifecycleModal → LifecycleActionButtons → usePublishBlock was unreliable because TanStack Query captures useMutation options at hook-init time, making the callback stale after component re-renders. New approach: watch blockLifecycleState?.state (and data?.aggregateState for course-level) in a useEffect. When a block/course transitions from any non-published state to 'published', dispatch the Redux thunk directly to refresh the outline without depending on any mutation callback chain. - SectionCard / SubsectionCard / UnitCard: useEffect dispatches fetchCourseSectionQuery([section.id]) on state → 'published' transition - CourseLifecycleSection: useEffect dispatches fetchCourseOutlineIndexQuery on aggregateState → 'published' transition - Remove now-redundant onPublishSuccess props from LifecycleModal usages - Revert usePublishCourse options param (no longer needed)
501992c to
c160cf6
Compare
c160cf6 to
a19e685
Compare
c6dcfbe to
ecdc4df
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Course Lifecycle Management — Frontend (Studio)
Adds a complete review/approval workflow UI to
frontend-app-authoring, consuming the new lifecycle REST API. Blocks flow through Draft → For Review →Approved → Published at both the block and course level, with role-based action buttons, comment threads, and inline status badges throughout the course
outline, unit page, and Studio home.
Studio Home
Course card lifecycle badges
LifecycleBadgerendered on each course card for non-published statesuseBulkCourseAggregateStatesCoursesLifecycleFilterMenudropdown to filter the course list by review state (All / Draft / For Review / Approved)lifecycleFilteradded to the ReduxstudioHomeCoursesRequestParamssliceCourse Outline
Sidebar (
CourseLifecycleSection)useEffectref-comparison that dispatchesfetchCourseOutlineIndexQueryOutline cards (Section / Subsection / Unit)
LifecycleBadgeon each card showing current review stateLifecycleModalwith the full review panel (badge + action buttons + comments)CardHeaderreceivescanPublish/lifecycleState/onClickLifecycleprops; the Publish menu item is hidden only when the lifecycle system explicitlydenies it (
canPublish === false), preserving the default publish behaviour for blocks not enrolled in the workflowUnit Page
LifecycleSection("Unit Status") in the sidebar details tabhidePublishButton) when a lifecycle state is present — the lifecycle section owns publishing on this pagefetchCourseSectionVerticalDatadispatched through anonPublishSuccesscallbackData Layer (
src/course-lifecycle/data/)api.tsapiHooks.ts['lifecycle']on success; publish hooks also invalidatecourseOutlineQueryKeys.contentLibrary(...)types.tsBlockReviewState,CourseAggregateState,BlockReviewComment,LifecycleStateapi.mock.tsComponents (
src/course-lifecycle/components/)LifecycleBadgeLifecycleSectionhasChangeschangeLifecycleModaleffectiveState(draft with no changes → published)LifecycleActionButtonscan*capability flagsCourseLifecycleSectionBlockCommentsPanelCourseCommentsPanelTests (
src/course-lifecycle/)72 tests across 7 new test files, following the hook-mocking pattern used throughout the MFE:
LifecycleBadge.test.tsxLifecycleActionButtons.test.tsxhasChanges=falsehides workflow buttons, click handlersBlockCommentsPanel.test.tsxreadOnlymodeCourseCommentsPanel.test.tsxresolveComment/deleteCommentAPI callsLifecycleSection.test.tsxeffectiveStatelogic, cache invalidation onhasChangesLifecycleModal.test.tsxeffectiveState, onClose callbackCourseLifecycleSection.test.tsx