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

SAK-50505 SakaiGrader don't display empty groups in the group picker #12889

Merged
merged 2 commits into from
Oct 14, 2024
Merged
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 @@ -53,7 +53,7 @@ export const graderRenderingMixin = Base => class extends Base {
${this.groups ? html`
<div class="grader-groups">
<div>${this.i18n.group_label}</div>
<sakai-group-picker .groups=${this.groups}
<sakai-group-picker .groups=${this.groups.filter(group => group.users && group.users.length > 0)}
Copy link
Contributor

Choose a reason for hiding this comment

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

is this doing the opposite of what the title of the PR says?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ern It could be, depending on how this is understood. For me, it's correct. The change proposes that the groups available in the group selector should only be those that have students (thereby filtering out the empty ones).

Copy link
Contributor

Choose a reason for hiding this comment

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

@st-manu I'd put your groups filter into the data mixin, where the groups data is set. Less logic in the templates is usually better.

@groups-selected=${this._groupsSelected}
group-ref=${ifDefined(this.selectedGroup)}>
</sakai-group-picker>
Expand Down
Loading