mirror of
https://github.com/abapGit/abapGit.git
synced 2025-04-30 11:46:38 +08:00
SCI result at stage and commit pages (#5002)
* sci result at stage and commit pages * improvements Co-authored-by: Lars Hvam <larshp@hotmail.com> Co-authored-by: Christian Günter <christianguenter@googlemail.com>
This commit is contained in:
parent
423cdd1009
commit
372a2ab7ae
|
@ -86,6 +86,32 @@ span.separator {
|
|||
margin-right: auto;
|
||||
}
|
||||
|
||||
span.boxed {
|
||||
border-radius: 3px;
|
||||
padding: 4px 7px;
|
||||
margin-left: 0.2em;
|
||||
margin-right: 0.2em;
|
||||
font-size: smaller;
|
||||
}
|
||||
span.boxed i.icon {
|
||||
padding-right: 5px;
|
||||
}
|
||||
.red-filled-set {
|
||||
border-width: 0px;
|
||||
color: hsl(0, 78%, 93%);
|
||||
background-color: hsl(0, 78%, 65%);
|
||||
}
|
||||
.green-filled-set {
|
||||
border-width: 0px;
|
||||
color: hsl(120, 45%, 90%);
|
||||
background-color: hsl(120, 27%, 60%);
|
||||
}
|
||||
.yellow-filled-set {
|
||||
border-width: 0px;
|
||||
color: hsl(45, 99%, 90%);
|
||||
background-color: hsl(45, 100%, 46%);
|
||||
}
|
||||
|
||||
/* PANELS */
|
||||
div.panel {
|
||||
border-radius: 3px;
|
||||
|
|
Binary file not shown.
|
@ -35,37 +35,38 @@
|
|||
.icon-bolt:before { content: "\f105"; }
|
||||
.icon-box:before { content: "\f106"; }
|
||||
.icon-briefcase:before { content: "\f107"; }
|
||||
.icon-check:before { content: "\f108"; }
|
||||
.icon-chevron-down:before { content: "\f109"; }
|
||||
.icon-chevron-left:before { content: "\f10a"; }
|
||||
.icon-chevron-right:before { content: "\f10b"; }
|
||||
.icon-chevron-up:before { content: "\f10c"; }
|
||||
.icon-circle-solid:before { content: "\f10d"; }
|
||||
.icon-cloud-commit:before { content: "\f10e"; }
|
||||
.icon-cloud-solid:before { content: "\f10f"; }
|
||||
.icon-cloud-upload-alt:before { content: "\f110"; }
|
||||
.icon-code-branch:before { content: "\f111"; }
|
||||
.icon-code-commit:before { content: "\f112"; }
|
||||
.icon-cog:before { content: "\f113"; }
|
||||
.icon-edit-solid:before { content: "\f114"; }
|
||||
.icon-exclamation-circle:before { content: "\f115"; }
|
||||
.icon-exclamation-triangle:before { content: "\f116"; }
|
||||
.icon-file-alt:before { content: "\f117"; }
|
||||
.icon-file-code:before { content: "\f118"; }
|
||||
.icon-file-image:before { content: "\f119"; }
|
||||
.icon-file:before { content: "\f11a"; }
|
||||
.icon-fire-alt:before { content: "\f11b"; }
|
||||
.icon-folder:before { content: "\f11c"; }
|
||||
.icon-git-alt:before { content: "\f11d"; }
|
||||
.icon-info-circle-solid:before { content: "\f11e"; }
|
||||
.icon-lock:before { content: "\f11f"; }
|
||||
.icon-plug:before { content: "\f120"; }
|
||||
.icon-question-circle-solid:before { content: "\f121"; }
|
||||
.icon-server-solid:before { content: "\f122"; }
|
||||
.icon-sliders-h:before { content: "\f123"; }
|
||||
.icon-snowflake:before { content: "\f124"; }
|
||||
.icon-star:before { content: "\f125"; }
|
||||
.icon-times-solid:before { content: "\f126"; }
|
||||
.icon-tools-solid:before { content: "\f127"; }
|
||||
.icon-truck-solid:before { content: "\f128"; }
|
||||
.icon-user-solid:before { content: "\f129"; }
|
||||
.icon-bug-solid:before { content: "\f108"; }
|
||||
.icon-check:before { content: "\f109"; }
|
||||
.icon-chevron-down:before { content: "\f10a"; }
|
||||
.icon-chevron-left:before { content: "\f10b"; }
|
||||
.icon-chevron-right:before { content: "\f10c"; }
|
||||
.icon-chevron-up:before { content: "\f10d"; }
|
||||
.icon-circle-solid:before { content: "\f10e"; }
|
||||
.icon-cloud-commit:before { content: "\f10f"; }
|
||||
.icon-cloud-solid:before { content: "\f110"; }
|
||||
.icon-cloud-upload-alt:before { content: "\f111"; }
|
||||
.icon-code-branch:before { content: "\f112"; }
|
||||
.icon-code-commit:before { content: "\f113"; }
|
||||
.icon-cog:before { content: "\f114"; }
|
||||
.icon-edit-solid:before { content: "\f115"; }
|
||||
.icon-exclamation-circle:before { content: "\f116"; }
|
||||
.icon-exclamation-triangle:before { content: "\f117"; }
|
||||
.icon-file-alt:before { content: "\f118"; }
|
||||
.icon-file-code:before { content: "\f119"; }
|
||||
.icon-file-image:before { content: "\f11a"; }
|
||||
.icon-file:before { content: "\f11b"; }
|
||||
.icon-fire-alt:before { content: "\f11c"; }
|
||||
.icon-folder:before { content: "\f11d"; }
|
||||
.icon-git-alt:before { content: "\f11e"; }
|
||||
.icon-info-circle-solid:before { content: "\f11f"; }
|
||||
.icon-lock:before { content: "\f120"; }
|
||||
.icon-plug:before { content: "\f121"; }
|
||||
.icon-question-circle-solid:before { content: "\f122"; }
|
||||
.icon-server-solid:before { content: "\f123"; }
|
||||
.icon-sliders-h:before { content: "\f124"; }
|
||||
.icon-snowflake:before { content: "\f125"; }
|
||||
.icon-star:before { content: "\f126"; }
|
||||
.icon-times-solid:before { content: "\f127"; }
|
||||
.icon-tools-solid:before { content: "\f128"; }
|
||||
.icon-truck-solid:before { content: "\f129"; }
|
||||
.icon-user-solid:before { content: "\f12a"; }
|
||||
|
|
|
@ -158,6 +158,12 @@ CLASS zcl_abapgit_gui_chunk_lib DEFINITION
|
|||
VALUE(ri_html) TYPE REF TO zif_abapgit_html
|
||||
RAISING
|
||||
zcx_abapgit_exception .
|
||||
CLASS-METHODS render_sci_result
|
||||
IMPORTING
|
||||
ii_html TYPE REF TO zif_abapgit_html
|
||||
iv_sci_result TYPE zif_abapgit_definitions=>ty_sci_result.
|
||||
|
||||
|
||||
PROTECTED SECTION.
|
||||
|
||||
CLASS-METHODS render_repo_top_commit_hash
|
||||
|
@ -185,7 +191,7 @@ ENDCLASS.
|
|||
|
||||
|
||||
|
||||
CLASS zcl_abapgit_gui_chunk_lib IMPLEMENTATION.
|
||||
CLASS ZCL_ABAPGIT_GUI_CHUNK_LIB IMPLEMENTATION.
|
||||
|
||||
|
||||
METHOD advanced_submenu.
|
||||
|
@ -931,6 +937,28 @@ CLASS zcl_abapgit_gui_chunk_lib IMPLEMENTATION.
|
|||
ENDMETHOD.
|
||||
|
||||
|
||||
METHOD render_sci_result.
|
||||
|
||||
DATA lv_icon TYPE string.
|
||||
|
||||
lv_icon = ii_html->icon(
|
||||
iv_name = 'bug-solid'
|
||||
iv_hint = 'Code inspector result' ).
|
||||
|
||||
CASE iv_sci_result.
|
||||
WHEN zif_abapgit_definitions=>c_sci_result-passed.
|
||||
ii_html->add( |<span class="boxed green-filled-set">{ lv_icon }PASSED</span>| ).
|
||||
WHEN zif_abapgit_definitions=>c_sci_result-failed.
|
||||
ii_html->add( |<span class="boxed red-filled-set">{ lv_icon }FAILED</span>| ).
|
||||
WHEN zif_abapgit_definitions=>c_sci_result-warning.
|
||||
ii_html->add( |<span class="boxed yellow-filled-set">{ lv_icon }WARN</span>| ).
|
||||
WHEN OTHERS. " Including NO_RUN
|
||||
RETURN.
|
||||
ENDCASE.
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
|
||||
METHOD render_transport.
|
||||
|
||||
DATA:
|
||||
|
|
|
@ -12,6 +12,10 @@ CLASS zcl_abapgit_gui_page_code_insp DEFINITION PUBLIC FINAL CREATE PUBLIC
|
|||
RAISING
|
||||
zcx_abapgit_exception,
|
||||
|
||||
is_nothing_to_display
|
||||
RETURNING
|
||||
VALUE(rv_yes) TYPE abap_bool,
|
||||
|
||||
zif_abapgit_gui_event_handler~on_event
|
||||
REDEFINITION,
|
||||
|
||||
|
@ -60,7 +64,7 @@ ENDCLASS.
|
|||
|
||||
|
||||
|
||||
CLASS zcl_abapgit_gui_page_code_insp IMPLEMENTATION.
|
||||
CLASS ZCL_ABAPGIT_GUI_PAGE_CODE_INSP IMPLEMENTATION.
|
||||
|
||||
|
||||
METHOD ask_user_for_check_variant.
|
||||
|
@ -163,6 +167,11 @@ CLASS zcl_abapgit_gui_page_code_insp IMPLEMENTATION.
|
|||
ENDMETHOD.
|
||||
|
||||
|
||||
METHOD is_nothing_to_display.
|
||||
rv_yes = boolc( lines( mt_result ) = 0 ).
|
||||
ENDMETHOD.
|
||||
|
||||
|
||||
METHOD is_stage_allowed.
|
||||
|
||||
rv_is_stage_allowed = boolc( NOT ( mo_repo->get_local_settings( )-block_commit = abap_true
|
||||
|
@ -220,7 +229,8 @@ CLASS zcl_abapgit_gui_page_code_insp IMPLEMENTATION.
|
|||
|
||||
METHOD zif_abapgit_gui_event_handler~on_event.
|
||||
|
||||
DATA: lo_repo_online TYPE REF TO zcl_abapgit_repo_online.
|
||||
DATA lo_repo_online TYPE REF TO zcl_abapgit_repo_online.
|
||||
DATA lv_sci_result TYPE zif_abapgit_definitions=>ty_sci_result.
|
||||
|
||||
CASE ii_event->mv_action.
|
||||
WHEN c_actions-stage.
|
||||
|
@ -231,9 +241,22 @@ CLASS zcl_abapgit_gui_page_code_insp IMPLEMENTATION.
|
|||
" we need to refresh as the source might have changed
|
||||
lo_repo_online->refresh( ).
|
||||
|
||||
READ TABLE mt_result TRANSPORTING NO FIELDS WITH KEY kind = 'E'.
|
||||
IF sy-subrc = 0.
|
||||
lv_sci_result = zif_abapgit_definitions=>c_sci_result-failed.
|
||||
ELSE.
|
||||
READ TABLE mt_result TRANSPORTING NO FIELDS WITH KEY kind = 'W'.
|
||||
IF sy-subrc = 0.
|
||||
lv_sci_result = zif_abapgit_definitions=>c_sci_result-warning.
|
||||
ELSE.
|
||||
lv_sci_result = zif_abapgit_definitions=>c_sci_result-passed.
|
||||
ENDIF.
|
||||
ENDIF.
|
||||
|
||||
CREATE OBJECT rs_handled-page TYPE zcl_abapgit_gui_page_stage
|
||||
EXPORTING
|
||||
io_repo = lo_repo_online.
|
||||
io_repo = lo_repo_online
|
||||
iv_sci_result = lv_sci_result.
|
||||
rs_handled-state = zcl_abapgit_gui=>c_event_state-new_page.
|
||||
|
||||
ELSE.
|
||||
|
|
|
@ -16,6 +16,7 @@ CLASS zcl_abapgit_gui_page_commit DEFINITION
|
|||
IMPORTING
|
||||
io_repo TYPE REF TO zcl_abapgit_repo_online
|
||||
io_stage TYPE REF TO zcl_abapgit_stage
|
||||
iv_sci_result TYPE zif_abapgit_definitions=>ty_sci_result DEFAULT zif_abapgit_definitions=>c_sci_result-no_run
|
||||
RAISING
|
||||
zcx_abapgit_exception.
|
||||
|
||||
|
@ -38,6 +39,7 @@ CLASS zcl_abapgit_gui_page_commit DEFINITION
|
|||
DATA mo_repo TYPE REF TO zcl_abapgit_repo_online .
|
||||
DATA mo_stage TYPE REF TO zcl_abapgit_stage .
|
||||
DATA ms_commit TYPE zif_abapgit_services_git=>ty_commit_fields .
|
||||
DATA mv_sci_result TYPE zif_abapgit_definitions=>ty_sci_result.
|
||||
|
||||
METHODS render_menu
|
||||
RETURNING
|
||||
|
@ -91,6 +93,7 @@ CLASS ZCL_ABAPGIT_GUI_PAGE_COMMIT IMPLEMENTATION.
|
|||
|
||||
mo_repo = io_repo.
|
||||
mo_stage = io_stage.
|
||||
mv_sci_result = iv_sci_result.
|
||||
|
||||
ms_control-page_title = 'Commit'.
|
||||
ENDMETHOD.
|
||||
|
@ -337,6 +340,15 @@ CLASS ZCL_ABAPGIT_GUI_PAGE_COMMIT IMPLEMENTATION.
|
|||
iv_opt = zif_abapgit_html=>c_html_opt-cancel ).
|
||||
|
||||
ri_html->add( '<div class="paddings">' ).
|
||||
|
||||
IF mv_sci_result <> zif_abapgit_definitions=>c_sci_result-no_run.
|
||||
ri_html->add( '<span class="float-right">' ).
|
||||
zcl_abapgit_gui_chunk_lib=>render_sci_result(
|
||||
ii_html = ri_html
|
||||
iv_sci_result = mv_sci_result ).
|
||||
ri_html->add( '</span>' ).
|
||||
ENDIF.
|
||||
|
||||
ri_html->add( lo_toolbar->render( ) ).
|
||||
ri_html->add( '</div>' ).
|
||||
|
||||
|
|
|
@ -13,13 +13,15 @@ CLASS zcl_abapgit_gui_page_stage DEFINITION
|
|||
stage_filter TYPE string VALUE 'stage_filter',
|
||||
END OF c_action.
|
||||
|
||||
METHODS:
|
||||
constructor
|
||||
METHODS constructor
|
||||
IMPORTING
|
||||
io_repo TYPE REF TO zcl_abapgit_repo_online
|
||||
iv_seed TYPE string OPTIONAL
|
||||
RAISING zcx_abapgit_exception,
|
||||
zif_abapgit_gui_event_handler~on_event REDEFINITION.
|
||||
iv_sci_result TYPE zif_abapgit_definitions=>ty_sci_result DEFAULT zif_abapgit_definitions=>c_sci_result-no_run
|
||||
RAISING
|
||||
zcx_abapgit_exception.
|
||||
|
||||
METHODS zif_abapgit_gui_event_handler~on_event REDEFINITION.
|
||||
|
||||
PROTECTED SECTION.
|
||||
METHODS:
|
||||
|
@ -39,6 +41,7 @@ CLASS zcl_abapgit_gui_page_stage DEFINITION
|
|||
DATA ms_files TYPE zif_abapgit_definitions=>ty_stage_files .
|
||||
DATA mv_seed TYPE string . " Unique page id to bind JS sessionStorage
|
||||
DATA mv_filter_value TYPE string .
|
||||
DATA mv_sci_result TYPE zif_abapgit_definitions=>ty_sci_result.
|
||||
|
||||
METHODS check_selected
|
||||
IMPORTING
|
||||
|
@ -119,7 +122,7 @@ ENDCLASS.
|
|||
|
||||
|
||||
|
||||
CLASS zcl_abapgit_gui_page_stage IMPLEMENTATION.
|
||||
CLASS ZCL_ABAPGIT_GUI_PAGE_STAGE IMPLEMENTATION.
|
||||
|
||||
|
||||
METHOD build_menu.
|
||||
|
@ -193,6 +196,7 @@ CLASS zcl_abapgit_gui_page_stage IMPLEMENTATION.
|
|||
ms_control-page_title = 'Stage'.
|
||||
mo_repo = io_repo.
|
||||
mv_seed = iv_seed.
|
||||
mv_sci_result = iv_sci_result.
|
||||
|
||||
IF mv_seed IS INITIAL. " Generate based on time unless obtained from diff page
|
||||
GET TIME STAMP FIELD lv_ts.
|
||||
|
@ -403,6 +407,9 @@ CLASS zcl_abapgit_gui_page_stage IMPLEMENTATION.
|
|||
ri_html->add( '<input class="stage-filter" id="objectSearch"' &&
|
||||
' type="search" placeholder="Filter Objects"' &&
|
||||
| value="{ mv_filter_value }">| ).
|
||||
zcl_abapgit_gui_chunk_lib=>render_sci_result(
|
||||
ii_html = ri_html
|
||||
iv_sci_result = mv_sci_result ).
|
||||
ri_html->add( '</td>' ).
|
||||
|
||||
ri_html->add( '</tr>' ).
|
||||
|
@ -791,7 +798,8 @@ CLASS zcl_abapgit_gui_page_stage IMPLEMENTATION.
|
|||
CREATE OBJECT rs_handled-page TYPE zcl_abapgit_gui_page_commit
|
||||
EXPORTING
|
||||
io_repo = mo_repo
|
||||
io_stage = lo_stage.
|
||||
io_stage = lo_stage
|
||||
iv_sci_result = mv_sci_result.
|
||||
|
||||
rs_handled-state = zcl_abapgit_gui=>c_event_state-new_page.
|
||||
|
||||
|
@ -802,7 +810,8 @@ CLASS zcl_abapgit_gui_page_stage IMPLEMENTATION.
|
|||
CREATE OBJECT rs_handled-page TYPE zcl_abapgit_gui_page_commit
|
||||
EXPORTING
|
||||
io_repo = mo_repo
|
||||
io_stage = lo_stage.
|
||||
io_stage = lo_stage
|
||||
iv_sci_result = mv_sci_result.
|
||||
|
||||
rs_handled-state = zcl_abapgit_gui=>c_event_state-new_page.
|
||||
|
||||
|
|
|
@ -376,7 +376,19 @@ CLASS zcl_abapgit_gui_router IMPLEMENTATION.
|
|||
EXPORTING
|
||||
io_repo = lo_repo.
|
||||
|
||||
IF lo_code_inspector_page->is_nothing_to_display( ) = abap_true.
|
||||
" force refresh on stage, to make sure the latest local and remote files are used
|
||||
lo_repo->refresh( ).
|
||||
CREATE OBJECT lo_stage_page
|
||||
EXPORTING
|
||||
io_repo = lo_repo
|
||||
iv_seed = lv_seed
|
||||
iv_sci_result = zif_abapgit_definitions=>c_sci_result-passed.
|
||||
ri_page = lo_stage_page.
|
||||
ELSE.
|
||||
ri_page = lo_code_inspector_page.
|
||||
ENDIF.
|
||||
|
||||
ELSEIF lo_repo->get_selected_branch( ) CP zif_abapgit_definitions=>c_git_branch-tags.
|
||||
lv_show_create_branch_popup = abap_true.
|
||||
lv_question_title = 'Staging on a tag'.
|
||||
|
|
|
@ -358,6 +358,14 @@ INTERFACE zif_abapgit_definitions
|
|||
TYPES:
|
||||
ty_deserialization_step_tt TYPE STANDARD TABLE OF ty_deserialization_step
|
||||
WITH DEFAULT KEY .
|
||||
TYPES ty_sci_result TYPE c LENGTH 1.
|
||||
CONSTANTS:
|
||||
BEGIN OF c_sci_result,
|
||||
no_run TYPE ty_sci_result VALUE '',
|
||||
failed TYPE ty_sci_result VALUE 'F',
|
||||
warning TYPE ty_sci_result VALUE 'W',
|
||||
passed TYPE ty_sci_result VALUE 'P',
|
||||
END OF c_sci_result.
|
||||
CONSTANTS:
|
||||
BEGIN OF c_git_branch_type,
|
||||
branch TYPE ty_git_branch_type VALUE 'HD',
|
||||
|
|
Loading…
Reference in New Issue
Block a user