mirror of
https://github.com/abap2UI5/abap2UI5.git
synced 2025-04-29 22:04:38 +08:00
fix launchpad compatibility+busy handling (#962)
This commit is contained in:
parent
190bb68dbc
commit
650b62a163
|
@ -90,9 +90,9 @@ CLASS z2ui5_cl_core_client IMPLEMENTATION.
|
|||
|
||||
METHOD z2ui5_if_client~nav_app_leave.
|
||||
|
||||
if app is not bound.
|
||||
app = z2ui5_if_client~get_app( z2ui5_if_client~get( )-s_draft-id_prev_app_stack ).
|
||||
endif.
|
||||
IF app IS NOT BOUND.
|
||||
app = z2ui5_if_client~get_app( z2ui5_if_client~get( )-s_draft-id_prev_app_stack ).
|
||||
ENDIF.
|
||||
|
||||
mo_action->ms_next-o_app_leave = app.
|
||||
|
||||
|
@ -214,6 +214,16 @@ CLASS z2ui5_cl_core_client IMPLEMENTATION.
|
|||
|
||||
mo_action->ms_next-s_set-s_view-check_update_model = abap_true.
|
||||
|
||||
IF path IS NOT INITIAL.
|
||||
try.
|
||||
DATA(lv_bind) = z2ui5_if_client~_bind( val = path path = abap_true ).
|
||||
catch cx_root.
|
||||
lv_bind = z2ui5_if_client~_bind_edit( val = path path = abap_true ).
|
||||
endtry.
|
||||
SHIFT lv_bind LEFT DELETING LEADING `/`.
|
||||
SPLIT lv_bind AT `/` INTO TABLE mo_action->ms_next-s_set-s_view-update_path.
|
||||
ENDIF.
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
|
||||
|
|
|
@ -81,12 +81,7 @@ CLASS Z2UI5_CL_CORE_HTTP_GET IMPLEMENTATION.
|
|||
` try{` && |\n| &&
|
||||
` if (!sap.z2ui5.oResponse.PARAMS) {` && |\n| &&
|
||||
` BusyIndicator.hide();` && |\n| &&
|
||||
` if (sap.z2ui5.isBusy) {` && |\n| &&
|
||||
` sap.z2ui5.isBusy = false;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` if (sap.z2ui5.busyDialog) {` && |\n| &&
|
||||
` sap.z2ui5.busyDialog.close();` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` return;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` const {S_POPUP, S_VIEW_NEST, S_VIEW_NEST2, S_POPOVER} = sap.z2ui5.oResponse.PARAMS;` && |\n| &&
|
||||
|
@ -118,12 +113,7 @@ CLASS Z2UI5_CL_CORE_HTTP_GET IMPLEMENTATION.
|
|||
` await this.displayPopover(S_POPOVER.XML, 'oViewPopover', S_POPOVER.OPEN_BY_ID);` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` BusyIndicator.hide();` && |\n| &&
|
||||
` if (sap.z2ui5.isBusy) {` && |\n| &&
|
||||
` sap.z2ui5.isBusy = false;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` if (sap.z2ui5.busyDialog) {` && |\n| &&
|
||||
` sap.z2ui5.busyDialog.close();` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` sap.z2ui5.isBusy = false;` && |\n| &&
|
||||
` sap.z2ui5.onAfterRendering.forEach(item=>{` && |\n| &&
|
||||
` if (item !== undefined) {` && |\n| &&
|
||||
` item();` && |\n| &&
|
||||
|
@ -309,13 +299,12 @@ CLASS Z2UI5_CL_CORE_HTTP_GET IMPLEMENTATION.
|
|||
` }` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` eB(...args) {` && |\n| &&
|
||||
` if (sap.z2ui5.isBusy) {` && |\n| &&
|
||||
` if (sap.z2ui5.isBusy == true) {` && |\n| &&
|
||||
` sap.z2ui5.busyDialog = new sap.m.BusyDialog();` && |\n| &&
|
||||
` sap.z2ui5.busyDialog.open();` && |\n| &&
|
||||
` let oBusyDialog = new sap.m.BusyDialog();` && |\n| &&
|
||||
` oBusyDialog.open();` && |\n| &&
|
||||
` setTimeout( (oBusyDialog) => { oBusyDialog.close() } , 100 , oBusyDialog );` && |\n| &&
|
||||
` return;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` sap.z2ui5.isBusy = true;` && |\n| &&
|
||||
` if (!window.navigator.onLine) {` && |\n| &&
|
||||
` sap.m.MessageBox.alert('No internet connection! Please reconnect to the server and try again.');` && |\n| &&
|
||||
|
@ -367,7 +356,12 @@ CLASS Z2UI5_CL_CORE_HTTP_GET IMPLEMENTATION.
|
|||
` updateModelIfRequired(paramKey, oView) {` && |\n| &&
|
||||
` if (sap.z2ui5.oResponse.PARAMS == undefined) { return; }` && |\n| &&
|
||||
` if (sap.z2ui5.oResponse.PARAMS[paramKey]?.CHECK_UPDATE_MODEL) {` && |\n| &&
|
||||
` let model = new JSONModel(sap.z2ui5.oResponse.OVIEWMODEL);` && |\n| &&
|
||||
` var data = sap.z2ui5.oView.getModel().getData();` && |\n| &&
|
||||
` if (sap.z2ui5.oResponse.PARAMS.S_VIEW.UPDATE_PATH ) { ` && |\n| &&
|
||||
` data[ sap.z2ui5.oResponse.PARAMS.S_VIEW.UPDATE_PATH[ 0 ] ] = sap.z2ui5.oResponse.OVIEWMODEL[ sap.z2ui5.oResponse.PARAMS.S_VIEW.UPDATE_PATH[ 0 ] ] } ` && |\n| &&
|
||||
` else { data = sap.z2ui5.oResponse.OVIEWMODEL; } ` && |\n| &&
|
||||
` let model = new JSONModel(data);` && |\n| &&
|
||||
` // let model = new JSONModel(sap.z2ui5.oResponse.OVIEWMODEL);` && |\n| &&
|
||||
` model.setSizeLimit(sap.z2ui5.JSON_MODEL_LIMIT);` && |\n| &&
|
||||
` oView.setModel(model);` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
|
@ -451,7 +445,7 @@ CLASS Z2UI5_CL_CORE_HTTP_GET IMPLEMENTATION.
|
|||
` APP_START: sap.z2ui5?.oBody?.APP_START,` && |\n| &&
|
||||
` XX: sap.z2ui5?.oBody?.XX,` && |\n| &&
|
||||
` ORIGIN: window.location.origin,` && |\n| &&
|
||||
` PATHNAME: sap.z2ui5.pathname,` && |\n| &&
|
||||
` PATHNAME: window.location.pathname, // sap.z2ui5.pathname,` && |\n| &&
|
||||
` SEARCH: (sap.z2ui5.search) ? sap.z2ui5.search : window.location.search,` && |\n| &&
|
||||
` VIEW: sap.z2ui5.oBody.VIEWNAME,` && |\n| &&
|
||||
` T_STARTUP_PARAMETERS: sap.z2ui5.startupParameters,` && |\n| &&
|
||||
|
|
|
@ -87,8 +87,22 @@ CLASS z2ui5_cl_core_http_post IMPLEMENTATION.
|
|||
s_front-params = mo_action->ms_next-s_set
|
||||
s_front-id = mo_action->mo_app->ms_draft-id
|
||||
s_front-app = z2ui5_cl_util=>rtti_get_classname_by_ref( mo_action->mo_app->mo_app )
|
||||
s_front-app_start = ms_request-s_control-app_start
|
||||
model = mo_action->mo_app->model_json_stringify( ) ).
|
||||
s_front-app_start = ms_request-s_control-app_start ).
|
||||
|
||||
IF ms_response-s_front-params-s_view-check_update_model = abap_true
|
||||
OR ms_response-s_front-params-s_view_nest-check_update_model = abap_true
|
||||
OR ms_response-s_front-params-s_view_nest2-check_update_model = abap_true
|
||||
OR ms_response-s_front-params-s_popup-check_update_model = abap_true
|
||||
OR ms_response-s_front-params-s_popover-check_update_model = abap_true
|
||||
OR ms_response-s_front-params-s_view-xml IS NOT INITIAL
|
||||
OR ms_response-s_front-params-s_view_nest-xml IS NOT INITIAL
|
||||
OR ms_response-s_front-params-s_view_nest2-xml IS NOT INITIAL
|
||||
OR ms_response-s_front-params-s_popup-xml IS NOT INITIAL
|
||||
OR ms_response-s_front-params-s_popover-xml IS NOT INITIAL.
|
||||
ms_response-model = mo_action->mo_app->model_json_stringify( ).
|
||||
ELSE.
|
||||
ms_response-model = `{}`.
|
||||
ENDIF.
|
||||
|
||||
DATA(lo_json_mapper) = NEW z2ui5_cl_core_json_srv( ).
|
||||
mv_response = lo_json_mapper->response_abap_to_json( ms_response ).
|
||||
|
|
|
@ -51,6 +51,7 @@ INTERFACE z2ui5_if_core_types
|
|||
xml TYPE string,
|
||||
check_destroy TYPE abap_bool,
|
||||
check_update_model TYPE abap_bool,
|
||||
update_path TYPE string_table,
|
||||
END OF s_view,
|
||||
BEGIN OF s_view_nest,
|
||||
xml TYPE string,
|
||||
|
|
|
@ -120,7 +120,10 @@ CLASS Z2UI5_CL_FW_CC_DEBUGGING_TOOLS IMPLEMENTATION.
|
|||
` if (selItem == 'SOURCE') {` && |\n| &&
|
||||
` let content= oEvent.getSource().getParent().getItems()[1].getItems()[0].getProperty( "content");` && |\n| &&
|
||||
` let url = window.location.origin + "/sap/bc/adt/oo/classes/" + sap.z2ui5.responseData.S_FRONT.APP + "/source/main";` && |\n| &&
|
||||
` content = '<iframe id="test" src="' + url + '" height="800px" width="1200px" />'` && |\n| &&
|
||||
* ` content = '<iframe id="test" src="' + url + '" height="800px" width="1200px" />'` && |\n| &&
|
||||
` content = atob( 'PGlmcmFtZSBpZD0idGVzdCIgc3JjPSInICsgdXJsICsgJyIgaGVpZ2h0PSI4MDBweCIgd2lkdGg9IjEyMDBweCIgLz4=' );` && |\n| &&
|
||||
* ` content = '<iframe id="test" src="' + url + '" height="800px" width="1200px" />'` && |\n| &&
|
||||
` content = content.replace( "' + url + '" , url );` && |\n| &&
|
||||
` oEvent.getSource().getParent().getItems()[1].getItems()[0].setProperty( "content" , content );` && |\n| &&
|
||||
` oEvent.getSource().getModel().oData.editor_visible = false;` && |\n| &&
|
||||
` oEvent.getSource().getModel().oData.source_visible = true;` && |\n| &&
|
||||
|
|
|
@ -33,7 +33,9 @@ INTERFACE z2ui5_if_client
|
|||
IMPORTING
|
||||
val TYPE clike.
|
||||
|
||||
METHODS view_model_update.
|
||||
METHODS view_model_update
|
||||
IMPORTING
|
||||
path TYPE data OPTIONAL.
|
||||
|
||||
METHODS nest_view_display
|
||||
IMPORTING
|
||||
|
@ -84,7 +86,7 @@ INTERFACE z2ui5_if_client
|
|||
|
||||
METHODS nav_app_leave
|
||||
IMPORTING
|
||||
value(app) TYPE REF TO z2ui5_if_app OPTIONAL
|
||||
VALUE(app) TYPE REF TO z2ui5_if_app OPTIONAL
|
||||
RETURNING
|
||||
VALUE(result) TYPE string.
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user