File
Methods
goToReports
|
goToReports(entity)
|
|
|
import { Component } from '@angular/core';
import { Router } from '@angular/router';
import { RouterLinks } from '@app/app/app.constant';
import { ToastService } from '../../core';
@Component({
selector: 'app-observation-solution-entity-listing',
templateUrl: './observation-solution-entity-listing.component.html',
styleUrls: ['./observation-solution-entity-listing.component.scss'],
})
export class ObservationSolutionEntityListingComponent {
solutionDetails;
constructor(private router: Router, private toast: ToastService) {
console.log(this.router.getCurrentNavigation().extras.state);
this.solutionDetails = this.router.getCurrentNavigation().extras.state;
}
goToReports(entity) {
let state = {
scores: false,
observation: true,
entityId: entity._id,
entityType: this.solutionDetails.entityType,
observationId: this.solutionDetails.observationId,
};
if (this.solutionDetails.isRubricDriven) {
state.scores = true;
}
if (!this.solutionDetails.criteriaLevelReport) {
state['filter'] = { questionId: [] };
state['criteriaWise'] = false;
}
this.router.navigate([RouterLinks.GENERIC_REPORT], {
state: state,
});
}
}
<ion-content>
<div>
<app-common-header [title]="solutionDetails?.name"
[subTitle]="solutionDetails?.programName"></app-common-header>
</div>
<div>
<div *ngFor="let entity of solutionDetails?.entities; let solutionIndex = index">
<app-item-list-card
[title]="entity?.name"
[subTitle]="entity?.programName"
(cardSelect)="goToReports(entity)"
>
<ion-icon class="mg-popup-btn-icon" name="arrow-forward" arrow></ion-icon>
</app-item-list-card>
</div>
</div>
<app-no-data *ngIf="!solutionDetails?.entities?.length"></app-no-data>
</ion-content>
Legend
Html element with directive