* kanban entry basic label support
This commit is contained in:
parent
eb6d65244f
commit
935af4c533
@ -23,3 +23,7 @@
|
||||
.ui.divided.items > .item {
|
||||
border-top: 1px solid rgba(250, 250, 250, 0.25);
|
||||
}
|
||||
|
||||
.ui.label {
|
||||
opacity: 0.85;
|
||||
}
|
||||
@ -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>
|
||||
|
||||
@ -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';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user