Cross app navigation (#632)

* cross app navigation

* abalint fix
This commit is contained in:
oblomov 2023-11-07 11:51:47 +01:00 committed by GitHub
parent 4ff68e7de5
commit 98cf374f29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 27 additions and 7 deletions

View File

@ -24,6 +24,7 @@ CLASS z2ui5_cl_fw_http_handler DEFINITION
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
@ -248,6 +249,23 @@ CLASS Z2UI5_CL_FW_HTTP_HANDLER IMPLEMENTATION.
` onEventFrontend: (...args) => {` && |\n| &&
custom_js_oneventfrontend &&
` switch (args[0].EVENT) {` && |\n| &&
` case 'CROSS_APP_NAV_TO_PREV_APP': ` && |\n| &&
` var oCrossAppNavigator = sap.ushell.Container.getService("CrossApplicationNavigation"); ` && |\n| &&
` oCrossAppNavigator.backToPreviousApp();` && |\n| &&
` break;` && |\n| &&
` case 'CROSS_APP_NAV_TO_EXT': ` && |\n| &&
` var oCrossAppNavigator = sap.ushell.Container.getService("CrossApplicationNavigation");` && |\n| &&
|\n| &&
` const hash = ( oCrossAppNavigator.hrefForExternal({` && |\n| &&
` target: args[1],` && |\n| &&
` params: args[2]` && |\n| &&
` })) || "";` && |\n| &&
|\n| &&
` oCrossAppNavigator.toExternal({` && |\n| &&
` target: {` && |\n| &&
` shellHash: hash` && |\n| &&
` }` && |\n| &&
` }); break;` && |\n| &&
` case 'LOCATION_RELOAD':` && |\n| &&
` window.location = args[1];` && |\n| &&
` break;` && |\n| &&

View File

@ -3,13 +3,15 @@ INTERFACE z2ui5_if_client
CONSTANTS:
BEGIN OF cs_event,
popup_close TYPE string VALUE `POPUP_CLOSE`,
open_new_tab TYPE string VALUE `OPEN_NEW_TAB`,
popover_close TYPE string VALUE `POPOVER_CLOSE`,
location_reload TYPE string VALUE `LOCATION_RELOAD`,
nav_container_to TYPE string VALUE `NAV_CONTAINER_TO`,
nest_nav_container_to TYPE string VALUE `NEST_NAV_CONTAINER_TO`,
nest2_nav_container_to TYPE string VALUE `NEST2_NAV_CONTAINER_TO`,
popup_close TYPE string VALUE `POPUP_CLOSE`,
open_new_tab TYPE string VALUE `OPEN_NEW_TAB`,
popover_close TYPE string VALUE `POPOVER_CLOSE`,
location_reload TYPE string VALUE `LOCATION_RELOAD`,
nav_container_to TYPE string VALUE `NAV_CONTAINER_TO`,
nest_nav_container_to TYPE string VALUE `NEST_NAV_CONTAINER_TO`,
nest2_nav_container_to TYPE string VALUE `NEST2_NAV_CONTAINER_TO`,
CROSS_APP_NAV_TO_EXT TYPE string VALUE `CROSS_APP_NAV_TO_EXT`,
CROSS_APP_NAV_TO_PREV_APP TYPE string VALUE `CROSS_APP_NAV_TO_PREV_APP`,
END OF cs_event.
CONSTANTS: