Show sequential number in motion list

Shows the sequential number (ID) in motion list
This commit is contained in:
Sean Engelhardt 2019-04-04 14:52:47 +02:00
parent 6364a04d22
commit 1dd8562dfc
5 changed files with 22 additions and 5 deletions

View File

@ -163,6 +163,12 @@ export abstract class ListViewBaseComponent<V extends BaseViewModel, M extends B
this.dataSource.paginator = this.paginator;
}
/**
* Central search/filter function. Can be extended and overwritten by a filterPredicate.
* Functions for that are usually called 'setFulltextFilter'
*
* @param event the string to search for
*/
public searchFilter(event: string): void {
this.dataSource.filter = event;
}

View File

@ -683,18 +683,18 @@
></os-search-value-selector>
</div>
<div class="extra-data" *osPerms="'motion.can_manage'">
<div class="extra-data">
<!-- Attachments -->
<div *ngIf="motion.hasAttachments() || editMotion" class="content-field">
<div *ngIf="!editMotion">
<h3>{{ 'Attachments' | translate }}<mat-icon>attach_file</mat-icon></h3>
<mat-list dense>
<mat-list-item *ngFor="let file of motion.attachments">
<a [routerLink]="" (click)="onClickAttacment(file)">{{ file.title }}</a>
<a [routerLink]="" (click)="onClickAttachment(file)">{{ file.title }}</a>
</mat-list-item>
</mat-list>
</div>
<div *ngIf="editMotion" class="shortened-selector">
<div *osPerms="'motions.can_manage';and:editMotion" class="shortened-selector">
<os-search-value-selector
class="selector"
ngDefaultControl

View File

@ -1294,7 +1294,7 @@ export class MotionDetailComponent extends BaseViewComponent implements OnInit,
*
* @param attachment the selected file
*/
public onClickAttacment(attachment: Mediafile): void {
public onClickAttachment(attachment: Mediafile): void {
window.open(attachment.downloadUrl);
}

View File

@ -75,6 +75,11 @@
<!-- submitters line -->
<div class="submitters-line ellipsis-overflow" *ngIf="motion.submitters.length">
<span translate>by</span> {{ motion.submitters }}
<span *osPerms="'motions.can_manage'">
&middot;
<span translate>Sequential number</span>
{{ motion.id }}
</span>
</div>
<!-- state line-->
<div class="ellipsis-overflow white">

View File

@ -295,7 +295,7 @@ export class MotionListComponent extends ListViewBaseComponent<ViewMotion, Motio
/**
* Overwrites the dataSource's string filter with a case-insensitive search
* in the identifier, title, state, recommendations, submitters and motion blocks
* in the identifier, title, state, recommendations, submitters, motion blocks and id
*/
private setFulltextFilter(): void {
this.dataSource.filterPredicate = (data, filter) => {
@ -332,6 +332,12 @@ export class MotionListComponent extends ListViewBaseComponent<ViewMotion, Motio
if (data.identifier && data.identifier.toLowerCase().includes(filter)) {
return true;
}
const dataid = '' + data.id;
if (dataid.includes(filter)) {
return true;
}
return false;
};
}