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