Skip to content

Commit

Permalink
Merge #2607
Browse files Browse the repository at this point in the history
2607: feat(enterprise): add settings panel r=jniles a=jniles

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 #2174.
  • Loading branch information
bors[bot] committed Mar 27, 2018
2 parents 3d8cc58 + 69510d0 commit 52eca5c
Show file tree
Hide file tree
Showing 23 changed files with 677 additions and 633 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 : '@',
name : '@',
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.onChange = (value) => {
$ctrl.onChangeCallback({ value });
};
}
Loading

0 comments on commit 52eca5c

Please sign in to comment.