Skip to content

Commit

Permalink
Merge branch 'abap2UI5:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
abapsheep authored May 16, 2024
2 parents e99a75b + ba263f6 commit dd61841
Show file tree
Hide file tree
Showing 51 changed files with 723 additions and 303 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build_downport.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: build_downport

on:
push:
branches: [main]

permissions:
contents: read
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/test_downport.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: test_downport

on:
pull_request:

permissions:
contents: read

jobs:
build_downport:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm ci
- run: npm run downport
1 change: 1 addition & 0 deletions ci/abaplint.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@
"^xubname$",
"^feld$",
"^abap_boolean$",
"boolean",
]
},
"form_tables_obsolete": true,
Expand Down
53 changes: 41 additions & 12 deletions src/z2ui5_cl_demo_app_000.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@
PROTECTED SECTION.
PRIVATE SECTION.

ENDCLASS.
ENDCLASS.



CLASS z2ui5_cl_demo_app_000 IMPLEMENTATION.
CLASS Z2UI5_CL_DEMO_APP_000 IMPLEMENTATION.


METHOD z2ui5_if_app~main.

Expand Down Expand Up @@ -81,7 +82,9 @@
`<p><strong>Explore and copy code samples!</strong> All samples are abap2UI5 implementations of the <a href="https://sapui5.hana.ondemand.com/#/controls" style="color:blue; font-weight:600;">SAP UI5 sample page.</a> If you miss a control or find a b` &&
`ug please create an ` &&
`<a href="https://github.com/abap2UI5/abap2UI5/issues" style="color:blue; font-weight:600;">issue</a> or send a <a href="https://github.com/abap2UI5/abap2UI5-samples/pulls" style="color:blue; font-weight:600;">PR</a>` &&
`.</p>` ).
`.</p>` &&
`<p>Always press CTRL+F12 to see code samples and classname of the app.</p>`
).

DATA(page2) = page.

Expand Down Expand Up @@ -148,6 +151,14 @@
mode = 'LineMode'
class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom' ).

panel->generic_tile(
header = 'Event IV'
subheader = `Facet Filter - T_arg with Objects`
press = client->_event( 'Z2UI5_CL_DEMO_APP_197' )
mode = 'LineMode'
class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom'
).

panel->generic_tile(
header = 'Follow Up Action'
subheader = ``
Expand All @@ -156,20 +167,30 @@
class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom'
).



panel = page->panel(
expandable = abap_false
expanded = abap_true
headertext = `Features`
).

panel->generic_tile(
header = 'Timer'
header = 'Timer I'
subheader = 'Wait n MS and call again the server'
press = client->_event( 'Z2UI5_CL_DEMO_APP_028' )
mode = 'LineMode'
class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom'
).

panel->generic_tile(
header = 'Timer II'
subheader = 'Set Loading Indicator while Server Request'
press = client->_event( 'Z2UI5_CL_DEMO_APP_064' )
mode = 'LineMode'
class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom'
).

panel->generic_tile(
header = 'New Tab'
subheader = 'Open an URL in a new tab'
Expand Down Expand Up @@ -640,13 +661,6 @@
class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom'
).

panel->generic_tile(
header = 'Network Graph'
press = client->_event( 'z2ui5_cl_demo_app_182' )
mode = 'LineMode'
class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom'
).

panel = page->panel(
expandable = abap_false
expanded = abap_true
Expand Down Expand Up @@ -1321,6 +1335,21 @@
class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom'
).

panel->generic_tile(
header = 'Network Graph'
press = client->_event( 'z2ui5_cl_demo_app_182' )
mode = 'LineMode'
class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom'
).

panel->generic_tile(
header = 'Status Indicator Library'
subheader = ``
press = client->_event( 'Z2UI5_CL_DEMO_APP_196' )
mode = 'LineMode'
class = 'sapUiTinyMarginEnd sapUiTinyMarginBottom'
).

