From 6d04f60a10a6ec213d150a5c03399b2cbf6cc23a Mon Sep 17 00:00:00 2001
From: Rahul Ramesh <121226043+rahu1ramesh@users.noreply.github.com>
Date: Mon, 24 Jun 2024 15:24:49 +0530
Subject: [PATCH] BAH-3968 | Add. Quick Logout Support In Admin, Bed, Doc, OT
And Reports
* [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
---
ui/app/admin/index.html | 4 +++-
ui/app/admin/initialization.js | 14 ++++++++---
ui/app/admin/views/header.html | 24 +++++++++++++++++++
ui/app/adt/views/headerAdt.html | 6 +++--
ui/app/bedmanagement/initialization.js | 4 +++-
ui/app/bedmanagement/views/header.html | 12 ++++++++++
ui/app/common/ui-helper/header.html | 5 +++-
ui/app/document-upload/app.js | 2 +-
ui/app/document-upload/initialization.js | 4 +++-
.../document-upload/views/patientHeader.html | 13 +++++++++-
ui/app/i18n/document-upload/locale_en.json | 3 ++-
ui/app/i18n/ipd/locale_en.json | 3 ++-
ui/app/i18n/reports/locale_en.json | 3 ++-
ui/app/ot/index.html | 5 ++--
ui/app/ot/initialization.js | 13 +++++++---
ui/app/ot/views/header.html | 12 ++++++++++
ui/app/reports/initialization.js | 10 +++++---
ui/app/reports/views/dashboardHeader.html | 10 ++++++++
18 files changed, 124 insertions(+), 23 deletions(-)
create mode 100644 ui/app/admin/views/header.html
diff --git a/ui/app/admin/index.html b/ui/app/admin/index.html
index af5d4cbfd4..a03e855217 100644
--- a/ui/app/admin/index.html
+++ b/ui/app/admin/index.html
@@ -14,7 +14,7 @@
-
@@ -71,6 +71,7 @@
+
@@ -86,6 +87,7 @@
+
diff --git a/ui/app/admin/initialization.js b/ui/app/admin/initialization.js
index 07948059ec..d44e689dc8 100644
--- a/ui/app/admin/initialization.js
+++ b/ui/app/admin/initialization.js
@@ -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');
};
@@ -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));
}
]);
diff --git a/ui/app/admin/views/header.html b/ui/app/admin/views/header.html
new file mode 100644
index 0000000000..04fb305243
--- /dev/null
+++ b/ui/app/admin/views/header.html
@@ -0,0 +1,24 @@
+
\ No newline at end of file
diff --git a/ui/app/adt/views/headerAdt.html b/ui/app/adt/views/headerAdt.html
index 7ea9240419..04fb305243 100644
--- a/ui/app/adt/views/headerAdt.html
+++ b/ui/app/adt/views/headerAdt.html
@@ -13,8 +13,10 @@
diff --git a/ui/app/bedmanagement/initialization.js b/ui/app/bedmanagement/initialization.js
index e7c5af40db..f886fcbe85 100644
--- a/ui/app/bedmanagement/initialization.js
+++ b/ui/app/bedmanagement/initialization.js
@@ -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;
diff --git a/ui/app/bedmanagement/views/header.html b/ui/app/bedmanagement/views/header.html
index 40460384d4..9159c15d05 100644
--- a/ui/app/bedmanagement/views/header.html
+++ b/ui/app/bedmanagement/views/header.html
@@ -2,6 +2,18 @@
\ No newline at end of file
diff --git a/ui/app/common/ui-helper/header.html b/ui/app/common/ui-helper/header.html
index 4400e16840..f381da0d37 100644
--- a/ui/app/common/ui-helper/header.html
+++ b/ui/app/common/ui-helper/header.html
@@ -15,7 +15,10 @@