diff --git a/app/app.css b/app/app.css index 8e8804679..8bd0517f6 100644 --- a/app/app.css +++ b/app/app.css @@ -6,4 +6,5 @@ md-toolbar .md-menu{ } #sidebar-menu__account-types{ margin-left: 1rem; -} \ No newline at end of file +} + diff --git a/app/app.routes.js b/app/app.routes.js index 81228a1f6..86a79e506 100644 --- a/app/app.routes.js +++ b/app/app.routes.js @@ -104,9 +104,9 @@ } }) .state('app.profile', { - url: '/charges', - templateUrl: 'src/common/coming-soon.html', - controller: 'ClientCtrl', + url: '/profile', + templateUrl: 'src/profile/profile.html', + controller: 'ProfileViewCtrl', controllerAs: 'vm', data: { title: 'Profile', diff --git a/app/src/common/main.component.js b/app/src/common/main.component.js index 52ffa37bc..dd0e14157 100644 --- a/app/src/common/main.component.js +++ b/app/src/common/main.component.js @@ -35,7 +35,9 @@ function selectItem(itemName) { vm.title = itemName; - vm.toggleItemsList(); + if(itemName!='Profile') { + vm.toggleItemsList(); + } } function getUserData() { diff --git a/app/src/common/main.html b/app/src/common/main.html index b25a3b0c1..f97082143 100644 --- a/app/src/common/main.html +++ b/app/src/common/main.html @@ -69,6 +69,13 @@

{{'nav.msg.welcome' | translate}} {{vm.profil + +
+ face{{'Profile'}} +
+
+
@@ -98,7 +105,7 @@

{{'nav.msg.welcome' | translate}} {{vm.profil - +

Profile

diff --git a/app/src/profile/profile.components.js b/app/src/profile/profile.components.js new file mode 100644 index 000000000..d735fb921 --- /dev/null +++ b/app/src/profile/profile.components.js @@ -0,0 +1,39 @@ +(function(){ + 'use strict'; + + angular.module('selfService') + .controller('ProfileViewCtrl', ['$state', '$stateParams', '$filter', 'navService', 'AccountService', ProfileViewCtrl]); + + function ProfileViewCtrl($state, $stateParams, $filter, navService, AccountService) { + + var vm=this; + + vm.profileImage = null; + vm.profile = getUserData(); + vm.profileAddress = 'N/A'; + + function getClient(clientId) { + AccountService.getClient(clientId).get().$promise.then( function (data) { + vm.profile = data; + }) + } + + function getClientImage(clientId) { + AccountService.getClientImage(clientId).then( function (resp) { + vm.profileImage = resp.data; + }).catch(function(err) { + // Not Found Profile image + vm.profileImage = 'assets/images/ic_person_black_24px.svg'; + }); + } + + function getUserData() { + AccountService.getClientId().then(function (clientId) { + vm.clientId = clientId; + getClient(clientId); + getClientImage(clientId); + }); + } + } + +})(); \ No newline at end of file diff --git a/app/src/profile/profile.html b/app/src/profile/profile.html new file mode 100644 index 000000000..1badd1889 --- /dev/null +++ b/app/src/profile/profile.html @@ -0,0 +1,100 @@ + + + edit + +