Commit 887fabdd authored by PECQUOT's avatar PECQUOT
Browse files

[fix] Try to deleting a forbidden campaign will not remove the line (Mantis #48115)


Signed-off-by: PECQUOT's avatarlp1ee9d <ludovic.pecquot@e-is.pro>
parent 358aad47
......@@ -38,11 +38,12 @@ import java.util.stream.Collectors;
import static org.nuiton.i18n.I18n.t;
/**
* Action permettant de supprimer un programmes.
* Action permettant de supprimer une campagne.
*/
public class DeleteCampaignAction extends AbstractReefDbAction<CampaignsTableUIModel, CampaignsTableUI, CampaignsTableUIHandler> {
private List<CampaignDTO> campaignsToDelete;
private boolean deleteAborted = false;
/**
* Constructor.
......@@ -97,7 +98,7 @@ public class DeleteCampaignAction extends AbstractReefDbAction<CampaignsTableUIM
* {@inheritDoc}
*/
@Override
public void doAction() throws Exception {
public void doAction() {
// check program usage in data
for (CampaignDTO campaign : campaignsToDelete) {
......@@ -109,6 +110,7 @@ public class DeleteCampaignAction extends AbstractReefDbAction<CampaignsTableUIM
? t("reefdb.action.delete.campaign.used.data.message", campaign.getName())
: t("reefdb.action.delete.campaign.used.data.many.message", surveyCount, campaign.getName()),
t("reefdb.action.delete.campaign.title"));
deleteAborted = true;
return;
}
......@@ -118,6 +120,7 @@ public class DeleteCampaignAction extends AbstractReefDbAction<CampaignsTableUIM
t("reefdb.action.delete.campaign.used.filter.message", campaign.getName()),
t("reefdb.action.delete.campaign.title")
);
deleteAborted = true;
return;
}
}
......@@ -149,6 +152,7 @@ public class DeleteCampaignAction extends AbstractReefDbAction<CampaignsTableUIM
t("reefdb.action.delete.campaign.title")
);
}
deleteAborted = true;
}
}
......@@ -160,7 +164,8 @@ public class DeleteCampaignAction extends AbstractReefDbAction<CampaignsTableUIM
super.postSuccessAction();
// Suppression des lignes
getModel().deleteSelectedRows();
if (!deleteAborted)
getModel().deleteSelectedRows();
}
......
......@@ -62,6 +62,9 @@
<action dev="ludovic.pecquot@e-is.pro" type="add" issue="47630">
Add current configuration options on About UI
</action>
<action dev="ludovic.pecquot@e-is.pro" type="fix" issue="48115">
Try to deleting a forbidden campaign will not remove the line
</action>
<action dev="ludovic.pecquot@e-is.pro" type="add">
Use the new quadrige3-ui-core-common module with many model refactoring
</action>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment