* #2725

> Bottom logo is now clickable and links to the repository page on GitHub
> New menu item 'Changelog' under 'Help' which links to the changelog.txt

Special Notes: 
> Link to documentation was already implemented
> Link for menu item 'Tutorials' isn't linked to anything. But that seems to be right, because there isn't a tutorial site separated from the documentation website

* abaplint: Normalization

* Update zcl_abapgit_services_abapgit.clas.abap

* Update zcl_abapgit_services_abapgit.clas.abap

* abaplint: fix max line length error

* abaplint

* Removed "|{}|"
This commit is contained in:
CASAG-MariusRaht 2019-09-15 10:09:27 +02:00 committed by Lars Hvam
parent 3ae7e3ad66
commit 9ad8973ab6
5 changed files with 80 additions and 58 deletions

View File

@ -10,7 +10,7 @@ CLASS zcl_abapgit_gui_page DEFINITION PUBLIC ABSTRACT CREATE PUBLIC.
" You should remember that these actions are handled in the UI. " You should remember that these actions are handled in the UI.
" Have a look at the JS file. " Have a look at the JS file.
BEGIN OF c_global_page_action, BEGIN OF c_global_page_action,
showhotkeys TYPE string VALUE `showHotkeys` ##NO_TEXT, showhotkeys TYPE string VALUE `showHotkeys` ##NO_TEXT,
END OF c_global_page_action. END OF c_global_page_action.
CLASS-METHODS: CLASS-METHODS:
@ -30,7 +30,7 @@ CLASS zcl_abapgit_gui_page DEFINITION PUBLIC ABSTRACT CREATE PUBLIC.
TYPES: BEGIN OF ty_event, TYPES: BEGIN OF ty_event,
method TYPE string, method TYPE string,
name TYPE string, name TYPE string,
END OF ty_event. END OF ty_event.
TYPES: tt_events TYPE STANDARD TABLE OF ty_event WITH DEFAULT KEY. TYPES: tt_events TYPE STANDARD TABLE OF ty_event WITH DEFAULT KEY.
@ -46,7 +46,7 @@ CLASS zcl_abapgit_gui_page DEFINITION PUBLIC ABSTRACT CREATE PUBLIC.
RAISING zcx_abapgit_exception. RAISING zcx_abapgit_exception.
METHODS render_event_as_form METHODS render_event_as_form
IMPORTING is_event TYPE ty_event IMPORTING is_event TYPE ty_event
RETURNING VALUE(ro_html) TYPE REF TO zcl_abapgit_html RETURNING VALUE(ro_html) TYPE REF TO zcl_abapgit_html
RAISING zcx_abapgit_exception. RAISING zcx_abapgit_exception.
@ -115,7 +115,7 @@ ENDCLASS.
CLASS ZCL_ABAPGIT_GUI_PAGE IMPLEMENTATION. CLASS zcl_abapgit_gui_page IMPLEMENTATION.
METHOD call_browser. METHOD call_browser.
@ -186,7 +186,9 @@ CLASS ZCL_ABAPGIT_GUI_PAGE IMPLEMENTATION.
ro_html->add( '<div id="footer">' ). "#EC NOTEXT ro_html->add( '<div id="footer">' ). "#EC NOTEXT
ro_html->add( '<img src="img/logo" alt="logo">' ). "#EC NOTEXT ro_html->add( zcl_abapgit_html=>a( iv_txt = '<img src="img/logo" alt="logo">'
iv_id = 'abapGitLogo'
iv_act = zif_abapgit_definitions=>c_action-abapgit_home ) ).
ro_html->add( '<table class="w100"><tr>' ). "#EC NOTEXT ro_html->add( '<table class="w100"><tr>' ). "#EC NOTEXT
ro_html->add( '<td class="w40"></td>' ). "#EC NOTEXT ro_html->add( '<td class="w40"></td>' ). "#EC NOTEXT

View File

