Show or hide motion id in amendment list by config

Hides the motion id in the list of amendments if the given config was
enabled or disabled
This commit is contained in:
Sean 2020-09-16 12:48:12 +02:00
parent 04477d9ebd
commit df2e26c3ed
2 changed files with 16 additions and 6 deletions

View File

@ -59,11 +59,13 @@
{{ motion.submitters }} {{ motion.submitters }}
</span> </span>
<span *ngIf="showSequentialNumber">
<span *ngIf="motion.submitters.length"> <span *ngIf="motion.submitters.length">
&middot; &middot;
</span> </span>
<span>{{ 'Sequential number' | translate }}</span> <span>{{ 'Sequential number' | translate }}</span>
{{ motion.id }} {{ motion.id }}
</span>
</div> </div>
<!-- State --> <!-- State -->

View File

@ -13,6 +13,7 @@ import { AmendmentFilterListService } from '../../services/amendment-filter-list
import { AmendmentSortListService } from '../../services/amendment-sort-list.service'; import { AmendmentSortListService } from '../../services/amendment-sort-list.service';
import { StorageService } from 'app/core/core-services/storage.service'; import { StorageService } from 'app/core/core-services/storage.service';
import { MotionRepositoryService } from 'app/core/repositories/motions/motion-repository.service'; import { MotionRepositoryService } from 'app/core/repositories/motions/motion-repository.service';
import { ConfigService } from 'app/core/ui-services/config.service';
import { LinenumberingService } from 'app/core/ui-services/linenumbering.service'; import { LinenumberingService } from 'app/core/ui-services/linenumbering.service';
import { OverlayService } from 'app/core/ui-services/overlay.service'; import { OverlayService } from 'app/core/ui-services/overlay.service';
import { ItemVisibilityChoices } from 'app/shared/models/agenda/item'; import { ItemVisibilityChoices } from 'app/shared/models/agenda/item';
@ -51,6 +52,8 @@ export class AmendmentListComponent extends BaseListViewComponent<ViewMotion> im
*/ */
public itemVisibility = ItemVisibilityChoices; public itemVisibility = ItemVisibilityChoices;
public showSequentialNumber: boolean;
/** /**
* Column defintiion * Column defintiion
*/ */
@ -85,7 +88,7 @@ export class AmendmentListComponent extends BaseListViewComponent<ViewMotion> im
* @param motionRepo get the motions * @param motionRepo get the motions
* @param motionSortService the default motion sorter * @param motionSortService the default motion sorter
* *
* @param configService get config vars * @param Service get config vars
*/ */
public constructor( public constructor(
titleService: Title, titleService: Title,
@ -102,7 +105,8 @@ export class AmendmentListComponent extends BaseListViewComponent<ViewMotion> im
private motionExport: MotionExportService, private motionExport: MotionExportService,
private linenumberingService: LinenumberingService, private linenumberingService: LinenumberingService,
private pdfExport: MotionPdfExportService, private pdfExport: MotionPdfExportService,
private overlayService: OverlayService private overlayService: OverlayService,
private configService: ConfigService
) { ) {
super(titleService, translate, matSnackBar, storage); super(titleService, translate, matSnackBar, storage);
super.setTitle('Amendments'); super.setTitle('Amendments');
@ -124,6 +128,10 @@ export class AmendmentListComponent extends BaseListViewComponent<ViewMotion> im
} else { } else {
this.amendmentFilterService.parentMotionId = undefined; this.amendmentFilterService.parentMotionId = undefined;
} }
this.configService
.get<boolean>('motions_show_sequential_numbers')
.subscribe(show => (this.showSequentialNumber = show));
} }
/** /**