Moved dashboard theme option from the dashboard to a persisted user setting, #1458
This commit is contained in:
@@ -28,7 +28,7 @@ func AdminGetUser(c *middleware.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
result := m.UserDTO{
|
||||
result := dtos.AdminUserListItem{
|
||||
Name: query.Result.Name,
|
||||
Email: query.Result.Email,
|
||||
Login: query.Result.Login,
|
||||
|
||||
@@ -19,6 +19,7 @@ type CurrentUser struct {
|
||||
Login string `json:"login"`
|
||||
Email string `json:"email"`
|
||||
Name string `json:"name"`
|
||||
LightTheme bool `json:"lightTheme"`
|
||||
OrgRole m.RoleType `json:"orgRole"`
|
||||
OrgName string `json:"orgName"`
|
||||
IsGrafanaAdmin bool `json:"isGrafanaAdmin"`
|
||||
|
||||
@@ -20,3 +20,10 @@ type AdminUpdateUserPasswordForm struct {
|
||||
type AdminUpdateUserPermissionsForm struct {
|
||||
IsGrafanaAdmin bool `json:"IsGrafanaAdmin" binding:"Required"`
|
||||
}
|
||||
|
||||
type AdminUserListItem struct {
|
||||
Email string `json:"email"`
|
||||
Name string `json:"name"`
|
||||
Login string `json:"login"`
|
||||
IsGrafanaAdmin bool `json:"isGrafanaAdmin"`
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ func setIndexViewData(c *middleware.Context) error {
|
||||
Login: c.Login,
|
||||
Email: c.Email,
|
||||
Name: c.Name,
|
||||
LightTheme: c.Theme == "light",
|
||||
OrgName: c.OrgName,
|
||||
OrgRole: c.OrgRole,
|
||||
GravatarUrl: dtos.GetGravatarUrl(c.Email),
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ import (
|
||||
)
|
||||
|
||||
func GetUser(c *middleware.Context) {
|
||||
query := m.GetUserInfoQuery{UserId: c.UserId}
|
||||
query := m.GetUserProfileQuery{UserId: c.UserId}
|
||||
|
||||
if err := bus.Dispatch(&query); err != nil {
|
||||
c.JsonApiErr(500, "Failed to get user", err)
|
||||
|
||||
Reference in New Issue
Block a user