From e59497bc54a1b5745709cf81e047341984b40ee3 Mon Sep 17 00:00:00 2001 From: FinnStutzenstein Date: Thu, 25 Oct 2018 15:11:38 +0200 Subject: [PATCH] Setting change recommendations internal --- .../models/motions/motion-change-reco.ts | 1 + ...otion-change-recommendation.component.html | 2 + .../motion-change-recommendation.component.ts | 8 +-- .../motion-detail-diff.component.html | 4 ++ .../motion-detail-diff.component.ts | 16 ++++-- .../site/motions/models/view-change-reco.ts | 7 ++- ...hange-recommendation-repository.service.ts | 14 +++++ openslides/motions/access_permissions.py | 21 ++++++++ ...014_motionchangerecommendation_internal.py | 18 +++++++ openslides/motions/models.py | 3 ++ openslides/motions/serializers.py | 1 + tests/integration/motions/test_viewset.py | 52 +++++++++++++++++++ 12 files changed, 140 insertions(+), 7 deletions(-) create mode 100644 openslides/motions/migrations/0014_motionchangerecommendation_internal.py diff --git a/client/src/app/shared/models/motions/motion-change-reco.ts b/client/src/app/shared/models/motions/motion-change-reco.ts index 05aa22b51..8abd10c19 100644 --- a/client/src/app/shared/models/motions/motion-change-reco.ts +++ b/client/src/app/shared/models/motions/motion-change-reco.ts @@ -8,6 +8,7 @@ export class MotionChangeReco extends BaseModel { public id: number; public motion_id: number; public rejected: boolean; + public internal: boolean; public type: number; public other_description: string; public line_from: number; diff --git a/client/src/app/site/motions/components/motion-change-recommendation/motion-change-recommendation.component.html b/client/src/app/site/motions/components/motion-change-recommendation/motion-change-recommendation.component.html index 70bc3529c..d2f850eec 100644 --- a/client/src/app/site/motions/components/motion-change-recommendation/motion-change-recommendation.component.html +++ b/client/src/app/site/motions/components/motion-change-recommendation/motion-change-recommendation.component.html @@ -10,6 +10,8 @@ + + {{ 'Public' | translate }} diff --git a/client/src/app/site/motions/components/motion-change-recommendation/motion-change-recommendation.component.ts b/client/src/app/site/motions/components/motion-change-recommendation/motion-change-recommendation.component.ts index 179921432..2d737d2bb 100644 --- a/client/src/app/site/motions/components/motion-change-recommendation/motion-change-recommendation.component.ts +++ b/client/src/app/site/motions/components/motion-change-recommendation/motion-change-recommendation.component.ts @@ -24,7 +24,7 @@ export interface MotionChangeRecommendationComponentData { * editChangeRecommendation: false, * newChangeRecommendation: true, * lineRange: lineRange, - * motion: this.motion, + * changeReco: this.changeRecommendation, * }; * this.dialogService.open(MotionChangeRecommendationComponent, { * height: '400px', @@ -104,14 +104,16 @@ export class MotionChangeRecommendationComponent { public createForm(): void { this.contentForm = this.formBuilder.group({ text: [this.changeReco.text, Validators.required], - diffType: [this.changeReco.type, Validators.required] + diffType: [this.changeReco.type, Validators.required], + public: [!this.changeReco.internal] }); } public saveChangeRecommendation(): void { this.changeReco.updateChangeReco( this.contentForm.controls.diffType.value, - this.contentForm.controls.text.value + this.contentForm.controls.text.value, + !this.contentForm.controls.public.value ); if (this.newReco) { diff --git a/client/src/app/site/motions/components/motion-detail-diff/motion-detail-diff.component.html b/client/src/app/site/motions/components/motion-detail-diff/motion-detail-diff.component.html index 76951821d..73363f427 100644 --- a/client/src/app/site/motions/components/motion-detail-diff/motion-detail-diff.component.html +++ b/client/src/app/site/motions/components/motion-detail-diff/motion-detail-diff.component.html @@ -111,6 +111,10 @@ Reject done +