Skip to content

Commit

Permalink
Fix motion create form
Browse files Browse the repository at this point in the history
  • Loading branch information
Elblinator committed Oct 22, 2024
1 parent 6a52d30 commit 9232265
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ export class MotionFormComponent extends BaseMeetingComponent implements OnInit
return this.perms.isAllowed(`change_metadata`, this.motion);
}

public get canManageAgenda(): boolean {
return this.perms.canManageAgenda();
}

public get isParagraphBasedAmendment(): boolean {
return this.isExisting && this.motion.isParagraphBasedAmendment();
}
Expand Down Expand Up @@ -208,6 +212,11 @@ export class MotionFormComponent extends BaseMeetingComponent implements OnInit
return async () => {
const update = event || this.temporaryMotion;
if (this.newMotion) {
for (const key in update) {
if (update[key] === null || update[key].length === 0) {
delete update[key];
}
}
await this.createMotion(update);
} else {
await this.updateMotion(update, this.motion);
Expand Down Expand Up @@ -582,7 +591,9 @@ export class MotionFormComponent extends BaseMeetingComponent implements OnInit
number: [
``,
isUniqueAmong<string>(this._motionNumbersSubject, (a, b) => a === b, [``, null, undefined])
],
]
}),
...(this.canManageAgenda && {
agenda_create: [``],
agenda_type: [``]
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ export class MotionPermissionService {
);
}

public canManageAgenda(): boolean {
return this.operator.hasPerms(Permission.agendaItemCanManage);
}

public canDoActionWhileDelegationEnabled(isAdditionalDelegationSettingEnabled: boolean): boolean {
return !(
!this.operator.isAnonymous &&
Expand Down

0 comments on commit 9232265

Please sign in to comment.