Merge pull request #5246 from jsangmeister/motion-block-check

Added an indicator if all motions of a block are finished
This commit is contained in:
Emanuel Schütze 2020-03-12 21:24:01 +01:00 committed by GitHub
commit 4d4697eee0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 43 additions and 9 deletions

View File

@ -23,6 +23,13 @@ export class ViewMotionBlock extends BaseViewModelWithAgendaItemAndListOfSpeaker
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
*

View File

@ -1,10 +1,24 @@
<os-head-bar [nav]="false">
<!-- Title -->
<div class="title-slot">
<h2 *ngIf="block">
<mat-icon *ngIf="block.internal">lock</mat-icon>
{{ block.title }}
</h2>
<os-icon-container
*ngIf="block"
[noWrap]="true"
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>
<!-- Menu -->

View File

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

View File

@ -19,16 +19,28 @@
<!-- Title column -->
<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>
<!--
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">
<os-icon-container
[noWrap]="true"
[icon]="block.internal ? 'lock' : null"
[icon]="block.isFinished ? 'check' : block.internal ? 'lock' : null"
size="large"
[matTooltip]="Internal"
[iconTooltip]="block.isFinished ? 'Finished' : block.internal ? 'Internal' : '' | translate"
>
<div class="ellipsis-overflow">
{{ title }}
</div>
<os-icon-container
[noWrap]="true"
icon="lock"
size="large"
[showIcon]="block.isFinished && block.internal"
[iconTooltip]="'Internal' | translate"
>
<div class="ellipsis-overflow">
{{ title }}
</div>
</os-icon-container>
</os-icon-container>
</div>
</div>