Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Buvana, Bindu | BAH-988 | Fix visit type is not showing up in visit dashboard UAT bug #379

Merged
merged 1 commit into from
Sep 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use strict';

angular.module('bahmni.clinical')
.directive('visitsTable', ['patientVisitHistoryService', 'conceptSetService', 'spinner', '$state', '$q',
function (patientVisitHistoryService, conceptSetService, spinner, $state, $q) {
.directive('visitsTable', ['patientVisitHistoryService', 'conceptSetService', 'spinner', '$state', '$q', '$translate',
function (patientVisitHistoryService, conceptSetService, spinner, $state, $q, $translate) {
var controller = function ($scope) {
var emitNoDataPresentEvent = function () {
$scope.$emit("no-data-present-event");
Expand All @@ -17,9 +17,10 @@ angular.module('bahmni.clinical')
$scope.hasVisits = function () {
return $scope.visits && $scope.visits.length > 0;
};
var translateVisitTypes = function (key) {
var translatedName = Bahmni.Common.Util.TranslationUtil.translateAttribute(key, Bahmni.Common.Constants.visit, $translate);
attribute.description = translatedName;
$scope.translateVisitTypes = function (attribute) {
var translatedName = Bahmni.Common.Util.TranslationUtil.translateAttribute(attribute, Bahmni.Common.Constants.visit, $translate);
attribute = translatedName;
return attribute;
};
$scope.params = angular.extend(
{
Expand Down
3 changes: 2 additions & 1 deletion ui/app/common/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,8 @@ Bahmni.Common = Bahmni.Common || {};
visitType: "VISIT_TYPE",
bedmanagement: "BEDMANAGEMENT",
bedmanagementDisposition: "BEDMANAGEMENT_DISPOSITION",
loginConfig: "/bahmni_config/openmrs/apps/home/login_config.json"
loginConfig: "/bahmni_config/openmrs/apps/home/login_config.json",
visit: "VISIT"
};
})();

6 changes: 4 additions & 2 deletions ui/test/unit/clinical/displaycontrols/visitsTable.spec.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
'use strict';

describe("Visits Table display control", function () {
var element, scope, $compile, mockBackend, conceptSetService, visitFormService,patientVisitHistoryService;
var element, scope, $compile, mockBackend, conceptSetService, visitFormService,patientVisitHistoryService, $translate;

beforeEach(module('ngHtml2JsPreprocessor'));
beforeEach(module('bahmni.clinical'));
beforeEach(module(function($provide) {
conceptSetService = jasmine.createSpyObj('conceptSetService', ['getConcept']);
visitFormService = jasmine.createSpyObj('visitFormService', ['formData']);
$translate = jasmine.createSpyObj('$translate', ['instant']);
patientVisitHistoryService= jasmine.createSpyObj('patientVisitHistoryService', ['getVisitHistory']);
$provide.value('$state', {});
$provide.value('$bahmniCookieStore', {});
Expand All @@ -16,6 +17,7 @@ describe("Visits Table display control", function () {
$provide.value('conceptSetService', conceptSetService);
$provide.value('visitFormService', visitFormService);
$provide.value('patientVisitHistoryService', patientVisitHistoryService);
$provide.value('$translate', $translate);
}));

beforeEach(inject(function (_$compile_, $rootScope, $httpBackend) {
Expand Down Expand Up @@ -89,4 +91,4 @@ describe("Visits Table display control", function () {
}
]}};

});
});