src/app/jobs/components/definition-status.component.ts
Component used to format the deployment status of Job Executions.
selector | app-definition-status |
Properties |
Methods |
|
Inputs |
jobExecution
|
The Job Execution from which the status will be retrieved.
Type: |
ngAfterContentInit |
ngAfterContentInit()
|
Returns :
void
|
ngDoCheck |
ngDoCheck()
|
Returns :
void
|
Private setStyle |
setStyle()
|
Returns :
void
|
label |
label:
|
Type : string
|
labelClass |
labelClass:
|
Type : string
|
import {
AfterContentInit, Component, DoCheck, Input
} from '@angular/core';
import { JobExecution } from '../model/job-execution.model';
/**
* Component used to format the deployment status of Job Executions.
*
* @author Gunnar Hillert
*/
@Component({
selector: 'app-definition-status',
template: `
<span class="label label-{{ labelClass }}">{{ label }}</span>
`
})
export class DefinitionStatusComponent implements AfterContentInit, DoCheck {
/**
* The Job Execution from which the status will be retrieved.
*/
@Input()
jobExecution: JobExecution;
label: string;
labelClass: string;
ngAfterContentInit() {
this.setStyle();
}
ngDoCheck() {
this.setStyle();
}
private setStyle() {
if (this.jobExecution) {
if (!this.jobExecution.defined) {
this.labelClass = 'info';
this.label = 'No Task Definition';
}
}
}
}