@ -20,6 +20,7 @@ CLASS zcl_abapgit_gui_page_main DEFINITION
changed_by TYPE string VALUE 'changed_by', changed_by TYPE string VALUE 'changed_by',
overview TYPE string VALUE 'overview', overview TYPE string VALUE 'overview',
documentation TYPE string VALUE 'documentation', documentation TYPE string VALUE 'documentation',
changelog TYPE string VALUE 'changelog',
END OF c_actions. END OF c_actions.
DATA: mv_show TYPE zif_abapgit_persistence=>ty_value, DATA: mv_show TYPE zif_abapgit_persistence=>ty_value,
@ -44,7 +45,7 @@ ENDCLASS.
CLASS ZCL_ABAPGIT_GUI_PAGE_MAIN IMPLEMENTATION. CLASS zcl_abapgit_gui_page_main IMPLEMENTATION.
METHOD build_main_menu. METHOD build_main_menu.
@ -79,6 +80,8 @@ CLASS ZCL_ABAPGIT_GUI_PAGE_MAIN IMPLEMENTATION.
iv_act = zif_abapgit_definitions=>c_action-go_tutorial ) ##NO_TEXT. iv_act = zif_abapgit_definitions=>c_action-go_tutorial ) ##NO_TEXT.
lo_helpsub->add( iv_txt = 'Documentation' lo_helpsub->add( iv_txt = 'Documentation'
iv_act = c_actions-documentation ) ##NO_TEXT. iv_act = c_actions-documentation ) ##NO_TEXT.
lo_helpsub->add( iv_txt = 'Changelog'
iv_act = c_actions-changelog ) ##NO_TEXT.
ro_menu->add( iv_txt = '+ Online' ro_menu->add( iv_txt = '+ Online'
iv_act = zif_abapgit_definitions=>c_action-repo_newonline ) ##NO_TEXT. iv_act = zif_abapgit_definitions=>c_action-repo_newonline ) ##NO_TEXT.
@ -345,6 +348,9 @@ CLASS ZCL_ABAPGIT_GUI_PAGE_MAIN IMPLEMENTATION.
WHEN c_actions-documentation. WHEN c_actions-documentation.
zcl_abapgit_services_abapgit=>open_abapgit_wikipage( ). zcl_abapgit_services_abapgit=>open_abapgit_wikipage( ).
ev_state = zcl_abapgit_gui=>c_event_state-no_more_act. ev_state = zcl_abapgit_gui=>c_event_state-no_more_act.
WHEN c_actions-changelog.
zcl_abapgit_services_abapgit=>open_abapgit_changelog( ).
ev_state = zcl_abapgit_gui=>c_event_state-no_more_act.
WHEN c_actions-overview. WHEN c_actions-overview.
CREATE OBJECT li_repo_overview TYPE zcl_abapgit_gui_page_repo_over. CREATE OBJECT li_repo_overview TYPE zcl_abapgit_gui_page_repo_over.
ei_page = li_repo_overview. ei_page = li_repo_overview.

View File

@ -5,11 +5,12 @@ CLASS zcl_abapgit_services_abapgit DEFINITION
PUBLIC SECTION. PUBLIC SECTION.
CONSTANTS c_abapgit_homepage TYPE string VALUE 'http://www.abapgit.org' ##NO_TEXT. CONSTANTS: c_abapgit_repo TYPE string VALUE 'https://github.com/larshp/abapGit' ##NO_TEXT,
CONSTANTS c_abapgit_wikipage TYPE string VALUE 'http://docs.abapgit.org' ##NO_TEXT. c_abapgit_homepage TYPE string VALUE 'http://www.abapgit.org' ##NO_TEXT,
CONSTANTS c_package_abapgit TYPE devclass VALUE '$ABAPGIT' ##NO_TEXT. c_abapgit_wikipage TYPE string VALUE 'http://docs.abapgit.org' ##NO_TEXT,
CONSTANTS c_abapgit_url TYPE string VALUE 'https://github.com/larshp/abapGit.git' ##NO_TEXT. c_abapgit_package TYPE devclass VALUE '$ABAPGIT' ##NO_TEXT,
CONSTANTS c_abapgit_tcode TYPE tcode VALUE `ZABAPGIT` ##NO_TEXT. c_abapgit_url TYPE string VALUE 'https://github.com/larshp/abapGit.git' ##NO_TEXT,
c_abapgit_tcode TYPE tcode VALUE `ZABAPGIT` ##NO_TEXT.
CLASS-METHODS open_abapgit_homepage CLASS-METHODS open_abapgit_homepage
RAISING RAISING
@ -17,9 +18,12 @@ CLASS zcl_abapgit_services_abapgit DEFINITION
CLASS-METHODS open_abapgit_wikipage CLASS-METHODS open_abapgit_wikipage
RAISING RAISING
zcx_abapgit_exception . zcx_abapgit_exception .
CLASS-METHODS open_abapgit_changelog
RAISING
zcx_abapgit_exception .
CLASS-METHODS install_abapgit CLASS-METHODS install_abapgit
RAISING RAISING
zcx_abapgit_exception. zcx_abapgit_exception .
CLASS-METHODS is_installed CLASS-METHODS is_installed
RETURNING RETURNING
VALUE(rv_devclass) TYPE tadir-devclass . VALUE(rv_devclass) TYPE tadir-devclass .
@ -52,7 +56,46 @@ ENDCLASS.
CLASS ZCL_ABAPGIT_SERVICES_ABAPGIT IMPLEMENTATION. CLASS zcl_abapgit_services_abapgit IMPLEMENTATION.
METHOD check_sapgui.
CONSTANTS:
lc_hide_sapgui_hint TYPE string VALUE '2' ##NO_TEXT.
DATA:
lv_answer TYPE char1,
ls_settings TYPE zif_abapgit_definitions=>ty_s_user_settings,
lo_user_persistence TYPE REF TO zif_abapgit_persist_user.
lo_user_persistence = zcl_abapgit_persistence_user=>get_instance( ).
ls_settings = lo_user_persistence->get_settings( ).
IF ls_settings-hide_sapgui_hint = abap_true.
RETURN.
ENDIF.
IF zcl_abapgit_ui_factory=>get_gui_functions( )->is_sapgui_for_java( ) = abap_false.
RETURN.
ENDIF.
lv_answer = zcl_abapgit_ui_factory=>get_popups( )->popup_to_confirm(
iv_titlebar = 'Not supported SAPGUI'
iv_text_question = 'SAPGUI for Java is not supported! There might be some issues.'
iv_text_button_1 = 'Got it'
iv_icon_button_1 = |{ icon_okay }|
iv_text_button_2 = 'Hide'
iv_icon_button_2 = |{ icon_set_state }|
iv_display_cancel_button = abap_false ).
IF lv_answer = lc_hide_sapgui_hint.
ls_settings-hide_sapgui_hint = abap_true.
lo_user_persistence->set_settings( ls_settings ).
ENDIF.
ENDMETHOD.
METHOD do_install. METHOD do_install.
@ -167,12 +210,12 @@ CLASS ZCL_ABAPGIT_SERVICES_ABAPGIT IMPLEMENTATION.
RETURN. RETURN.
ENDIF. ENDIF.
lv_text = |Confirm to install current version of abapGit to package { c_package_abapgit }|. lv_text = |Confirm to install current version of abapGit to package { c_abapgit_package }|.
do_install( iv_title = lc_title do_install( iv_title = lc_title
iv_text = lv_text iv_text = lv_text
iv_url = c_abapgit_url iv_url = c_abapgit_url
iv_package = c_package_abapgit ). iv_package = c_abapgit_package ).
ENDMETHOD. ENDMETHOD.
@ -185,6 +228,18 @@ CLASS ZCL_ABAPGIT_SERVICES_ABAPGIT IMPLEMENTATION.
ENDMETHOD. ENDMETHOD.
METHOD open_abapgit_changelog.
cl_gui_frontend_services=>execute(
EXPORTING document = c_abapgit_repo && '/blob/master/changelog.txt'
EXCEPTIONS OTHERS = 1 ).
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'Opening page in external browser failed.' ).
ENDIF.
ENDMETHOD.
METHOD open_abapgit_homepage. METHOD open_abapgit_homepage.
cl_gui_frontend_services=>execute( cl_gui_frontend_services=>execute(
@ -298,44 +353,4 @@ CLASS ZCL_ABAPGIT_SERVICES_ABAPGIT IMPLEMENTATION.
ENDIF. ENDIF.
ENDMETHOD. ENDMETHOD.
METHOD check_sapgui.
CONSTANTS:
lc_hide_sapgui_hint TYPE string VALUE '2' ##NO_TEXT.
DATA:
lv_answer TYPE char1,
ls_settings TYPE zif_abapgit_definitions=>ty_s_user_settings,
lo_user_persistence TYPE REF TO zif_abapgit_persist_user.
lo_user_persistence = zcl_abapgit_persistence_user=>get_instance( ).
ls_settings = lo_user_persistence->get_settings( ).
IF ls_settings-hide_sapgui_hint = abap_true.
RETURN.
ENDIF.
IF zcl_abapgit_ui_factory=>get_gui_functions( )->is_sapgui_for_java( ) = abap_false.
RETURN.
ENDIF.
lv_answer = zcl_abapgit_ui_factory=>get_popups( )->popup_to_confirm(
iv_titlebar = 'Not supported SAPGUI'
iv_text_question = 'SAPGUI for Java is not supported! There might be some issues.'
iv_text_button_1 = 'Got it'
iv_icon_button_1 = |{ icon_okay }|
iv_text_button_2 = 'Hide'
iv_icon_button_2 = |{ icon_set_state }|
iv_display_cancel_button = abap_false ).
IF lv_answer = lc_hide_sapgui_hint.
ls_settings-hide_sapgui_hint = abap_true.
lo_user_persistence->set_settings( ls_settings ).
ENDIF.
ENDMETHOD.
ENDCLASS. ENDCLASS.

View File

@ -64,7 +64,7 @@ ENDCLASS.
CLASS ZCL_ABAPGIT_REPO_SRV IMPLEMENTATION. CLASS zcl_abapgit_repo_srv IMPLEMENTATION.
METHOD add. METHOD add.
@ -232,7 +232,6 @@ CLASS ZCL_ABAPGIT_REPO_SRV IMPLEMENTATION.
FIELD-SYMBOLS: <lo_list> LIKE LINE OF mt_list. FIELD-SYMBOLS: <lo_list> LIKE LINE OF mt_list.
IF mv_init = abap_false. IF mv_init = abap_false.
refresh( ). refresh( ).
ENDIF. ENDIF.

View File

@ -45,7 +45,7 @@ INTERFACE zif_abapgit_repo_srv
!iv_folder_logic TYPE string DEFAULT 'PREFIX' !iv_folder_logic TYPE string DEFAULT 'PREFIX'
!iv_ign_subpkg TYPE abap_bool DEFAULT abap_false !iv_ign_subpkg TYPE abap_bool DEFAULT abap_false
RETURNING RETURNING
VALUE(ro_repo) TYPE REF TO zcl_abapgit_repo_online VALUE(ro_repo) TYPE REF TO zcl_abapgit_repo_online
RAISING RAISING
zcx_abapgit_exception . zcx_abapgit_exception .
METHODS purge METHODS purge