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