mirror of
https://github.com/abapGit/abapGit.git
synced 2025-04-30 20:03:20 +08:00
Merge pull request #1553 from flaiker/requirements-ui
Add UI for requirements in repo settings
This commit is contained in:
commit
6f54a1e9ff
|
@ -91,15 +91,25 @@ CLASS zcl_abapgit_gui_page_repo_sett IMPLEMENTATION.
|
||||||
|
|
||||||
METHOD render_dot_abapgit.
|
METHOD render_dot_abapgit.
|
||||||
|
|
||||||
|
CONSTANTS: lc_requirement_edit_count TYPE i VALUE 5.
|
||||||
DATA: ls_dot TYPE zif_abapgit_dot_abapgit=>ty_dot_abapgit,
|
DATA: ls_dot TYPE zif_abapgit_dot_abapgit=>ty_dot_abapgit,
|
||||||
lv_selected TYPE string,
|
lv_selected TYPE string,
|
||||||
lt_folder_logic TYPE stringtab.
|
lt_folder_logic TYPE stringtab,
|
||||||
|
lv_req_index TYPE i,
|
||||||
FIELD-SYMBOLS: <lv_folder_logic> TYPE LINE OF stringtab.
|
lv_requirement_count TYPE i.
|
||||||
|
|
||||||
|
FIELD-SYMBOLS: <lv_folder_logic> TYPE LINE OF stringtab,
|
||||||
|
<ls_requirement> TYPE zif_abapgit_dot_abapgit=>ty_requirement.
|
||||||
|
|
||||||
ls_dot = mo_repo->get_dot_abapgit( )->get_data( ).
|
ls_dot = mo_repo->get_dot_abapgit( )->get_data( ).
|
||||||
|
|
||||||
|
lv_requirement_count = lines( ls_dot-requirements ).
|
||||||
|
IF lv_requirement_count < lc_requirement_edit_count.
|
||||||
|
DO - lv_requirement_count + lc_requirement_edit_count TIMES.
|
||||||
|
INSERT INITIAL LINE INTO TABLE ls_dot-requirements.
|
||||||
|
ENDDO.
|
||||||
|
ENDIF.
|
||||||
|
|
||||||
INSERT zif_abapgit_dot_abapgit=>c_folder_logic-full
|
INSERT zif_abapgit_dot_abapgit=>c_folder_logic-full
|
||||||
INTO TABLE lt_folder_logic.
|
INTO TABLE lt_folder_logic.
|
||||||
|
|
||||||
|
@ -130,6 +140,25 @@ CLASS zcl_abapgit_gui_page_repo_sett IMPLEMENTATION.
|
||||||
ls_dot-starting_folder && '">' ).
|
ls_dot-starting_folder && '">' ).
|
||||||
io_html->add( '<br>' ).
|
io_html->add( '<br>' ).
|
||||||
|
|
||||||
|
io_html->add( '<h3>Requirements</h3>' ).
|
||||||
|
io_html->add( '<table class="repo_tab" id="requirement-tab" style="max-width: 300px;">' ).
|
||||||
|
io_html->add( '<tr><th>Software Component</th><th>Min Release</th><th>Min Patch</th></tr>' ).
|
||||||
|
|
||||||
|
LOOP AT ls_dot-requirements ASSIGNING <ls_requirement>.
|
||||||
|
lv_req_index = sy-tabix.
|
||||||
|
|
||||||
|
io_html->add( '<tr>' ).
|
||||||
|
io_html->add( |<td><input name="req_com_{ lv_req_index }" maxlength=30 type="text" | &&
|
||||||
|
|value="{ <ls_requirement>-component }"></td>| ).
|
||||||
|
io_html->add( |<td><input name="req_rel_{ lv_req_index }" maxlength=10 type="text" | &&
|
||||||
|
|value="{ <ls_requirement>-min_release }"></td>| ).
|
||||||
|
io_html->add( |<td><input name="req_pat_{ lv_req_index }" maxlength=10 type="text" | &&
|
||||||
|
|value="{ <ls_requirement>-min_patch }"></td>| ).
|
||||||
|
io_html->add( '</tr>' ).
|
||||||
|
ENDLOOP.
|
||||||
|
|
||||||
|
io_html->add( '</table>' ).
|
||||||
|
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
|
||||||
|
|
||||||
|
@ -196,7 +225,9 @@ CLASS zcl_abapgit_gui_page_repo_sett IMPLEMENTATION.
|
||||||
METHOD save_dot_abap.
|
METHOD save_dot_abap.
|
||||||
|
|
||||||
DATA: lo_dot TYPE REF TO zcl_abapgit_dot_abapgit,
|
DATA: lo_dot TYPE REF TO zcl_abapgit_dot_abapgit,
|
||||||
ls_post_field LIKE LINE OF it_post_fields.
|
ls_post_field LIKE LINE OF it_post_fields,
|
||||||
|
lt_requirements TYPE zif_abapgit_dot_abapgit=>ty_requirement_tt.
|
||||||
|
FIELD-SYMBOLS: <ls_requirement> TYPE zif_abapgit_dot_abapgit=>ty_requirement.
|
||||||
|
|
||||||
|
|
||||||
lo_dot = mo_repo->get_dot_abapgit( ).
|
lo_dot = mo_repo->get_dot_abapgit( ).
|
||||||
|
@ -209,6 +240,24 @@ CLASS zcl_abapgit_gui_page_repo_sett IMPLEMENTATION.
|
||||||
ASSERT sy-subrc = 0.
|
ASSERT sy-subrc = 0.
|
||||||
lo_dot->set_starting_folder( ls_post_field-value ).
|
lo_dot->set_starting_folder( ls_post_field-value ).
|
||||||
|
|
||||||
|
LOOP AT it_post_fields INTO ls_post_field WHERE name CP 'req_*'.
|
||||||
|
CASE ls_post_field-name+4(3).
|
||||||
|
WHEN 'com'.
|
||||||
|
INSERT INITIAL LINE INTO TABLE lt_requirements ASSIGNING <ls_requirement>.
|
||||||
|
<ls_requirement>-component = ls_post_field-value.
|
||||||
|
WHEN 'rel'.
|
||||||
|
<ls_requirement>-min_release = ls_post_field-value.
|
||||||
|
WHEN 'pat'.
|
||||||
|
<ls_requirement>-min_patch = ls_post_field-value.
|
||||||
|
ENDCASE.
|
||||||
|
ENDLOOP.
|
||||||
|
|
||||||
|
SORT lt_requirements BY component min_release min_patch.
|
||||||
|
DELETE lt_requirements WHERE component IS INITIAL.
|
||||||
|
DELETE ADJACENT DUPLICATES FROM lt_requirements COMPARING ALL FIELDS.
|
||||||
|
|
||||||
|
lo_dot->set_requirements( lt_requirements ).
|
||||||
|
|
||||||
mo_repo->set_dot_abapgit( lo_dot ).
|
mo_repo->set_dot_abapgit( lo_dot ).
|
||||||
|
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
@ -278,6 +327,4 @@ CLASS zcl_abapgit_gui_page_repo_sett IMPLEMENTATION.
|
||||||
ENDCASE.
|
ENDCASE.
|
||||||
|
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
|
||||||
|
|
||||||
ENDCLASS.
|
ENDCLASS.
|
||||||
|
|
|
@ -65,6 +65,12 @@ CLASS zcl_abapgit_dot_abapgit DEFINITION
|
||||||
VALUE(rs_signature) TYPE zif_abapgit_definitions=>ty_file_signature
|
VALUE(rs_signature) TYPE zif_abapgit_definitions=>ty_file_signature
|
||||||
RAISING
|
RAISING
|
||||||
zcx_abapgit_exception .
|
zcx_abapgit_exception .
|
||||||
|
METHODS get_requirements
|
||||||
|
RETURNING
|
||||||
|
VALUE(rt_requirements) TYPE zif_abapgit_dot_abapgit=>ty_requirement_tt.
|
||||||
|
METHODS set_requirements
|
||||||
|
IMPORTING
|
||||||
|
it_requirements TYPE zif_abapgit_dot_abapgit=>ty_requirement_tt.
|
||||||
PRIVATE SECTION.
|
PRIVATE SECTION.
|
||||||
DATA: ms_data TYPE zif_abapgit_dot_abapgit=>ty_dot_abapgit.
|
DATA: ms_data TYPE zif_abapgit_dot_abapgit=>ty_dot_abapgit.
|
||||||
|
|
||||||
|
@ -281,4 +287,11 @@ CLASS zcl_abapgit_dot_abapgit IMPLEMENTATION.
|
||||||
|
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
|
||||||
|
METHOD get_requirements.
|
||||||
|
rt_requirements = ms_data-requirements.
|
||||||
|
ENDMETHOD.
|
||||||
|
|
||||||
|
METHOD set_requirements.
|
||||||
|
ms_data-requirements = it_requirements.
|
||||||
|
ENDMETHOD.
|
||||||
ENDCLASS.
|
ENDCLASS.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user