Skip to content

Commit daf7590

Browse files
authored
fix(playground): remove all roles and all organizations (#666)
1 parent b0658bd commit daf7590

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

playground/app/features/users/components/lists.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,13 @@ def user_filters() -> rx.Component:
8585
),
8686
rx.text("Filters", size=TEXT_SIZE_LABEL, color=rx.color("mauve", 11)),
8787
rx.select(
88-
UsersState.roles_name_list,
88+
UsersState.roles_name_list_with_all,
8989
on_change=UsersState.set_filter_role,
9090
value=UsersState.filter_role_value,
9191
width=SELECT_MEDIUM_WIDTH,
9292
),
9393
rx.select(
94-
UsersState.organizations_name_list,
94+
UsersState.organizations_name_list_with_all,
9595
on_change=UsersState.set_filter_organization,
9696
value=UsersState.filter_organization_value,
9797
width=SELECT_MEDIUM_WIDTH,

playground/app/features/users/state.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,18 @@ class UsersState(EntityState):
1414

1515
@rx.var
1616
def roles_name_list(self) -> list[str]:
17+
return sorted([role["name"] for role in self.roles_list])
18+
19+
@rx.var
20+
def roles_name_list_with_all(self) -> list[str]:
1721
return ["All roles", *sorted([role["name"] for role in self.roles_list])]
1822

1923
@rx.var
2024
def organizations_name_list(self) -> list[str]:
25+
return sorted([organization["name"] for organization in self.organizations_list])
26+
27+
@rx.var
28+
def organizations_name_list_with_all(self) -> list[str]:
2129
return ["All organizations", *sorted([organization["name"] for organization in self.organizations_list])]
2230

2331
def _format_user(self, user: dict) -> User:

0 commit comments

Comments
 (0)