mirror of
https://github.com/abapGit/abapGit.git
synced 2025-05-02 04:36:49 +08:00
Diff/Patch: Add "Filter by Object Type" (#5129)
* Diff/Patch: Add "Filter by Object Type" Enhancement of filter options: - Renamed "Type" to "Extension" - Added "Object Type" Closes #3249 * Switch to INSERT Co-authored-by: Lars Hvam <larshp@hotmail.com> Co-authored-by: Christian Günter <christianguenter@googlemail.com>
This commit is contained in:
parent
49bc056fec
commit
86262f4e54
|
@ -254,24 +254,23 @@ CLASS zcl_abapgit_gui_page_diff IMPLEMENTATION.
|
||||||
|
|
||||||
DATA:
|
DATA:
|
||||||
lo_sub_filter TYPE REF TO zcl_abapgit_html_toolbar,
|
lo_sub_filter TYPE REF TO zcl_abapgit_html_toolbar,
|
||||||
lt_types TYPE string_table,
|
lv_user TYPE string,
|
||||||
lt_users TYPE string_table.
|
lt_extensions TYPE SORTED TABLE OF string WITH UNIQUE DEFAULT KEY,
|
||||||
|
lt_obj_types TYPE SORTED TABLE OF string WITH UNIQUE DEFAULT KEY,
|
||||||
|
lt_users TYPE SORTED TABLE OF string WITH UNIQUE DEFAULT KEY.
|
||||||
|
|
||||||
FIELD-SYMBOLS: <ls_diff> LIKE LINE OF mt_diff_files,
|
FIELD-SYMBOLS: <ls_diff> LIKE LINE OF mt_diff_files,
|
||||||
<lv_i> TYPE string.
|
<lv_i> TYPE string.
|
||||||
" Get unique
|
|
||||||
|
" Get unique filter values
|
||||||
LOOP AT mt_diff_files ASSIGNING <ls_diff>.
|
LOOP AT mt_diff_files ASSIGNING <ls_diff>.
|
||||||
APPEND <ls_diff>-type TO lt_types.
|
lv_user = <ls_diff>-changed_by.
|
||||||
APPEND <ls_diff>-changed_by TO lt_users.
|
INSERT <ls_diff>-type INTO TABLE lt_extensions.
|
||||||
|
INSERT <ls_diff>-obj_type INTO TABLE lt_obj_types.
|
||||||
|
INSERT lv_user INTO TABLE lt_users.
|
||||||
ENDLOOP.
|
ENDLOOP.
|
||||||
|
|
||||||
SORT lt_types.
|
IF lines( lt_extensions ) > 1 OR lines( lt_obj_types ) > 1 OR lines( lt_users ) > 1.
|
||||||
DELETE ADJACENT DUPLICATES FROM lt_types.
|
|
||||||
|
|
||||||
SORT lt_users.
|
|
||||||
DELETE ADJACENT DUPLICATES FROM lt_users.
|
|
||||||
|
|
||||||
IF lines( lt_types ) > 1 OR lines( lt_users ) > 1.
|
|
||||||
CREATE OBJECT lo_sub_filter EXPORTING iv_id = 'diff-filter'.
|
CREATE OBJECT lo_sub_filter EXPORTING iv_id = 'diff-filter'.
|
||||||
|
|
||||||
IF lines( lt_users ) > 1.
|
IF lines( lt_users ) > 1.
|
||||||
|
@ -281,21 +280,33 @@ CLASS zcl_abapgit_gui_page_diff IMPLEMENTATION.
|
||||||
iv_chk = abap_false ).
|
iv_chk = abap_false ).
|
||||||
ENDIF.
|
ENDIF.
|
||||||
|
|
||||||
" File types
|
" File extensions
|
||||||
IF lines( lt_types ) > 1.
|
IF lines( lt_extensions ) > 1.
|
||||||
lo_sub_filter->add( iv_txt = 'TYPE'
|
lo_sub_filter->add( iv_txt = 'Extension'
|
||||||
iv_typ = zif_abapgit_html=>c_action_type-separator ).
|
iv_typ = zif_abapgit_html=>c_action_type-separator ).
|
||||||
LOOP AT lt_types ASSIGNING <lv_i>.
|
LOOP AT lt_extensions ASSIGNING <lv_i>.
|
||||||
lo_sub_filter->add( iv_txt = <lv_i>
|
lo_sub_filter->add( iv_txt = <lv_i>
|
||||||
iv_typ = zif_abapgit_html=>c_action_type-onclick
|
iv_typ = zif_abapgit_html=>c_action_type-onclick
|
||||||
iv_aux = 'type'
|
iv_aux = 'extension'
|
||||||
|
iv_chk = abap_true ).
|
||||||
|
ENDLOOP.
|
||||||
|
ENDIF.
|
||||||
|
|
||||||
|
" Object types
|
||||||
|
IF lines( lt_obj_types ) > 1.
|
||||||
|
lo_sub_filter->add( iv_txt = 'Object Type'
|
||||||
|
iv_typ = zif_abapgit_html=>c_action_type-separator ).
|
||||||
|
LOOP AT lt_obj_types ASSIGNING <lv_i>.
|
||||||
|
lo_sub_filter->add( iv_txt = <lv_i>
|
||||||
|
iv_typ = zif_abapgit_html=>c_action_type-onclick
|
||||||
|
iv_aux = 'object-type'
|
||||||
iv_chk = abap_true ).
|
iv_chk = abap_true ).
|
||||||
ENDLOOP.
|
ENDLOOP.
|
||||||
ENDIF.
|
ENDIF.
|
||||||
|
|
||||||
" Changed by
|
" Changed by
|
||||||
IF lines( lt_users ) > 1.
|
IF lines( lt_users ) > 1.
|
||||||
lo_sub_filter->add( iv_txt = 'CHANGED BY'
|
lo_sub_filter->add( iv_txt = 'Changed By'
|
||||||
iv_typ = zif_abapgit_html=>c_action_type-separator ).
|
iv_typ = zif_abapgit_html=>c_action_type-separator ).
|
||||||
LOOP AT lt_users ASSIGNING <lv_i>.
|
LOOP AT lt_users ASSIGNING <lv_i>.
|
||||||
lo_sub_filter->add( iv_txt = <lv_i>
|
lo_sub_filter->add( iv_txt = <lv_i>
|
||||||
|
@ -804,7 +815,8 @@ CLASS zcl_abapgit_gui_page_diff IMPLEMENTATION.
|
||||||
|
|
||||||
CREATE OBJECT ri_html TYPE zcl_abapgit_html.
|
CREATE OBJECT ri_html TYPE zcl_abapgit_html.
|
||||||
|
|
||||||
ri_html->add( |<div class="diff" data-type="{ is_diff-type
|
ri_html->add( |<div class="diff" data-extension="{ is_diff-type
|
||||||
|
}" data-object-type="{ is_diff-obj_type
|
||||||
}" data-changed-by="{ is_diff-changed_by
|
}" data-changed-by="{ is_diff-changed_by
|
||||||
}" data-file="{ is_diff-path && is_diff-filename }">| ).
|
}" data-file="{ is_diff-path && is_diff-filename }">| ).
|
||||||
ri_html->add( render_diff_head( is_diff ) ).
|
ri_html->add( render_diff_head( is_diff ) ).
|
||||||
|
|
Loading…
Reference in New Issue
Block a user