Skip to content

Commit

Permalink
feat(enterprise): add settings panel
Browse files Browse the repository at this point in the history
This commit adds a new panel and CRUD interface for operation on
enterprise settings.  The settings table is linked 1-1 to the enterprise
table.  Tests have been updated accordingly.  The projects service has
also been updated to use the PrototypeApiService.

Closes IMA-WorldHealth#2174.
  • Loading branch information
jniles committed Mar 20, 2018
1 parent f0e7b22 commit 680b6e8
Show file tree
Hide file tree
Showing 22 changed files with 612 additions and 596 deletions.
25 changes: 17 additions & 8 deletions client/src/i18n/en/enterprise.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
{"ENTERPRISE":{"ADD_ENTERPRISE":"Add Enterprise.",
"ALL_ENTERPRISES":"All Enterprises",
"CONFIGURATION_ENTERPRISE":"Configuration Enterprise",
"DESCRIPTION_1":"Manage the application Companies from here. For now clearing the enterprise is not taken into account.",
"DESCRIPTION_2":"Edit selected Enterprise",
"DESCRIPTION_3":"Add a new enterprise.",
"EDITING_ENTERPRISE":"Editing enterprise",
"TITLE":"Enterprise Management"}}
{
"ENTERPRISE": {
"ADD_ENTERPRISE" : "Add Enterprise.",
"ALL_ENTERPRISES" : "All Enterprises",
"CONFIGURATION_ENTERPRISE" : "Configuration Enterprise",
"DESCRIPTION_1" : "Manage the application Companies from here. For now clearing the enterprise is not taken into account.",
"DESCRIPTION_2" : "Edit selected enterprise",
"DESCRIPTION_3" : "Add a new enterprise.",
"EDITING_ENTERPRISE" : "Editing enterprise",
"TITLE" : "Enterprise Management",
"SETTINGS" : {
"TITLE" : "Enterprise Settings",
"ENABLE_PRICE_LOCK_LABEL" : "Lock Price Changes for Patient Invoicing",
"ENABLE_PRICE_LOCK_HELP_TEXT" : "Enabling this feature will disallow users from modifying the prices of inventory items in the Patient Invoice module."
}
}
}
25 changes: 17 additions & 8 deletions client/src/i18n/fr/enterprise.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
{"ENTERPRISE":{"ADD_ENTERPRISE":"Ajouter entreprise",
"ALL_ENTERPRISES":"Tous les entriprises",
"CONFIGURATION_ENTERPRISE":"Configuration entreprise",
"DESCRIPTION_1":"Gerer les entreprises de l'application A partir d'ici. Pour l'instant effacement de l'entrerpise n'est pas prise en compte.",
"DESCRIPTION_2":"Modifier l'enterprise sélectionner",
"DESCRIPTION_3":"Ajouter une nouvelle entreprises",
"EDITING_ENTERPRISE":"Edition entreprise",
"TITLE":"Gestion des entreprises"}}
{
"ENTERPRISE" : {
"ADD_ENTERPRISE" : "Ajouter entreprise",
"ALL_ENTERPRISES" : "Tous les entriprises",
"CONFIGURATION_ENTERPRISE" : "Configuration entreprise",
"DESCRIPTION_1" : "Gerer les entreprises de l'application A partir d'ici. Pour l'instant effacement de l'entrerpise n'est pas prise en compte.",
"DESCRIPTION_2" : "Modifier l'enterprise sélectionner",
"DESCRIPTION_3" : "Ajouter une nouvelle entreprises",
"EDITING_ENTERPRISE" : "Edition entreprise",
"TITLE" : "Gestion des entreprises",
"SETTINGS" : {
"TITLE" : "Parametres de l'Enterprise",
"ENABLE_PRICE_LOCK_LABEL" : "Verrouiller les changements de prix pour la facturation des patients",
"ENABLE_PRICE_LOCK_HELP_TEXT" : "L'activation de cette fonctionnalité empêchera les utilisateurs de modifier les prix des articles en stock dans le module Facturation de Patients."
}
}
}
28 changes: 17 additions & 11 deletions client/src/js/components/bhYesNoRadios.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,30 @@
angular.module('bhima.components')
.component('bhYesNoRadios', {
bindings : {
defaultValue : '@?',
value : '=',
label : '@?',
value : '<',
label : '@',
helpText : '@?',
onChangeCallback : '&',
},
templateUrl : 'modules/templates/bhYesNoRadios.tmpl.html',
controller : YesNoRadio,
controller : YesNoRadioController,
});

function YesNoRadio() {
/**
* @function YesNoRadioController
*
* @description
* This component makes yes/no options a bit easier to navigate.
*/
function YesNoRadioController() {
const $ctrl = this;
$ctrl.$onInit = function onInit() {
$ctrl.onChangeCallback = $ctrl.onChangeCallback;
$ctrl.defaultValue = $ctrl.defaultValue;
$ctrl.value = ($ctrl.defaultValue) ? 1 : 0;
$ctrl.label = $ctrl.label;
$ctrl.helpText = $ctrl.helpText;

$ctrl.$onInit = () => {
$ctrl.value = Number.parseInt($ctrl.value, 10);
$ctrl.onChangeCallback = $ctrl.onChangeCallback || angular.noop;
};

$ctrl.onChange = (value) => {
$ctrl.onChangeCallback({ value });
};
}
Loading

0 comments on commit 680b6e8

Please sign in to comment.