Skip to content

Commit

Permalink
Enhance anonymized nominal polls (#4460)
Browse files Browse the repository at this point in the history
  • Loading branch information
luisa-beerboom authored Dec 12, 2024
1 parent 68dade8 commit 1b77291
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 4 deletions.
2 changes: 2 additions & 0 deletions client/src/app/domain/models/poll/poll.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export class Poll extends BaseDecimalModel<Poll> {
public global_no!: boolean;
public global_abstain!: boolean;
public entitled_users_at_stop!: EntitledUsersEntry[];
public is_pseudoanonymized!: boolean;

public get isCreated(): boolean {
return this.state === PollState.Created;
Expand Down Expand Up @@ -154,6 +155,7 @@ export class Poll extends BaseDecimalModel<Poll> {
`title`,
`type`,
`backend`,
`is_pseudoanonymized`,
`pollmethod`,
`state`,
`min_votes_amount`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ export class PollRepositoryService extends BaseMeetingRelatedRepository<ViewPoll
`pollmethod`,
`onehundred_percent_base`,
`backend`,
`content_object_id`
`content_object_id`,
`is_pseudoanonymized`
];
return {
...super.getFieldsets(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ <h1>{{ poll.title }}</h1>
<span>{{ 'Edit' | translate }}</span>
</button>
<button
*osPerms="permission.assignmentCanManage; and: poll && poll.type === 'named'"
*osPerms="permission.assignmentCanManage; and: poll && poll.type === 'named' && !poll.is_pseudoanonymized"
mat-menu-item
(click)="pseudoanonymizePoll()"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ <h1>{{ poll.title | translate }}</h1>
<span>{{ 'Edit' | translate }}</span>
</button>
<button
*osPerms="permission.motionCanManagePolls; and: poll && poll.type === 'named'"
*osPerms="permission.motionCanManagePolls; and: poll && poll.type === 'named' && !poll.is_pseudoanonymized"
mat-menu-item
(click)="pseudoanonymizePoll()"
>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { _ } from '@ngx-translate/core';
import { DetailNavigable } from 'src/app/domain/interfaces';
import {
PollClassType,
Expand All @@ -7,6 +8,7 @@ import {
PollPercentBaseVerbose,
PollStateChangeActionVerbose,
PollStateVerbose,
PollType,
PollTypeVerbose,
VOTE_MAJORITY
} from 'src/app/domain/models/poll';
Expand Down Expand Up @@ -80,7 +82,11 @@ export class ViewPoll<C extends PollContentObject = any>
}

public get typeVerbose(): string {
return PollTypeVerbose[this.type];
const suffix = ``;
if (this.is_pseudoanonymized && this.type === PollType.Named) {
return _(`nominal (anonymized)`);
}
return PollTypeVerbose[this.type] + suffix;
}

public getContentObjectTitle(): string | null {
Expand Down

0 comments on commit 1b77291

Please sign in to comment.