Skip to content

Commit 3cbb352

Browse files
committed
Don't show study right progress for nodl
1 parent 785260a commit 3cbb352

1 file changed

Lines changed: 18 additions & 8 deletions

File tree

src/components/PointsBalloon/PartProgress.js

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { BarChart, Bar, XAxis, YAxis, LabelList, Tooltip } from "recharts"
55
import { improveGroupName } from "../../util/strings"
66
import CustomTooltip from "./CustomTooltip"
77
import { SMALL_MEDIUM_BREAKPOINT } from "../../util/constants"
8+
import { getCourseVariant } from "../../services/moocfi"
89

910
const PartProgressContainer = styled.div`
1011
margin-bottom: 0.5rem;
@@ -102,14 +103,23 @@ const PartProgress = ({ name, data, appliesForStudyRight }) => {
102103
{Math.floor(Math.min(100, totalProgress * 111.112))}
103104
/100.
104105
</LargeP>
105-
{appliesForStudyRight && (
106-
<SmallP>
107-
Opinto-oikeuteen vaaditaan 90% ohjelmointitehtävien pisteistä.
108-
Edistymisesi tällä hetkellä:{" "}
109-
{allChartData.find(o => o.tool === "Ohjelmointitehtävät")?.progress}
110-
%.
111-
</SmallP>
112-
)}
106+
{appliesForStudyRight &&
107+
(getCourseVariant() === "nodl" ? (
108+
<SmallP>
109+
Olet aikatauluttomalla kurssilla, josta ei voi hakea
110+
opinto-oikeutta.
111+
</SmallP>
112+
) : (
113+
<SmallP>
114+
Opinto-oikeuteen vaaditaan 90% aikataulutetun kurssin
115+
ohjelmointitehtävien pisteistä. Edistymisesi tällä hetkellä:{" "}
116+
{
117+
allChartData.find(o => o.tool === "Ohjelmointitehtävät")
118+
?.progress
119+
}
120+
%.
121+
</SmallP>
122+
))}
113123
</div>
114124
</PartProgressContainer>
115125
)

0 commit comments

Comments
 (0)