Skip to content

Commit 43ba7db

Browse files
authored
Remove Category from amendment create (#6456)
1 parent f43f2da commit 43ba7db

2 files changed

Lines changed: 24 additions & 21 deletions

File tree

client/src/app/site/pages/meetings/pages/motions/pages/motion-detail/pages/motion-form/components/motion-form/motion-form.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ <h3>
173173

174174
<div class="extra-data">
175175
<!-- Category form -->
176-
@if (newMotion && hasCategories) {
176+
@if (newMotion && !amendmentEdit && hasCategories) {
177177
<div class="content-field">
178178
<mat-form-field>
179179
<mat-label>{{ 'Category' | translate }}</mat-label>

client/src/app/site/pages/meetings/pages/motions/pages/motion-detail/pages/motion-form/components/motion-form/motion-form.component.ts

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {
33
ChangeDetectorRef,
44
Component,
55
HostListener,
6+
inject,
67
OnInit,
78
ViewEncapsulation
89
} from '@angular/core';
@@ -23,7 +24,6 @@ import { ParticipantControllerService } from '@app/site/pages/meetings/pages/par
2324
import { OperatorService } from '@app/site/services/operator.service';
2425
import { ViewPortService } from '@app/site/services/view-port.service';
2526
import { PromptService } from '@app/ui/modules/prompt-dialog';
26-
import { TranslateService } from '@ngx-translate/core';
2727
import {
2828
auditTime,
2929
BehaviorSubject,
@@ -185,24 +185,23 @@ export class MotionFormComponent extends BaseMeetingComponent implements OnInit
185185
private _motionId: Id | null = null;
186186
private _parentId: Id | null = null;
187187

188-
public constructor(
189-
protected override translate: TranslateService,
190-
public vp: ViewPortService,
191-
public participantRepo: ParticipantControllerService,
192-
public participantSortService: ParticipantListSortService,
193-
public userRepo: UserRepositoryService,
194-
public categoryRepo: MotionCategoryControllerService,
195-
public workflowRepo: MotionWorkflowControllerService,
196-
private fb: UntypedFormBuilder,
197-
private route: ActivatedRoute,
198-
private motionController: MotionControllerService,
199-
private amendmentRepo: AmendmentControllerService,
200-
private perms: MotionPermissionService,
201-
private prompt: PromptService,
202-
private cd: ChangeDetectorRef,
203-
private operator: OperatorService,
204-
private presenter: GetForwardingCommitteesPresenterService
205-
) {
188+
public categoryRepo = inject(MotionCategoryControllerService);
189+
public participantRepo = inject(ParticipantControllerService);
190+
public participantSortService = inject(ParticipantListSortService);
191+
public userRepo = inject(UserRepositoryService);
192+
public vp = inject(ViewPortService);
193+
public workflowRepo = inject(MotionWorkflowControllerService);
194+
private amendmentRepo = inject(AmendmentControllerService);
195+
private cd = inject(ChangeDetectorRef);
196+
private fb = inject(UntypedFormBuilder);
197+
private motionController = inject(MotionControllerService);
198+
private operator = inject(OperatorService);
199+
private perms = inject(MotionPermissionService);
200+
private presenter = inject(GetForwardingCommitteesPresenterService);
201+
private prompt = inject(PromptService);
202+
private route = inject(ActivatedRoute);
203+
204+
public constructor() {
206205
super();
207206

208207
this.subscriptions.push(
@@ -250,12 +249,16 @@ export class MotionFormComponent extends BaseMeetingComponent implements OnInit
250249
delete update.supporter_ids;
251250
}
252251

252+
if (this.amendmentEdit && update.category_id) {
253+
delete update.category_id;
254+
}
255+
253256
if (this.newMotion) {
254257
update.submitter_meeting_user_ids = [];
255258
if (update.submitter_ids.length === 0 && this.operator.isInMeeting(this.activeMeetingId)) {
256259
update.submitter_meeting_user_ids = [this.operator.user.getMeetingUser(this.activeMeetingId).id];
257260
} else {
258-
update.submitter_ids.forEach(id => {
261+
update.submitter_ids.forEach((id: number) => {
259262
update.submitter_meeting_user_ids.push(
260263
this.userRepo.getViewModel(id).getMeetingUser(this.activeMeetingId).id
261264
);

0 commit comments

Comments
 (0)