mirror of
https://github.com/abapGit/abapGit.git
synced 2025-05-01 12:20:51 +08:00
Offline repo: Folder logic in create popup
This commit is contained in:
parent
6eb17c2e10
commit
ad7809e4f2
|
@ -82,12 +82,17 @@ CLASS zcl_abapgit_popups DEFINITION
|
||||||
CHANGING ct_fields TYPE ty_lt_fields
|
CHANGING ct_fields TYPE ty_lt_fields
|
||||||
RAISING zcx_abapgit_exception
|
RAISING zcx_abapgit_exception
|
||||||
zcx_abapgit_cancel.
|
zcx_abapgit_cancel.
|
||||||
|
METHODS validate_folder_logic
|
||||||
|
IMPORTING
|
||||||
|
iv_folder_logic TYPE string
|
||||||
|
RAISING
|
||||||
|
zcx_abapgit_exception.
|
||||||
|
|
||||||
ENDCLASS.
|
ENDCLASS.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
CLASS ZCL_ABAPGIT_POPUPS IMPLEMENTATION.
|
CLASS zcl_abapgit_popups IMPLEMENTATION.
|
||||||
|
|
||||||
|
|
||||||
METHOD add_field.
|
METHOD add_field.
|
||||||
|
@ -899,6 +904,13 @@ CLASS ZCL_ABAPGIT_POPUPS IMPLEMENTATION.
|
||||||
iv_obligatory = abap_true
|
iv_obligatory = abap_true
|
||||||
CHANGING ct_fields = lt_fields ).
|
CHANGING ct_fields = lt_fields ).
|
||||||
|
|
||||||
|
add_field( EXPORTING iv_tabname = 'ZABAPGIT'
|
||||||
|
iv_fieldname = 'VALUE'
|
||||||
|
iv_fieldtext = 'Folder logic'
|
||||||
|
iv_obligatory = abap_true
|
||||||
|
iv_value = zif_abapgit_dot_abapgit=>c_folder_logic-prefix
|
||||||
|
CHANGING ct_fields = lt_fields ).
|
||||||
|
|
||||||
WHILE lv_finished = abap_false.
|
WHILE lv_finished = abap_false.
|
||||||
|
|
||||||
lv_icon_ok = icon_okay.
|
lv_icon_ok = icon_okay.
|
||||||
|
@ -941,10 +953,16 @@ CLASS ZCL_ABAPGIT_POPUPS IMPLEMENTATION.
|
||||||
TRANSLATE <ls_field>-value TO UPPER CASE.
|
TRANSLATE <ls_field>-value TO UPPER CASE.
|
||||||
rs_popup-package = <ls_field>-value.
|
rs_popup-package = <ls_field>-value.
|
||||||
|
|
||||||
|
READ TABLE lt_fields INDEX 3 ASSIGNING <ls_field>.
|
||||||
|
ASSERT sy-subrc = 0.
|
||||||
|
TRANSLATE <ls_field>-value TO UPPER CASE.
|
||||||
|
rs_popup-folder_logic = <ls_field>-value.
|
||||||
|
|
||||||
lv_finished = abap_true.
|
lv_finished = abap_true.
|
||||||
|
|
||||||
TRY.
|
TRY.
|
||||||
zcl_abapgit_repo_srv=>get_instance( )->validate_package( rs_popup-package ).
|
zcl_abapgit_repo_srv=>get_instance( )->validate_package( rs_popup-package ).
|
||||||
|
validate_folder_logic( rs_popup-folder_logic ).
|
||||||
|
|
||||||
CATCH zcx_abapgit_exception INTO lx_error.
|
CATCH zcx_abapgit_exception INTO lx_error.
|
||||||
" in case of validation errors we display the popup again
|
" in case of validation errors we display the popup again
|
||||||
|
@ -1140,4 +1158,18 @@ CLASS ZCL_ABAPGIT_POPUPS IMPLEMENTATION.
|
||||||
ENDIF.
|
ENDIF.
|
||||||
|
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
|
||||||
|
METHOD validate_folder_logic.
|
||||||
|
|
||||||
|
IF iv_folder_logic <> zif_abapgit_dot_abapgit=>c_folder_logic-prefix
|
||||||
|
AND iv_folder_logic <> zif_abapgit_dot_abapgit=>c_folder_logic-full.
|
||||||
|
|
||||||
|
zcx_abapgit_exception=>raise( |Invalid folder logic { iv_folder_logic }. |
|
||||||
|
&& |Choose either { zif_abapgit_dot_abapgit=>c_folder_logic-prefix } |
|
||||||
|
&& |or { zif_abapgit_dot_abapgit=>c_folder_logic-full } | ).
|
||||||
|
|
||||||
|
ENDIF.
|
||||||
|
|
||||||
|
ENDMETHOD.
|
||||||
|
|
||||||
ENDCLASS.
|
ENDCLASS.
|
||||||
|
|
|
@ -146,8 +146,9 @@ CLASS ZCL_ABAPGIT_SERVICES_REPO IMPLEMENTATION.
|
||||||
ENDIF.
|
ENDIF.
|
||||||
|
|
||||||
lo_repo = zcl_abapgit_repo_srv=>get_instance( )->new_offline(
|
lo_repo = zcl_abapgit_repo_srv=>get_instance( )->new_offline(
|
||||||
iv_url = ls_popup-url
|
iv_url = ls_popup-url
|
||||||
iv_package = ls_popup-package ).
|
iv_package = ls_popup-package
|
||||||
|
iv_folder_logic = ls_popup-folder_logic ).
|
||||||
lo_repo->rebuild_local_checksums( ).
|
lo_repo->rebuild_local_checksums( ).
|
||||||
|
|
||||||
zcl_abapgit_persistence_user=>get_instance( )->set_repo_show( lo_repo->get_key( ) ). " Set default repo for user
|
zcl_abapgit_persistence_user=>get_instance( )->set_repo_show( lo_repo->get_key( ) ). " Set default repo for user
|
||||||
|
|
|
@ -4,10 +4,11 @@ INTERFACE zif_abapgit_popups
|
||||||
|
|
||||||
TYPES:
|
TYPES:
|
||||||
BEGIN OF ty_popup,
|
BEGIN OF ty_popup,
|
||||||
url TYPE string,
|
url TYPE string,
|
||||||
package TYPE devclass,
|
package TYPE devclass,
|
||||||
branch_name TYPE string,
|
branch_name TYPE string,
|
||||||
cancel TYPE abap_bool,
|
folder_logic TYPE string,
|
||||||
|
cancel TYPE abap_bool,
|
||||||
END OF ty_popup .
|
END OF ty_popup .
|
||||||
|
|
||||||
CONSTANTS c_new_branch_label TYPE string VALUE '+ create new ...' ##NO_TEXT.
|
CONSTANTS c_new_branch_label TYPE string VALUE '+ create new ...' ##NO_TEXT.
|
||||||
|
|
|
@ -293,18 +293,22 @@ CLASS ZCL_ABAPGIT_REPO_SRV IMPLEMENTATION.
|
||||||
|
|
||||||
METHOD zif_abapgit_repo_srv~new_offline.
|
METHOD zif_abapgit_repo_srv~new_offline.
|
||||||
|
|
||||||
DATA: ls_repo TYPE zif_abapgit_persistence=>ty_repo,
|
DATA: ls_repo TYPE zif_abapgit_persistence=>ty_repo,
|
||||||
lv_key TYPE zif_abapgit_persistence=>ty_repo-key.
|
lv_key TYPE zif_abapgit_persistence=>ty_repo-key,
|
||||||
|
lo_dot_abapgit TYPE REF TO zcl_abapgit_dot_abapgit.
|
||||||
|
|
||||||
|
|
||||||
validate_package( iv_package ).
|
validate_package( iv_package ).
|
||||||
|
|
||||||
|
lo_dot_abapgit = zcl_abapgit_dot_abapgit=>build_default( ).
|
||||||
|
lo_dot_abapgit->set_folder_logic( iv_folder_logic ).
|
||||||
|
|
||||||
lv_key = zcl_abapgit_persist_factory=>get_repo( )->add(
|
lv_key = zcl_abapgit_persist_factory=>get_repo( )->add(
|
||||||
iv_url = iv_url
|
iv_url = iv_url
|
||||||
iv_branch_name = ''
|
iv_branch_name = ''
|
||||||
iv_package = iv_package
|
iv_package = iv_package
|
||||||
iv_offline = abap_true
|
iv_offline = abap_true
|
||||||
is_dot_abapgit = zcl_abapgit_dot_abapgit=>build_default( )->get_data( ) ).
|
is_dot_abapgit = lo_dot_abapgit->get_data( ) ).
|
||||||
|
|
||||||
TRY.
|
TRY.
|
||||||
ls_repo = zcl_abapgit_persist_factory=>get_repo( )->read( lv_key ).
|
ls_repo = zcl_abapgit_persist_factory=>get_repo( )->read( lv_key ).
|
||||||
|
|
|
@ -29,10 +29,11 @@ INTERFACE zif_abapgit_repo_srv
|
||||||
zcx_abapgit_exception .
|
zcx_abapgit_exception .
|
||||||
METHODS new_offline
|
METHODS new_offline
|
||||||
IMPORTING
|
IMPORTING
|
||||||
!iv_url TYPE string
|
!iv_url TYPE string
|
||||||
!iv_package TYPE devclass
|
!iv_package TYPE devclass
|
||||||
|
iv_folder_logic TYPE string DEFAULT zif_abapgit_dot_abapgit=>c_folder_logic-full
|
||||||
RETURNING
|
RETURNING
|
||||||
VALUE(ro_repo) TYPE REF TO zcl_abapgit_repo_offline
|
VALUE(ro_repo) TYPE REF TO zcl_abapgit_repo_offline
|
||||||
RAISING
|
RAISING
|
||||||
zcx_abapgit_exception .
|
zcx_abapgit_exception .
|
||||||
METHODS new_online
|
METHODS new_online
|
||||||
|
|
Loading…
Reference in New Issue
Block a user