file status, close #334

"Only Local" will be shown for objects only existing locally

"Only Remote" will be shown for objects only existing in remote repository

"diff" link will be shown if the file differs and exists both locally and remotely

(this part of the code could use some refactoring)
This commit is contained in:
larshp 2016-09-10 06:19:32 +00:00
parent 8799542cb9
commit 580eb3d63e
4 changed files with 22 additions and 16 deletions

View File

@ -3,7 +3,7 @@ REPORT zabapgit LINE-SIZE 100.
* See http://www.abapgit.org
CONSTANTS: gc_xml_version TYPE string VALUE 'v1.0.0', "#EC NOTEXT
gc_abap_version TYPE string VALUE 'v1.17.12'. "#EC NOTEXT
gc_abap_version TYPE string VALUE 'v1.17.13'. "#EC NOTEXT
********************************************************************************
* The MIT License (MIT)

View File

@ -51,6 +51,7 @@ TYPES: BEGIN OF ty_repo_file,
path TYPE string,
filename TYPE string,
is_changed TYPE abap_bool,
remote_only TYPE abap_bool,
END OF ty_repo_file.
TYPES tt_repo_files TYPE STANDARD TABLE OF ty_repo_file WITH DEFAULT KEY.
@ -92,6 +93,7 @@ TYPES: BEGIN OF ty_result,
filename TYPE string,
package TYPE devclass,
path TYPE string,
remote_only TYPE abap_bool,
END OF ty_result.
TYPES: ty_results_tt TYPE STANDARD TABLE OF ty_result WITH DEFAULT KEY.

View File

@ -105,6 +105,7 @@ CLASS lcl_file_status IMPLEMENTATION.
IF lt_files[] IS INITIAL.
* item does not exist locally
ls_result-filename = <ls_remote>-filename.
ls_result-remote_only = abap_true.
APPEND ls_result TO rt_results.
CONTINUE. " current loop
ENDIF.

View File

@ -391,6 +391,7 @@ CLASS lcl_gui_page_main IMPLEMENTATION.
ls_file-path = <ls_result>-path.
ls_file-filename = <ls_result>-filename.
ls_file-is_changed = boolc( NOT <ls_result>-match = abap_true ).
ls_file-remote_only = <ls_result>-remote_only.
APPEND ls_file TO ls_repo_item-files.
ENDIF.
@ -456,10 +457,12 @@ CLASS lcl_gui_page_main IMPLEMENTATION.
ro_html->add( '<td class="cmd">' ).
IF lines( is_item-files ) = 0.
ro_html->add( '<span class="grey">new</span>' ).
ro_html->add( '<span class="grey">Only Local</span>' ).
ELSE.
LOOP AT is_item-files INTO ls_file.
IF ls_file-is_changed = abap_true.
IF ls_file-remote_only = abap_true.
ro_html->add( '<span class="grey">Only Remote</span>' ).
ELSEIF ls_file-is_changed = abap_true.
lv_difflink = lcl_html_action_utils=>file_encode(
iv_key = io_repo->get_key( )
ig_file = ls_file ).