* kanban entry basic label support

This commit is contained in:
Dávid Danyi 2017-08-18 15:51:50 +02:00
parent eb6d65244f
commit 935af4c533
4 changed files with 27 additions and 0 deletions

View File

@ -23,3 +23,7 @@
.ui.divided.items > .item {
border-top: 1px solid rgba(250, 250, 250, 0.25);
}
.ui.label {
opacity: 0.85;
}

View File

@ -3,6 +3,9 @@
<div class="item" *ngFor="let kanbanEntry of kanbanEntries">
<div class="content">
<div class="task-description">
<ng-template [ngIf]="hasLabels(kanbanEntry)">
<a *ngFor="let label of kanbanEntry.labels" class="ui mini {{labelClass(label)}} right floated label">{{label}}</a>
</ng-template>
<div class="ui jira-avatar floated image">
<img src="{{avatarUrl(kanbanEntry.assignee?.avatar)}}">
</div>

View File

@ -5,6 +5,13 @@ import {KanbanEntry} from "../shared/kanban-entry.model";
const DEFAULT_AVATAR = '/assets/riddler.png';
const labelColors = {
TSP: 'teal',
MTAS: 'orange',
Internal: 'yellow',
Team: 'yellow',
};
@Component({
selector: 'app-kanban-entry-item,[app-kanban-entry-item]',
templateUrl: './kanban-entry-item.component.html',
@ -21,4 +28,16 @@ export class KanbanEntryItemComponent implements OnInit {
public avatarUrl(avatarPath: string): string {
return environment.apiUri + ( avatarPath ? avatarPath : DEFAULT_AVATAR );
}
public hasLabels(entry: KanbanEntry): boolean {
return entry.labels.length > 0;
}
public labelClass(label: string): string {
try {
return labelColors[label];
} catch(e) {
return 'white';
}
}
}

View File

@ -11,6 +11,7 @@ export class KanbanEntry {
public assignee: JiraAssignee;
public issuePriority: string
public issuePriorityIcon: string;
public labels: Array<string>;
public prio: number;
public functionalAreas: Array<string>;
public externalId: string;