From 2645e2208b830c188a54235737aa6cb23beff43d Mon Sep 17 00:00:00 2001 From: Marc Bernard <59966492+mbtools@users.noreply.github.com> Date: Thu, 21 Sep 2023 11:32:22 -0400 Subject: [PATCH] Fine-tune popups to confirm uninstall (#6504) Co-authored-by: Lars Hvam --- .../routing/zcl_abapgit_services_repo.clas.abap | 16 +++++++++++++--- src/ui/zcl_abapgit_popups.clas.abap | 1 + src/ui/zif_abapgit_popups.intf.abap | 1 + 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/ui/routing/zcl_abapgit_services_repo.clas.abap b/src/ui/routing/zcl_abapgit_services_repo.clas.abap index 39e5b66b4..08d3ff8fa 100644 --- a/src/ui/routing/zcl_abapgit_services_repo.clas.abap +++ b/src/ui/routing/zcl_abapgit_services_repo.clas.abap @@ -616,7 +616,8 @@ CLASS zcl_abapgit_services_repo IMPLEMENTATION. lv_answer TYPE c LENGTH 1, lo_repo TYPE REF TO zcl_abapgit_repo, lv_package TYPE devclass, - lv_question TYPE c LENGTH 100, + lv_title TYPE c LENGTH 20, + lv_question TYPE c LENGTH 150, ls_checks TYPE zif_abapgit_definitions=>ty_delete_checks, lv_repo_name TYPE string, lv_message TYPE string. @@ -633,14 +634,23 @@ CLASS zcl_abapgit_services_repo IMPLEMENTATION. lv_question = |This will DELETE all objects in package { lv_package } including subpackages ({ lines( lt_tadir ) } objects) from the system|. + IF iv_keep_repo = abap_true. + lv_title = 'Remove Objects'. + lv_question = lv_question && ', but keep the reference to the repository'. + ELSE. + lv_title = 'Uninstall'. + lv_question = lv_question && ' and remove the reference to the repository'. + ENDIF. + lv_answer = zcl_abapgit_ui_factory=>get_popups( )->popup_to_confirm( - iv_titlebar = 'Uninstall' + iv_titlebar = lv_title iv_text_question = lv_question iv_text_button_1 = 'Delete' iv_icon_button_1 = 'ICON_DELETE' iv_text_button_2 = 'Cancel' iv_icon_button_2 = 'ICON_CANCEL' iv_default_button = '2' + iv_popup_type = 'ICON_MESSAGE_WARNING' iv_display_cancel_button = abap_false ). IF lv_answer = '2'. @@ -755,7 +765,7 @@ CLASS zcl_abapgit_services_repo IMPLEMENTATION. }. All objects will safely remain in the system.|. lv_answer = zcl_abapgit_ui_factory=>get_popups( )->popup_to_confirm( - iv_titlebar = 'Remove' + iv_titlebar = 'Remove Repository' iv_text_question = lv_question iv_text_button_1 = 'Remove' iv_icon_button_1 = 'ICON_WF_UNLINK' diff --git a/src/ui/zcl_abapgit_popups.clas.abap b/src/ui/zcl_abapgit_popups.clas.abap index c5c6fbf98..6d706955a 100644 --- a/src/ui/zcl_abapgit_popups.clas.abap +++ b/src/ui/zcl_abapgit_popups.clas.abap @@ -591,6 +591,7 @@ CLASS zcl_abapgit_popups IMPLEMENTATION. icon_button_2 = iv_icon_button_2 default_button = iv_default_button display_cancel_button = iv_display_cancel_button + popup_type = iv_popup_type start_column = ms_position-start_column start_row = ms_position-start_row IMPORTING diff --git a/src/ui/zif_abapgit_popups.intf.abap b/src/ui/zif_abapgit_popups.intf.abap index c8c8b3fa6..1517faccb 100644 --- a/src/ui/zif_abapgit_popups.intf.abap +++ b/src/ui/zif_abapgit_popups.intf.abap @@ -84,6 +84,7 @@ INTERFACE zif_abapgit_popups !iv_icon_button_2 TYPE ty_icon DEFAULT space !iv_default_button TYPE ty_char1 DEFAULT '1' !iv_display_cancel_button TYPE ty_char1 DEFAULT abap_true + !iv_popup_type TYPE clike DEFAULT 'ICON_MESSAGE_QUESTION' RETURNING VALUE(rv_answer) TYPE ty_char1 RAISING