Refactoring (#877)

* refactoring

* refactoring

* update

* update

* update

* update

* update

* Update changelog.txt
This commit is contained in:
oblomov 2024-02-08 19:46:24 +01:00 committed by GitHub
parent 7d16383978
commit e7f1ae439d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
14 changed files with 305 additions and 79 deletions

View File

@ -14,7 +14,8 @@
<item>/.gitlab-ci.yml</item>
<item>/abaplint.json</item>
<item>/azure-pipelines.yml</item>
<item>/resources</item>
<item>/src/01/z2ui5_cl_fw_font_awsome_icons.clas.abap</item>
<item>/src/01/z2ui5_cl_fw_font_awsome_icons.clas.xml</item>
</IGNORE>
<VERSION_CONSTANT>Z2UI5_IF_APP=&gt;VERSION</VERSION_CONSTANT>
</DATA>

View File

@ -9,6 +9,13 @@ Legend
- : removed
2024-02-08 v1.118.0
-------------------
! /ui2/cl_json replaced with aJson
* Compatibility Fixes for Low Releases
2024-02-02 v1.117.0
-------------------

View File

@ -5,6 +5,10 @@ CLASS z2ui5_cl_core_draft_srv DEFINITION
PUBLIC SECTION.
METHODS count
RETURNING
VALUE(result) TYPE i.
METHODS create
IMPORTING
!draft TYPE z2ui5_if_types=>ty_s_draft
@ -47,7 +51,7 @@ CLASS z2ui5_cl_core_draft_srv IMPLEMENTATION.
time = z2ui5_cl_util=>time_get_timestampl( )
seconds = 60 * 60 * 4 ).
DELETE FROM z2ui5_t_fw_01 WHERE timestampl < @lv_four_hours_ago.
DELETE FROM z2ui5_t_core_01 WHERE timestampl < @lv_four_hours_ago.
COMMIT WORK.
ENDMETHOD.
@ -55,7 +59,7 @@ CLASS z2ui5_cl_core_draft_srv IMPLEMENTATION.
METHOD create.
DATA(ls_db) = VALUE z2ui5_t_fw_01(
DATA(ls_db) = VALUE z2ui5_if_core_types=>ty_s_db(
id = draft-id
id_prev = draft-id_prev
id_prev_app = draft-id_prev_app
@ -65,7 +69,7 @@ CLASS z2ui5_cl_core_draft_srv IMPLEMENTATION.
data = model_xml
).
MODIFY z2ui5_t_fw_01 FROM @ls_db.
MODIFY z2ui5_t_core_01 FROM @ls_db.
IF sy-subrc <> 0.
RAISE EXCEPTION TYPE z2ui5_cx_util_error
EXPORTING
@ -81,14 +85,14 @@ CLASS z2ui5_cl_core_draft_srv IMPLEMENTATION.
IF check_load_app = abap_true.
SELECT SINGLE *
FROM z2ui5_t_fw_01
FROM z2ui5_t_core_01
WHERE id = @id
INTO @result.
ELSE.
SELECT SINGLE id, id_prev, id_prev_app, id_prev_app_stack
FROM z2ui5_t_fw_01
FROM z2ui5_t_core_01
WHERE id = @id
INTO CORRESPONDING FIELDS OF @result.
@ -120,4 +124,13 @@ CLASS z2ui5_cl_core_draft_srv IMPLEMENTATION.
result = CORRESPONDING #( ls_db ).
ENDMETHOD.
METHOD count.
SELECT
COUNT( * )
FROM z2ui5_t_core_01
INTO @result.
ENDMETHOD.
ENDCLASS.

View File

@ -91,10 +91,11 @@ CLASS z2ui5_cl_core_action IMPLEMENTATION.
result->ms_actual-check_on_navigated = abap_true.
CATCH cx_root.
CATCH cx_root into data(x).
RAISE EXCEPTION TYPE z2ui5_cx_util_error
EXPORTING
val = `App with name ` && mo_http_post->ms_request-s_control-app_start && ` not found...`.
val = `App with name ` && mo_http_post->ms_request-s_control-app_start && ` not found...`
previous = x.
ENDTRY.
ENDMETHOD.

View File

@ -49,7 +49,7 @@ CLASS z2ui5_cl_core_http_get IMPLEMENTATION.
` async onAfterRendering() {` && |\n| &&
` try{` && |\n| &&
` if (!sap.z2ui5.oResponse.PARAMS) {` && |\n| &&
` BusyIndicator.hide();` && |\n| &&
` BusyIndicator.hide();` && |\n| &&
` if (sap.z2ui5.isBusy) {` && |\n| &&
` sap.z2ui5.isBusy = false;` && |\n| &&
` }` && |\n| &&
@ -112,7 +112,7 @@ CLASS z2ui5_cl_core_http_get IMPLEMENTATION.
` let oview_model = new JSONModel(sap.z2ui5.oResponse.OVIEWMODEL);` && |\n| &&
` oview_model.setSizeLimit(sap.z2ui5.JSON_MODEL_LIMIT);` && |\n| &&
` oFragment.setModel(oview_model);` && |\n| &&
` let oControl = openById ? this.getControlById(openById) : null;` && |\n| &&
` let oControl = openById ? sap.z2ui5.oView.byId(openById) : null;` && |\n| &&
` if (oControl) {` && |\n| &&
` oFragment.openBy(oControl);` && |\n| &&
` } else {` && |\n| &&
@ -129,7 +129,7 @@ CLASS z2ui5_cl_core_http_get IMPLEMENTATION.
` let oview_model = new JSONModel(sap.z2ui5.oResponse.OVIEWMODEL);` && |\n| &&
` oview_model.setSizeLimit(sap.z2ui5.JSON_MODEL_LIMIT);` && |\n| &&
` oFragment.setModel(oview_model);` && |\n| &&
` let oControl = openById ? this.getControlById(openById) : null;` && |\n| &&
` let oControl = openById ? sap.z2ui5.oView.byId(openById) : null;` && |\n| &&
` if (oControl) {` && |\n| &&
` oFragment.openBy(oControl);` && |\n| &&
` } else {` && |\n| &&
@ -145,7 +145,6 @@ CLASS z2ui5_cl_core_http_get IMPLEMENTATION.
` let oview_model = new JSONModel(sap.z2ui5.oResponse.OVIEWMODEL);` && |\n| &&
` oview_model.setSizeLimit(sap.z2ui5.JSON_MODEL_LIMIT);` && |\n| &&
` oView.setModel(oview_model);` && |\n| &&
|\n| &&
` let oParent = sap.z2ui5.oView.byId(sap.z2ui5.oResponse.PARAMS[viewNestId].ID);` && |\n| &&
` if (oParent) {` && |\n| &&
` try {` && |\n| &&
@ -163,7 +162,6 @@ CLASS z2ui5_cl_core_http_get IMPLEMENTATION.
` let oview_model = new JSONModel(sap.z2ui5.oResponse.OVIEWMODEL);` && |\n| &&
` oview_model.setSizeLimit(sap.z2ui5.JSON_MODEL_LIMIT);` && |\n| &&
` oView.setModel(oview_model);` && |\n| &&
|\n| &&
` let oParent = sap.z2ui5.oView.byId(sap.z2ui5.oResponse.PARAMS[viewNestId].ID);` && |\n| &&
` if (oParent) {` && |\n| &&
` try {` && |\n| &&
@ -173,18 +171,6 @@ CLASS z2ui5_cl_core_http_get IMPLEMENTATION.
` }` && |\n| &&
` sap.z2ui5[viewProp] = oView;` && |\n| &&
` },` && |\n| &&
` getControlById(id) {` && |\n| &&
` let oControl = sap.z2ui5.oView.byId(id);` && |\n| &&
` if (!oControl) {` && |\n| &&
` oControl = sap.ui.getCore().byId(id);` && |\n| &&
* ` debugger;` && |\n| &&
` }` && |\n| &&
` if (!oControl) {` && |\n| &&
` oControl = sap.z2ui5.oViewNest.byId(id) || sap.z2ui5.oViewNest2.byId(id);` && |\n| &&
` }` && |\n| &&
` return oControl;` && |\n| &&
` },` && |\n| &&
|\n| &&
` PopupDestroy() {` && |\n| &&
` if (!sap.z2ui5.oViewPopup) {` && |\n| &&
` return;` && |\n| &&
@ -226,14 +212,12 @@ CLASS z2ui5_cl_core_http_get IMPLEMENTATION.
` sap.z2ui5.oView.destroy();` && |\n| &&
` },` && |\n| &&
` onEventFrontend(...args) {` && |\n| &&
|\n| &&
` sap.z2ui5.onBeforeEventFrontend.forEach(item => {` && |\n| &&
` if (item !== undefined) {` && |\n| &&
` item(args);` && |\n| &&
` }` && |\n| &&
` }` && |\n| &&
` )` && |\n| &&
|\n| &&
` let oCrossAppNavigator;` && |\n| &&
` switch (args[0].EVENT) {` && |\n| &&
` case 'CROSS_APP_NAV_TO_PREV_APP':` && |\n| &&
@ -338,7 +322,6 @@ CLASS z2ui5_cl_core_http_get IMPLEMENTATION.
` }` && |\n| &&
` sap.z2ui5.oBody.ID = sap.z2ui5.oResponse.ID;` && |\n| &&
` sap.z2ui5.oBody.ARGUMENTS = args;` && |\n| &&
|\n| &&
` sap.z2ui5.oResponseOld = sap.z2ui5.oResponse;` && |\n| &&
` sap.z2ui5.oResponse = {};` && |\n| &&
` sap.z2ui5.oController.Roundtrip();` && |\n| &&
@ -354,14 +337,12 @@ CLASS z2ui5_cl_core_http_get IMPLEMENTATION.
` oView.setModel(model);` && |\n| &&
` }` && |\n| &&
` },` && |\n| &&
` async responseSuccess(response) {` && |\n| &&
` async responseSuccess(response) {` && |\n| &&
` try{` && |\n| &&
` sap.z2ui5.oResponse = response;` && |\n| &&
|\n| &&
` if (sap.z2ui5.oResponse.PARAMS?.S_VIEW?.CHECK_DESTROY) {` && |\n| &&
` sap.z2ui5.oController.ViewDestroy();` && |\n| &&
` }` && |\n| &&
|\n| &&
` sap.z2ui5.oController.showMessage('S_MSG_TOAST', sap.z2ui5.oResponse.PARAMS);` && |\n| &&
` sap.z2ui5.oController.showMessage('S_MSG_BOX', sap.z2ui5.oResponse.PARAMS);` && |\n| &&
` if (sap.z2ui5.oResponse.PARAMS?.S_VIEW?.XML) { if ( sap.z2ui5.oResponse.PARAMS?.S_VIEW?.XML !== '') {` && |\n| &&
@ -374,7 +355,7 @@ CLASS z2ui5_cl_core_http_get IMPLEMENTATION.
` this.updateModelIfRequired('S_POPUP', sap.z2ui5.oViewPopup);` && |\n| &&
` this.updateModelIfRequired('S_POPOVER', sap.z2ui5.oViewPopover);` && |\n| &&
` sap.z2ui5.oController.onAfterRendering();` && |\n| &&
` }catch(e){ BusyIndicator.hide(); MessageBox.error(e.toLocaleString()); }` && |\n| &&
` }catch(e){ BusyIndicator.hide(); MessageBox.error(e.toLocaleString()); }` && |\n| &&
` },` && |\n| &&
` showMessage(msgType, params) {` && |\n| &&
` if (params == undefined) { return; }` && |\n| &&
@ -390,11 +371,11 @@ CLASS z2ui5_cl_core_http_get IMPLEMENTATION.
` const oView = await XMLView.create({` && |\n| &&
` definition: xml,` && |\n| &&
` controller: sap.z2ui5.oController,` && |\n| &&
` id: 'mainView',` && |\n| &&
` });` && |\n| &&
` let oview_model = new JSONModel(viewModel);` && |\n| &&
` oview_model.setSizeLimit(sap.z2ui5.JSON_MODEL_LIMIT);` && |\n| &&
` oView.setModel(oview_model);` && |\n| &&
|\n| &&
` if (sap.z2ui5.oParent) {` && |\n| &&
` sap.z2ui5.oParent.removeAllPages();` && |\n| &&
` sap.z2ui5.oParent.insertPage(oView);` && |\n| &&
@ -411,54 +392,37 @@ CLASS z2ui5_cl_core_http_get IMPLEMENTATION.
` },` && |\n| &&
` body: JSON.stringify(sap.z2ui5.oBody)` && |\n| &&
` });` && |\n| &&
|\n| &&
` if (!response.ok) {` && |\n| &&
` const responseText = await response.text();` && |\n| &&
` sap.z2ui5.oController.responseError(responseText);` && |\n| &&
` } else {` && |\n| &&
` const responseData = await response.json();` && |\n| &&
* ` debugger;` && |\n| &&
` sap.z2ui5.oController.responseSuccess({` && |\n| &&
` ID : responseData.S_FRONTEND.ID,` && |\n| &&
` PARAMS : responseData.S_FRONTEND.PARAMS,` && |\n| &&
` OVIEWMODEL : responseData.MODEL,` && |\n| &&
` });` && |\n| &&
` }` && |\n| &&
|\n| &&
` },` && |\n| &&
|\n| &&
` Roundtrip() {` && |\n| &&
|\n| &&
` sap.z2ui5.checkTimerActive = false;` && |\n| &&
` sap.z2ui5.checkNestAfter = false;` && |\n| &&
` sap.z2ui5.checkNestAfter2 = false;` && |\n| &&
|\n| &&
` sap.z2ui5.oBody.OLOCATION = {` && |\n| &&
` ORIGIN: window.location.origin,` && |\n| &&
` PATHNAME: sap.z2ui5.pathname,` && |\n| &&
` SEARCH: window.location.search,` && |\n| &&
` // VERSION: sap.ui.getVersionInfo().gav,` && |\n| &&
` T_STARTUP_PARAMETERS: sap.z2ui5.startupParameters,` && |\n| &&
` };` && |\n| &&
` if (sap.z2ui5.search) {` && |\n| &&
` sap.z2ui5.oBody.OLOCATION.SEARCH = sap.z2ui5.search;` && |\n| &&
` }` && |\n| &&
` let event = (args) => { if ( args != undefined ) { return args[ 0 ].EVENT; } };` && |\n| &&
` sap.z2ui5.oBody.S_FRONTEND = {` && |\n| &&
` ID: sap.z2ui5?.oBody?.ID,` && |\n| &&
` APP_START: sap.z2ui5?.oBody?.APP_START,` && |\n| &&
` EDIT: sap.z2ui5?.oBody?.EDIT,` && |\n| &&
` ORIGIN: sap.z2ui5.oBody.OLOCATION.ORIGIN,` && |\n| &&
` PATHNAME: sap.z2ui5.oBody.OLOCATION.PATHNAME,` && |\n| &&
` SEARCH: sap.z2ui5.oBody.OLOCATION.SEARCH,` && |\n| &&
` ORIGIN: window.location.origin,` && |\n| &&
` 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.oBody.OLOCATION.T_STARTUP_PARAMETERS,` && |\n| &&
` T_STARTUP_PARAMETERS: sap.z2ui5.startupParameters,` && |\n| &&
` EVENT: event(sap.z2ui5.oBody?.ARGUMENTS),` && |\n| &&
` };` && |\n| &&
` if ( sap.z2ui5.oBody?.ARGUMENTS != undefined ) { if ( sap.z2ui5.oBody?.ARGUMENTS.length > 0 ) { sap.z2ui5.oBody?.ARGUMENTS.shift(); } }` && |\n| &&
` sap.z2ui5.oBody.S_FRONTEND.T_EVENT_ARG = sap.z2ui5.oBody?.ARGUMENTS;` && |\n| &&
` delete sap.z2ui5.oBody.ID;` && |\n| &&
` delete sap.z2ui5.oBody?.OLOCATION;` && |\n| &&
` delete sap.z2ui5.oBody?.VIEWNAME;` && |\n| &&
` delete sap.z2ui5.oBody?.APP_START;` && |\n| &&
` sap.z2ui5.oController.readHttp();` && |\n| &&
@ -518,8 +482,8 @@ CLASS z2ui5_cl_core_http_get IMPLEMENTATION.
IF lt_config IS INITIAL.
lt_config = VALUE #(
* ( n = `src` v = `https://sdk.openui5.org/nightly/2/resources/sap-ui-core.js` )
* ( n = `src` v = `https://sdk.openui5.org/resources/sap-ui-cachebuster/sap-ui-core.js` )
( n = `src` v = `https://ui5.sap.com/1.120.0/resources/sap-ui-core.js` )
( n = `src` v = `https://sdk.openui5.org/resources/sap-ui-cachebuster/sap-ui-core.js` )
* ( n = `src` v = `https://ui5.sap.com/1.120.0/resources/sap-ui-core.js` )
( n = `data-sap-ui-theme` v = `sap_horizon` )
( n = `data-sap-ui-async` v = `true` )
( n = `data-sap-ui-bindingSyntax` v = `complex` )

View File

@ -13,6 +13,7 @@ CLASS ltcl_test_http_get DEFINITION FINAL FOR TESTING
METHODS js_no_sap_ui_get_core FOR TESTING RAISING cx_static_check.
METHODS js_no_window FOR TESTING RAISING cx_static_check.
METHODS js_no_document FOR TESTING RAISING cx_static_check.
METHODS bootstrap_with_open_ui5 FOR TESTING RAISING cx_static_check.
METHODS js_no_jquery FOR TESTING RAISING cx_static_check.
ENDCLASS.
@ -70,9 +71,9 @@ CLASS ltcl_test_http_get IMPLEMENTATION.
DATA(lo_get) = NEW z2ui5_cl_core_http_get( ).
DATA(lv_index_html) = to_upper( lo_get->main( ) ) ##NEEDED.
* IF lv_index_html CS `SAP.UI.GETCORE`.
* cl_abap_unit_assert=>fail( 'sap.ui.get.core not allowed' ).
* ENDIF.
IF lv_index_html CS `SAP.UI.GETCORE`.
cl_abap_unit_assert=>fail( 'sap.ui.get.core not allowed' ).
ENDIF.
ENDMETHOD.
@ -106,4 +107,20 @@ CLASS ltcl_test_http_get IMPLEMENTATION.
ENDMETHOD.
METHOD bootstrap_with_open_ui5.
DATA(lo_get) = NEW z2ui5_cl_core_http_get( ).
DATA(lv_index_html) = to_upper( lo_get->main( ) ) ##NEEDED.
DATA(lv_check) = xsdbool( lv_index_html CS `HTTPS://SDK.OPENUI5.ORG/RESOURCES` ).
IF lv_check = abap_false.
cl_abap_unit_assert=>fail( 'no bootstrap with openUI5' ).
ENDIF.
lv_check = xsdbool( lv_index_html CS `NIGHTLY` ).
IF lv_check = abap_true.
cl_abap_unit_assert=>fail( 'no bootstrap with nightly version' ).
ENDIF.
ENDMETHOD.
ENDCLASS.

View File

@ -152,6 +152,6 @@ INTERFACE z2ui5_if_core_types
s_config TYPE ty_s_config,
END OF ty_s_actual.
TYPES ty_s_db TYPE z2ui5_t_fw_01.
TYPES ty_s_db TYPE z2ui5_t_core_01.
ENDINTERFACE.

View File

@ -3,7 +3,7 @@
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
<asx:values>
<DD02V>
<TABNAME>Z2UI5_T_FW_01</TABNAME>
<TABNAME>Z2UI5_T_CORE_01</TABNAME>
<DDLANGUAGE>E</DDLANGUAGE>
<TABCLASS>TRANSP</TABCLASS>
<CLIDEP>X</CLIDEP>
@ -12,7 +12,7 @@
<EXCLASS>1</EXCLASS>
</DD02V>
<DD09L>
<TABNAME>Z2UI5_T_FW_01</TABNAME>
<TABNAME>Z2UI5_T_CORE_01</TABNAME>
<AS4LOCAL>A</AS4LOCAL>
<TABKAT>0</TABKAT>
<TABART>APPL0</TABART>

View File

@ -0,0 +1,140 @@
CLASS z2ui5_cl_core_app_info DEFINITION
PUBLIC
FINAL
CREATE PUBLIC.
PUBLIC SECTION.
INTERFACES z2ui5_if_app.
DATA client TYPE REF TO z2ui5_if_client.
DATA mv_check_initialized TYPE abap_bool.
DATA mv_ui5_version TYPE string.
* DATA mv_device TYPE string.
* DATA mv_device_type TYPE string.
* DATA mv_theme TYPE string.
* DATA mv_device_browser TYPE string.
* DATA mv_device_theme TYPE string.
* DATA mv_device_gav TYPE string.
CLASS-METHODS factory
RETURNING
VALUE(result) TYPE REF TO z2ui5_cl_core_app_info.
METHODS z2ui5_on_init.
METHODS z2ui5_on_event.
METHODS view_display_start.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS z2ui5_cl_core_app_info IMPLEMENTATION.
METHOD factory.
result = NEW #( ).
ENDMETHOD.
METHOD view_display_start.
DATA(page2) = z2ui5_cl_xml_view=>factory( )->shell( )->page(
shownavbutton = abap_false ).
page2->header_content( )->text( )->title( `abap2UI5 - System Information` )->toolbar_spacer( ).
page2->_z2ui5( )->info_frontend(
* device_browser = client->_bind( mv_device_browser )
* device_systemtype = client->_bind( mv_device_type )
* ui5_gav = client->_bind( mv_device_gav )
* ui5_theme = client->_bind( mv_device_theme )
ui5_version = client->_bind( mv_ui5_version ) ).
DATA(simple_form2) = page2->simple_form(
editable = abap_true
layout = `ResponsiveGridLayout`
labelspanxl = `4`
labelspanl = `3`
labelspanm = `4`
labelspans = `12`
adjustlabelspan = abap_false
emptyspanxl = `0`
emptyspanl = `4`
emptyspanm = `0`
emptyspans = `0`
columnsxl = `1`
columnsl = `1`
columnsm = `1`
singlecontainerfullsize = abap_false
)->content( `form` ).
simple_form2->toolbar( )->title( `Frontend` ).
simple_form2->label( `UI5 Version`).
simple_form2->text( client->_bind( mv_ui5_version ) ).
simple_form2->label( `Launchpad active` ).
simple_form2->checkbox( enabled = abap_false selected = client->get( )-check_launchpad_active ).
* simple_form2->label( `Browser` ).
* simple_form2->text( client->_bind( mv_device_browser ) ).
* simple_form2->label( `Bootstrap` ).
* simple_form2->text( client->_bind( mv_device_gav ) ).
* simple_form2->label( `Theme` ).
* simple_form2->text( client->_bind( mv_device_theme ) ).
* simple_form2->label( `Type` ).
* simple_form2->text( client->_bind( mv_device_type ) ).
simple_form2->toolbar( )->title( `Backend` ).
simple_form2->label( `ABAP for Cloud` ).
simple_form2->checkbox( enabled = abap_false selected = z2ui5_cl_util=>rtti_check_lang_version_cloud( ) ).
data(lv_count) = conv string( new z2ui5_cl_core_draft_srv( )->count( ) ).
simple_form2->toolbar( )->title( `abap2UI5` ).
simple_form2->label( `Version ` ).
simple_form2->text( z2ui5_if_app=>version ).
simple_form2->label( `Draft Entries ` ).
simple_form2->text( lv_count ).
client->view_display( page2->stringify( ) ).
ENDMETHOD.
METHOD z2ui5_if_app~main.
me->client = client.
IF mv_check_initialized = abap_false.
mv_check_initialized = abap_true.
z2ui5_on_init( ).
view_display_start( ).
RETURN.
ENDIF.
IF client->get( )-check_on_navigated = abap_true.
view_display_start( ).
RETURN.
ENDIF.
z2ui5_on_event( ).
view_display_start( ).
ENDMETHOD.
METHOD z2ui5_on_event.
ENDMETHOD.
METHOD z2ui5_on_init.
ENDMETHOD.
ENDCLASS.

View File

@ -0,0 +1,19 @@
CLASS ltcl_app_startup_test DEFINITION FINAL FOR TESTING
DURATION SHORT
RISK LEVEL DANGEROUS.
PRIVATE SECTION.
METHODS first_test FOR TESTING RAISING cx_static_check.
ENDCLASS.
CLASS ltcl_app_startup_test IMPLEMENTATION.
METHOD first_test.
DATA(lo_app) = z2ui5_cl_core_app_info=>factory( ) ##NEEDED.
ENDMETHOD.
ENDCLASS.

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<abapGit version="v1.0.0" serializer="LCL_OBJECT_CLAS" serializer_version="v1.0.0">
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
<asx:values>
<VSEOCLASS>
<CLSNAME>Z2UI5_CL_CORE_APP_INFO</CLSNAME>
<LANGU>E</LANGU>
<DESCRIPT>abap2UI5 - system info</DESCRIPT>
<STATE>1</STATE>
<CLSCCINCL>X</CLSCCINCL>
<FIXPT>X</FIXPT>
<UNICODE>X</UNICODE>
<WITH_UNIT_TESTS>X</WITH_UNIT_TESTS>
</VSEOCLASS>
</asx:values>
</asx:abap>
</abapGit>

View File

@ -19,9 +19,7 @@ CLASS z2ui5_cl_core_app_startup DEFINITION
END OF ms_home .
DATA client TYPE REF TO z2ui5_if_client.
DATA mv_check_initialized TYPE abap_bool.
DATA mv_check_demo TYPE abap_bool.
DATA mv_ui5_version TYPE string.
CLASS-METHODS factory
RETURNING
VALUE(result) TYPE REF TO z2ui5_cl_core_app_startup.
@ -81,9 +79,18 @@ CLASS Z2UI5_CL_CORE_APP_STARTUP IMPLEMENTATION.
DATA(page2) = z2ui5_cl_xml_view=>factory( )->shell( )->page(
shownavbutton = abap_false ).
page2->header_content( )->title( `abap2UI5 - Developing UI5 Apps Purely in ABAP` )->toolbar_spacer( ).
page2->_z2ui5( )->info_frontend( ui5_version = client->_bind( mv_ui5_version ) ).
DATA(lv_url_info) = z2ui5_cl_util=>app_get_url(
client = client
classname = 'z2ui5_cl_core_app_info' ).
page2->header_content(
)->text(
)->title( `abap2UI5 - Developing UI5 Apps Purely in ABAP`
)->toolbar_spacer(
)->button( text = `System` icon = `sap-icon://information`
press = client->_event_client( val = client->cs_event-open_new_tab
t_arg = VALUE #( ( lv_url_info ) ) ) ).
DATA(simple_form2) = page2->simple_form(
editable = abap_true
@ -141,17 +148,17 @@ CLASS Z2UI5_CL_CORE_APP_STARTUP IMPLEMENTATION.
href = lv_url
enabled = z2ui5_cl_util=>boolean_abap_2_json( xsdbool( ms_home-class_editable = abap_false ) ) ).
simple_form2->toolbar( )->title( `System Information` ).
* simple_form2->label( `abap2UI5 Version` ).
simple_form2->label( `abap2UI5 Version ` ).
simple_form2->text( z2ui5_if_app=>version ).
simple_form2->label( `UI5 Version`).
simple_form2->text( client->_bind( mv_ui5_version ) ).
simple_form2->label( `ABAP for Cloud` ).
simple_form2->checkbox( enabled = abap_false selected = z2ui5_cl_util=>rtti_check_lang_version_cloud( ) ).
simple_form2->label( `Launchpad active` ).
simple_form2->checkbox( enabled = abap_false selected = client->get( )-check_launchpad_active ).
*
* simple_form2->toolbar( )->title( `System Information` ).
** simple_form2->label( `abap2UI5 Version` ).
* simple_form2->label( `abap2UI5 Version ` ).
* simple_form2->text( z2ui5_if_app=>version ).
* simple_form2->label( `UI5 Version`).
* simple_form2->text( client->_bind( mv_ui5_version ) ).
* simple_form2->label( `ABAP for Cloud` ).
* simple_form2->checkbox( enabled = abap_false selected = z2ui5_cl_util=>rtti_check_lang_version_cloud( ) ).
* simple_form2->label( `Launchpad active` ).
* simple_form2->checkbox( enabled = abap_false selected = client->get( )-check_launchpad_active ).
DATA(lv_url_samples2) = z2ui5_cl_util=>app_get_url(
client = client
@ -168,7 +175,7 @@ CLASS Z2UI5_CL_CORE_APP_STARTUP IMPLEMENTATION.
simple_form2->button(
text = `Check out the samples`
press = client->_event_client( val = client->cs_event-open_new_tab
t_arg = VALUE #( ( `$` && client->_bind_local( lv_url_samples2 ) ) ) )
t_arg = VALUE #( ( lv_url_samples2 ) ) )
width = `70%` ).
else.
@ -276,7 +283,6 @@ CLASS Z2UI5_CL_CORE_APP_STARTUP IMPLEMENTATION.
ms_home-class_editable = abap_true.
ms_home-btn_icon = `sap-icon://validate`.
ms_home-classname = `Z2UI5_CL_APP_HELLO_WORLD`.
mv_check_demo = abap_true.
ENDMETHOD.
ENDCLASS.

View File

@ -1,3 +1,41 @@
CLASS ltcl_unit_test DEFINITION FINAL FOR TESTING
DURATION SHORT
RISK LEVEL HARMLESS.
PRIVATE SECTION.
METHODS:
first_test FOR TESTING RAISING cx_static_check.
ENDCLASS.
CLASS ltcl_unit_test IMPLEMENTATION.
METHOD first_test.
* DATA test TYPE /ui2/cl_json=>bool ##NEEDED.
* DATA test_const TYPE string VALUE /ui2/cl_json=>pretty_mode-extended ##NEEDED.
* DATA text TYPE char10.
* DATA text2 TYPE text100.
* DATA text3 TYPE text10.
* DATA text4 TYPE text10.
*
* DATA stringtab TYPE stringtab.
*
* DATA test1 TYPE text1.
* DATA test2 TYPE text10.
* DATA test3 TYPE text11.
* DATA test4 TYPE text12.
* DATA test5 TYPE text120.
* DATA test6 TYPE text128.
* DATA test7 TYPE text132.
* DATA test8 TYPE text140.
ENDMETHOD.
ENDCLASS.
*CLASS ltcl_integration_test DEFINITION FINAL FOR TESTING
* DURATION LONG
* RISK LEVEL HARMLESS.

View File

@ -649,8 +649,10 @@ CLASS z2ui5_cl_xml_view DEFINITION
!hideonnodata TYPE clike OPTIONAL
RETURNING
VALUE(result) TYPE REF TO z2ui5_cl_xml_view .
METHODS column_list_item
IMPORTING
!id TYPE clike OPTIONAL
!valign TYPE clike OPTIONAL
!selected TYPE clike OPTIONAL
!type TYPE clike OPTIONAL
@ -3865,6 +3867,7 @@ CLASS Z2UI5_CL_XML_VIEW IMPLEMENTATION.
METHOD column_list_item.
result = _generic( name = `ColumnListItem`
t_prop = VALUE #( ( n = `vAlign` v = valign )
( n = `id` v = id )
( n = `selected` v = z2ui5_cl_util=>boolean_abap_2_json( selected ) )
( n = `unread` v = z2ui5_cl_util=>boolean_abap_2_json( unread ) )
( n = `visible` v = z2ui5_cl_util=>boolean_abap_2_json( visible ) )