src/app/tool-page/tool-view/tool-view.component.ts
Container for the tool view.
| selector | app-tool-view |
| styleUrls | tool-view.component.css |
| templateUrl | ./tool-view.component.html |
Properties |
|
Methods |
constructor(courseService: CourseService, toolService: ToolService, settingsService: SettingsService)
|
||||||||||||||||
|
Constructor
Parameters :
|
| getIssueCount |
getIssueCount()
|
|
Determines the current total count of issues from all selected courses discovered by the currently selected tool.
Returns :
any
|
| Public courseService |
courseService:
|
Type : CourseService
|
|
Provides information and management for the currently selected courses.
|
| Public settingsService |
settingsService:
|
Type : SettingsService
|
|
Provides this component with access to user settings.
|
| Public toolService |
toolService:
|
Type : ToolService
|
|
Provides information and management for available tools.
|
import { Component } from '@angular/core';
import { CourseService } from '../../course.service';
import { ToolService } from '../../tool.service';
import { SettingsService } from '../../settings.service';
/**
* Container for the tool view.
*/
@Component({
selector: 'app-tool-view',
templateUrl: './tool-view.component.html',
styleUrls: ['./tool-view.component.css']
})
export class ToolViewComponent {
/**
* Constructor
* @param courseService Provides information and management for the currently selected courses.
* @param toolService Provides information and management for available tools.
* @param settingsService Provides this component with access to user settings.
*/
constructor(public courseService: CourseService,
public toolService: ToolService,
public settingsService: SettingsService) { }
/**
* Determines the current total count of issues from all selected courses
* discovered by the currently selected tool.
*/
getIssueCount() {
return this.courseService.courses.reduce((acc, course) => {
if (!course.issueItems) return acc;
return acc += course.issueItems.reduce((acc2, issueItem) => {
if (!issueItem.issues) return acc2;
return acc2 += issueItem.issues.length;
}, 0)
}, 0);
}
}
<div *ngIf="courseService.selectedCourse.processing">
<div class="progress">
<div class="indeterminate"></div>
</div>
<div class="ashen-text">
{{settingsService.checkLocalStorage('goofMessages') ? settingsService.buildProcessingMessage() : toolService.processingMessage}}
</div>
</div>
<div class="issueContainer" *ngIf="!courseService.selectedCourse.processing">
<app-issue-list></app-issue-list>
<div>
<app-issue-details></app-issue-details>
<app-issue-nav></app-issue-nav>
</div>
</div>