From bab9b7ba223849a9350958e7fd40d79f017eeead Mon Sep 17 00:00:00 2001 From: Fabian Lupa Date: Sun, 20 Sep 2020 09:40:57 +0200 Subject: [PATCH] Show tutorial if there are no repos (#3907) Fixes #3553 Co-authored-by: Lars Hvam --- src/ui/zcl_abapgit_gui_router.clas.abap | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/ui/zcl_abapgit_gui_router.clas.abap b/src/ui/zcl_abapgit_gui_router.clas.abap index 316987ff2..e4c505419 100644 --- a/src/ui/zcl_abapgit_gui_router.clas.abap +++ b/src/ui/zcl_abapgit_gui_router.clas.abap @@ -216,23 +216,27 @@ CLASS ZCL_ABAPGIT_GUI_ROUTER IMPLEMENTATION. METHOD general_page_routing. DATA: lv_key TYPE zif_abapgit_persistence=>ty_repo-key, - lv_last_repo_key TYPE zif_abapgit_persistence=>ty_repo-key. + lv_last_repo_key TYPE zif_abapgit_persistence=>ty_repo-key, + lt_repo_list TYPE zif_abapgit_definitions=>ty_repo_ref_tt. lv_key = ii_event->mv_getdata. " TODO refactor CASE ii_event->mv_action. WHEN zcl_abapgit_gui=>c_action-go_home. - lv_last_repo_key = zcl_abapgit_persistence_user=>get_instance( )->get_repo_show( ). + lt_repo_list = zcl_abapgit_repo_srv=>get_instance( )->list( ). - IF lv_last_repo_key IS INITIAL. - CREATE OBJECT rs_handled-page TYPE zcl_abapgit_gui_page_main. - ELSE. + IF lv_last_repo_key IS NOT INITIAL. CREATE OBJECT rs_handled-page TYPE zcl_abapgit_gui_page_view_repo EXPORTING iv_key = lv_last_repo_key. + ELSEIF lt_repo_list IS NOT INITIAL. + CREATE OBJECT rs_handled-page TYPE zcl_abapgit_gui_page_main. + ELSE. + rs_handled-page = zcl_abapgit_gui_page_tutorial=>create( ). ENDIF. + rs_handled-state = zcl_abapgit_gui=>c_event_state-new_page. WHEN zif_abapgit_definitions=>c_action-go_db. " Go DB util page