added an indicator if all motions of a block are finished

This commit is contained in:
Joshua Sangmeister 2020-03-12 11:49:34 +01:00
parent 3ad8944b9c
commit aa46922c8b
4 changed files with 43 additions and 9 deletions

View File

@ -23,6 +23,13 @@ export class ViewMotionBlock extends BaseViewModelWithAgendaItemAndListOfSpeaker
return this._model; return this._model;
} }
/**
* A block is finished when all its motions are in a final state
*/
public get isFinished(): boolean {
return this.motions && this.motions.length && this.motions.every(motion => motion.isInFinalState());
}
/** /**
* Formats the category for search * Formats the category for search
* *

View File

@ -1,10 +1,24 @@
<os-head-bar [nav]="false"> <os-head-bar [nav]="false">
<!-- Title --> <!-- Title -->
<div class="title-slot"> <div class="title-slot">
<h2 *ngIf="block"> <os-icon-container
<mat-icon *ngIf="block.internal">lock</mat-icon> *ngIf="block"
{{ block.title }} [noWrap]="true"
</h2> icon="check"
size="large"
[showIcon]="block.isFinished"
[iconTooltip]="'Finished' | translate"
>
<os-icon-container
[noWrap]="true"
icon="lock"
size="large"
[showIcon]="block.internal"
[iconTooltip]="'Internal' | translate"
>
<h2>{{ block.title }}</h2>
</os-icon-container>
</os-icon-container>
</div> </div>
<!-- Menu --> <!-- Menu -->

View File

@ -148,6 +148,7 @@ export class MotionBlockDetailComponent extends BaseListViewComponent<ViewMotion
this.configService this.configService
.get<boolean>('motions_show_sequential_numbers') .get<boolean>('motions_show_sequential_numbers')
.subscribe(show => (this.showSequential = show)); .subscribe(show => (this.showSequential = show));
(<any>window).comp = this;
} }
/** /**

View File

@ -19,16 +19,28 @@
<!-- Title column --> <!-- Title column -->
<div *pblNgridCellDef="'title'; value as title; row as block; rowContext as rowContext" class="cell-slot fill"> <div *pblNgridCellDef="'title'; value as title; row as block; rowContext as rowContext" class="cell-slot fill">
<a class="detail-link" [routerLink]="block.id" *ngIf="!isMultiSelect"></a> <a class="detail-link" [routerLink]="block.id" *ngIf="!isMultiSelect"></a>
<!--
TODO: Tooltips do not work when hidden under the absolute link, but they can't be above it either,
because for some reason they don't delegate the click event. So no tooltips for now
-->
<div class="innerTable"> <div class="innerTable">
<os-icon-container <os-icon-container
[noWrap]="true" [noWrap]="true"
[icon]="block.internal ? 'lock' : null" [icon]="block.isFinished ? 'check' : block.internal ? 'lock' : null"
size="large" size="large"
[matTooltip]="Internal" [iconTooltip]="block.isFinished ? 'Finished' : block.internal ? 'Internal' : '' | translate"
> >
<div class="ellipsis-overflow"> <os-icon-container
{{ title }} [noWrap]="true"
</div> icon="lock"
size="large"
[showIcon]="block.isFinished && block.internal"
[iconTooltip]="'Internal' | translate"
>
<div class="ellipsis-overflow">
{{ title }}
</div>
</os-icon-container>
</os-icon-container> </os-icon-container>
</div> </div>
</div> </div>