When an Action table is created with a 'danger' action_type and a
single handler method for a single object, the 'selection' and
'help' parameters are empty. This causes the pop-up message to be
incomplete. For example:
"You have selected: . Please confirm your selection. "
This patch fixes this behaviour by displaying the message with
the selected objects only when one or more objects are selected.
Otherwise, it only asks for confirmation.
Closes-Bug: 2000799
Test Plan:
PASS: Build python3-django-horizon package including these changes.
PASS: Test the behaviour for single delete actions. For example:
Create a patch strategy and press the "Delete" action. Verify
the following message is displayed in the pop-up message:
"Please confirm your selection. This action cannot be undone."
PASS: Test the behaviour for multiple delete actions. For example:
Upload more than one patch, select them and click on the 'Delete'
action. Verify the following message is displayed:
You have selected: "22.12_NRR_INSVC", "22.12_RESTART_FAILURE_INSVC".
Please confirm your selection. This action cannot be undone.
Reviewed: https:/ /review. opendev. org/c/starlingx /upstream/ +/868933 /opendev. org/starlingx/ upstream/ commit/ feb152c085dd5a2 2e929244c481870 b27e23759d
Committed: https:/
Submitter: "Zuul (22348)"
Branch: master
commit feb152c085dd5a2 2e929244c481870 b27e23759d
Author: Enzo Candotti <email address hidden>
Date: Fri Dec 30 18:06:03 2022 -0300
Fix incomplete pop-up message on delete Action
When an Action table is created with a 'danger' action_type and a
single handler method for a single object, the 'selection' and
'help' parameters are empty. This causes the pop-up message to be
incomplete. For example:
"You have selected: . Please confirm your selection. "
This patch fixes this behaviour by displaying the message with
the selected objects only when one or more objects are selected.
Otherwise, it only asks for confirmation.
Closes-Bug: 2000799
Test Plan: django- horizon package including these changes.
PASS: Build python3-
PASS: Test the behaviour for single delete actions. For example:
Create a patch strategy and press the "Delete" action. Verify
the following message is displayed in the pop-up message:
"Please confirm your selection. This action cannot be undone."
PASS: Test the behaviour for multiple delete actions. For example: RESTART_ FAILURE_ INSVC".
Upload more than one patch, select them and click on the 'Delete'
action. Verify the following message is displayed:
You have selected: "22.12_NRR_INSVC", "22.12_
Please confirm your selection. This action cannot be undone.
Signed-off-by: Enzo Candotti <email address hidden> 14a1a5fa84d54ed 22032437f88
Change-Id: I85bc5c8155466e