Skip to content

Commit

Permalink
Merge pull request #8574 from MisRob/home-page-fixes
Browse files Browse the repository at this point in the history
Home page follow-up fixes
  • Loading branch information
rtibbles committed Nov 2, 2021
2 parents 8d3dc81 + a3e3432 commit 376811b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -356,16 +356,21 @@ export default function useLearnerResources() {
if (!contentNodes || !contentNodes.length) {
return [];
}
set(_resumableContentNodes, contentNodes);
const contentNodesIds = contentNodes.map(contentNode => contentNode.id);
return ContentNodeProgressResource.fetchCollection({
getParams: { ids: contentNodesIds },
force,
}).then(progresses => {
if (progresses) {
set(_resumableContentNodesProgresses, progresses);
}
return contentNodes;
}).then(progressData => {
const progresses = progressData ? progressData : [];
set(_resumableContentNodesProgresses, progresses);
// when saving resumable content nodes, remove those that have progress 0
// see https://github.com/learningequality/kolibri/issues/8573
const resumableContentNodes = contentNodes.filter(contentNode => {
const progress = progresses.find(progress => progress.id === contentNode.id);
return progress.progress_fraction > 0;
});
set(_resumableContentNodes, resumableContentNodes);
return resumableContentNodes;
});
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
v-for="(contentNode, idx) in resumableNonClassesContentNodes"
:key="idx"
:contentNode="contentNode"
:contentNodeProgress="getResumableContentNodeProgress(contentNode.id)"
:to="getTopicContentNodeLink(contentNode.id)"
:collectionTitle="getContentNodeTopicName(contentNode)"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
</div>
<div
v-if="!hideDuration"
class="duration"
data-test="duration"
:style="{ marginTop: '8px' }"
>
<TimeDuration
v-if="displayMinutes"
Expand Down Expand Up @@ -167,4 +167,9 @@
}
}
.duration {
margin-top: 8px;
text-align: right;
}
</style>

0 comments on commit 376811b

Please sign in to comment.