mirror of
https://github.com/abapGit/abapGit.git
synced 2025-05-01 12:20:51 +08:00
Offline Repos: add ZIP Import/Export to actions (#3823)
* navigate to repo after ZIP import * add zip import/export action for offline repos * rename action labels * change new state to be dependent on current page change replacing -> new page if action called from repo list rerender if in repo view * add some TODOs, see PR discussion Co-authored-by: Lars Hvam <larshp@hotmail.com>
This commit is contained in:
parent
b55f92edbb
commit
3e4ce7bf73
|
@ -115,7 +115,7 @@ ENDCLASS.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
CLASS ZCL_ABAPGIT_GUI_REPO_OVER IMPLEMENTATION.
|
CLASS zcl_abapgit_gui_repo_over IMPLEMENTATION.
|
||||||
|
|
||||||
|
|
||||||
METHOD apply_filter.
|
METHOD apply_filter.
|
||||||
|
@ -306,6 +306,8 @@ CLASS ZCL_ABAPGIT_GUI_REPO_OVER IMPLEMENTATION.
|
||||||
lv_package_obj_name TYPE sobj_name,
|
lv_package_obj_name TYPE sobj_name,
|
||||||
lv_stage_link TYPE string,
|
lv_stage_link TYPE string,
|
||||||
lv_patch_link TYPE string,
|
lv_patch_link TYPE string,
|
||||||
|
lv_zip_import_link TYPE string,
|
||||||
|
lv_zip_export_link TYPE string,
|
||||||
lv_check_link TYPE string,
|
lv_check_link TYPE string,
|
||||||
lv_settings_link TYPE string,
|
lv_settings_link TYPE string,
|
||||||
lv_branch_html TYPE string.
|
lv_branch_html TYPE string.
|
||||||
|
@ -398,6 +400,18 @@ CLASS ZCL_ABAPGIT_GUI_REPO_OVER IMPLEMENTATION.
|
||||||
iv_act = |{ zif_abapgit_definitions=>c_action-go_patch }?{ <ls_overview>-key } | ).
|
iv_act = |{ zif_abapgit_definitions=>c_action-go_patch }?{ <ls_overview>-key } | ).
|
||||||
|
|
||||||
ii_html->add( lv_patch_link && lc_separator ).
|
ii_html->add( lv_patch_link && lc_separator ).
|
||||||
|
ELSE. " offline repo
|
||||||
|
lv_zip_import_link = ii_html->a(
|
||||||
|
iv_txt = |Import|
|
||||||
|
iv_act = |{ zif_abapgit_definitions=>c_action-zip_import }?{ <ls_overview>-key } | ).
|
||||||
|
|
||||||
|
ii_html->add( lv_zip_import_link && lc_separator ).
|
||||||
|
|
||||||
|
lv_zip_export_link = ii_html->a(
|
||||||
|
iv_txt = |Export|
|
||||||
|
iv_act = |{ zif_abapgit_definitions=>c_action-zip_export }?{ <ls_overview>-key } | ).
|
||||||
|
|
||||||
|
ii_html->add( lv_zip_export_link && lc_separator ).
|
||||||
ENDIF.
|
ENDIF.
|
||||||
|
|
||||||
lv_settings_link = ii_html->a(
|
lv_settings_link = ii_html->a(
|
||||||
|
|
|
@ -141,7 +141,7 @@ ENDCLASS.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
CLASS ZCL_ABAPGIT_GUI_ROUTER IMPLEMENTATION.
|
CLASS zcl_abapgit_gui_router IMPLEMENTATION.
|
||||||
|
|
||||||
|
|
||||||
METHOD abapgit_services_actions.
|
METHOD abapgit_services_actions.
|
||||||
|
@ -693,12 +693,19 @@ CLASS ZCL_ABAPGIT_GUI_ROUTER IMPLEMENTATION.
|
||||||
|
|
||||||
METHOD zip_services.
|
METHOD zip_services.
|
||||||
|
|
||||||
DATA: lv_key TYPE zif_abapgit_persistence=>ty_repo-key,
|
DATA: lv_key TYPE zif_abapgit_persistence=>ty_repo-key,
|
||||||
lo_repo TYPE REF TO zcl_abapgit_repo,
|
lo_repo TYPE REF TO zcl_abapgit_repo,
|
||||||
lv_package TYPE devclass,
|
lv_package TYPE devclass,
|
||||||
lv_path TYPE string,
|
lv_path TYPE string,
|
||||||
lv_xstr TYPE xstring.
|
lv_xstr TYPE xstring,
|
||||||
|
lv_current_page_name TYPE string.
|
||||||
|
|
||||||
|
" TODO refactor
|
||||||
|
CONSTANTS:
|
||||||
|
BEGIN OF lc_page,
|
||||||
|
main_view TYPE string VALUE 'ZCL_ABAPGIT_GUI_PAGE_MAIN',
|
||||||
|
repo_view TYPE string VALUE 'ZCL_ABAPGIT_GUI_PAGE_VIEW_REPO',
|
||||||
|
END OF lc_page.
|
||||||
|
|
||||||
lv_key = is_event_data-getdata. " TODO refactor
|
lv_key = is_event_data-getdata. " TODO refactor
|
||||||
|
|
||||||
|
@ -713,7 +720,20 @@ CLASS ZCL_ABAPGIT_GUI_ROUTER IMPLEMENTATION.
|
||||||
lv_xstr = zcl_abapgit_ui_factory=>get_frontend_services( )->file_upload( lv_path ).
|
lv_xstr = zcl_abapgit_ui_factory=>get_frontend_services( )->file_upload( lv_path ).
|
||||||
lo_repo->set_files_remote( zcl_abapgit_zip=>load( lv_xstr ) ).
|
lo_repo->set_files_remote( zcl_abapgit_zip=>load( lv_xstr ) ).
|
||||||
zcl_abapgit_services_repo=>refresh( lv_key ).
|
zcl_abapgit_services_repo=>refresh( lv_key ).
|
||||||
ev_state = zcl_abapgit_gui=>c_event_state-re_render.
|
|
||||||
|
" TODO refactor how current page name is determined
|
||||||
|
lv_current_page_name = zcl_abapgit_ui_factory=>get_gui_services( )->get_current_page_name( ).
|
||||||
|
CASE lv_current_page_name.
|
||||||
|
WHEN lc_page-repo_view.
|
||||||
|
ev_state = zcl_abapgit_gui=>c_event_state-re_render.
|
||||||
|
WHEN lc_page-main_view.
|
||||||
|
CREATE OBJECT ei_page TYPE zcl_abapgit_gui_page_view_repo
|
||||||
|
EXPORTING
|
||||||
|
iv_key = lo_repo->get_key( ).
|
||||||
|
ev_state = zcl_abapgit_gui=>c_event_state-new_page.
|
||||||
|
WHEN OTHERS.
|
||||||
|
ev_state = zcl_abapgit_gui=>c_event_state-no_more_act.
|
||||||
|
ENDCASE.
|
||||||
WHEN zif_abapgit_definitions=>c_action-zip_export. " Export repo as ZIP
|
WHEN zif_abapgit_definitions=>c_action-zip_export. " Export repo as ZIP
|
||||||
lo_repo = zcl_abapgit_repo_srv=>get_instance( )->get( lv_key ).
|
lo_repo = zcl_abapgit_repo_srv=>get_instance( )->get( lv_key ).
|
||||||
lv_xstr = zcl_abapgit_zip=>export( lo_repo ).
|
lv_xstr = zcl_abapgit_zip=>export( lo_repo ).
|
||||||
|
|
Loading…
Reference in New Issue
Block a user