MOBILE-3213 workshop: Disable refreshers when inform

main
Pau Ferrer Ocaña 2019-12-18 12:36:57 +01:00
parent bed497d54d
commit 7a1b49cae1
6 changed files with 7 additions and 25 deletions

View File

@ -154,6 +154,7 @@ export class AddonModWorkshopIndexComponent extends CoreCourseModuleMainActivity
promises.push(this.workshopProvider.invalidateReviewerAssesmentsData(this.workshop.id)); promises.push(this.workshopProvider.invalidateReviewerAssesmentsData(this.workshop.id));
} }
promises.push(this.workshopProvider.invalidateGradesData(this.workshop.id)); promises.push(this.workshopProvider.invalidateGradesData(this.workshop.id));
promises.push(this.workshopProvider.invalidateWorkshopWSData(this.workshop.id));
} }
return Promise.all(promises); return Promise.all(promises);

View File

@ -9,7 +9,7 @@
</ion-navbar> </ion-navbar>
</ion-header> </ion-header>
<ion-content> <ion-content>
<ion-refresher [enabled]="loaded" (ionRefresh)="refreshAssessment($event)"> <ion-refresher [enabled]="loaded" (ionRefresh)="refreshAssessment($event)" *ngIf="!evaluating">
<ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content> <ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
</ion-refresher> </ion-refresher>
<core-loading [hideUntil]="loaded"> <core-loading [hideUntil]="loaded">

View File

@ -9,9 +9,6 @@
</ion-navbar> </ion-navbar>
</ion-header> </ion-header>
<ion-content> <ion-content>
<ion-refresher [enabled]="loaded" (ionRefresh)="refreshSubmission($event)">
<ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
</ion-refresher>
<core-loading [hideUntil]="loaded"> <core-loading [hideUntil]="loaded">
<form ion-list [formGroup]="editForm" *ngIf="workshop"> <form ion-list [formGroup]="editForm" *ngIf="workshop">
<ion-item text-wrap> <ion-item text-wrap>

View File

@ -274,26 +274,6 @@ export class AddonModWorkshopEditSubmissionPage implements OnInit, OnDestroy {
return false; return false;
} }
/**
* Pull to refresh.
*
* @param refresher Refresher.
*/
refreshSubmission(refresher: any): void {
if (this.loaded) {
const promises = [];
promises.push(this.workshopProvider.invalidateSubmissionData(this.workshopId, this.submission.id));
promises.push(this.workshopProvider.invalidateSubmissionsData(this.workshopId));
Promise.all(promises).finally(() => {
return this.fetchSubmissionData();
}).finally(() => {
refresher.complete();
});
}
}
/** /**
* Save the submission. * Save the submission.
*/ */

View File

@ -12,7 +12,7 @@
</ion-navbar> </ion-navbar>
</ion-header> </ion-header>
<ion-content> <ion-content>
<ion-refresher [enabled]="loaded" (ionRefresh)="refreshSubmission($event)"> <ion-refresher [enabled]="loaded" (ionRefresh)="refreshSubmission($event)" *ngIf="!((assessmentId && access.assessingallowed) || canAddFeedback)">
<ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content> <ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
</ion-refresher> </ion-refresher>
<core-loading [hideUntil]="loaded"> <core-loading [hideUntil]="loaded">

View File

@ -373,6 +373,10 @@ export class AddonModWorkshopSubmissionPage implements OnInit, OnDestroy {
promises.push(this.workshopProvider.invalidateAssessmentData(this.workshopId, this.assessmentId)); promises.push(this.workshopProvider.invalidateAssessmentData(this.workshopId, this.assessmentId));
} }
if (this.assessmentUserId) {
promises.push(this.workshopProvider.invalidateReviewerAssesmentsData(this.workshopId, this.assessmentId));
}
return Promise.all(promises).finally(() => { return Promise.all(promises).finally(() => {
this.eventsProvider.trigger(AddonModWorkshopProvider.ASSESSMENT_INVALIDATED, this.siteId); this.eventsProvider.trigger(AddonModWorkshopProvider.ASSESSMENT_INVALIDATED, this.siteId);