MOBILE-3749 a11y: Remove usage of routerlink attribute
parent
fa78783c07
commit
a41df38a71
|
@ -39,9 +39,8 @@
|
|||
</ion-label>
|
||||
</ion-item-divider>
|
||||
<section *ngFor="let category of categories">
|
||||
<ion-item class="ion-text-wrap" router-direction="forward"
|
||||
[routerLink]="['/main/home/courses/categories', category.id]"
|
||||
[attr.aria-label]="category.name" detail="true">
|
||||
<ion-item button class="ion-text-wrap" (click)="openCategory(category.id)" [attr.aria-label]="category.name"
|
||||
detail="true">
|
||||
<ion-icon name="fas-folder" slot="start" [attr.aria-label]="'core.category' | translate"></ion-icon>
|
||||
<ion-label>
|
||||
<h2>
|
||||
|
|
|
@ -117,4 +117,13 @@ export class CoreCoursesCategoriesPage implements OnInit {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Open a category.
|
||||
*
|
||||
* @param categoryId Category Id.
|
||||
*/
|
||||
openCategory(categoryId: number): void {
|
||||
CoreNavigator.navigateToSitePath('courses/categories/' + categoryId);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -7,8 +7,7 @@
|
|||
<ion-title>{{ 'core.login.login' | translate }}</ion-title>
|
||||
|
||||
<ion-buttons slot="end">
|
||||
<ion-button fill="clear" router-direction="forward" routerLink="/settings"
|
||||
[attr.aria-label]="'core.settings.appsettings' | translate">
|
||||
<ion-button fill="clear" (click)="openSettings()" [attr.aria-label]="'core.settings.appsettings' | translate">
|
||||
<ion-icon slot="icon-only" name="fas-cog" aria-hidden="true"></ion-icon>
|
||||
</ion-button>
|
||||
</ion-buttons>
|
||||
|
@ -92,8 +91,7 @@
|
|||
<ion-item class="ion-text-wrap" lines="none" *ngIf="authInstructions">
|
||||
<ion-label><p><core-format-text [text]="authInstructions" [filter]="false"></core-format-text></p></ion-label>
|
||||
</ion-item>
|
||||
<ion-button expand="block" class="ion-margin" color="light" router-direction="forward" routerLink="/login/emailsignup"
|
||||
[queryParams]="{siteUrl: siteUrl}">
|
||||
<ion-button expand="block" class="ion-margin" color="light" (click)="openEmailSignup()">
|
||||
{{ 'core.login.startsignup' | translate }}
|
||||
</ion-button>
|
||||
</ion-list>
|
||||
|
|
|
@ -287,6 +287,20 @@ export class CoreLoginCredentialsPage implements OnInit, OnDestroy {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Open email signup page.
|
||||
*/
|
||||
openEmailSignup(): void {
|
||||
CoreNavigator.navigate('/login/emailsignup', { params: { siteUrl: this.siteUrl } });
|
||||
}
|
||||
|
||||
/**
|
||||
* Open settings page.
|
||||
*/
|
||||
openSettings(): void {
|
||||
CoreNavigator.navigate('/settings');
|
||||
}
|
||||
|
||||
/**
|
||||
* View destroyed.
|
||||
*/
|
||||
|
|
|
@ -7,8 +7,7 @@
|
|||
<ion-title>{{ 'core.login.connecttomoodle' | translate }}</ion-title>
|
||||
|
||||
<ion-buttons slot="end">
|
||||
<ion-button fill="clear" router-direction="forward" routerLink="/settings"
|
||||
[attr.aria-label]="'core.settings.appsettings' | translate">
|
||||
<ion-button fill="clear" (click)="openSettings()" [attr.aria-label]="'core.settings.appsettings' | translate">
|
||||
<ion-icon slot="icon-only" name="fas-cog" aria-hidden="true"></ion-icon>
|
||||
</ion-button>
|
||||
</ion-buttons>
|
||||
|
|
|
@ -567,6 +567,13 @@ export class CoreLoginSitePage implements OnInit {
|
|||
CoreCustomURLSchemes.treatHandleCustomURLError(error);
|
||||
}
|
||||
|
||||
/**
|
||||
* Open settings page.
|
||||
*/
|
||||
openSettings(): void {
|
||||
CoreNavigator.navigate('/settings');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -11,8 +11,7 @@
|
|||
[attr.aria-label]="'core.delete' | translate">
|
||||
<ion-icon slot="icon-only" name="fas-pen" aria-hidden="true"></ion-icon>
|
||||
</ion-button>
|
||||
<ion-button router-direction="forward" routerLink="/settings"
|
||||
[attr.aria-label]="'core.settings.appsettings' | translate">
|
||||
<ion-button (click)="openSettings()" [attr.aria-label]="'core.settings.appsettings' | translate">
|
||||
<ion-icon slot="icon-only" name="fas-cog" aria-hidden="true"></ion-icon>
|
||||
</ion-button>
|
||||
</ion-buttons>
|
||||
|
|
|
@ -139,4 +139,11 @@ export class CoreLoginSitesPage implements OnInit {
|
|||
this.showDelete = !this.showDelete;
|
||||
}
|
||||
|
||||
/**
|
||||
* Open settings page.
|
||||
*/
|
||||
openSettings(): void {
|
||||
CoreNavigator.navigate('/settings');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -61,7 +61,7 @@
|
|||
</ion-content>
|
||||
|
||||
<ng-template #allCourseList>
|
||||
<ion-item button class="ion-text-wrap" router-direction="forward" routerLink="/main/home/courses/all" detail="true">
|
||||
<ion-item button class="ion-text-wrap" (click)="openAvailableCourses()" detail="true">
|
||||
<ion-icon name="fas-graduation-cap" fixed-width slot="start" aria-hidden="true"></ion-icon>
|
||||
<ion-label>
|
||||
<h2>{{ 'core.courses.availablecourses' | translate}}</h2>
|
||||
|
@ -75,7 +75,7 @@
|
|||
</ng-template>
|
||||
|
||||
<ng-template #categories>
|
||||
<ion-item button class="ion-text-wrap" router-direction="forward" routerLink="/main/home/courses/categories" detail="true">
|
||||
<ion-item button class="ion-text-wrap" (click)="openCourseCategories()" detail="true">
|
||||
<ion-icon name="fas-folder" slot="start" aria-hidden="true"></ion-icon>
|
||||
<ion-label>
|
||||
<h2>{{ 'core.courses.categories' | translate}}</h2>
|
||||
|
@ -84,7 +84,7 @@
|
|||
</ng-template>
|
||||
|
||||
<ng-template #enrolledCourseList>
|
||||
<ion-item button class="ion-text-wrap" router-direction="forward" routerLink="/main/home/courses/my" detail="true">
|
||||
<ion-item button class="ion-text-wrap" (click)="openMyCourses()" detail="true">
|
||||
<ion-icon name="fas-graduation-cap" fixed-width slot="start" aria-hidden="true">
|
||||
</ion-icon>
|
||||
<ion-label><h2>{{ 'core.courses.mycourses' | translate}}</h2></ion-label>
|
||||
|
@ -92,7 +92,7 @@
|
|||
</ng-template>
|
||||
|
||||
<ng-template #courseSearch>
|
||||
<ion-item button class="ion-text-wrap" router-direction="forward" routerLink="/main/home/courses/search" detail="true">
|
||||
<ion-item button class="ion-text-wrap" (click)="openSearch()" detail="true">
|
||||
<ion-icon name="fas-search" slot="start" aria-hidden="true"></ion-icon>
|
||||
<ion-label><h2>{{ 'core.courses.searchcourses' | translate}}</h2></ion-label>
|
||||
</ion-item>
|
||||
|
|
|
@ -221,6 +221,27 @@ export class CoreSiteHomeIndexPage implements OnInit, OnDestroy {
|
|||
CoreNavigator.navigateToSitePath('courses/search');
|
||||
}
|
||||
|
||||
/**
|
||||
* Go to available courses.
|
||||
*/
|
||||
openAvailableCourses(): void {
|
||||
CoreNavigator.navigateToSitePath('courses/all');
|
||||
}
|
||||
|
||||
/**
|
||||
* Go to my courses.
|
||||
*/
|
||||
openMyCourses(): void {
|
||||
CoreNavigator.navigateToSitePath('courses/my');
|
||||
}
|
||||
|
||||
/**
|
||||
* Go to course categories.
|
||||
*/
|
||||
openCourseCategories(): void {
|
||||
CoreNavigator.navigateToSitePath('courses/categories');
|
||||
}
|
||||
|
||||
/**
|
||||
* Component being destroyed.
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue