Merge pull request #3796 from dpalou/MOBILE-3599
MOBILE-3599 competency: Format competency and plan namesmain
commit
335a380977
|
@ -4,7 +4,10 @@
|
||||||
<ion-back-button [text]="'core.back' | translate"></ion-back-button>
|
<ion-back-button [text]="'core.back' | translate"></ion-back-button>
|
||||||
</ion-buttons>
|
</ion-buttons>
|
||||||
<ion-title>
|
<ion-title>
|
||||||
<h1>{{ title }}</h1>
|
<h1>
|
||||||
|
<core-format-text [text]="title" [contextLevel]="contextLevel" [contextInstanceId]="contextInstanceId">
|
||||||
|
</core-format-text>
|
||||||
|
</h1>
|
||||||
</ion-title>
|
</ion-title>
|
||||||
</ion-toolbar>
|
</ion-toolbar>
|
||||||
</ion-header>
|
</ion-header>
|
||||||
|
@ -19,7 +22,11 @@
|
||||||
[attr.aria-label]="competency.competency.shortname" (click)="competencies.select(competency)"
|
[attr.aria-label]="competency.competency.shortname" (click)="competencies.select(competency)"
|
||||||
[attr.aria-current]="competencies.getItemAriaCurrent(competency)" button detail="true">
|
[attr.aria-current]="competencies.getItemAriaCurrent(competency)" button detail="true">
|
||||||
<ion-label>
|
<ion-label>
|
||||||
<p class="item-heading">{{ competency.competency.shortname }} <em>{{competency.competency.idnumber}}</em></p>
|
<p class="item-heading">
|
||||||
|
<core-format-text [text]="competency.competency.shortname" [contextLevel]="contextLevel"
|
||||||
|
[contextInstanceId]="contextInstanceId">
|
||||||
|
</core-format-text> <em>{{competency.competency.idnumber}}</em>
|
||||||
|
</p>
|
||||||
</ion-label>
|
</ion-label>
|
||||||
<ion-badge slot="end" *ngIf="competency.usercompetency"
|
<ion-badge slot="end" *ngIf="competency.usercompetency"
|
||||||
[color]="competency.usercompetency.proficiency ? 'success' : 'danger'">
|
[color]="competency.usercompetency.proficiency ? 'success' : 'danger'">
|
||||||
|
|
|
@ -30,6 +30,7 @@ import { CoreRoutedItemsManagerSourcesTracker } from '@classes/items-management/
|
||||||
import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics';
|
import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics';
|
||||||
import { CoreSites } from '@services/sites';
|
import { CoreSites } from '@services/sites';
|
||||||
import { CoreTime } from '@singletons/time';
|
import { CoreTime } from '@singletons/time';
|
||||||
|
import { ContextLevel } from '@/core/constants';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Page that displays the list of competencies of a learning plan.
|
* Page that displays the list of competencies of a learning plan.
|
||||||
|
@ -48,6 +49,8 @@ export class AddonCompetencyCompetenciesPage implements AfterViewInit, OnDestroy
|
||||||
>;
|
>;
|
||||||
|
|
||||||
title = '';
|
title = '';
|
||||||
|
contextLevel?: string;
|
||||||
|
contextInstanceId?: number;
|
||||||
|
|
||||||
protected logView: () => void;
|
protected logView: () => void;
|
||||||
|
|
||||||
|
@ -99,8 +102,12 @@ export class AddonCompetencyCompetenciesPage implements AfterViewInit, OnDestroy
|
||||||
}
|
}
|
||||||
|
|
||||||
this.title = source.plan.plan.name;
|
this.title = source.plan.plan.name;
|
||||||
|
this.contextLevel = ContextLevel.USER;
|
||||||
|
this.contextInstanceId = source.user?.id || source.plan.plan.userid;
|
||||||
} else {
|
} else {
|
||||||
this.title = Translate.instant('addon.competency.coursecompetencies');
|
this.title = Translate.instant('addon.competency.coursecompetencies');
|
||||||
|
this.contextLevel = ContextLevel.COURSE;
|
||||||
|
this.contextInstanceId = source.COURSE_ID;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.logView();
|
this.logView();
|
||||||
|
|
|
@ -5,7 +5,9 @@
|
||||||
</ion-buttons>
|
</ion-buttons>
|
||||||
<ion-title>
|
<ion-title>
|
||||||
<h1 *ngIf="competency">
|
<h1 *ngIf="competency">
|
||||||
{{ competency.competency.competency.shortname }} <small>{{ competency.competency.competency.idnumber }}</small>
|
<core-format-text [text]="competency.competency.competency.shortname" [contextLevel]="contextLevel"
|
||||||
|
[contextInstanceId]="contextInstanceId">
|
||||||
|
</core-format-text> <small>{{ competency.competency.competency.idnumber }}</small>
|
||||||
</h1>
|
</h1>
|
||||||
</ion-title>
|
</ion-title>
|
||||||
</ion-toolbar>
|
</ion-toolbar>
|
||||||
|
@ -37,18 +39,28 @@
|
||||||
<p class="item-heading">{{ 'addon.competency.path' | translate }}</p>
|
<p class="item-heading">{{ 'addon.competency.path' | translate }}</p>
|
||||||
<p>
|
<p>
|
||||||
<a *ngIf="competency.competency.comppath.showlinks" [href]="competencyFrameworkUrl" core-link>
|
<a *ngIf="competency.competency.comppath.showlinks" [href]="competencyFrameworkUrl" core-link>
|
||||||
{{ competency.competency.comppath.framework.name }}
|
<core-format-text [text]="competency.competency.comppath.framework.name" [contextLevel]="contextLevel"
|
||||||
|
[contextInstanceId]="contextInstanceId">
|
||||||
|
</core-format-text>
|
||||||
</a>
|
</a>
|
||||||
<ng-container *ngIf="!competency.competency.comppath.showlinks">
|
<ng-container *ngIf="!competency.competency.comppath.showlinks">
|
||||||
{{ competency.competency.comppath.framework.name }}
|
<core-format-text [text]="competency.competency.comppath.framework.name" [contextLevel]="contextLevel"
|
||||||
|
[contextInstanceId]="contextInstanceId">
|
||||||
|
</core-format-text>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
/
|
/
|
||||||
<ng-container *ngFor="let ancestor of competency.competency.comppath.ancestors">
|
<ng-container *ngFor="let ancestor of competency.competency.comppath.ancestors">
|
||||||
<button *ngIf="competency.competency.comppath.showlinks" (click)="openCompetencySummary(ancestor.id)"
|
<button *ngIf="competency.competency.comppath.showlinks" (click)="openCompetencySummary(ancestor.id)"
|
||||||
class="as-link">
|
class="as-link">
|
||||||
{{ ancestor.name }}
|
<core-format-text [text]="ancestor.name" [contextLevel]="contextLevel"
|
||||||
|
[contextInstanceId]="contextInstanceId">
|
||||||
|
</core-format-text>
|
||||||
</button>
|
</button>
|
||||||
<ng-container *ngIf="!competency.competency.comppath.showlinks">{{ ancestor.name }}</ng-container>
|
<ng-container *ngIf="!competency.competency.comppath.showlinks">
|
||||||
|
<core-format-text [text]="ancestor.name" [contextLevel]="contextLevel"
|
||||||
|
[contextInstanceId]="contextInstanceId">
|
||||||
|
</core-format-text>
|
||||||
|
</ng-container>
|
||||||
<ng-container *ngIf="!ancestor.last"> / </ng-container>
|
<ng-container *ngIf="!ancestor.last"> / </ng-container>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</p>
|
</p>
|
||||||
|
@ -63,7 +75,9 @@
|
||||||
<ng-container *ngIf="competency.competency.hasrelatedcompetencies">
|
<ng-container *ngIf="competency.competency.hasrelatedcompetencies">
|
||||||
<p *ngFor="let relatedcomp of competency.competency.relatedcompetencies">
|
<p *ngFor="let relatedcomp of competency.competency.relatedcompetencies">
|
||||||
<button (click)="openCompetencySummary(relatedcomp.id)" class="as-link">
|
<button (click)="openCompetencySummary(relatedcomp.id)" class="as-link">
|
||||||
{{ relatedcomp.shortname }} - {{ relatedcomp.idnumber }}
|
<core-format-text [text]="relatedcomp.shortname" [contextLevel]="contextLevel"
|
||||||
|
[contextInstanceId]="contextInstanceId">
|
||||||
|
</core-format-text> - {{ relatedcomp.idnumber }}
|
||||||
</button>
|
</button>
|
||||||
</p>
|
</p>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
|
@ -5,7 +5,9 @@
|
||||||
</ion-buttons>
|
</ion-buttons>
|
||||||
<ion-title>
|
<ion-title>
|
||||||
<h1 *ngIf="competency">
|
<h1 *ngIf="competency">
|
||||||
{{ competency.competency.shortname }} <small>{{ competency.competency.idnumber }}</small>
|
<core-format-text [text]="competency.competency.shortname" [contextLevel]="contextLevel"
|
||||||
|
[contextInstanceId]="contextInstanceId">
|
||||||
|
</core-format-text> <small>{{ competency.competency.idnumber }}</small>
|
||||||
</h1>
|
</h1>
|
||||||
</ion-title>
|
</ion-title>
|
||||||
</ion-toolbar>
|
</ion-toolbar>
|
||||||
|
@ -26,11 +28,16 @@
|
||||||
<ion-item class="ion-text-wrap">
|
<ion-item class="ion-text-wrap">
|
||||||
<ion-label>
|
<ion-label>
|
||||||
<p class="item-heading">{{ 'addon.competency.path' | translate }}</p>
|
<p class="item-heading">{{ 'addon.competency.path' | translate }}</p>
|
||||||
<p>{{ competency.comppath.framework.name }}
|
<p>
|
||||||
|
<core-format-text [text]="competency.comppath.framework.name" [contextLevel]="contextLevel"
|
||||||
|
[contextInstanceId]="contextInstanceId">
|
||||||
|
</core-format-text>
|
||||||
<ng-container *ngFor="let ancestor of competency.comppath.ancestors">
|
<ng-container *ngFor="let ancestor of competency.comppath.ancestors">
|
||||||
/
|
/
|
||||||
<button class="as-link" (click)="openCompetencySummary(ancestor.id)">
|
<button class="as-link" (click)="openCompetencySummary(ancestor.id)">
|
||||||
{{ ancestor.name }}
|
<core-format-text [text]="ancestor.name" [contextLevel]="contextLevel"
|
||||||
|
[contextInstanceId]="contextInstanceId">
|
||||||
|
</core-format-text>
|
||||||
</button>
|
</button>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</p>
|
</p>
|
||||||
|
|
|
@ -39,7 +39,8 @@
|
||||||
<p class="item-heading">{{ 'addon.competency.competenciesmostoftennotproficientincourse' | translate }}</p>
|
<p class="item-heading">{{ 'addon.competency.competenciesmostoftennotproficientincourse' | translate }}</p>
|
||||||
<p *ngFor="let comp of courseCompetencies.statistics.leastproficient">
|
<p *ngFor="let comp of courseCompetencies.statistics.leastproficient">
|
||||||
<button class="as-link" (click)="openCompetencySummary(comp.id)">
|
<button class="as-link" (click)="openCompetencySummary(comp.id)">
|
||||||
{{ comp.shortname }} - {{ comp.idnumber }}
|
<core-format-text [text]="comp.shortname" contextLevel="course" [contextInstanceId]="courseId">
|
||||||
|
</core-format-text> - {{ comp.idnumber }}
|
||||||
</button>
|
</button>
|
||||||
</p>
|
</p>
|
||||||
</ion-label>
|
</ion-label>
|
||||||
|
@ -67,7 +68,8 @@
|
||||||
[attr.aria-label]="competency.competency.shortname" detail="true" button>
|
[attr.aria-label]="competency.competency.shortname" detail="true" button>
|
||||||
<ion-label>
|
<ion-label>
|
||||||
<p class="item-heading">
|
<p class="item-heading">
|
||||||
{{competency.competency.shortname}} <em>{{competency.competency.idnumber}}</em>
|
<core-format-text [text]="competency.competency.shortname" contextLevel="course" [contextInstanceId]="courseId">
|
||||||
|
</core-format-text> <em>{{competency.competency.idnumber}}</em>
|
||||||
</p>
|
</p>
|
||||||
</ion-label>
|
</ion-label>
|
||||||
<ion-badge slot="end" *ngIf="competency.usercompetencycourse && competency.usercompetencycourse.gradename"
|
<ion-badge slot="end" *ngIf="competency.usercompetencycourse && competency.usercompetencycourse.gradename"
|
||||||
|
@ -87,18 +89,26 @@
|
||||||
<p>
|
<p>
|
||||||
<a *ngIf="competency.comppath.showlinks" [href]="getCompetencyFrameworkUrl(competency)" core-link
|
<a *ngIf="competency.comppath.showlinks" [href]="getCompetencyFrameworkUrl(competency)" core-link
|
||||||
[title]="competency.comppath.framework.name">
|
[title]="competency.comppath.framework.name">
|
||||||
{{ competency.comppath.framework.name }}
|
<core-format-text [text]="competency.comppath.framework.name" contextLevel="course"
|
||||||
|
[contextInstanceId]="courseId">
|
||||||
|
</core-format-text>
|
||||||
</a>
|
</a>
|
||||||
<ng-container *ngIf="!competency.comppath.showlinks">
|
<ng-container *ngIf="!competency.comppath.showlinks">
|
||||||
{{ competency.comppath.framework.name }}
|
<core-format-text [text]="competency.comppath.framework.name" contextLevel="course"
|
||||||
|
[contextInstanceId]="courseId">
|
||||||
|
</core-format-text>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
/
|
/
|
||||||
<ng-container *ngFor="let ancestor of competency.comppath.ancestors">
|
<ng-container *ngFor="let ancestor of competency.comppath.ancestors">
|
||||||
<button class="as-link" *ngIf="competency.comppath.showlinks"
|
<button class="as-link" *ngIf="competency.comppath.showlinks"
|
||||||
(click)="openCompetencySummary(ancestor.id)">
|
(click)="openCompetencySummary(ancestor.id)">
|
||||||
{{ ancestor.name }}
|
<core-format-text [text]="ancestor.name" contextLevel="course" [contextInstanceId]="courseId">
|
||||||
|
</core-format-text>
|
||||||
</button>
|
</button>
|
||||||
<ng-container *ngIf="!competency.comppath.showlinks">{{ ancestor.name }}</ng-container>
|
<ng-container *ngIf="!competency.comppath.showlinks">
|
||||||
|
<core-format-text [text]="ancestor.name" contextLevel="course" [contextInstanceId]="courseId">
|
||||||
|
</core-format-text>
|
||||||
|
</ng-container>
|
||||||
<ng-container *ngIf="!ancestor.last"> / </ng-container>
|
<ng-container *ngIf="!ancestor.last"> / </ng-container>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</p>
|
</p>
|
||||||
|
|
|
@ -4,7 +4,10 @@
|
||||||
<ion-back-button [text]="'core.back' | translate"></ion-back-button>
|
<ion-back-button [text]="'core.back' | translate"></ion-back-button>
|
||||||
</ion-buttons>
|
</ion-buttons>
|
||||||
<ion-title>
|
<ion-title>
|
||||||
<h1 *ngIf="plan">{{plan.plan.name}}</h1>
|
<h1 *ngIf="plan">
|
||||||
|
<core-format-text [text]="plan.plan.name" contextLevel="user" [contextInstanceId]="plan.plan.userid">
|
||||||
|
</core-format-text>
|
||||||
|
</h1>
|
||||||
</ion-title>
|
</ion-title>
|
||||||
</ion-toolbar>
|
</ion-toolbar>
|
||||||
</ion-header>
|
</ion-header>
|
||||||
|
@ -46,7 +49,10 @@
|
||||||
<ion-item class="ion-text-wrap" *ngIf="plan.plan.template">
|
<ion-item class="ion-text-wrap" *ngIf="plan.plan.template">
|
||||||
<ion-label>
|
<ion-label>
|
||||||
<p class="item-heading">{{ 'addon.competency.template' | translate }}</p>
|
<p class="item-heading">{{ 'addon.competency.template' | translate }}</p>
|
||||||
<p>{{ plan.plan.template.shortname }}</p>
|
<p>
|
||||||
|
<core-format-text [text]="plan.plan.template.shortname" contextLevel="system" [contextInstanceId]="0">
|
||||||
|
</core-format-text>
|
||||||
|
</p>
|
||||||
</ion-label>
|
</ion-label>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
<ion-item class="ion-text-wrap">
|
<ion-item class="ion-text-wrap">
|
||||||
|
@ -77,7 +83,11 @@
|
||||||
<ion-item class="ion-text-wrap" *ngFor="let competency of competencies.items" (click)="competencies.select(competency)"
|
<ion-item class="ion-text-wrap" *ngFor="let competency of competencies.items" (click)="competencies.select(competency)"
|
||||||
[attr.aria-label]="competency.competency.shortname" detail="true" button>
|
[attr.aria-label]="competency.competency.shortname" detail="true" button>
|
||||||
<ion-label>
|
<ion-label>
|
||||||
<p class="item-heading">{{competency.competency.shortname}} <em>{{competency.competency.idnumber}}</em></p>
|
<p class="item-heading">
|
||||||
|
<core-format-text [text]="competency.competency.shortname" contextLevel="user"
|
||||||
|
[contextInstanceId]="plan.plan.userid">
|
||||||
|
</core-format-text> <em>{{competency.competency.idnumber}}</em>
|
||||||
|
</p>
|
||||||
</ion-label>
|
</ion-label>
|
||||||
<ion-badge *ngIf="competency.usercompetencyplan" slot="end"
|
<ion-badge *ngIf="competency.usercompetencyplan" slot="end"
|
||||||
[color]="competency.usercompetencyplan.proficiency ? 'success' : 'danger'">
|
[color]="competency.usercompetencyplan.proficiency ? 'success' : 'danger'">
|
||||||
|
|
|
@ -21,7 +21,10 @@
|
||||||
<ion-item class="ion-text-wrap" *ngFor="let plan of plans.items" [attr.aria-label]="plan.name" (click)="plans.select(plan)"
|
<ion-item class="ion-text-wrap" *ngFor="let plan of plans.items" [attr.aria-label]="plan.name" (click)="plans.select(plan)"
|
||||||
[attr.aria-current]="plans.getItemAriaCurrent(plan)" button detail="true">
|
[attr.aria-current]="plans.getItemAriaCurrent(plan)" button detail="true">
|
||||||
<ion-label>
|
<ion-label>
|
||||||
<p class="item-heading">{{ plan.name }}</p>
|
<p class="item-heading">
|
||||||
|
<core-format-text [text]="plan.name" contextLevel="user" [contextInstanceId]="plan.userid">
|
||||||
|
</core-format-text>
|
||||||
|
</p>
|
||||||
<p *ngIf="plan.duedate > 0">
|
<p *ngIf="plan.duedate > 0">
|
||||||
{{ 'addon.competency.duedate' | translate }}:
|
{{ 'addon.competency.duedate' | translate }}:
|
||||||
{{ plan.duedate * 1000 | coreFormatDate :'strftimedatetimeshort' }}
|
{{ plan.duedate * 1000 | coreFormatDate :'strftimedatetimeshort' }}
|
||||||
|
|
|
@ -41,14 +41,12 @@ export class AddonCompetencyPlanListPage implements AfterViewInit, OnDestroy {
|
||||||
protected logView: () => void;
|
protected logView: () => void;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
const userId = CoreNavigator.getRouteNumberParam('userId');
|
const userId = CoreNavigator.getRouteNumberParam('userId') ?? CoreSites.getCurrentSiteUserId();
|
||||||
const source = CoreRoutedItemsManagerSourcesTracker.getOrCreateSource(AddonCompetencyPlansSource, [userId]);
|
const source = CoreRoutedItemsManagerSourcesTracker.getOrCreateSource(AddonCompetencyPlansSource, [userId]);
|
||||||
|
|
||||||
this.plans = new CoreListItemsManager(source, AddonCompetencyPlanListPage);
|
this.plans = new CoreListItemsManager(source, AddonCompetencyPlanListPage);
|
||||||
|
|
||||||
this.logView = CoreTime.once(async () => {
|
this.logView = CoreTime.once(async () => {
|
||||||
const userId = source.USER_ID ?? CoreSites.getCurrentSiteId();
|
|
||||||
|
|
||||||
CoreAnalytics.logEvent({
|
CoreAnalytics.logEvent({
|
||||||
type: CoreAnalyticsEventType.VIEW_ITEM_LIST,
|
type: CoreAnalyticsEventType.VIEW_ITEM_LIST,
|
||||||
ws: 'tool_lp_data_for_plans_page',
|
ws: 'tool_lp_data_for_plans_page',
|
||||||
|
|
Loading…
Reference in New Issue