flow page, cleanup and remove feature flag (#6668)

This commit is contained in:
Lars Hvam 2023-11-28 19:24:08 +01:00 committed by GitHub
parent a8b3bf9427
commit e14cba7d71
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 31 additions and 18 deletions

View File

@ -76,6 +76,7 @@ CLASS zcl_abapgit_html_form DEFINITION
!iv_label TYPE csequence
!iv_name TYPE csequence
!iv_hint TYPE csequence OPTIONAL
!iv_readonly TYPE abap_bool DEFAULT abap_false
RETURNING
VALUE(ro_self) TYPE REF TO zcl_abapgit_html_form .
METHODS radio
@ -201,10 +202,11 @@ CLASS zcl_abapgit_html_form IMPLEMENTATION.
DATA ls_field LIKE LINE OF mt_fields.
ls_field-type = zif_abapgit_html_form=>c_field_type-checkbox.
ls_field-name = iv_name.
ls_field-label = iv_label.
ls_field-hint = iv_hint.
ls_field-type = zif_abapgit_html_form=>c_field_type-checkbox.
ls_field-name = iv_name.
ls_field-label = iv_label.
ls_field-hint = iv_hint.
ls_field-readonly = iv_readonly.
APPEND ls_field TO mt_fields.
@ -632,7 +634,8 @@ CLASS zcl_abapgit_html_form IMPLEMENTATION.
METHOD render_field_checkbox.
DATA lv_checked TYPE string.
DATA lv_checked TYPE string.
DATA lv_disabled TYPE string.
IF is_attr-error IS NOT INITIAL.
ii_html->add( is_attr-error ).
@ -643,8 +646,12 @@ CLASS zcl_abapgit_html_form IMPLEMENTATION.
lv_checked = ' checked'.
ENDIF.
IF is_attr-readonly IS NOT INITIAL.
lv_disabled = ' disabled'.
ENDIF.
ii_html->add( |<input type="checkbox" name="{ is_field-name }" id="{ is_field-name }"| &&
|{ lv_checked }{ is_attr-readonly }{ is_attr-autofocus }>| ).
|{ lv_checked }{ lv_disabled }{ is_attr-autofocus }>| ).
ii_html->add( |<label for="{ is_field-name }"{ is_attr-hint }>{ is_field-label }</label>| ).
ENDMETHOD.

View File

@ -50,7 +50,7 @@ ENDCLASS.
CLASS ZCL_ABAPGIT_GUI_PAGE_FLOW IMPLEMENTATION.
CLASS zcl_abapgit_gui_page_flow IMPLEMENTATION.
METHOD constructor.
@ -336,6 +336,16 @@ CLASS ZCL_ABAPGIT_GUI_PAGE_FLOW IMPLEMENTATION.
ri_html->add( '<br>' ).
ENDLOOP.
IF lines( mt_features ) = 0.
ri_html->add( 'Empty, repositories must be favorite + flow enabled<br><br>' ).
ri_html->add_a(
iv_txt = 'abapGit flow documentation'
iv_act = |{ zif_abapgit_definitions=>c_action-url
}?url=https://docs.abapgit.org/user-guide/reference/flow.html|
iv_class = |url| ).
ENDIF.
ri_html->add( '</div>' ).
ENDMETHOD.

View File

@ -1002,11 +1002,9 @@ CLASS zcl_abapgit_gui_page_repo_over IMPLEMENTATION.
CREATE OBJECT ro_toolbar EXPORTING iv_id = 'toolbar-main'.
IF zcl_abapgit_feature=>is_enabled( 'FLOW' ) = abap_true.
ro_toolbar->add(
iv_txt = zcl_abapgit_gui_buttons=>flow( )
iv_act = zif_abapgit_definitions=>c_action-flow ).
ENDIF.
ro_toolbar->add(
iv_txt = zcl_abapgit_gui_buttons=>flow( )
iv_act = zif_abapgit_definitions=>c_action-flow ).
ro_toolbar->add(
iv_txt = zcl_abapgit_gui_buttons=>new_online( )

View File

@ -274,12 +274,10 @@ CLASS zcl_abapgit_gui_page_sett_locl IMPLEMENTATION.
iv_label = 'Only Serialize Main Language'
iv_hint = 'Ignore translations; serialize only main language of repository' ).
IF zcl_abapgit_feature=>is_enabled( 'FLOW' ) = abap_true
AND li_package->are_changes_recorded_in_tr_req( ) = abap_true.
ro_form->checkbox(
iv_name = c_id-flow
iv_label = 'Enable Flow Page' ).
ENDIF.
ro_form->checkbox(
iv_name = c_id-flow
iv_readonly = boolc( li_package->are_changes_recorded_in_tr_req( ) = abap_false )
iv_label = 'BETA: Enable abapGit flow for this repository (requires transported packages)' ).
ro_form->start_group(
iv_name = c_id-checks