mirror of
https://github.com/openMF/community-app.git
synced 2026-02-06 09:37:29 +00:00
updated bower dependency (#3234)
This commit is contained in:
parent
b38ec7ebcf
commit
78e3d790a5
@ -2,7 +2,8 @@
|
|||||||
mifosX.controllers = _.extend(module, {
|
mifosX.controllers = _.extend(module, {
|
||||||
MainController: function (scope, location, sessionManager, translate, $rootScope, localStorageService, keyboardManager, $idle, tmhDynamicLocale,
|
MainController: function (scope, location, sessionManager, translate, $rootScope, localStorageService, keyboardManager, $idle, tmhDynamicLocale,
|
||||||
uiConfigService, $http) {
|
uiConfigService, $http) {
|
||||||
$http.get('release.json').success(function(data) {
|
$http.get('release.json').then(function onSuccess(response) {
|
||||||
|
var data = response.data;
|
||||||
scope.version = data.version;
|
scope.version = data.version;
|
||||||
scope.releasedate = data.releasedate;
|
scope.releasedate = data.releasedate;
|
||||||
});
|
});
|
||||||
@ -16,7 +17,8 @@
|
|||||||
|
|
||||||
if(!scope.islogofoldernamefetched && $rootScope.tenantIdentifier && $rootScope.tenantIdentifier != "default"){
|
if(!scope.islogofoldernamefetched && $rootScope.tenantIdentifier && $rootScope.tenantIdentifier != "default"){
|
||||||
scope.islogofoldernamefetched = true;
|
scope.islogofoldernamefetched = true;
|
||||||
$http.get('scripts/config/LogoConfig.json').success(function(datas) {
|
$http.get('scripts/config/LogoConfig.json').then(function onSuccess(response) {
|
||||||
|
var datas = response.data;
|
||||||
for(var i in datas){
|
for(var i in datas){
|
||||||
var data = datas[i];
|
var data = datas[i];
|
||||||
if(data.tenantIdentifier != undefined && data.tenantIdentifier == $rootScope.tenantIdentifier){
|
if(data.tenantIdentifier != undefined && data.tenantIdentifier == $rootScope.tenantIdentifier){
|
||||||
@ -42,11 +44,11 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}).catch(function onError(response) {
|
||||||
|
console.warn("Error: ", response.data)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
scope.$on('scrollbar.show', function(){
|
scope.$on('scrollbar.show', function(){
|
||||||
console.log('Scrollbar show');
|
console.log('Scrollbar show');
|
||||||
});
|
});
|
||||||
|
|||||||
@ -12,7 +12,8 @@
|
|||||||
method: 'GET',
|
method: 'GET',
|
||||||
url: $rootScope.hostUrl + API_VERSION + '/mixmapping'
|
url: $rootScope.hostUrl + API_VERSION + '/mixmapping'
|
||||||
})
|
})
|
||||||
.success(function (data) {
|
.then(function onSuccess(response) {
|
||||||
|
var data = response.data;
|
||||||
var mappingJson = data.config;
|
var mappingJson = data.config;
|
||||||
if (mappingJson != undefined && mappingJson.length > 0) {
|
if (mappingJson != undefined && mappingJson.length > 0) {
|
||||||
for (var i = scope.mixtaxonomyArray.length - 1; i >= 0; i--) {
|
for (var i = scope.mixtaxonomyArray.length - 1; i >= 0; i--) {
|
||||||
@ -24,6 +25,8 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}).catch(function onError(response) {
|
||||||
|
console.log("Error Detected: ", response.data)
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -95,11 +98,14 @@
|
|||||||
http({
|
http({
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
url: $rootScope.hostUrl + API_VERSION + '/mixreport?startDate=' + scope.startDate + '&endDate=' + scope.endDate
|
url: $rootScope.hostUrl + API_VERSION + '/mixreport?startDate=' + scope.startDate + '&endDate=' + scope.endDate
|
||||||
}).success(function (data) {
|
}).then(function onSuccess(response) {
|
||||||
|
var data = response.data;
|
||||||
var parser = new DOMParser();
|
var parser = new DOMParser();
|
||||||
var xmlDoc = parser.parseFromString(data, "text/xml");
|
var xmlDoc = parser.parseFromString(data, "text/xml");
|
||||||
$rootScope.xmlData = xmlDoc;
|
$rootScope.xmlData = xmlDoc;
|
||||||
location.path('/xbrlreport');
|
location.path('/xbrlreport');
|
||||||
|
}) .catch( function onError(response) {
|
||||||
|
console.log("Error Detected: ", response.data)
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -1034,6 +1034,7 @@
|
|||||||
.otherwise({
|
.otherwise({
|
||||||
templateUrl: "views/errors/404.html"
|
templateUrl: "views/errors/404.html"
|
||||||
});
|
});
|
||||||
|
$locationProvider.hashPrefix('');
|
||||||
$locationProvider.html5Mode(false);
|
$locationProvider.html5Mode(false);
|
||||||
};
|
};
|
||||||
mifosX.ng.application.config(defineRoutes).run(function ($log) {
|
mifosX.ng.application.config(defineRoutes).run(function ($log) {
|
||||||
|
|||||||
@ -5,7 +5,8 @@
|
|||||||
var twoFactorIsRememberMeRequest = false;
|
var twoFactorIsRememberMeRequest = false;
|
||||||
var twoFactorAccessToken = null;
|
var twoFactorAccessToken = null;
|
||||||
|
|
||||||
var onLoginSuccess = function (data) {
|
var onLoginSuccess = function (response) {
|
||||||
|
var data = response.data;
|
||||||
if(data.isTwoFactorAuthenticationRequired != null && data.isTwoFactorAuthenticationRequired == true) {
|
if(data.isTwoFactorAuthenticationRequired != null && data.isTwoFactorAuthenticationRequired == true) {
|
||||||
if(hasValidTwoFactorToken(data.username)) {
|
if(hasValidTwoFactorToken(data.username)) {
|
||||||
var token = getTokenFromStorage(data.username);
|
var token = getTokenFromStorage(data.username);
|
||||||
@ -20,23 +21,26 @@
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
var onLoginFailure = function (data, status) {
|
var onLoginFailure = function (response) {
|
||||||
|
var data = response.data;
|
||||||
|
var status = response.status;
|
||||||
scope.$broadcast("UserAuthenticationFailureEvent", data, status);
|
scope.$broadcast("UserAuthenticationFailureEvent", data, status);
|
||||||
};
|
};
|
||||||
|
|
||||||
var apiVer = '/fineract-provider/api/v1';
|
var apiVer = '/fineract-provider/api/v1';
|
||||||
|
|
||||||
var getUserDetails = function(data){
|
var getUserDetails = function(response){
|
||||||
|
var data = response.data;
|
||||||
localStorageService.addToLocalStorage('tokendetails', data);
|
localStorageService.addToLocalStorage('tokendetails', data);
|
||||||
setTimer(data.expires_in);
|
setTimer(data.expires_in);
|
||||||
httpService.get( apiVer + "/userdetails?access_token=" + data.access_token)
|
httpService.get( apiVer + "/userdetails?access_token=" + data.access_token)
|
||||||
.success(onLoginSuccess)
|
.then(onLoginSuccess)
|
||||||
.error(onLoginFailure);
|
.catch(onLoginFailure);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var updateAccessDetails = function(data){
|
var updateAccessDetails = function(response){
|
||||||
|
var data = response.data;
|
||||||
var sessionData = webStorage.get('sessionData');
|
var sessionData = webStorage.get('sessionData');
|
||||||
sessionData.authenticationKey = data.access_token;
|
sessionData.authenticationKey = data.access_token;
|
||||||
webStorage.add("sessionData",sessionData);
|
webStorage.add("sessionData",sessionData);
|
||||||
@ -56,19 +60,19 @@
|
|||||||
var refreshToken = localStorageService.getFromLocalStorage("tokendetails").refresh_token;
|
var refreshToken = localStorageService.getFromLocalStorage("tokendetails").refresh_token;
|
||||||
httpService.cancelAuthorization();
|
httpService.cancelAuthorization();
|
||||||
httpService.post( "/fineract-provider/api/oauth/token?&client_id=community-app&grant_type=refresh_token&client_secret=123&refresh_token=" + refreshToken)
|
httpService.post( "/fineract-provider/api/oauth/token?&client_id=community-app&grant_type=refresh_token&client_secret=123&refresh_token=" + refreshToken)
|
||||||
.success(updateAccessDetails);
|
.then(updateAccessDetails);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.authenticateWithUsernamePassword = function (credentials) {
|
this.authenticateWithUsernamePassword = function (credentials) {
|
||||||
scope.$broadcast("UserAuthenticationStartEvent");
|
scope.$broadcast("UserAuthenticationStartEvent");
|
||||||
if(SECURITY === 'oauth'){
|
if(SECURITY === 'oauth'){
|
||||||
httpService.post( "/fineract-provider/api/oauth/token?username=" + credentials.username + "&password=" + credentials.password +"&client_id=community-app&grant_type=password&client_secret=123")
|
httpService.post( "/fineract-provider/api/oauth/token?username=" + credentials.username + "&password=" + credentials.password +"&client_id=community-app&grant_type=password&client_secret=123")
|
||||||
.success(getUserDetails)
|
.then(getUserDetails)
|
||||||
.error(onLoginFailure);
|
.catch(onLoginFailure);
|
||||||
} else {
|
} else {
|
||||||
httpService.post(apiVer + "/authentication", { "username": credentials.username, "password": credentials.password})
|
httpService.post(apiVer + "/authentication", { "username": credentials.username, "password": credentials.password})
|
||||||
.success(onLoginSuccess)
|
.then(onLoginSuccess)
|
||||||
.error(onLoginFailure);
|
.catch(onLoginFailure);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -80,7 +84,8 @@
|
|||||||
localStorageService.addToLocalStorage('userData', userData);
|
localStorageService.addToLocalStorage('userData', userData);
|
||||||
};
|
};
|
||||||
|
|
||||||
var onOTPValidateSuccess = function (data) {
|
var onOTPValidateSuccess = function (response) {
|
||||||
|
var data = response.data;
|
||||||
var accessToken = data.token;
|
var accessToken = data.token;
|
||||||
if(twoFactorIsRememberMeRequest) {
|
if(twoFactorIsRememberMeRequest) {
|
||||||
saveTwoFactorTokenToStorage(userData.username, data);
|
saveTwoFactorTokenToStorage(userData.username, data);
|
||||||
@ -91,7 +96,9 @@
|
|||||||
localStorageService.addToLocalStorage('userData', userData);
|
localStorageService.addToLocalStorage('userData', userData);
|
||||||
};
|
};
|
||||||
|
|
||||||
var onOTPValidateError = function (data, status) {
|
var onOTPValidateError = function (response) {
|
||||||
|
var data = response.data;
|
||||||
|
var status = response.status;
|
||||||
scope.$broadcast("TwoFactorAuthenticationFailureEvent", data, status);
|
scope.$broadcast("TwoFactorAuthenticationFailureEvent", data, status);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -134,8 +141,8 @@
|
|||||||
this.validateOTP = function (token, rememberMe) {
|
this.validateOTP = function (token, rememberMe) {
|
||||||
twoFactorIsRememberMeRequest = rememberMe;
|
twoFactorIsRememberMeRequest = rememberMe;
|
||||||
httpService.post(apiVer + "/twofactor/validate?token=" + token)
|
httpService.post(apiVer + "/twofactor/validate?token=" + token)
|
||||||
.success(onOTPValidateSuccess)
|
.then(onOTPValidateSuccess)
|
||||||
.error(onOTPValidateError);
|
.catch(onOTPValidateError);
|
||||||
};
|
};
|
||||||
|
|
||||||
scope.$on("OnUserPreLogout", function (event) {
|
scope.$on("OnUserPreLogout", function (event) {
|
||||||
|
|||||||
@ -17,14 +17,13 @@
|
|||||||
|
|
||||||
this.init = function(scope) {
|
this.init = function(scope) {
|
||||||
var deferred = $q.defer();
|
var deferred = $q.defer();
|
||||||
$http.get('scripts/config/UIconfig.json').success(function(data) {
|
$http.get('scripts/config/UIconfig.json').then(function onSuccess(response) {
|
||||||
|
var data = response.data;
|
||||||
scope.$emit("configJsonObj",data);
|
scope.$emit("configJsonObj",data);
|
||||||
deferred.resolve(data);
|
deferred.resolve(data);
|
||||||
$templateCache.put("configJsonObj", deferred.promise);
|
$templateCache.put("configJsonObj", deferred.promise);
|
||||||
}).error(function(data) {
|
}).catch(function onError(errorResponse){
|
||||||
deferred.reject(data);
|
deferred.reject(errorResponse.data);
|
||||||
}).catch(function(e){
|
|
||||||
console.log("Configuration file not found");
|
|
||||||
});
|
});
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
35
bower.json
35
bower.json
@ -5,43 +5,44 @@
|
|||||||
"lib"
|
"lib"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"angular": "1.5.0",
|
"angular": "1.7.9",
|
||||||
"angular-resource": "1.5.0",
|
"angular-resource": "^1.7.9",
|
||||||
"angular-route": "1.5.0",
|
"angular-route": "1.7.9",
|
||||||
"angular-mocks": "1.5.0",
|
"angular-mocks": "1.7.9",
|
||||||
"angular-bootstrap": "1.3.2",
|
"angular-bootstrap": "1.3.2",
|
||||||
"angular-webstorage": "latest",
|
"angular-webstorage": "latest",
|
||||||
"angular-animate": "1.5.0",
|
"angular-animate": "1.7.9",
|
||||||
"angular-touch": "1.5.0",
|
"angular-touch": "1.7.9",
|
||||||
"jquery": "2.2.1",
|
"jquery": "2.2.1",
|
||||||
"requirejs": "2.2.0",
|
"requirejs": "^2.3.6",
|
||||||
"require-css": "0.1.8",
|
"require-css": "^0.1.10",
|
||||||
"underscore": "1.8.3",
|
"underscore": "1.8.3",
|
||||||
"angular-translate": "2.7.2",
|
"angular-translate": "2.18.2",
|
||||||
"angular-translate-loader-static-files": "2.7.2",
|
"angular-translate-loader-static-files": "2.18.2",
|
||||||
"d3": "3.3.13",
|
"d3": "3.3.13",
|
||||||
"nvd3": "~v1.1.15-beta",
|
"nvd3": "~v1.1.15-beta",
|
||||||
"angularjs-file-upload": "12.0.1",
|
"angularjs-file-upload": "12.0.1",
|
||||||
"angular-sanitize": "1.5.0",
|
"angular-sanitize": "1.7.9",
|
||||||
"ckeditor": "4.5.7",
|
"ckeditor": "^4.14.0",
|
||||||
"ng-idle": "v0.3.5",
|
"ng-idle": "v0.3.5",
|
||||||
"q": "1.0.1",
|
"q": "1.0.1",
|
||||||
"angular-dynamic-locale": "",
|
"angular-dynamic-locale": "^0.1.37",
|
||||||
"webcam-directive": "3.2.1",
|
"webcam-directive": "3.2.1",
|
||||||
"angular-utils-pagination": "0.9.1",
|
"angular-utils-pagination": "0.9.1",
|
||||||
"bootstrap": "~3.3.3",
|
"bootstrap": "~3.3.3",
|
||||||
"fontawesome": "~4.1.0",
|
"fontawesome": "~4.1.0",
|
||||||
"bootstrap-sass": "~3.3.3",
|
"bootstrap-sass": "~3.3.3",
|
||||||
"angular-chosen-localytics": "^1.4.0",
|
"angular-chosen-localytics": "^1.9.3",
|
||||||
"ng-scrollbar": "^0.0.8",
|
"ng-scrollbar": "^0.0.8",
|
||||||
"almond": "^0.3.2"
|
"almond": "^0.3.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"jasmine": "2.4.1"
|
"jasmine": "2.4.1"
|
||||||
},
|
},
|
||||||
"resolutions": {
|
"resolutions": {
|
||||||
"angular": "1.5.0",
|
"angular": "1.7.9",
|
||||||
"d3": "3.5.12",
|
"d3": "3.5.12",
|
||||||
"angular-translate": "~2.11.0"
|
"angular-translate": "^2.18.2",
|
||||||
|
"angular-resource": "^1.7.9"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,9 +5,9 @@ describe("AuthenticationService", function () {
|
|||||||
scope = jasmine.createSpyObj("$rootScope", ['$broadcast', '$on']);
|
scope = jasmine.createSpyObj("$rootScope", ['$broadcast', '$on']);
|
||||||
localStorageService = jasmine.createSpyObj('localStorageService', ['addToLocalStorage']);
|
localStorageService = jasmine.createSpyObj('localStorageService', ['addToLocalStorage']);
|
||||||
|
|
||||||
httpService = jasmine.createSpyObj("httpService", ['post', 'success', 'error']);
|
httpService = jasmine.createSpyObj("httpService", ['post', 'then', 'catch']);
|
||||||
httpService.post.andReturn(httpService);
|
httpService.post.andReturn(httpService);
|
||||||
_.each(['success', 'error'], function (method) {
|
_.each(['then', 'catch'], function (method) {
|
||||||
httpService[method].andCallFake(function (callback) {
|
httpService[method].andCallFake(function (callback) {
|
||||||
callbacks[method] = callback;
|
callbacks[method] = callback;
|
||||||
return this;
|
return this;
|
||||||
@ -30,7 +30,7 @@ describe("AuthenticationService", function () {
|
|||||||
|
|
||||||
describe("On successful authentication", function () {
|
describe("On successful authentication", function () {
|
||||||
it("should broadcast a 'UserAuthenticationSuccessEvent' on successful authentication", function () {
|
it("should broadcast a 'UserAuthenticationSuccessEvent' on successful authentication", function () {
|
||||||
callbacks['success']("test_data");
|
callbacks['then']({ data: "test_data"});
|
||||||
|
|
||||||
expect(scope.$broadcast).toHaveBeenCalledWith("UserAuthenticationSuccessEvent", "test_data");
|
expect(scope.$broadcast).toHaveBeenCalledWith("UserAuthenticationSuccessEvent", "test_data");
|
||||||
});
|
});
|
||||||
@ -38,7 +38,7 @@ describe("AuthenticationService", function () {
|
|||||||
|
|
||||||
describe("On failed authentication", function () {
|
describe("On failed authentication", function () {
|
||||||
it("should broadcast a 'UserAuthenticationFailureEvent' on failed authentication", function () {
|
it("should broadcast a 'UserAuthenticationFailureEvent' on failed authentication", function () {
|
||||||
callbacks['error']("test_data", "status_code");
|
callbacks['catch']({ data: "test_data", status:"status_code" });
|
||||||
|
|
||||||
expect(scope.$broadcast).toHaveBeenCalledWith("UserAuthenticationFailureEvent", "test_data", "status_code");
|
expect(scope.$broadcast).toHaveBeenCalledWith("UserAuthenticationFailureEvent", "test_data", "status_code");
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user