mirror of
https://github.com/abap2UI5/abap2UI5.git
synced 2025-04-29 22:09:24 +08:00
Fixes startup app (#929)
* fixes startup app * fixes * fixes * update leave app handling
This commit is contained in:
parent
59bafcf52f
commit
d977f3633c
|
@ -73,12 +73,12 @@ CLASS z2ui5_cl_core_attri_srv IMPLEMENTATION.
|
|||
ENDIF.
|
||||
|
||||
ASSIGN lr_attri->r_ref->* TO FIELD-SYMBOL(<val_ref>).
|
||||
ASSIGN <val_ref>->* TO FIELD-SYMBOL(<val>).
|
||||
IF <val_ref> IS NOT INITIAL.
|
||||
ASSIGN <val_ref>->* TO FIELD-SYMBOL(<val>).
|
||||
lr_attri->srtti_data = z2ui5_cl_util=>xml_srtti_stringify( <val> ).
|
||||
CLEAR <val>.
|
||||
ENDIF.
|
||||
|
||||
|
||||
lr_attri->srtti_data = z2ui5_cl_util=>xml_srtti_stringify( <val> ).
|
||||
|
||||
CLEAR <val>.
|
||||
CLEAR <val_ref>.
|
||||
CLEAR lr_attri->r_ref.
|
||||
|
||||
|
|
|
@ -119,8 +119,20 @@ CLASS z2ui5_cl_core_action IMPLEMENTATION.
|
|||
METHOD factory_stack_leave.
|
||||
|
||||
result = prepare_app_stack( ms_next-o_app_leave ).
|
||||
IF result->mo_app->ms_draft-id_prev_app_stack IS INITIAL.
|
||||
result->mo_app->ms_draft-id_prev_app_stack = mo_app->ms_draft-id_prev_app_stack.
|
||||
|
||||
"check for new app?
|
||||
TRY.
|
||||
DATA(lo_draft) = NEW z2ui5_cl_core_draft_srv( ).
|
||||
DATA(ls_draft) = lo_draft->read_info( ms_next-o_app_leave->id_draft ).
|
||||
CATCH cx_root.
|
||||
result->mo_app->ms_draft-id_prev_app_stack = mo_app->ms_draft-id_prev_app_stack.
|
||||
RETURN.
|
||||
ENDTRY.
|
||||
|
||||
"check for already existing app?
|
||||
IF mo_app->ms_draft-id_prev_app_stack IS NOT INITIAL.
|
||||
ls_draft = lo_draft->read_info( mo_app->ms_draft-id_prev_app_stack ).
|
||||
result->mo_app->ms_draft-id_prev_app_stack = ls_draft-id_prev_app_stack.
|
||||
ENDIF.
|
||||
|
||||
ENDMETHOD.
|
||||
|
|
|
@ -83,6 +83,8 @@ CLASS z2ui5_cl_core_app_startup IMPLEMENTATION.
|
|||
)->text(
|
||||
)->title( `abap2UI5 - Developing UI5 Apps Purely in ABAP`
|
||||
)->toolbar_spacer(
|
||||
)->button( text = `Debugging Tools` icon = `sap-icon://enablement`
|
||||
press = client->_event( `OPEN_DEBUG` )
|
||||
)->button( text = `System` icon = `sap-icon://information`
|
||||
press = client->_event( `OPEN_INFO` ) ).
|
||||
|
||||
|
@ -152,10 +154,17 @@ CLASS z2ui5_cl_core_app_startup IMPLEMENTATION.
|
|||
|
||||
simple_form2->toolbar( )->title( `What's next?` ).
|
||||
|
||||
simple_form2->label( `App Finder` ).
|
||||
simple_form2->button(
|
||||
text = `Start & Install Apps`
|
||||
press = client->_event_client( val = client->cs_event-open_new_tab
|
||||
t_arg = VALUE #( ( lv_url_samples3 ) ) )
|
||||
width = `70%` ).
|
||||
|
||||
IF z2ui5_cl_util=>rtti_check_class_exists( `z2ui5_cl_demo_app_000` ).
|
||||
simple_form2->label( `Start Developing` ).
|
||||
simple_form2->button(
|
||||
text = `Check Out the Samples`
|
||||
text = `Explore Code Samples`
|
||||
press = client->_event_client( val = client->cs_event-open_new_tab
|
||||
t_arg = VALUE #( ( lv_url_samples2 ) ) )
|
||||
width = `70%` ).
|
||||
|
@ -167,25 +176,19 @@ CLASS z2ui5_cl_core_app_startup IMPLEMENTATION.
|
|||
href = `https://github.com/abap2UI5/abap2UI5-samples` ).
|
||||
ENDIF.
|
||||
|
||||
simple_form2->label( `App Finder` ).
|
||||
simple_form2->button(
|
||||
text = `Start & Install App`
|
||||
press = client->_event_client( val = client->cs_event-open_new_tab
|
||||
t_arg = VALUE #( ( lv_url_samples3 ) ) )
|
||||
width = `70%` ).
|
||||
|
||||
simple_form2->label( `` ).
|
||||
simple_form2->text( `` ).
|
||||
simple_form2->label( `Open an issue` ).
|
||||
simple_form2->link( text = `You have problems, comments or wishes?`
|
||||
target = `_blank`
|
||||
href = `https://github.com/abap2UI5/abap2UI5/issues` ).
|
||||
|
||||
simple_form2->label( `Open a Pull Request` ).
|
||||
simple_form2->link( text = `You added a new feature or fixed a bug?`
|
||||
target = `_blank`
|
||||
href = `https://github.com/abap2UI5/abap2UI5/pulls` ).
|
||||
|
||||
simple_form2->label( `Open an issue` ).
|
||||
simple_form2->link( text = `You have problems, comments or wishes?`
|
||||
target = `_blank`
|
||||
href = `https://github.com/abap2UI5/abap2UI5/issues` ).
|
||||
|
||||
simple_form2->label( `` ).
|
||||
simple_form2->text( `` ).
|
||||
|
||||
|
@ -243,6 +246,8 @@ CLASS z2ui5_cl_core_app_startup IMPLEMENTATION.
|
|||
|
||||
CASE client->get( )-event.
|
||||
|
||||
when `OPEN_DEBUG`.
|
||||
client->message_box_display( `Press ctrl+F12 to open the debugging tools` ).
|
||||
WHEN `OPEN_INFO`.
|
||||
client->nav_app_call( z2ui5_cl_core_app_info=>factory( ) ).
|
||||
RETURN.
|
||||
|
|
|
@ -4391,9 +4391,10 @@ CLASS z2ui5_cl_xml_view IMPLEMENTATION.
|
|||
result->mo_root = result.
|
||||
result->mo_parent = result.
|
||||
|
||||
INSERT VALUE #( n = `xmlns` v = `sap.m` ) INTO TABLE result->mt_prop.
|
||||
INSERT VALUE #( n = `xmlns:mvc` v = `sap.ui.core.mvc` ) INTO TABLE result->mt_prop.
|
||||
INSERT VALUE #( n = `xmlns:core` v = `sap.ui.core` ) INTO TABLE result->mt_prop.
|
||||
INSERT VALUE #( n = `xmlns` v = `sap.m` ) INTO TABLE result->mt_prop.
|
||||
INSERT VALUE #( n = `xmlns:mvc` v = `sap.ui.core.mvc` ) INTO TABLE result->mt_prop.
|
||||
INSERT VALUE #( n = `xmlns:core` v = `sap.ui.core` ) INTO TABLE result->mt_prop.
|
||||
INSERT VALUE #( n = `xmlns:table` v = `sap.ui.table` ) INTO TABLE result->mt_prop.
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
|
|
|
@ -59,6 +59,7 @@ CLASS z2ui5_cl_app_search_apps DEFINITION
|
|||
TYPES ty_t_repo TYPE STANDARD TABLE OF ty_s_repo WITH EMPTY KEY.
|
||||
|
||||
DATA mt_git_repos TYPE ty_t_repo.
|
||||
DATA mt_git_addons TYPE ty_t_repo.
|
||||
|
||||
PROTECTED SECTION.
|
||||
METHODS search.
|
||||
|
@ -76,7 +77,7 @@ ENDCLASS.
|
|||
|
||||
|
||||
|
||||
CLASS z2ui5_cl_app_search_apps IMPLEMENTATION.
|
||||
CLASS Z2UI5_CL_APP_SEARCH_APPS IMPLEMENTATION.
|
||||
|
||||
|
||||
METHOD search.
|
||||
|
@ -135,34 +136,15 @@ CLASS z2ui5_cl_app_search_apps IMPLEMENTATION.
|
|||
|
||||
DATA(page) = z2ui5_cl_xml_view=>factory(
|
||||
)->shell(
|
||||
* )->page(
|
||||
* title = 'abap2UI5 - Search Apps'
|
||||
* navbuttonpress = client->_event( 'BACK' )
|
||||
* shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack is not initial )
|
||||
* )->header_content(
|
||||
* )->search_field(
|
||||
* value = client->_bind_edit( mv_search_value )
|
||||
* search = client->_event( 'ON_SEARCH' )
|
||||
* change = client->_event( 'ON_SEARCH' )
|
||||
* width = `17.5rem`
|
||||
* id = `SEARCH`
|
||||
* )->get_parent( ).
|
||||
)->tool_page(
|
||||
)->header( `tnt`
|
||||
)->header( `tnt`
|
||||
)->tool_header(
|
||||
)->title( `abap2UI5 - App Finder`
|
||||
* )->text( width = `10%`
|
||||
* )->link( text = `Visit the abap2UI5 Project`
|
||||
* )->button( text = `Bak` press = client->_event( 'BACK' )
|
||||
)->get_parent(
|
||||
)->get_parent( )->sub_header( `tnt`
|
||||
)->tool_header( ).
|
||||
|
||||
DATA(pages) = page->icon_tab_header( selectedkey = client->_bind_edit( mv_selected_key )
|
||||
* select = client->_event( `OnSelectIconTabBar` )
|
||||
* select = client->_event_client(
|
||||
* action = 'NAV_TO'
|
||||
* t_arg = value #( ( `NavCon` ) ( `${$parameters}` ) ) )
|
||||
select = client->_event_client(
|
||||
val = client->cs_event-nav_container_to
|
||||
t_arg = VALUE #( ( `NavCon` ) ( `${$parameters>/selectedKey}` ) ) )
|
||||
|
@ -173,16 +155,11 @@ CLASS z2ui5_cl_app_search_apps IMPLEMENTATION.
|
|||
)->icon_tab_filter( key = `page_all`
|
||||
text = `Local` )->get_parent(
|
||||
)->icon_tab_filter( key = `page_online`
|
||||
text = `GitHub`
|
||||
* )->items(
|
||||
* )->icon_tab_filter( key = `page11` text = `User 1` )->get_parent(
|
||||
* )->icon_tab_filter( key = `page32` text = `User 2` )->get_parent(
|
||||
* )->icon_tab_filter( key = `page33` text = `User 3`
|
||||
text = `Apps on GitHub` )->get_parent(
|
||||
)->icon_tab_filter( key = `page_addon`
|
||||
text = `Addons`
|
||||
)->get_parent( )->get_parent( )->get_parent( )->get_parent( )->get_parent(
|
||||
)->main_contents(
|
||||
* )->button( text = `page1` press = client->_event_client( action = 'NAV_TO' t_arg = VALUE #( ( `NavCon` ) ( `page1` ) ) )
|
||||
* )->button( text = `page2` press = client->_event_client( action = 'NAV_TO' t_arg = VALUE #( ( `NavCon` ) ( `page2` ) ) )
|
||||
* )->button( text = `page3` press = client->_event_client( action = 'NAV_TO' t_arg = VALUE #( ( `NavCon` ) ( `page3` ) ) )
|
||||
)->nav_container( id = `NavCon`
|
||||
initialpage = `page_favs`
|
||||
defaulttransitionname = `flip`
|
||||
|
@ -193,12 +170,6 @@ CLASS z2ui5_cl_app_search_apps IMPLEMENTATION.
|
|||
id = `page_favs`
|
||||
)->header_content(
|
||||
)->button( text = `Clear` press = client->_event( `ON_FAVS_CLEAR` )
|
||||
* )->search_field(
|
||||
* value = client->_bind_edit( ms_favorites-search_field )
|
||||
* search = client->_event( 'ON_SEARCH_FAVS' )
|
||||
* change = client->_event( 'ON_SEARCH_FAVS' )
|
||||
* width = `17.5rem`
|
||||
*id = `SEARCH`
|
||||
)->get_parent( ).
|
||||
|
||||
DATA(page_all) = pages->page(
|
||||
|
@ -231,9 +202,7 @@ CLASS z2ui5_cl_app_search_apps IMPLEMENTATION.
|
|||
|
||||
view_nest_display( ).
|
||||
|
||||
DATA(page_online) = pages->page(
|
||||
* title = `Your app is not listed here? Fell free to send a PR and extend this page`
|
||||
id = `page_online`
|
||||
DATA(page_online) = pages->page( id = `page_online`
|
||||
)->header_content(
|
||||
)->text(
|
||||
)->link( text = `Install with abapGit` href = `https://abapgit.org/` target = `blank`
|
||||
|
@ -243,23 +212,7 @@ CLASS z2ui5_cl_app_search_apps IMPLEMENTATION.
|
|||
)->text(
|
||||
)->toolbar_spacer(
|
||||
)->text(
|
||||
* )->checkbox( text = `Cloud`
|
||||
* selected = client->_bind_edit( ms_git-check_cloud_ready )
|
||||
* )->checkbox( text = `On-Premise`
|
||||
* selected = client->_bind_edit( ms_git-check_premise_ready )
|
||||
* select = client->_event( `ON_SEARCH_GIT` )
|
||||
* )->button( text = `sort`
|
||||
* )->search_field(
|
||||
* value = client->_bind_edit( ms_git-search_field )
|
||||
* search = client->_event( 'ON_SEARCH_GIT' )
|
||||
* change = client->_event( 'ON_SEARCH_GIT' )
|
||||
* width = `17.5rem`
|
||||
)->get_parent(
|
||||
* )->sub_header(
|
||||
* )->overflow_toolbar(
|
||||
* )->text( `Your open-source app is not listed here? Feel free to send a PR and extend this page`
|
||||
* )->link( target = `_blank` text = `HERE` href = `{AUTHOR_LINK}`
|
||||
* )->get_parent( )->get_parent(
|
||||
)->get_parent(
|
||||
)->content( ).
|
||||
|
||||
page_online->message_strip( type = `Warning`
|
||||
|
@ -297,13 +250,6 @@ CLASS z2ui5_cl_app_search_apps IMPLEMENTATION.
|
|||
|
||||
item = item->vbox( ).
|
||||
|
||||
* grid->combobox(
|
||||
* selectedkey = `{OPTION}`
|
||||
* items = client->_bind_local( value string_table( ( `OFFLINE` ) ( `ONLINE` ) ) )
|
||||
* )->item(
|
||||
* key = '{}'
|
||||
* text = '{}'
|
||||
* )->get_parent(
|
||||
item->text( ).
|
||||
DATA(row) = item->grid( ).
|
||||
row->title( `{NAME}` ).
|
||||
|
@ -314,8 +260,6 @@ CLASS z2ui5_cl_app_search_apps IMPLEMENTATION.
|
|||
selected = `{CHECK_ABAP_FOR_CLOUD}` ).
|
||||
|
||||
row = item->grid( ).
|
||||
* row = item->hbox( ).
|
||||
* item->text( text = `{DESCR}`
|
||||
row->link( target = `_blank`
|
||||
text = `{AUTHOR_NAME}`
|
||||
href = `{AUTHOR_LINK}` ).
|
||||
|
@ -330,7 +274,83 @@ CLASS z2ui5_cl_app_search_apps IMPLEMENTATION.
|
|||
row->checkbox( text = `Standard ABAP`
|
||||
selected = `{CHECK_STANDARD_ABAP}`
|
||||
enabled = abap_false ).
|
||||
* row->text( `{DESCR}` ).
|
||||
|
||||
|
||||
|
||||
|
||||
DATA(page_addon) = pages->page( id = `page_addon`
|
||||
)->header_content(
|
||||
)->text(
|
||||
)->link( text = `Install with abapGit` href = `https://abapgit.org/` target = `blank`
|
||||
)->toolbar_spacer(
|
||||
)->link( text = `More Open Source on dotabap.org...` href = `https://dotabap.org/` target = `blank`
|
||||
)->toolbar_spacer(
|
||||
)->text(
|
||||
)->toolbar_spacer(
|
||||
)->text(
|
||||
)->get_parent(
|
||||
)->content( ).
|
||||
|
||||
page_addon->message_strip( type = `Warning`
|
||||
text = `Your open-source addon is not listed here? Feel free to send a PR and extend this page`
|
||||
)->get( )->link(
|
||||
text = `here`
|
||||
target = `blank`
|
||||
href = `https://github.com/abap2UI5/abap2UI5/blob/main/src/02/02/z2ui5_cl_app_search_apps.clas.locals_imp.abap` ).
|
||||
|
||||
mt_git_addons = NEW lcl_github( )->get_repositories_addons( ).
|
||||
|
||||
LOOP AT mt_git_addons REFERENCE INTO lr_repo.
|
||||
|
||||
LOOP AT lr_repo->t_app REFERENCE INTO lr_app2.
|
||||
|
||||
IF z2ui5_cl_util=>rtti_check_class_exists( lr_app2->classname ).
|
||||
lr_repo->check_installed = abap_true.
|
||||
ENDIF.
|
||||
EXIT.
|
||||
ENDLOOP.
|
||||
|
||||
lr_repo->number_of_app = lines( lr_repo->t_app ).
|
||||
lr_repo->author_name = shift_left( val = lr_repo->author_link
|
||||
sub = `https://github.com/` ).
|
||||
ENDLOOP.
|
||||
|
||||
|
||||
|
||||
item = page_addon->list(
|
||||
" headertext = `Product`
|
||||
nodata = `no conditions defined`
|
||||
items = client->_bind( mt_git_addons )
|
||||
selectionchange = client->_event( 'SELCHANGE' )
|
||||
)->custom_list_item( ).
|
||||
|
||||
item = item->vbox( ).
|
||||
|
||||
item->text( ).
|
||||
row = item->grid( ).
|
||||
row->title( `{NAME}` ).
|
||||
row->text( `{DESCR}` ).
|
||||
row->text( ).
|
||||
* row->checkbox( text = `ABAP for Cloud`
|
||||
* enabled = abap_false
|
||||
* selected = `{CHECK_ABAP_FOR_CLOUD}` ).
|
||||
|
||||
row = item->grid( ).
|
||||
* row->link( target = `_blank`
|
||||
* text = `{AUTHOR_NAME}`
|
||||
* href = `{AUTHOR_LINK}` ).
|
||||
|
||||
row->link( target = `_blank`
|
||||
text = `{LINK}`
|
||||
href = `{LINK}` ).
|
||||
|
||||
* row->checkbox( text = `Installed`
|
||||
* selected = `{CHECK_INSTALLED}`
|
||||
* enabled = abap_false ).
|
||||
* row->checkbox( text = `Standard ABAP`
|
||||
* selected = `{CHECK_STANDARD_ABAP}`
|
||||
* enabled = abap_false ).
|
||||
|
||||
|
||||
client->view_display( page->stringify( ) ).
|
||||
|
||||
|
|
|
@ -15,6 +15,10 @@ CLASS lcl_github DEFINITION.
|
|||
RETURNING
|
||||
VALUE(result) TYPE z2ui5_cl_app_search_apps=>ty_t_repo.
|
||||
|
||||
METHODS get_repositories_addons
|
||||
RETURNING
|
||||
VALUE(result) TYPE z2ui5_cl_app_search_apps=>ty_t_repo.
|
||||
|
||||
ENDCLASS.
|
||||
|
||||
CLASS lcl_github IMPLEMENTATION.
|
||||
|
@ -73,4 +77,31 @@ CLASS lcl_github IMPLEMENTATION.
|
|||
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD get_repositories_addons.
|
||||
|
||||
result = VALUE #(
|
||||
(
|
||||
name = `Launchpad Proxy App`
|
||||
descr = `Integrate your apps to the on-premise fiori launchpad`
|
||||
link = `https://github.com/abap2UI5/abap2UI5-launchpad_proxy_app`
|
||||
)
|
||||
(
|
||||
name = `BTP Proxy App`
|
||||
descr = `Integrate your apps with Business Technology Platform & SAP Mobile Start`
|
||||
link = `https://github.com/abap2UI5/abap2UI5-btp_proxy_app`
|
||||
)
|
||||
(
|
||||
name = `S-RTTI`
|
||||
descr = `Install this repository to use dynamically types variables and tables in your abap2UI5 apps`
|
||||
link = `https://github.com/sandraros/S-RTTI`
|
||||
)
|
||||
(
|
||||
name = `abap2UI5-web`
|
||||
descr = `Run abap2UI5 with open-abap on Node.js`
|
||||
link = `https://github.com/abap2UI5/abap2UI5-web`
|
||||
)
|
||||
).
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
ENDCLASS.
|
||||
|
|
|
@ -14,11 +14,12 @@ CLASS z2ui5_cl_popup_file_download DEFINITION
|
|||
i_button_text_confirm TYPE string DEFAULT `OK`
|
||||
i_button_text_cancel TYPE string DEFAULT `Cancel`
|
||||
i_file TYPE string
|
||||
i_type type string default `data:text/csv;base64,`
|
||||
RETURNING
|
||||
VALUE(r_result) TYPE REF TO z2ui5_cl_popup_file_download.
|
||||
|
||||
DATA mv_name TYPE string.
|
||||
DATA mv_type TYPE string VALUE `data:text/csv;base64,`.
|
||||
DATA mv_type TYPE string.
|
||||
DATA mv_size TYPE string.
|
||||
DATA mv_value TYPE string.
|
||||
DATA mv_check_download TYPE abap_bool.
|
||||
|
@ -53,6 +54,7 @@ CLASS Z2UI5_CL_POPUP_FILE_DOWNLOAD IMPLEMENTATION.
|
|||
r_result->question_text = i_text.
|
||||
r_result->button_text_confirm = i_button_text_confirm.
|
||||
r_result->button_text_cancel = i_button_text_cancel.
|
||||
r_result->mv_type = i_type.
|
||||
r_result->mv_value = i_file.
|
||||
r_result->mv_size = strlen( i_file ) / 1000.
|
||||
|
||||
|
@ -75,7 +77,9 @@ CLASS Z2UI5_CL_POPUP_FILE_DOWNLOAD IMPLEMENTATION.
|
|||
)->content( ).
|
||||
|
||||
IF mv_check_download = abap_true.
|
||||
DATA(lv_base64) = z2ui5_cl_util=>conv_decode_x_base64( mv_value ).
|
||||
data(lv_csv_x) = z2ui5_cl_util=>conv_get_xstring_by_string( mv_value ).
|
||||
DATA(lv_base64) = z2ui5_cl_util=>conv_encode_x_base64( lv_csv_x ).
|
||||
* DATA(lv_base64) = z2ui5_cl_util=>conv_decode_x_base64( mv_value ).
|
||||
popup->_generic( ns = `html`
|
||||
name = `iframe`
|
||||
t_prop = VALUE #( ( n = `src` v = mv_type && lv_base64 ) ( n = `hidden` v = `hidden` ) ) ).
|
||||
|
|
Loading…
Reference in New Issue
Block a user