mirror of
https://github.com/abapGit/abapGit.git
synced 2025-05-01 20:32:26 +08:00
Fix dump during "New Online" (#4977)
* Fix dump during "New Online" I accidentally used a copied link `sapevent:url?url=https://github.com/abapGit-tests/TABL` into the "New Online" diaplog. AG would dump in this case. Now you get a proper error message. * Strip leading/trailing spaces for URLs * Add * Update Co-authored-by: Lars Hvam <larshp@hotmail.com> Co-authored-by: g-back <27279305+g-back@users.noreply.github.com>
This commit is contained in:
parent
84e6971bf8
commit
b41831868f
|
@ -96,6 +96,7 @@ CLASS zcl_abapgit_gui_page_addonline IMPLEMENTATION.
|
||||||
ro_form->text(
|
ro_form->text(
|
||||||
iv_name = c_id-url
|
iv_name = c_id-url
|
||||||
iv_required = abap_true
|
iv_required = abap_true
|
||||||
|
iv_condense = abap_true
|
||||||
iv_label = 'Git Repository URL'
|
iv_label = 'Git Repository URL'
|
||||||
iv_hint = 'HTTPS address of the repository'
|
iv_hint = 'HTTPS address of the repository'
|
||||||
iv_placeholder = 'https://github.com/...git'
|
iv_placeholder = 'https://github.com/...git'
|
||||||
|
|
|
@ -467,6 +467,7 @@ CLASS zcl_abapgit_gui_page_sett_remo IMPLEMENTATION.
|
||||||
iv_readonly = abap_true
|
iv_readonly = abap_true
|
||||||
)->text(
|
)->text(
|
||||||
iv_name = c_id-url
|
iv_name = c_id-url
|
||||||
|
iv_condense = abap_true
|
||||||
iv_label = lv_label
|
iv_label = lv_label
|
||||||
iv_hint = lv_hint
|
iv_hint = lv_hint
|
||||||
iv_placeholder = lv_placeholder ).
|
iv_placeholder = lv_placeholder ).
|
||||||
|
|
|
@ -36,6 +36,7 @@ CLASS zcl_abapgit_html_form DEFINITION
|
||||||
!iv_upper_case TYPE abap_bool DEFAULT abap_false
|
!iv_upper_case TYPE abap_bool DEFAULT abap_false
|
||||||
!iv_readonly TYPE abap_bool DEFAULT abap_false
|
!iv_readonly TYPE abap_bool DEFAULT abap_false
|
||||||
!iv_password TYPE abap_bool DEFAULT abap_false
|
!iv_password TYPE abap_bool DEFAULT abap_false
|
||||||
|
!iv_condense TYPE abap_bool OPTIONAL
|
||||||
!iv_placeholder TYPE csequence OPTIONAL
|
!iv_placeholder TYPE csequence OPTIONAL
|
||||||
!iv_side_action TYPE csequence OPTIONAL
|
!iv_side_action TYPE csequence OPTIONAL
|
||||||
!iv_min TYPE i DEFAULT cl_abap_math=>min_int4
|
!iv_min TYPE i DEFAULT cl_abap_math=>min_int4
|
||||||
|
@ -817,6 +818,7 @@ CLASS zcl_abapgit_html_form IMPLEMENTATION.
|
||||||
ls_field-min = iv_min.
|
ls_field-min = iv_min.
|
||||||
ls_field-max = iv_max.
|
ls_field-max = iv_max.
|
||||||
ls_field-password = iv_password.
|
ls_field-password = iv_password.
|
||||||
|
ls_field-condense = iv_condense.
|
||||||
ls_field-hint = iv_hint.
|
ls_field-hint = iv_hint.
|
||||||
ls_field-required = iv_required.
|
ls_field-required = iv_required.
|
||||||
ls_field-placeholder = iv_placeholder.
|
ls_field-placeholder = iv_placeholder.
|
||||||
|
|
|
@ -59,7 +59,7 @@ ENDCLASS.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
CLASS ZCL_ABAPGIT_HTML_FORM_UTILS IMPLEMENTATION.
|
CLASS zcl_abapgit_html_form_utils IMPLEMENTATION.
|
||||||
|
|
||||||
|
|
||||||
METHOD constructor.
|
METHOD constructor.
|
||||||
|
@ -169,6 +169,10 @@ CLASS ZCL_ABAPGIT_HTML_FORM_UTILS IMPLEMENTATION.
|
||||||
LOOP AT lt_fields ASSIGNING <ls_field> WHERE type <> zif_abapgit_html_form=>c_field_type-field_group.
|
LOOP AT lt_fields ASSIGNING <ls_field> WHERE type <> zif_abapgit_html_form=>c_field_type-field_group.
|
||||||
CLEAR lv_value.
|
CLEAR lv_value.
|
||||||
lv_value = io_form_data->get( <ls_field>-name ).
|
lv_value = io_form_data->get( <ls_field>-name ).
|
||||||
|
IF <ls_field>-condense = abap_true.
|
||||||
|
lv_value = condense( val = lv_value
|
||||||
|
del = ` ` ).
|
||||||
|
ENDIF.
|
||||||
|
|
||||||
IF <ls_field>-type = zif_abapgit_html_form=>c_field_type-checkbox.
|
IF <ls_field>-type = zif_abapgit_html_form=>c_field_type-checkbox.
|
||||||
ro_form_data->set(
|
ro_form_data->set(
|
||||||
|
@ -241,6 +245,10 @@ CLASS ZCL_ABAPGIT_HTML_FORM_UTILS IMPLEMENTATION.
|
||||||
lt_fields = mo_form->get_fields( ).
|
lt_fields = mo_form->get_fields( ).
|
||||||
LOOP AT lt_fields ASSIGNING <ls_field>.
|
LOOP AT lt_fields ASSIGNING <ls_field>.
|
||||||
lv_value = io_form_data->get( <ls_field>-name ).
|
lv_value = io_form_data->get( <ls_field>-name ).
|
||||||
|
IF <ls_field>-condense = abap_true.
|
||||||
|
lv_value = condense( val = lv_value
|
||||||
|
del = ` ` ).
|
||||||
|
ENDIF.
|
||||||
IF <ls_field>-required IS NOT INITIAL AND lv_value IS INITIAL.
|
IF <ls_field>-required IS NOT INITIAL AND lv_value IS INITIAL.
|
||||||
ro_validation_log->set(
|
ro_validation_log->set(
|
||||||
iv_key = <ls_field>-name
|
iv_key = <ls_field>-name
|
||||||
|
|
|
@ -26,6 +26,7 @@ INTERFACE zif_abapgit_html_form
|
||||||
subitems TYPE ty_subitems,
|
subitems TYPE ty_subitems,
|
||||||
readonly TYPE abap_bool,
|
readonly TYPE abap_bool,
|
||||||
password TYPE abap_bool,
|
password TYPE abap_bool,
|
||||||
|
condense TYPE abap_bool,
|
||||||
min TYPE i,
|
min TYPE i,
|
||||||
max TYPE i,
|
max TYPE i,
|
||||||
END OF ty_field .
|
END OF ty_field .
|
||||||
|
|
|
@ -119,10 +119,10 @@ CLASS zcl_abapgit_url IMPLEMENTATION.
|
||||||
|
|
||||||
METHOD regex.
|
METHOD regex.
|
||||||
|
|
||||||
FIND REGEX '(https?://[^/]*)(.*/)(.*)\.git$' IN iv_url
|
FIND REGEX '^(https?://[^/]*)(.*/)(.*)\.git$' IN iv_url
|
||||||
SUBMATCHES ev_host ev_path ev_name.
|
SUBMATCHES ev_host ev_path ev_name.
|
||||||
IF sy-subrc <> 0.
|
IF sy-subrc <> 0.
|
||||||
FIND REGEX '(https?://[^/]*)(.*/)(.*)$' IN iv_url
|
FIND REGEX '^(https?://[^/]*)(.*/)(.*)$' IN iv_url
|
||||||
SUBMATCHES ev_host ev_path ev_name.
|
SUBMATCHES ev_host ev_path ev_name.
|
||||||
IF sy-subrc <> 0.
|
IF sy-subrc <> 0.
|
||||||
zcx_abapgit_exception=>raise( 'Malformed URL' ).
|
zcx_abapgit_exception=>raise( 'Malformed URL' ).
|
||||||
|
@ -132,14 +132,6 @@ CLASS zcl_abapgit_url IMPLEMENTATION.
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
|
||||||
|
|
||||||
METHOD validate.
|
|
||||||
|
|
||||||
name( iv_url = iv_url
|
|
||||||
iv_validate = abap_true ).
|
|
||||||
|
|
||||||
ENDMETHOD.
|
|
||||||
|
|
||||||
|
|
||||||
METHOD url_address.
|
METHOD url_address.
|
||||||
|
|
||||||
DATA:
|
DATA:
|
||||||
|
@ -167,4 +159,10 @@ CLASS zcl_abapgit_url IMPLEMENTATION.
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
|
||||||
|
|
||||||
|
METHOD validate.
|
||||||
|
|
||||||
|
name( iv_url = iv_url
|
||||||
|
iv_validate = abap_true ).
|
||||||
|
|
||||||
|
ENDMETHOD.
|
||||||
ENDCLASS.
|
ENDCLASS.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user