From 3d5f79a76c78da9b1f86410c0916812047b6cc0c Mon Sep 17 00:00:00 2001 From: GabrielMeyer Date: Tue, 30 Apr 2019 16:53:50 +0200 Subject: [PATCH] Fields are only available if they are available - The user can change information about motions - The user can send an invitation email --- .../motion-list/motion-list.component.html | 6 +-- .../motion-list/motion-list.component.ts | 54 +++++++++++++++++-- .../user-detail/user-detail.component.html | 2 +- 3 files changed, 55 insertions(+), 7 deletions(-) diff --git a/client/src/app/site/motions/modules/motion-list/components/motion-list/motion-list.component.html b/client/src/app/site/motions/modules/motion-list/components/motion-list/motion-list.component.html index a928403b6..bea288349 100644 --- a/client/src/app/site/motions/modules/motion-list/components/motion-list/motion-list.component.html +++ b/client/src/app/site/motions/modules/motion-list/components/motion-list/motion-list.component.html @@ -339,7 +339,7 @@
- + - @@ -348,7 +348,7 @@ - + - @@ -357,7 +357,7 @@ - + {{ tag.getTitle() | translate }} diff --git a/client/src/app/site/motions/modules/motion-list/components/motion-list/motion-list.component.ts b/client/src/app/site/motions/modules/motion-list/components/motion-list/motion-list.component.ts index 2fcf6b921..eae0e49c0 100644 --- a/client/src/app/site/motions/modules/motion-list/components/motion-list/motion-list.component.ts +++ b/client/src/app/site/motions/modules/motion-list/components/motion-list/motion-list.component.ts @@ -169,9 +169,18 @@ export class MotionListComponent extends ListViewBaseComponent('motions_recommendations_by').subscribe(recommender => { this.recommendationEnabled = !!recommender; }); - this.motionBlockRepo.getViewModelListObservable().subscribe(mBs => (this.motionBlocks = mBs)); - this.categoryRepo.getViewModelListObservable().subscribe(cats => (this.categories = cats)); - this.tagRepo.getViewModelListObservable().subscribe(tags => (this.tags = tags)); + this.motionBlockRepo.getViewModelListObservable().subscribe(mBs => { + this.motionBlocks = mBs; + this.updateStateColumnVisibility(); + }); + this.categoryRepo.getViewModelListObservable().subscribe(cats => { + this.categories = cats; + this.updateStateColumnVisibility(); + }); + this.tagRepo.getViewModelListObservable().subscribe(tags => { + this.tags = tags; + this.updateStateColumnVisibility(); + }); this.workflowRepo.getViewModelListObservable().subscribe(wfs => (this.workflows = wfs)); this.setFulltextFilter(); } @@ -436,4 +445,43 @@ export class MotionListComponent extends ListViewBaseComponent 0; + } + + /** + * Checks if tags are available. + * + * @returns A boolean if they are available. + */ + public isTagAvailable(): boolean { + return !!this.tags && this.tags.length > 0; + } + + /** + * Checks if categories are available. + * + * @returns A boolean if they are available. + */ + public isCategoryAvailable(): boolean { + return !!this.categories && this.categories.length > 0; + } } diff --git a/client/src/app/site/users/components/user-detail/user-detail.component.html b/client/src/app/site/users/components/user-detail/user-detail.component.html index dc07ee93e..9910c2bc3 100644 --- a/client/src/app/site/users/components/user-detail/user-detail.component.html +++ b/client/src/app/site/users/components/user-detail/user-detail.component.html @@ -32,7 +32,7 @@ Change password -