diff --git a/pkg/api/user.go b/pkg/api/user.go index 0f972431426..d4545a7c709 100644 --- a/pkg/api/user.go +++ b/pkg/api/user.go @@ -111,9 +111,6 @@ func UserSetUsingOrg(c *middleware.Context) Response { } func ChangeUserPassword(c *middleware.Context, cmd m.ChangeUserPasswordCommand) Response { - - log.Info("%v", cmd) - userQuery := m.GetUserByIdQuery{Id: c.UserId} if err := bus.Dispatch(&userQuery); err != nil { diff --git a/public/app/core/components/sidemenu/sidemenu.ts b/public/app/core/components/sidemenu/sidemenu.ts index 4c0e100f85c..f68edf8fca5 100644 --- a/public/app/core/components/sidemenu/sidemenu.ts +++ b/public/app/core/components/sidemenu/sidemenu.ts @@ -39,6 +39,7 @@ export class SideMenuCtrl { this.orgMenu = [ {section: 'You', cssClass: 'dropdown-menu-title'}, {text: 'Profile', url: this.getUrl('/profile')}, + {text: 'Preferences', url: this.getUrl('/preferences')}, ]; if (this.isSignedIn) { diff --git a/public/app/core/routes/routes.ts b/public/app/core/routes/routes.ts index 6e3af683c82..334800c22f5 100644 --- a/public/app/core/routes/routes.ts +++ b/public/app/core/routes/routes.ts @@ -89,6 +89,10 @@ function setupAngularRoutes($routeProvider, $locationProvider) { templateUrl: 'public/app/features/profile/partials/profile.html', controller : 'ProfileCtrl', }) + .when('/preferences', { + templateUrl: 'public/app/features/profile/partials/preferences.html', + controller : 'PreferencesCtrl', + }) .when('/profile/password', { templateUrl: 'public/app/features/profile/partials/password.html', controller : 'ChangePasswordCtrl', diff --git a/public/app/features/all.js b/public/app/features/all.js index c110bcff7cd..94da3809ae7 100644 --- a/public/app/features/all.js +++ b/public/app/features/all.js @@ -10,5 +10,6 @@ define([ './profile/profileCtrl', './profile/changePasswordCtrl', './profile/selectOrgCtrl', + './profile/preferencesCtrl', './styleguide/styleguide', ], function () {}); diff --git a/public/app/features/profile/partials/preferences.html b/public/app/features/profile/partials/preferences.html new file mode 100644 index 00000000000..093163dde32 --- /dev/null +++ b/public/app/features/profile/partials/preferences.html @@ -0,0 +1,32 @@ + + + +
+ + +
+
+ Home Dashboard + +
+ +
+ Time Range + +
+ +
+ Theme + +
+ +
+ + Cancel +
+
+ +
+ diff --git a/public/app/features/profile/partials/profile.html b/public/app/features/profile/partials/profile.html index 042344eeac6..dd5afebeaac 100644 --- a/public/app/features/profile/partials/profile.html +++ b/public/app/features/profile/partials/profile.html @@ -7,7 +7,7 @@
-

Preferences

+

Information

Name diff --git a/public/app/features/profile/preferencesCtrl.js b/public/app/features/profile/preferencesCtrl.js new file mode 100644 index 00000000000..00e7d59182c --- /dev/null +++ b/public/app/features/profile/preferencesCtrl.js @@ -0,0 +1,25 @@ +define([ + 'angular', + 'app/core/config', +], +function (angular) { + 'use strict'; + + var module = angular.module('grafana.controllers'); + + module.controller('PreferencesCtrl', function($scope, backendSrv, $location) { + + $scope.command = {}; + + $scope.setUserPreferences = function() { + if (!$scope.userForm.$valid) { return; } + + console.log($scope.command); + + backendSrv.put('/api/user/prefs', $scope.command).then(function() { + $location.path("profile"); + }); + }; + + }); +});