-
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 #107 from OpenLMIS-Angola/OAM-27
OAM 27: partial solution
- Loading branch information
Showing
33 changed files
with
964 additions
and
187 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.orderable-list-buttons-group { | ||
display: flex !important; | ||
flex-direction: row; | ||
gap: 1rem; | ||
float: right !important; | ||
} |
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
{ | ||
"adminOrderableList.export": "Export", | ||
"adminOrderableList.includeQuarantined": "Include Quarantined Products", | ||
"adminOrderableList.isQuarantined": "Quarantined" | ||
"adminOrderableList.isQuarantined": "Quarantined", | ||
"adminOrderableList.createUnit": "Create unit" | ||
} |
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,9 @@ | ||
{ | ||
"openlmisUnitAdd.form.header": "Create unit", | ||
"openlmisUnitAdd.form.label.name": "Name", | ||
"openlmisUnitAdd.form.label.description": "Description", | ||
"openlmisUnitAdd.form.label.displayOrder": "Display order", | ||
"openlmisUnitAdd.form.label.factor": "Factor", | ||
"openlmisUnitAdd.cancel": "Cancel", | ||
"openlmisUnitAdd.save": "Save" | ||
} |
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,34 @@ | ||
/* | ||
* 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 component | ||
* @name openlmis-unit-add.component:openlmisUnitAdd | ||
* | ||
* @description | ||
* Component responsible for displaying modal panel where user can add a new unit | ||
*/ | ||
angular | ||
.module('openlmis-unit-add') | ||
.component('openlmisUnitAdd', { | ||
templateUrl: 'openlmis-unit-add/openlmis-unit-add.html', | ||
controller: 'openlmisUnitAddController', | ||
controllerAs: '$ctrl' | ||
}); | ||
})(); |
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,57 @@ | ||
/* | ||
* 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 controller | ||
* @name openlmis-unit-add.controller:openlmisUnitAddController * | ||
* @description | ||
* Manages the openlmis-unit-add component | ||
*/ | ||
angular | ||
.module('openlmis-unit-add') | ||
.controller('openlmisUnitAddController', openlmisUnitAddController); | ||
|
||
openlmisUnitAddController.$inject = ['openlmisUnitAddService', 'stateTrackerService']; | ||
|
||
function openlmisUnitAddController(openlmisUnitAddService, stateTrackerService) { | ||
var $ctrl = this; | ||
$ctrl.newUnit = { | ||
name: undefined, | ||
description: undefined, | ||
displayOrder: undefined, | ||
factor: undefined | ||
}; | ||
$ctrl.save = save; | ||
$ctrl.goToPreviousState = stateTrackerService.goToPreviousState; | ||
$ctrl.saveDisabled = saveDisabled; | ||
|
||
function saveDisabled() { | ||
return !$ctrl.newUnit.name || | ||
!$ctrl.newUnit.factor || | ||
!$ctrl.newUnit.displayOrder; | ||
} | ||
|
||
function save() { | ||
openlmisUnitAddService.save($ctrl.newUnit) | ||
.then(function() { | ||
$ctrl.goToPreviousState(); | ||
}); | ||
} | ||
} | ||
})(); |
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 @@ | ||
<div class="modal" role="dialog" aria-hidden="true"> | ||
<div class="modal-dialog"> | ||
<div class="modal-content"> | ||
<div class="modal-header"> | ||
<h1>{{:: 'openlmisUnitAdd.form.header' | message}}</h1> | ||
</div> | ||
<div class="modal-body"> | ||
<form id="add-unit-form" ng-submit="$ctrl.save()"> | ||
<div class="form-group"> | ||
<label for="unit-name">{{:: 'openlmisUnitAdd.form.label.name' | message}}</label> | ||
<input id="unit-name" type="text" ng-model="$ctrl.newUnit.name" required> | ||
</div> | ||
<div class="form-group"> | ||
<label for="unit-description">{{:: 'openlmisUnitAdd.form.label.description' | message}}</label> | ||
<input id="unit-description" type="text" ng-model="$ctrl.newUnit.description"> | ||
</div> | ||
<div class="form-group"> | ||
<label for="unit-display-order">{{:: 'openlmisUnitAdd.form.label.displayOrder' | message}}</label> | ||
<input id="unit-display-order" type="number" ng-model="$ctrl.newUnit.displayOrder" required> | ||
</div> | ||
<div class="form-group"> | ||
<label for="unit-factor">{{:: 'openlmisUnitAdd.form.label.factor' | message}}</label> | ||
<input id="unit-factor" type="number" ng-model="$ctrl.newUnit.factor" required> | ||
</div> | ||
</form> | ||
</div> | ||
<div class="modal-footer"> | ||
<button id="cancel" ng-click="$ctrl.goToPreviousState()">{{'openlmisUnitAdd.cancel' | message}}</button> | ||
<button | ||
class="btn primary" | ||
ng-disabled="$ctrl.saveDisabled()" | ||
ng-class="{'btn-disabled': $ctrl.saveDisabled()}" | ||
form="add-unit-form" | ||
> | ||
{{'openlmisUnitAdd.save' | message}} | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
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,26 @@ | ||
/* | ||
* 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'; | ||
|
||
angular.module('openlmis-unit-add', [ | ||
'openlmis-modal', | ||
'openlmis-templates', | ||
'openlmis-state-tracker', | ||
'openlmis-modal-state', | ||
'openlmis-pagination' | ||
]); | ||
})(); |
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,49 @@ | ||
/* | ||
* 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'; | ||
|
||
angular | ||
.module('openlmis-unit-add') | ||
.config(routes); | ||
|
||
routes.$inject = ['modalStateProvider']; | ||
|
||
function routes(modalStateProvider) { | ||
|
||
modalStateProvider.state('openlmis.stockmanagement.adjustment.creation.unitAdd', { | ||
controller: 'openlmisUnitAddController', | ||
controllerAs: '$ctrl', | ||
templateUrl: 'openlmis-unit-add/openlmis-unit-add.html', | ||
url: '/addUnit' | ||
}); | ||
|
||
modalStateProvider.state('openlmis.stockmanagement.physicalInventory.draft.unitAdd', { | ||
controller: 'openlmisUnitAddController', | ||
controllerAs: '$ctrl', | ||
templateUrl: 'openlmis-unit-add/openlmis-unit-add.html', | ||
url: '/addUnit' | ||
}); | ||
|
||
modalStateProvider.state('openlmis.administration.orderables.unitAdd', { | ||
controller: 'openlmisUnitAddController', | ||
controllerAs: '$ctrl', | ||
templateUrl: 'openlmis-unit-add/openlmis-unit-add.html', | ||
url: '/addUnit' | ||
}); | ||
} | ||
})(); |
Empty file.
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,34 @@ | ||
/* | ||
* 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'; | ||
|
||
angular | ||
.module('openlmis-unit-add') | ||
.service('openlmisUnitAddService', openlmisUnitAddService); | ||
|
||
openlmisUnitAddService.$inject = ['unitOfOrderableService']; | ||
|
||
function openlmisUnitAddService(unitOfOrderableService) { | ||
return { | ||
save: save | ||
}; | ||
|
||
function save(unit) { | ||
return unitOfOrderableService.create(unit); | ||
} | ||
} | ||
})(); |
Oops, something went wrong.