PageSourceSearch

https://gradana.co.id/assets/js/controllers/quickview.js

js gradana.co.id collected 2026-10-07 21:52:57 UTC 3,727 bytes, 83 lines download raw bytes

1'use strict';
2
3/* Controllers */
4
5angular
6    .module('app')
7    .controller('QuickviewCtrl', QuickviewController);
8    QuickviewController.$inject = ['$scope', '$rootScope', 'ServerService', 'SettingsService', '$state'];
9
10    function QuickviewController($scope, $rootScope ,ServerService, SettingsService, $state){
11        var currentUser = SettingsService.GetCredentials();
12        $scope.currentUser = currentUser;
13        
14        if (currentUser) {
15            if (currentUser.user) {
16                if(currentUser.user.role === 'admin'){
17                    // $scope.userRole = 'Customer Service'
18                    $scope.userRole = 'Admin'
19                } else if(currentUser.user.role === 'superAdmin'){
20                    $scope.userRole = 'Super Admin'
21                } else if(currentUser.user.role === 'creditAnalyst'){
22                    $scope.userRole = 'Credit Analyst'
23                } else if(currentUser.user.role === 'borrower'){
24                    $scope.userRole = 'Borrower'
25                } else if(currentUser.user.role === 'lender'){
26                    $scope.userRole = 'Lender'
27                } else if(currentUser.user.role === 'agent'){
28                    $scope.userRole = 'Agent'
29                }
30            }
31        }
32
33        // $scope.baseImageURL = "https://s3-ap-southeast-1.amazonaws.com/gradana/";
34        // $scope.baseImageURL = "https://gradana-backup-test.oss-ap-southeast-5.aliyuncs.com/";
35        $scope.baseImageURL = "https://gradana-prod.oss-ap-southeast-5.aliyuncs.com/";
36
37        $rootScope.$on('$locationChangeSuccess',function() {
38            currentUser = SettingsService.GetCredentials();
39            $scope.currentUser = currentUser;
40
41            if (currentUser) {
42                if (currentUser.user) {
43                    if(currentUser.user.role === 'admin'){
44                        // $scope.userRole = 'Customer Service'
45                        $scope.userRole = 'Admin'
46                    } else if(currentUser.user.role === 'superAdmin'){
47                        $scope.userRole = 'Super Admin'
48                    } else if(currentUser.user.role === 'creditAnalyst'){
49                        $scope.userRole = 'Credit Analyst'
50                    } else if(currentUser.user.role === 'borrower'){
51                        $scope.userRole = 'Borrower'
52                    } else if(currentUser.user.role === 'lender'){
53                        $scope.userRole = 'Lender'
54                    } else if(currentUser.user.role === 'Agent'){
55                        $scope.userRole = 'Agent'
56                    }
57                }
58            }
59        });
60
61        $scope.logoutButton = function() {
62            ServerService.Logout(currentUser, function(response){
63                SettingsService.ClearLocalStorage();
64                SettingsService.ClearCredentials();
65
66                if($scope.currentUser.user.role == "admin" || $scope.currentUser.user.role == "superAdmin" || $scope.currentUser.user.role == "creditAnalyst"){
67                    $state.go('admin_access.login')
68                }else{
69                    $state.go('access.login', { role : $scope.currentUser.user.role })
70                }
71            });
72        }
73
74        $scope.profileButton = function(userId) {
75            if(currentUser.user.role == 'borrower') {
76                $state.go("app.borrower_profile", { userId })
77            }else if(currentUser.user.role == 'lender'){
78                $state.go("app.lender_profile", { userId })
79            }else if(currentUser.user.role == 'admin' || currentUser.user.role == 'superAdmin' || currentUser.user.role == 'creditAnalyst'){
80                $state.go("admin.profile", { userId })
81            }
82        }
83    }

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.