Skip to content

Commit

Permalink
BAH-3968 | Add. Quick Logout Support In Admin, Bed, Doc, OT And Reports
Browse files Browse the repository at this point in the history
* [Rahul] | BAH-3968 | Add. Quick Logout In Bed Mngt

* [Rahul] | BAH-3968 | Add. Quick Logout In Doc Upload

* [Rahul] | BAH-3968 | Add. Quick Logout In Reports

* [Rahul] | BAH-3968 | Add. Quick Logout In OT

* [Rahul] | BAH-3968 | Add. Quick Logout In Admin
  • Loading branch information
rahu1ramesh authored Jun 24, 2024
1 parent 3635848 commit 6d04f60
Show file tree
Hide file tree
Showing 18 changed files with 124 additions and 23 deletions.
4 changes: 3 additions & 1 deletion ui/app/admin/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<!-- endbuild -->
</head>
<body ng-app="admin" class="admin-app">
<div ng-include src="'../common/ui-helper/header.html'"></div>
<div ng-include src="'views/header.html'"></div>
<div ng-include src="'../common/ui-helper/messages.html'"></div>
<div class="opd-wrapper">
<div ui-view id="view-content" class="opd-content-wrapper"></div>
Expand Down Expand Up @@ -71,6 +71,7 @@
<script src="../common/ui-helper/directives.js"></script>
<script src="../common/config/init.js"></script>
<script src="../common/config/directives/showIfPrivilege.js"></script>
<script src="../common/config/services/configurations.js"></script>
<script src="../common/ui-helper/services/backlinkService.js"></script>
<script src="../common/ui-helper/directives/backLinks.js"></script>
<script src="../common/ui-helper/directives/bahmniAutocomplete.js"></script>
Expand All @@ -86,6 +87,7 @@
<script src="../common/logging/exceptionHandler.js"></script>
<script src="../common/logging/services/loggingService.js"></script>
<script src="../common/logging/services/auditLogService.js"></script>
<script src="../common/models/auditLogEventDetails.js"></script>

<script src="../common/i18n/init.js"></script>
<script src="../common/i18n/bahmni-translate.js"></script>
Expand Down
14 changes: 11 additions & 3 deletions ui/app/admin/initialization.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
'use strict';

