MOBILE-3643 forum: Add rating TODOs

main
Noel De Martin 2021-02-25 10:00:49 +01:00
parent 9d92c41678
commit aed159df7c
3 changed files with 17 additions and 0 deletions

View File

@ -162,6 +162,8 @@ export class AddonModForumIndexComponent extends CoreCourseModuleMainActivityCom
});
}
});
// @todo Listen for offline ratings saved and synced.
}
async ngAfterViewInit(): Promise<void> {
@ -219,6 +221,7 @@ export class AddonModForumIndexComponent extends CoreCourseModuleMainActivityCom
await Promise.all([
this.fetchOfflineDiscussions(),
this.fetchDiscussions(refresh),
// @todo fetch hasOfflineRatings.
]);
} catch (error) {
if (refresh) {

View File

@ -71,6 +71,16 @@
<core-tag-list [tags]="post.tags"></core-tag-list>
</ion-label>
</ion-item>
<!-- @todo -->
<!-- <core-rating-rate *ngIf="forum && ratingInfo"
[ratingInfo]="ratingInfo" contextLevel="module" [instanceId]="componentId" [itemId]="post.id"
[itemSetId]="discussionId" [courseId]="courseId" [aggregateMethod]="forum.assessed" [scaleId]="forum.scale"
[userId]="post.author.id" (onUpdate)="ratingUpdated()">
</core-rating-rate>
<core-rating-aggregate *ngIf="forum && ratingInfo"
[ratingInfo]="ratingInfo" contextLevel="module" [instanceId]="componentId" [itemId]="post.id"
[courseId]="courseId" [aggregateMethod]="forum.assessed" [scaleId]="forum.scale">
</core-rating-aggregate> -->
<ion-item *ngIf="post.id > 0 && post.capabilities.reply && !post.isprivatereply"
class="ion-no-padding ion-text-end addon-forum-reply-button">

View File

@ -194,6 +194,8 @@ export class AddonModForumDiscussionPage implements OnInit, AfterViewInit, OnDes
AddonModForum.instance.invalidateDiscussionsList(this.forumId);
}
// @todo Listen for offline ratings saved and synced.
this.changeDiscObserver = CoreEvents.on(AddonModForumProvider.CHANGE_DISCUSSION_EVENT, (data: any) => {
if ((this.forumId && this.forumId === data.forumId) || data.cmId === this.cmId) {
AddonModForum.instance.invalidateDiscussionsList(this.forumId).finally(() => {
@ -476,6 +478,8 @@ export class AddonModForumDiscussionPage implements OnInit, AfterViewInit, OnDes
} else {
this.canPin = false;
}
// @todo fetch hasOfflineRatings.
} catch (error) {
CoreDomUtils.instance.showErrorModal(error);
} finally {