Improve reuse of HTML viewer (#4688)

* Improve reuse of HTML viewer

Adding optional parameters to allow reuse of HTML viewer in subscreens and allow testing of query parameter table (potential replacement of `zcl_abapgit_html_action_util=>parse...`).

* Lint

Co-authored-by: Lars Hvam <larshp@hotmail.com>
This commit is contained in:
Marc Bernard 2021-04-07 17:50:31 +02:00 committed by GitHub
parent cd6da45a12
commit cea83ffb86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 6 deletions

View File

@ -7,7 +7,10 @@ CLASS zcl_abapgit_html_viewer_gui DEFINITION
INTERFACES zif_abapgit_html_viewer .
METHODS constructor .
METHODS constructor
IMPORTING
!io_container TYPE REF TO cl_gui_container DEFAULT cl_gui_container=>screen0
!iv_disable_query_table TYPE abap_bool DEFAULT abap_true .
PROTECTED SECTION.
DATA mo_html_viewer TYPE REF TO cl_gui_html_viewer .
@ -36,8 +39,8 @@ CLASS zcl_abapgit_html_viewer_gui IMPLEMENTATION.
CREATE OBJECT mo_html_viewer
EXPORTING
query_table_disabled = abap_true
parent = cl_gui_container=>screen0.
query_table_disabled = iv_disable_query_table
parent = io_container.
ls_event-eventid = zif_abapgit_html_viewer=>m_id_sapevent.
ls_event-appl_event = abap_true.

View File

@ -33,8 +33,11 @@ CLASS zcl_abapgit_ui_factory DEFINITION
RETURNING
VALUE(ri_fe_serv) TYPE REF TO zif_abapgit_frontend_services .
CLASS-METHODS get_html_viewer
IMPORTING
!io_container TYPE REF TO cl_gui_container DEFAULT cl_gui_container=>screen0
!iv_disable_query_table TYPE abap_bool DEFAULT abap_true
RETURNING
VALUE(ri_viewer) TYPE REF TO zif_abapgit_html_viewer .
VALUE(ri_viewer) TYPE REF TO zif_abapgit_html_viewer .
PROTECTED SECTION.
PRIVATE SECTION.
@ -49,7 +52,7 @@ ENDCLASS.
CLASS ZCL_ABAPGIT_UI_FACTORY IMPLEMENTATION.
CLASS zcl_abapgit_ui_factory IMPLEMENTATION.
METHOD get_asset_manager.
@ -181,7 +184,10 @@ CLASS ZCL_ABAPGIT_UI_FACTORY IMPLEMENTATION.
METHOD get_html_viewer.
IF gi_html_viewer IS NOT BOUND.
CREATE OBJECT gi_html_viewer TYPE zcl_abapgit_html_viewer_gui.
CREATE OBJECT gi_html_viewer TYPE zcl_abapgit_html_viewer_gui
EXPORTING
io_container = io_container
iv_disable_query_table = iv_disable_query_table.
ENDIF.
ri_viewer = gi_html_viewer.