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 <larshp@hotmail.com>
This commit is contained in:
mariusraht2 2020-10-19 11:19:02 +02:00 committed by GitHub
parent 5ee93ced13
commit 54ce6771bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 23 additions and 15 deletions

View File

@ -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.

View File

@ -176,7 +176,8 @@ CLASS ZCL_ABAPGIT_GUI_PAGE_CODE_INSP IMPLEMENTATION.
CREATE OBJECT ri_html TYPE zcl_abapgit_html.
ri_html->add( `<div class="repo">` ).
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( `</div>` ).
IF mv_check_variant IS INITIAL.

View File

@ -90,7 +90,8 @@ CLASS ZCL_ABAPGIT_GUI_PAGE_REPO_SETT IMPLEMENTATION.
CREATE OBJECT ri_html TYPE zcl_abapgit_html.
ri_html->add( `<div class="repo">` ).
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( `</div>` ).
ri_html->add( '<div class="settings_container">' ).

View File

@ -60,7 +60,8 @@ CLASS ZCL_ABAPGIT_GUI_PAGE_SYNTAX IMPLEMENTATION.
CREATE OBJECT ri_html TYPE zcl_abapgit_html.
ri_html->add( `<div class="repo">` ).
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( `</div>` ).
ri_html->add( '<div class="toc">' ).

View File

@ -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.