From 808ee203ca870ef9b39fc9ac6663c27dd843457a Mon Sep 17 00:00:00 2001 From: sbcgua Date: Wed, 1 Feb 2017 23:14:12 +0200 Subject: [PATCH 1/3] Better error log styles --- src/zabapgit_css_common.w3mi.data.css | 15 +++++++++++++++ src/zabapgit_css_common.w3mi.xml | 4 ++-- src/zabapgit_util.prog.abap | 12 +++++------- src/zabapgit_view_repo.prog.abap | 2 +- 4 files changed, 23 insertions(+), 10 deletions(-) diff --git a/src/zabapgit_css_common.w3mi.data.css b/src/zabapgit_css_common.w3mi.data.css index 5a8ee5538..2528aa62f 100644 --- a/src/zabapgit_css_common.w3mi.data.css +++ b/src/zabapgit_css_common.w3mi.data.css @@ -37,6 +37,8 @@ form input:focus, textarea:focus { .grey { color: lightgrey !important; } .darkgrey { color: #808080 !important; } .attention { color: red !important; } +.error { color: #d41919 !important; } +.warning { color: #e4ae0d !important; } .blue { color: #5e8dc9 !important; } .red { color: red !important; } @@ -105,6 +107,19 @@ span.page_title { padding-left: 0.4em; } +/* ERROR LOG */ + +div.log { + padding: 6px; + margin: 4px; + background-color: #fee6e6; + border: 1px #fdcece solid; + border-radius: 4px; +} + +div.log > span { display:block; } +div.log .octicon { padding-right: 6px; } + /* MENU */ div.menu { display: inline; } div.menu .menu_end { border-right: 0px !important; } diff --git a/src/zabapgit_css_common.w3mi.xml b/src/zabapgit_css_common.w3mi.xml index 7f7372fc2..cbea95037 100644 --- a/src/zabapgit_css_common.w3mi.xml +++ b/src/zabapgit_css_common.w3mi.xml @@ -3,7 +3,7 @@ ZABAPGIT_CSS_COMMON - + Abapgit common CSS MI @@ -15,7 +15,7 @@ MI ZABAPGIT_CSS_COMMON filename - ~wwwtmp.css + common.css MI diff --git a/src/zabapgit_util.prog.abap b/src/zabapgit_util.prog.abap index 9c9ca66dd..80c1461a7 100644 --- a/src/zabapgit_util.prog.abap +++ b/src/zabapgit_util.prog.abap @@ -1069,16 +1069,14 @@ CLASS lcl_log IMPLEMENTATION. RETURN. ENDIF. - ro_html->add( '
' ). LOOP AT mt_log ASSIGNING . - CONCATENATE -msgv1 - -msgv2 - -msgv3 - -msgv4 INTO lv_string SEPARATED BY space. + CONCATENATE -msgv1 -msgv2 -msgv3 -msgv4 + INTO lv_string SEPARATED BY space. + ro_html->add( '' ). + ro_html->add_icon( iv_name = 'alert' iv_class = 'error' ). " warning CSS exists too ro_html->add( lv_string ). - ro_html->add( '
' ). + ro_html->add( '
' ). ENDLOOP. - ro_html->add( '
' ). ENDMETHOD. diff --git a/src/zabapgit_view_repo.prog.abap b/src/zabapgit_view_repo.prog.abap index dbfa5bd5f..05f2ec8c0 100644 --- a/src/zabapgit_view_repo.prog.abap +++ b/src/zabapgit_view_repo.prog.abap @@ -140,7 +140,7 @@ CLASS lcl_gui_view_repo_content IMPLEMENTATION. lo_log = lo_browser->get_log( ). IF mo_repo->is_offline( ) = abap_false AND lo_log->count( ) > 0. - ro_html->add( '
' ). + ro_html->add( '
' ). ro_html->add( lo_log->to_html( ) ). " shows eg. list of unsupported objects ro_html->add( '
' ). ENDIF. From 05e6086ea4dedfc0650662fd84fdde29567b3284 Mon Sep 17 00:00:00 2001 From: sbcgua Date: Fri, 3 Feb 2017 18:03:37 +0200 Subject: [PATCH 2/3] #514 remove/ignore files command --- src/zabapgit_definitions.prog.abap | 2 ++ src/zabapgit_gui_router.prog.abap | 11 ++++++++--- src/zabapgit_page_stage.prog.abap | 12 ++++++++++-- src/zabapgit_stage_logic.prog.abap | 21 ++++++++++++++++----- src/zabapgit_view_repo.prog.abap | 4 ++++ 5 files changed, 40 insertions(+), 10 deletions(-) diff --git a/src/zabapgit_definitions.prog.abap b/src/zabapgit_definitions.prog.abap index e8612e1b6..7946170e1 100644 --- a/src/zabapgit_definitions.prog.abap +++ b/src/zabapgit_definitions.prog.abap @@ -227,6 +227,8 @@ CONSTANTS: BEGIN OF gc_action, go_debuginfo TYPE string VALUE 'go_debuginfo', go_settings TYPE string VALUE 'go_settings', go_tutorial TYPE string VALUE 'go_tutorial', + go_manage_files TYPE string VALUE 'go_manage_files', + jump TYPE string VALUE 'jump', jump_pkg TYPE string VALUE 'jump_pkg', END OF gc_action. \ No newline at end of file diff --git a/src/zabapgit_gui_router.prog.abap b/src/zabapgit_gui_router.prog.abap index 3c259c095..bd03347aa 100644 --- a/src/zabapgit_gui_router.prog.abap +++ b/src/zabapgit_gui_router.prog.abap @@ -35,8 +35,9 @@ CLASS lcl_gui_router DEFINITION FINAL. RAISING lcx_exception. METHODS get_page_stage - IMPORTING iv_key TYPE lcl_persistence_repo=>ty_repo-key - RETURNING VALUE(ri_page) TYPE REF TO lif_gui_page + IMPORTING iv_key TYPE lcl_persistence_repo=>ty_repo-key + iv_manage_files TYPE abap_bool DEFAULT abap_false + RETURNING VALUE(ri_page) TYPE REF TO lif_gui_page RAISING lcx_exception. METHODS get_page_db_by_name @@ -90,6 +91,9 @@ CLASS lcl_gui_router IMPLEMENTATION. WHEN gc_action-go_stage. " Go Staging page ei_page = get_page_stage( lv_key ). ev_state = gc_event_state-new_page_w_bookmark. + WHEN gc_action-go_manage_files. " Go files management + ei_page = get_page_stage( iv_key = lv_key iv_manage_files = abap_true ). + ev_state = gc_event_state-new_page_w_bookmark. WHEN gc_action-go_branch_overview. " Go repo branch overview ei_page = get_page_branch_overview( iv_getdata ). ev_state = gc_event_state-new_page. @@ -310,7 +314,8 @@ CLASS lcl_gui_router IMPLEMENTATION. CREATE OBJECT lo_stage_page EXPORTING - io_repo = lo_repo. + io_repo = lo_repo + iv_manage_files = iv_manage_files. ri_page = lo_stage_page. diff --git a/src/zabapgit_page_stage.prog.abap b/src/zabapgit_page_stage.prog.abap index 7af9552fd..6f80ad850 100644 --- a/src/zabapgit_page_stage.prog.abap +++ b/src/zabapgit_page_stage.prog.abap @@ -12,7 +12,9 @@ CLASS lcl_gui_page_stage DEFINITION FINAL INHERITING FROM lcl_gui_page. METHODS: constructor - IMPORTING io_repo TYPE REF TO lcl_repo_online + IMPORTING + io_repo TYPE REF TO lcl_repo_online + iv_manage_files TYPE abap_bool DEFAULT abap_false RAISING lcx_exception, lif_gui_page~on_event REDEFINITION. @@ -51,7 +53,13 @@ CLASS lcl_gui_page_stage IMPLEMENTATION. ms_control-page_title = 'STAGE'. mo_repo = io_repo. - ms_files = lcl_stage_logic=>get( mo_repo ). + IF iv_manage_files = abap_true. + ms_files = lcl_stage_logic=>get( + io_repo = mo_repo + iv_remote_only = abap_true ). + ELSE. + ms_files = lcl_stage_logic=>get( mo_repo ). + ENDIF. CREATE OBJECT mo_stage EXPORTING diff --git a/src/zabapgit_stage_logic.prog.abap b/src/zabapgit_stage_logic.prog.abap index 2857381aa..305e2536a 100644 --- a/src/zabapgit_stage_logic.prog.abap +++ b/src/zabapgit_stage_logic.prog.abap @@ -10,6 +10,7 @@ CLASS lcl_stage_logic DEFINITION FINAL. CLASS-METHODS: get IMPORTING io_repo TYPE REF TO lcl_repo_online + iv_remote_only TYPE abap_bool DEFAULT abap_false RETURNING VALUE(rs_files) TYPE ty_stage_files RAISING lcx_exception, count @@ -30,11 +31,17 @@ ENDCLASS. CLASS lcl_stage_logic IMPLEMENTATION. METHOD get. - rs_files-local = io_repo->get_files_local( ). + rs_files-remote = io_repo->get_files_remote( ). - remove_identical( CHANGING cs_files = rs_files ). - remove_ignored( EXPORTING io_repo = io_repo - CHANGING cs_files = rs_files ). + + IF iv_remote_only = abap_false. + rs_files-local = io_repo->get_files_local( ). + remove_identical( CHANGING cs_files = rs_files ). + ENDIF. + + remove_ignored( EXPORTING io_repo = io_repo + CHANGING cs_files = rs_files ). + ENDMETHOD. METHOD count. @@ -58,10 +65,14 @@ CLASS lcl_stage_logic IMPLEMENTATION. lv_index = sy-tabix. IF io_repo->get_dot_abapgit( )->is_ignored( - iv_path = -path + iv_path = -path iv_filename = -filename ) = abap_true. DELETE cs_files-remote INDEX lv_index. + ELSEIF -path = gc_root_dir AND -filename = gc_dot_abapgit. + " Remove .abapgit from remotes - it cannot be removed or ignored + DELETE cs_files-remote INDEX lv_index. ENDIF. + ENDLOOP. ENDMETHOD. diff --git a/src/zabapgit_view_repo.prog.abap b/src/zabapgit_view_repo.prog.abap index 05f2ec8c0..3aff5e3a8 100644 --- a/src/zabapgit_view_repo.prog.abap +++ b/src/zabapgit_view_repo.prog.abap @@ -259,6 +259,10 @@ CLASS lcl_gui_view_repo_content IMPLEMENTATION. iv_act = |{ gc_action-repo_remote_change }?{ lv_key }| ). lo_tb_advanced->add( iv_txt = 'Make off-line' iv_act = |{ gc_action-repo_remote_detach }?{ lv_key }| ). + IF iv_rstate IS INITIAL AND iv_lstate IS INITIAL. + lo_tb_advanced->add( iv_txt = 'Remove/Ignore files' + iv_act = |{ gc_action-go_manage_files }?{ lv_key }| ). + ENDIF. ELSE. lo_tb_advanced->add( iv_txt = 'Make on-line' iv_act = |{ gc_action-repo_remote_attach }?{ lv_key }| ). From 1bdaac812f2974bae930f277500d40123c4a13ac Mon Sep 17 00:00:00 2001 From: sbcgua Date: Sun, 5 Feb 2017 17:00:06 +0200 Subject: [PATCH 3/3] rollback 'remove/ignore' logic to Force stage --- src/zabapgit_definitions.prog.abap | 1 - src/zabapgit_gui_router.prog.abap | 7 +------ src/zabapgit_page_stage.prog.abap | 9 +-------- src/zabapgit_stage_logic.prog.abap | 9 ++------- src/zabapgit_view_repo.prog.abap | 4 ++-- 5 files changed, 6 insertions(+), 24 deletions(-) diff --git a/src/zabapgit_definitions.prog.abap b/src/zabapgit_definitions.prog.abap index 7946170e1..b9aad9d04 100644 --- a/src/zabapgit_definitions.prog.abap +++ b/src/zabapgit_definitions.prog.abap @@ -227,7 +227,6 @@ CONSTANTS: BEGIN OF gc_action, go_debuginfo TYPE string VALUE 'go_debuginfo', go_settings TYPE string VALUE 'go_settings', go_tutorial TYPE string VALUE 'go_tutorial', - go_manage_files TYPE string VALUE 'go_manage_files', jump TYPE string VALUE 'jump', jump_pkg TYPE string VALUE 'jump_pkg', diff --git a/src/zabapgit_gui_router.prog.abap b/src/zabapgit_gui_router.prog.abap index bd03347aa..7b76f5410 100644 --- a/src/zabapgit_gui_router.prog.abap +++ b/src/zabapgit_gui_router.prog.abap @@ -36,7 +36,6 @@ CLASS lcl_gui_router DEFINITION FINAL. METHODS get_page_stage IMPORTING iv_key TYPE lcl_persistence_repo=>ty_repo-key - iv_manage_files TYPE abap_bool DEFAULT abap_false RETURNING VALUE(ri_page) TYPE REF TO lif_gui_page RAISING lcx_exception. @@ -91,9 +90,6 @@ CLASS lcl_gui_router IMPLEMENTATION. WHEN gc_action-go_stage. " Go Staging page ei_page = get_page_stage( lv_key ). ev_state = gc_event_state-new_page_w_bookmark. - WHEN gc_action-go_manage_files. " Go files management - ei_page = get_page_stage( iv_key = lv_key iv_manage_files = abap_true ). - ev_state = gc_event_state-new_page_w_bookmark. WHEN gc_action-go_branch_overview. " Go repo branch overview ei_page = get_page_branch_overview( iv_getdata ). ev_state = gc_event_state-new_page. @@ -314,8 +310,7 @@ CLASS lcl_gui_router IMPLEMENTATION. CREATE OBJECT lo_stage_page EXPORTING - io_repo = lo_repo - iv_manage_files = iv_manage_files. + io_repo = lo_repo. ri_page = lo_stage_page. diff --git a/src/zabapgit_page_stage.prog.abap b/src/zabapgit_page_stage.prog.abap index 6f80ad850..c2cb8ff19 100644 --- a/src/zabapgit_page_stage.prog.abap +++ b/src/zabapgit_page_stage.prog.abap @@ -14,7 +14,6 @@ CLASS lcl_gui_page_stage DEFINITION FINAL INHERITING FROM lcl_gui_page. constructor IMPORTING io_repo TYPE REF TO lcl_repo_online - iv_manage_files TYPE abap_bool DEFAULT abap_false RAISING lcx_exception, lif_gui_page~on_event REDEFINITION. @@ -53,13 +52,7 @@ CLASS lcl_gui_page_stage IMPLEMENTATION. ms_control-page_title = 'STAGE'. mo_repo = io_repo. - IF iv_manage_files = abap_true. - ms_files = lcl_stage_logic=>get( - io_repo = mo_repo - iv_remote_only = abap_true ). - ELSE. - ms_files = lcl_stage_logic=>get( mo_repo ). - ENDIF. + ms_files = lcl_stage_logic=>get( mo_repo ). CREATE OBJECT mo_stage EXPORTING diff --git a/src/zabapgit_stage_logic.prog.abap b/src/zabapgit_stage_logic.prog.abap index 305e2536a..44a3bec0f 100644 --- a/src/zabapgit_stage_logic.prog.abap +++ b/src/zabapgit_stage_logic.prog.abap @@ -10,7 +10,6 @@ CLASS lcl_stage_logic DEFINITION FINAL. CLASS-METHODS: get IMPORTING io_repo TYPE REF TO lcl_repo_online - iv_remote_only TYPE abap_bool DEFAULT abap_false RETURNING VALUE(rs_files) TYPE ty_stage_files RAISING lcx_exception, count @@ -32,13 +31,9 @@ CLASS lcl_stage_logic IMPLEMENTATION. METHOD get. + rs_files-local = io_repo->get_files_local( ). rs_files-remote = io_repo->get_files_remote( ). - - IF iv_remote_only = abap_false. - rs_files-local = io_repo->get_files_local( ). - remove_identical( CHANGING cs_files = rs_files ). - ENDIF. - + remove_identical( CHANGING cs_files = rs_files ). remove_ignored( EXPORTING io_repo = io_repo CHANGING cs_files = rs_files ). diff --git a/src/zabapgit_view_repo.prog.abap b/src/zabapgit_view_repo.prog.abap index 3aff5e3a8..aeaffd8d8 100644 --- a/src/zabapgit_view_repo.prog.abap +++ b/src/zabapgit_view_repo.prog.abap @@ -260,8 +260,8 @@ CLASS lcl_gui_view_repo_content IMPLEMENTATION. lo_tb_advanced->add( iv_txt = 'Make off-line' iv_act = |{ gc_action-repo_remote_detach }?{ lv_key }| ). IF iv_rstate IS INITIAL AND iv_lstate IS INITIAL. - lo_tb_advanced->add( iv_txt = 'Remove/Ignore files' - iv_act = |{ gc_action-go_manage_files }?{ lv_key }| ). + lo_tb_advanced->add( iv_txt = 'Force stage' + iv_act = |{ gc_action-go_stage }?{ lv_key }| ). ENDIF. ELSE. lo_tb_advanced->add( iv_txt = 'Make on-line'