Hides amendments entry in menu if deactivated

This commit is contained in:
Joshua Sangmeister 2020-05-28 15:26:56 +02:00
parent dcf5d5316c
commit a84bfccd07
2 changed files with 9 additions and 1 deletions

View File

@ -236,7 +236,7 @@
</div>
<!-- Amendments -->
<div *ngIf="perms.isAllowed('manage') || hasAmendments()">
<div *ngIf="amendmentsEnabled && (perms.isAllowed('manage') || hasAmendments())">
<button mat-menu-item routerLink="amendments">
<!-- color_lens -->
<!-- format_paint -->

View File

@ -139,6 +139,11 @@ export class MotionListComponent extends BaseListViewComponent<ViewMotion> imple
*/
public statutesEnabled: boolean;
/**
* Value of the configuration variable `motions_amendments_enabled` - are amendments enabled?
*/
public amendmentsEnabled: boolean;
/**
* Value of the config variable `motions_show_sequential_numbers`
*/
@ -235,6 +240,9 @@ export class MotionListComponent extends BaseListViewComponent<ViewMotion> imple
this.configService
.get<boolean>('motions_statutes_enabled')
.subscribe(enabled => (this.statutesEnabled = enabled));
this.configService
.get<boolean>('motions_amendments_enabled')
.subscribe(enabled => (this.amendmentsEnabled = enabled));
this.configService.get<string>('motions_recommendations_by').subscribe(recommender => {
this.recommendationEnabled = !!recommender;
});