diff --git a/client/src/js/directives/findpatient.js b/client/src/js/directives/findpatient.js index e17c89d06e..7b174ac6b6 100644 --- a/client/src/js/directives/findpatient.js +++ b/client/src/js/directives/findpatient.js @@ -2,9 +2,10 @@ angular.module('bhima.directives') .component('bhFindPatient', { controller: FindPatientComponent, templateUrl : 'partials/templates/findpatient.tmpl.html', - bindings : { - onSearchComplete : '&', - type : '@' + bindings: { + onSearchComplete: '&', // bind callback + type: '@', // bind string + required: '<', // bind the required } }); diff --git a/client/src/partials/templates/findpatient.tmpl.html b/client/src/partials/templates/findpatient.tmpl.html index 9ab299117c..d8eae25c55 100644 --- a/client/src/partials/templates/findpatient.tmpl.html +++ b/client/src/partials/templates/findpatient.tmpl.html @@ -14,7 +14,7 @@
-
+
@@ -36,8 +36,11 @@ name="idInput" type="text" class="form-control" - placeholder="{{ $ctrl.selected.placeholder | translate }}..." - required> + placeholder="{{ $ctrl.selected.placeholder | translate }}...", + autocomplete="off" + autocorrect="off" + autocapitalize="off" + ng-required="$ctrl.required"> + autocomplete="off" + autocorrect="off" + autocapitalize="off" + ng-required="$ctrl.required"> @@ -126,21 +132,24 @@
- {{ "FIND.TITLE" | translate }} + {{ "FIND.TITLE" | translate }}
- {{ "FIND.PATIENT_NOT_FOUND" | translate }} - {{ "FIND.PATIENT_LOADING" | translate }} + + {{ "FIND.PATIENT_NOT_FOUND" | translate }} + + + {{ "FIND.PATIENT_LOADING" | translate }} +
-
-
@@ -151,7 +160,7 @@
-
    @@ -170,10 +179,13 @@ name="idInput" type="text" class="form-control" + autocomplete="off" + autocorrect="off" + autocapitalize="off" placeholder="{{ $ctrl.selected.placeholder | translate }}" - required> + ng-required="$ctrl.required"> - + + autocomplete="off" + autocorrect="off" + autocapitalize="off" + ng-required="$ctrl.required">
-
- {{ 'FIND.PATIENT_NOT_FOUND' | translate }} + {{ 'FIND.PATIENT_NOT_FOUND' | translate }}
@@ -223,10 +237,7 @@
-
-
-
diff --git a/client/test/e2e/shared/components.js b/client/test/e2e/shared/components.js index d6807ac3b3..cd5b17f6c7 100644 --- a/client/test/e2e/shared/components.js +++ b/client/test/e2e/shared/components.js @@ -149,3 +149,26 @@ exports.currencyInput = { return elm.getAttribute('ng-invalid'); } }; + +/** + * hooks for the find patient component described in the component + * bhFindPatient.js. + * @public + */ +exports.findPatient = { + selector : '[data-bh-find-patient]', + + /** + * searches for a patient by name + */ + findByName: function findByName(name) { + // TODO + }, + + /** + * searches for a patient by id + */ + findById : function findById(id) { + // TODO + } +};