Skip to content

Commit

Permalink
Add optional indicator to many system selection components.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcameron committed Dec 14, 2021
1 parent 490f2ef commit 21a522f
Show file tree
Hide file tree
Showing 40 changed files with 186 additions and 89 deletions.
12 changes: 12 additions & 0 deletions client/src/i18n/en/form.json
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@
"ADDRESS_IN_DOCUMENTS":"Address (to be displayed on documents)",
"ABBREVIATION": "Abbreviation",
"ACCOUNT": "Account",
"ACCOUNT_OPTIONAL": "Account (optional)",
"ACCOUNT_CONFIGURATION" : "Account Setup",
"ACCOUNT_EXTRACT": "Account Details",
"ACCOUNT_NUMBER": "Account Number",
Expand Down Expand Up @@ -409,6 +410,7 @@
"DEBTOR_BALANCE_REMAINING": "Debtor's Remaining Balance",
"DEBTOR_CREDITOR": "Debtor/Creditor",
"DEBTOR_GROUP": "Debtor Group",
"DEBTOR_GROUP_OPTIONAL": "Debtor Group (optional)",
"DEBTOR_GROUP_FORM": "Form debtor group record",
"DECREASE": "Decrease",
"DEDUCTION" : "Deduction",
Expand All @@ -419,6 +421,7 @@
"DEFINE_UNTIL_DATE": "Define a limit date",
"DELAY": "Delay",
"DEPOT": "Depot",
"DEPOT_OPTIONAL": "Depot (optional)",
"DESCRIPTION": "Description",
"DESIGNATION": "Designation",
"DETAIL_PREVIOUS": "Previous Year Details",
Expand All @@ -441,6 +444,7 @@
"EMAIL": "Email",
"EMPLOYEE_ID": "Employee Id",
"EMPLOYEE_NAME": "Employee name",
"EMPLOYEE_NAME_OPTIONAL": "Employee name (optional)",
"EMPLOYER": "Employer",
"ENABLED": "Enabled",
"END_DATE": "End Date",
Expand Down Expand Up @@ -473,6 +477,7 @@
"FINANCIAL_STATUS": "Financial Status",
"FIRST_NAME": "First Name",
"FISCAL_YEAR": "Fiscal Year",
"FISCAL_YEAR_OPTIONAL": "Fiscal Year (optional)",
"FIXED_CHARGE": "Fixed Cost",
"FOR": "For",
"FORM": "Form",
Expand Down Expand Up @@ -512,6 +517,9 @@
"INTERMEDIATE_BALANCE": "Intermediate Balance",
"INTL": "International",
"INVENTORY": "Inventory",
"INVENTORY_OPTIONAL": "Inventory (optional)",
"INVENTORY_GROUP": "Inventory Group",
"INVENTORY_GROUP_OPTIONAL": "Inventory Group (optional)",
"INVENTORY_ITEM": "Item",
"INVENTORY_PRICE": "Inventory Price",
"INVOICE_CURRENCY_SETTING": "Invoice Currency Setting",
Expand Down Expand Up @@ -637,6 +645,7 @@
"PERIOD_FROM": "Period From",
"PERIOD_PAYMENT" : "Period of payment",
"PERIOD": "Period",
"PERIOD_OPTIONAL": "Period (optional)",
"PERIOD_TO": "Period To",
"PERIOD_TOTAL": "Period Total",
"PHONE_NO": "Phone Number",
Expand Down Expand Up @@ -716,6 +725,7 @@
"SELECT": "Select",
"SENIORITY_BONUS": "seniority bonus",
"SERVICE": "Service",
"SERVICE_OPTIONAL": "Service (optional)",
"SERVICES": "Services",
"SET_DATE": "Change Date",
"SETTINGS": "Settings",
Expand Down Expand Up @@ -939,11 +949,13 @@
"ACCOUNT_REFERENCE" : "Select an Account Reference",
"ACCOUNT_REFERENCE_TYPE" : "Select an Account Reference Type",
"ACCOUNT": "Select an Account",
"ACCOUNT_OPTIONAL": "Select an Account (optional)",
"ACCOUNTS": "Select Accounts",
"ACCOUNT_TYPE": "Select Account Type",
"BALANCE_SECTION": "Select Balance Sheet Section",
"BED":"Select a Bed",
"CASHBOX": "Select a cashbox",
"CASHBOX_OPTIONAL": "Select a cashbox (optional)",
"COST_CENTER": "Select a Cost Center",
"COUNTRY": "Select Country",
"CREDITOR_GROUP": "Select a Creditor Group",
Expand Down
1 change: 1 addition & 0 deletions client/src/i18n/en/periods.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"START" : "P. Start",
"END" : "P. End",
"PERIOD_LIMIT" : "Period Limit",
"PERIOD_LIMIT_OPTIONAL" : "Period Limit (optional)",
"CUSTOM_FROM" : "Custom From",
"CUSTOM_TO" : "Custom To",
"SELECT_PERIOD" : "Select Period",
Expand Down
2 changes: 1 addition & 1 deletion client/src/i18n/en/report.json
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
"SOURCE_DEPOT" : "Source Depot"
},
"MONTHLY_CONSUMPTION" : {
"TITLE": "Monthly consumption",
"TITLE": "Monthly Consumption",
"DESCRIPTION": "Monthly consumption report by deposit for a given period"
},
"OPENING_BALANCE": "Opening Balance",
Expand Down
14 changes: 13 additions & 1 deletion client/src/i18n/fr/form.json
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@
"ADDRESS_IN_DOCUMENTS":"Adresse (à afficher sur les documents)",
"ABBREVIATION": "Abbreviation",
"ACCOUNT": "Compte",
"ACCOUNT_OPTIONAL": "Compte (optionnel)",
"ACCOUNT_CONFIGURATION" : "Configuration du Compte",
"ACCOUNT_EXTRACT": "Extrait de compte",
"ACCOUNT_NUMBER": "Numéro de Compte",
Expand Down Expand Up @@ -412,7 +413,8 @@
"DEBTOR_BALANCE_REMAINING": "Solde Restant du Débiteur",
"DEBTOR_CREDITOR": "Débiteur/Créditeur",
"DEBTOR_GROUP_FORM": "Formulaire d'enregistrement de Groupe Débiteur",
"DEBTOR_GROUP": "Groupe Débiteur",
"DEBTOR_GROUP": "Groupe débiteur",
"DEBTOR_GROUP": "Groupe débiteur (optionnel)",
"DECREASE" : "Dimunition",
"DEDUCTION" : "Contribution ou retenue",
"DEFAULT_QUANTITY": "Quantité par Défaut",
Expand All @@ -422,6 +424,7 @@
"DEFINE_UNTIL_DATE": "Définir une date limite",
"DELAY": "Délai de livraison",
"DEPOT": "Dépôt",
"DEPOT_OPTIONAL" : "Dépôt (optionnel)",
"DESCRIPTION": "Description",
"DESIGNATION": "Désignation",
"DETAIL_PREVIOUS": "Detailler Année Précédente",
Expand All @@ -444,6 +447,7 @@
"EMAIL": "Email",
"EMPLOYEE_ID": "ID Employé",
"EMPLOYEE_NAME": "Nom de l'employé",
"EMPLOYEE_NAME_OPTIONAL": "Nom de l'employé (optionnel)",
"EMPLOYER": "Employeur",
"ENABLED": "Activé",
"END_DATE": "Date de fin",
Expand Down Expand Up @@ -476,6 +480,7 @@
"FINANCIAL_STATUS": "Situation Financière",
"FIRST_NAME": "Prenom",
"FISCAL_YEAR": "Annee Fiscale",
"FISCAL_YEAR_OPTIONAL": "Annee Fiscale (optionnelle)",
"FIXED_CHARGE": "Charge fixe",
"FORM": "Formulaire",
"FOR": "Pour",
Expand Down Expand Up @@ -515,6 +520,9 @@
"INTERMEDIATE_BALANCE": "Balance Intermediare",
"INTL": "Internationale",
"INVENTORY": "Inventaire",
"INVENTORY_OPTIONAL": "Inventaire (optionnel)",
"INVENTORY_GROUP": "Groupe d'inventaire",
"INVENTORY_GROUP_OPTIONAL": "Groupe d'inventaire (optionnel)",
"INVENTORY_ITEM": "Item",
"INVENTORY_PRICE": "Prix d'inventaire",
"INVOICE_CURRENCY_SETTING": "Paramètre de monnaie de facture",
Expand Down Expand Up @@ -639,6 +647,7 @@
"PERIOD_FROM": "Période Du",
"PERIOD_PAYMENT" : "Période de paiement",
"PERIOD": "Période",
"PERIOD_OPTIONAL": "Période (optionnelle)",
"PERIOD_TO": "Période Au",
"PERIOD_TOTAL": "Total de la période",
"PHONE_NO": "Numéro de Téléphone",
Expand Down Expand Up @@ -716,6 +725,7 @@
"SELECT": "Sélectionner",
"SENIORITY_BONUS": "Prime d'ancienneté",
"SERVICE": "Service",
"SERVICE_OPTIONAL": "Service (optionnel)",
"SERVICES": "Services",
"SET_DATE": "Changer la Date",
"SETTINGS": "Paramétrages",
Expand Down Expand Up @@ -939,11 +949,13 @@
"ACCOUNT_REFERENCE" : "Sélectionner la référence des comptes",
"ACCOUNT_REFERENCE_TYPE" : "Sélectionner le type de référence des comptes",
"ACCOUNT": "Sélectionner un compte",
"ACCOUNT_OPTIONAL": "Sélectionner un compte (optionnel)",
"ACCOUNTS": "Sélectionner des comptes",
"ACCOUNT_TYPE": "Sélectionner un Type de Compte",
"BALANCE_SECTION": "Sélectionner la section du bilan",
"BED":"Sélectionner un lit",
"CASHBOX": "Sélectionner une caisse",
"CASHBOX_OPTIONAL": "Sélectionner une caisse (optionnel)",
"COST_CENTER": "Sélectionnez un centre de coûts",
"COUNTRY": "Sélectionner le pays",
"CREDITOR_GROUP": "Sélectionner un Groupe Créditeur",
Expand Down
1 change: 1 addition & 0 deletions client/src/i18n/fr/periods.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"START" : "Début",
"END" : "Fin",
"PERIOD_LIMIT" : "Limite de Période",
"PERIOD_LIMIT_OPTIONAL" : "Limite de Période (optinnelle)",
"CUSTOM_FROM" : "de",
"CUSTOM_TO" : "à",
"SELECT_PERIOD" : "Choisir une Période",
Expand Down
3 changes: 2 additions & 1 deletion client/src/js/components/bhCashboxSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ function CashboxSelectController(Cashbox, Notify, Session) {
$ctrl.name = $ctrl.name || 'CashboxForm';

// translated label for the form input
$ctrl.label = $ctrl.label || 'FORM.SELECT.CASHBOX';
$ctrl.label = $ctrl.label
|| $ctrl.required ? 'FORM.SELECT.CASHBOX' : 'FORM.SELECT.CASHBOX_OPTIONAL';

const restrictCashboxList = angular.isDefined($ctrl.restrictToUser)
? $ctrl.restrictToUser : true;
Expand Down
3 changes: 2 additions & 1 deletion client/src/js/components/bhDepotSelect/bhDepotSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ function DepotSelectController(Depots, Notify) {
const $ctrl = this;

$ctrl.$onInit = () => {
$ctrl.label = $ctrl.label || 'FORM.LABELS.DEPOT';
$ctrl.label = $ctrl.label
|| $ctrl.required ? 'FORM.LABELS.DEPOT' : 'FORM.LABELS.DEPOT_OPTIONAL';
if ($ctrl.depotUuid) {
if ($ctrl.depotUuid === '0') { return; }
loadDepotByUuid($ctrl.depotUuid);
Expand Down
1 change: 1 addition & 0 deletions client/src/js/components/bhFiscalYearSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ angular.module('bhima.components')
bindings : {
onSelectFiscalCallback : '&',
fiscalId : '<?',
required : '<?',
},
});

Expand Down
1 change: 1 addition & 0 deletions client/src/js/components/bhPeriodSelection.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ angular.module('bhima.components')
onSelectCallback : '&',
periodId : '<?',
disable : '<?',
required : '<?',
label : '@?',
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
name="account_id"
on-select-callback="ModalCtrl.onSelectAccount(account)"
exclude-title-accounts="true"
required="0">
required="false">
<bh-clear on-clear="ModalCtrl.clear('account_id')"></bh-clear>
</bh-account-select>

Expand Down
4 changes: 2 additions & 2 deletions client/src/modules/journal/modals/search.modal.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
name="account_id"
on-select-callback="ModalCtrl.onSelectAccount(account)"
exclude-title-accounts="true"
required="0">
required="false">
<bh-clear on-clear="ModalCtrl.clear('account_id')"></bh-clear>
</bh-account-select>
</div>
Expand Down Expand Up @@ -190,7 +190,7 @@
name="account_id"
on-select-callback="ModalCtrl.onSelectAccount(account)"
exclude-title-accounts="true"
required="0">
required="false">
</bh-account-select>
</div>

Expand Down
63 changes: 33 additions & 30 deletions client/src/modules/patients/visits/modals/visits.modal.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@

<!-- service -->
<div ng-if="AdmitCtrl.isAdmission">
<bh-service-select on-select-callback="AdmitCtrl.onServiceSelect(service)" required="true"></bh-service-select>
<bh-service-select
on-select-callback="AdmitCtrl.onServiceSelect(service)"
required="true">
</bh-service-select>
</div>

<div ng-if="!AdmitCtrl.isAdmission && AdmitCtrl.currentVisit.start_diagnosis_label" class="form-group">
Expand Down Expand Up @@ -63,23 +66,23 @@
</p>
<div class="radio">
<label>
<input
type="radio"
name="is_new_case"
id="yes"
ng-value="1"
<input
type="radio"
name="is_new_case"
id="yes"
ng-value="1"
ng-model="AdmitCtrl.visit.is_new_case"
ng-change="AdmitCtrl.onChangeCase()">
<span translate>PATIENT_RECORDS.VISITS.IS_NEW_CASE</span>
</label>
</div>
<div class="radio">
<label>
<input
type="radio"
name="is_new_case"
id="no"
ng-value="0"
<input
type="radio"
name="is_new_case"
id="no"
ng-value="0"
ng-model="AdmitCtrl.visit.is_new_case"
ng-change="AdmitCtrl.onChangeCase()">
<span translate>PATIENT_RECORDS.VISITS.IS_NOT_NEW_CASE</span>
Expand All @@ -92,10 +95,10 @@
<strong translate>PATIENT_RECORDS.VISITS.REFERED</strong>
</p>
<label>
<input
type="checkbox"
ng-true-value="1"
ng-false-value="0"
<input
type="checkbox"
ng-true-value="1"
ng-false-value="0"
ng-model="AdmitCtrl.visit.is_refered"> <span translate>PATIENT_RECORDS.VISITS.IS_REFERED</span>
</label>
</div>
Expand All @@ -107,10 +110,10 @@
<strong translate>PATIENT_RECORDS.VISITS.PREGNANT</strong>
</p>
<label>
<input
type="checkbox"
ng-true-value="1"
ng-false-value="0"
<input
type="checkbox"
ng-true-value="1"
ng-false-value="0"
ng-model="AdmitCtrl.visit.is_pregnant"> <span translate>PATIENT_RECORDS.VISITS.IS_PREGNANT</span>
</label>
</div>
Expand All @@ -122,23 +125,23 @@
</p>
<div class="radio">
<label>
<input
type="radio"
name="inside_health_zone"
id="yes"
ng-value="1"
<input
type="radio"
name="inside_health_zone"
id="yes"
ng-value="1"
ng-model="AdmitCtrl.visit.inside_health_zone"
ng-change="AdmitCtrl.onChangeHZ()" checked>
<span translate>PATIENT_RECORDS.VISITS.IS_IN_HEALTH_ZONE</span>
</label>
</div>
<div class="radio">
<label>
<input
type="radio"
name="inside_health_zone"
id="no"
ng-value="0"
<input
type="radio"
name="inside_health_zone"
id="no"
ng-value="0"
ng-model="AdmitCtrl.visit.inside_health_zone"
ng-change="AdmitCtrl.onChangeHZ()">
<span translate>PATIENT_RECORDS.VISITS.IS_NOT_IN_HEALTH_ZONE</span>
Expand Down Expand Up @@ -169,7 +172,7 @@
<div ng-messages-include="modules/templates/messages.tmpl.html"></div>
</div>
</div>

<!-- ward and bed -->
<div ng-if="AdmitCtrl.isAdmission && AdmitCtrl.visit.hospitalized">
<hr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,16 @@ <h3 class="text-capitalize" translate>REPORT.ACCOUNT_REFERENCE.TITLE</h3>

<bh-fiscal-year-select
fiscal-id="ReportConfigCtrl.reportDetails.fiscal_id"
on-select-fiscal-callback="ReportConfigCtrl.onSelectFiscalYear(fiscalYear)">
on-select-fiscal-callback="ReportConfigCtrl.onSelectFiscalYear(fiscalYear)"
required="true">
</bh-fiscal-year-select>

<bh-period-selection
fiscal-year-id="ReportConfigCtrl.reportDetails.fiscal_id"
period-id="ReportConfigCtrl.reportDetails.period_id"
on-select-callback="ReportConfigCtrl.onSelectPeriod(period)">
on-select-callback="ReportConfigCtrl.onSelectPeriod(period)"
disable="!ReportConfigCtrl.reportDetails.fiscal_id"
required="true">
</bh-period-selection>

<bh-account-reference-type-select
Expand Down
Loading

0 comments on commit 21a522f

Please sign in to comment.