Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update getPollResult to avoid translate undefined #4473

Merged
merged 3 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ export class TopicPdfService {
return true;
}
})
.filter((singleResult: VotingResult) => !!singleResult.vote)
Copy link
Member

@bastianjoel bastianjoel Dec 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could just do this check within the other filter call.

Also in line 179 there is logic to handle such cases. So either remove that logic or adjust it. I've committed a solution with the latter to you PR as it does not come with behavioral changes (Which your solution actually introduces).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it is removed. I have looked at your comment and think, it could work that way.

.map((singleResult: VotingResult) => {
const votingKey = this.translate.instant(this.pollKeyVerbose.transform(singleResult.vote!));
const resultValue = this.parsePollNumber.transform(singleResult.amount!);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ export class AssignmentPdfService {
return true;
}
})
.filter((singleResult: VotingResult) => !!singleResult.vote)
.map((singleResult: VotingResult) => {
const votingKey = this.translate.instant(this.pollKeyVerbose.transform(singleResult.vote!));
const resultValue = this.parsePollNumber.transform(singleResult.amount!);
Expand Down
Loading