Display proper notices for segment actions

This updates some of the segment listing messages to include the name of
 the segment to avoid confusion, and allows for the possibility that
 bulk actions will work for some segments but not all, in which case we
 need to show both success and error messages.

MAILPOET-5395
This commit is contained in:
John Oleksowicz
2024-02-12 11:07:34 -06:00
committed by Aschepikov
parent 28ca417261
commit 6675a616b5
6 changed files with 127 additions and 72 deletions

View File

@@ -121,7 +121,7 @@ class DynamicSegmentsTest extends \MailPoetTest {
$response = $this->endpoint->trash(['id' => $dynamicSegment->getId()]);
$this->entityManager->refresh($dynamicSegment);
verify($response->status)->equals(APIResponse::STATUS_BAD_REQUEST);
verify($response->errors[0]['message'])->equals("Segment cannot be deleted because its used for 'Subject' email");
verify($response->errors[0]['message'])->equals("Segment '{$dynamicSegment->getName()}' cannot be deleted because its used for 'Subject' email");
}
public function testItCanRestoreASegment() {