impleement full message toast properties (#1109)

This commit is contained in:
choper725 2024-04-29 12:11:15 +03:00 committed by GitHub
parent 0ed42cd029
commit 7904dad027
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 66 additions and 12 deletions

View File

@ -19,7 +19,7 @@ ENDCLASS.
CLASS z2ui5_cl_core_client IMPLEMENTATION.
CLASS Z2UI5_CL_CORE_CLIENT IMPLEMENTATION.
METHOD constructor.
@ -38,6 +38,13 @@ CLASS z2ui5_cl_core_client IMPLEMENTATION.
ENDMETHOD.
METHOD z2ui5_if_client~follow_up_action.
mo_action->ms_next-s_set-s_follow_up_action-custom_js = val.
ENDMETHOD.
METHOD z2ui5_if_client~get.
result = VALUE #(
@ -89,7 +96,22 @@ CLASS z2ui5_cl_core_client IMPLEMENTATION.
METHOD z2ui5_if_client~message_toast_display.
mo_action->ms_next-s_set-s_msg_toast = VALUE #( text = text ).
mo_action->ms_next-s_set-s_msg_toast = VALUE #(
id = id
text = text
duration = duration
width = width
my = my
at = at
of = of
offset = offset
collision = collision
onclose = onclose
autoclose = autoclose
animationtimingfunction = animationtimingfunction
animationduration = animationduration
closeonbrowsernavigation = closeonbrowsernavigation
).
ENDMETHOD.
@ -317,11 +339,4 @@ CLASS z2ui5_cl_core_client IMPLEMENTATION.
t_arg = t_arg ).
ENDMETHOD.
METHOD z2ui5_if_client~follow_up_action.
mo_action->ms_next-s_set-s_follow_up_action-custom_js = val.
ENDMETHOD.
ENDCLASS.

View File

@ -437,7 +437,19 @@ CLASS Z2UI5_CL_CORE_HTTP_GET IMPLEMENTATION.
` if (params == undefined) { return; }` && |\n| &&
` if (params[msgType]?.TEXT !== undefined) {` && |\n| &&
` if (msgType === 'S_MSG_TOAST') {` && |\n| &&
` MessageToast.show(params[msgType].TEXT);` && |\n| &&
` MessageToast.show(params[msgType].TEXT,{duration: parseInt(params[msgType].DURATION),` && |\n| &&
` width: params[msgType].WIDTH,` && |\n| &&
` my: params[msgType].MY,` && |\n| &&
` at: params[msgType].AT,` && |\n| &&
` of: params[msgType].OF ? params[msgType].OF : window,` && |\n| &&
` offset: params[msgType].OFFSET,` && |\n| &&
` collision: params[msgType].COLLISION,` && |\n| &&
` onClose: params[msgType].ONCLOSE ? params[msgType].ONCLOSE : null,` && |\n| &&
` autoClose: params[msgType].AUTOCLOSE ? true : false,` && |\n| &&
` animationTimingFunction: params[msgType].ANIMATIONTIMINGFUNCTION,` && |\n| &&
` animationDuration: parseInt(params[msgType].ANIMATIONDURATION),` && |\n| &&
` closeonBrowserNavigation: params[msgType].CLOSEONBROWSERNAVIGATION ? true : false` && |\n| &&
` });` && |\n| &&
` } else if (msgType === 'S_MSG_BOX') {` && |\n| &&
` MessageBox[params[msgType].TYPE](params[msgType].TEXT);` && |\n| &&
` }` && |\n| &&

View File

@ -87,7 +87,20 @@ INTERFACE z2ui5_if_core_types
text TYPE string,
END OF s_msg_box,
BEGIN OF s_msg_toast,
text TYPE string,
id TYPE string,
text TYPE string,
duration TYPE string,
width TYPE string,
my TYPE string,
at TYPE string,
of TYPE string,
offset TYPE string,
collision TYPE string,
onclose TYPE string,
autoclose TYPE string,
animationtimingfunction TYPE string,
animationduration TYPE string,
closeonbrowsernavigation TYPE string,
END OF s_msg_toast,
BEGIN OF s_follow_up_action,
custom_js TYPE string,

View File

@ -102,7 +102,21 @@ INTERFACE z2ui5_if_client
METHODS message_toast_display
IMPORTING
text TYPE string.
id TYPE string OPTIONAL
text TYPE string
duration TYPE string DEFAULT `3000`
width TYPE string DEFAULT `15em`
my TYPE string DEFAULT `center bottom`
at TYPE string DEFAULT `center bottom`
of TYPE string OPTIONAL
offset TYPE string DEFAULT `0 0`
collision TYPE string DEFAULT `fit fit`
onclose TYPE string DEFAULT ``
autoclose TYPE abap_bool DEFAULT abap_true
animationtimingfunction TYPE string DEFAULT `ease`
animationduration TYPE string DEFAULT `1000`
closeonbrowsernavigation TYPE abap_bool DEFAULT abap_true
PREFERRED PARAMETER text.
METHODS _event
IMPORTING