Skip to content

Commit

Permalink
feat: show hide from toc
Browse files Browse the repository at this point in the history
  • Loading branch information
BryanttV committed Dec 19, 2023
1 parent 06d79ce commit 6bfb2b9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/course-home/data/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ export function normalizeOutlineBlocks(courseId, blocks) {
title: block.display_name,
resumeBlock: block.resume_block,
sequenceIds: block.children || [],
hideFromTOC: block.hide_from_toc,
};
break;

Expand All @@ -152,6 +153,7 @@ export function normalizeOutlineBlocks(courseId, blocks) {
// link in the outline (even though we ignore the given url and use an internal <Link> to ourselves).
showLink: !!block.lms_web_url,
title: block.display_name,
hideFromTOC: block.hide_from_toc,
};
break;

Expand Down
8 changes: 7 additions & 1 deletion src/course-home/outline-tab/Section.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const Section = ({
complete,
sequenceIds,
title,
hideFromTOC,
} = section;
const {
courseBlocks: {
Expand Down Expand Up @@ -63,10 +64,15 @@ const Section = ({
)}
</div>
<div className="col-10 ml-3 p-0 font-weight-bold text-dark-500">
<span className="align-middle">{title}</span>
<span className="align-middle mr-7">{title}</span>
<span className="sr-only">
, {intl.formatMessage(complete ? messages.completedSection : messages.incompleteSection)}
</span>
{hideFromTOC && (
<span className="font-weight-light ml-6" style={{ fontSize: '0.9rem' }}>
Hidden in Course Outline, accessible via Link
</span>
)}
</div>
</div>
);
Expand Down
6 changes: 6 additions & 0 deletions src/course-home/outline-tab/SequenceLink.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const SequenceLink = ({
due,
showLink,
title,
hideFromTOC,
} = sequence;
const {
userTimezone,
Expand Down Expand Up @@ -112,6 +113,11 @@ const SequenceLink = ({
, {intl.formatMessage(complete ? messages.completedAssignment : messages.incompleteAssignment)}
</span>
<EffortEstimate className="ml-3 align-middle" block={sequence} />
{hideFromTOC && (
<span className="font-weight-light ml-2" style={{ fontSize: '0.9rem' }}>
Subsections are not navigable beetwen each other, they can only be accessed through their link.
</span>
)}
</div>
</div>
<div className="row w-100 m-0 ml-3 pl-3">
Expand Down

0 comments on commit 6bfb2b9

Please sign in to comment.