mirror of
https://github.com/abapGit/abapGit.git
synced 2025-05-01 12:20:51 +08:00
topmenu & tutorial finetuning #487
This commit is contained in:
parent
18243254fd
commit
c4b06d7853
|
@ -587,3 +587,21 @@ table.tag {
|
|||
}
|
||||
table.tag td { padding: 0.2em 0.5em; }
|
||||
table.tag td.label { background-color: #b3c1cc; }
|
||||
|
||||
/* TUTORIAL */
|
||||
|
||||
div.tutorial {
|
||||
margin-top: 3px;
|
||||
background-color: #f2f2f2;
|
||||
padding: 0.5em 1em 0.5em 1em;
|
||||
}
|
||||
|
||||
div.tutorial hr { border-color: #CCC; }
|
||||
div.tutorial h1 {
|
||||
font-size: 18pt;
|
||||
color: #404040;
|
||||
}
|
||||
div.tutorial h2 {
|
||||
font-size: 14pt;
|
||||
color: #404040;
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
<RELID>MI</RELID>
|
||||
<OBJID>ZABAPGIT_CSS_COMMON</OBJID>
|
||||
<NAME>filesize</NAME>
|
||||
<VALUE>12322</VALUE>
|
||||
<VALUE>12615</VALUE>
|
||||
</WWWPARAMS>
|
||||
<WWWPARAMS>
|
||||
<RELID>MI</RELID>
|
||||
|
|
|
@ -173,6 +173,7 @@ CONSTANTS: BEGIN OF gc_action,
|
|||
abapgit_home TYPE string VALUE 'abapgit_home',
|
||||
abapgit_wiki TYPE string VALUE 'abapgit_wiki',
|
||||
abapgit_install TYPE string VALUE 'abapgit_install',
|
||||
abapgit_install_pi TYPE string VALUE 'abapgit_install_pi',
|
||||
|
||||
zip_import TYPE string VALUE 'zip_import',
|
||||
zip_export TYPE string VALUE 'zip_export',
|
||||
|
|
|
@ -138,6 +138,9 @@ CLASS lcl_gui_router IMPLEMENTATION.
|
|||
WHEN gc_action-abapgit_install. " Install abapGit
|
||||
lcl_services_abapgit=>install_abapgit( ).
|
||||
ev_state = gc_event_state-re_render.
|
||||
WHEN gc_action-abapgit_install_pi. " Install abapGit plugins
|
||||
lcl_services_abapgit=>install_abapgit_pi( ).
|
||||
ev_state = gc_event_state-re_render.
|
||||
|
||||
" Repository services actions
|
||||
WHEN gc_action-repo_newoffline. " New offline repo
|
||||
|
|
|
@ -205,14 +205,12 @@ CLASS lcl_gui_page_main IMPLEMENTATION.
|
|||
lo_helpsub->add( iv_txt = 'Tutorial' iv_act = gc_action-go_tutorial ) ##NO_TEXT.
|
||||
lo_helpsub->add( iv_txt = 'abapGit wiki' iv_act = gc_action-abapgit_wiki ) ##NO_TEXT.
|
||||
|
||||
ro_menu->add( iv_txt = 'Clone' iv_act = gc_action-repo_clone ) ##NO_TEXT.
|
||||
ro_menu->add( iv_txt = 'Explore' iv_act = gc_action-go_explore ) ##NO_TEXT.
|
||||
ro_menu->add( iv_txt = 'New offline repo' iv_act = gc_action-repo_newoffline ) ##NO_TEXT.
|
||||
IF lcl_services_abapgit=>needs_installation( ) = abap_true.
|
||||
ro_menu->add( iv_txt = 'Get abapGit' iv_act = gc_action-abapgit_install ) ##NO_TEXT.
|
||||
ENDIF.
|
||||
ro_menu->add( iv_txt = 'Advanced' io_sub = lo_advsub ) ##NO_TEXT.
|
||||
ro_menu->add( iv_txt = 'Help' io_sub = lo_helpsub ) ##NO_TEXT.
|
||||
ro_menu->add( iv_txt = '+ Clone' iv_act = gc_action-repo_clone ) ##NO_TEXT.
|
||||
ro_menu->add( iv_txt = '+ Offline' iv_act = gc_action-repo_newoffline ) ##NO_TEXT.
|
||||
ro_menu->add( iv_txt = 'Explore' iv_act = gc_action-go_explore ) ##NO_TEXT.
|
||||
|
||||
ro_menu->add( iv_txt = 'Advanced' io_sub = lo_advsub ) ##NO_TEXT.
|
||||
ro_menu->add( iv_txt = 'Help' io_sub = lo_helpsub ) ##NO_TEXT.
|
||||
|
||||
ENDMETHOD. "build main_menu
|
||||
|
||||
|
|
|
@ -59,7 +59,13 @@ CLASS lcl_popups DEFINITION FINAL.
|
|||
default_button TYPE char1 DEFAULT '1'
|
||||
display_cancel_button TYPE char1 DEFAULT abap_true
|
||||
RETURNING VALUE(rv_answer) TYPE char1
|
||||
RAISING lcx_exception.
|
||||
RAISING lcx_exception,
|
||||
popup_to_inform
|
||||
IMPORTING
|
||||
titlebar TYPE clike
|
||||
text_message TYPE clike
|
||||
RAISING lcx_exception.
|
||||
|
||||
|
||||
ENDCLASS.
|
||||
|
||||
|
@ -438,4 +444,22 @@ CLASS lcl_popups IMPLEMENTATION.
|
|||
|
||||
ENDMETHOD. "popup_to_confirm
|
||||
|
||||
METHOD popup_to_inform.
|
||||
|
||||
DATA: lv_line1 TYPE char70,
|
||||
lv_line2 TYPE char70.
|
||||
|
||||
lv_line1 = text_message.
|
||||
IF strlen( text_message ) > 70.
|
||||
lv_line2 = text_message+70.
|
||||
ENDIF.
|
||||
|
||||
CALL FUNCTION 'POPUP_TO_DISPLAY_TEXT'
|
||||
EXPORTING
|
||||
titel = titlebar
|
||||
textline1 = lv_line1
|
||||
textline2 = lv_line2.
|
||||
|
||||
ENDMETHOD. " popup_to_inform.
|
||||
|
||||
ENDCLASS.
|
|
@ -21,8 +21,23 @@ CLASS lcl_services_abapgit DEFINITION FINAL.
|
|||
CLASS-METHODS install_abapgit
|
||||
RAISING lcx_exception lcx_cancel.
|
||||
|
||||
CLASS-METHODS needs_installation
|
||||
RETURNING VALUE(rv_not_completely_installed) TYPE abap_bool.
|
||||
CLASS-METHODS install_abapgit_pi
|
||||
RAISING lcx_exception lcx_cancel.
|
||||
|
||||
CLASS-METHODS is_installed
|
||||
RETURNING VALUE(rv_installed) TYPE abap_bool.
|
||||
|
||||
CLASS-METHODS is_installed_pi
|
||||
RETURNING VALUE(rv_installed) TYPE abap_bool.
|
||||
|
||||
PRIVATE SECTION.
|
||||
|
||||
CLASS-METHODS do_install
|
||||
IMPORTING iv_title TYPE c
|
||||
iv_text TYPE c
|
||||
iv_url TYPE string
|
||||
iv_package TYPE devclass
|
||||
RAISING lcx_exception.
|
||||
|
||||
ENDCLASS. "lcl_services_abapgit
|
||||
|
||||
|
@ -52,69 +67,108 @@ CLASS lcl_services_abapgit IMPLEMENTATION.
|
|||
|
||||
METHOD install_abapgit.
|
||||
|
||||
DATA lv_text TYPE c LENGTH 100.
|
||||
DATA lv_answer TYPE c LENGTH 1.
|
||||
DATA lo_repo TYPE REF TO lcl_repo_online.
|
||||
DATA lv_url TYPE string.
|
||||
DATA lv_target_package TYPE devclass.
|
||||
CONSTANTS lc_title TYPE c LENGTH 40 VALUE 'Install abapGit'.
|
||||
DATA lv_text TYPE c LENGTH 100.
|
||||
|
||||
lv_text = |Installing current version ABAPGit to package { c_package_abapgit } |
|
||||
&& |and plugins to { c_package_plugins }|.
|
||||
IF is_installed( ) = abap_true.
|
||||
lv_text = 'Seems like abapGit package is already installed. No changes to be done'.
|
||||
lcl_popups=>popup_to_inform(
|
||||
titlebar = lc_title
|
||||
text_message = lv_text ).
|
||||
RETURN.
|
||||
ENDIF.
|
||||
|
||||
lv_text = |Confirm to install current version of ABAPGit to package { c_package_abapgit }|.
|
||||
|
||||
do_install( iv_title = lc_title
|
||||
iv_text = lv_text
|
||||
iv_url = c_abapgit_url
|
||||
iv_package = c_package_abapgit ).
|
||||
|
||||
ENDMETHOD. "install_abapgit
|
||||
|
||||
METHOD install_abapgit_pi.
|
||||
|
||||
CONSTANTS lc_title TYPE c LENGTH 40 VALUE 'Install abapGit plugins'.
|
||||
DATA lv_text TYPE c LENGTH 100.
|
||||
|
||||
IF is_installed_pi( ) = abap_true.
|
||||
lv_text = 'Seems like abapGit plugins package is already installed. No changes to be done'.
|
||||
lcl_popups=>popup_to_inform(
|
||||
titlebar = lc_title
|
||||
text_message = lv_text ).
|
||||
RETURN.
|
||||
ENDIF.
|
||||
|
||||
lv_text = |Confirm to install current version ABAPGit plugins to package {
|
||||
c_package_plugins }|.
|
||||
|
||||
do_install( iv_title = lc_title
|
||||
iv_text = lv_text
|
||||
iv_url = c_plugins_url
|
||||
iv_package = c_package_plugins ).
|
||||
|
||||
ENDMETHOD. "install_abapgit_pi
|
||||
|
||||
METHOD do_install.
|
||||
|
||||
DATA lo_repo TYPE REF TO lcl_repo_online.
|
||||
DATA lv_answer TYPE c LENGTH 1.
|
||||
|
||||
lv_answer = lcl_popups=>popup_to_confirm(
|
||||
titlebar = 'Install abapGit'
|
||||
text_question = lv_text
|
||||
titlebar = iv_title
|
||||
text_question = iv_text
|
||||
text_button_1 = 'Continue'
|
||||
text_button_2 = 'Cancel'
|
||||
default_button = '2'
|
||||
display_cancel_button = abap_false ). "#EC NOTEXT
|
||||
|
||||
IF lv_answer <> '1'.
|
||||
RETURN. ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
||||
RETURN.
|
||||
ENDIF.
|
||||
|
||||
DO 2 TIMES.
|
||||
CASE sy-index.
|
||||
WHEN 1.
|
||||
lv_url = c_abapgit_url.
|
||||
lv_target_package = c_package_abapgit.
|
||||
WHEN 2.
|
||||
lv_url = c_plugins_url.
|
||||
lv_target_package = c_package_plugins.
|
||||
ENDCASE.
|
||||
IF abap_false = lcl_app=>repo_srv( )->is_repo_installed(
|
||||
iv_url = iv_url
|
||||
iv_target_package = iv_package ).
|
||||
|
||||
IF abap_false = lcl_app=>repo_srv( )->is_repo_installed(
|
||||
iv_url = lv_url
|
||||
iv_target_package = lv_target_package ).
|
||||
lcl_sap_package=>create_local( iv_package ).
|
||||
|
||||
lcl_sap_package=>create_local( lv_target_package ).
|
||||
lo_repo = lcl_app=>repo_srv( )->new_online(
|
||||
iv_url = iv_url
|
||||
iv_branch_name = 'refs/heads/master'
|
||||
iv_package = iv_package ) ##NO_TEXT.
|
||||
|
||||
lo_repo = lcl_app=>repo_srv( )->new_online(
|
||||
iv_url = lv_url
|
||||
iv_branch_name = 'refs/heads/master' "TODO replace with HEAD ?
|
||||
iv_package = lv_target_package ) ##NO_TEXT.
|
||||
|
||||
lo_repo->status( ). " check for errors
|
||||
lo_repo->deserialize( ).
|
||||
ENDIF.
|
||||
ENDDO.
|
||||
lo_repo->status( ). " check for errors
|
||||
lo_repo->deserialize( ).
|
||||
ENDIF.
|
||||
|
||||
COMMIT WORK.
|
||||
|
||||
ENDMETHOD. "install_abapgit
|
||||
ENDMETHOD. " do_install.
|
||||
|
||||
METHOD needs_installation.
|
||||
|
||||
METHOD is_installed.
|
||||
|
||||
TRY.
|
||||
IF lcl_app=>repo_srv( )->is_repo_installed( c_abapgit_url ) = abap_false
|
||||
OR lcl_app=>repo_srv( )->is_repo_installed( c_plugins_url ) = abap_false.
|
||||
rv_not_completely_installed = abap_true.
|
||||
ENDIF.
|
||||
rv_installed = lcl_app=>repo_srv( )->is_repo_installed( c_abapgit_url ).
|
||||
" TODO, alternative checks for presence in the system
|
||||
CATCH lcx_exception.
|
||||
" cannot be installed anyway in this case, e.g. no connection
|
||||
rv_not_completely_installed = abap_false.
|
||||
rv_installed = abap_false.
|
||||
ENDTRY.
|
||||
|
||||
ENDMETHOD. "needs_installation
|
||||
ENDMETHOD. "is_installed
|
||||
|
||||
METHOD is_installed_pi.
|
||||
|
||||
TRY.
|
||||
rv_installed = lcl_app=>repo_srv( )->is_repo_installed( c_plugins_url ).
|
||||
" TODO, alternative checks for presence in the system
|
||||
CATCH lcx_exception.
|
||||
" cannot be installed anyway in this case, e.g. no connection
|
||||
rv_installed = abap_false.
|
||||
ENDTRY.
|
||||
|
||||
ENDMETHOD. "is_installed_pi
|
||||
|
||||
ENDCLASS. "lcl_services_abapgit
|
|
@ -7,6 +7,8 @@ CLASS lcl_gui_view_tutorial DEFINITION FINAL INHERITING FROM lcl_gui_page_super.
|
|||
METHODS lif_gui_page~render REDEFINITION.
|
||||
|
||||
PRIVATE SECTION.
|
||||
METHODS render_content
|
||||
RETURNING VALUE(ro_html) TYPE REF TO lcl_html_helper.
|
||||
|
||||
ENDCLASS. "lcl_gui_view_tutorial
|
||||
|
||||
|
@ -16,13 +18,51 @@ CLASS lcl_gui_view_tutorial IMPLEMENTATION.
|
|||
|
||||
CREATE OBJECT ro_html.
|
||||
|
||||
ro_html->add( '<div class="repo">' ).
|
||||
ro_html->add( '<b>Tutorial</b><br>' ).
|
||||
ro_html->add( 'To add a repo as favorite'
|
||||
&& ' click <img src="img/star-grey"> icon at repo toolbar.<br>' ).
|
||||
ro_html->add( 'To choose a repo press <img src="img/burger"> at the favorite bar.<br>' ).
|
||||
ro_html->add( '<div class="tutorial">' ).
|
||||
ro_html->add( render_content( ) ).
|
||||
ro_html->add( '</div>' ).
|
||||
|
||||
ENDMETHOD. "lif_gui_page~render
|
||||
|
||||
METHOD render_content.
|
||||
|
||||
CREATE OBJECT ro_html.
|
||||
|
||||
_add '<h1>Tutorial</h1>'.
|
||||
_add '<hr>'.
|
||||
|
||||
_add '<h2>Repository list and favorites</h2>'.
|
||||
_add '<p><ul>'.
|
||||
_add '<li>To choose a repo press <img src="img/burger"> at the favorite bar.</li>'.
|
||||
_add '<li>To add a repo as favorite'.
|
||||
_add ' click <img src="img/star-grey"> icon at repo toolbar.</li>'.
|
||||
_add '</ul></p>'.
|
||||
|
||||
|
||||
_add '<h2>Adding and cloning repos</h2>'.
|
||||
_add '<p><ul>'.
|
||||
_add `<li>To clone a remote repo (e.g. from github) click `.
|
||||
ro_html->add_anchor( iv_txt = '+ Clone' iv_act = gc_action-repo_clone ).
|
||||
_add ' from the top menu. This will copy a remote repo to your system.</li>'.
|
||||
_add `<li>To add a local package as a repo click `.
|
||||
ro_html->add_anchor( iv_txt = '+ Offline' iv_act = gc_action-repo_newoffline ).
|
||||
_add ' from the top menu. This will track a repo which already exist in'.
|
||||
_add ' the system with abapGit. You''ll be able to attach it to remote origin'.
|
||||
_add ' or just serialize as a zip file</li>'.
|
||||
_add '</ul></p>'.
|
||||
|
||||
_add '<h2>abapGit related repositories</h2>'.
|
||||
|
||||
_add '<p><ul>'.
|
||||
_add '<li>'.
|
||||
ro_html->add_anchor( iv_txt = 'install abapGit repo' iv_act = gc_action-abapgit_install ).
|
||||
_add ' - To keep abapGit up-to-date (or also to contribute) you need to'.
|
||||
_add 'install it as a repository.</li>'.
|
||||
_add '<li>'.
|
||||
ro_html->add_anchor( iv_txt = 'install abapGit plugins' iv_act = gc_action-abapgit_install_pi ).
|
||||
_add ' - you can also install plugins to extend supported object types</li>'.
|
||||
_add '</ul></p>'.
|
||||
|
||||
ENDMETHOD. " render_content.
|
||||
|
||||
ENDCLASS. "lcl_gui_view_tutorial
|
Loading…
Reference in New Issue
Block a user