ui(users): banner explaining the disabled-username re-enable flow
This commit is contained in:
@@ -153,6 +153,11 @@ type userFormPage struct {
|
||||
SetupURL string
|
||||
SetupExpAt time.Time
|
||||
Error string
|
||||
// Reenable is set when the admin landed here because they tried
|
||||
// to add a username that already exists (disabled). Triggers a
|
||||
// banner on the edit page explaining why and steering them at
|
||||
// the Re-enable button. See handleUIUserNewPost's collision branch.
|
||||
Reenable bool
|
||||
}
|
||||
|
||||
func (s *Server) handleUIUserNewGet(w stdhttp.ResponseWriter, r *stdhttp.Request) {
|
||||
@@ -290,6 +295,7 @@ func (s *Server) handleUIUserEditGet(w stdhttp.ResponseWriter, r *stdhttp.Reques
|
||||
Mode: "edit", ID: target.ID, Username: target.Username,
|
||||
Email: em, Role: string(target.Role),
|
||||
Disabled: target.DisabledAt != nil,
|
||||
Reenable: r.URL.Query().Get("reenable") == "1",
|
||||
}
|
||||
_ = s.deps.UI.Render(w, "user_edit", view)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user