UI: Add help buttons to "New Online/Offline" (#4189)

* UI: Add help buttons to "New Online/Offline"

- Add help button to both dialogs linking to docs.abapgit.org
- Clicking the button brings up the documentation inside the GUI HTML viewer
- Enhancement to `zcl_abapgit_gui` and `zcl_abapgit_html_viewer_gui` to properly handle 'Back' when navigating through Internet pages

* Open help in external browser

Co-authored-by: Lars Hvam <larshp@hotmail.com>
This commit is contained in:
Marc Bernard 2020-11-18 01:33:00 -05:00 committed by GitHub
parent 59136bd06a
commit 9e385c264e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 38 additions and 7 deletions

View File

@ -117,6 +117,12 @@ CLASS ZCL_ABAPGIT_GUI IMPLEMENTATION.
DATA: lv_index TYPE i,
ls_stack LIKE LINE OF mt_stack.
" If viewer is showing Internet page, then use browser navigation
IF mi_html_viewer->get_url( ) CP 'http*'.
mi_html_viewer->back( ).
RETURN.
ENDIF.
lv_index = lines( mt_stack ).
IF lv_index = 0.

View File

@ -57,7 +57,7 @@ ENDCLASS.
CLASS zcl_abapgit_gui_page_addofflin IMPLEMENTATION.
CLASS ZCL_ABAPGIT_GUI_PAGE_ADDOFFLIN IMPLEMENTATION.
METHOD constructor.
@ -83,7 +83,9 @@ CLASS zcl_abapgit_gui_page_addofflin IMPLEMENTATION.
METHOD get_form_schema.
ro_form = zcl_abapgit_html_form=>create( iv_form_id = 'add-repo-offline-form' ).
ro_form = zcl_abapgit_html_form=>create(
iv_form_id = 'add-repo-offline-form'
iv_help_page = 'https://docs.abapgit.org/guide-offline-install.html' ).
ro_form->text(
iv_name = c_id-url

View File

@ -61,7 +61,7 @@ ENDCLASS.
CLASS zcl_abapgit_gui_page_addonline IMPLEMENTATION.
CLASS ZCL_ABAPGIT_GUI_PAGE_ADDONLINE IMPLEMENTATION.
METHOD constructor.
@ -87,7 +87,9 @@ CLASS zcl_abapgit_gui_page_addonline IMPLEMENTATION.
METHOD get_form_schema.
ro_form = zcl_abapgit_html_form=>create( iv_form_id = 'add-repo-online-form' ).
ro_form = zcl_abapgit_html_form=>create(
iv_form_id = 'add-repo-online-form'
iv_help_page = 'https://docs.abapgit.org/guide-online-install.html' ).
ro_form->text(
iv_name = c_id-url

View File

@ -334,6 +334,7 @@ CLASS zcl_abapgit_html_form IMPLEMENTATION.
DATA lv_hint TYPE string.
DATA ls_form_id TYPE string.
DATA lv_cur_group TYPE string.
DATA lv_url TYPE string.
IF mv_form_id IS NOT INITIAL.
ls_form_id = | id="{ mv_form_id }"|.
@ -393,10 +394,11 @@ CLASS zcl_abapgit_html_form IMPLEMENTATION.
ri_html->add( |<li class="dialog-commands">| ).
IF mv_help_page IS NOT INITIAL.
lv_url = escape( val = mv_help_page
format = cl_abap_format=>e_url ).
ri_html->add_a(
iv_txt = zcl_abapgit_gui_buttons=>help( )
iv_typ = zif_abapgit_html=>c_action_type-url
iv_act = mv_help_page
iv_act = |{ zif_abapgit_definitions=>c_action-url }?url={ lv_url }|
iv_class = 'dialog-help'
iv_title = 'Help' ).
ENDIF.

View File

@ -26,7 +26,7 @@ ENDCLASS.
CLASS zcl_abapgit_html_viewer_gui IMPLEMENTATION.
CLASS ZCL_ABAPGIT_HTML_VIEWER_GUI IMPLEMENTATION.
METHOD constructor.
@ -62,6 +62,13 @@ CLASS zcl_abapgit_html_viewer_gui IMPLEMENTATION.
ENDMETHOD.
METHOD zif_abapgit_html_viewer~back.
mo_html_viewer->go_back( ).
ENDMETHOD.
METHOD zif_abapgit_html_viewer~close_document.
mo_html_viewer->close_document( ).
@ -76,6 +83,14 @@ CLASS zcl_abapgit_html_viewer_gui IMPLEMENTATION.
ENDMETHOD.
METHOD zif_abapgit_html_viewer~get_url.
mo_html_viewer->get_current_url( IMPORTING url = rv_url ).
cl_gui_cfw=>flush( ).
ENDMETHOD.
METHOD zif_abapgit_html_viewer~load_data.
mo_html_viewer->load_data(

View File

@ -44,4 +44,8 @@ INTERFACE zif_abapgit_html_viewer
dp_error_general .
METHODS free .
METHODS close_document .
METHODS get_url
RETURNING
VALUE(rv_url) TYPE w3url.
METHODS back .
ENDINTERFACE.