-
Notifications
You must be signed in to change notification settings - Fork 149
feat: Enhance Course Optimizer Page with Previous Run Links and Improved UI #2356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
feat: Enhance Course Optimizer Page with Previous Run Links and Improved UI #2356
Conversation
36e5e52
to
33fa7c8
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2356 +/- ##
==========================================
+ Coverage 94.44% 94.45% +0.01%
==========================================
Files 1169 1169
Lines 25106 25249 +143
Branches 5492 5558 +66
==========================================
+ Hits 23712 23850 +138
- Misses 1322 1334 +12
+ Partials 72 65 -7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
const PreviousRunLinkHref: FC<{ href: string }> = ({ href }) => { | ||
const handleClick = (event: React.MouseEvent<HTMLAnchorElement>) => { | ||
event.preventDefault(); | ||
window.open(href, '_blank'); | ||
}; | ||
|
||
return ( | ||
<div className="broken-link-container"> | ||
<a href={href} onClick={handleClick} className="broken-link" rel="noreferrer"> | ||
{href} | ||
</a> | ||
</div> | ||
); | ||
}; | ||
|
||
const GoToBlock: FC<{ block: { url: string, displayName: string } }> = ({ block }) => { | ||
const handleClick = (event: React.MouseEvent<HTMLAnchorElement>) => { | ||
event.preventDefault(); | ||
window.open(block.url, '_blank'); | ||
}; | ||
|
||
return ( | ||
<div className="go-to-block-link-container"> | ||
<a href={block.url} onClick={handleClick} className="broken-link" rel="noreferrer"> | ||
{block.displayName} | ||
</a> | ||
</div> | ||
); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why adding these functions again,
Can we import these from brokenLinkTable?
<Card className="unit-card rounded-sm pt-2 pb-3 pl-3 pr-4 mb-2.5"> | ||
<p className="unit-header">{unit.displayName}</p> | ||
<DataTable | ||
data={previousRunLinkList} | ||
itemCount={previousRunLinkList.length} | ||
columns={[ | ||
{ | ||
accessor: 'Links', | ||
width: 'col-12', | ||
}, | ||
]} | ||
/> | ||
</Card> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this part is also same, can we add changes to same file BrokenLinkTable?
const collapsibleTitle = ( | ||
<div className={className}> | ||
<div className="section-collapsible-header-item"> | ||
<Icon src={isOpen ? ArrowDropDown : ArrowRight} /> | ||
<p className="section-title">{title}</p> | ||
</div> | ||
<div className="section-collapsible-header-actions"> | ||
<div className="section-collapsible-header-action-item"> | ||
<p>{previousRunLinksCount > 0 ? previousRunLinksCount : '-'}</p> | ||
</div> | ||
</div> | ||
</div> | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use SectionCollapsible?? As only function arguments and collapsibleTitle
is changing in both with same return value including a lot of duplications.
We can edit SectionCollapsible based on a flag i think instead of creating a new component.
const virtualSections = useMemo(() => { | ||
const createVirtualSection = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use some different name? Virtual isn't making any sense, what do you think?
// eslint-disable-next-line max-len | ||
() => allSectionsForPrevRun.some(section => section.subsections.some(subsection => subsection.units.some(unit => unit.blocks.some(block => block.previousRunLinks && block.previousRunLinks.length > 0)))), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we format this line instead of adding // eslint-disable-next-line max-len
// eslint-disable-next-line max-len | ||
const hasVisibleUnit = section.subsections.some((subsection) => subsection.units.some((unit) => unit.blocks.some((block) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here. can we remove // eslint-disable-next-line max-len
d88d14c
to
2b44e8f
Compare
Description
This PR introduces multiple UI enhancements and new functionality for the Course Optimizer page. The key updates include:
Previous Run Link Section
contentstore.enable_course_optimizer_check_prev_run_links
Course Update, Handouts, and Custom Page Section
UI Enhancements
after-course-optimizer-enhancement-2025-08-08.mp4
Jira
Testing Instructions
Please verify the following: