Moved dashboard theme option from the dashboard to a persisted user setting, #1458

This commit is contained in:
Torkel Ödegaard
2015-02-28 14:30:08 +01:00
parent 962b316bcf
commit 04ca85fe89
15 changed files with 56 additions and 35 deletions
+1 -1
View File
@@ -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,
+1
View File
@@ -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"`
+7
View File
@@ -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"`
}
+1
View File
@@ -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
View File
@@ -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)