Merge pull request #2086 from coreos-inc/user-info
Add collection of user metadata: name and company
This commit is contained in:
commit
45b1148118
14 changed files with 178 additions and 33 deletions
|
@ -10,6 +10,7 @@
|
|||
|
||||
function UpdateUserCtrl($scope, UserService, $location, ApiService) {
|
||||
$scope.state = 'loading';
|
||||
$scope.metadata = {};
|
||||
|
||||
UserService.updateUserIn($scope, function(user) {
|
||||
if (!user.anonymous) {
|
||||
|
@ -45,15 +46,17 @@
|
|||
});
|
||||
};
|
||||
|
||||
$scope.updateUsername = function(username) {
|
||||
$scope.state = 'updating';
|
||||
var data = {
|
||||
'username': username
|
||||
};
|
||||
|
||||
ApiService.changeUserDetails(data).then(function() {
|
||||
window.location = '/';
|
||||
}, ApiService.errorDisplay('Could not update username'));
|
||||
$scope.updateUser = function(data) {
|
||||
$scope.state = 'updating';
|
||||
ApiService.changeUserDetails(data).then(function() {
|
||||
UserService.load(function(updated) {
|
||||
if (updated.prompts.length) {
|
||||
$scope.state = 'editing';
|
||||
} else {
|
||||
$location.url('/');
|
||||
}
|
||||
});
|
||||
}, ApiService.errorDisplay('Could not update user information'));
|
||||
};
|
||||
|
||||
$scope.hasPrompt = function(user, prompt_name) {
|
||||
|
|
Reference in a new issue