diff --git a/app/app.css b/app/app.css index 8e8804679..6d9820e6c 100644 --- a/app/app.css +++ b/app/app.css @@ -6,4 +6,4 @@ 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 8928210d2..54eb2188c 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/assets/stylesheets/_custom.scss b/app/assets/stylesheets/_custom.scss index 07a557baa..a3a30c8a8 100644 --- a/app/assets/stylesheets/_custom.scss +++ b/app/assets/stylesheets/_custom.scss @@ -129,6 +129,11 @@ a.md-button.md-warn.md-raised, a.md-button.md-warn.md-fab, .md-button.md-warn.md color: white; } + +.md-button.md-fab.md-fab-bottom-right { + position: fixed; +} + md-radio-button.md-accent.md-checked .md-label span { color: $accent-color; } @@ -448,6 +453,24 @@ md-toolbar .md-menu { border: 2px solid white; } +.profile-image { + height: 300px; +} + +.profile-input-icons { + color: #1e88e5; +} + +.profile-card { + padding-left: 10px; + padding-right: 20px; +} + +.profile-details-card { + padding-right: 30px; + padding-left: 30px +} + .text-center { text-align: center; } diff --git a/app/global-translations/locale-en.json b/app/global-translations/locale-en.json index dda69f80b..30d825be3 100644 --- a/app/global-translations/locale-en.json +++ b/app/global-translations/locale-en.json @@ -16,6 +16,7 @@ "nav.label.help": "Help", "nav.label.applyloan": "Apply For Loan", "nav.label.reports": "Reports", + "nav.label.profile": "Profile", "label.heading.loans": "Loans", "label.heading.loanAccountList": "Loan Account List", diff --git a/app/src/common/main.component.js b/app/src/common/main.component.js index 54f8c3d20..2d784c9d2 100644 --- a/app/src/common/main.component.js +++ b/app/src/common/main.component.js @@ -1,9 +1,9 @@ (function () { angular.module('selfService') - .controller('MainCtrl', ['navService', '$mdSidenav', '$mdBottomSheet', '$log', '$q', '$state', '$mdToast', '$scope', 'AuthService', 'AccountService', MainCtrl]); + .controller('MainCtrl', ['navService', '$mdSidenav', '$mdBottomSheet', '$log', '$q', '$state', '$mdToast', '$scope', '$location', 'AuthService', 'AccountService', MainCtrl]); - function MainCtrl(navService, $mdSidenav, $mdBottomSheet, $log, $q, $state, $mdToast, $scope, AuthService, AccountService) { + function MainCtrl(navService, $mdSidenav, $mdBottomSheet, $log, $q, $state, $mdToast, $scope, $location, AuthService, AccountService) { var vm = this; vm.menuItems = []; @@ -12,6 +12,7 @@ vm.selectItem = selectItem; vm.toggleItemsList = toggleItemsList; vm.toggleRightSidebar = toggleRightSidebar; + vm.goToProfile = goToProfile; vm.logout = logout; vm.profile = getUserData(); @@ -36,6 +37,7 @@ function selectItem(itemName) { vm.title = itemName; vm.toggleItemsList(); + } function getUserData() { @@ -61,6 +63,10 @@ }); } + function goToProfile() { + $location.path('/profile'); + } + function logout() { AuthService.logout(); } diff --git a/app/src/common/main.html b/app/src/common/main.html index fad26f062..ba24f295a 100644 --- a/app/src/common/main.html +++ b/app/src/common/main.html @@ -63,7 +63,7 @@

{{'nav.msg.welcome' | translate}} {{vm.profil + class="sidenav-icon">
ballot {{ 'nav.label.reports' | translate }}
@@ -76,6 +76,13 @@

{{'nav.msg.welcome' | translate}} {{vm.profil + +
+ face {{ 'nav.label.profile' | translate }} +
+
+
@@ -105,7 +112,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..4c9d8f45b --- /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 () { + // 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..e4a4aef2c --- /dev/null +++ b/app/src/profile/profile.html @@ -0,0 +1,93 @@ + + + edit + + diff --git a/app/src/reports/run_reports/run_reports.component.js b/app/src/reports/run_reports/run_reports.component.js index eeb0e100c..b9b3e46a8 100644 --- a/app/src/reports/run_reports/run_reports.component.js +++ b/app/src/reports/run_reports/run_reports.component.js @@ -19,7 +19,6 @@ RunReportService.reports().get({reportName: vm.reportName, id: vm.id}).$promise.then(function(data) { vm.reportData = data; vm.reportData.columnHeaders = data.columnHeaders; - console.log(vm.reportData.data[0].row); }); function isDecimal (index) { @@ -31,7 +30,7 @@ } } return false; - }; + } }