From 54ce6771bdaa06f18415013cd86e954eadb0273d Mon Sep 17 00:00:00 2001 From: mariusraht2 <45243391+mariusraht2@users.noreply.github.com> Date: Mon, 19 Oct 2020 11:19:02 +0200 Subject: [PATCH] Issue #4027: Resolve possible crash of AG and add option to be able to suppress showing commit hash on Code Inspector result page (#4028) * Replace LEAVE with CALL SCREEN * Add new option iv_show_commit Add new option iv_show_commit to GUI_CHUNK_LIB to be able to suppress showing commit hash on GUI_PAGE_CODE_INSP page * abapLint: Replace 'EQ' by '=' Co-authored-by: abaplint[bot] <24845621+abaplint[bot]@users.noreply.github.com> * Hide commit hash on other pages too Hide commit hash on ZCL_ABAPGIT_GUI_PAGE_REPO_SETT and ZCL_ABAPGIT_GUI_PAGE_SYNTAX pages Co-authored-by: abaplint[bot] <24845621+abaplint[bot]@users.noreply.github.com> Co-authored-by: Lars Hvam --- src/ui/zcl_abapgit_gui_chunk_lib.clas.abap | 27 +++++++++++-------- .../zcl_abapgit_gui_page_code_insp.clas.abap | 3 ++- .../zcl_abapgit_gui_page_repo_sett.clas.abap | 3 ++- src/ui/zcl_abapgit_gui_page_syntax.clas.abap | 3 ++- src/zabapgit_forms.prog.abap | 2 +- 5 files changed, 23 insertions(+), 15 deletions(-) diff --git a/src/ui/zcl_abapgit_gui_chunk_lib.clas.abap b/src/ui/zcl_abapgit_gui_chunk_lib.clas.abap index d46a41ee8..7a4aabd24 100644 --- a/src/ui/zcl_abapgit_gui_chunk_lib.clas.abap +++ b/src/ui/zcl_abapgit_gui_chunk_lib.clas.abap @@ -24,6 +24,7 @@ CLASS zcl_abapgit_gui_chunk_lib DEFINITION !io_repo TYPE REF TO zcl_abapgit_repo !iv_show_package TYPE abap_bool DEFAULT abap_true !iv_show_branch TYPE abap_bool DEFAULT abap_true + !iv_show_commit TYPE abap_bool DEFAULT abap_true !iv_interactive_branch TYPE abap_bool DEFAULT abap_false !iv_branch TYPE string OPTIONAL !io_news TYPE REF TO zcl_abapgit_news OPTIONAL @@ -140,7 +141,7 @@ ENDCLASS. -CLASS ZCL_ABAPGIT_GUI_CHUNK_LIB IMPLEMENTATION. +CLASS zcl_abapgit_gui_chunk_lib IMPLEMENTATION. METHOD advanced_submenu. @@ -679,16 +680,20 @@ CLASS ZCL_ABAPGIT_GUI_CHUNK_LIB IMPLEMENTATION. && |{ lo_repo_online->get_url( ) }| iv_class = |url| ). - TRY. - render_repo_top_commit_hash( ii_html = ri_html - io_repo_online = lo_repo_online ). - CATCH zcx_abapgit_exception INTO lx_error. - " In case of missing or wrong credentials, show message in status bar - lv_hint = lx_error->get_text( ). - IF lv_hint CS 'credentials'. - MESSAGE lv_hint TYPE 'S' DISPLAY LIKE 'E'. - ENDIF. - ENDTRY. + IF iv_show_commit = abap_true. + + TRY. + render_repo_top_commit_hash( ii_html = ri_html + io_repo_online = lo_repo_online ). + CATCH zcx_abapgit_exception INTO lx_error. + " In case of missing or wrong credentials, show message in status bar + lv_hint = lx_error->get_text( ). + IF lv_hint CS 'credentials'. + MESSAGE lv_hint TYPE 'S' DISPLAY LIKE 'E'. + ENDIF. + ENDTRY. + + ENDIF. ENDIF. diff --git a/src/ui/zcl_abapgit_gui_page_code_insp.clas.abap b/src/ui/zcl_abapgit_gui_page_code_insp.clas.abap index be604c884..e2831626f 100644 --- a/src/ui/zcl_abapgit_gui_page_code_insp.clas.abap +++ b/src/ui/zcl_abapgit_gui_page_code_insp.clas.abap @@ -176,7 +176,8 @@ CLASS ZCL_ABAPGIT_GUI_PAGE_CODE_INSP IMPLEMENTATION. CREATE OBJECT ri_html TYPE zcl_abapgit_html. ri_html->add( `
` ). - ri_html->add( zcl_abapgit_gui_chunk_lib=>render_repo_top( mo_repo ) ). + ri_html->add( zcl_abapgit_gui_chunk_lib=>render_repo_top( io_repo = mo_repo + iv_show_commit = abap_false ) ). ri_html->add( `
` ). IF mv_check_variant IS INITIAL. diff --git a/src/ui/zcl_abapgit_gui_page_repo_sett.clas.abap b/src/ui/zcl_abapgit_gui_page_repo_sett.clas.abap index 6d8943757..4f1e2759d 100644 --- a/src/ui/zcl_abapgit_gui_page_repo_sett.clas.abap +++ b/src/ui/zcl_abapgit_gui_page_repo_sett.clas.abap @@ -90,7 +90,8 @@ CLASS ZCL_ABAPGIT_GUI_PAGE_REPO_SETT IMPLEMENTATION. CREATE OBJECT ri_html TYPE zcl_abapgit_html. ri_html->add( `
` ). - ri_html->add( zcl_abapgit_gui_chunk_lib=>render_repo_top( mo_repo ) ). + ri_html->add( zcl_abapgit_gui_chunk_lib=>render_repo_top( io_repo = mo_repo + iv_show_commit = abap_false ) ). ri_html->add( `
` ). ri_html->add( '
' ). diff --git a/src/ui/zcl_abapgit_gui_page_syntax.clas.abap b/src/ui/zcl_abapgit_gui_page_syntax.clas.abap index e4dfd046a..18e6a9fa6 100644 --- a/src/ui/zcl_abapgit_gui_page_syntax.clas.abap +++ b/src/ui/zcl_abapgit_gui_page_syntax.clas.abap @@ -60,7 +60,8 @@ CLASS ZCL_ABAPGIT_GUI_PAGE_SYNTAX IMPLEMENTATION. CREATE OBJECT ri_html TYPE zcl_abapgit_html. ri_html->add( `
` ). - ri_html->add( zcl_abapgit_gui_chunk_lib=>render_repo_top( mo_repo ) ). + ri_html->add( zcl_abapgit_gui_chunk_lib=>render_repo_top( io_repo = mo_repo + iv_show_commit = abap_false ) ). ri_html->add( `
` ). ri_html->add( '
' ). diff --git a/src/zabapgit_forms.prog.abap b/src/zabapgit_forms.prog.abap index 7027cfc3a..815ce8dc3 100644 --- a/src/zabapgit_forms.prog.abap +++ b/src/zabapgit_forms.prog.abap @@ -94,7 +94,7 @@ FORM exit RAISING zcx_abapgit_exception. IF zcl_abapgit_ui_factory=>get_gui( )->back( ) = abap_true. " end of stack zcl_abapgit_ui_factory=>get_gui( )->free( ). " Graceful shutdown ELSE. - LEAVE TO SCREEN 1001. + CALL SELECTION-SCREEN 1001. ENDIF. ENDCASE. ENDFORM.