Skip to content

Commit 3687d6b

Browse files
fix: progress bar behavior
1 parent ea0c9b0 commit 3687d6b

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/components/ProgressBar/ProgressStep.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { stepNames } from 'data/services/lms/constants';
1616
import { useProgressStepData } from './hooks';
1717

1818
export const stepIcons = StrictDict({
19-
[stepNames.submisson]: Edit,
19+
[stepNames.submission]: Edit,
2020
[stepNames.studentTraining]: Highlight,
2121
[stepNames.self]: Highlight,
2222
[stepNames.peer]: Highlight,
@@ -45,13 +45,13 @@ const ProgressStep = ({
4545
subLabel = 'Past due!';
4646
} else if (isComplete) {
4747
iconSrc = CheckCircle;
48-
if (step === stepNames.myGrades) {
48+
if (step === stepNames.myGrades && myGrade) {
4949
subLabel = `${myGrade.earned} / ${myGrade.possible}`;
5050
}
5151
}
5252
return (
5353
<Nav.Link
54-
href={href}
54+
{...(!isActive && { href })}
5555
disabled={!isEnabled}
5656
className={classNames(
5757
'ora-progress-nav',

src/components/ProgressBar/hooks.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,18 @@ export const useProgressStepData = ({ step, canRevisit = false }) => {
1515
const stepState = useStepState({ step });
1616

1717
const href = `/${stepRoutes[step]}${isEmbedded ? '/embedded' : ''}/${xblockId}`;
18+
const isActive = viewStep === step;
1819
const isEnabled = (
19-
(stepState === stepStates.inProgress)
20+
isActive
21+
|| (stepState === stepStates.inProgress)
2022
|| (canRevisit && stepState === stepStates.completed)
2123
);
22-
const myGrade = useEffectiveGrade();
24+
const myGrade = useEffectiveGrade()?.stepScore;
2325

2426
return {
2527
href,
2628
isEnabled,
27-
isActive: viewStep === step,
29+
isActive,
2830
isComplete: stepState === stepStates.completed,
2931
inProgress: stepState === stepStates.inProgress,
3032
isPastDue: stepState === stepStates.closed,

0 commit comments

Comments
 (0)