mirror of
https://github.com/abapGit/abapGit.git
synced 2025-05-01 12:20:51 +08:00
Repo view: fix "order by transport" dump (#5571)
* Repo view: fix "order by transport" Partly regression of #5323 Closes #5570 * Add flag * Improve sort
This commit is contained in:
parent
9f048abeff
commit
297708b054
|
@ -9,8 +9,9 @@ CLASS zcl_abapgit_repo_content_list DEFINITION
|
||||||
|
|
||||||
METHODS list
|
METHODS list
|
||||||
IMPORTING iv_path TYPE string
|
IMPORTING iv_path TYPE string
|
||||||
iv_by_folders TYPE abap_bool
|
iv_by_folders TYPE abap_bool OPTIONAL
|
||||||
iv_changes_only TYPE abap_bool
|
iv_changes_only TYPE abap_bool OPTIONAL
|
||||||
|
iv_transports TYPE abap_bool OPTIONAL
|
||||||
RETURNING VALUE(rt_repo_items) TYPE zif_abapgit_definitions=>ty_repo_item_tt
|
RETURNING VALUE(rt_repo_items) TYPE zif_abapgit_definitions=>ty_repo_item_tt
|
||||||
RAISING zcx_abapgit_exception.
|
RAISING zcx_abapgit_exception.
|
||||||
|
|
||||||
|
@ -43,6 +44,9 @@ CLASS zcl_abapgit_repo_content_list DEFINITION
|
||||||
CHANGING ct_repo_items TYPE zif_abapgit_definitions=>ty_repo_item_tt
|
CHANGING ct_repo_items TYPE zif_abapgit_definitions=>ty_repo_item_tt
|
||||||
RAISING zcx_abapgit_exception.
|
RAISING zcx_abapgit_exception.
|
||||||
|
|
||||||
|
METHODS determine_transports
|
||||||
|
CHANGING ct_repo_items TYPE zif_abapgit_definitions=>ty_repo_item_tt.
|
||||||
|
|
||||||
METHODS filter_changes
|
METHODS filter_changes
|
||||||
CHANGING ct_repo_items TYPE zif_abapgit_definitions=>ty_repo_item_tt.
|
CHANGING ct_repo_items TYPE zif_abapgit_definitions=>ty_repo_item_tt.
|
||||||
|
|
||||||
|
@ -243,6 +247,25 @@ CLASS ZCL_ABAPGIT_REPO_CONTENT_LIST IMPLEMENTATION.
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
|
||||||
|
|
||||||
|
METHOD determine_transports.
|
||||||
|
|
||||||
|
DATA ls_item TYPE zif_abapgit_definitions=>ty_item.
|
||||||
|
|
||||||
|
FIELD-SYMBOLS <ls_item> LIKE LINE OF ct_repo_items.
|
||||||
|
|
||||||
|
LOOP AT ct_repo_items ASSIGNING <ls_item>.
|
||||||
|
ls_item-obj_type = <ls_item>-obj_type.
|
||||||
|
ls_item-obj_name = <ls_item>-obj_name.
|
||||||
|
TRY.
|
||||||
|
<ls_item>-transport = zcl_abapgit_factory=>get_cts_api( )->get_transport_for_object( ls_item ).
|
||||||
|
CATCH zcx_abapgit_exception ##NO_HANDLER.
|
||||||
|
" Ignore errors related to object check when trying to get transport
|
||||||
|
ENDTRY.
|
||||||
|
ENDLOOP.
|
||||||
|
|
||||||
|
ENDMETHOD.
|
||||||
|
|
||||||
|
|
||||||
METHOD filter_changes.
|
METHOD filter_changes.
|
||||||
|
|
||||||
FIELD-SYMBOLS: <ls_item> TYPE zif_abapgit_definitions=>ty_repo_item.
|
FIELD-SYMBOLS: <ls_item> TYPE zif_abapgit_definitions=>ty_repo_item.
|
||||||
|
@ -301,6 +324,10 @@ CLASS ZCL_ABAPGIT_REPO_CONTENT_LIST IMPLEMENTATION.
|
||||||
filter_changes( CHANGING ct_repo_items = rt_repo_items ).
|
filter_changes( CHANGING ct_repo_items = rt_repo_items ).
|
||||||
ENDIF.
|
ENDIF.
|
||||||
|
|
||||||
|
IF iv_transports = abap_true.
|
||||||
|
determine_transports( CHANGING ct_repo_items = rt_repo_items ).
|
||||||
|
ENDIF.
|
||||||
|
|
||||||
SORT rt_repo_items BY
|
SORT rt_repo_items BY
|
||||||
sortkey ASCENDING
|
sortkey ASCENDING
|
||||||
path ASCENDING
|
path ASCENDING
|
||||||
|
|
|
@ -241,7 +241,8 @@ CLASS ZCL_ABAPGIT_GUI_PAGE_REPO_VIEW IMPLEMENTATION.
|
||||||
INSERT ls_sort INTO TABLE lt_sort.
|
INSERT ls_sort INTO TABLE lt_sort.
|
||||||
ENDIF.
|
ENDIF.
|
||||||
|
|
||||||
IF mv_order_by = 'TRANSPORT'.
|
" Use object name as secondary sort criteria
|
||||||
|
IF mv_order_by <> 'OBJ_NAME'.
|
||||||
ls_sort-name = 'OBJ_NAME'.
|
ls_sort-name = 'OBJ_NAME'.
|
||||||
INSERT ls_sort INTO TABLE lt_sort.
|
INSERT ls_sort INTO TABLE lt_sort.
|
||||||
ENDIF.
|
ENDIF.
|
||||||
|
@ -253,11 +254,10 @@ CLASS ZCL_ABAPGIT_GUI_PAGE_REPO_VIEW IMPLEMENTATION.
|
||||||
INSERT LINES OF lt_diff_items INTO TABLE ct_repo_items.
|
INSERT LINES OF lt_diff_items INTO TABLE ct_repo_items.
|
||||||
INSERT LINES OF lt_code_items INTO TABLE ct_repo_items.
|
INSERT LINES OF lt_code_items INTO TABLE ct_repo_items.
|
||||||
|
|
||||||
IF mv_order_by = 'TRANSPORT'.
|
" Files are listed under the object names so we always sort them by name
|
||||||
LOOP AT ct_repo_items ASSIGNING <ls_repo_item>.
|
LOOP AT ct_repo_items ASSIGNING <ls_repo_item>.
|
||||||
order_files( CHANGING ct_files = <ls_repo_item>-files ).
|
order_files( CHANGING ct_files = <ls_repo_item>-files ).
|
||||||
ENDLOOP.
|
ENDLOOP.
|
||||||
ENDIF.
|
|
||||||
|
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
|
||||||
|
@ -766,7 +766,7 @@ CLASS ZCL_ABAPGIT_GUI_PAGE_REPO_VIEW IMPLEMENTATION.
|
||||||
|
|
||||||
ls_sort-descending = mv_order_descending.
|
ls_sort-descending = mv_order_descending.
|
||||||
ls_sort-astext = abap_true.
|
ls_sort-astext = abap_true.
|
||||||
ls_sort-name = 'TRANSPORT'.
|
ls_sort-name = 'PATH'.
|
||||||
INSERT ls_sort INTO TABLE lt_sort.
|
INSERT ls_sort INTO TABLE lt_sort.
|
||||||
|
|
||||||
ls_sort-descending = mv_order_descending.
|
ls_sort-descending = mv_order_descending.
|
||||||
|
@ -826,7 +826,8 @@ CLASS ZCL_ABAPGIT_GUI_PAGE_REPO_VIEW IMPLEMENTATION.
|
||||||
|
|
||||||
lt_repo_items = lo_browser->list( iv_path = mv_cur_dir
|
lt_repo_items = lo_browser->list( iv_path = mv_cur_dir
|
||||||
iv_by_folders = mv_show_folders
|
iv_by_folders = mv_show_folders
|
||||||
iv_changes_only = mv_changes_only ).
|
iv_changes_only = mv_changes_only
|
||||||
|
iv_transports = mv_are_changes_recorded_in_tr ).
|
||||||
|
|
||||||
apply_order_by( CHANGING ct_repo_items = lt_repo_items ).
|
apply_order_by( CHANGING ct_repo_items = lt_repo_items ).
|
||||||
|
|
||||||
|
@ -1130,25 +1131,11 @@ CLASS ZCL_ABAPGIT_GUI_PAGE_REPO_VIEW IMPLEMENTATION.
|
||||||
|
|
||||||
METHOD render_item_transport.
|
METHOD render_item_transport.
|
||||||
|
|
||||||
DATA:
|
|
||||||
ls_item TYPE zif_abapgit_definitions=>ty_item,
|
|
||||||
lv_transport TYPE trkorr.
|
|
||||||
|
|
||||||
CREATE OBJECT ri_html TYPE zcl_abapgit_html.
|
CREATE OBJECT ri_html TYPE zcl_abapgit_html.
|
||||||
|
|
||||||
ri_html->add( '<td class="transport">' ).
|
ri_html->add( '<td class="transport">' ).
|
||||||
|
|
||||||
ls_item-obj_type = is_item-obj_type.
|
ri_html->add( zcl_abapgit_gui_chunk_lib=>render_transport( is_item-transport ) ).
|
||||||
ls_item-obj_name = is_item-obj_name.
|
|
||||||
|
|
||||||
TRY.
|
|
||||||
lv_transport = zcl_abapgit_factory=>get_cts_api( )->get_transport_for_object( ls_item ).
|
|
||||||
IF lv_transport IS NOT INITIAL.
|
|
||||||
ri_html->add( zcl_abapgit_gui_chunk_lib=>render_transport( iv_transport = lv_transport ) ).
|
|
||||||
ENDIF.
|
|
||||||
CATCH zcx_abapgit_exception ##NO_HANDLER.
|
|
||||||
" Ignore errors related to object check when trying to get transport
|
|
||||||
ENDTRY.
|
|
||||||
|
|
||||||
ri_html->add( '</td>' ).
|
ri_html->add( '</td>' ).
|
||||||
|
|
||||||
|
|
|
@ -314,6 +314,7 @@ INTERFACE zif_abapgit_definitions
|
||||||
rstate TYPE ty_item_state,
|
rstate TYPE ty_item_state,
|
||||||
files TYPE ty_repo_file_tt,
|
files TYPE ty_repo_file_tt,
|
||||||
changed_by TYPE syuname,
|
changed_by TYPE syuname,
|
||||||
|
transport TYPE trkorr,
|
||||||
packmove TYPE abap_bool,
|
packmove TYPE abap_bool,
|
||||||
END OF ty_repo_item .
|
END OF ty_repo_item .
|
||||||
TYPES:
|
TYPES:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user