Modifications to make community-app work with fineract

This commit is contained in:
Adi Narayana Raju 2016-02-02 15:51:35 +05:30
parent 4a4d31a1f7
commit 3ba2cea715
7 changed files with 12 additions and 12 deletions

View File

@ -13,11 +13,11 @@
console.log('domains---' + domains);
// For multi tenant hosting
if (domains[0] == "demo") {
$httpProvider.defaults.headers.common['X-Mifos-Platform-TenantId'] = 'default';
$httpProvider.defaults.headers.common['Fineract-Platform-TenantId'] = 'default';
ResourceFactoryProvider.setTenantIdenetifier('default');
console.log("demo server", domains[0]);
} else {
$httpProvider.defaults.headers.common['X-Mifos-Platform-TenantId'] = domains[0];
$httpProvider.defaults.headers.common['Fineract-Platform-TenantId'] = domains[0];
ResourceFactoryProvider.setTenantIdenetifier(domains[0]);
console.log("other than demo server", domains[0]);
}
@ -37,10 +37,10 @@
host = "https://" + queryLink.hostname + (queryLink.port ? ':' + queryLink.port : '');
portNumber = queryLink.port;
$httpProvider.defaults.headers.common['X-Mifos-Platform-TenantId'] = 'default';
$httpProvider.defaults.headers.common['Fineract-Platform-TenantId'] = 'default';
ResourceFactoryProvider.setTenantIdenetifier('default');
if (QueryParameters["tenantIdentifier"]) {
$httpProvider.defaults.headers.common['X-Mifos-Platform-TenantId'] = QueryParameters["tenantIdentifier"];
$httpProvider.defaults.headers.common['Fineract-Platform-TenantId'] = QueryParameters["tenantIdentifier"];
ResourceFactoryProvider.setTenantIdenetifier(QueryParameters["tenantIdentifier"]);
}
}

View File

@ -1,5 +1,5 @@
angular.module('configurations', [])
.constant('API_VERSION', '/mifosng-provider/api/v1')
.constant('API_VERSION', '/fineract-provider/api/v1')
.constant('IDLE_DURATION', 30 * 60)
.constant('WARN_DURATION', 10)
.constant('KEEPALIVE_INTERVAL', 15 * 60)

View File

@ -10,7 +10,7 @@
scope.$broadcast("UserAuthenticationFailureEvent", data, status);
};
var apiVer = '/mifosng-provider/api/v1';
var apiVer = '/fineract-provider/api/v1';
var getUserDetails = function(data){
@ -41,14 +41,14 @@
var getAccessToken = function(){
var refreshToken = localStorageService.getFromLocalStorage("tokendetails").refresh_token;
httpService.cancelAuthorization();
httpService.post( "/mifosng-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);
}
this.authenticateWithUsernamePassword = function (credentials) {
scope.$broadcast("UserAuthenticationStartEvent");
if(SECURITY === 'oauth'){
httpService.post( "/mifosng-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)
.error(onFailure);
} else {

View File

@ -1,7 +1,7 @@
(function (module) {
mifosX.services = _.extend(module, {
ResourceFactoryProvider: function () {
var baseUrl = "" , apiVer = "/mifosng-provider/api/v1", tenantIdentifier = "";
var baseUrl = "" , apiVer = "/fineract-provider/api/v1", tenantIdentifier = "";
this.setBaseUrl = function (url) {
baseUrl = url;
};

View File

@ -10,7 +10,7 @@ define(['mifosX', 'services/HttpServiceProvider', 'services/ResourceFactoryProvi
return _.extend(config, {url: baseUrl + config.url});
});*/
httpProvider.defaults.headers.common['X-Mifos-Platform-TenantId'] = 'default';
httpProvider.defaults.headers.common['Fineract-Platform-TenantId'] = 'default';
}]).run(function ($log) {
$log.warn("Using live demo server api -> " + baseUrl);
});

View File

@ -21,7 +21,7 @@ describe("AuthenticationService", function () {
});
it("should pass the correct parameters to the post method", function () {
expect(httpService.post).toHaveBeenCalledWith("/mifosng-provider/api/v1/authentication?username=test_username&password=test_password");
expect(httpService.post).toHaveBeenCalledWith("/fineract-provider/api/v1/authentication?username=test_username&password=test_password");
});
it("should broadcast 'UserAuthenticationStartEvent'", function () {

View File

@ -1,7 +1,7 @@
describe("ResourceFactoryProvider", function () {
var ngResource,
rootScope,
apiVersion = "/mifosng-provider/api/v1";
apiVersion = "/fineract-provider/api/v1";
beforeEach(function () {
this.provider = new mifosX.services.ResourceFactoryProvider();
ngResource = jasmine.createSpy("$resource").andReturn("test_resource");