Skip to content

Commit 6385ec4

Browse files
committed
feat(user_management): add dashboard role filter functionality
- Implement filtering by dashboard role in user management - Add conditional logic to apply filter only when a specific role is selected - Ensure 'Any' selection does not apply any filters
1 parent 18ec2c1 commit 6385ec4

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/user_management/bloc/user_management_bloc.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,14 @@ class UserManagementBloc
129129
filter['appRole'] = {r'$in': intersectingRoles.toList()};
130130
}
131131

132+
if (state.dashboardRole != null) {
133+
// When 'Any' is selected, dashboardRole is null, so we don't add the filter.
134+
// Otherwise, we filter by the specific role name.
135+
if (state.dashboardRole != DashboardUserRole.none) {
136+
filter['dashboardRole'] = state.dashboardRole!.name;
137+
}
138+
}
139+
132140
return filter;
133141
}
134142

0 commit comments

Comments
 (0)