MOBILE-2302 courses: Fix time selector in courses overview

main
Dani Palou 2018-01-10 13:08:08 +01:00
parent 64460157c1
commit 56edbdf5d2
3 changed files with 11 additions and 4 deletions

View File

@ -3,7 +3,7 @@
<ion-title>{{ 'core.courses.courseoverview' | translate }}</ion-title>
<ion-buttons end>
<button *ngIf="tabShown == 'courses' && (courses[courses.selected] || courses[courses.selected].length > 5)" ion-button icon-only [attr.aria-label]="'core.courses.filtermycourses' | translate" (click)="switchFilter()">
<button *ngIf="tabShown == 'courses' && courses[courses.selected] && courses[courses.selected].length > 5" ion-button icon-only [attr.aria-label]="'core.courses.filtermycourses' | translate" (click)="switchFilter()">
<ion-icon name="funnel"></ion-icon>
</button>
<button *ngIf="searchEnabled" ion-button icon-only (click)="openSearch()" [attr.aria-label]="'core.courses.searchcourses' | translate">
@ -48,7 +48,7 @@
</div>
<core-loading [hideUntil]="courses.loaded" [hidden]="tabShown != 'courses'" class="core-loading-center">
<div no-padding class="clearfix" [hidden]="showFilter">
<ion-select [title]="'core.show' | translate" [(ngModel)]="courses.selected" float-start>
<ion-select [title]="'core.show' | translate" [(ngModel)]="courses.selected" float-start (ngModelChange)="selectedChanged()">
<ion-option value="inprogress">{{ 'core.courses.inprogress' | translate }}</ion-option>
<ion-option value="future">{{ 'core.courses.future' | translate }}</ion-option>
<ion-option value="past">{{ 'core.courses.past' | translate }}</ion-option>

View File

@ -198,7 +198,7 @@ export class CoreCoursesMyOverviewPage {
this.filteredCourses = this.courses[this.courses.selected];
} else {
this.filteredCourses = this.courses[this.courses.selected].filter((course) => {
return course.fullname.indexOf(newValue) > -1;
return course.fullname.toLowerCase().indexOf(newValue.toLowerCase()) > -1;
});
}
}
@ -309,4 +309,11 @@ export class CoreCoursesMyOverviewPage {
openSearch() {
this.navCtrl.push('CoreCoursesSearchPage');
}
/**
* The selected courses have changed.
*/
selectedChanged() {
this.filteredCourses = this.courses[this.courses.selected];
}
}

View File

@ -408,7 +408,7 @@ export class CoreSitesProvider {
return siteId;
});
} else if (result == this.LEGACY_APP_VERSION) {
return Promise.reject(this.translate.instant('mm.login.legacymoodleversion'));
return Promise.reject(this.translate.instant('core.login.legacymoodleversion'));
} else {
return Promise.reject(this.translate.instant('core.login.invalidmoodleversion'));
}