From c9473986d3eb5527f112e17441492cc50f522943 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20G=C3=BCnther?= Date: Wed, 6 Mar 2019 14:05:31 +0100 Subject: [PATCH] Add highlighting for status in list --- .../board/board-list/board-list.component.html | 8 +++++++- .../board/board-list/board-list.component.sass | 8 ++++++++ .../board/board-list/board-list.component.ts | 18 +++++++++++++++++- .../modules/boards/board/board.component.html | 4 +++- .../modules/boards/board/board.component.sass | 1 - .../modules/boards/board/board.component.ts | 13 ++++++++++++- 6 files changed, 47 insertions(+), 5 deletions(-) diff --git a/frontend/src/app/modules/boards/board/board-list/board-list.component.html b/frontend/src/app/modules/boards/board/board-list/board-list.component.html index 6f227ca973..36a8f838a2 100644 --- a/frontend/src/app/modules/boards/board/board-list/board-list.component.html +++ b/frontend/src/app/modules/boards/board/board-list/board-list.component.html @@ -1,8 +1,14 @@
+ class="board-list--container loading-indicator--location" + [ngClass]="{ '-action-list': board.isAction }"> +
+
+
(); + /** Access to the board resource */ + @Input() public board:Board; + /** Access to the loading indicator element */ @ViewChild('loadingIndicator') indicator:ElementRef; @@ -130,6 +135,17 @@ export class BoardListComponent extends AbstractWidgetComponent implements OnIni .catch(() => this.inFlight = false); } + public boardListActionColorClass(query:QueryResource):string { + const attribute = this.board.actionAttribute!; + const filter = _.find(query.filters, f => f.id === attribute); + + if (!(filter && filter.values[0] instanceof HalResource)) { + return ''; + } + const value = filter.values[0] as HalResource; + return `__hl_row_${attribute}_${value.getId()}`; + } + public get listName() { return this.query && this.query.name; } diff --git a/frontend/src/app/modules/boards/board/board.component.html b/frontend/src/app/modules/boards/board/board.component.html index cd7cbfca4d..99c9568e9b 100644 --- a/frontend/src/app/modules/boards/board/board.component.html +++ b/frontend/src/app/modules/boards/board/board.component.html @@ -50,7 +50,9 @@ - +
this.board = board); + .subscribe(board => { + this.board = board; + + if (board.isAction && !initialized) { + this.dynamicCss.requireHighlighting(); + initialized = true; + } + }); } ngOnDestroy():void {