From ad10a2b0d73d24c3a9975d95768d25c6e8b8070c Mon Sep 17 00:00:00 2001 From: GabrielMeyer Date: Thu, 12 Sep 2019 14:02:17 +0200 Subject: [PATCH] Fixes can create amendments if having permissions --- .../components/motion-detail/motion-detail.component.ts | 2 +- client/src/app/site/motions/motions-routing.module.ts | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/client/src/app/site/motions/modules/motion-detail/components/motion-detail/motion-detail.component.ts b/client/src/app/site/motions/modules/motion-detail/components/motion-detail/motion-detail.component.ts index b8d6672f8..9555d7653 100644 --- a/client/src/app/site/motions/modules/motion-detail/components/motion-detail/motion-detail.component.ts +++ b/client/src/app/site/motions/modules/motion-detail/components/motion-detail/motion-detail.component.ts @@ -1100,7 +1100,7 @@ export class MotionDetailComponent extends BaseViewComponent implements OnInit, if (mode === 'paragraph') { this.router.navigate(['./create-amendment'], { relativeTo: this.route }); } else { - this.router.navigate(['./motions/new'], { + this.router.navigate(['./motions/new-amendment'], { relativeTo: this.route.snapshot.params.relativeTo, queryParams: { parent: this.motion.id || null } }); diff --git a/client/src/app/site/motions/motions-routing.module.ts b/client/src/app/site/motions/motions-routing.module.ts index 2a4b569d3..749328d72 100644 --- a/client/src/app/site/motions/motions-routing.module.ts +++ b/client/src/app/site/motions/motions-routing.module.ts @@ -52,6 +52,11 @@ const routes: Routes = [ loadChildren: () => import('./modules/motion-detail/motion-detail.module').then(m => m.MotionDetailModule), data: { basePerm: 'motions.can_create' } }, + { + path: 'new-amendment', + loadChildren: () => import('./modules/motion-detail/motion-detail.module').then(m => m.MotionDetailModule), + data: { basePerm: 'motions.can_create_amendments' } + }, { path: 'amendments', loadChildren: () => import('./modules/amendment-list/amendment-list.module').then(m => m.AmendmentListModule),