diff --git a/app/src/components/add_group_member.rs b/app/src/components/add_group_member.rs index faac268..1d17e40 100644 --- a/app/src/components/add_group_member.rs +++ b/app/src/components/add_group_member.rs @@ -110,11 +110,12 @@ impl AddGroupMemberComponent { self.props.on_user_added_to_group.emit(user); } Msg::SelectionChanged(option_props) => { + let was_some = self.selected_user.is_some(); self.selected_user = option_props.map(|u| User { id: u.value, display_name: u.text, }); - return Ok(false); + return Ok(self.selected_user.is_some() != was_some); } } Ok(true) @@ -170,8 +171,8 @@ impl Component for AddGroupMemberComponent { } }; html! { - <> - +
+
- - - - - +
+
+ +
+
} } else { html! { - <> - {"Loading groups"} - - + {"Loading groups"} } } } diff --git a/app/src/components/add_user_to_group.rs b/app/src/components/add_user_to_group.rs index 44bf6a1..ff77cf3 100644 --- a/app/src/components/add_user_to_group.rs +++ b/app/src/components/add_user_to_group.rs @@ -124,11 +124,12 @@ impl AddUserToGroupComponent { self.props.on_user_added_to_group.emit(group); } Msg::SelectionChanged(option_props) => { + let was_some = self.selected_group.is_some(); self.selected_group = option_props.map(|props| Group { id: props.value.parse::().unwrap(), display_name: props.text, }); - return Ok(false); + return Ok(self.selected_group.is_some() != was_some); } } Ok(true) @@ -183,8 +184,8 @@ impl Component for AddUserToGroupComponent { } }; html! { - <> - +
+
- - - - - +
+
+ +
+
} } else { html! { - <> - {"Loading groups"} - - + {"Loading groups"} } } } diff --git a/app/src/components/group_details.rs b/app/src/components/group_details.rs index 6adbd1c..9561825 100644 --- a/app/src/components/group_details.rs +++ b/app/src/components/group_details.rs @@ -131,36 +131,32 @@ impl GroupDetails { } }; html! { -
-

{"Members"}

-
- - - - - - - - - - {if g.users.is_empty() { - html! { - - - - } - } else { - html! {<>{g.users.iter().map(make_user_row).collect::>()}} - }} -
-
- {self.view_add_user_button(g)} - - -
{"User Id"}{"Display name"}
{"No members"} -
+
+

{"Members"}

+
+ + + + + + + + + + {if g.users.is_empty() { + html! { + + + + } + } else { + html! {<>{g.users.iter().map(make_user_row).collect::>()}} + }} + +
{"User Id"}{"Display name"}
{"No members"} +
+
-
} } @@ -222,12 +218,8 @@ impl Component for GroupDetails { (Some(u), error) => { html! {
- /* - - */ {self.view_user_list(u)} + {self.view_add_user_button(u)} {self.view_messages(error)}
} diff --git a/app/src/components/select.rs b/app/src/components/select.rs index e78581e..1125b2b 100644 --- a/app/src/components/select.rs +++ b/app/src/components/select.rs @@ -69,6 +69,7 @@ impl Component for Select { html! { diff --git a/app/src/components/user_details.rs b/app/src/components/user_details.rs index 840d95f..d6b31bc 100644 --- a/app/src/components/user_details.rs +++ b/app/src/components/user_details.rs @@ -153,10 +153,6 @@ impl UserDetails { } else { html! {<>{u.groups.iter().map(make_group_row).collect::>()}} }} -
- - {self.view_add_group_button(u)} -
@@ -222,6 +218,7 @@ impl Component for UserDetails { user=u.clone() on_error=self.link.callback(Msg::OnError)/> {self.view_group_memberships(u)} + {self.view_add_group_button(u)}