diff --git a/packages/fiori-elements-writer/test/__snapshots__/alp.test.ts.snap b/packages/fiori-elements-writer/test/__snapshots__/alp.test.ts.snap index b8bee8994c..73fd77efd6 100644 --- a/packages/fiori-elements-writer/test/__snapshots__/alp.test.ts.snap +++ b/packages/fiori-elements-writer/test/__snapshots__/alp.test.ts.snap @@ -5780,32 +5780,35 @@ if (parseInt(version[0], 10) <= 1 && parseInt(version[1], 10) < 78) { return libOrCompKeysStringTmp; } return new Promise(function (resolve, reject) { - $.ajax(url) - .done(function (manifest) { - if (manifest) { - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].dependencies - ) { - if (manifest[\\"sap.ui5\\"].dependencies.libs) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + localJQuery.ajax(url) + .done(function (manifest) { + if (manifest) { + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].dependencies + ) { + if (manifest[\\"sap.ui5\\"].dependencies.libs) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + } + if (manifest[\\"sap.ui5\\"].dependencies.components) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + } } - if (manifest[\\"sap.ui5\\"].dependencies.components) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].componentUsages + ) { + result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); } } - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].componentUsages - ) { - result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); - } - } - resolve(result); - }) - .fail(function () { - reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); - }); + resolve(result); + }) + .fail(function () { + reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); + }); + }); }); }; function registerModules(dataFromAppIndex) { @@ -5848,18 +5851,19 @@ if (parseInt(version[0], 10) <= 1 && parseInt(version[1], 10) < 78) { return new Promise( function (resolve) { - sap.ui.require([\\"sap/base/util/UriParameters\\"], function (UriParameters) { - sapClient = UriParameters.fromQuery(window.location.search).get(\\"sap-client\\"); - if (sapClient && sapClient.length === 3) { - url = url + \\"&sap-client=\\" + sapClient; - } - resolve(url); - }); + sapClient = new URLSearchParams(window.location.search).get(\\"sap-client\\"); + if (sapClient && sapClient.length === 3) { + url = url + \\"&sap-client=\\" + sapClient; + } + resolve(url); }).then(function (url2) { - return $.ajax(url2).done(function (data) { - if (data) { - registerModules(data); - } + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + return localJQuery.ajax(url2) + .done(function (data) { + if (data) { + registerModules(data); + } + }); }); }); } else { @@ -5897,6 +5901,10 @@ var manifestUri = currentScript.getAttribute(\\"data-sap-ui-manifest-uri\\"); var componentName = currentScript.getAttribute(\\"data-sap-ui-componentName\\"); var useMockserver = currentScript.getAttribute(\\"data-sap-ui-use-mockserver\\"); +// Patch (KW): resourceRoot is needed to load the correct ResourceBundles +var resourceRoot = manifestUri.substring(0, manifestUri.lastIndexOf('/')+1); + + sap.registerComponentDependencyPaths(manifestUri) .catch(function (error) { sap.ui.require([\\"sap/base/Log\\"], function (Log) { @@ -5906,57 +5914,75 @@ sap.registerComponentDependencyPaths(manifestUri) .finally(function () { // setting the app title with internationalization - sap.ui.getCore().attachInit(function () { - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); - if (componentName && componentName.length > 0) { + if (componentName && componentName.length > 0) { if (useMockserver && useMockserver === \\"true\\") { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { - // set up test service for local testing - server.init(); - // initialize the ushell sandbox component - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - }); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { + // set up test service for local testing + server.init(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + }); + }); + }); }); } else { // Requiring the ComponentSupport module automatically executes the component initialisation for all declaratively defined components sap.ui.require([\\"sap/ui/core/ComponentSupport\\"]); // setting the app title with the i18n text - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); } } else { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - try { - // initialize the ushell sandbox component in ui5 v2 - sap.ushell.Container.createRenderer(true).then(function (component) { - component.placeAt(\\"content\\"); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + try { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + } catch (error) { + // support older versions of ui5 + Container.createRenderer().placeAt(\\"content\\"); + } }); - } catch { - // support older versions of ui5 - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - } + }); }); } });", @@ -11769,32 +11795,35 @@ appDescription=A Fiori application.", return libOrCompKeysStringTmp; } return new Promise(function (resolve, reject) { - $.ajax(url) - .done(function (manifest) { - if (manifest) { - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].dependencies - ) { - if (manifest[\\"sap.ui5\\"].dependencies.libs) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + localJQuery.ajax(url) + .done(function (manifest) { + if (manifest) { + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].dependencies + ) { + if (manifest[\\"sap.ui5\\"].dependencies.libs) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + } + if (manifest[\\"sap.ui5\\"].dependencies.components) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + } } - if (manifest[\\"sap.ui5\\"].dependencies.components) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].componentUsages + ) { + result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); } } - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].componentUsages - ) { - result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); - } - } - resolve(result); - }) - .fail(function () { - reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); - }); + resolve(result); + }) + .fail(function () { + reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); + }); + }); }); }; function registerModules(dataFromAppIndex) { @@ -11837,18 +11866,19 @@ appDescription=A Fiori application.", return new Promise( function (resolve) { - sap.ui.require([\\"sap/base/util/UriParameters\\"], function (UriParameters) { - sapClient = UriParameters.fromQuery(window.location.search).get(\\"sap-client\\"); - if (sapClient && sapClient.length === 3) { - url = url + \\"&sap-client=\\" + sapClient; - } - resolve(url); - }); + sapClient = new URLSearchParams(window.location.search).get(\\"sap-client\\"); + if (sapClient && sapClient.length === 3) { + url = url + \\"&sap-client=\\" + sapClient; + } + resolve(url); }).then(function (url2) { - return $.ajax(url2).done(function (data) { - if (data) { - registerModules(data); - } + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + return localJQuery.ajax(url2) + .done(function (data) { + if (data) { + registerModules(data); + } + }); }); }); } else { @@ -11886,6 +11916,10 @@ var manifestUri = currentScript.getAttribute(\\"data-sap-ui-manifest-uri\\"); var componentName = currentScript.getAttribute(\\"data-sap-ui-componentName\\"); var useMockserver = currentScript.getAttribute(\\"data-sap-ui-use-mockserver\\"); +// Patch (KW): resourceRoot is needed to load the correct ResourceBundles +var resourceRoot = manifestUri.substring(0, manifestUri.lastIndexOf('/')+1); + + sap.registerComponentDependencyPaths(manifestUri) .catch(function (error) { sap.ui.require([\\"sap/base/Log\\"], function (Log) { @@ -11895,57 +11929,75 @@ sap.registerComponentDependencyPaths(manifestUri) .finally(function () { // setting the app title with internationalization - sap.ui.getCore().attachInit(function () { - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); - if (componentName && componentName.length > 0) { + if (componentName && componentName.length > 0) { if (useMockserver && useMockserver === \\"true\\") { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { - // set up test service for local testing - server.init(); - // initialize the ushell sandbox component - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - }); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { + // set up test service for local testing + server.init(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + }); + }); + }); }); } else { // Requiring the ComponentSupport module automatically executes the component initialisation for all declaratively defined components sap.ui.require([\\"sap/ui/core/ComponentSupport\\"]); // setting the app title with the i18n text - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); } } else { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - try { - // initialize the ushell sandbox component in ui5 v2 - sap.ushell.Container.createRenderer(true).then(function (component) { - component.placeAt(\\"content\\"); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + try { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + } catch (error) { + // support older versions of ui5 + Container.createRenderer().placeAt(\\"content\\"); + } }); - } catch { - // support older versions of ui5 - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - } + }); }); } });", diff --git a/packages/fiori-elements-writer/test/__snapshots__/feop.test.ts.snap b/packages/fiori-elements-writer/test/__snapshots__/feop.test.ts.snap index d0b93b3ec7..df7871d378 100644 --- a/packages/fiori-elements-writer/test/__snapshots__/feop.test.ts.snap +++ b/packages/fiori-elements-writer/test/__snapshots__/feop.test.ts.snap @@ -3469,32 +3469,35 @@ EntityType=\\"com.sap.gateway.srvd.dmo.sd_travel_mduu.v0001.TravelAgencyType\\"> return libOrCompKeysStringTmp; } return new Promise(function (resolve, reject) { - $.ajax(url) - .done(function (manifest) { - if (manifest) { - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].dependencies - ) { - if (manifest[\\"sap.ui5\\"].dependencies.libs) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + localJQuery.ajax(url) + .done(function (manifest) { + if (manifest) { + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].dependencies + ) { + if (manifest[\\"sap.ui5\\"].dependencies.libs) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + } + if (manifest[\\"sap.ui5\\"].dependencies.components) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + } } - if (manifest[\\"sap.ui5\\"].dependencies.components) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].componentUsages + ) { + result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); } } - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].componentUsages - ) { - result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); - } - } - resolve(result); - }) - .fail(function () { - reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); - }); + resolve(result); + }) + .fail(function () { + reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); + }); + }); }); }; function registerModules(dataFromAppIndex) { @@ -3537,18 +3540,19 @@ EntityType=\\"com.sap.gateway.srvd.dmo.sd_travel_mduu.v0001.TravelAgencyType\\"> return new Promise( function (resolve) { - sap.ui.require([\\"sap/base/util/UriParameters\\"], function (UriParameters) { - sapClient = UriParameters.fromQuery(window.location.search).get(\\"sap-client\\"); - if (sapClient && sapClient.length === 3) { - url = url + \\"&sap-client=\\" + sapClient; - } - resolve(url); - }); + sapClient = new URLSearchParams(window.location.search).get(\\"sap-client\\"); + if (sapClient && sapClient.length === 3) { + url = url + \\"&sap-client=\\" + sapClient; + } + resolve(url); }).then(function (url2) { - return $.ajax(url2).done(function (data) { - if (data) { - registerModules(data); - } + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + return localJQuery.ajax(url2) + .done(function (data) { + if (data) { + registerModules(data); + } + }); }); }); } else { @@ -3586,6 +3590,10 @@ var manifestUri = currentScript.getAttribute(\\"data-sap-ui-manifest-uri\\"); var componentName = currentScript.getAttribute(\\"data-sap-ui-componentName\\"); var useMockserver = currentScript.getAttribute(\\"data-sap-ui-use-mockserver\\"); +// Patch (KW): resourceRoot is needed to load the correct ResourceBundles +var resourceRoot = manifestUri.substring(0, manifestUri.lastIndexOf('/')+1); + + sap.registerComponentDependencyPaths(manifestUri) .catch(function (error) { sap.ui.require([\\"sap/base/Log\\"], function (Log) { @@ -3595,57 +3603,75 @@ sap.registerComponentDependencyPaths(manifestUri) .finally(function () { // setting the app title with internationalization - sap.ui.getCore().attachInit(function () { - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); - if (componentName && componentName.length > 0) { + if (componentName && componentName.length > 0) { if (useMockserver && useMockserver === \\"true\\") { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { - // set up test service for local testing - server.init(); - // initialize the ushell sandbox component - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - }); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { + // set up test service for local testing + server.init(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + }); + }); + }); }); } else { // Requiring the ComponentSupport module automatically executes the component initialisation for all declaratively defined components sap.ui.require([\\"sap/ui/core/ComponentSupport\\"]); // setting the app title with the i18n text - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); } } else { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - try { - // initialize the ushell sandbox component in ui5 v2 - sap.ushell.Container.createRenderer(true).then(function (component) { - component.placeAt(\\"content\\"); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + try { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + } catch (error) { + // support older versions of ui5 + Container.createRenderer().placeAt(\\"content\\"); + } }); - } catch { - // support older versions of ui5 - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - } + }); }); } });", diff --git a/packages/fiori-elements-writer/test/__snapshots__/fpm.test.ts.snap b/packages/fiori-elements-writer/test/__snapshots__/fpm.test.ts.snap index bd85370b0d..4ddb7bef6e 100644 --- a/packages/fiori-elements-writer/test/__snapshots__/fpm.test.ts.snap +++ b/packages/fiori-elements-writer/test/__snapshots__/fpm.test.ts.snap @@ -3487,32 +3487,35 @@ EntityType=\\"com.sap.gateway.srvd.dmo.sd_travel_mduu.v0001.TravelAgencyType\\"> return libOrCompKeysStringTmp; } return new Promise(function (resolve, reject) { - $.ajax(url) - .done(function (manifest) { - if (manifest) { - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].dependencies - ) { - if (manifest[\\"sap.ui5\\"].dependencies.libs) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + localJQuery.ajax(url) + .done(function (manifest) { + if (manifest) { + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].dependencies + ) { + if (manifest[\\"sap.ui5\\"].dependencies.libs) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + } + if (manifest[\\"sap.ui5\\"].dependencies.components) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + } } - if (manifest[\\"sap.ui5\\"].dependencies.components) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].componentUsages + ) { + result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); } } - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].componentUsages - ) { - result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); - } - } - resolve(result); - }) - .fail(function () { - reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); - }); + resolve(result); + }) + .fail(function () { + reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); + }); + }); }); }; function registerModules(dataFromAppIndex) { @@ -3555,18 +3558,19 @@ EntityType=\\"com.sap.gateway.srvd.dmo.sd_travel_mduu.v0001.TravelAgencyType\\"> return new Promise( function (resolve) { - sap.ui.require([\\"sap/base/util/UriParameters\\"], function (UriParameters) { - sapClient = UriParameters.fromQuery(window.location.search).get(\\"sap-client\\"); - if (sapClient && sapClient.length === 3) { - url = url + \\"&sap-client=\\" + sapClient; - } - resolve(url); - }); + sapClient = new URLSearchParams(window.location.search).get(\\"sap-client\\"); + if (sapClient && sapClient.length === 3) { + url = url + \\"&sap-client=\\" + sapClient; + } + resolve(url); }).then(function (url2) { - return $.ajax(url2).done(function (data) { - if (data) { - registerModules(data); - } + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + return localJQuery.ajax(url2) + .done(function (data) { + if (data) { + registerModules(data); + } + }); }); }); } else { @@ -3604,6 +3608,10 @@ var manifestUri = currentScript.getAttribute(\\"data-sap-ui-manifest-uri\\"); var componentName = currentScript.getAttribute(\\"data-sap-ui-componentName\\"); var useMockserver = currentScript.getAttribute(\\"data-sap-ui-use-mockserver\\"); +// Patch (KW): resourceRoot is needed to load the correct ResourceBundles +var resourceRoot = manifestUri.substring(0, manifestUri.lastIndexOf('/')+1); + + sap.registerComponentDependencyPaths(manifestUri) .catch(function (error) { sap.ui.require([\\"sap/base/Log\\"], function (Log) { @@ -3613,57 +3621,75 @@ sap.registerComponentDependencyPaths(manifestUri) .finally(function () { // setting the app title with internationalization - sap.ui.getCore().attachInit(function () { - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); - if (componentName && componentName.length > 0) { + if (componentName && componentName.length > 0) { if (useMockserver && useMockserver === \\"true\\") { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { - // set up test service for local testing - server.init(); - // initialize the ushell sandbox component - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - }); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { + // set up test service for local testing + server.init(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + }); + }); + }); }); } else { // Requiring the ComponentSupport module automatically executes the component initialisation for all declaratively defined components sap.ui.require([\\"sap/ui/core/ComponentSupport\\"]); // setting the app title with the i18n text - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); } } else { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - try { - // initialize the ushell sandbox component in ui5 v2 - sap.ushell.Container.createRenderer(true).then(function (component) { - component.placeAt(\\"content\\"); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + try { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + } catch (error) { + // support older versions of ui5 + Container.createRenderer().placeAt(\\"content\\"); + } }); - } catch { - // support older versions of ui5 - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - } + }); }); } });", diff --git a/packages/fiori-elements-writer/test/__snapshots__/lrop.test.ts.snap b/packages/fiori-elements-writer/test/__snapshots__/lrop.test.ts.snap index 82e6347bb4..941d762030 100644 --- a/packages/fiori-elements-writer/test/__snapshots__/lrop.test.ts.snap +++ b/packages/fiori-elements-writer/test/__snapshots__/lrop.test.ts.snap @@ -3423,32 +3423,35 @@ if (parseInt(version[0], 10) <= 1 && parseInt(version[1], 10) < 78) { return libOrCompKeysStringTmp; } return new Promise(function (resolve, reject) { - $.ajax(url) - .done(function (manifest) { - if (manifest) { - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].dependencies - ) { - if (manifest[\\"sap.ui5\\"].dependencies.libs) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + localJQuery.ajax(url) + .done(function (manifest) { + if (manifest) { + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].dependencies + ) { + if (manifest[\\"sap.ui5\\"].dependencies.libs) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + } + if (manifest[\\"sap.ui5\\"].dependencies.components) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + } } - if (manifest[\\"sap.ui5\\"].dependencies.components) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].componentUsages + ) { + result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); } } - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].componentUsages - ) { - result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); - } - } - resolve(result); - }) - .fail(function () { - reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); - }); + resolve(result); + }) + .fail(function () { + reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); + }); + }); }); }; function registerModules(dataFromAppIndex) { @@ -3491,18 +3494,19 @@ if (parseInt(version[0], 10) <= 1 && parseInt(version[1], 10) < 78) { return new Promise( function (resolve) { - sap.ui.require([\\"sap/base/util/UriParameters\\"], function (UriParameters) { - sapClient = UriParameters.fromQuery(window.location.search).get(\\"sap-client\\"); - if (sapClient && sapClient.length === 3) { - url = url + \\"&sap-client=\\" + sapClient; - } - resolve(url); - }); + sapClient = new URLSearchParams(window.location.search).get(\\"sap-client\\"); + if (sapClient && sapClient.length === 3) { + url = url + \\"&sap-client=\\" + sapClient; + } + resolve(url); }).then(function (url2) { - return $.ajax(url2).done(function (data) { - if (data) { - registerModules(data); - } + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + return localJQuery.ajax(url2) + .done(function (data) { + if (data) { + registerModules(data); + } + }); }); }); } else { @@ -3540,6 +3544,10 @@ var manifestUri = currentScript.getAttribute(\\"data-sap-ui-manifest-uri\\"); var componentName = currentScript.getAttribute(\\"data-sap-ui-componentName\\"); var useMockserver = currentScript.getAttribute(\\"data-sap-ui-use-mockserver\\"); +// Patch (KW): resourceRoot is needed to load the correct ResourceBundles +var resourceRoot = manifestUri.substring(0, manifestUri.lastIndexOf('/')+1); + + sap.registerComponentDependencyPaths(manifestUri) .catch(function (error) { sap.ui.require([\\"sap/base/Log\\"], function (Log) { @@ -3549,57 +3557,75 @@ sap.registerComponentDependencyPaths(manifestUri) .finally(function () { // setting the app title with internationalization - sap.ui.getCore().attachInit(function () { - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); - if (componentName && componentName.length > 0) { + if (componentName && componentName.length > 0) { if (useMockserver && useMockserver === \\"true\\") { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { - // set up test service for local testing - server.init(); - // initialize the ushell sandbox component - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - }); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { + // set up test service for local testing + server.init(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + }); + }); + }); }); } else { // Requiring the ComponentSupport module automatically executes the component initialisation for all declaratively defined components sap.ui.require([\\"sap/ui/core/ComponentSupport\\"]); // setting the app title with the i18n text - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); } } else { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - try { - // initialize the ushell sandbox component in ui5 v2 - sap.ushell.Container.createRenderer(true).then(function (component) { - component.placeAt(\\"content\\"); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + try { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + } catch (error) { + // support older versions of ui5 + Container.createRenderer().placeAt(\\"content\\"); + } }); - } catch { - // support older versions of ui5 - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - } + }); }); } });", @@ -7031,32 +7057,35 @@ if (parseInt(version[0], 10) <= 1 && parseInt(version[1], 10) < 78) { return libOrCompKeysStringTmp; } return new Promise(function (resolve, reject) { - $.ajax(url) - .done(function (manifest) { - if (manifest) { - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].dependencies - ) { - if (manifest[\\"sap.ui5\\"].dependencies.libs) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + localJQuery.ajax(url) + .done(function (manifest) { + if (manifest) { + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].dependencies + ) { + if (manifest[\\"sap.ui5\\"].dependencies.libs) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + } + if (manifest[\\"sap.ui5\\"].dependencies.components) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + } } - if (manifest[\\"sap.ui5\\"].dependencies.components) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].componentUsages + ) { + result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); } } - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].componentUsages - ) { - result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); - } - } - resolve(result); - }) - .fail(function () { - reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); - }); + resolve(result); + }) + .fail(function () { + reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); + }); + }); }); }; function registerModules(dataFromAppIndex) { @@ -7099,18 +7128,19 @@ if (parseInt(version[0], 10) <= 1 && parseInt(version[1], 10) < 78) { return new Promise( function (resolve) { - sap.ui.require([\\"sap/base/util/UriParameters\\"], function (UriParameters) { - sapClient = UriParameters.fromQuery(window.location.search).get(\\"sap-client\\"); - if (sapClient && sapClient.length === 3) { - url = url + \\"&sap-client=\\" + sapClient; - } - resolve(url); - }); + sapClient = new URLSearchParams(window.location.search).get(\\"sap-client\\"); + if (sapClient && sapClient.length === 3) { + url = url + \\"&sap-client=\\" + sapClient; + } + resolve(url); }).then(function (url2) { - return $.ajax(url2).done(function (data) { - if (data) { - registerModules(data); - } + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + return localJQuery.ajax(url2) + .done(function (data) { + if (data) { + registerModules(data); + } + }); }); }); } else { @@ -7148,6 +7178,10 @@ var manifestUri = currentScript.getAttribute(\\"data-sap-ui-manifest-uri\\"); var componentName = currentScript.getAttribute(\\"data-sap-ui-componentName\\"); var useMockserver = currentScript.getAttribute(\\"data-sap-ui-use-mockserver\\"); +// Patch (KW): resourceRoot is needed to load the correct ResourceBundles +var resourceRoot = manifestUri.substring(0, manifestUri.lastIndexOf('/')+1); + + sap.registerComponentDependencyPaths(manifestUri) .catch(function (error) { sap.ui.require([\\"sap/base/Log\\"], function (Log) { @@ -7157,57 +7191,75 @@ sap.registerComponentDependencyPaths(manifestUri) .finally(function () { // setting the app title with internationalization - sap.ui.getCore().attachInit(function () { - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); - if (componentName && componentName.length > 0) { + if (componentName && componentName.length > 0) { if (useMockserver && useMockserver === \\"true\\") { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { - // set up test service for local testing - server.init(); - // initialize the ushell sandbox component - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - }); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { + // set up test service for local testing + server.init(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + }); + }); + }); }); } else { // Requiring the ComponentSupport module automatically executes the component initialisation for all declaratively defined components sap.ui.require([\\"sap/ui/core/ComponentSupport\\"]); // setting the app title with the i18n text - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); } } else { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - try { - // initialize the ushell sandbox component in ui5 v2 - sap.ushell.Container.createRenderer(true).then(function (component) { - component.placeAt(\\"content\\"); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + try { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + } catch (error) { + // support older versions of ui5 + Container.createRenderer().placeAt(\\"content\\"); + } }); - } catch { - // support older versions of ui5 - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - } + }); }); } });", @@ -14184,32 +14236,35 @@ EntityType=\\"com.sap.gateway.srvd.dmo.sd_travel_mduu.v0001.TravelAgencyType\\"> return libOrCompKeysStringTmp; } return new Promise(function (resolve, reject) { - $.ajax(url) - .done(function (manifest) { - if (manifest) { - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].dependencies - ) { - if (manifest[\\"sap.ui5\\"].dependencies.libs) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + localJQuery.ajax(url) + .done(function (manifest) { + if (manifest) { + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].dependencies + ) { + if (manifest[\\"sap.ui5\\"].dependencies.libs) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + } + if (manifest[\\"sap.ui5\\"].dependencies.components) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + } } - if (manifest[\\"sap.ui5\\"].dependencies.components) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].componentUsages + ) { + result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); } } - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].componentUsages - ) { - result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); - } - } - resolve(result); - }) - .fail(function () { - reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); - }); + resolve(result); + }) + .fail(function () { + reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); + }); + }); }); }; function registerModules(dataFromAppIndex) { @@ -14252,18 +14307,19 @@ EntityType=\\"com.sap.gateway.srvd.dmo.sd_travel_mduu.v0001.TravelAgencyType\\"> return new Promise( function (resolve) { - sap.ui.require([\\"sap/base/util/UriParameters\\"], function (UriParameters) { - sapClient = UriParameters.fromQuery(window.location.search).get(\\"sap-client\\"); - if (sapClient && sapClient.length === 3) { - url = url + \\"&sap-client=\\" + sapClient; - } - resolve(url); - }); + sapClient = new URLSearchParams(window.location.search).get(\\"sap-client\\"); + if (sapClient && sapClient.length === 3) { + url = url + \\"&sap-client=\\" + sapClient; + } + resolve(url); }).then(function (url2) { - return $.ajax(url2).done(function (data) { - if (data) { - registerModules(data); - } + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + return localJQuery.ajax(url2) + .done(function (data) { + if (data) { + registerModules(data); + } + }); }); }); } else { @@ -14301,6 +14357,10 @@ var manifestUri = currentScript.getAttribute(\\"data-sap-ui-manifest-uri\\"); var componentName = currentScript.getAttribute(\\"data-sap-ui-componentName\\"); var useMockserver = currentScript.getAttribute(\\"data-sap-ui-use-mockserver\\"); +// Patch (KW): resourceRoot is needed to load the correct ResourceBundles +var resourceRoot = manifestUri.substring(0, manifestUri.lastIndexOf('/')+1); + + sap.registerComponentDependencyPaths(manifestUri) .catch(function (error) { sap.ui.require([\\"sap/base/Log\\"], function (Log) { @@ -14310,57 +14370,75 @@ sap.registerComponentDependencyPaths(manifestUri) .finally(function () { // setting the app title with internationalization - sap.ui.getCore().attachInit(function () { - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); - if (componentName && componentName.length > 0) { + if (componentName && componentName.length > 0) { if (useMockserver && useMockserver === \\"true\\") { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { - // set up test service for local testing - server.init(); - // initialize the ushell sandbox component - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - }); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { + // set up test service for local testing + server.init(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + }); + }); + }); }); } else { // Requiring the ComponentSupport module automatically executes the component initialisation for all declaratively defined components sap.ui.require([\\"sap/ui/core/ComponentSupport\\"]); // setting the app title with the i18n text - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); } } else { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - try { - // initialize the ushell sandbox component in ui5 v2 - sap.ushell.Container.createRenderer(true).then(function (component) { - component.placeAt(\\"content\\"); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + try { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + } catch (error) { + // support older versions of ui5 + Container.createRenderer().placeAt(\\"content\\"); + } }); - } catch { - // support older versions of ui5 - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - } + }); }); } });", @@ -17851,32 +17929,35 @@ EntityType=\\"com.sap.gateway.srvd.dmo.sd_travel_mduu.v0001.TravelAgencyType\\"> return libOrCompKeysStringTmp; } return new Promise(function (resolve, reject) { - $.ajax(url) - .done(function (manifest) { - if (manifest) { - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].dependencies - ) { - if (manifest[\\"sap.ui5\\"].dependencies.libs) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + localJQuery.ajax(url) + .done(function (manifest) { + if (manifest) { + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].dependencies + ) { + if (manifest[\\"sap.ui5\\"].dependencies.libs) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + } + if (manifest[\\"sap.ui5\\"].dependencies.components) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + } } - if (manifest[\\"sap.ui5\\"].dependencies.components) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].componentUsages + ) { + result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); } } - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].componentUsages - ) { - result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); - } - } - resolve(result); - }) - .fail(function () { - reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); - }); + resolve(result); + }) + .fail(function () { + reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); + }); + }); }); }; function registerModules(dataFromAppIndex) { @@ -17919,18 +18000,19 @@ EntityType=\\"com.sap.gateway.srvd.dmo.sd_travel_mduu.v0001.TravelAgencyType\\"> return new Promise( function (resolve) { - sap.ui.require([\\"sap/base/util/UriParameters\\"], function (UriParameters) { - sapClient = UriParameters.fromQuery(window.location.search).get(\\"sap-client\\"); - if (sapClient && sapClient.length === 3) { - url = url + \\"&sap-client=\\" + sapClient; - } - resolve(url); - }); + sapClient = new URLSearchParams(window.location.search).get(\\"sap-client\\"); + if (sapClient && sapClient.length === 3) { + url = url + \\"&sap-client=\\" + sapClient; + } + resolve(url); }).then(function (url2) { - return $.ajax(url2).done(function (data) { - if (data) { - registerModules(data); - } + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + return localJQuery.ajax(url2) + .done(function (data) { + if (data) { + registerModules(data); + } + }); }); }); } else { @@ -17968,6 +18050,10 @@ var manifestUri = currentScript.getAttribute(\\"data-sap-ui-manifest-uri\\"); var componentName = currentScript.getAttribute(\\"data-sap-ui-componentName\\"); var useMockserver = currentScript.getAttribute(\\"data-sap-ui-use-mockserver\\"); +// Patch (KW): resourceRoot is needed to load the correct ResourceBundles +var resourceRoot = manifestUri.substring(0, manifestUri.lastIndexOf('/')+1); + + sap.registerComponentDependencyPaths(manifestUri) .catch(function (error) { sap.ui.require([\\"sap/base/Log\\"], function (Log) { @@ -17977,57 +18063,75 @@ sap.registerComponentDependencyPaths(manifestUri) .finally(function () { // setting the app title with internationalization - sap.ui.getCore().attachInit(function () { - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); - if (componentName && componentName.length > 0) { + if (componentName && componentName.length > 0) { if (useMockserver && useMockserver === \\"true\\") { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { - // set up test service for local testing - server.init(); - // initialize the ushell sandbox component - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - }); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { + // set up test service for local testing + server.init(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + }); + }); + }); }); } else { // Requiring the ComponentSupport module automatically executes the component initialisation for all declaratively defined components sap.ui.require([\\"sap/ui/core/ComponentSupport\\"]); // setting the app title with the i18n text - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); } } else { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - try { - // initialize the ushell sandbox component in ui5 v2 - sap.ushell.Container.createRenderer(true).then(function (component) { - component.placeAt(\\"content\\"); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + try { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + } catch (error) { + // support older versions of ui5 + Container.createRenderer().placeAt(\\"content\\"); + } }); - } catch { - // support older versions of ui5 - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - } + }); }); } });", @@ -21684,32 +21788,35 @@ EntityType=\\"com.sap.gateway.srvd.dmo.sd_travel_mduu.v0001.TravelAgencyType\\"> return libOrCompKeysStringTmp; } return new Promise(function (resolve, reject) { - $.ajax(url) - .done(function (manifest) { - if (manifest) { - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].dependencies - ) { - if (manifest[\\"sap.ui5\\"].dependencies.libs) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + localJQuery.ajax(url) + .done(function (manifest) { + if (manifest) { + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].dependencies + ) { + if (manifest[\\"sap.ui5\\"].dependencies.libs) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + } + if (manifest[\\"sap.ui5\\"].dependencies.components) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + } } - if (manifest[\\"sap.ui5\\"].dependencies.components) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].componentUsages + ) { + result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); } } - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].componentUsages - ) { - result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); - } - } - resolve(result); - }) - .fail(function () { - reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); - }); + resolve(result); + }) + .fail(function () { + reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); + }); + }); }); }; function registerModules(dataFromAppIndex) { @@ -21752,18 +21859,19 @@ EntityType=\\"com.sap.gateway.srvd.dmo.sd_travel_mduu.v0001.TravelAgencyType\\"> return new Promise( function (resolve) { - sap.ui.require([\\"sap/base/util/UriParameters\\"], function (UriParameters) { - sapClient = UriParameters.fromQuery(window.location.search).get(\\"sap-client\\"); - if (sapClient && sapClient.length === 3) { - url = url + \\"&sap-client=\\" + sapClient; - } - resolve(url); - }); + sapClient = new URLSearchParams(window.location.search).get(\\"sap-client\\"); + if (sapClient && sapClient.length === 3) { + url = url + \\"&sap-client=\\" + sapClient; + } + resolve(url); }).then(function (url2) { - return $.ajax(url2).done(function (data) { - if (data) { - registerModules(data); - } + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + return localJQuery.ajax(url2) + .done(function (data) { + if (data) { + registerModules(data); + } + }); }); }); } else { @@ -21801,6 +21909,10 @@ var manifestUri = currentScript.getAttribute(\\"data-sap-ui-manifest-uri\\"); var componentName = currentScript.getAttribute(\\"data-sap-ui-componentName\\"); var useMockserver = currentScript.getAttribute(\\"data-sap-ui-use-mockserver\\"); +// Patch (KW): resourceRoot is needed to load the correct ResourceBundles +var resourceRoot = manifestUri.substring(0, manifestUri.lastIndexOf('/')+1); + + sap.registerComponentDependencyPaths(manifestUri) .catch(function (error) { sap.ui.require([\\"sap/base/Log\\"], function (Log) { @@ -21810,57 +21922,75 @@ sap.registerComponentDependencyPaths(manifestUri) .finally(function () { // setting the app title with internationalization - sap.ui.getCore().attachInit(function () { - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); - if (componentName && componentName.length > 0) { + if (componentName && componentName.length > 0) { if (useMockserver && useMockserver === \\"true\\") { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { - // set up test service for local testing - server.init(); - // initialize the ushell sandbox component - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - }); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { + // set up test service for local testing + server.init(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + }); + }); + }); }); } else { // Requiring the ComponentSupport module automatically executes the component initialisation for all declaratively defined components sap.ui.require([\\"sap/ui/core/ComponentSupport\\"]); // setting the app title with the i18n text - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); } } else { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - try { - // initialize the ushell sandbox component in ui5 v2 - sap.ushell.Container.createRenderer(true).then(function (component) { - component.placeAt(\\"content\\"); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + try { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + } catch (error) { + // support older versions of ui5 + Container.createRenderer().placeAt(\\"content\\"); + } }); - } catch { - // support older versions of ui5 - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - } + }); }); } });", @@ -22501,32 +22631,35 @@ appDescription=A Fiori application.", return libOrCompKeysStringTmp; } return new Promise(function (resolve, reject) { - $.ajax(url) - .done(function (manifest) { - if (manifest) { - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].dependencies - ) { - if (manifest[\\"sap.ui5\\"].dependencies.libs) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + localJQuery.ajax(url) + .done(function (manifest) { + if (manifest) { + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].dependencies + ) { + if (manifest[\\"sap.ui5\\"].dependencies.libs) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + } + if (manifest[\\"sap.ui5\\"].dependencies.components) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + } } - if (manifest[\\"sap.ui5\\"].dependencies.components) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].componentUsages + ) { + result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); } } - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].componentUsages - ) { - result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); - } - } - resolve(result); - }) - .fail(function () { - reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); - }); + resolve(result); + }) + .fail(function () { + reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); + }); + }); }); }; function registerModules(dataFromAppIndex) { @@ -22569,18 +22702,19 @@ appDescription=A Fiori application.", return new Promise( function (resolve) { - sap.ui.require([\\"sap/base/util/UriParameters\\"], function (UriParameters) { - sapClient = UriParameters.fromQuery(window.location.search).get(\\"sap-client\\"); - if (sapClient && sapClient.length === 3) { - url = url + \\"&sap-client=\\" + sapClient; - } - resolve(url); - }); + sapClient = new URLSearchParams(window.location.search).get(\\"sap-client\\"); + if (sapClient && sapClient.length === 3) { + url = url + \\"&sap-client=\\" + sapClient; + } + resolve(url); }).then(function (url2) { - return $.ajax(url2).done(function (data) { - if (data) { - registerModules(data); - } + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + return localJQuery.ajax(url2) + .done(function (data) { + if (data) { + registerModules(data); + } + }); }); }); } else { @@ -22618,6 +22752,10 @@ var manifestUri = currentScript.getAttribute(\\"data-sap-ui-manifest-uri\\"); var componentName = currentScript.getAttribute(\\"data-sap-ui-componentName\\"); var useMockserver = currentScript.getAttribute(\\"data-sap-ui-use-mockserver\\"); +// Patch (KW): resourceRoot is needed to load the correct ResourceBundles +var resourceRoot = manifestUri.substring(0, manifestUri.lastIndexOf('/')+1); + + sap.registerComponentDependencyPaths(manifestUri) .catch(function (error) { sap.ui.require([\\"sap/base/Log\\"], function (Log) { @@ -22627,57 +22765,75 @@ sap.registerComponentDependencyPaths(manifestUri) .finally(function () { // setting the app title with internationalization - sap.ui.getCore().attachInit(function () { - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); - if (componentName && componentName.length > 0) { + if (componentName && componentName.length > 0) { if (useMockserver && useMockserver === \\"true\\") { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { - // set up test service for local testing - server.init(); - // initialize the ushell sandbox component - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - }); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { + // set up test service for local testing + server.init(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + }); + }); + }); }); } else { // Requiring the ComponentSupport module automatically executes the component initialisation for all declaratively defined components sap.ui.require([\\"sap/ui/core/ComponentSupport\\"]); // setting the app title with the i18n text - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); } } else { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - try { - // initialize the ushell sandbox component in ui5 v2 - sap.ushell.Container.createRenderer(true).then(function (component) { - component.placeAt(\\"content\\"); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + try { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + } catch (error) { + // support older versions of ui5 + Container.createRenderer().placeAt(\\"content\\"); + } }); - } catch { - // support older versions of ui5 - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - } + }); }); } });", @@ -23385,32 +23541,35 @@ appDescription=A Fiori application.", return libOrCompKeysStringTmp; } return new Promise(function (resolve, reject) { - $.ajax(url) - .done(function (manifest) { - if (manifest) { - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].dependencies - ) { - if (manifest[\\"sap.ui5\\"].dependencies.libs) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + localJQuery.ajax(url) + .done(function (manifest) { + if (manifest) { + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].dependencies + ) { + if (manifest[\\"sap.ui5\\"].dependencies.libs) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + } + if (manifest[\\"sap.ui5\\"].dependencies.components) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + } } - if (manifest[\\"sap.ui5\\"].dependencies.components) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].componentUsages + ) { + result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); } } - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].componentUsages - ) { - result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); - } - } - resolve(result); - }) - .fail(function () { - reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); - }); + resolve(result); + }) + .fail(function () { + reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); + }); + }); }); }; function registerModules(dataFromAppIndex) { @@ -23453,18 +23612,19 @@ appDescription=A Fiori application.", return new Promise( function (resolve) { - sap.ui.require([\\"sap/base/util/UriParameters\\"], function (UriParameters) { - sapClient = UriParameters.fromQuery(window.location.search).get(\\"sap-client\\"); - if (sapClient && sapClient.length === 3) { - url = url + \\"&sap-client=\\" + sapClient; - } - resolve(url); - }); + sapClient = new URLSearchParams(window.location.search).get(\\"sap-client\\"); + if (sapClient && sapClient.length === 3) { + url = url + \\"&sap-client=\\" + sapClient; + } + resolve(url); }).then(function (url2) { - return $.ajax(url2).done(function (data) { - if (data) { - registerModules(data); - } + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + return localJQuery.ajax(url2) + .done(function (data) { + if (data) { + registerModules(data); + } + }); }); }); } else { @@ -23502,6 +23662,10 @@ var manifestUri = currentScript.getAttribute(\\"data-sap-ui-manifest-uri\\"); var componentName = currentScript.getAttribute(\\"data-sap-ui-componentName\\"); var useMockserver = currentScript.getAttribute(\\"data-sap-ui-use-mockserver\\"); +// Patch (KW): resourceRoot is needed to load the correct ResourceBundles +var resourceRoot = manifestUri.substring(0, manifestUri.lastIndexOf('/')+1); + + sap.registerComponentDependencyPaths(manifestUri) .catch(function (error) { sap.ui.require([\\"sap/base/Log\\"], function (Log) { @@ -23511,57 +23675,75 @@ sap.registerComponentDependencyPaths(manifestUri) .finally(function () { // setting the app title with internationalization - sap.ui.getCore().attachInit(function () { - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); - if (componentName && componentName.length > 0) { + if (componentName && componentName.length > 0) { if (useMockserver && useMockserver === \\"true\\") { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { - // set up test service for local testing - server.init(); - // initialize the ushell sandbox component - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - }); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { + // set up test service for local testing + server.init(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + }); + }); + }); }); } else { // Requiring the ComponentSupport module automatically executes the component initialisation for all declaratively defined components sap.ui.require([\\"sap/ui/core/ComponentSupport\\"]); // setting the app title with the i18n text - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); } } else { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - try { - // initialize the ushell sandbox component in ui5 v2 - sap.ushell.Container.createRenderer(true).then(function (component) { - component.placeAt(\\"content\\"); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + try { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + } catch (error) { + // support older versions of ui5 + Container.createRenderer().placeAt(\\"content\\"); + } }); - } catch { - // support older versions of ui5 - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - } + }); }); } });", @@ -24716,32 +24898,35 @@ xmlns:edmx=\\"http://docs.oasis-open.org/odata/ns/edmx\\"> return libOrCompKeysStringTmp; } return new Promise(function (resolve, reject) { - $.ajax(url) - .done(function (manifest) { - if (manifest) { - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].dependencies - ) { - if (manifest[\\"sap.ui5\\"].dependencies.libs) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + localJQuery.ajax(url) + .done(function (manifest) { + if (manifest) { + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].dependencies + ) { + if (manifest[\\"sap.ui5\\"].dependencies.libs) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + } + if (manifest[\\"sap.ui5\\"].dependencies.components) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + } } - if (manifest[\\"sap.ui5\\"].dependencies.components) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].componentUsages + ) { + result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); } } - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].componentUsages - ) { - result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); - } - } - resolve(result); - }) - .fail(function () { - reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); - }); + resolve(result); + }) + .fail(function () { + reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); + }); + }); }); }; function registerModules(dataFromAppIndex) { @@ -24784,18 +24969,19 @@ xmlns:edmx=\\"http://docs.oasis-open.org/odata/ns/edmx\\"> return new Promise( function (resolve) { - sap.ui.require([\\"sap/base/util/UriParameters\\"], function (UriParameters) { - sapClient = UriParameters.fromQuery(window.location.search).get(\\"sap-client\\"); - if (sapClient && sapClient.length === 3) { - url = url + \\"&sap-client=\\" + sapClient; - } - resolve(url); - }); + sapClient = new URLSearchParams(window.location.search).get(\\"sap-client\\"); + if (sapClient && sapClient.length === 3) { + url = url + \\"&sap-client=\\" + sapClient; + } + resolve(url); }).then(function (url2) { - return $.ajax(url2).done(function (data) { - if (data) { - registerModules(data); - } + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + return localJQuery.ajax(url2) + .done(function (data) { + if (data) { + registerModules(data); + } + }); }); }); } else { @@ -24833,6 +25019,10 @@ var manifestUri = currentScript.getAttribute(\\"data-sap-ui-manifest-uri\\"); var componentName = currentScript.getAttribute(\\"data-sap-ui-componentName\\"); var useMockserver = currentScript.getAttribute(\\"data-sap-ui-use-mockserver\\"); +// Patch (KW): resourceRoot is needed to load the correct ResourceBundles +var resourceRoot = manifestUri.substring(0, manifestUri.lastIndexOf('/')+1); + + sap.registerComponentDependencyPaths(manifestUri) .catch(function (error) { sap.ui.require([\\"sap/base/Log\\"], function (Log) { @@ -24842,57 +25032,75 @@ sap.registerComponentDependencyPaths(manifestUri) .finally(function () { // setting the app title with internationalization - sap.ui.getCore().attachInit(function () { - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); - if (componentName && componentName.length > 0) { + if (componentName && componentName.length > 0) { if (useMockserver && useMockserver === \\"true\\") { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { - // set up test service for local testing - server.init(); - // initialize the ushell sandbox component - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - }); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { + // set up test service for local testing + server.init(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + }); + }); + }); }); } else { // Requiring the ComponentSupport module automatically executes the component initialisation for all declaratively defined components sap.ui.require([\\"sap/ui/core/ComponentSupport\\"]); // setting the app title with the i18n text - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); } } else { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - try { - // initialize the ushell sandbox component in ui5 v2 - sap.ushell.Container.createRenderer(true).then(function (component) { - component.placeAt(\\"content\\"); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + try { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + } catch (error) { + // support older versions of ui5 + Container.createRenderer().placeAt(\\"content\\"); + } }); - } catch { - // support older versions of ui5 - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - } + }); }); } });", @@ -28409,32 +28617,35 @@ EntityType=\\"com.sap.gateway.srvd.dmo.sd_travel_mduu.v0001.TravelAgencyType\\"> return libOrCompKeysStringTmp; } return new Promise(function (resolve, reject) { - $.ajax(url) - .done(function (manifest) { - if (manifest) { - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].dependencies - ) { - if (manifest[\\"sap.ui5\\"].dependencies.libs) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + localJQuery.ajax(url) + .done(function (manifest) { + if (manifest) { + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].dependencies + ) { + if (manifest[\\"sap.ui5\\"].dependencies.libs) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + } + if (manifest[\\"sap.ui5\\"].dependencies.components) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + } } - if (manifest[\\"sap.ui5\\"].dependencies.components) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].componentUsages + ) { + result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); } } - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].componentUsages - ) { - result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); - } - } - resolve(result); - }) - .fail(function () { - reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); - }); + resolve(result); + }) + .fail(function () { + reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); + }); + }); }); }; function registerModules(dataFromAppIndex) { @@ -28477,18 +28688,19 @@ EntityType=\\"com.sap.gateway.srvd.dmo.sd_travel_mduu.v0001.TravelAgencyType\\"> return new Promise( function (resolve) { - sap.ui.require([\\"sap/base/util/UriParameters\\"], function (UriParameters) { - sapClient = UriParameters.fromQuery(window.location.search).get(\\"sap-client\\"); - if (sapClient && sapClient.length === 3) { - url = url + \\"&sap-client=\\" + sapClient; - } - resolve(url); - }); + sapClient = new URLSearchParams(window.location.search).get(\\"sap-client\\"); + if (sapClient && sapClient.length === 3) { + url = url + \\"&sap-client=\\" + sapClient; + } + resolve(url); }).then(function (url2) { - return $.ajax(url2).done(function (data) { - if (data) { - registerModules(data); - } + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + return localJQuery.ajax(url2) + .done(function (data) { + if (data) { + registerModules(data); + } + }); }); }); } else { @@ -28526,6 +28738,10 @@ var manifestUri = currentScript.getAttribute(\\"data-sap-ui-manifest-uri\\"); var componentName = currentScript.getAttribute(\\"data-sap-ui-componentName\\"); var useMockserver = currentScript.getAttribute(\\"data-sap-ui-use-mockserver\\"); +// Patch (KW): resourceRoot is needed to load the correct ResourceBundles +var resourceRoot = manifestUri.substring(0, manifestUri.lastIndexOf('/')+1); + + sap.registerComponentDependencyPaths(manifestUri) .catch(function (error) { sap.ui.require([\\"sap/base/Log\\"], function (Log) { @@ -28535,57 +28751,75 @@ sap.registerComponentDependencyPaths(manifestUri) .finally(function () { // setting the app title with internationalization - sap.ui.getCore().attachInit(function () { - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); - if (componentName && componentName.length > 0) { + if (componentName && componentName.length > 0) { if (useMockserver && useMockserver === \\"true\\") { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { - // set up test service for local testing - server.init(); - // initialize the ushell sandbox component - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - }); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { + // set up test service for local testing + server.init(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + }); + }); + }); }); } else { // Requiring the ComponentSupport module automatically executes the component initialisation for all declaratively defined components sap.ui.require([\\"sap/ui/core/ComponentSupport\\"]); // setting the app title with the i18n text - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); } } else { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - try { - // initialize the ushell sandbox component in ui5 v2 - sap.ushell.Container.createRenderer(true).then(function (component) { - component.placeAt(\\"content\\"); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + try { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + } catch (error) { + // support older versions of ui5 + Container.createRenderer().placeAt(\\"content\\"); + } }); - } catch { - // support older versions of ui5 - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - } + }); }); } });", @@ -32077,32 +32311,35 @@ EntityType=\\"com.sap.gateway.srvd.dmo.sd_travel_mduu.v0001.TravelAgencyType\\"> return libOrCompKeysStringTmp; } return new Promise(function (resolve, reject) { - $.ajax(url) - .done(function (manifest) { - if (manifest) { - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].dependencies - ) { - if (manifest[\\"sap.ui5\\"].dependencies.libs) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + localJQuery.ajax(url) + .done(function (manifest) { + if (manifest) { + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].dependencies + ) { + if (manifest[\\"sap.ui5\\"].dependencies.libs) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + } + if (manifest[\\"sap.ui5\\"].dependencies.components) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + } } - if (manifest[\\"sap.ui5\\"].dependencies.components) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].componentUsages + ) { + result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); } } - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].componentUsages - ) { - result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); - } - } - resolve(result); - }) - .fail(function () { - reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); - }); + resolve(result); + }) + .fail(function () { + reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); + }); + }); }); }; function registerModules(dataFromAppIndex) { @@ -32145,18 +32382,19 @@ EntityType=\\"com.sap.gateway.srvd.dmo.sd_travel_mduu.v0001.TravelAgencyType\\"> return new Promise( function (resolve) { - sap.ui.require([\\"sap/base/util/UriParameters\\"], function (UriParameters) { - sapClient = UriParameters.fromQuery(window.location.search).get(\\"sap-client\\"); - if (sapClient && sapClient.length === 3) { - url = url + \\"&sap-client=\\" + sapClient; - } - resolve(url); - }); + sapClient = new URLSearchParams(window.location.search).get(\\"sap-client\\"); + if (sapClient && sapClient.length === 3) { + url = url + \\"&sap-client=\\" + sapClient; + } + resolve(url); }).then(function (url2) { - return $.ajax(url2).done(function (data) { - if (data) { - registerModules(data); - } + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + return localJQuery.ajax(url2) + .done(function (data) { + if (data) { + registerModules(data); + } + }); }); }); } else { @@ -32194,6 +32432,10 @@ var manifestUri = currentScript.getAttribute(\\"data-sap-ui-manifest-uri\\"); var componentName = currentScript.getAttribute(\\"data-sap-ui-componentName\\"); var useMockserver = currentScript.getAttribute(\\"data-sap-ui-use-mockserver\\"); +// Patch (KW): resourceRoot is needed to load the correct ResourceBundles +var resourceRoot = manifestUri.substring(0, manifestUri.lastIndexOf('/')+1); + + sap.registerComponentDependencyPaths(manifestUri) .catch(function (error) { sap.ui.require([\\"sap/base/Log\\"], function (Log) { @@ -32203,57 +32445,75 @@ sap.registerComponentDependencyPaths(manifestUri) .finally(function () { // setting the app title with internationalization - sap.ui.getCore().attachInit(function () { - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); - if (componentName && componentName.length > 0) { + if (componentName && componentName.length > 0) { if (useMockserver && useMockserver === \\"true\\") { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { - // set up test service for local testing - server.init(); - // initialize the ushell sandbox component - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - }); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { + // set up test service for local testing + server.init(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + }); + }); + }); }); } else { // Requiring the ComponentSupport module automatically executes the component initialisation for all declaratively defined components sap.ui.require([\\"sap/ui/core/ComponentSupport\\"]); // setting the app title with the i18n text - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); } } else { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - try { - // initialize the ushell sandbox component in ui5 v2 - sap.ushell.Container.createRenderer(true).then(function (component) { - component.placeAt(\\"content\\"); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + try { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + } catch (error) { + // support older versions of ui5 + Container.createRenderer().placeAt(\\"content\\"); + } }); - } catch { - // support older versions of ui5 - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - } + }); }); } });", @@ -35687,32 +35947,35 @@ if (parseInt(version[0], 10) <= 1 && parseInt(version[1], 10) < 78) { return libOrCompKeysStringTmp; } return new Promise(function (resolve, reject) { - $.ajax(url) - .done(function (manifest) { - if (manifest) { - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].dependencies - ) { - if (manifest[\\"sap.ui5\\"].dependencies.libs) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + localJQuery.ajax(url) + .done(function (manifest) { + if (manifest) { + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].dependencies + ) { + if (manifest[\\"sap.ui5\\"].dependencies.libs) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + } + if (manifest[\\"sap.ui5\\"].dependencies.components) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + } } - if (manifest[\\"sap.ui5\\"].dependencies.components) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].componentUsages + ) { + result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); } } - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].componentUsages - ) { - result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); - } - } - resolve(result); - }) - .fail(function () { - reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); - }); + resolve(result); + }) + .fail(function () { + reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); + }); + }); }); }; function registerModules(dataFromAppIndex) { @@ -35755,18 +36018,19 @@ if (parseInt(version[0], 10) <= 1 && parseInt(version[1], 10) < 78) { return new Promise( function (resolve) { - sap.ui.require([\\"sap/base/util/UriParameters\\"], function (UriParameters) { - sapClient = UriParameters.fromQuery(window.location.search).get(\\"sap-client\\"); - if (sapClient && sapClient.length === 3) { - url = url + \\"&sap-client=\\" + sapClient; - } - resolve(url); - }); + sapClient = new URLSearchParams(window.location.search).get(\\"sap-client\\"); + if (sapClient && sapClient.length === 3) { + url = url + \\"&sap-client=\\" + sapClient; + } + resolve(url); }).then(function (url2) { - return $.ajax(url2).done(function (data) { - if (data) { - registerModules(data); - } + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + return localJQuery.ajax(url2) + .done(function (data) { + if (data) { + registerModules(data); + } + }); }); }); } else { @@ -35804,6 +36068,10 @@ var manifestUri = currentScript.getAttribute(\\"data-sap-ui-manifest-uri\\"); var componentName = currentScript.getAttribute(\\"data-sap-ui-componentName\\"); var useMockserver = currentScript.getAttribute(\\"data-sap-ui-use-mockserver\\"); +// Patch (KW): resourceRoot is needed to load the correct ResourceBundles +var resourceRoot = manifestUri.substring(0, manifestUri.lastIndexOf('/')+1); + + sap.registerComponentDependencyPaths(manifestUri) .catch(function (error) { sap.ui.require([\\"sap/base/Log\\"], function (Log) { @@ -35813,57 +36081,75 @@ sap.registerComponentDependencyPaths(manifestUri) .finally(function () { // setting the app title with internationalization - sap.ui.getCore().attachInit(function () { - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); - if (componentName && componentName.length > 0) { + if (componentName && componentName.length > 0) { if (useMockserver && useMockserver === \\"true\\") { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { - // set up test service for local testing - server.init(); - // initialize the ushell sandbox component - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - }); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { + // set up test service for local testing + server.init(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + }); + }); + }); }); } else { // Requiring the ComponentSupport module automatically executes the component initialisation for all declaratively defined components sap.ui.require([\\"sap/ui/core/ComponentSupport\\"]); // setting the app title with the i18n text - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); } } else { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - try { - // initialize the ushell sandbox component in ui5 v2 - sap.ushell.Container.createRenderer(true).then(function (component) { - component.placeAt(\\"content\\"); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + try { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + } catch (error) { + // support older versions of ui5 + Container.createRenderer().placeAt(\\"content\\"); + } }); - } catch { - // support older versions of ui5 - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - } + }); }); } });", @@ -42665,32 +42951,35 @@ if (parseInt(version[0], 10) <= 1 && parseInt(version[1], 10) < 78) { return libOrCompKeysStringTmp; } return new Promise(function (resolve, reject) { - $.ajax(url) - .done(function (manifest) { - if (manifest) { - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].dependencies - ) { - if (manifest[\\"sap.ui5\\"].dependencies.libs) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + localJQuery.ajax(url) + .done(function (manifest) { + if (manifest) { + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].dependencies + ) { + if (manifest[\\"sap.ui5\\"].dependencies.libs) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + } + if (manifest[\\"sap.ui5\\"].dependencies.components) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + } } - if (manifest[\\"sap.ui5\\"].dependencies.components) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].componentUsages + ) { + result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); } } - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].componentUsages - ) { - result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); - } - } - resolve(result); - }) - .fail(function () { - reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); - }); + resolve(result); + }) + .fail(function () { + reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); + }); + }); }); }; function registerModules(dataFromAppIndex) { @@ -42733,18 +43022,19 @@ if (parseInt(version[0], 10) <= 1 && parseInt(version[1], 10) < 78) { return new Promise( function (resolve) { - sap.ui.require([\\"sap/base/util/UriParameters\\"], function (UriParameters) { - sapClient = UriParameters.fromQuery(window.location.search).get(\\"sap-client\\"); - if (sapClient && sapClient.length === 3) { - url = url + \\"&sap-client=\\" + sapClient; - } - resolve(url); - }); + sapClient = new URLSearchParams(window.location.search).get(\\"sap-client\\"); + if (sapClient && sapClient.length === 3) { + url = url + \\"&sap-client=\\" + sapClient; + } + resolve(url); }).then(function (url2) { - return $.ajax(url2).done(function (data) { - if (data) { - registerModules(data); - } + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + return localJQuery.ajax(url2) + .done(function (data) { + if (data) { + registerModules(data); + } + }); }); }); } else { @@ -42782,6 +43072,10 @@ var manifestUri = currentScript.getAttribute(\\"data-sap-ui-manifest-uri\\"); var componentName = currentScript.getAttribute(\\"data-sap-ui-componentName\\"); var useMockserver = currentScript.getAttribute(\\"data-sap-ui-use-mockserver\\"); +// Patch (KW): resourceRoot is needed to load the correct ResourceBundles +var resourceRoot = manifestUri.substring(0, manifestUri.lastIndexOf('/')+1); + + sap.registerComponentDependencyPaths(manifestUri) .catch(function (error) { sap.ui.require([\\"sap/base/Log\\"], function (Log) { @@ -42791,57 +43085,75 @@ sap.registerComponentDependencyPaths(manifestUri) .finally(function () { // setting the app title with internationalization - sap.ui.getCore().attachInit(function () { - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); - if (componentName && componentName.length > 0) { + if (componentName && componentName.length > 0) { if (useMockserver && useMockserver === \\"true\\") { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { - // set up test service for local testing - server.init(); - // initialize the ushell sandbox component - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - }); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { + // set up test service for local testing + server.init(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + }); + }); + }); }); } else { // Requiring the ComponentSupport module automatically executes the component initialisation for all declaratively defined components sap.ui.require([\\"sap/ui/core/ComponentSupport\\"]); // setting the app title with the i18n text - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); } } else { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - try { - // initialize the ushell sandbox component in ui5 v2 - sap.ushell.Container.createRenderer(true).then(function (component) { - component.placeAt(\\"content\\"); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + try { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + } catch (error) { + // support older versions of ui5 + Container.createRenderer().placeAt(\\"content\\"); + } }); - } catch { - // support older versions of ui5 - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - } + }); }); } });", @@ -46274,32 +46586,35 @@ if (parseInt(version[0], 10) <= 1 && parseInt(version[1], 10) < 78) { return libOrCompKeysStringTmp; } return new Promise(function (resolve, reject) { - $.ajax(url) - .done(function (manifest) { - if (manifest) { - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].dependencies - ) { - if (manifest[\\"sap.ui5\\"].dependencies.libs) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + localJQuery.ajax(url) + .done(function (manifest) { + if (manifest) { + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].dependencies + ) { + if (manifest[\\"sap.ui5\\"].dependencies.libs) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + } + if (manifest[\\"sap.ui5\\"].dependencies.components) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + } } - if (manifest[\\"sap.ui5\\"].dependencies.components) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].componentUsages + ) { + result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); } } - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].componentUsages - ) { - result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); - } - } - resolve(result); - }) - .fail(function () { - reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); - }); + resolve(result); + }) + .fail(function () { + reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); + }); + }); }); }; function registerModules(dataFromAppIndex) { @@ -46342,18 +46657,19 @@ if (parseInt(version[0], 10) <= 1 && parseInt(version[1], 10) < 78) { return new Promise( function (resolve) { - sap.ui.require([\\"sap/base/util/UriParameters\\"], function (UriParameters) { - sapClient = UriParameters.fromQuery(window.location.search).get(\\"sap-client\\"); - if (sapClient && sapClient.length === 3) { - url = url + \\"&sap-client=\\" + sapClient; - } - resolve(url); - }); + sapClient = new URLSearchParams(window.location.search).get(\\"sap-client\\"); + if (sapClient && sapClient.length === 3) { + url = url + \\"&sap-client=\\" + sapClient; + } + resolve(url); }).then(function (url2) { - return $.ajax(url2).done(function (data) { - if (data) { - registerModules(data); - } + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + return localJQuery.ajax(url2) + .done(function (data) { + if (data) { + registerModules(data); + } + }); }); }); } else { @@ -46391,6 +46707,10 @@ var manifestUri = currentScript.getAttribute(\\"data-sap-ui-manifest-uri\\"); var componentName = currentScript.getAttribute(\\"data-sap-ui-componentName\\"); var useMockserver = currentScript.getAttribute(\\"data-sap-ui-use-mockserver\\"); +// Patch (KW): resourceRoot is needed to load the correct ResourceBundles +var resourceRoot = manifestUri.substring(0, manifestUri.lastIndexOf('/')+1); + + sap.registerComponentDependencyPaths(manifestUri) .catch(function (error) { sap.ui.require([\\"sap/base/Log\\"], function (Log) { @@ -46400,57 +46720,75 @@ sap.registerComponentDependencyPaths(manifestUri) .finally(function () { // setting the app title with internationalization - sap.ui.getCore().attachInit(function () { - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); - if (componentName && componentName.length > 0) { + if (componentName && componentName.length > 0) { if (useMockserver && useMockserver === \\"true\\") { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { - // set up test service for local testing - server.init(); - // initialize the ushell sandbox component - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - }); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { + // set up test service for local testing + server.init(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + }); + }); + }); }); } else { // Requiring the ComponentSupport module automatically executes the component initialisation for all declaratively defined components sap.ui.require([\\"sap/ui/core/ComponentSupport\\"]); // setting the app title with the i18n text - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); } } else { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - try { - // initialize the ushell sandbox component in ui5 v2 - sap.ushell.Container.createRenderer(true).then(function (component) { - component.placeAt(\\"content\\"); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + try { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + } catch (error) { + // support older versions of ui5 + Container.createRenderer().placeAt(\\"content\\"); + } }); - } catch { - // support older versions of ui5 - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - } + }); }); } });", diff --git a/packages/fiori-elements-writer/test/__snapshots__/ovp.test.ts.snap b/packages/fiori-elements-writer/test/__snapshots__/ovp.test.ts.snap index bf146b9a06..ed45187ec3 100644 --- a/packages/fiori-elements-writer/test/__snapshots__/ovp.test.ts.snap +++ b/packages/fiori-elements-writer/test/__snapshots__/ovp.test.ts.snap @@ -1493,32 +1493,35 @@ if (parseInt(version[0], 10) <= 1 && parseInt(version[1], 10) < 78) { return libOrCompKeysStringTmp; } return new Promise(function (resolve, reject) { - $.ajax(url) - .done(function (manifest) { - if (manifest) { - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].dependencies - ) { - if (manifest[\\"sap.ui5\\"].dependencies.libs) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + localJQuery.ajax(url) + .done(function (manifest) { + if (manifest) { + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].dependencies + ) { + if (manifest[\\"sap.ui5\\"].dependencies.libs) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + } + if (manifest[\\"sap.ui5\\"].dependencies.components) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + } } - if (manifest[\\"sap.ui5\\"].dependencies.components) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].componentUsages + ) { + result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); } } - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].componentUsages - ) { - result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); - } - } - resolve(result); - }) - .fail(function () { - reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); - }); + resolve(result); + }) + .fail(function () { + reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); + }); + }); }); }; function registerModules(dataFromAppIndex) { @@ -1561,18 +1564,19 @@ if (parseInt(version[0], 10) <= 1 && parseInt(version[1], 10) < 78) { return new Promise( function (resolve) { - sap.ui.require([\\"sap/base/util/UriParameters\\"], function (UriParameters) { - sapClient = UriParameters.fromQuery(window.location.search).get(\\"sap-client\\"); - if (sapClient && sapClient.length === 3) { - url = url + \\"&sap-client=\\" + sapClient; - } - resolve(url); - }); + sapClient = new URLSearchParams(window.location.search).get(\\"sap-client\\"); + if (sapClient && sapClient.length === 3) { + url = url + \\"&sap-client=\\" + sapClient; + } + resolve(url); }).then(function (url2) { - return $.ajax(url2).done(function (data) { - if (data) { - registerModules(data); - } + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + return localJQuery.ajax(url2) + .done(function (data) { + if (data) { + registerModules(data); + } + }); }); }); } else { @@ -1610,6 +1614,10 @@ var manifestUri = currentScript.getAttribute(\\"data-sap-ui-manifest-uri\\"); var componentName = currentScript.getAttribute(\\"data-sap-ui-componentName\\"); var useMockserver = currentScript.getAttribute(\\"data-sap-ui-use-mockserver\\"); +// Patch (KW): resourceRoot is needed to load the correct ResourceBundles +var resourceRoot = manifestUri.substring(0, manifestUri.lastIndexOf('/')+1); + + sap.registerComponentDependencyPaths(manifestUri) .catch(function (error) { sap.ui.require([\\"sap/base/Log\\"], function (Log) { @@ -1619,57 +1627,75 @@ sap.registerComponentDependencyPaths(manifestUri) .finally(function () { // setting the app title with internationalization - sap.ui.getCore().attachInit(function () { - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); - if (componentName && componentName.length > 0) { + if (componentName && componentName.length > 0) { if (useMockserver && useMockserver === \\"true\\") { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { - // set up test service for local testing - server.init(); - // initialize the ushell sandbox component - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - }); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { + // set up test service for local testing + server.init(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + }); + }); + }); }); } else { // Requiring the ComponentSupport module automatically executes the component initialisation for all declaratively defined components sap.ui.require([\\"sap/ui/core/ComponentSupport\\"]); // setting the app title with the i18n text - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); } } else { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - try { - // initialize the ushell sandbox component in ui5 v2 - sap.ushell.Container.createRenderer(true).then(function (component) { - component.placeAt(\\"content\\"); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + try { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + } catch (error) { + // support older versions of ui5 + Container.createRenderer().placeAt(\\"content\\"); + } }); - } catch { - // support older versions of ui5 - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - } + }); }); } });", @@ -8962,32 +8988,35 @@ appDescription=A Fiori application.", return libOrCompKeysStringTmp; } return new Promise(function (resolve, reject) { - $.ajax(url) - .done(function (manifest) { - if (manifest) { - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].dependencies - ) { - if (manifest[\\"sap.ui5\\"].dependencies.libs) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + localJQuery.ajax(url) + .done(function (manifest) { + if (manifest) { + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].dependencies + ) { + if (manifest[\\"sap.ui5\\"].dependencies.libs) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + } + if (manifest[\\"sap.ui5\\"].dependencies.components) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + } } - if (manifest[\\"sap.ui5\\"].dependencies.components) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].componentUsages + ) { + result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); } } - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].componentUsages - ) { - result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); - } - } - resolve(result); - }) - .fail(function () { - reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); - }); + resolve(result); + }) + .fail(function () { + reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); + }); + }); }); }; function registerModules(dataFromAppIndex) { @@ -9030,18 +9059,19 @@ appDescription=A Fiori application.", return new Promise( function (resolve) { - sap.ui.require([\\"sap/base/util/UriParameters\\"], function (UriParameters) { - sapClient = UriParameters.fromQuery(window.location.search).get(\\"sap-client\\"); - if (sapClient && sapClient.length === 3) { - url = url + \\"&sap-client=\\" + sapClient; - } - resolve(url); - }); + sapClient = new URLSearchParams(window.location.search).get(\\"sap-client\\"); + if (sapClient && sapClient.length === 3) { + url = url + \\"&sap-client=\\" + sapClient; + } + resolve(url); }).then(function (url2) { - return $.ajax(url2).done(function (data) { - if (data) { - registerModules(data); - } + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + return localJQuery.ajax(url2) + .done(function (data) { + if (data) { + registerModules(data); + } + }); }); }); } else { @@ -9079,6 +9109,10 @@ var manifestUri = currentScript.getAttribute(\\"data-sap-ui-manifest-uri\\"); var componentName = currentScript.getAttribute(\\"data-sap-ui-componentName\\"); var useMockserver = currentScript.getAttribute(\\"data-sap-ui-use-mockserver\\"); +// Patch (KW): resourceRoot is needed to load the correct ResourceBundles +var resourceRoot = manifestUri.substring(0, manifestUri.lastIndexOf('/')+1); + + sap.registerComponentDependencyPaths(manifestUri) .catch(function (error) { sap.ui.require([\\"sap/base/Log\\"], function (Log) { @@ -9088,57 +9122,75 @@ sap.registerComponentDependencyPaths(manifestUri) .finally(function () { // setting the app title with internationalization - sap.ui.getCore().attachInit(function () { - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); - if (componentName && componentName.length > 0) { + if (componentName && componentName.length > 0) { if (useMockserver && useMockserver === \\"true\\") { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { - // set up test service for local testing - server.init(); - // initialize the ushell sandbox component - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - }); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { + // set up test service for local testing + server.init(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + }); + }); + }); }); } else { // Requiring the ComponentSupport module automatically executes the component initialisation for all declaratively defined components sap.ui.require([\\"sap/ui/core/ComponentSupport\\"]); // setting the app title with the i18n text - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); } } else { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - try { - // initialize the ushell sandbox component in ui5 v2 - sap.ushell.Container.createRenderer(true).then(function (component) { - component.placeAt(\\"content\\"); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + try { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + } catch (error) { + // support older versions of ui5 + Container.createRenderer().placeAt(\\"content\\"); + } }); - } catch { - // support older versions of ui5 - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - } + }); }); } });", diff --git a/packages/fiori-elements-writer/test/__snapshots__/worklist.test.ts.snap b/packages/fiori-elements-writer/test/__snapshots__/worklist.test.ts.snap index ae3cb61ce5..e9ed3d771e 100644 --- a/packages/fiori-elements-writer/test/__snapshots__/worklist.test.ts.snap +++ b/packages/fiori-elements-writer/test/__snapshots__/worklist.test.ts.snap @@ -3431,32 +3431,35 @@ if (parseInt(version[0], 10) <= 1 && parseInt(version[1], 10) < 78) { return libOrCompKeysStringTmp; } return new Promise(function (resolve, reject) { - $.ajax(url) - .done(function (manifest) { - if (manifest) { - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].dependencies - ) { - if (manifest[\\"sap.ui5\\"].dependencies.libs) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + localJQuery.ajax(url) + .done(function (manifest) { + if (manifest) { + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].dependencies + ) { + if (manifest[\\"sap.ui5\\"].dependencies.libs) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + } + if (manifest[\\"sap.ui5\\"].dependencies.components) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + } } - if (manifest[\\"sap.ui5\\"].dependencies.components) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].componentUsages + ) { + result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); } } - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].componentUsages - ) { - result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); - } - } - resolve(result); - }) - .fail(function () { - reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); - }); + resolve(result); + }) + .fail(function () { + reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); + }); + }); }); }; function registerModules(dataFromAppIndex) { @@ -3499,18 +3502,19 @@ if (parseInt(version[0], 10) <= 1 && parseInt(version[1], 10) < 78) { return new Promise( function (resolve) { - sap.ui.require([\\"sap/base/util/UriParameters\\"], function (UriParameters) { - sapClient = UriParameters.fromQuery(window.location.search).get(\\"sap-client\\"); - if (sapClient && sapClient.length === 3) { - url = url + \\"&sap-client=\\" + sapClient; - } - resolve(url); - }); + sapClient = new URLSearchParams(window.location.search).get(\\"sap-client\\"); + if (sapClient && sapClient.length === 3) { + url = url + \\"&sap-client=\\" + sapClient; + } + resolve(url); }).then(function (url2) { - return $.ajax(url2).done(function (data) { - if (data) { - registerModules(data); - } + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + return localJQuery.ajax(url2) + .done(function (data) { + if (data) { + registerModules(data); + } + }); }); }); } else { @@ -3548,6 +3552,10 @@ var manifestUri = currentScript.getAttribute(\\"data-sap-ui-manifest-uri\\"); var componentName = currentScript.getAttribute(\\"data-sap-ui-componentName\\"); var useMockserver = currentScript.getAttribute(\\"data-sap-ui-use-mockserver\\"); +// Patch (KW): resourceRoot is needed to load the correct ResourceBundles +var resourceRoot = manifestUri.substring(0, manifestUri.lastIndexOf('/')+1); + + sap.registerComponentDependencyPaths(manifestUri) .catch(function (error) { sap.ui.require([\\"sap/base/Log\\"], function (Log) { @@ -3557,57 +3565,75 @@ sap.registerComponentDependencyPaths(manifestUri) .finally(function () { // setting the app title with internationalization - sap.ui.getCore().attachInit(function () { - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); - if (componentName && componentName.length > 0) { + if (componentName && componentName.length > 0) { if (useMockserver && useMockserver === \\"true\\") { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { - // set up test service for local testing - server.init(); - // initialize the ushell sandbox component - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - }); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { + // set up test service for local testing + server.init(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + }); + }); + }); }); } else { // Requiring the ComponentSupport module automatically executes the component initialisation for all declaratively defined components sap.ui.require([\\"sap/ui/core/ComponentSupport\\"]); // setting the app title with the i18n text - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); } } else { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - try { - // initialize the ushell sandbox component in ui5 v2 - sap.ushell.Container.createRenderer(true).then(function (component) { - component.placeAt(\\"content\\"); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + try { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + } catch (error) { + // support older versions of ui5 + Container.createRenderer().placeAt(\\"content\\"); + } }); - } catch { - // support older versions of ui5 - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - } + }); }); } });", @@ -7047,32 +7073,35 @@ if (parseInt(version[0], 10) <= 1 && parseInt(version[1], 10) < 78) { return libOrCompKeysStringTmp; } return new Promise(function (resolve, reject) { - $.ajax(url) - .done(function (manifest) { - if (manifest) { - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].dependencies - ) { - if (manifest[\\"sap.ui5\\"].dependencies.libs) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + localJQuery.ajax(url) + .done(function (manifest) { + if (manifest) { + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].dependencies + ) { + if (manifest[\\"sap.ui5\\"].dependencies.libs) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + } + if (manifest[\\"sap.ui5\\"].dependencies.components) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + } } - if (manifest[\\"sap.ui5\\"].dependencies.components) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].componentUsages + ) { + result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); } } - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].componentUsages - ) { - result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); - } - } - resolve(result); - }) - .fail(function () { - reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); - }); + resolve(result); + }) + .fail(function () { + reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); + }); + }); }); }; function registerModules(dataFromAppIndex) { @@ -7115,18 +7144,19 @@ if (parseInt(version[0], 10) <= 1 && parseInt(version[1], 10) < 78) { return new Promise( function (resolve) { - sap.ui.require([\\"sap/base/util/UriParameters\\"], function (UriParameters) { - sapClient = UriParameters.fromQuery(window.location.search).get(\\"sap-client\\"); - if (sapClient && sapClient.length === 3) { - url = url + \\"&sap-client=\\" + sapClient; - } - resolve(url); - }); + sapClient = new URLSearchParams(window.location.search).get(\\"sap-client\\"); + if (sapClient && sapClient.length === 3) { + url = url + \\"&sap-client=\\" + sapClient; + } + resolve(url); }).then(function (url2) { - return $.ajax(url2).done(function (data) { - if (data) { - registerModules(data); - } + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + return localJQuery.ajax(url2) + .done(function (data) { + if (data) { + registerModules(data); + } + }); }); }); } else { @@ -7164,6 +7194,10 @@ var manifestUri = currentScript.getAttribute(\\"data-sap-ui-manifest-uri\\"); var componentName = currentScript.getAttribute(\\"data-sap-ui-componentName\\"); var useMockserver = currentScript.getAttribute(\\"data-sap-ui-use-mockserver\\"); +// Patch (KW): resourceRoot is needed to load the correct ResourceBundles +var resourceRoot = manifestUri.substring(0, manifestUri.lastIndexOf('/')+1); + + sap.registerComponentDependencyPaths(manifestUri) .catch(function (error) { sap.ui.require([\\"sap/base/Log\\"], function (Log) { @@ -7173,57 +7207,75 @@ sap.registerComponentDependencyPaths(manifestUri) .finally(function () { // setting the app title with internationalization - sap.ui.getCore().attachInit(function () { - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); - if (componentName && componentName.length > 0) { + if (componentName && componentName.length > 0) { if (useMockserver && useMockserver === \\"true\\") { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { - // set up test service for local testing - server.init(); - // initialize the ushell sandbox component - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - }); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { + // set up test service for local testing + server.init(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + }); + }); + }); }); } else { // Requiring the ComponentSupport module automatically executes the component initialisation for all declaratively defined components sap.ui.require([\\"sap/ui/core/ComponentSupport\\"]); // setting the app title with the i18n text - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); } } else { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - try { - // initialize the ushell sandbox component in ui5 v2 - sap.ushell.Container.createRenderer(true).then(function (component) { - component.placeAt(\\"content\\"); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + try { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + } catch (error) { + // support older versions of ui5 + Container.createRenderer().placeAt(\\"content\\"); + } }); - } catch { - // support older versions of ui5 - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - } + }); }); } });", @@ -10715,32 +10767,35 @@ EntityType=\\"com.sap.gateway.srvd.dmo.sd_travel_mduu.v0001.TravelAgencyType\\"> return libOrCompKeysStringTmp; } return new Promise(function (resolve, reject) { - $.ajax(url) - .done(function (manifest) { - if (manifest) { - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].dependencies - ) { - if (manifest[\\"sap.ui5\\"].dependencies.libs) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + localJQuery.ajax(url) + .done(function (manifest) { + if (manifest) { + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].dependencies + ) { + if (manifest[\\"sap.ui5\\"].dependencies.libs) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + } + if (manifest[\\"sap.ui5\\"].dependencies.components) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + } } - if (manifest[\\"sap.ui5\\"].dependencies.components) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].componentUsages + ) { + result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); } } - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].componentUsages - ) { - result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); - } - } - resolve(result); - }) - .fail(function () { - reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); - }); + resolve(result); + }) + .fail(function () { + reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); + }); + }); }); }; function registerModules(dataFromAppIndex) { @@ -10783,18 +10838,19 @@ EntityType=\\"com.sap.gateway.srvd.dmo.sd_travel_mduu.v0001.TravelAgencyType\\"> return new Promise( function (resolve) { - sap.ui.require([\\"sap/base/util/UriParameters\\"], function (UriParameters) { - sapClient = UriParameters.fromQuery(window.location.search).get(\\"sap-client\\"); - if (sapClient && sapClient.length === 3) { - url = url + \\"&sap-client=\\" + sapClient; - } - resolve(url); - }); + sapClient = new URLSearchParams(window.location.search).get(\\"sap-client\\"); + if (sapClient && sapClient.length === 3) { + url = url + \\"&sap-client=\\" + sapClient; + } + resolve(url); }).then(function (url2) { - return $.ajax(url2).done(function (data) { - if (data) { - registerModules(data); - } + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + return localJQuery.ajax(url2) + .done(function (data) { + if (data) { + registerModules(data); + } + }); }); }); } else { @@ -10832,6 +10888,10 @@ var manifestUri = currentScript.getAttribute(\\"data-sap-ui-manifest-uri\\"); var componentName = currentScript.getAttribute(\\"data-sap-ui-componentName\\"); var useMockserver = currentScript.getAttribute(\\"data-sap-ui-use-mockserver\\"); +// Patch (KW): resourceRoot is needed to load the correct ResourceBundles +var resourceRoot = manifestUri.substring(0, manifestUri.lastIndexOf('/')+1); + + sap.registerComponentDependencyPaths(manifestUri) .catch(function (error) { sap.ui.require([\\"sap/base/Log\\"], function (Log) { @@ -10841,57 +10901,75 @@ sap.registerComponentDependencyPaths(manifestUri) .finally(function () { // setting the app title with internationalization - sap.ui.getCore().attachInit(function () { - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); - if (componentName && componentName.length > 0) { + if (componentName && componentName.length > 0) { if (useMockserver && useMockserver === \\"true\\") { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { - // set up test service for local testing - server.init(); - // initialize the ushell sandbox component - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - }); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { + // set up test service for local testing + server.init(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + }); + }); + }); }); } else { // Requiring the ComponentSupport module automatically executes the component initialisation for all declaratively defined components sap.ui.require([\\"sap/ui/core/ComponentSupport\\"]); // setting the app title with the i18n text - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); } } else { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - try { - // initialize the ushell sandbox component in ui5 v2 - sap.ushell.Container.createRenderer(true).then(function (component) { - component.placeAt(\\"content\\"); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + try { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + } catch (error) { + // support older versions of ui5 + Container.createRenderer().placeAt(\\"content\\"); + } }); - } catch { - // support older versions of ui5 - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - } + }); }); } });", @@ -14547,32 +14625,35 @@ EntityType=\\"com.sap.gateway.srvd.dmo.sd_travel_mduu.v0001.TravelAgencyType\\"> return libOrCompKeysStringTmp; } return new Promise(function (resolve, reject) { - $.ajax(url) - .done(function (manifest) { - if (manifest) { - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].dependencies - ) { - if (manifest[\\"sap.ui5\\"].dependencies.libs) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + localJQuery.ajax(url) + .done(function (manifest) { + if (manifest) { + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].dependencies + ) { + if (manifest[\\"sap.ui5\\"].dependencies.libs) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + } + if (manifest[\\"sap.ui5\\"].dependencies.components) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + } } - if (manifest[\\"sap.ui5\\"].dependencies.components) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].componentUsages + ) { + result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); } } - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].componentUsages - ) { - result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); - } - } - resolve(result); - }) - .fail(function () { - reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); - }); + resolve(result); + }) + .fail(function () { + reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); + }); + }); }); }; function registerModules(dataFromAppIndex) { @@ -14615,18 +14696,19 @@ EntityType=\\"com.sap.gateway.srvd.dmo.sd_travel_mduu.v0001.TravelAgencyType\\"> return new Promise( function (resolve) { - sap.ui.require([\\"sap/base/util/UriParameters\\"], function (UriParameters) { - sapClient = UriParameters.fromQuery(window.location.search).get(\\"sap-client\\"); - if (sapClient && sapClient.length === 3) { - url = url + \\"&sap-client=\\" + sapClient; - } - resolve(url); - }); + sapClient = new URLSearchParams(window.location.search).get(\\"sap-client\\"); + if (sapClient && sapClient.length === 3) { + url = url + \\"&sap-client=\\" + sapClient; + } + resolve(url); }).then(function (url2) { - return $.ajax(url2).done(function (data) { - if (data) { - registerModules(data); - } + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + return localJQuery.ajax(url2) + .done(function (data) { + if (data) { + registerModules(data); + } + }); }); }); } else { @@ -14664,6 +14746,10 @@ var manifestUri = currentScript.getAttribute(\\"data-sap-ui-manifest-uri\\"); var componentName = currentScript.getAttribute(\\"data-sap-ui-componentName\\"); var useMockserver = currentScript.getAttribute(\\"data-sap-ui-use-mockserver\\"); +// Patch (KW): resourceRoot is needed to load the correct ResourceBundles +var resourceRoot = manifestUri.substring(0, manifestUri.lastIndexOf('/')+1); + + sap.registerComponentDependencyPaths(manifestUri) .catch(function (error) { sap.ui.require([\\"sap/base/Log\\"], function (Log) { @@ -14673,57 +14759,75 @@ sap.registerComponentDependencyPaths(manifestUri) .finally(function () { // setting the app title with internationalization - sap.ui.getCore().attachInit(function () { - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); - if (componentName && componentName.length > 0) { + if (componentName && componentName.length > 0) { if (useMockserver && useMockserver === \\"true\\") { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { - // set up test service for local testing - server.init(); - // initialize the ushell sandbox component - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - }); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { + // set up test service for local testing + server.init(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + }); + }); + }); }); } else { // Requiring the ComponentSupport module automatically executes the component initialisation for all declaratively defined components sap.ui.require([\\"sap/ui/core/ComponentSupport\\"]); // setting the app title with the i18n text - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); } } else { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - try { - // initialize the ushell sandbox component in ui5 v2 - sap.ushell.Container.createRenderer(true).then(function (component) { - component.placeAt(\\"content\\"); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + try { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + } catch (error) { + // support older versions of ui5 + Container.createRenderer().placeAt(\\"content\\"); + } }); - } catch { - // support older versions of ui5 - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - } + }); }); } });", diff --git a/packages/fiori-elements-writer/test/common.ts b/packages/fiori-elements-writer/test/common.ts index c042d25a48..dd1f08c15d 100644 --- a/packages/fiori-elements-writer/test/common.ts +++ b/packages/fiori-elements-writer/test/common.ts @@ -166,7 +166,7 @@ export const projectChecks = async ( debugFull = false ): Promise => { if (debugFull && (config.appOptions?.typescript ?? config.appOptions?.eslint)) { - // Do additonal checks on generated projects + // Do additional checks on generated projects const npm = process.platform === 'win32' ? 'npm.cmd' : 'npm'; let npmResult; try { @@ -192,6 +192,10 @@ export const projectChecks = async ( console.log('stdout:', npmResult.stdout); console.log('stderr:', npmResult.stderr); } + // Check UI5 Linter + npmResult = await exec(`npx @ui5/linter`, { cwd: rootPath }); + console.log('stdout:', npmResult.stdout); + console.log('stderr:', npmResult.stderr); } catch (error) { console.log('stdout:', error?.stdout); console.log('stderr:', error?.stderr); diff --git a/packages/fiori-freestyle-writer/test/__snapshots__/basic.test.ts.snap b/packages/fiori-freestyle-writer/test/__snapshots__/basic.test.ts.snap index a6b40470ea..9bb5b6361b 100644 --- a/packages/fiori-freestyle-writer/test/__snapshots__/basic.test.ts.snap +++ b/packages/fiori-freestyle-writer/test/__snapshots__/basic.test.ts.snap @@ -471,32 +471,35 @@ function (JSONModel, Device) { return libOrCompKeysStringTmp; } return new Promise(function (resolve, reject) { - $.ajax(url) - .done(function (manifest) { - if (manifest) { - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].dependencies - ) { - if (manifest[\\"sap.ui5\\"].dependencies.libs) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + localJQuery.ajax(url) + .done(function (manifest) { + if (manifest) { + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].dependencies + ) { + if (manifest[\\"sap.ui5\\"].dependencies.libs) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + } + if (manifest[\\"sap.ui5\\"].dependencies.components) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + } } - if (manifest[\\"sap.ui5\\"].dependencies.components) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].componentUsages + ) { + result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); } } - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].componentUsages - ) { - result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); - } - } - resolve(result); - }) - .fail(function () { - reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); - }); + resolve(result); + }) + .fail(function () { + reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); + }); + }); }); }; function registerModules(dataFromAppIndex) { @@ -539,18 +542,19 @@ function (JSONModel, Device) { return new Promise( function (resolve) { - sap.ui.require([\\"sap/base/util/UriParameters\\"], function (UriParameters) { - sapClient = UriParameters.fromQuery(window.location.search).get(\\"sap-client\\"); - if (sapClient && sapClient.length === 3) { - url = url + \\"&sap-client=\\" + sapClient; - } - resolve(url); - }); + sapClient = new URLSearchParams(window.location.search).get(\\"sap-client\\"); + if (sapClient && sapClient.length === 3) { + url = url + \\"&sap-client=\\" + sapClient; + } + resolve(url); }).then(function (url2) { - return $.ajax(url2).done(function (data) { - if (data) { - registerModules(data); - } + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + return localJQuery.ajax(url2) + .done(function (data) { + if (data) { + registerModules(data); + } + }); }); }); } else { @@ -588,6 +592,10 @@ var manifestUri = currentScript.getAttribute(\\"data-sap-ui-manifest-uri\\"); var componentName = currentScript.getAttribute(\\"data-sap-ui-componentName\\"); var useMockserver = currentScript.getAttribute(\\"data-sap-ui-use-mockserver\\"); +// Patch (KW): resourceRoot is needed to load the correct ResourceBundles +var resourceRoot = manifestUri.substring(0, manifestUri.lastIndexOf('/')+1); + + sap.registerComponentDependencyPaths(manifestUri) .catch(function (error) { sap.ui.require([\\"sap/base/Log\\"], function (Log) { @@ -597,57 +605,75 @@ sap.registerComponentDependencyPaths(manifestUri) .finally(function () { // setting the app title with internationalization - sap.ui.getCore().attachInit(function () { - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); - if (componentName && componentName.length > 0) { + if (componentName && componentName.length > 0) { if (useMockserver && useMockserver === \\"true\\") { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { - // set up test service for local testing - server.init(); - // initialize the ushell sandbox component - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - }); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { + // set up test service for local testing + server.init(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + }); + }); + }); }); } else { // Requiring the ComponentSupport module automatically executes the component initialisation for all declaratively defined components sap.ui.require([\\"sap/ui/core/ComponentSupport\\"]); // setting the app title with the i18n text - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); } } else { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - try { - // initialize the ushell sandbox component in ui5 v2 - sap.ushell.Container.createRenderer(true).then(function (component) { - component.placeAt(\\"content\\"); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + try { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + } catch (error) { + // support older versions of ui5 + Container.createRenderer().placeAt(\\"content\\"); + } }); - } catch { - // support older versions of ui5 - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - } + }); }); } });", @@ -1187,32 +1213,35 @@ export function createDeviceModel () { return libOrCompKeysStringTmp; } return new Promise(function (resolve, reject) { - $.ajax(url) - .done(function (manifest) { - if (manifest) { - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].dependencies - ) { - if (manifest[\\"sap.ui5\\"].dependencies.libs) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + localJQuery.ajax(url) + .done(function (manifest) { + if (manifest) { + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].dependencies + ) { + if (manifest[\\"sap.ui5\\"].dependencies.libs) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + } + if (manifest[\\"sap.ui5\\"].dependencies.components) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + } } - if (manifest[\\"sap.ui5\\"].dependencies.components) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].componentUsages + ) { + result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); } } - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].componentUsages - ) { - result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); - } - } - resolve(result); - }) - .fail(function () { - reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); - }); + resolve(result); + }) + .fail(function () { + reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); + }); + }); }); }; function registerModules(dataFromAppIndex) { @@ -1255,18 +1284,19 @@ export function createDeviceModel () { return new Promise( function (resolve) { - sap.ui.require([\\"sap/base/util/UriParameters\\"], function (UriParameters) { - sapClient = UriParameters.fromQuery(window.location.search).get(\\"sap-client\\"); - if (sapClient && sapClient.length === 3) { - url = url + \\"&sap-client=\\" + sapClient; - } - resolve(url); - }); + sapClient = new URLSearchParams(window.location.search).get(\\"sap-client\\"); + if (sapClient && sapClient.length === 3) { + url = url + \\"&sap-client=\\" + sapClient; + } + resolve(url); }).then(function (url2) { - return $.ajax(url2).done(function (data) { - if (data) { - registerModules(data); - } + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + return localJQuery.ajax(url2) + .done(function (data) { + if (data) { + registerModules(data); + } + }); }); }); } else { @@ -1304,6 +1334,10 @@ var manifestUri = currentScript.getAttribute(\\"data-sap-ui-manifest-uri\\"); var componentName = currentScript.getAttribute(\\"data-sap-ui-componentName\\"); var useMockserver = currentScript.getAttribute(\\"data-sap-ui-use-mockserver\\"); +// Patch (KW): resourceRoot is needed to load the correct ResourceBundles +var resourceRoot = manifestUri.substring(0, manifestUri.lastIndexOf('/')+1); + + sap.registerComponentDependencyPaths(manifestUri) .catch(function (error) { sap.ui.require([\\"sap/base/Log\\"], function (Log) { @@ -1313,57 +1347,75 @@ sap.registerComponentDependencyPaths(manifestUri) .finally(function () { // setting the app title with internationalization - sap.ui.getCore().attachInit(function () { - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); - if (componentName && componentName.length > 0) { + if (componentName && componentName.length > 0) { if (useMockserver && useMockserver === \\"true\\") { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { - // set up test service for local testing - server.init(); - // initialize the ushell sandbox component - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - }); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { + // set up test service for local testing + server.init(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + }); + }); + }); }); } else { // Requiring the ComponentSupport module automatically executes the component initialisation for all declaratively defined components sap.ui.require([\\"sap/ui/core/ComponentSupport\\"]); // setting the app title with the i18n text - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); } } else { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - try { - // initialize the ushell sandbox component in ui5 v2 - sap.ushell.Container.createRenderer(true).then(function (component) { - component.placeAt(\\"content\\"); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + try { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + } catch (error) { + // support older versions of ui5 + Container.createRenderer().placeAt(\\"content\\"); + } }); - } catch { - // support older versions of ui5 - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - } + }); }); } });", @@ -1903,32 +1955,35 @@ function (JSONModel, Device) { return libOrCompKeysStringTmp; } return new Promise(function (resolve, reject) { - $.ajax(url) - .done(function (manifest) { - if (manifest) { - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].dependencies - ) { - if (manifest[\\"sap.ui5\\"].dependencies.libs) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + localJQuery.ajax(url) + .done(function (manifest) { + if (manifest) { + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].dependencies + ) { + if (manifest[\\"sap.ui5\\"].dependencies.libs) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + } + if (manifest[\\"sap.ui5\\"].dependencies.components) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + } } - if (manifest[\\"sap.ui5\\"].dependencies.components) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].componentUsages + ) { + result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); } } - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].componentUsages - ) { - result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); - } - } - resolve(result); - }) - .fail(function () { - reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); - }); + resolve(result); + }) + .fail(function () { + reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); + }); + }); }); }; function registerModules(dataFromAppIndex) { @@ -1971,18 +2026,19 @@ function (JSONModel, Device) { return new Promise( function (resolve) { - sap.ui.require([\\"sap/base/util/UriParameters\\"], function (UriParameters) { - sapClient = UriParameters.fromQuery(window.location.search).get(\\"sap-client\\"); - if (sapClient && sapClient.length === 3) { - url = url + \\"&sap-client=\\" + sapClient; - } - resolve(url); - }); + sapClient = new URLSearchParams(window.location.search).get(\\"sap-client\\"); + if (sapClient && sapClient.length === 3) { + url = url + \\"&sap-client=\\" + sapClient; + } + resolve(url); }).then(function (url2) { - return $.ajax(url2).done(function (data) { - if (data) { - registerModules(data); - } + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + return localJQuery.ajax(url2) + .done(function (data) { + if (data) { + registerModules(data); + } + }); }); }); } else { @@ -2020,6 +2076,10 @@ var manifestUri = currentScript.getAttribute(\\"data-sap-ui-manifest-uri\\"); var componentName = currentScript.getAttribute(\\"data-sap-ui-componentName\\"); var useMockserver = currentScript.getAttribute(\\"data-sap-ui-use-mockserver\\"); +// Patch (KW): resourceRoot is needed to load the correct ResourceBundles +var resourceRoot = manifestUri.substring(0, manifestUri.lastIndexOf('/')+1); + + sap.registerComponentDependencyPaths(manifestUri) .catch(function (error) { sap.ui.require([\\"sap/base/Log\\"], function (Log) { @@ -2029,57 +2089,75 @@ sap.registerComponentDependencyPaths(manifestUri) .finally(function () { // setting the app title with internationalization - sap.ui.getCore().attachInit(function () { - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); - if (componentName && componentName.length > 0) { + if (componentName && componentName.length > 0) { if (useMockserver && useMockserver === \\"true\\") { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { - // set up test service for local testing - server.init(); - // initialize the ushell sandbox component - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - }); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { + // set up test service for local testing + server.init(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + }); + }); + }); }); } else { // Requiring the ComponentSupport module automatically executes the component initialisation for all declaratively defined components sap.ui.require([\\"sap/ui/core/ComponentSupport\\"]); // setting the app title with the i18n text - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); } } else { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - try { - // initialize the ushell sandbox component in ui5 v2 - sap.ushell.Container.createRenderer(true).then(function (component) { - component.placeAt(\\"content\\"); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + try { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + } catch (error) { + // support older versions of ui5 + Container.createRenderer().placeAt(\\"content\\"); + } }); - } catch { - // support older versions of ui5 - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - } + }); }); } });", @@ -4556,32 +4634,35 @@ function (JSONModel, Device) { return libOrCompKeysStringTmp; } return new Promise(function (resolve, reject) { - $.ajax(url) - .done(function (manifest) { - if (manifest) { - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].dependencies - ) { - if (manifest[\\"sap.ui5\\"].dependencies.libs) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + localJQuery.ajax(url) + .done(function (manifest) { + if (manifest) { + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].dependencies + ) { + if (manifest[\\"sap.ui5\\"].dependencies.libs) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + } + if (manifest[\\"sap.ui5\\"].dependencies.components) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + } } - if (manifest[\\"sap.ui5\\"].dependencies.components) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].componentUsages + ) { + result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); } } - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].componentUsages - ) { - result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); - } - } - resolve(result); - }) - .fail(function () { - reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); - }); + resolve(result); + }) + .fail(function () { + reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); + }); + }); }); }; function registerModules(dataFromAppIndex) { @@ -4624,18 +4705,19 @@ function (JSONModel, Device) { return new Promise( function (resolve) { - sap.ui.require([\\"sap/base/util/UriParameters\\"], function (UriParameters) { - sapClient = UriParameters.fromQuery(window.location.search).get(\\"sap-client\\"); - if (sapClient && sapClient.length === 3) { - url = url + \\"&sap-client=\\" + sapClient; - } - resolve(url); - }); + sapClient = new URLSearchParams(window.location.search).get(\\"sap-client\\"); + if (sapClient && sapClient.length === 3) { + url = url + \\"&sap-client=\\" + sapClient; + } + resolve(url); }).then(function (url2) { - return $.ajax(url2).done(function (data) { - if (data) { - registerModules(data); - } + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + return localJQuery.ajax(url2) + .done(function (data) { + if (data) { + registerModules(data); + } + }); }); }); } else { @@ -4673,6 +4755,10 @@ var manifestUri = currentScript.getAttribute(\\"data-sap-ui-manifest-uri\\"); var componentName = currentScript.getAttribute(\\"data-sap-ui-componentName\\"); var useMockserver = currentScript.getAttribute(\\"data-sap-ui-use-mockserver\\"); +// Patch (KW): resourceRoot is needed to load the correct ResourceBundles +var resourceRoot = manifestUri.substring(0, manifestUri.lastIndexOf('/')+1); + + sap.registerComponentDependencyPaths(manifestUri) .catch(function (error) { sap.ui.require([\\"sap/base/Log\\"], function (Log) { @@ -4682,57 +4768,75 @@ sap.registerComponentDependencyPaths(manifestUri) .finally(function () { // setting the app title with internationalization - sap.ui.getCore().attachInit(function () { - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); - if (componentName && componentName.length > 0) { + if (componentName && componentName.length > 0) { if (useMockserver && useMockserver === \\"true\\") { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { - // set up test service for local testing - server.init(); - // initialize the ushell sandbox component - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - }); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { + // set up test service for local testing + server.init(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + }); + }); + }); }); } else { // Requiring the ComponentSupport module automatically executes the component initialisation for all declaratively defined components sap.ui.require([\\"sap/ui/core/ComponentSupport\\"]); // setting the app title with the i18n text - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); } } else { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - try { - // initialize the ushell sandbox component in ui5 v2 - sap.ushell.Container.createRenderer(true).then(function (component) { - component.placeAt(\\"content\\"); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + try { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + } catch (error) { + // support older versions of ui5 + Container.createRenderer().placeAt(\\"content\\"); + } }); - } catch { - // support older versions of ui5 - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - } + }); }); } });", @@ -5350,32 +5454,35 @@ function (JSONModel, Device) { return libOrCompKeysStringTmp; } return new Promise(function (resolve, reject) { - $.ajax(url) - .done(function (manifest) { - if (manifest) { - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].dependencies - ) { - if (manifest[\\"sap.ui5\\"].dependencies.libs) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + localJQuery.ajax(url) + .done(function (manifest) { + if (manifest) { + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].dependencies + ) { + if (manifest[\\"sap.ui5\\"].dependencies.libs) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + } + if (manifest[\\"sap.ui5\\"].dependencies.components) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + } } - if (manifest[\\"sap.ui5\\"].dependencies.components) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].componentUsages + ) { + result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); } } - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].componentUsages - ) { - result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); - } - } - resolve(result); - }) - .fail(function () { - reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); - }); + resolve(result); + }) + .fail(function () { + reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); + }); + }); }); }; function registerModules(dataFromAppIndex) { @@ -5418,18 +5525,19 @@ function (JSONModel, Device) { return new Promise( function (resolve) { - sap.ui.require([\\"sap/base/util/UriParameters\\"], function (UriParameters) { - sapClient = UriParameters.fromQuery(window.location.search).get(\\"sap-client\\"); - if (sapClient && sapClient.length === 3) { - url = url + \\"&sap-client=\\" + sapClient; - } - resolve(url); - }); + sapClient = new URLSearchParams(window.location.search).get(\\"sap-client\\"); + if (sapClient && sapClient.length === 3) { + url = url + \\"&sap-client=\\" + sapClient; + } + resolve(url); }).then(function (url2) { - return $.ajax(url2).done(function (data) { - if (data) { - registerModules(data); - } + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + return localJQuery.ajax(url2) + .done(function (data) { + if (data) { + registerModules(data); + } + }); }); }); } else { @@ -5467,6 +5575,10 @@ var manifestUri = currentScript.getAttribute(\\"data-sap-ui-manifest-uri\\"); var componentName = currentScript.getAttribute(\\"data-sap-ui-componentName\\"); var useMockserver = currentScript.getAttribute(\\"data-sap-ui-use-mockserver\\"); +// Patch (KW): resourceRoot is needed to load the correct ResourceBundles +var resourceRoot = manifestUri.substring(0, manifestUri.lastIndexOf('/')+1); + + sap.registerComponentDependencyPaths(manifestUri) .catch(function (error) { sap.ui.require([\\"sap/base/Log\\"], function (Log) { @@ -5476,57 +5588,75 @@ sap.registerComponentDependencyPaths(manifestUri) .finally(function () { // setting the app title with internationalization - sap.ui.getCore().attachInit(function () { - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); - if (componentName && componentName.length > 0) { + if (componentName && componentName.length > 0) { if (useMockserver && useMockserver === \\"true\\") { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { - // set up test service for local testing - server.init(); - // initialize the ushell sandbox component - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - }); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { + // set up test service for local testing + server.init(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + }); + }); + }); }); } else { // Requiring the ComponentSupport module automatically executes the component initialisation for all declaratively defined components sap.ui.require([\\"sap/ui/core/ComponentSupport\\"]); // setting the app title with the i18n text - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); } } else { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - try { - // initialize the ushell sandbox component in ui5 v2 - sap.ushell.Container.createRenderer(true).then(function (component) { - component.placeAt(\\"content\\"); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + try { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + } catch (error) { + // support older versions of ui5 + Container.createRenderer().placeAt(\\"content\\"); + } }); - } catch { - // support older versions of ui5 - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - } + }); }); } });", @@ -6145,32 +6275,35 @@ function (JSONModel, Device) { return libOrCompKeysStringTmp; } return new Promise(function (resolve, reject) { - $.ajax(url) - .done(function (manifest) { - if (manifest) { - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].dependencies - ) { - if (manifest[\\"sap.ui5\\"].dependencies.libs) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + localJQuery.ajax(url) + .done(function (manifest) { + if (manifest) { + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].dependencies + ) { + if (manifest[\\"sap.ui5\\"].dependencies.libs) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + } + if (manifest[\\"sap.ui5\\"].dependencies.components) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + } } - if (manifest[\\"sap.ui5\\"].dependencies.components) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].componentUsages + ) { + result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); } } - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].componentUsages - ) { - result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); - } - } - resolve(result); - }) - .fail(function () { - reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); - }); + resolve(result); + }) + .fail(function () { + reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); + }); + }); }); }; function registerModules(dataFromAppIndex) { @@ -6213,18 +6346,19 @@ function (JSONModel, Device) { return new Promise( function (resolve) { - sap.ui.require([\\"sap/base/util/UriParameters\\"], function (UriParameters) { - sapClient = UriParameters.fromQuery(window.location.search).get(\\"sap-client\\"); - if (sapClient && sapClient.length === 3) { - url = url + \\"&sap-client=\\" + sapClient; - } - resolve(url); - }); + sapClient = new URLSearchParams(window.location.search).get(\\"sap-client\\"); + if (sapClient && sapClient.length === 3) { + url = url + \\"&sap-client=\\" + sapClient; + } + resolve(url); }).then(function (url2) { - return $.ajax(url2).done(function (data) { - if (data) { - registerModules(data); - } + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + return localJQuery.ajax(url2) + .done(function (data) { + if (data) { + registerModules(data); + } + }); }); }); } else { @@ -6262,6 +6396,10 @@ var manifestUri = currentScript.getAttribute(\\"data-sap-ui-manifest-uri\\"); var componentName = currentScript.getAttribute(\\"data-sap-ui-componentName\\"); var useMockserver = currentScript.getAttribute(\\"data-sap-ui-use-mockserver\\"); +// Patch (KW): resourceRoot is needed to load the correct ResourceBundles +var resourceRoot = manifestUri.substring(0, manifestUri.lastIndexOf('/')+1); + + sap.registerComponentDependencyPaths(manifestUri) .catch(function (error) { sap.ui.require([\\"sap/base/Log\\"], function (Log) { @@ -6271,57 +6409,75 @@ sap.registerComponentDependencyPaths(manifestUri) .finally(function () { // setting the app title with internationalization - sap.ui.getCore().attachInit(function () { - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); - if (componentName && componentName.length > 0) { + if (componentName && componentName.length > 0) { if (useMockserver && useMockserver === \\"true\\") { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { - // set up test service for local testing - server.init(); - // initialize the ushell sandbox component - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - }); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { + // set up test service for local testing + server.init(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + }); + }); + }); }); } else { // Requiring the ComponentSupport module automatically executes the component initialisation for all declaratively defined components sap.ui.require([\\"sap/ui/core/ComponentSupport\\"]); // setting the app title with the i18n text - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); } } else { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - try { - // initialize the ushell sandbox component in ui5 v2 - sap.ushell.Container.createRenderer(true).then(function (component) { - component.placeAt(\\"content\\"); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + try { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + } catch (error) { + // support older versions of ui5 + Container.createRenderer().placeAt(\\"content\\"); + } }); - } catch { - // support older versions of ui5 - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - } + }); }); } });", @@ -7453,32 +7609,35 @@ function (JSONModel, Device) { return libOrCompKeysStringTmp; } return new Promise(function (resolve, reject) { - $.ajax(url) - .done(function (manifest) { - if (manifest) { - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].dependencies - ) { - if (manifest[\\"sap.ui5\\"].dependencies.libs) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + localJQuery.ajax(url) + .done(function (manifest) { + if (manifest) { + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].dependencies + ) { + if (manifest[\\"sap.ui5\\"].dependencies.libs) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + } + if (manifest[\\"sap.ui5\\"].dependencies.components) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + } } - if (manifest[\\"sap.ui5\\"].dependencies.components) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].componentUsages + ) { + result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); } } - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].componentUsages - ) { - result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); - } - } - resolve(result); - }) - .fail(function () { - reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); - }); + resolve(result); + }) + .fail(function () { + reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); + }); + }); }); }; function registerModules(dataFromAppIndex) { @@ -7521,18 +7680,19 @@ function (JSONModel, Device) { return new Promise( function (resolve) { - sap.ui.require([\\"sap/base/util/UriParameters\\"], function (UriParameters) { - sapClient = UriParameters.fromQuery(window.location.search).get(\\"sap-client\\"); - if (sapClient && sapClient.length === 3) { - url = url + \\"&sap-client=\\" + sapClient; - } - resolve(url); - }); + sapClient = new URLSearchParams(window.location.search).get(\\"sap-client\\"); + if (sapClient && sapClient.length === 3) { + url = url + \\"&sap-client=\\" + sapClient; + } + resolve(url); }).then(function (url2) { - return $.ajax(url2).done(function (data) { - if (data) { - registerModules(data); - } + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + return localJQuery.ajax(url2) + .done(function (data) { + if (data) { + registerModules(data); + } + }); }); }); } else { @@ -7570,6 +7730,10 @@ var manifestUri = currentScript.getAttribute(\\"data-sap-ui-manifest-uri\\"); var componentName = currentScript.getAttribute(\\"data-sap-ui-componentName\\"); var useMockserver = currentScript.getAttribute(\\"data-sap-ui-use-mockserver\\"); +// Patch (KW): resourceRoot is needed to load the correct ResourceBundles +var resourceRoot = manifestUri.substring(0, manifestUri.lastIndexOf('/')+1); + + sap.registerComponentDependencyPaths(manifestUri) .catch(function (error) { sap.ui.require([\\"sap/base/Log\\"], function (Log) { @@ -7579,57 +7743,75 @@ sap.registerComponentDependencyPaths(manifestUri) .finally(function () { // setting the app title with internationalization - sap.ui.getCore().attachInit(function () { - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); - if (componentName && componentName.length > 0) { + if (componentName && componentName.length > 0) { if (useMockserver && useMockserver === \\"true\\") { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { - // set up test service for local testing - server.init(); - // initialize the ushell sandbox component - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - }); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { + // set up test service for local testing + server.init(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + }); + }); + }); }); } else { // Requiring the ComponentSupport module automatically executes the component initialisation for all declaratively defined components sap.ui.require([\\"sap/ui/core/ComponentSupport\\"]); // setting the app title with the i18n text - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); } } else { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - try { - // initialize the ushell sandbox component in ui5 v2 - sap.ushell.Container.createRenderer(true).then(function (component) { - component.placeAt(\\"content\\"); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + try { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + } catch (error) { + // support older versions of ui5 + Container.createRenderer().placeAt(\\"content\\"); + } }); - } catch { - // support older versions of ui5 - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - } + }); }); } });", diff --git a/packages/fiori-freestyle-writer/test/__snapshots__/index.test.ts.snap b/packages/fiori-freestyle-writer/test/__snapshots__/index.test.ts.snap index 68714b33d8..b97bb6ca8c 100644 --- a/packages/fiori-freestyle-writer/test/__snapshots__/index.test.ts.snap +++ b/packages/fiori-freestyle-writer/test/__snapshots__/index.test.ts.snap @@ -1133,32 +1133,35 @@ function (JSONModel, Device) { return libOrCompKeysStringTmp; } return new Promise(function (resolve, reject) { - $.ajax(url) - .done(function (manifest) { - if (manifest) { - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].dependencies - ) { - if (manifest[\\"sap.ui5\\"].dependencies.libs) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + localJQuery.ajax(url) + .done(function (manifest) { + if (manifest) { + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].dependencies + ) { + if (manifest[\\"sap.ui5\\"].dependencies.libs) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + } + if (manifest[\\"sap.ui5\\"].dependencies.components) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + } } - if (manifest[\\"sap.ui5\\"].dependencies.components) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].componentUsages + ) { + result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); } } - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].componentUsages - ) { - result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); - } - } - resolve(result); - }) - .fail(function () { - reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); - }); + resolve(result); + }) + .fail(function () { + reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); + }); + }); }); }; function registerModules(dataFromAppIndex) { @@ -1201,18 +1204,19 @@ function (JSONModel, Device) { return new Promise( function (resolve) { - sap.ui.require([\\"sap/base/util/UriParameters\\"], function (UriParameters) { - sapClient = UriParameters.fromQuery(window.location.search).get(\\"sap-client\\"); - if (sapClient && sapClient.length === 3) { - url = url + \\"&sap-client=\\" + sapClient; - } - resolve(url); - }); + sapClient = new URLSearchParams(window.location.search).get(\\"sap-client\\"); + if (sapClient && sapClient.length === 3) { + url = url + \\"&sap-client=\\" + sapClient; + } + resolve(url); }).then(function (url2) { - return $.ajax(url2).done(function (data) { - if (data) { - registerModules(data); - } + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + return localJQuery.ajax(url2) + .done(function (data) { + if (data) { + registerModules(data); + } + }); }); }); } else { @@ -1250,6 +1254,10 @@ var manifestUri = currentScript.getAttribute(\\"data-sap-ui-manifest-uri\\"); var componentName = currentScript.getAttribute(\\"data-sap-ui-componentName\\"); var useMockserver = currentScript.getAttribute(\\"data-sap-ui-use-mockserver\\"); +// Patch (KW): resourceRoot is needed to load the correct ResourceBundles +var resourceRoot = manifestUri.substring(0, manifestUri.lastIndexOf('/')+1); + + sap.registerComponentDependencyPaths(manifestUri) .catch(function (error) { sap.ui.require([\\"sap/base/Log\\"], function (Log) { @@ -1259,57 +1267,75 @@ sap.registerComponentDependencyPaths(manifestUri) .finally(function () { // setting the app title with internationalization - sap.ui.getCore().attachInit(function () { - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); - if (componentName && componentName.length > 0) { + if (componentName && componentName.length > 0) { if (useMockserver && useMockserver === \\"true\\") { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { - // set up test service for local testing - server.init(); - // initialize the ushell sandbox component - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - }); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { + // set up test service for local testing + server.init(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + }); + }); + }); }); } else { // Requiring the ComponentSupport module automatically executes the component initialisation for all declaratively defined components sap.ui.require([\\"sap/ui/core/ComponentSupport\\"]); // setting the app title with the i18n text - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); } } else { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - try { - // initialize the ushell sandbox component in ui5 v2 - sap.ushell.Container.createRenderer(true).then(function (component) { - component.placeAt(\\"content\\"); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + try { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + } catch (error) { + // support older versions of ui5 + Container.createRenderer().placeAt(\\"content\\"); + } }); - } catch { - // support older versions of ui5 - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - } + }); }); } });", @@ -3510,32 +3536,35 @@ function (JSONModel, Device) { return libOrCompKeysStringTmp; } return new Promise(function (resolve, reject) { - $.ajax(url) - .done(function (manifest) { - if (manifest) { - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].dependencies - ) { - if (manifest[\\"sap.ui5\\"].dependencies.libs) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + localJQuery.ajax(url) + .done(function (manifest) { + if (manifest) { + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].dependencies + ) { + if (manifest[\\"sap.ui5\\"].dependencies.libs) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + } + if (manifest[\\"sap.ui5\\"].dependencies.components) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + } } - if (manifest[\\"sap.ui5\\"].dependencies.components) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].componentUsages + ) { + result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); } } - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].componentUsages - ) { - result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); - } - } - resolve(result); - }) - .fail(function () { - reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); - }); + resolve(result); + }) + .fail(function () { + reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); + }); + }); }); }; function registerModules(dataFromAppIndex) { @@ -3578,18 +3607,19 @@ function (JSONModel, Device) { return new Promise( function (resolve) { - sap.ui.require([\\"sap/base/util/UriParameters\\"], function (UriParameters) { - sapClient = UriParameters.fromQuery(window.location.search).get(\\"sap-client\\"); - if (sapClient && sapClient.length === 3) { - url = url + \\"&sap-client=\\" + sapClient; - } - resolve(url); - }); + sapClient = new URLSearchParams(window.location.search).get(\\"sap-client\\"); + if (sapClient && sapClient.length === 3) { + url = url + \\"&sap-client=\\" + sapClient; + } + resolve(url); }).then(function (url2) { - return $.ajax(url2).done(function (data) { - if (data) { - registerModules(data); - } + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + return localJQuery.ajax(url2) + .done(function (data) { + if (data) { + registerModules(data); + } + }); }); }); } else { @@ -3627,6 +3657,10 @@ var manifestUri = currentScript.getAttribute(\\"data-sap-ui-manifest-uri\\"); var componentName = currentScript.getAttribute(\\"data-sap-ui-componentName\\"); var useMockserver = currentScript.getAttribute(\\"data-sap-ui-use-mockserver\\"); +// Patch (KW): resourceRoot is needed to load the correct ResourceBundles +var resourceRoot = manifestUri.substring(0, manifestUri.lastIndexOf('/')+1); + + sap.registerComponentDependencyPaths(manifestUri) .catch(function (error) { sap.ui.require([\\"sap/base/Log\\"], function (Log) { @@ -3636,57 +3670,75 @@ sap.registerComponentDependencyPaths(manifestUri) .finally(function () { // setting the app title with internationalization - sap.ui.getCore().attachInit(function () { - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); - if (componentName && componentName.length > 0) { + if (componentName && componentName.length > 0) { if (useMockserver && useMockserver === \\"true\\") { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { - // set up test service for local testing - server.init(); - // initialize the ushell sandbox component - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - }); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { + // set up test service for local testing + server.init(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + }); + }); + }); }); } else { // Requiring the ComponentSupport module automatically executes the component initialisation for all declaratively defined components sap.ui.require([\\"sap/ui/core/ComponentSupport\\"]); // setting the app title with the i18n text - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); } } else { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - try { - // initialize the ushell sandbox component in ui5 v2 - sap.ushell.Container.createRenderer(true).then(function (component) { - component.placeAt(\\"content\\"); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + try { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + } catch (error) { + // support older versions of ui5 + Container.createRenderer().placeAt(\\"content\\"); + } }); - } catch { - // support older versions of ui5 - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - } + }); }); } });", @@ -5708,32 +5760,35 @@ function (JSONModel, Device) { return libOrCompKeysStringTmp; } return new Promise(function (resolve, reject) { - $.ajax(url) - .done(function (manifest) { - if (manifest) { - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].dependencies - ) { - if (manifest[\\"sap.ui5\\"].dependencies.libs) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + localJQuery.ajax(url) + .done(function (manifest) { + if (manifest) { + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].dependencies + ) { + if (manifest[\\"sap.ui5\\"].dependencies.libs) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + } + if (manifest[\\"sap.ui5\\"].dependencies.components) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + } } - if (manifest[\\"sap.ui5\\"].dependencies.components) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].componentUsages + ) { + result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); } } - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].componentUsages - ) { - result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); - } - } - resolve(result); - }) - .fail(function () { - reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); - }); + resolve(result); + }) + .fail(function () { + reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); + }); + }); }); }; function registerModules(dataFromAppIndex) { @@ -5776,18 +5831,19 @@ function (JSONModel, Device) { return new Promise( function (resolve) { - sap.ui.require([\\"sap/base/util/UriParameters\\"], function (UriParameters) { - sapClient = UriParameters.fromQuery(window.location.search).get(\\"sap-client\\"); - if (sapClient && sapClient.length === 3) { - url = url + \\"&sap-client=\\" + sapClient; - } - resolve(url); - }); + sapClient = new URLSearchParams(window.location.search).get(\\"sap-client\\"); + if (sapClient && sapClient.length === 3) { + url = url + \\"&sap-client=\\" + sapClient; + } + resolve(url); }).then(function (url2) { - return $.ajax(url2).done(function (data) { - if (data) { - registerModules(data); - } + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + return localJQuery.ajax(url2) + .done(function (data) { + if (data) { + registerModules(data); + } + }); }); }); } else { @@ -5825,6 +5881,10 @@ var manifestUri = currentScript.getAttribute(\\"data-sap-ui-manifest-uri\\"); var componentName = currentScript.getAttribute(\\"data-sap-ui-componentName\\"); var useMockserver = currentScript.getAttribute(\\"data-sap-ui-use-mockserver\\"); +// Patch (KW): resourceRoot is needed to load the correct ResourceBundles +var resourceRoot = manifestUri.substring(0, manifestUri.lastIndexOf('/')+1); + + sap.registerComponentDependencyPaths(manifestUri) .catch(function (error) { sap.ui.require([\\"sap/base/Log\\"], function (Log) { @@ -5834,57 +5894,75 @@ sap.registerComponentDependencyPaths(manifestUri) .finally(function () { // setting the app title with internationalization - sap.ui.getCore().attachInit(function () { - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); - if (componentName && componentName.length > 0) { + if (componentName && componentName.length > 0) { if (useMockserver && useMockserver === \\"true\\") { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { - // set up test service for local testing - server.init(); - // initialize the ushell sandbox component - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - }); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { + // set up test service for local testing + server.init(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + }); + }); + }); }); } else { // Requiring the ComponentSupport module automatically executes the component initialisation for all declaratively defined components sap.ui.require([\\"sap/ui/core/ComponentSupport\\"]); // setting the app title with the i18n text - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); } } else { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - try { - // initialize the ushell sandbox component in ui5 v2 - sap.ushell.Container.createRenderer(true).then(function (component) { - component.placeAt(\\"content\\"); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + try { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + } catch (error) { + // support older versions of ui5 + Container.createRenderer().placeAt(\\"content\\"); + } }); - } catch { - // support older versions of ui5 - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - } + }); }); } });", diff --git a/packages/fiori-freestyle-writer/test/__snapshots__/listdetail.test.ts.snap b/packages/fiori-freestyle-writer/test/__snapshots__/listdetail.test.ts.snap index 281c5ac3b6..6fad537b73 100644 --- a/packages/fiori-freestyle-writer/test/__snapshots__/listdetail.test.ts.snap +++ b/packages/fiori-freestyle-writer/test/__snapshots__/listdetail.test.ts.snap @@ -2208,32 +2208,35 @@ export function createDeviceModel () { return libOrCompKeysStringTmp; } return new Promise(function (resolve, reject) { - $.ajax(url) - .done(function (manifest) { - if (manifest) { - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].dependencies - ) { - if (manifest[\\"sap.ui5\\"].dependencies.libs) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + localJQuery.ajax(url) + .done(function (manifest) { + if (manifest) { + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].dependencies + ) { + if (manifest[\\"sap.ui5\\"].dependencies.libs) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + } + if (manifest[\\"sap.ui5\\"].dependencies.components) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + } } - if (manifest[\\"sap.ui5\\"].dependencies.components) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].componentUsages + ) { + result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); } } - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].componentUsages - ) { - result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); - } - } - resolve(result); - }) - .fail(function () { - reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); - }); + resolve(result); + }) + .fail(function () { + reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); + }); + }); }); }; function registerModules(dataFromAppIndex) { @@ -2276,18 +2279,19 @@ export function createDeviceModel () { return new Promise( function (resolve) { - sap.ui.require([\\"sap/base/util/UriParameters\\"], function (UriParameters) { - sapClient = UriParameters.fromQuery(window.location.search).get(\\"sap-client\\"); - if (sapClient && sapClient.length === 3) { - url = url + \\"&sap-client=\\" + sapClient; - } - resolve(url); - }); + sapClient = new URLSearchParams(window.location.search).get(\\"sap-client\\"); + if (sapClient && sapClient.length === 3) { + url = url + \\"&sap-client=\\" + sapClient; + } + resolve(url); }).then(function (url2) { - return $.ajax(url2).done(function (data) { - if (data) { - registerModules(data); - } + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + return localJQuery.ajax(url2) + .done(function (data) { + if (data) { + registerModules(data); + } + }); }); }); } else { @@ -2325,6 +2329,10 @@ var manifestUri = currentScript.getAttribute(\\"data-sap-ui-manifest-uri\\"); var componentName = currentScript.getAttribute(\\"data-sap-ui-componentName\\"); var useMockserver = currentScript.getAttribute(\\"data-sap-ui-use-mockserver\\"); +// Patch (KW): resourceRoot is needed to load the correct ResourceBundles +var resourceRoot = manifestUri.substring(0, manifestUri.lastIndexOf('/')+1); + + sap.registerComponentDependencyPaths(manifestUri) .catch(function (error) { sap.ui.require([\\"sap/base/Log\\"], function (Log) { @@ -2334,57 +2342,75 @@ sap.registerComponentDependencyPaths(manifestUri) .finally(function () { // setting the app title with internationalization - sap.ui.getCore().attachInit(function () { - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); - if (componentName && componentName.length > 0) { + if (componentName && componentName.length > 0) { if (useMockserver && useMockserver === \\"true\\") { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { - // set up test service for local testing - server.init(); - // initialize the ushell sandbox component - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - }); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { + // set up test service for local testing + server.init(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + }); + }); + }); }); } else { // Requiring the ComponentSupport module automatically executes the component initialisation for all declaratively defined components sap.ui.require([\\"sap/ui/core/ComponentSupport\\"]); // setting the app title with the i18n text - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); } } else { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - try { - // initialize the ushell sandbox component in ui5 v2 - sap.ushell.Container.createRenderer(true).then(function (component) { - component.placeAt(\\"content\\"); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + try { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + } catch (error) { + // support older versions of ui5 + Container.createRenderer().placeAt(\\"content\\"); + } }); - } catch { - // support older versions of ui5 - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - } + }); }); } });", @@ -4907,32 +4933,35 @@ export function createDeviceModel () { return libOrCompKeysStringTmp; } return new Promise(function (resolve, reject) { - $.ajax(url) - .done(function (manifest) { - if (manifest) { - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].dependencies - ) { - if (manifest[\\"sap.ui5\\"].dependencies.libs) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + localJQuery.ajax(url) + .done(function (manifest) { + if (manifest) { + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].dependencies + ) { + if (manifest[\\"sap.ui5\\"].dependencies.libs) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + } + if (manifest[\\"sap.ui5\\"].dependencies.components) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + } } - if (manifest[\\"sap.ui5\\"].dependencies.components) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].componentUsages + ) { + result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); } } - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].componentUsages - ) { - result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); - } - } - resolve(result); - }) - .fail(function () { - reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); - }); + resolve(result); + }) + .fail(function () { + reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); + }); + }); }); }; function registerModules(dataFromAppIndex) { @@ -4975,18 +5004,19 @@ export function createDeviceModel () { return new Promise( function (resolve) { - sap.ui.require([\\"sap/base/util/UriParameters\\"], function (UriParameters) { - sapClient = UriParameters.fromQuery(window.location.search).get(\\"sap-client\\"); - if (sapClient && sapClient.length === 3) { - url = url + \\"&sap-client=\\" + sapClient; - } - resolve(url); - }); + sapClient = new URLSearchParams(window.location.search).get(\\"sap-client\\"); + if (sapClient && sapClient.length === 3) { + url = url + \\"&sap-client=\\" + sapClient; + } + resolve(url); }).then(function (url2) { - return $.ajax(url2).done(function (data) { - if (data) { - registerModules(data); - } + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + return localJQuery.ajax(url2) + .done(function (data) { + if (data) { + registerModules(data); + } + }); }); }); } else { @@ -5024,6 +5054,10 @@ var manifestUri = currentScript.getAttribute(\\"data-sap-ui-manifest-uri\\"); var componentName = currentScript.getAttribute(\\"data-sap-ui-componentName\\"); var useMockserver = currentScript.getAttribute(\\"data-sap-ui-use-mockserver\\"); +// Patch (KW): resourceRoot is needed to load the correct ResourceBundles +var resourceRoot = manifestUri.substring(0, manifestUri.lastIndexOf('/')+1); + + sap.registerComponentDependencyPaths(manifestUri) .catch(function (error) { sap.ui.require([\\"sap/base/Log\\"], function (Log) { @@ -5033,57 +5067,75 @@ sap.registerComponentDependencyPaths(manifestUri) .finally(function () { // setting the app title with internationalization - sap.ui.getCore().attachInit(function () { - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); - if (componentName && componentName.length > 0) { + if (componentName && componentName.length > 0) { if (useMockserver && useMockserver === \\"true\\") { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { - // set up test service for local testing - server.init(); - // initialize the ushell sandbox component - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - }); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { + // set up test service for local testing + server.init(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + }); + }); + }); }); } else { // Requiring the ComponentSupport module automatically executes the component initialisation for all declaratively defined components sap.ui.require([\\"sap/ui/core/ComponentSupport\\"]); // setting the app title with the i18n text - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); } } else { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - try { - // initialize the ushell sandbox component in ui5 v2 - sap.ushell.Container.createRenderer(true).then(function (component) { - component.placeAt(\\"content\\"); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + try { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + } catch (error) { + // support older versions of ui5 + Container.createRenderer().placeAt(\\"content\\"); + } }); - } catch { - // support older versions of ui5 - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - } + }); }); } });", @@ -7606,32 +7658,35 @@ export function createDeviceModel () { return libOrCompKeysStringTmp; } return new Promise(function (resolve, reject) { - $.ajax(url) - .done(function (manifest) { - if (manifest) { - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].dependencies - ) { - if (manifest[\\"sap.ui5\\"].dependencies.libs) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + localJQuery.ajax(url) + .done(function (manifest) { + if (manifest) { + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].dependencies + ) { + if (manifest[\\"sap.ui5\\"].dependencies.libs) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + } + if (manifest[\\"sap.ui5\\"].dependencies.components) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + } } - if (manifest[\\"sap.ui5\\"].dependencies.components) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].componentUsages + ) { + result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); } } - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].componentUsages - ) { - result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); - } - } - resolve(result); - }) - .fail(function () { - reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); - }); + resolve(result); + }) + .fail(function () { + reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); + }); + }); }); }; function registerModules(dataFromAppIndex) { @@ -7674,18 +7729,19 @@ export function createDeviceModel () { return new Promise( function (resolve) { - sap.ui.require([\\"sap/base/util/UriParameters\\"], function (UriParameters) { - sapClient = UriParameters.fromQuery(window.location.search).get(\\"sap-client\\"); - if (sapClient && sapClient.length === 3) { - url = url + \\"&sap-client=\\" + sapClient; - } - resolve(url); - }); + sapClient = new URLSearchParams(window.location.search).get(\\"sap-client\\"); + if (sapClient && sapClient.length === 3) { + url = url + \\"&sap-client=\\" + sapClient; + } + resolve(url); }).then(function (url2) { - return $.ajax(url2).done(function (data) { - if (data) { - registerModules(data); - } + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + return localJQuery.ajax(url2) + .done(function (data) { + if (data) { + registerModules(data); + } + }); }); }); } else { @@ -7723,6 +7779,10 @@ var manifestUri = currentScript.getAttribute(\\"data-sap-ui-manifest-uri\\"); var componentName = currentScript.getAttribute(\\"data-sap-ui-componentName\\"); var useMockserver = currentScript.getAttribute(\\"data-sap-ui-use-mockserver\\"); +// Patch (KW): resourceRoot is needed to load the correct ResourceBundles +var resourceRoot = manifestUri.substring(0, manifestUri.lastIndexOf('/')+1); + + sap.registerComponentDependencyPaths(manifestUri) .catch(function (error) { sap.ui.require([\\"sap/base/Log\\"], function (Log) { @@ -7732,57 +7792,75 @@ sap.registerComponentDependencyPaths(manifestUri) .finally(function () { // setting the app title with internationalization - sap.ui.getCore().attachInit(function () { - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); - if (componentName && componentName.length > 0) { + if (componentName && componentName.length > 0) { if (useMockserver && useMockserver === \\"true\\") { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { - // set up test service for local testing - server.init(); - // initialize the ushell sandbox component - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - }); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { + // set up test service for local testing + server.init(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + }); + }); + }); }); } else { // Requiring the ComponentSupport module automatically executes the component initialisation for all declaratively defined components sap.ui.require([\\"sap/ui/core/ComponentSupport\\"]); // setting the app title with the i18n text - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); } } else { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - try { - // initialize the ushell sandbox component in ui5 v2 - sap.ushell.Container.createRenderer(true).then(function (component) { - component.placeAt(\\"content\\"); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + try { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + } catch (error) { + // support older versions of ui5 + Container.createRenderer().placeAt(\\"content\\"); + } }); - } catch { - // support older versions of ui5 - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - } + }); }); } });", @@ -10220,32 +10298,35 @@ function (JSONModel, Device) { return libOrCompKeysStringTmp; } return new Promise(function (resolve, reject) { - $.ajax(url) - .done(function (manifest) { - if (manifest) { - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].dependencies - ) { - if (manifest[\\"sap.ui5\\"].dependencies.libs) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + localJQuery.ajax(url) + .done(function (manifest) { + if (manifest) { + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].dependencies + ) { + if (manifest[\\"sap.ui5\\"].dependencies.libs) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + } + if (manifest[\\"sap.ui5\\"].dependencies.components) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + } } - if (manifest[\\"sap.ui5\\"].dependencies.components) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].componentUsages + ) { + result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); } } - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].componentUsages - ) { - result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); - } - } - resolve(result); - }) - .fail(function () { - reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); - }); + resolve(result); + }) + .fail(function () { + reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); + }); + }); }); }; function registerModules(dataFromAppIndex) { @@ -10288,18 +10369,19 @@ function (JSONModel, Device) { return new Promise( function (resolve) { - sap.ui.require([\\"sap/base/util/UriParameters\\"], function (UriParameters) { - sapClient = UriParameters.fromQuery(window.location.search).get(\\"sap-client\\"); - if (sapClient && sapClient.length === 3) { - url = url + \\"&sap-client=\\" + sapClient; - } - resolve(url); - }); + sapClient = new URLSearchParams(window.location.search).get(\\"sap-client\\"); + if (sapClient && sapClient.length === 3) { + url = url + \\"&sap-client=\\" + sapClient; + } + resolve(url); }).then(function (url2) { - return $.ajax(url2).done(function (data) { - if (data) { - registerModules(data); - } + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + return localJQuery.ajax(url2) + .done(function (data) { + if (data) { + registerModules(data); + } + }); }); }); } else { @@ -10337,6 +10419,10 @@ var manifestUri = currentScript.getAttribute(\\"data-sap-ui-manifest-uri\\"); var componentName = currentScript.getAttribute(\\"data-sap-ui-componentName\\"); var useMockserver = currentScript.getAttribute(\\"data-sap-ui-use-mockserver\\"); +// Patch (KW): resourceRoot is needed to load the correct ResourceBundles +var resourceRoot = manifestUri.substring(0, manifestUri.lastIndexOf('/')+1); + + sap.registerComponentDependencyPaths(manifestUri) .catch(function (error) { sap.ui.require([\\"sap/base/Log\\"], function (Log) { @@ -10346,57 +10432,75 @@ sap.registerComponentDependencyPaths(manifestUri) .finally(function () { // setting the app title with internationalization - sap.ui.getCore().attachInit(function () { - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); - if (componentName && componentName.length > 0) { + if (componentName && componentName.length > 0) { if (useMockserver && useMockserver === \\"true\\") { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { - // set up test service for local testing - server.init(); - // initialize the ushell sandbox component - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - }); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { + // set up test service for local testing + server.init(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + }); + }); + }); }); } else { // Requiring the ComponentSupport module automatically executes the component initialisation for all declaratively defined components sap.ui.require([\\"sap/ui/core/ComponentSupport\\"]); // setting the app title with the i18n text - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); } } else { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - try { - // initialize the ushell sandbox component in ui5 v2 - sap.ushell.Container.createRenderer(true).then(function (component) { - component.placeAt(\\"content\\"); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + try { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + } catch (error) { + // support older versions of ui5 + Container.createRenderer().placeAt(\\"content\\"); + } }); - } catch { - // support older versions of ui5 - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - } + }); }); } });", @@ -12772,32 +12876,35 @@ export function createDeviceModel () { return libOrCompKeysStringTmp; } return new Promise(function (resolve, reject) { - $.ajax(url) - .done(function (manifest) { - if (manifest) { - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].dependencies - ) { - if (manifest[\\"sap.ui5\\"].dependencies.libs) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + localJQuery.ajax(url) + .done(function (manifest) { + if (manifest) { + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].dependencies + ) { + if (manifest[\\"sap.ui5\\"].dependencies.libs) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + } + if (manifest[\\"sap.ui5\\"].dependencies.components) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + } } - if (manifest[\\"sap.ui5\\"].dependencies.components) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].componentUsages + ) { + result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); } } - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].componentUsages - ) { - result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); - } - } - resolve(result); - }) - .fail(function () { - reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); - }); + resolve(result); + }) + .fail(function () { + reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); + }); + }); }); }; function registerModules(dataFromAppIndex) { @@ -12840,18 +12947,19 @@ export function createDeviceModel () { return new Promise( function (resolve) { - sap.ui.require([\\"sap/base/util/UriParameters\\"], function (UriParameters) { - sapClient = UriParameters.fromQuery(window.location.search).get(\\"sap-client\\"); - if (sapClient && sapClient.length === 3) { - url = url + \\"&sap-client=\\" + sapClient; - } - resolve(url); - }); + sapClient = new URLSearchParams(window.location.search).get(\\"sap-client\\"); + if (sapClient && sapClient.length === 3) { + url = url + \\"&sap-client=\\" + sapClient; + } + resolve(url); }).then(function (url2) { - return $.ajax(url2).done(function (data) { - if (data) { - registerModules(data); - } + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + return localJQuery.ajax(url2) + .done(function (data) { + if (data) { + registerModules(data); + } + }); }); }); } else { @@ -12889,6 +12997,10 @@ var manifestUri = currentScript.getAttribute(\\"data-sap-ui-manifest-uri\\"); var componentName = currentScript.getAttribute(\\"data-sap-ui-componentName\\"); var useMockserver = currentScript.getAttribute(\\"data-sap-ui-use-mockserver\\"); +// Patch (KW): resourceRoot is needed to load the correct ResourceBundles +var resourceRoot = manifestUri.substring(0, manifestUri.lastIndexOf('/')+1); + + sap.registerComponentDependencyPaths(manifestUri) .catch(function (error) { sap.ui.require([\\"sap/base/Log\\"], function (Log) { @@ -12898,57 +13010,75 @@ sap.registerComponentDependencyPaths(manifestUri) .finally(function () { // setting the app title with internationalization - sap.ui.getCore().attachInit(function () { - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); - if (componentName && componentName.length > 0) { + if (componentName && componentName.length > 0) { if (useMockserver && useMockserver === \\"true\\") { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { - // set up test service for local testing - server.init(); - // initialize the ushell sandbox component - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - }); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { + // set up test service for local testing + server.init(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + }); + }); + }); }); } else { // Requiring the ComponentSupport module automatically executes the component initialisation for all declaratively defined components sap.ui.require([\\"sap/ui/core/ComponentSupport\\"]); // setting the app title with the i18n text - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); } } else { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - try { - // initialize the ushell sandbox component in ui5 v2 - sap.ushell.Container.createRenderer(true).then(function (component) { - component.placeAt(\\"content\\"); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + try { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + } catch (error) { + // support older versions of ui5 + Container.createRenderer().placeAt(\\"content\\"); + } }); - } catch { - // support older versions of ui5 - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - } + }); }); } });", diff --git a/packages/fiori-freestyle-writer/test/__snapshots__/worklist.test.ts.snap b/packages/fiori-freestyle-writer/test/__snapshots__/worklist.test.ts.snap index 6df0a62114..3a746bcc64 100644 --- a/packages/fiori-freestyle-writer/test/__snapshots__/worklist.test.ts.snap +++ b/packages/fiori-freestyle-writer/test/__snapshots__/worklist.test.ts.snap @@ -6381,32 +6381,35 @@ function (JSONModel, Device) { return libOrCompKeysStringTmp; } return new Promise(function (resolve, reject) { - $.ajax(url) - .done(function (manifest) { - if (manifest) { - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].dependencies - ) { - if (manifest[\\"sap.ui5\\"].dependencies.libs) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + localJQuery.ajax(url) + .done(function (manifest) { + if (manifest) { + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].dependencies + ) { + if (manifest[\\"sap.ui5\\"].dependencies.libs) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + } + if (manifest[\\"sap.ui5\\"].dependencies.components) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + } } - if (manifest[\\"sap.ui5\\"].dependencies.components) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].componentUsages + ) { + result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); } } - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].componentUsages - ) { - result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); - } - } - resolve(result); - }) - .fail(function () { - reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); - }); + resolve(result); + }) + .fail(function () { + reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); + }); + }); }); }; function registerModules(dataFromAppIndex) { @@ -6449,18 +6452,19 @@ function (JSONModel, Device) { return new Promise( function (resolve) { - sap.ui.require([\\"sap/base/util/UriParameters\\"], function (UriParameters) { - sapClient = UriParameters.fromQuery(window.location.search).get(\\"sap-client\\"); - if (sapClient && sapClient.length === 3) { - url = url + \\"&sap-client=\\" + sapClient; - } - resolve(url); - }); + sapClient = new URLSearchParams(window.location.search).get(\\"sap-client\\"); + if (sapClient && sapClient.length === 3) { + url = url + \\"&sap-client=\\" + sapClient; + } + resolve(url); }).then(function (url2) { - return $.ajax(url2).done(function (data) { - if (data) { - registerModules(data); - } + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + return localJQuery.ajax(url2) + .done(function (data) { + if (data) { + registerModules(data); + } + }); }); }); } else { @@ -6498,6 +6502,10 @@ var manifestUri = currentScript.getAttribute(\\"data-sap-ui-manifest-uri\\"); var componentName = currentScript.getAttribute(\\"data-sap-ui-componentName\\"); var useMockserver = currentScript.getAttribute(\\"data-sap-ui-use-mockserver\\"); +// Patch (KW): resourceRoot is needed to load the correct ResourceBundles +var resourceRoot = manifestUri.substring(0, manifestUri.lastIndexOf('/')+1); + + sap.registerComponentDependencyPaths(manifestUri) .catch(function (error) { sap.ui.require([\\"sap/base/Log\\"], function (Log) { @@ -6507,57 +6515,75 @@ sap.registerComponentDependencyPaths(manifestUri) .finally(function () { // setting the app title with internationalization - sap.ui.getCore().attachInit(function () { - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); - if (componentName && componentName.length > 0) { + if (componentName && componentName.length > 0) { if (useMockserver && useMockserver === \\"true\\") { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { - // set up test service for local testing - server.init(); - // initialize the ushell sandbox component - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - }); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { + // set up test service for local testing + server.init(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + }); + }); + }); }); } else { // Requiring the ComponentSupport module automatically executes the component initialisation for all declaratively defined components sap.ui.require([\\"sap/ui/core/ComponentSupport\\"]); // setting the app title with the i18n text - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); } } else { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - try { - // initialize the ushell sandbox component in ui5 v2 - sap.ushell.Container.createRenderer(true).then(function (component) { - component.placeAt(\\"content\\"); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + try { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + } catch (error) { + // support older versions of ui5 + Container.createRenderer().placeAt(\\"content\\"); + } }); - } catch { - // support older versions of ui5 - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - } + }); }); } });", @@ -9724,32 +9750,35 @@ function (JSONModel, Device) { return libOrCompKeysStringTmp; } return new Promise(function (resolve, reject) { - $.ajax(url) - .done(function (manifest) { - if (manifest) { - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].dependencies - ) { - if (manifest[\\"sap.ui5\\"].dependencies.libs) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + localJQuery.ajax(url) + .done(function (manifest) { + if (manifest) { + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].dependencies + ) { + if (manifest[\\"sap.ui5\\"].dependencies.libs) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + } + if (manifest[\\"sap.ui5\\"].dependencies.components) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + } } - if (manifest[\\"sap.ui5\\"].dependencies.components) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].componentUsages + ) { + result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); } } - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].componentUsages - ) { - result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); - } - } - resolve(result); - }) - .fail(function () { - reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); - }); + resolve(result); + }) + .fail(function () { + reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); + }); + }); }); }; function registerModules(dataFromAppIndex) { @@ -9792,18 +9821,19 @@ function (JSONModel, Device) { return new Promise( function (resolve) { - sap.ui.require([\\"sap/base/util/UriParameters\\"], function (UriParameters) { - sapClient = UriParameters.fromQuery(window.location.search).get(\\"sap-client\\"); - if (sapClient && sapClient.length === 3) { - url = url + \\"&sap-client=\\" + sapClient; - } - resolve(url); - }); + sapClient = new URLSearchParams(window.location.search).get(\\"sap-client\\"); + if (sapClient && sapClient.length === 3) { + url = url + \\"&sap-client=\\" + sapClient; + } + resolve(url); }).then(function (url2) { - return $.ajax(url2).done(function (data) { - if (data) { - registerModules(data); - } + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + return localJQuery.ajax(url2) + .done(function (data) { + if (data) { + registerModules(data); + } + }); }); }); } else { @@ -9841,6 +9871,10 @@ var manifestUri = currentScript.getAttribute(\\"data-sap-ui-manifest-uri\\"); var componentName = currentScript.getAttribute(\\"data-sap-ui-componentName\\"); var useMockserver = currentScript.getAttribute(\\"data-sap-ui-use-mockserver\\"); +// Patch (KW): resourceRoot is needed to load the correct ResourceBundles +var resourceRoot = manifestUri.substring(0, manifestUri.lastIndexOf('/')+1); + + sap.registerComponentDependencyPaths(manifestUri) .catch(function (error) { sap.ui.require([\\"sap/base/Log\\"], function (Log) { @@ -9850,57 +9884,75 @@ sap.registerComponentDependencyPaths(manifestUri) .finally(function () { // setting the app title with internationalization - sap.ui.getCore().attachInit(function () { - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); - if (componentName && componentName.length > 0) { + if (componentName && componentName.length > 0) { if (useMockserver && useMockserver === \\"true\\") { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { - // set up test service for local testing - server.init(); - // initialize the ushell sandbox component - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - }); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { + // set up test service for local testing + server.init(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + }); + }); + }); }); } else { // Requiring the ComponentSupport module automatically executes the component initialisation for all declaratively defined components sap.ui.require([\\"sap/ui/core/ComponentSupport\\"]); // setting the app title with the i18n text - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); } } else { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - try { - // initialize the ushell sandbox component in ui5 v2 - sap.ushell.Container.createRenderer(true).then(function (component) { - component.placeAt(\\"content\\"); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + try { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + } catch (error) { + // support older versions of ui5 + Container.createRenderer().placeAt(\\"content\\"); + } }); - } catch { - // support older versions of ui5 - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - } + }); }); } });", @@ -12658,32 +12710,35 @@ function (JSONModel, Device) { return libOrCompKeysStringTmp; } return new Promise(function (resolve, reject) { - $.ajax(url) - .done(function (manifest) { - if (manifest) { - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].dependencies - ) { - if (manifest[\\"sap.ui5\\"].dependencies.libs) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + localJQuery.ajax(url) + .done(function (manifest) { + if (manifest) { + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].dependencies + ) { + if (manifest[\\"sap.ui5\\"].dependencies.libs) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + } + if (manifest[\\"sap.ui5\\"].dependencies.components) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + } } - if (manifest[\\"sap.ui5\\"].dependencies.components) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].componentUsages + ) { + result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); } } - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].componentUsages - ) { - result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); - } - } - resolve(result); - }) - .fail(function () { - reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); - }); + resolve(result); + }) + .fail(function () { + reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); + }); + }); }); }; function registerModules(dataFromAppIndex) { @@ -12726,18 +12781,19 @@ function (JSONModel, Device) { return new Promise( function (resolve) { - sap.ui.require([\\"sap/base/util/UriParameters\\"], function (UriParameters) { - sapClient = UriParameters.fromQuery(window.location.search).get(\\"sap-client\\"); - if (sapClient && sapClient.length === 3) { - url = url + \\"&sap-client=\\" + sapClient; - } - resolve(url); - }); + sapClient = new URLSearchParams(window.location.search).get(\\"sap-client\\"); + if (sapClient && sapClient.length === 3) { + url = url + \\"&sap-client=\\" + sapClient; + } + resolve(url); }).then(function (url2) { - return $.ajax(url2).done(function (data) { - if (data) { - registerModules(data); - } + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + return localJQuery.ajax(url2) + .done(function (data) { + if (data) { + registerModules(data); + } + }); }); }); } else { @@ -12775,6 +12831,10 @@ var manifestUri = currentScript.getAttribute(\\"data-sap-ui-manifest-uri\\"); var componentName = currentScript.getAttribute(\\"data-sap-ui-componentName\\"); var useMockserver = currentScript.getAttribute(\\"data-sap-ui-use-mockserver\\"); +// Patch (KW): resourceRoot is needed to load the correct ResourceBundles +var resourceRoot = manifestUri.substring(0, manifestUri.lastIndexOf('/')+1); + + sap.registerComponentDependencyPaths(manifestUri) .catch(function (error) { sap.ui.require([\\"sap/base/Log\\"], function (Log) { @@ -12784,57 +12844,75 @@ sap.registerComponentDependencyPaths(manifestUri) .finally(function () { // setting the app title with internationalization - sap.ui.getCore().attachInit(function () { - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); - if (componentName && componentName.length > 0) { + if (componentName && componentName.length > 0) { if (useMockserver && useMockserver === \\"true\\") { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { - // set up test service for local testing - server.init(); - // initialize the ushell sandbox component - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - }); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { + // set up test service for local testing + server.init(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + }); + }); + }); }); } else { // Requiring the ComponentSupport module automatically executes the component initialisation for all declaratively defined components sap.ui.require([\\"sap/ui/core/ComponentSupport\\"]); // setting the app title with the i18n text - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); } } else { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - try { - // initialize the ushell sandbox component in ui5 v2 - sap.ushell.Container.createRenderer(true).then(function (component) { - component.placeAt(\\"content\\"); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + try { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + } catch (error) { + // support older versions of ui5 + Container.createRenderer().placeAt(\\"content\\"); + } }); - } catch { - // support older versions of ui5 - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - } + }); }); } });", @@ -16027,32 +16105,35 @@ export function createDeviceModel () { return libOrCompKeysStringTmp; } return new Promise(function (resolve, reject) { - $.ajax(url) - .done(function (manifest) { - if (manifest) { - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].dependencies - ) { - if (manifest[\\"sap.ui5\\"].dependencies.libs) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + localJQuery.ajax(url) + .done(function (manifest) { + if (manifest) { + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].dependencies + ) { + if (manifest[\\"sap.ui5\\"].dependencies.libs) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + } + if (manifest[\\"sap.ui5\\"].dependencies.components) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + } } - if (manifest[\\"sap.ui5\\"].dependencies.components) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].componentUsages + ) { + result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); } } - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].componentUsages - ) { - result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); - } - } - resolve(result); - }) - .fail(function () { - reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); - }); + resolve(result); + }) + .fail(function () { + reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); + }); + }); }); }; function registerModules(dataFromAppIndex) { @@ -16095,18 +16176,19 @@ export function createDeviceModel () { return new Promise( function (resolve) { - sap.ui.require([\\"sap/base/util/UriParameters\\"], function (UriParameters) { - sapClient = UriParameters.fromQuery(window.location.search).get(\\"sap-client\\"); - if (sapClient && sapClient.length === 3) { - url = url + \\"&sap-client=\\" + sapClient; - } - resolve(url); - }); + sapClient = new URLSearchParams(window.location.search).get(\\"sap-client\\"); + if (sapClient && sapClient.length === 3) { + url = url + \\"&sap-client=\\" + sapClient; + } + resolve(url); }).then(function (url2) { - return $.ajax(url2).done(function (data) { - if (data) { - registerModules(data); - } + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + return localJQuery.ajax(url2) + .done(function (data) { + if (data) { + registerModules(data); + } + }); }); }); } else { @@ -16144,6 +16226,10 @@ var manifestUri = currentScript.getAttribute(\\"data-sap-ui-manifest-uri\\"); var componentName = currentScript.getAttribute(\\"data-sap-ui-componentName\\"); var useMockserver = currentScript.getAttribute(\\"data-sap-ui-use-mockserver\\"); +// Patch (KW): resourceRoot is needed to load the correct ResourceBundles +var resourceRoot = manifestUri.substring(0, manifestUri.lastIndexOf('/')+1); + + sap.registerComponentDependencyPaths(manifestUri) .catch(function (error) { sap.ui.require([\\"sap/base/Log\\"], function (Log) { @@ -16153,57 +16239,75 @@ sap.registerComponentDependencyPaths(manifestUri) .finally(function () { // setting the app title with internationalization - sap.ui.getCore().attachInit(function () { - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); - if (componentName && componentName.length > 0) { + if (componentName && componentName.length > 0) { if (useMockserver && useMockserver === \\"true\\") { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { - // set up test service for local testing - server.init(); - // initialize the ushell sandbox component - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - }); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { + // set up test service for local testing + server.init(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + }); + }); + }); }); } else { // Requiring the ComponentSupport module automatically executes the component initialisation for all declaratively defined components sap.ui.require([\\"sap/ui/core/ComponentSupport\\"]); // setting the app title with the i18n text - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); } } else { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - try { - // initialize the ushell sandbox component in ui5 v2 - sap.ushell.Container.createRenderer(true).then(function (component) { - component.placeAt(\\"content\\"); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + try { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + } catch (error) { + // support older versions of ui5 + Container.createRenderer().placeAt(\\"content\\"); + } }); - } catch { - // support older versions of ui5 - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - } + }); }); } });", @@ -19397,32 +19501,35 @@ export function createDeviceModel () { return libOrCompKeysStringTmp; } return new Promise(function (resolve, reject) { - $.ajax(url) - .done(function (manifest) { - if (manifest) { - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].dependencies - ) { - if (manifest[\\"sap.ui5\\"].dependencies.libs) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + localJQuery.ajax(url) + .done(function (manifest) { + if (manifest) { + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].dependencies + ) { + if (manifest[\\"sap.ui5\\"].dependencies.libs) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + } + if (manifest[\\"sap.ui5\\"].dependencies.components) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + } } - if (manifest[\\"sap.ui5\\"].dependencies.components) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].componentUsages + ) { + result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); } } - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].componentUsages - ) { - result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); - } - } - resolve(result); - }) - .fail(function () { - reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); - }); + resolve(result); + }) + .fail(function () { + reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); + }); + }); }); }; function registerModules(dataFromAppIndex) { @@ -19465,18 +19572,19 @@ export function createDeviceModel () { return new Promise( function (resolve) { - sap.ui.require([\\"sap/base/util/UriParameters\\"], function (UriParameters) { - sapClient = UriParameters.fromQuery(window.location.search).get(\\"sap-client\\"); - if (sapClient && sapClient.length === 3) { - url = url + \\"&sap-client=\\" + sapClient; - } - resolve(url); - }); + sapClient = new URLSearchParams(window.location.search).get(\\"sap-client\\"); + if (sapClient && sapClient.length === 3) { + url = url + \\"&sap-client=\\" + sapClient; + } + resolve(url); }).then(function (url2) { - return $.ajax(url2).done(function (data) { - if (data) { - registerModules(data); - } + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + return localJQuery.ajax(url2) + .done(function (data) { + if (data) { + registerModules(data); + } + }); }); }); } else { @@ -19514,6 +19622,10 @@ var manifestUri = currentScript.getAttribute(\\"data-sap-ui-manifest-uri\\"); var componentName = currentScript.getAttribute(\\"data-sap-ui-componentName\\"); var useMockserver = currentScript.getAttribute(\\"data-sap-ui-use-mockserver\\"); +// Patch (KW): resourceRoot is needed to load the correct ResourceBundles +var resourceRoot = manifestUri.substring(0, manifestUri.lastIndexOf('/')+1); + + sap.registerComponentDependencyPaths(manifestUri) .catch(function (error) { sap.ui.require([\\"sap/base/Log\\"], function (Log) { @@ -19523,57 +19635,75 @@ sap.registerComponentDependencyPaths(manifestUri) .finally(function () { // setting the app title with internationalization - sap.ui.getCore().attachInit(function () { - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); - if (componentName && componentName.length > 0) { + if (componentName && componentName.length > 0) { if (useMockserver && useMockserver === \\"true\\") { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { - // set up test service for local testing - server.init(); - // initialize the ushell sandbox component - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - }); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { + // set up test service for local testing + server.init(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + }); + }); + }); }); } else { // Requiring the ComponentSupport module automatically executes the component initialisation for all declaratively defined components sap.ui.require([\\"sap/ui/core/ComponentSupport\\"]); // setting the app title with the i18n text - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); } } else { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - try { - // initialize the ushell sandbox component in ui5 v2 - sap.ushell.Container.createRenderer(true).then(function (component) { - component.placeAt(\\"content\\"); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + try { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + } catch (error) { + // support older versions of ui5 + Container.createRenderer().placeAt(\\"content\\"); + } }); - } catch { - // support older versions of ui5 - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - } + }); }); } });", diff --git a/packages/fiori-freestyle-writer/test/common.ts b/packages/fiori-freestyle-writer/test/common.ts index da4433df36..49df63dc03 100644 --- a/packages/fiori-freestyle-writer/test/common.ts +++ b/packages/fiori-freestyle-writer/test/common.ts @@ -107,6 +107,10 @@ export const projectChecks = async ( console.log('stdout:', npmResult.stdout); console.log('stderr:', npmResult.stderr); } + // Check UI5 Linter + npmResult = await exec(`npx @ui5/linter`, { cwd: rootPath }); + console.log('stdout:', npmResult.stdout); + console.log('stderr:', npmResult.stderr); } catch (error) { console.log('stdout:', error?.stdout); console.log('stderr:', error?.stderr); diff --git a/packages/ui5-application-writer/templates/optional/loadReuseLibs/webapp/test/locate-reuse-libs.js b/packages/ui5-application-writer/templates/optional/loadReuseLibs/webapp/test/locate-reuse-libs.js index f8e9b5486d..87a6a16a63 100644 --- a/packages/ui5-application-writer/templates/optional/loadReuseLibs/webapp/test/locate-reuse-libs.js +++ b/packages/ui5-application-writer/templates/optional/loadReuseLibs/webapp/test/locate-reuse-libs.js @@ -59,32 +59,35 @@ return libOrCompKeysStringTmp; } return new Promise(function (resolve, reject) { - $.ajax(url) - .done(function (manifest) { - if (manifest) { - if ( - manifest["sap.ui5"] && - manifest["sap.ui5"].dependencies - ) { - if (manifest["sap.ui5"].dependencies.libs) { - result = getKeys(manifest["sap.ui5"].dependencies.libs, result); + + sap.ui.require(["sap/ui/thirdparty/jquery"], function (localJQuery) { + localJQuery.ajax(url) + .done(function (manifest) { + if (manifest) { + if ( + manifest["sap.ui5"] && + manifest["sap.ui5"].dependencies + ) { + if (manifest["sap.ui5"].dependencies.libs) { + result = getKeys(manifest["sap.ui5"].dependencies.libs, result); + } + if (manifest["sap.ui5"].dependencies.components) { + result = getKeys(manifest["sap.ui5"].dependencies.components, result); + } } - if (manifest["sap.ui5"].dependencies.components) { - result = getKeys(manifest["sap.ui5"].dependencies.components, result); + if ( + manifest["sap.ui5"] && + manifest["sap.ui5"].componentUsages + ) { + result = getComponentUsageNames(manifest["sap.ui5"].componentUsages, result); } } - if ( - manifest["sap.ui5"] && - manifest["sap.ui5"].componentUsages - ) { - result = getComponentUsageNames(manifest["sap.ui5"].componentUsages, result); - } - } - resolve(result); - }) - .fail(function () { - reject(new Error("Could not fetch manifest at '" + manifestPath)); - }); + resolve(result); + }) + .fail(function () { + reject(new Error("Could not fetch manifest at '" + manifestPath)); + }); + }); }); }; function registerModules(dataFromAppIndex) { @@ -127,18 +130,19 @@ return new Promise( function (resolve) { - sap.ui.require(["sap/base/util/UriParameters"], function (UriParameters) { - sapClient = UriParameters.fromQuery(window.location.search).get("sap-client"); - if (sapClient && sapClient.length === 3) { - url = url + "&sap-client=" + sapClient; - } - resolve(url); - }); + sapClient = new URLSearchParams(window.location.search).get("sap-client"); + if (sapClient && sapClient.length === 3) { + url = url + "&sap-client=" + sapClient; + } + resolve(url); }).then(function (url2) { - return $.ajax(url2).done(function (data) { - if (data) { - registerModules(data); - } + sap.ui.require(["sap/ui/thirdparty/jquery"], function (localJQuery) { + return localJQuery.ajax(url2) + .done(function (data) { + if (data) { + registerModules(data); + } + }); }); }); } else { @@ -176,6 +180,10 @@ var manifestUri = currentScript.getAttribute("data-sap-ui-manifest-uri"); var componentName = currentScript.getAttribute("data-sap-ui-componentName"); var useMockserver = currentScript.getAttribute("data-sap-ui-use-mockserver"); +// Patch (KW): resourceRoot is needed to load the correct ResourceBundles +var resourceRoot = manifestUri.substring(0, manifestUri.lastIndexOf('/')+1); + + sap.registerComponentDependencyPaths(manifestUri) .catch(function (error) { sap.ui.require(["sap/base/Log"], function (Log) { @@ -185,57 +193,75 @@ sap.registerComponentDependencyPaths(manifestUri) .finally(function () { // setting the app title with internationalization - sap.ui.getCore().attachInit(function () { - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require(["sap/base/i18n/ResourceBundle"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: "i18n/i18n.properties", - locale: sLocale + sap.ui.require(["sap/ui/core/Core"], async function(Core) { + Core.ready(() => { + sap.ui.require(["sap/base/i18n/Localization"], function (Localization) { + sap.ui.require(["sap/base/i18n/ResourceBundle"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + "i18n/i18n.properties", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText("appTitle"); + }); }); - document.title = oResourceBundle.getText("appTitle"); }); - }); + }); - if (componentName && componentName.length > 0) { + if (componentName && componentName.length > 0) { if (useMockserver && useMockserver === "true") { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - sap.ui.require([componentName.replace(/\./g, "/") + "/localService/mockserver"], function (server) { - // set up test service for local testing - server.init(); - // initialize the ushell sandbox component - sap.ushell.Container.createRenderer().placeAt("content"); - }); + sap.ui.require(["sap/ui/core/Core"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([componentName.replace(/\./g, "/") + "/localService/mockserver"], function (server) { + // set up test service for local testing + server.init(); + // initialize the ushell sandbox component + sap.ui.require(["sap/ushell/Container"], async function (Container) { + Container.createRenderer(true).then(function (component) { + component.placeAt("content"); + }); + }); + }); + }); }); } else { // Requiring the ComponentSupport module automatically executes the component initialisation for all declaratively defined components sap.ui.require(["sap/ui/core/ComponentSupport"]); // setting the app title with the i18n text - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require(["sap/base/i18n/ResourceBundle"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: "i18n/i18n.properties", - locale: sLocale + sap.ui.require(["sap/ui/core/Core"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require(["sap/base/i18n/Localization"], function (Localization) { + sap.ui.require(["sap/base/i18n/ResourceBundle"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + "i18n/i18n.properties", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText("appTitle"); + }); }); - document.title = oResourceBundle.getText("appTitle"); }); - }); + }); } } else { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - try { - // initialize the ushell sandbox component in ui5 v2 - sap.ushell.Container.createRenderer(true).then(function (component) { - component.placeAt("content"); + sap.ui.require(["sap/ui/core/Core"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + // initialize the ushell sandbox component + sap.ui.require(["sap/ushell/Container"], async function (Container) { + try { + Container.createRenderer(true).then(function (component) { + component.placeAt("content"); + }); + } catch (error) { + // support older versions of ui5 + Container.createRenderer().placeAt("content"); + } }); - } catch { - // support older versions of ui5 - sap.ushell.Container.createRenderer().placeAt("content"); - } + }); }); } }); \ No newline at end of file diff --git a/packages/ui5-application-writer/test/__snapshots__/options.test.ts.snap b/packages/ui5-application-writer/test/__snapshots__/options.test.ts.snap index 25bc7069a1..ea54e5ba52 100644 --- a/packages/ui5-application-writer/test/__snapshots__/options.test.ts.snap +++ b/packages/ui5-application-writer/test/__snapshots__/options.test.ts.snap @@ -818,32 +818,35 @@ appDescription=Test App Description", return libOrCompKeysStringTmp; } return new Promise(function (resolve, reject) { - $.ajax(url) - .done(function (manifest) { - if (manifest) { - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].dependencies - ) { - if (manifest[\\"sap.ui5\\"].dependencies.libs) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + localJQuery.ajax(url) + .done(function (manifest) { + if (manifest) { + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].dependencies + ) { + if (manifest[\\"sap.ui5\\"].dependencies.libs) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.libs, result); + } + if (manifest[\\"sap.ui5\\"].dependencies.components) { + result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + } } - if (manifest[\\"sap.ui5\\"].dependencies.components) { - result = getKeys(manifest[\\"sap.ui5\\"].dependencies.components, result); + if ( + manifest[\\"sap.ui5\\"] && + manifest[\\"sap.ui5\\"].componentUsages + ) { + result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); } } - if ( - manifest[\\"sap.ui5\\"] && - manifest[\\"sap.ui5\\"].componentUsages - ) { - result = getComponentUsageNames(manifest[\\"sap.ui5\\"].componentUsages, result); - } - } - resolve(result); - }) - .fail(function () { - reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); - }); + resolve(result); + }) + .fail(function () { + reject(new Error(\\"Could not fetch manifest at '\\" + manifestPath)); + }); + }); }); }; function registerModules(dataFromAppIndex) { @@ -886,18 +889,19 @@ appDescription=Test App Description", return new Promise( function (resolve) { - sap.ui.require([\\"sap/base/util/UriParameters\\"], function (UriParameters) { - sapClient = UriParameters.fromQuery(window.location.search).get(\\"sap-client\\"); - if (sapClient && sapClient.length === 3) { - url = url + \\"&sap-client=\\" + sapClient; - } - resolve(url); - }); + sapClient = new URLSearchParams(window.location.search).get(\\"sap-client\\"); + if (sapClient && sapClient.length === 3) { + url = url + \\"&sap-client=\\" + sapClient; + } + resolve(url); }).then(function (url2) { - return $.ajax(url2).done(function (data) { - if (data) { - registerModules(data); - } + sap.ui.require([\\"sap/ui/thirdparty/jquery\\"], function (localJQuery) { + return localJQuery.ajax(url2) + .done(function (data) { + if (data) { + registerModules(data); + } + }); }); }); } else { @@ -935,6 +939,10 @@ var manifestUri = currentScript.getAttribute(\\"data-sap-ui-manifest-uri\\"); var componentName = currentScript.getAttribute(\\"data-sap-ui-componentName\\"); var useMockserver = currentScript.getAttribute(\\"data-sap-ui-use-mockserver\\"); +// Patch (KW): resourceRoot is needed to load the correct ResourceBundles +var resourceRoot = manifestUri.substring(0, manifestUri.lastIndexOf('/')+1); + + sap.registerComponentDependencyPaths(manifestUri) .catch(function (error) { sap.ui.require([\\"sap/base/Log\\"], function (Log) { @@ -944,57 +952,75 @@ sap.registerComponentDependencyPaths(manifestUri) .finally(function () { // setting the app title with internationalization - sap.ui.getCore().attachInit(function () { - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); - if (componentName && componentName.length > 0) { + if (componentName && componentName.length > 0) { if (useMockserver && useMockserver === \\"true\\") { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { - // set up test service for local testing - server.init(); - // initialize the ushell sandbox component - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - }); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([componentName.replace(/\\\\./g, \\"/\\") + \\"/localService/mockserver\\"], function (server) { + // set up test service for local testing + server.init(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + }); + }); + }); }); } else { // Requiring the ComponentSupport module automatically executes the component initialisation for all declaratively defined components sap.ui.require([\\"sap/ui/core/ComponentSupport\\"]); // setting the app title with the i18n text - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - var sLocale = sap.ui.getCore().getConfiguration().getLanguage(); - sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { - var oResourceBundle = ResourceBundle.create({ - url: \\"i18n/i18n.properties\\", - locale: sLocale + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + sap.ui.require([\\"sap/base/i18n/Localization\\"], function (Localization) { + sap.ui.require([\\"sap/base/i18n/ResourceBundle\\"], function (ResourceBundle) { + var oResourceBundle = ResourceBundle.create({ + // Patch (KW): resourceRoot is needed to load the correct ResourceBundles + url: resourceRoot + \\"i18n/i18n.properties\\", + locale: Localization.getLanguage() + }); + document.title = oResourceBundle.getText(\\"appTitle\\"); + }); }); - document.title = oResourceBundle.getText(\\"appTitle\\"); }); - }); + }); } } else { - sap.ui.getCore().attachInit(function () { - registerSAPFonts(); - try { - // initialize the ushell sandbox component in ui5 v2 - sap.ushell.Container.createRenderer(true).then(function (component) { - component.placeAt(\\"content\\"); + sap.ui.require([\\"sap/ui/core/Core\\"], async function(Core) { + Core.ready(() => { + registerSAPFonts(); + // initialize the ushell sandbox component + sap.ui.require([\\"sap/ushell/Container\\"], async function (Container) { + try { + Container.createRenderer(true).then(function (component) { + component.placeAt(\\"content\\"); + }); + } catch (error) { + // support older versions of ui5 + Container.createRenderer().placeAt(\\"content\\"); + } }); - } catch { - // support older versions of ui5 - sap.ushell.Container.createRenderer().placeAt(\\"content\\"); - } + }); }); } });", diff --git a/packages/ui5-library-writer/test/common.ts b/packages/ui5-library-writer/test/common.ts index e73408c1b9..4deb8d8596 100644 --- a/packages/ui5-library-writer/test/common.ts +++ b/packages/ui5-library-writer/test/common.ts @@ -42,6 +42,10 @@ export const projectChecks = async (rootPath: string, config: UI5LibConfig, debu console.log('stdout:', npmResult.stdout); console.log('stderr:', npmResult.stderr); } + // Check UI5 Linter + npmResult = await exec(`npx @ui5/linter`, { cwd: rootPath }); + console.log('stdout:', npmResult.stdout); + console.log('stderr:', npmResult.stderr); } catch (error) { console.log('stdout:', error?.stdout); console.log('stderr:', error?.stderr);