✨ (user): Recuerda el estado de usuarios y roles
Los listados de usuarios y roles se montan con `remember_query()` y dejan de arrastrar el estado en los enlaces. La renovación de la sesión "Recuérdame" ya no se pierde cuando la respuesta fija otra cookie.
This commit is contained in:
parent
030ac92e2f
commit
84eef9ec4f
24 changed files with 251 additions and 201 deletions
|
|
@ -27,8 +27,6 @@ pub(crate) struct UserForm {
|
|||
mode: UserFormMode,
|
||||
error: Option<Lc>,
|
||||
user_id: Option<i32>,
|
||||
/// Listado de origen al que volver tras guardar (orden, búsqueda, página).
|
||||
waypoint: Waypoint,
|
||||
username: String,
|
||||
email: String,
|
||||
display_name: String,
|
||||
|
|
@ -63,7 +61,7 @@ impl Component for UserForm {
|
|||
// El propio usuario cambia su email en otra pantalla, que pide su contraseña y confirma la
|
||||
// nueva dirección antes de aplicarla.
|
||||
let email_readonly = *self.mode() == UserFormMode::Profile;
|
||||
let action = self.waypoint().append_to(cx.route(action));
|
||||
let action = cx.route(action);
|
||||
|
||||
let mut form = Form::new()
|
||||
.with_id(USER_ADMIN_FORM_ID)
|
||||
|
|
@ -168,7 +166,7 @@ impl Component for UserForm {
|
|||
form = form.with_child(profile_form_actions(save, cx));
|
||||
}
|
||||
UserFormMode::New => {
|
||||
let cancel = self.waypoint().or(cx.route(ADMIN_USERS_PATH.as_str()));
|
||||
let cancel = cx.route(ADMIN_USERS_PATH.as_str());
|
||||
form = form.with_child(form_actions(save, cancel));
|
||||
}
|
||||
}
|
||||
|
|
@ -196,11 +194,6 @@ impl UserForm {
|
|||
self
|
||||
}
|
||||
|
||||
pub(crate) fn with_waypoint(mut self, waypoint: impl Into<Waypoint>) -> Self {
|
||||
self.waypoint = waypoint.into();
|
||||
self
|
||||
}
|
||||
|
||||
pub(crate) fn with_username(mut self, username: impl Into<String>) -> Self {
|
||||
self.username = username.into();
|
||||
self
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue