Skip to content

Commit

Permalink
fix: fix tabs urls on progress tab
Browse files Browse the repository at this point in the history
 This fix does fixes the url links by getting them from the state
 simliar to how tabs navigation gets them.

 This would allow it work for PUBLIC_PATH is not '/', i.e. in
 tutor.

  This was reported in openedx/wg-build-test-release/issues/222
  • Loading branch information
ghassanmas committed Dec 6, 2022
1 parent c0928b0 commit ad3aba7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ function DetailedGrades({ intl }) {
} = useSelector(state => state.courseHome);
const {
org,
tabs,
} = useModel('courseHomeMeta', courseId);
const {
gradesFeatureIsFullyLocked,
Expand All @@ -40,7 +41,7 @@ function DetailedGrades({ intl }) {
<Hyperlink
variant="muted"
isInline
destination={`/course/${courseId}/home`}
destination={tabs.find(({ slug }) => slug === 'outline').url}
onClick={logOutlineLinkClick}
tabIndex={gradesFeatureIsFullyLocked ? '-1' : '0'}
>
Expand Down
7 changes: 3 additions & 4 deletions src/course-home/progress-tab/related-links/RelatedLinks.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ function RelatedLinks({ intl }) {
courseId,
} = useSelector(state => state.courseHome);
const {
org,
org, tabs,
} = useModel('courseHomeMeta', courseId);

const { administrator } = getAuthenticatedUser();
const logLinkClicked = (linkName) => {
sendTrackEvent('edx.ui.lms.course_progress.related_links.clicked', {
Expand All @@ -32,13 +31,13 @@ function RelatedLinks({ intl }) {
<h3 className="h4">{intl.formatMessage(messages.relatedLinks)}</h3>
<ul className="pl-4">
<li>
<Hyperlink destination={`/course/${courseId}/dates`} onClick={() => logLinkClicked('dates')}>
<Hyperlink destination={tabs.find(({ slug }) => slug === 'dates').url} onClick={() => logLinkClicked('dates')}>
{intl.formatMessage(messages.datesCardLink)}
</Hyperlink>
<p>{intl.formatMessage(messages.datesCardDescription)}</p>
</li>
<li>
<Hyperlink destination={`/course/${courseId}/home`} onClick={() => logLinkClicked('course_outline')}>
<Hyperlink destination={tabs.find(({ slug }) => slug === 'outline').url} onClick={() => logLinkClicked('course_outline')}>
{intl.formatMessage(messages.outlineCardLink)}
</Hyperlink>
<p>{intl.formatMessage(messages.outlineCardDescription)}</p>
Expand Down

0 comments on commit ad3aba7

Please sign in to comment.