From 2ba8074702237a23f3c3893a1f891b96f1db7854 Mon Sep 17 00:00:00 2001 From: Diana Pazheva Date: Thu, 26 Sep 2024 15:33:58 +0300 Subject: [PATCH] chore: inprove retreival of version and buildTimestamp --- app/vendor/ToolsAPI.js | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/app/vendor/ToolsAPI.js b/app/vendor/ToolsAPI.js index 425cc93..d9047ad 100644 --- a/app/vendor/ToolsAPI.js +++ b/app/vendor/ToolsAPI.js @@ -288,28 +288,14 @@ sap.ui.define(["sap/ui/core/Core", "sap/ui/core/Element", "sap/ui/core/ElementMe */ function _getVersion() { var Version = sap.ui.require('sap/base/util/Version'); - if (Version && Core.version) { - return Version(Core.version); + var VersionInfo = sap.ui.require('sap/ui/VersionInfo'); + var versionStr = VersionInfo?._content?.version; + if (Version && versionStr) { + return Version(versionStr); } return _getOptionalGlobalConfig().getVersion(); } - /** - * Returns the version string of the framework. - * @returns {string} - */ - function _getVersionString() { - return Core.version || _getVersion().toString(); - } - - /** - * Returns the build time of the framework. - * @returns {string} - */ - function _getBuildTime() { - return Core.buildinfo?.buildtime || sap.ui.getVersionInfo().buildTimestamp; - } - /** * Returns the registered element with the given ID, if any. * @param {sap.ui.core.ID|null|undefined} sId ID of the element to search for @@ -359,8 +345,8 @@ sap.ui.define(["sap/ui/core/Core", "sap/ui/core/Element", "sap/ui/core/ElementMe var frameworkInfo = { commonInformation: { frameworkName: _getFrameworkName(oVersionInfo.name), - version: _getVersion(), - buildTime: _getBuildTime(), + version: oVersionInfo.version, + buildTime: oVersionInfo.buildTimestamp, userAgent: navigator.userAgent, applicationHREF: window.location.href, documentTitle: document.title,