|
|
@ -2,7 +2,7 @@ import { |
|
|
|
ChangeDetectorRef, |
|
|
|
ChangeDetectorRef, |
|
|
|
Component, |
|
|
|
Component, |
|
|
|
ElementRef, |
|
|
|
ElementRef, |
|
|
|
EventEmitter, |
|
|
|
EventEmitter, Input, |
|
|
|
OnDestroy, |
|
|
|
OnDestroy, |
|
|
|
OnInit, |
|
|
|
OnInit, |
|
|
|
Output, |
|
|
|
Output, |
|
|
@ -23,6 +23,8 @@ import {BoardCacheService} from "core-app/modules/boards/board/board-cache.servi |
|
|
|
import {StateService} from "@uirouter/core"; |
|
|
|
import {StateService} from "@uirouter/core"; |
|
|
|
import {NotificationsService} from "core-app/modules/common/notifications/notifications.service"; |
|
|
|
import {NotificationsService} from "core-app/modules/common/notifications/notifications.service"; |
|
|
|
import {IsolatedQuerySpace} from "core-app/modules/work_packages/query-space/isolated-query-space"; |
|
|
|
import {IsolatedQuerySpace} from "core-app/modules/work_packages/query-space/isolated-query-space"; |
|
|
|
|
|
|
|
import {Board} from "core-app/modules/boards/board/board"; |
|
|
|
|
|
|
|
import {HalResource} from "core-app/modules/hal/resources/hal-resource"; |
|
|
|
|
|
|
|
|
|
|
|
@Component({ |
|
|
|
@Component({ |
|
|
|
selector: 'board-list', |
|
|
|
selector: 'board-list', |
|
|
@ -36,6 +38,9 @@ export class BoardListComponent extends AbstractWidgetComponent implements OnIni |
|
|
|
/** Output fired upon query removal */ |
|
|
|
/** Output fired upon query removal */ |
|
|
|
@Output() onRemove = new EventEmitter<void>(); |
|
|
|
@Output() onRemove = new EventEmitter<void>(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** Access to the board resource */ |
|
|
|
|
|
|
|
@Input() public board:Board; |
|
|
|
|
|
|
|
|
|
|
|
/** Access to the loading indicator element */ |
|
|
|
/** Access to the loading indicator element */ |
|
|
|
@ViewChild('loadingIndicator') indicator:ElementRef; |
|
|
|
@ViewChild('loadingIndicator') indicator:ElementRef; |
|
|
|
|
|
|
|
|
|
|
@ -130,6 +135,17 @@ export class BoardListComponent extends AbstractWidgetComponent implements OnIni |
|
|
|
.catch(() => this.inFlight = false); |
|
|
|
.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() { |
|
|
|
public get listName() { |
|
|
|
return this.query && this.query.name; |
|
|
|
return this.query && this.query.name; |
|
|
|
} |
|
|
|
} |
|
|
|