Bug 1021584

Summary: message in the 'remove' confirmation dialog cannot be overridden in some cases
Product: [Retired] oVirt Reporter: Einav Cohen <ecohen>
Component: ovirt-engine-webadminAssignee: Greg Sheremeta <gshereme>
Status: CLOSED CURRENTRELEASE QA Contact: Martin Pavlik <mpavlik>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 3.3CC: acathrow, ecohen, gklein, gshereme, iheim, mgoldboi, mpavlik, yeylon, ykaul
Target Milestone: ---Keywords: CodeChange
Target Release: 3.4.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: ux
Fixed In Version: ovirt-3.4.0-alpha1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-03-31 12:31:30 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Einav Cohen 2013-10-21 15:00:40 UTC
today, if you are using RemoveConfirmationPopupView and you want to override the default "Are you sure you want to remove the following items?" [constants.removeConfirmationPopupMessage message], you cannot do that if the dialog's HashName is starting with "remove_" [1].

need to change the code so that we will not depend on the HashName value at all:
   * set the constants.removeConfirmationPopupMessage message as the default message of this dialog (regardless of HashName).
   * message can always be overridden (again - regardless of HashName).

also need to go over the code and look for all cases in which 'setMessage' is called on a RemoveConfirmationPopupView instance that has its 'HashName' set to something that starts with "remove_".
currently, the above "setMessage" invocations are doing nothing. 
after the fix, they will actually change the message within the dialog - need to make sure that each one of these 'setMessage' invocations is OK (i.e. the message is set to something appropriate to the relevant dialog instance), or maybe the 'setMessage' invocation should be removed, in order to preserve the current behavior of using the default message.

[1] From RemoveConfirmationPopupView.java:

    public void setMessage(String message) {
        if (getHashName() != null && getHashName().startsWith("remove_")) { //$NON-NLS-1$
            super.setMessage(constants.removeConfirmationPopupMessage());
        } else {
            super.setMessage(message);
        }
    }

more info in thread that has been started by this e-mail:

http://lists.ovirt.org/pipermail/engine-devel/2013-October/005731.html

Comment 1 Sandro Bonazzola 2014-01-13 13:56:27 UTC
oVirt 3.4.0 alpha has been released including the fix for this issue.

Comment 2 Martin Pavlik 2014-02-18 15:30:35 UTC
Greg,

can you please advise how to test this?

Comment 3 Greg Sheremeta 2014-02-18 17:04:16 UTC
It's a refactor, so only need to test for regressions. No user feature here.

As long as remove dialogs still popup and contain a message, we're good.

Example: delete anything (host, vm, dc, etc.). If you get a popup that says "Are you sure you want to remove the following items?" then we are good.

Comment 4 Martin Pavlik 2014-02-19 07:27:03 UTC
works with ovirt-3.4.0-beta2

Comment 5 Sandro Bonazzola 2014-03-31 12:31:30 UTC
this is an automated message: moving to Closed CURRENT RELEASE since oVirt 3.4.0 has been released