Skip to content

Commit

Permalink
BAH-2962 | sms sending part removed from frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
atishbeehyv123 committed Oct 12, 2023
1 parent 0dffef9 commit 92d4965
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 38 deletions.
4 changes: 0 additions & 4 deletions ui/app/common/config/services/configurations.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,6 @@ angular.module('bahmni.common.config')
return this.configs.defaultEncounterType;
};

this.registrationSMSToggle = function () {
return this.configs.registrationSMSToggle;
};

this.helpDeskNumber = function () {
return this.configs.helpDeskNumber;
};
Expand Down
12 changes: 0 additions & 12 deletions ui/app/common/domain/services/configurationService.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,18 +171,6 @@ angular.module('bahmni.common.domain')
});
};

configurationFunctions.registrationSMSToggle = function () {
return $http.get(Bahmni.Common.Constants.globalPropertyUrl, {
params: {
property: 'sms.enableRegistrationSMSAlert'
},
withCredentials: true,
transformResponse: [function (data) {
return data;
}]
});
};

configurationFunctions.helpDeskNumber = function () {
return $http.get(Bahmni.Common.Constants.globalPropertyUrl, {
params: {
Expand Down
1 change: 0 additions & 1 deletion ui/app/registration/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@

<script src="../common/displaycontrols/observation/init.js"></script>
<script src="../common/services/formService.js"></script>
<script src="../common/services/smsService.js"></script>
<script src="../common/displaycontrols/observation/helpers/groupingFunctions.js"></script>
<script src="../common/displaycontrols/observation/services/formHierarchyBuildService.js"></script>
<script src="../common/displaycontrols/observation/services/formRecordTreeBuildService.js"></script>
Expand Down
7 changes: 2 additions & 5 deletions ui/app/registration/initialization.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ angular.module('bahmni.registration').factory('initialization',
['$rootScope', '$q', 'configurations', 'authenticator', 'appService', 'spinner', 'preferences', 'locationService', 'mergeService', '$translate',
function ($rootScope, $q, configurations, authenticator, appService, spinner, preferences, locationService, mergeService, $translate) {
var getConfigs = function () {
var configNames = ['encounterConfig', 'patientAttributesConfig', 'identifierTypesConfig', 'addressLevels', 'genderMap', 'relationshipTypeConfig', 'relationshipTypeMap', 'loginLocationToVisitTypeMapping', 'registrationSMSToggle', 'helpDeskNumber'];
var configNames = ['encounterConfig', 'patientAttributesConfig', 'identifierTypesConfig', 'addressLevels', 'genderMap', 'relationshipTypeConfig', 'relationshipTypeMap', 'loginLocationToVisitTypeMapping', 'helpDeskNumber'];
return configurations.load(configNames).then(function () {
var mandatoryPersonAttributes = appService.getAppDescriptor().getConfigValue("mandatoryPersonAttributes");
var patientAttributeTypes = new Bahmni.Common.Domain.AttributeTypeMapper().mapFromOpenmrsAttributeTypes(configurations.patientAttributesConfig(), mandatoryPersonAttributes, {}, $rootScope.currentUser.userProperties.defaultLocale);
Expand All @@ -17,10 +17,7 @@ angular.module('bahmni.registration').factory('initialization',
$rootScope.addressLevels = configurations.addressLevels();
$rootScope.fieldValidation = appService.getAppDescriptor().getConfigValue("fieldValidation");
$rootScope.genderMap = configurations.genderMap();
$rootScope.registrationSMSToggle = configurations.registrationSMSToggle();
if ($rootScope.registrationSMSToggle) {
$rootScope.helpDeskNumber = configurations.helpDeskNumber();
}
$rootScope.helpDeskNumber = configurations.helpDeskNumber();
Bahmni.Common.Util.GenderUtil.translateGender($rootScope.genderMap, $translate);
$rootScope.relationshipTypeMap = configurations.relationshipTypeMap();
$rootScope.relationshipTypes = configurations.relationshipTypes();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

describe('CreatePatientController', function() {
var $aController, q, scopeMock, rootScopeMock, stateMock, patientServiceMock, preferencesMock, spinnerMock,
appServiceMock, ngDialogMock, ngDialogLocalScopeMock, httpBackend, http, sections, identifiersMock, messagingService, smsServiceMock;
appServiceMock, ngDialogMock, ngDialogLocalScopeMock, httpBackend, http, sections, identifiersMock, messagingService;

beforeEach(module('bahmni.registration'));
beforeEach(module('bahmni.common.models'));
Expand Down Expand Up @@ -44,7 +44,6 @@ describe('CreatePatientController', function() {
spinnerMock = jasmine.createSpyObj('spinnerMock', ['forPromise']);
appServiceMock = jasmine.createSpyObj('appServiceMock', ['getAppDescriptor']);
messagingService = jasmine.createSpyObj('messagingService', ['showMessage']);
smsServiceMock = jasmine.createSpyObj('smsService', ['smsAlert']);

ngDialogMock = jasmine.createSpyObj('ngDialogMock', ['open', 'close']);
ngDialogLocalScopeMock = scopeMock;
Expand Down Expand Up @@ -138,8 +137,7 @@ describe('CreatePatientController', function() {
spinner: spinnerMock,
appService: appServiceMock,
ngDialog: ngDialogMock,
messagingService: messagingService,
smsService: smsServiceMock
messagingService: messagingService
});

scopeMock.actions = {
Expand Down Expand Up @@ -167,8 +165,7 @@ describe('CreatePatientController', function() {
preferences: preferencesMock,
spinner: spinnerMock,
appService: appServiceMock,
ngDialog: ngDialogMock,
smsService: smsServiceMock
ngDialog: ngDialogMock
});

expect(scopeMock.patient["education"].conceptUuid).toBe("c2107f30-3f10-11e4-adec-0800271c1b75");
Expand All @@ -186,8 +183,7 @@ describe('CreatePatientController', function() {
preferences: preferencesMock,
spinner: spinnerMock,
appService: appServiceMock,
ngDialog: ngDialogMock,
smsService: smsServiceMock
ngDialog: ngDialogMock
});

expect(scopeMock.patient["date"].toLocaleDateString()).toBe(new Date().toLocaleDateString());
Expand Down Expand Up @@ -217,8 +213,7 @@ describe('CreatePatientController', function() {
preferences: preferencesMock,
spinner: spinnerMock,
appService: appServiceMock,
ngDialog: ngDialogMock,
smsService: smsServiceMock
ngDialog: ngDialogMock
});

expect(sections["additionalPatientInformation"].expand).toBeTruthy();
Expand All @@ -234,8 +229,7 @@ describe('CreatePatientController', function() {
preferences: preferencesMock,
spinner: spinnerMock,
appService: appServiceMock,
ngDialog: ngDialogMock,
smsService: smsServiceMock
ngDialog: ngDialogMock
});

expect(sections["additionalPatientInformation"].expand).toBeTruthy();
Expand All @@ -262,8 +256,7 @@ describe('CreatePatientController', function() {
preferences: preferencesMock,
spinner: spinnerMock,
appService: appServiceMock,
ngDialog: ngDialogMock,
smsService: smsServiceMock
ngDialog: ngDialogMock
});

expect(scopeMock.patient["education"]).toBeUndefined();
Expand Down Expand Up @@ -514,8 +507,7 @@ describe('CreatePatientController', function() {
preferences: preferencesMock,
spinner: spinnerMock,
appService: appServiceMock,
ngDialog: ngDialogMock,
smsService: smsServiceMock
ngDialog: ngDialogMock
});
expect(scopeMock.disablePhotoCapture).toBeTruthy();
});
Expand Down

0 comments on commit 92d4965

Please sign in to comment.