Skip to content

Commit

Permalink
chore: inprove retreival of version and buildTimestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
kineticjs committed Sep 26, 2024
1 parent 2394caf commit 2ba8074
Showing 1 changed file with 6 additions and 20 deletions.
26 changes: 6 additions & 20 deletions app/vendor/ToolsAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 2ba8074

Please sign in to comment.