panel = page->panel(
expandable = abap_false
expanded = abap_true
Expand Down Expand Up @@ -1436,4 +1465,4 @@
client->view_display( page->stringify( ) ).

ENDMETHOD.
ENDCLASS.
ENDCLASS.
6 changes: 4 additions & 2 deletions src/z2ui5_cl_demo_app_001.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ ENDCLASS.



CLASS z2ui5_cl_demo_app_001 IMPLEMENTATION.
CLASS Z2UI5_CL_DEMO_APP_001 IMPLEMENTATION.


METHOD z2ui5_if_app~main.
Expand All @@ -26,6 +26,7 @@ CLASS z2ui5_cl_demo_app_001 IMPLEMENTATION.
quantity = '500'.

DATA(view) = z2ui5_cl_xml_view=>factory( ).
view->_generic( ns = `html` name = `style` )->_cc_plain_xml( `.my-style{ background: black !important; opacity: 0.6; color: white; }` ).
client->view_display( view->shell(
)->page(
title = 'abap2UI5 - First Example'
Expand All @@ -48,7 +49,8 @@ CLASS z2ui5_cl_demo_app_001 IMPLEMENTATION.
CASE client->get( )-event.

WHEN 'BUTTON_POST'.
client->message_toast_display( |{ product } { quantity } - send to the server| ).
client->message_toast_display( text = |{ product } { quantity } - send to the server| at = 'left bottom' offset = '0 -15' animationtimingfunction = `ease-in`
class = 'my-style').

WHEN 'BACK'.
client->nav_app_leave( ).
Expand Down
44 changes: 41 additions & 3 deletions src/z2ui5_cl_demo_app_002.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ ENDCLASS.



CLASS z2ui5_cl_demo_app_002 IMPLEMENTATION.
CLASS Z2UI5_CL_DEMO_APP_002 IMPLEMENTATION.


METHOD z2ui5_if_app~main.
Expand All @@ -72,7 +72,23 @@ CLASS z2ui5_cl_demo_app_002 IMPLEMENTATION.
METHOD z2ui5_on_event.

CASE client->get( )-event.

WHEN 'BUTTON_MCUSTOM'.
* send type = '' is mandatory in order to not break current implementation
client->message_box_display( type = '' text = 'Custom MessageBox' icon = `SUCCESS`
title = 'Custom MessageBox' actions = VALUE #( ( `First Button` ) ( `Second Button` ) ) emphasizedaction = `First Button`
onclose = `callMessageToast()` details = `<h3>these are details</h3>`).
WHEN 'BUTTON_MCONFIRM'.
client->message_box_display( type = 'confirm' text = 'Confirm MessageBox' ).
WHEN 'BUTTON_MALERT'.
client->message_box_display( type = 'alert' text = 'Alert MessageBox' ).
WHEN 'BUTTON_MERROR'.
client->message_box_display( type = 'error' text = 'Error MessageBox' ).
WHEN 'BUTTON_MINFO'.
client->message_box_display( type = 'information' text = 'Information MessageBox' ).
WHEN 'BUTTON_MWARNING'.
client->message_box_display( type = 'warning' text = 'Warning MessageBox' ).
WHEN 'BUTTON_MSUCCESS'.
client->message_box_display( type = 'success' text = 'Success MessageBox' icon = `sap-icon://accept` ).
WHEN 'BUTTON_SEND'.
client->message_box_display( 'success - values send to the server' ).
WHEN 'BUTTON_CLEAR'.
Expand Down Expand Up @@ -112,7 +128,7 @@ CLASS z2ui5_cl_demo_app_002 IMPLEMENTATION.
METHOD z2ui5_on_rendering.

DATA(view) = z2ui5_cl_xml_view=>factory( ).

view->_generic( name = `script` ns = `html` )->_cc_plain_xml( `function callMessageToast(sAction) { sap.m.MessageToast.show('Hello there !!'); }` ).
data(page) = view->shell(
)->page(
showheader = xsdbool( abap_false = client->get( )-check_launchpad_active )
Expand Down Expand Up @@ -220,6 +236,28 @@ CLASS z2ui5_cl_demo_app_002 IMPLEMENTATION.
customtextoff = 'NO' ).

page->footer( )->overflow_toolbar(
)->text( text = `MessageBox Types`
)->button(
text = 'Confirm'
press = client->_event( 'BUTTON_MCONFIRM' )
)->button(
text = 'Alert'
press = client->_event( 'BUTTON_MALERT' )
)->button(
text = 'Error'
press = client->_event( 'BUTTON_MERROR' )
)->button(
text = 'Information'
press = client->_event( 'BUTTON_MINFO' )
)->button(
text = 'Warning'
press = client->_event( 'BUTTON_MWARNING' )
)->button(
text = 'Success'
press = client->_event( 'BUTTON_MSUCCESS' )
)->button(
text = 'Custom'
press = client->_event( 'BUTTON_MCUSTOM' )
)->toolbar_spacer(
)->button(
text = 'Clear'
Expand Down
9 changes: 2 additions & 7 deletions src/z2ui5_cl_demo_app_028.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ CLASS z2ui5_cl_demo_app_028 DEFINITION PUBLIC.
checkbox TYPE abap_bool,
END OF ty_row.
DATA t_tab TYPE STANDARD TABLE OF ty_row WITH EMPTY KEY.

DATA mv_counter TYPE i.
* DATA mv_check_repeat TYPE abap_bool.
DATA mv_check_active TYPE abap_bool.

PROTECTED SECTION.
Expand Down Expand Up @@ -61,7 +61,6 @@ CLASS z2ui5_cl_demo_app_028 IMPLEMENTATION.
INTO TABLE t_tab.

IF mv_counter = 3.
* mv_check_repeat = abap_false.
mv_check_active = abap_false.
client->message_toast_display( `timer deactivated` ).
ENDIF.
Expand All @@ -79,7 +78,6 @@ CLASS z2ui5_cl_demo_app_028 IMPLEMENTATION.
METHOD z2ui5_on_init.

mv_counter = 1.
* mv_check_repeat = abap_true.
mv_check_active = abap_true.

t_tab = VALUE #(
Expand All @@ -95,9 +93,7 @@ CLASS z2ui5_cl_demo_app_028 IMPLEMENTATION.
lo_view->_z2ui5( )->timer(
finished = client->_event( 'TIMER_FINISHED' )
delayms = `2000`
* checkrepeat = client->_bind( mv_check_repeat )
checkactive = client->_bind( mv_check_active )
).
checkactive = client->_bind( mv_check_active ) ).

DATA(page) = lo_view->shell( )->page(
title = 'abap2UI5 - CL_GUI_TIMER - Monitor'
Expand All @@ -107,7 +103,6 @@ CLASS z2ui5_cl_demo_app_028 IMPLEMENTATION.
)->link( text = 'Demo' target = '_blank' href = `https://twitter.com/abap2UI5/status/1645816100813152256`
)->link(
text = 'Source_Code' target = '_blank'

)->get_parent( ).

page->list(
Expand Down
Loading

0 comments on commit dd61841

Please sign in to comment.