-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #168 from OpenLMIS-Angola/OAM-291
OAM-291: made receive and issue and soh work offline
- Loading branch information
Showing
25 changed files
with
2,397 additions
and
195 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
519 changes: 519 additions & 0 deletions
519
src/openlmis-cached-repository/openlmis-cached-resource.js
Large diffs are not rendered by default.
Oops, something went wrong.
929 changes: 929 additions & 0 deletions
929
src/openlmis-cached-repository/openlmis-cached-resource.spec.js
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* This program is part of the OpenLMIS logistics management information system platform software. | ||
* Copyright © 2017 VillageReach | ||
* | ||
* This program is free software: you can redistribute it and/or modify it under the terms | ||
* of the GNU Affero General Public License as published by the Free Software Foundation, either | ||
* version 3 of the License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; | ||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
* See the GNU Affero General Public License for more details. You should have received a copy of | ||
* the GNU Affero General Public License along with this program. If not, see | ||
* http://www.gnu.org/licenses. For additional information contact [email protected]. | ||
*/ | ||
|
||
(function() { | ||
|
||
'use strict'; | ||
|
||
/** | ||
* @ngdoc service | ||
* @name referencedata-facility.FacilityResource | ||
* | ||
* @description | ||
* Implementation of the FacilityResource interface. Communicates with the REST API of the OpenLMIS | ||
* server. | ||
*/ | ||
angular | ||
.module('referencedata-facility') | ||
.factory('FacilityResource', FacilityResource); | ||
|
||
FacilityResource.$inject = ['OpenlmisCachedResource', 'classExtender']; | ||
|
||
function FacilityResource(OpenlmisCachedResource, classExtender) { | ||
|
||
classExtender.extend(FacilityResource, OpenlmisCachedResource); | ||
|
||
return FacilityResource; | ||
|
||
function FacilityResource() { | ||
this.super('/api/facilities', 'facilities', { | ||
versioned: false | ||
}); | ||
} | ||
} | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* This program is part of the OpenLMIS logistics management information system platform software. | ||
* Copyright © 2017 VillageReach | ||
* | ||
* This program is free software: you can redistribute it and/or modify it under the terms | ||
* of the GNU Affero General Public License as published by the Free Software Foundation, either | ||
* version 3 of the License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; | ||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
* See the GNU Affero General Public License for more details. You should have received a copy of | ||
* the GNU Affero General Public License along with this program. If not, see | ||
* http://www.gnu.org/licenses. For additional information contact [email protected]. | ||
*/ | ||
|
||
describe('FacilityResource', function() { | ||
|
||
beforeEach(function() { | ||
this.OpenlmisCachedResourceMock = jasmine.createSpy('OpenlmisCachedResource'); | ||
|
||
var OpenlmisCachedResourceMock = this.OpenlmisCachedResourceMock; | ||
module('referencedata-facility', function($provide) { | ||
$provide.factory('OpenlmisCachedResource', function() { | ||
return OpenlmisCachedResourceMock; | ||
}); | ||
}); | ||
|
||
inject(function($injector) { | ||
this.FacilityResource = $injector.get('FacilityResource'); | ||
}); | ||
}); | ||
|
||
it('should extend OpenlmisCachedResource', function() { | ||
new this.FacilityResource(); | ||
|
||
expect(this.OpenlmisCachedResourceMock).toHaveBeenCalledWith('/api/facilities', 'facilities', { | ||
versioned: false | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.