Skip to content

feat: Add filter by role and username#2659

Open
Koc wants to merge 2 commits into
masterfrom
feature/add-filters-for-members
Open

feat: Add filter by role and username#2659
Koc wants to merge 2 commits into
masterfrom
feature/add-filters-for-members

Conversation

@Koc

@Koc Koc commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Summary

This is a follow-up for #2561 inspired by nextcloud/contacts#5330:

  • added filters by role and username
  • added a spinner for members loading instead of showing error "You currently have no access to the member list"
  • reload members list once we've added new members to the Team
  • fix member item actions:
    • fixed an issue with wrongly displayed "Promote to Admin" menu item for current authenticated user in status Moderator
    • show "Leave team" instead of "Remove member" for current authenticated user in list
    • hide "Remove member" for an Team Owner
    • hide "Remove member" if current authenticated user has not greater permissions that member in list
image image

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

@codecov

codecov Bot commented Jul 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@Koc
Koc force-pushed the feature/add-filters-for-members branch from 1dd3846 to eaa2b5c Compare July 19, 2026 13:45
@Koc
Koc force-pushed the feature/add-filters-for-members branch from dffa816 to dc962e1 Compare July 19, 2026 14:00
Koc added 2 commits July 19, 2026 16:10
Signed-off-by: Kostiantyn Miakshyn <molodchick@gmail.com>
Signed-off-by: Kostiantyn Miakshyn <molodchick@gmail.com>
params: {
search,
role,
...(limit ? { limit } : {}),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The members controller doesn't appear accept these filter params. Is that still coming in a separate back-end PR?

@Koc Koc Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

see #2482 and #1913

Comment on lines +249 to +255
'circle.id': {
handler() {
this.fetchCircleMembers()
},

immediate: true,
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We already dispatch getCircleMembers on teamId change in TeamPage.loadCircle. This means we hit the endpoint twice on every team page open, so perhaps we can remove this one?

return this.$store.getters.getCircle(this.selectedCircle)
},

members() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this used anywhere?

if (!this.circle || !this.circle.id) {
return
}
if (!this.circle.canManageMembers) {

@pringelmann pringelmann Jul 22, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If I understand correctly: the filter controls render for every member, but here we return early when !canManageMembers, so a regular member gets a search box and role dropdown that silently do nothing.

Is the guard intentional? Viewing the member list doesn't require manage rights, so should filtering it? If there's a reason to keep it, would it make sense to hide the filter controls for people who can't use them?


try {
await this.$store.dispatch('getCircleMembers', payload)
console.log('debug: getCircleMembers', this.list)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please change console logs to use this.logger

:options="roles"
:placeholder="t('circles', 'Role')"
:multiple="false"
style="min-width: 160px;" />

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please move this inline style to <style module> below where the other styles live

<NcSelect
v-model="searchRole"
:options="roles"
:placeholder="t('circles', 'Role')"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please add an aria-label or label so screen readers can announce the role filter

* @param {string} circleId the circle id
*/
resetCircleMembers(state, circleId) {
state.circles[circleId].members = []

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

MemberList is Record<string, Member> (see src/teams/team-page/models/circle.ts#L14)

Suggested change
state.circles[circleId].members = []
state.circles[circleId].members = {}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants