Merge pull request #3664 from NoelDeMartin/MOBILE-4188

MOBILE-4188 grades: Improve course navigation
main
Dani Palou 2023-05-09 08:05:49 +02:00 committed by GitHub
commit a0b4c8259d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 14 additions and 3 deletions

View File

@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import { CoreSilentError } from '@classes/errors/silenterror';
import { CoreItemsManagerSource } from './items-manager-source';
/**
@ -45,7 +46,7 @@ export abstract class CoreItemsManager<
*/
getSource(): Source {
if (!this.source) {
throw new Error('Source is missing from items manager');
throw new CoreSilentError('Source is missing from items manager');
}
return this.source.instance;

View File

@ -12,7 +12,7 @@
<ion-refresher slot="fixed" [disabled]="!columns || !rows" (ionRefresh)="refreshGrades($event.target)">
<ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
</ion-refresher>
<core-loading [hideUntil]="columns && rows">
<core-loading [hideUntil]="loaded">
<core-empty-box *ngIf="!rows.length" icon="fas-chart-bar" [message]="'core.grades.nogradesreturned' | translate">
</core-empty-box>
<div *ngIf="rows.length" class="core-grades-container">

View File

@ -58,6 +58,7 @@ export class CoreGradesCoursePage implements AfterViewInit, OnDestroy {
rowsOnView = 0;
totalColumnsSpan?: number;
withinSplitView?: boolean;
loaded = false;
protected useLegacyLayout?: boolean; // Whether to use the layout before 4.1.
protected fetchSuccess = false;
@ -111,6 +112,8 @@ export class CoreGradesCoursePage implements AfterViewInit, OnDestroy {
await this.swipeManager?.start();
await this.fetchInitialGrades();
this.loaded = true;
}
/**

View File

@ -72,8 +72,14 @@ export class CoreUserParticipantsPage implements OnInit, AfterViewInit, OnDestro
*/
async ngAfterViewInit(): Promise<void> {
await this.fetchInitialParticipants();
await this.participants.start(this.splitView);
}
this.participants.start(this.splitView);
/**
* @inheritdoc
*/
async ionViewDidEnter(): Promise<void> {
await this.participants.start();
}
/**

View File

@ -28,6 +28,7 @@ const routes: Routes = [
{
path: ':userId',
loadChildren: () => import('@features/user/user-profile-lazy.module').then(m => m.CoreUserProfileLazyModule),
data: { swipeManagerSource: 'participants' },
},
], () => CoreScreen.isTablet),
},