angular.module('bahmni.admin')
.factory('initialization', ['$rootScope', '$q', 'appService', 'spinner',
function ($rootScope, $q, appService, spinner) {
.factory('initialization', ['$rootScope', '$q', 'appService', 'spinner', 'configurations',
function ($rootScope, $q, appService, spinner, configurations) {
var loadConfigPromise = function () {
var configNames = ['quickLogoutComboKey', 'contextCookieExpirationTimeInMinutes'];
return configurations.load(configNames).then(function () {
$rootScope.quickLogoutComboKey = configurations.quickLogoutComboKey() || 'Escape';
$rootScope.cookieExpiryTime = configurations.contextCookieExpirationTimeInMinutes() || 30;
});
};

var initApp = function () {
return appService.initApp('admin');
};
Expand All @@ -11,6 +19,6 @@ angular.module('bahmni.admin')
return appService.checkPrivilege("app:admin");
};

return spinner.forPromise(initApp().then(checkPrivilege));
return spinner.forPromise(initApp().then(checkPrivilege).then(loadConfigPromise));
}
]);
24 changes: 24 additions & 0 deletions ui/app/admin/views/header.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<div class="opd-header-wrapper">
<div class="opd-header-top">
<header>
<bm-back-links></bm-back-links>
<a id="clinicalHomeBackLink" show-if-privilege="app:clinical" class="back-btn"
ng-if="showClinicalDashboardLink" ng-href="../clinical/#/default/patient/{{patient.uuid}}/dashboard"
title="Go to Clinical Dashboard">
<i class="fa fa-stethoscope fa-white"></i>
</a>
<button class="btn-user-info">
<i class="fa fa-user-md fa-white small"></i>
<i class="fa fa-caret-down fa-white mini"></i>
</button>
<ul>
<li>
<a log-out>
<i class="fa fa-power-off fa-white small"></i>
<span class="nav-link">{{::'LOGOUT_TRANSLATION_KEY' | translate}}</span>
</a>
</li>
</ul>
</header>
</div>
</div>
6 changes: 4 additions & 2 deletions ui/app/adt/views/headerAdt.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
</button>
<ul>
<li>
<a log-out><i class="fa fa-power-off fa-white small"></i><span
class="nav-link">{{::'LOGOUT_TRANSLATION_KEY' | translate}}</span></a>
<a log-out>
<i class="fa fa-power-off fa-white small"></i>
<span class="nav-link">{{::'LOGOUT_TRANSLATION_KEY' | translate}}</span>
</a>
</li>
</ul>
</header>
Expand Down
4 changes: 3 additions & 1 deletion ui/app/bedmanagement/initialization.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ angular.module('bahmni.ipd').factory('initialization', ['$rootScope', '$q', '$ba
function ($rootScope, $q, $bahmniCookieStore, appService, configurations, authenticator, spinner, locationService) {
var getConfigs = function () {
var config = $q.defer();
var configNames = ['encounterConfig', 'patientConfig', 'genderMap', 'relationshipTypeMap'];
var configNames = ['encounterConfig', 'patientConfig', 'genderMap', 'relationshipTypeMap', 'quickLogoutComboKey', 'contextCookieExpirationTimeInMinutes'];
configurations.load(configNames).then(function () {
$rootScope.encounterConfig = angular.extend(new EncounterConfig(), configurations.encounterConfig());
$rootScope.patientConfig = configurations.patientConfig();
$rootScope.genderMap = configurations.genderMap();
$rootScope.relationshipTypeMap = configurations.relationshipTypeMap();
$rootScope.diagnosisStatus = ((appService.getAppDescriptor().getConfig("diagnosisStatus") && appService.getAppDescriptor().getConfig("diagnosisStatus").value) || "RULED OUT");
$rootScope.quickLogoutComboKey = configurations.quickLogoutComboKey() || 'Escape';
$rootScope.cookieExpiryTime = configurations.contextCookieExpirationTimeInMinutes() || 30;
config.resolve();
});
return config.promise;
Expand Down
12 changes: 12 additions & 0 deletions ui/app/bedmanagement/views/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@
<div class="opd-header-top">
<header>
<back-links-cache-buster></back-links-cache-buster>
<button class="btn-user-info">
<i class="fa fa-user-md fa-white small"></i>
<i class="fa fa-caret-down fa-white mini"></i>
</button>
<ul>
<li>
<a log-out>
<i class="fa fa-power-off fa-white small"></i>
<span class="nav-link">{{::'LOGOUT_TRANSLATION_KEY' | translate}}</span>
</a>
</li>
</ul>
</header>
</div>
</div>
5 changes: 4 additions & 1 deletion ui/app/common/ui-helper/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@
</button>
<ul>
<li>
<a log-out><i class="fa fa-power-off fa-white small"></i><span class="nav-link">{{::'LOGOUT_TRANSLATION_KEY' | translate}}</span></a>
<a log-out>
<i class="fa fa-power-off fa-white small"></i>
<span class="nav-link">{{::'LOGOUT_TRANSLATION_KEY' | translate}}</span>
</a>
</li>
</ul>
</div>
Expand Down
2 changes: 1 addition & 1 deletion ui/app/document-upload/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ angular.module('documentupload').config(['$stateProvider', '$httpProvider', '$ur
controller: 'PatientsListController'
},
'additional-header': {
templateUrl: '../common/ui-helper/header.html'
templateUrl: 'views/patientHeader.html'
}
},
resolve: {
Expand Down
4 changes: 3 additions & 1 deletion ui/app/document-upload/initialization.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ angular.module('opd.documentupload').factory('initialization',
$rootScope.appConfig = url.param();

var getConfigs = function () {
var configNames = ['genderMap'];
var configNames = ['genderMap', 'quickLogoutComboKey', 'contextCookieExpirationTimeInMinutes'];
return configurations.load(configNames).then(function () {
$rootScope.genderMap = configurations.genderMap();
$rootScope.quickLogoutComboKey = configurations.quickLogoutComboKey() || 'Escape';
$rootScope.cookieExpiryTime = configurations.contextCookieExpirationTimeInMinutes() || 30;
});
};

Expand Down
13 changes: 12 additions & 1 deletion ui/app/document-upload/views/patientHeader.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,18 @@
<div class="opd-header-top">
<header>
<bm-back-links></bm-back-links>
<!-- <a class="header-logo" href="../home/"><img src="../images/jss_logo.png" alt="Bahmni" title="Bahmni"></a> -->
<button class="btn-user-info">
<i class="fa fa-user-md fa-white small"></i>
<i class="fa fa-caret-down fa-white mini"></i>
</button>
<ul>
<li>
<a log-out>
<i class="fa fa-power-off fa-white small"></i>
<span class="nav-link">{{::'LOGOUT_TRANSLATION_KEY' | translate}}</span>
</a>
</li>
</ul>
</header>
</div>
</div>
3 changes: 2 additions & 1 deletion ui/app/i18n/document-upload/locale_en.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,6 @@
"VISIT_TO_LABEL": "To:",
"FILE_TYPE_NOT_SUPPORTED_MESSAGE": "File type is not supported",
"FILE_SIZE_LIMIT_EXCEEDED_MESSAGE": "File size limit exceeded. Please upload a file less than {{maxAllowedSize}} MB.",
"SIZE_LIMIT_EXCEEDED_MESSAGE": "File size limit exceeded. Please upload a smaller file"
"SIZE_LIMIT_EXCEEDED_MESSAGE": "File size limit exceeded. Please upload a smaller file",
"LOGOUT_TRANSLATION_KEY": "Logout"
}
3 changes: 2 additions & 1 deletion ui/app/i18n/ipd/locale_en.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,6 @@
"IS_SUCCESSFULLY_ASSIGNED_MESSAGE": "is assigned successfully",
"BED": "Bed",
"CARE_VIEW_LABEL": "Change to Care View",
"MESSAGE_AUTO_CONVERT_TO_IPD_VISIT": "{{visitType}} Visit Started Successfully"
"MESSAGE_AUTO_CONVERT_TO_IPD_VISIT": "{{visitType}} Visit Started Successfully",
"LOGOUT_TRANSLATION_KEY": "Logout"
}
3 changes: 2 additions & 1 deletion ui/app/i18n/reports/locale_en.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,6 @@
"DELETE_LABEL": "Delete",
"EDIT_LABEL": "Edit",
"REPORT_DATE_RANGE": "Select Date Range",
"START_DATE_CANNOT_LATER_THAN_STOP_DATE": "start date can not be later than stop date"
"START_DATE_CANNOT_LATER_THAN_STOP_DATE": "start date can not be later than stop date",
"LOGOUT_TRANSLATION_KEY": "Logout"
}
5 changes: 2 additions & 3 deletions ui/app/ot/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
<script src="../common/models/visitSummary.js"></script>

<script src="../common/patient/init.js"></script>

<script src="../common/models/auditLogEventDetails.js"></script>
<script src="../common/patient/mappers/patientMapper.js"></script>
<script src="../common/patient/services/patientService.js"></script>
<script src="../common/config/directives/showIfPrivilege.js"></script>
Expand Down Expand Up @@ -154,8 +154,6 @@
<script src="../common/concept-set/models/tabularObservations.js"></script>
<script src="../common/concept-set/models/multiSelectObservations.js"></script>
<script src="../common/concept-set/models/customRepresentationBuilder.js"></script>
<script src="../clinical/consultation/services/observationFormService.js"></script>


<script src="../common/patient-search/init.js"></script>
<script src="../common/patient-search/constants.js"></script>
Expand Down Expand Up @@ -191,6 +189,7 @@
<script src="../common/logging/init.js"></script>
<script src="../common/logging/exceptionHandler.js"></script>
<script src="../common/logging/services/loggingService.js"></script>
<script src="../common/logging/services/auditLogService.js"></script>

<script src="../common/obs/init.js"></script>
<script src="../common/obs/models/observation.js"></script>
Expand Down
13 changes: 10 additions & 3 deletions ui/app/ot/initialization.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
'use strict';

angular.module('bahmni.ot').factory('initialization', ['$rootScope', '$q', 'surgicalAppointmentHelper', 'appService', 'surgicalAppointmentService', 'authenticator', 'spinner',
function ($rootScope, $q, surgicalAppointmentHelper, appService, surgicalAppointmentService, authenticator, spinner) {
angular.module('bahmni.ot').factory('initialization', ['$rootScope', '$q', 'surgicalAppointmentHelper', 'appService', 'surgicalAppointmentService', 'authenticator', 'spinner', 'configurations',
function ($rootScope, $q, surgicalAppointmentHelper, appService, surgicalAppointmentService, authenticator, spinner, configurations) {
var loadConfigPromise = function () {
var configNames = ['quickLogoutComboKey', 'contextCookieExpirationTimeInMinutes'];
return configurations.load(configNames).then(function () {
$rootScope.quickLogoutComboKey = configurations.quickLogoutComboKey() || 'Escape';
$rootScope.cookieExpiryTime = configurations.contextCookieExpirationTimeInMinutes() || 30;
});
};
var initApp = function () {
return appService.initApp('ot', {'app': true, 'extension': true}).then(function (data) {
var providerNames = data.getConfigValue("primarySurgeonsForOT");
Expand All @@ -13,6 +20,6 @@ angular.module('bahmni.ot').factory('initialization', ['$rootScope', '$q', 'surg
});
});
};
return spinner.forPromise(authenticator.authenticateUser().then(initApp));
return spinner.forPromise(authenticator.authenticateUser().then(initApp).then(loadConfigPromise));
}
]);
12 changes: 12 additions & 0 deletions ui/app/ot/views/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@
<div class="opd-header-top">
<header>
<back-links-cache-buster></back-links-cache-buster>
<button class="btn-user-info">
<i class="fa fa-user-md fa-white small"></i>
<i class="fa fa-caret-down fa-white mini"></i>
</button>
<ul>
<li>
<a log-out>
<i class="fa fa-power-off fa-white small"></i>
<span class="nav-link">{{::'LOGOUT_TRANSLATION_KEY' | translate}}</span>
</a>
</li>
</ul>
</header>
</div>
</div>
10 changes: 7 additions & 3 deletions ui/app/reports/initialization.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
'use strict';

angular.module('bahmni.reports').factory('initialization',
['authenticator', 'appService', 'spinner', 'configurations',
function (authenticator, appService, spinner, configurations) {
['$rootScope', 'authenticator', 'appService', 'spinner', 'configurations',
function ($rootScope, authenticator, appService, spinner, configurations) {
return function (appName) {
var loadConfigPromise = function () {
return configurations.load([]);
var configNames = ['quickLogoutComboKey', 'contextCookieExpirationTimeInMinutes'];
return configurations.load(configNames).then(function () {
$rootScope.quickLogoutComboKey = configurations.quickLogoutComboKey() || 'Escape';
$rootScope.cookieExpiryTime = configurations.contextCookieExpirationTimeInMinutes() || 30;
});
};
var initApp = function () {
return appService.initApp(appName || 'reports', {'app': true, 'extension': true }, null, ["reports"]);
Expand Down
10 changes: 10 additions & 0 deletions ui/app/reports/views/dashboardHeader.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@
<div class="opd-header-top">
<header>
<bm-back-links></bm-back-links>
<button class="btn-user-info">
<i class="fa fa-user-md fa-white small"></i>
<i class="fa fa-caret-down fa-white mini"></i>
</button>
<ul>
<li>
<a log-out><i class="fa fa-power-off fa-white small"></i><span
class="nav-link">{{::'LOGOUT_TRANSLATION_KEY' | translate}}</span></a>
</li>
</ul>
</header>
</div>
</div>

0 comments on commit 6d04f60

Please sign in to comment.