diff --git a/client/src/app/site/assignments/modules/assignment-poll/components/assignment-poll-dialog/assignment-poll-dialog.component.html b/client/src/app/site/assignments/modules/assignment-poll/components/assignment-poll-dialog/assignment-poll-dialog.component.html index 8d721dac0..737503ef1 100644 --- a/client/src/app/site/assignments/modules/assignment-poll/components/assignment-poll-dialog/assignment-poll-dialog.component.html +++ b/client/src/app/site/assignments/modules/assignment-poll/components/assignment-poll-dialog/assignment-poll-dialog.component.html @@ -1,4 +1,5 @@ extends BaseViewComponentDirective { public publishImmediately: boolean; + public pollClassType = PollClassType; protected pollForm: PollFormComponent; diff --git a/client/src/app/site/polls/components/poll-form/poll-form.component.html b/client/src/app/site/polls/components/poll-form/poll-form.component.html index 3f2750ec3..2243b34ad 100644 --- a/client/src/app/site/polls/components/poll-form/poll-form.component.html +++ b/client/src/app/site/polls/components/poll-form/poll-form.component.html @@ -89,7 +89,7 @@ -
+
{{ PollPropertyVerbose.global_yes | translate }} diff --git a/client/src/app/site/polls/components/poll-form/poll-form.component.ts b/client/src/app/site/polls/components/poll-form/poll-form.component.ts index f8b218bc2..8709c78e4 100644 --- a/client/src/app/site/polls/components/poll-form/poll-form.component.ts +++ b/client/src/app/site/polls/components/poll-form/poll-form.component.ts @@ -64,6 +64,9 @@ export class PollFormComponent @Input() private pollService: S; + @Input() + public pollClassType: PollClassType; + /** * The different types the poll can accept. */ @@ -105,6 +108,10 @@ export class PollFormComponent } } + public get isAssignmentPoll(): boolean { + return this.pollClassType === PollClassType.Assignment; + } + public get isEVotingSelected(): boolean { return this.pollTypeControl?.value !== PollType.Analog || false; } @@ -140,6 +147,7 @@ export class PollFormComponent ) { super(title, translate, snackbar); this.initContentForm(); + this.groupObservable = this.groupRepo.getViewModelListObservableWithoutDefaultGroup(); } /** @@ -147,9 +155,6 @@ export class PollFormComponent * Sets the observable for groups. */ public ngOnInit(): void { - // without default group since default cant ever vote - this.groupObservable = this.groupRepo.getViewModelListObservableWithoutDefaultGroup(); - if (this.data) { if (this.data.state) { this.disablePollType(); @@ -312,7 +317,7 @@ export class PollFormComponent ] ]; // show pollmethod only for assignment polls - if (this.data.pollClassType === PollClassType.Assignment) { + if (this.isAssignmentPoll) { this.pollValues.push([ this.pollService.getVerboseNameForKey('pollmethod'), this.pollService.getVerboseNameForValue('pollmethod', data.pollmethod) @@ -375,6 +380,16 @@ export class PollFormComponent global_yes: [false], global_no: [false], global_abstain: [false] + /** + * TODO, global is not required for motions, current logic does not + * survive changes after constructor due strickt access calls + * Change to observe + */ + // ...(this.isAssignmentPoll && { + // global_yes: [false], + // global_no: [false], + // global_abstain: [false] + // }) }); }