Use "automation" instead of "workflow" in user-facing strings
[MAILPOET-4758]
This commit is contained in:
@ -21,7 +21,7 @@ export function TrashButton(): JSX.Element {
|
||||
<>
|
||||
<ConfirmDialog
|
||||
isOpen={showConfirmDialog}
|
||||
title={__('Delete workflow', 'mailpoet')}
|
||||
title={__('Delete automation', 'mailpoet')}
|
||||
confirmButtonText={__('Yes, delete', 'mailpoet')}
|
||||
onConfirm={async () => {
|
||||
trash(() => {
|
||||
@ -32,7 +32,7 @@ export function TrashButton(): JSX.Element {
|
||||
__experimentalHideHeader={false}
|
||||
>
|
||||
{sprintf(
|
||||
__('You are about to delete the "%s" workflow.', 'mailpoet'),
|
||||
__('You are about to delete the automation "%s".', 'mailpoet'),
|
||||
workflow.name,
|
||||
)}
|
||||
<br />
|
||||
|
@ -68,7 +68,7 @@ export function DocumentActions({ children }): JSX.Element {
|
||||
as="h1"
|
||||
>
|
||||
<VisuallyHidden as="span">
|
||||
{__('Editing workflow:', 'mailpoet')}
|
||||
{__('Editing automation:', 'mailpoet')}
|
||||
</VisuallyHidden>
|
||||
{workflowName}
|
||||
</Text>
|
||||
@ -93,7 +93,7 @@ export function DocumentActions({ children }): JSX.Element {
|
||||
aria-expanded={isOpen}
|
||||
aria-haspopup="true"
|
||||
onClick={onToggle}
|
||||
label={__('Change workflow name', 'mailpoet')}
|
||||
label={__('Change automation name', 'mailpoet')}
|
||||
>
|
||||
{showIconLabels && __('Rename', 'mailpoet')}
|
||||
</Button>
|
||||
|
@ -151,12 +151,12 @@ export function Errors(): JSX.Element | null {
|
||||
<Composite
|
||||
state={compositeState}
|
||||
role="list"
|
||||
aria-label={__('Workflow errors', 'mailpoet')}
|
||||
aria-label={__('Automation errors', 'mailpoet')}
|
||||
className="mailpoet-automation-errors"
|
||||
>
|
||||
<div className="mailpoet-automation-errors-header">
|
||||
{
|
||||
// translators: Label for a list of automation workflow steps that are incomplete or have errors
|
||||
// translators: Label for a list of automation steps that are incomplete or have errors
|
||||
__('The following steps are not fully set:', 'mailpoet')
|
||||
}
|
||||
</div>
|
||||
|
@ -18,8 +18,8 @@ export function Header({ sidebarKey }: Props): JSX.Element {
|
||||
|
||||
const [workflowAriaLabel, workflowActiveClass] =
|
||||
sidebarKey === workflowSidebarKey
|
||||
? [__('Workflow (selected)', 'mailpoet'), 'is-active']
|
||||
: ['Workflow', ''];
|
||||
? [__('Automation (selected)', 'mailpoet'), 'is-active']
|
||||
: ['Automation', ''];
|
||||
|
||||
const [stepAriaLabel, stepActiveClass] =
|
||||
sidebarKey === stepSidebarKey
|
||||
@ -33,9 +33,9 @@ export function Header({ sidebarKey }: Props): JSX.Element {
|
||||
onClick={openWorkflowSettings}
|
||||
className={`edit-site-sidebar__panel-tab ${workflowActiveClass}`}
|
||||
aria-label={workflowAriaLabel}
|
||||
data-label={__('Workflow', 'mailpoet')}
|
||||
data-label={__('Automation', 'mailpoet')}
|
||||
>
|
||||
{__('Workflow', 'mailpoet')}
|
||||
{__('Automation', 'mailpoet')}
|
||||
</Button>
|
||||
</li>
|
||||
<li>
|
||||
|
@ -3,7 +3,7 @@ import { __ } from '@wordpress/i18n';
|
||||
export function EmptyWorkflow(): JSX.Element {
|
||||
return (
|
||||
<div className="mailpoet-automation-editor-empty-workflow">
|
||||
{__('No workflow data.', 'mailpoet')}
|
||||
{__('No automation data.', 'mailpoet')}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
@ -90,7 +90,7 @@ export function Workflow(): JSX.Element {
|
||||
<Composite
|
||||
state={compositeState}
|
||||
role="tree"
|
||||
aria-label={__('Workflow', 'mailpoet')}
|
||||
aria-label={__('Automation', 'mailpoet')}
|
||||
aria-orientation="vertical"
|
||||
className="mailpoet-automation-editor-workflow"
|
||||
>
|
||||
|
@ -17,19 +17,19 @@ export function Statistics(): JSX.Element {
|
||||
items={[
|
||||
{
|
||||
key: 'entered',
|
||||
// translators: Total number of subscribers who entered an automation workflow
|
||||
// translators: Total number of subscribers who entered an automation
|
||||
label: _x('Total Entered', 'automation stats', 'mailpoet'),
|
||||
value: workflow.stats.totals.entered,
|
||||
},
|
||||
{
|
||||
key: 'processing',
|
||||
// translators: Total number of subscribers who are being processed in an automation workflow
|
||||
// translators: Total number of subscribers who are being processed in an automation
|
||||
label: _x('Total Processing', 'automation stats', 'mailpoet'),
|
||||
value: workflow.stats.totals.in_progress,
|
||||
},
|
||||
{
|
||||
key: 'exited',
|
||||
// translators: Total number of subscribers who exited an automation workflow, no matter the result
|
||||
// translators: Total number of subscribers who exited an automation, no matter the result
|
||||
label: _x('Total Exited', 'automation stats', 'mailpoet'),
|
||||
value: workflow.stats.totals.exited,
|
||||
},
|
||||
|
@ -97,7 +97,7 @@ export function EditNewsletter(): JSX.Element {
|
||||
{emailIdError && (
|
||||
<span className="mailpoet-automation-field-message">
|
||||
{__(
|
||||
'You need to design an email before you can activate the workflow',
|
||||
'You need to design an email before you can activate the automation',
|
||||
'mailpoet',
|
||||
)}
|
||||
</span>
|
||||
|
@ -13,19 +13,19 @@ export function Subscribers({ workflow }: Props): JSX.Element {
|
||||
items={[
|
||||
{
|
||||
key: 'entered',
|
||||
// translators: Total number of subscribers who entered an automation workflow
|
||||
// translators: Total number of subscribers who entered an automation
|
||||
label: _x('Entered', 'automation stats', 'mailpoet'),
|
||||
value: workflow.stats.totals.entered,
|
||||
},
|
||||
{
|
||||
key: 'processing',
|
||||
// translators: Total number of subscribers who are being processed in an automation workflow
|
||||
// translators: Total number of subscribers who are being processed in an automation
|
||||
label: _x('Processing', 'automation stats', 'mailpoet'),
|
||||
value: workflow.stats.totals.in_progress,
|
||||
},
|
||||
{
|
||||
key: 'exited',
|
||||
// translators: Total number of subscribers who exited an automation workflow, no matter the result
|
||||
// translators: Total number of subscribers who exited an automation, no matter the result
|
||||
label: _x('Exited', 'automation stats', 'mailpoet'),
|
||||
value: workflow.stats.totals.exited,
|
||||
},
|
||||
|
@ -31,7 +31,7 @@ export const useDeleteButton = (workflow: Workflow): Item | undefined => {
|
||||
onCancel={() => setShowDialog(false)}
|
||||
>
|
||||
{sprintf(
|
||||
// translators: %s is the workflow name
|
||||
// translators: %s is the automation name
|
||||
__(
|
||||
'Are you sure you want to permanently delete "%s" and all associated data? This cannot be undone!',
|
||||
'mailpoet',
|
||||
|
@ -24,16 +24,16 @@ export const useTrashButton = (workflow: Workflow): Item | undefined => {
|
||||
slot: (
|
||||
<ConfirmDialog
|
||||
isOpen={showDialog}
|
||||
title={__('Trash workflow', 'mailpoet')}
|
||||
title={__('Trash automation', 'mailpoet')}
|
||||
confirmButtonText={__('Yes, move to trash', 'mailpoet')}
|
||||
__experimentalHideHeader={false}
|
||||
onConfirm={() => trashWorkflow(workflow)}
|
||||
onCancel={() => setShowDialog(false)}
|
||||
>
|
||||
{sprintf(
|
||||
// translators: %s is the workflow name
|
||||
// translators: %s is the automation name
|
||||
__(
|
||||
'Are you sure you want to move the workflow "%s" to the Trash?',
|
||||
'Are you sure you want to move the automation "%s" to the Trash?',
|
||||
'mailpoet',
|
||||
),
|
||||
workflow.name,
|
||||
|
@ -32,7 +32,7 @@ export function* duplicateWorkflow(workflow: Workflow) {
|
||||
});
|
||||
|
||||
void createSuccessNotice(
|
||||
// translators: %s is the automation workflow name
|
||||
// translators: %s is the automation name
|
||||
sprintf(__('Automation "%s" was duplicated.', 'mailpoet'), workflow.name),
|
||||
);
|
||||
|
||||
@ -86,7 +86,7 @@ export function* restoreWorkflow(workflow: Workflow, status: WorkflowStatus) {
|
||||
{message}{' '}
|
||||
<EditWorkflow
|
||||
workflow={workflow}
|
||||
label={__('Edit workflow', 'mailpoet')}
|
||||
label={__('Edit automation', 'mailpoet')}
|
||||
/>
|
||||
</p>
|
||||
),
|
||||
|
@ -47,7 +47,7 @@ export function WorkflowListingNotices(): JSX.Element {
|
||||
if (workflowDeleted) {
|
||||
return (
|
||||
<Notice type="success" closable timeout={false}>
|
||||
<p>{__('1 workflow moved to the Trash.', 'mailpoet')}</p>
|
||||
<p>{__('1 automation moved to the Trash.', 'mailpoet')}</p>
|
||||
</Notice>
|
||||
);
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ export function BuildYourOwnSection(): JSX.Element {
|
||||
},
|
||||
{
|
||||
slug: 'customize-your-workflow',
|
||||
title: __('Customize your workflow', 'mailpoet'),
|
||||
title: __('Customize your automation', 'mailpoet'),
|
||||
text: __(
|
||||
'Choose steps and create a custom journey to best suit your needs.',
|
||||
'mailpoet',
|
||||
@ -49,7 +49,7 @@ export function BuildYourOwnSection(): JSX.Element {
|
||||
<section className="mailpoet-automation-section mailpoet-automation-white-background">
|
||||
<div className="mailpoet-automation-section-content mailpoet-section-build-your-own">
|
||||
<div>
|
||||
<h2>{__('Build your own automation workflows', 'mailpoet')}</h2>
|
||||
<h2>{__('Build your own automations', 'mailpoet')}</h2>
|
||||
<p>
|
||||
{__(
|
||||
'Create customized email sequences with our new automation editor.',
|
||||
|
@ -37,7 +37,7 @@ export function TemplateListItem({
|
||||
<p>
|
||||
{error.data
|
||||
? error.data.message
|
||||
: __('Could not create workflow.', 'mailpoet')}
|
||||
: __('Could not create automation.', 'mailpoet')}
|
||||
</p>
|
||||
</Notice>
|
||||
);
|
||||
|
@ -64,7 +64,7 @@ class AutomationEditor {
|
||||
if (!$workflow) {
|
||||
$notice = new WPNotice(
|
||||
WPNotice::TYPE_ERROR,
|
||||
__('Workflow not found.', 'mailpoet')
|
||||
__('Automation not found.', 'mailpoet')
|
||||
);
|
||||
$notice->displayWPNotice();
|
||||
$this->pageRenderer->displayPage('blank.html');
|
||||
|
@ -40,7 +40,7 @@ class CreateWorkflowFromTemplateController {
|
||||
$workflowId = $this->storage->createWorkflow($workflow);
|
||||
$savedWorkflow = $this->storage->getWorkflow($workflowId);
|
||||
if (!$savedWorkflow) {
|
||||
throw new InvalidStateException('Workflow not found.');
|
||||
throw new InvalidStateException('Automation not found.');
|
||||
}
|
||||
return $savedWorkflow;
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ class DuplicateWorkflowController {
|
||||
}
|
||||
|
||||
private function getName(string $name): string {
|
||||
// translators: %s is the original workflow name.
|
||||
// translators: %s is the original automation name.
|
||||
$newName = sprintf(__('Copy of %s', 'mailpoet'), $name);
|
||||
$maxLength = $this->workflowStorage->getNameColumnLength();
|
||||
if (strlen($newName) > $maxLength) {
|
||||
|
@ -63,50 +63,50 @@ class Exceptions {
|
||||
public static function workflowNotFound(int $id): NotFoundException {
|
||||
return NotFoundException::create()
|
||||
->withErrorCode(self::WORKFLOW_NOT_FOUND)
|
||||
// translators: %d is the ID of the workflow.
|
||||
->withMessage(sprintf(__("Workflow with ID '%d' not found.", 'mailpoet'), $id));
|
||||
// translators: %d is the ID of the automation.
|
||||
->withMessage(sprintf(__("Automation with ID '%d' not found.", 'mailpoet'), $id));
|
||||
}
|
||||
|
||||
public static function workflowVersionNotFound(int $workflow, int $version): NotFoundException {
|
||||
return NotFoundException::create()
|
||||
->withErrorCode(self::WORKFLOW_VERSION_NOT_FOUND)
|
||||
// translators: %1$s is the ID of the workflow, %2$s the version.
|
||||
->withMessage(sprintf(__('Workflow with ID "%1$s" in version "%2$s" not found.', 'mailpoet'), $workflow, $version));
|
||||
// translators: %1$s is the ID of the automation, %2$s the version.
|
||||
->withMessage(sprintf(__('Automation with ID "%1$s" in version "%2$s" not found.', 'mailpoet'), $workflow, $version));
|
||||
}
|
||||
|
||||
public static function workflowNotActive(int $workflow): InvalidStateException {
|
||||
return InvalidStateException::create()
|
||||
->withErrorCode(self::WORKFLOW_NOT_ACTIVE)
|
||||
// translators: %1$s is the ID of the workflow.
|
||||
->withMessage(sprintf(__('Workflow with ID "%1$s" in no longer active.', 'mailpoet'), $workflow));
|
||||
// translators: %1$s is the ID of the automation.
|
||||
->withMessage(sprintf(__('Automation with ID "%1$s" in no longer active.', 'mailpoet'), $workflow));
|
||||
}
|
||||
|
||||
public static function workflowRunNotFound(int $id): NotFoundException {
|
||||
return NotFoundException::create()
|
||||
->withErrorCode(self::WORKFLOW_RUN_NOT_FOUND)
|
||||
// translators: %d is the ID of the workflow run.
|
||||
->withMessage(sprintf(__("Workflow run with ID '%d' not found.", 'mailpoet'), $id));
|
||||
// translators: %d is the ID of the automation run.
|
||||
->withMessage(sprintf(__("Automation run with ID '%d' not found.", 'mailpoet'), $id));
|
||||
}
|
||||
|
||||
public static function workflowStepNotFound(string $key): NotFoundException {
|
||||
return NotFoundException::create()
|
||||
->withErrorCode(self::WORKFLOW_STEP_NOT_FOUND)
|
||||
// translators: %s is the key of the workflow step.
|
||||
->withMessage(sprintf(__("Workflow step with key '%s' not found.", 'mailpoet'), $key));
|
||||
// translators: %s is the key of the automation step.
|
||||
->withMessage(sprintf(__("Automation step with key '%s' not found.", 'mailpoet'), $key));
|
||||
}
|
||||
|
||||
public static function workflowTriggerNotFound(int $workflowId, string $key): NotFoundException {
|
||||
return NotFoundException::create()
|
||||
->withErrorCode(self::WORKFLOW_TRIGGER_NOT_FOUND)
|
||||
// translators: %1$s is the key, %2$d is the workflow ID.
|
||||
->withMessage(sprintf(__('Workflow trigger with key "%1$s" not found in workflow ID "%2$d".', 'mailpoet'), $key, $workflowId));
|
||||
// translators: %1$s is the key, %2$d is the automation ID.
|
||||
->withMessage(sprintf(__('Automation trigger with key "%1$s" not found in automation ID "%2$d".', 'mailpoet'), $key, $workflowId));
|
||||
}
|
||||
|
||||
public static function workflowRunNotRunning(int $id, string $status): InvalidStateException {
|
||||
return InvalidStateException::create()
|
||||
->withErrorCode(self::WORKFLOW_RUN_NOT_RUNNING)
|
||||
// translators: %1$d is the ID of the workflow run, %2$s its current status.
|
||||
->withMessage(sprintf(__('Workflow run with ID "%1$d" is not running. Status: %2$s', 'mailpoet'), $id, $status));
|
||||
// translators: %1$d is the ID of the automation run, %2$s its current status.
|
||||
->withMessage(sprintf(__('Automation run with ID "%1$d" is not running. Status: %2$s', 'mailpoet'), $id, $status));
|
||||
}
|
||||
|
||||
public static function subjectNotFound(string $key): NotFoundException {
|
||||
@ -133,50 +133,50 @@ class Exceptions {
|
||||
public static function subjectDataNotFound(string $key, int $workflowRunId): NotFoundException {
|
||||
return NotFoundException::create()
|
||||
->withErrorCode(self::SUBJECT_DATA_NOT_FOUND)
|
||||
// translators: %1$s is the key of the subject, %2$d is workflow run ID.
|
||||
// translators: %1$s is the key of the subject, %2$d is automation run ID.
|
||||
->withMessage(
|
||||
sprintf(__("Subject data for subject with key '%1\$s' not found for workflow run with ID '%2\$d'.", 'mailpoet'), $key, $workflowRunId)
|
||||
sprintf(__("Subject data for subject with key '%1\$s' not found for automation run with ID '%2\$d'.", 'mailpoet'), $key, $workflowRunId)
|
||||
);
|
||||
}
|
||||
|
||||
public static function multipleSubjectsFound(string $key, int $workflowRunId): InvalidStateException {
|
||||
return InvalidStateException::create()
|
||||
->withErrorCode(self::MULTIPLE_SUBJECTS_FOUND)
|
||||
// translators: %1$s is the key of the subject, %2$d is workflow run ID.
|
||||
// translators: %1$s is the key of the subject, %2$d is automation run ID.
|
||||
->withMessage(
|
||||
sprintf(__("Multiple subjects with key '%1\$s' found for workflow run with ID '%2\$d', only one expected.", 'mailpoet'), $key, $workflowRunId)
|
||||
sprintf(__("Multiple subjects with key '%1\$s' found for automation run with ID '%2\$d', only one expected.", 'mailpoet'), $key, $workflowRunId)
|
||||
);
|
||||
}
|
||||
|
||||
public static function payloadNotFound(string $class, int $workflowRunId): NotFoundException {
|
||||
return NotFoundException::create()
|
||||
->withErrorCode(self::PAYLOAD_NOT_FOUND)
|
||||
// translators: %1$s is the class of the payload, %2$d is workflow run ID.
|
||||
// translators: %1$s is the class of the payload, %2$d is automation run ID.
|
||||
->withMessage(
|
||||
sprintf(__("Payload of class '%1\$s' not found for workflow run with ID '%2\$d'.", 'mailpoet'), $class, $workflowRunId)
|
||||
sprintf(__("Payload of class '%1\$s' not found for automation run with ID '%2\$d'.", 'mailpoet'), $class, $workflowRunId)
|
||||
);
|
||||
}
|
||||
|
||||
public static function multiplePayloadsFound(string $class, int $workflowRunId): NotFoundException {
|
||||
return NotFoundException::create()
|
||||
->withErrorCode(self::MULTIPLE_PAYLOADS_FOUND)
|
||||
// translators: %1$s is the class of the payloads, %2$d is workflow run ID.
|
||||
// translators: %1$s is the class of the payloads, %2$d is automation run ID.
|
||||
->withMessage(
|
||||
sprintf(__("Multiple payloads of class '%1\$s' found for workflow run with ID '%2\$d'.", 'mailpoet'), $class, $workflowRunId)
|
||||
sprintf(__("Multiple payloads of class '%1\$s' found for automation run with ID '%2\$d'.", 'mailpoet'), $class, $workflowRunId)
|
||||
);
|
||||
}
|
||||
|
||||
public static function workflowStructureModificationNotSupported(): UnexpectedValueException {
|
||||
return UnexpectedValueException::create()
|
||||
->withErrorCode(self::WORKFLOW_STRUCTURE_MODIFICATION_NOT_SUPPORTED)
|
||||
->withMessage(__("Workflow structure modification not supported.", 'mailpoet'));
|
||||
->withMessage(__('Automation structure modification not supported.', 'mailpoet'));
|
||||
}
|
||||
|
||||
public static function workflowStructureNotValid(string $detail, string $ruleId): UnexpectedValueException {
|
||||
return UnexpectedValueException::create()
|
||||
->withErrorCode(self::WORKFLOW_STRUCTURE_NOT_VALID)
|
||||
// translators: %s is a detailed information
|
||||
->withMessage(sprintf(__("Invalid workflow structure: %s", 'mailpoet'), $detail))
|
||||
->withMessage(sprintf(__("Invalid automation structure: %s", 'mailpoet'), $detail))
|
||||
->withErrors(['rule_id' => $ruleId]);
|
||||
}
|
||||
|
||||
@ -198,7 +198,7 @@ class Exceptions {
|
||||
return UnexpectedValueException::create()
|
||||
->withErrorCode(self::WORKFLOW_NOT_VALID)
|
||||
// translators: %s is a detailed information
|
||||
->withMessage(sprintf(__("Workflow validation failed: %s", 'mailpoet'), $detail))
|
||||
->withMessage(sprintf(__("Automation validation failed: %s", 'mailpoet'), $detail))
|
||||
->withErrors($errors);
|
||||
}
|
||||
|
||||
@ -218,14 +218,14 @@ class Exceptions {
|
||||
public static function workflowNotTrashed(int $id): UnexpectedValueException {
|
||||
return UnexpectedValueException::create()
|
||||
->withErrorCode(self::WORKFLOW_NOT_TRASHED)
|
||||
// translators: %d is the ID of the workflow.
|
||||
->withMessage(sprintf(__("Can't delete workflow with ID '%d' because it was not trashed.", 'mailpoet'), $id));
|
||||
// translators: %d is the ID of the automation.
|
||||
->withMessage(sprintf(__("Can't delete automation with ID '%d' because it was not trashed.", 'mailpoet'), $id));
|
||||
}
|
||||
|
||||
public static function workflowTemplateNotFound(string $id): NotFoundException {
|
||||
return NotFoundException::create()
|
||||
->withErrorCode(self::WORKFLOW_TEMPLATE_NOT_FOUND)
|
||||
// translators: %d is the ID of the workflow template.
|
||||
->withMessage(sprintf(__("Workflow template with ID '%d' not found.", 'mailpoet'), $id));
|
||||
// translators: %d is the ID of the automation template.
|
||||
->withMessage(sprintf(__("Automation template with ID '%d' not found.", 'mailpoet'), $id));
|
||||
}
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ class WorkflowWalker {
|
||||
$steps = $workflow->getSteps();
|
||||
$root = $steps['root'] ?? null;
|
||||
if (!$root) {
|
||||
throw Exceptions::workflowStructureNotValid(__("Workflow must contain a 'root' step", 'mailpoet'), 'no-root');
|
||||
throw Exceptions::workflowStructureNotValid(__("Automation must contain a 'root' step", 'mailpoet'), 'no-root');
|
||||
}
|
||||
|
||||
foreach ($visitors as $visitor) {
|
||||
|
@ -28,6 +28,6 @@ class AtLeastOneTriggerRule implements WorkflowNodeVisitor {
|
||||
if ($this->triggerFound) {
|
||||
return;
|
||||
}
|
||||
throw Exceptions::workflowStructureNotValid(__('There must be at least one trigger in the workflow.', 'mailpoet'), self::RULE_ID);
|
||||
throw Exceptions::workflowStructureNotValid(__('There must be at least one trigger in the automation.', 'mailpoet'), self::RULE_ID);
|
||||
}
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ class NoCycleRule implements WorkflowNodeVisitor {
|
||||
foreach ($step->getNextSteps() as $nextStep) {
|
||||
$nextStepId = $nextStep->getId();
|
||||
if ($nextStepId === $step->getId() || isset($parentIdsMap[$nextStepId])) {
|
||||
throw Exceptions::workflowStructureNotValid(__('Cycle found in workflow graph', 'mailpoet'), self::RULE_ID);
|
||||
throw Exceptions::workflowStructureNotValid(__('Cycle found in automation graph', 'mailpoet'), self::RULE_ID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ class NoJoinRule implements WorkflowNodeVisitor {
|
||||
foreach ($step->getNextSteps() as $nextStep) {
|
||||
$nextStepId = $nextStep->getId();
|
||||
if (isset($this->visitedSteps[$nextStepId])) {
|
||||
throw Exceptions::workflowStructureNotValid(__('Path join found in workflow graph', 'mailpoet'), self::RULE_ID);
|
||||
throw Exceptions::workflowStructureNotValid(__('Path join found in automation graph', 'mailpoet'), self::RULE_ID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ class NoSplitRule implements WorkflowNodeVisitor {
|
||||
public function visitNode(Workflow $workflow, WorkflowNode $node): void {
|
||||
$step = $node->getStep();
|
||||
if (count($step->getNextSteps()) > 1) {
|
||||
throw Exceptions::workflowStructureNotValid(__('Path split found in workflow graph', 'mailpoet'), self::RULE_ID);
|
||||
throw Exceptions::workflowStructureNotValid(__('Path split found in automation graph', 'mailpoet'), self::RULE_ID);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@ class NoUnreachableStepsRule implements WorkflowNodeVisitor {
|
||||
|
||||
public function complete(Workflow $workflow): void {
|
||||
if (count($this->visitedNodes) !== count($workflow->getSteps())) {
|
||||
throw Exceptions::workflowStructureNotValid(__('Unreachable steps found in workflow graph', 'mailpoet'), self::RULE_ID);
|
||||
throw Exceptions::workflowStructureNotValid(__('Unreachable steps found in automation graph', 'mailpoet'), self::RULE_ID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ class TriggersUnderRootRule implements WorkflowNodeVisitor {
|
||||
foreach ($step->getNextSteps() as $nextStep) {
|
||||
$nextStepId = $nextStep->getId();
|
||||
if (isset($this->triggersMap[$nextStepId])) {
|
||||
throw Exceptions::workflowStructureNotValid(__('Trigger must be a direct descendant of workflow root', 'mailpoet'), self::RULE_ID);
|
||||
throw Exceptions::workflowStructureNotValid(__('Trigger must be a direct descendant of automation root', 'mailpoet'), self::RULE_ID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -87,7 +87,7 @@ class StepHandlerTest extends \MailPoetTest
|
||||
try {
|
||||
$this->testee->handle(['workflow_run_id' => $workflowRun->getId(), 'step_id' => $currentStep->getId()]);
|
||||
} catch (InvalidStateException $error) {
|
||||
$this->assertSame('mailpoet_automation_workflow_not_active', $error->getErrorCode(), "Workflow with '$status' did not return expected error code.");
|
||||
$this->assertSame('mailpoet_automation_workflow_not_active', $error->getErrorCode(), "Automation with '$status' did not return expected error code.");
|
||||
}
|
||||
$this->assertInstanceOf(InvalidStateException::class, $error);
|
||||
|
||||
|
@ -136,7 +136,7 @@ class WorkflowStorageTest extends \MailPoetTest
|
||||
$workflowId = $this->testee->createWorkflow($workflow);
|
||||
$workflow = $this->testee->getWorkflow($workflowId);
|
||||
if (! $workflow) {
|
||||
throw new \RuntimeException("Workflow not stored.");
|
||||
throw new \RuntimeException("Automation not stored.");
|
||||
}
|
||||
return $workflow;
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ class WorkflowsDeleteEndpointTest extends AutomationTest {
|
||||
|
||||
$this->assertSame([
|
||||
'code' => 'mailpoet_automation_workflow_not_trashed',
|
||||
'message' => "Can't delete workflow with ID '{$this->workflow->getId()}' because it was not trashed.",
|
||||
'message' => "Can't delete automation with ID '{$this->workflow->getId()}' because it was not trashed.",
|
||||
'data' => ['status' => 400, 'errors' => []],
|
||||
], $data);
|
||||
|
||||
|
@ -13,7 +13,7 @@ class WorkflowWalkerTest extends MailPoetUnitTest {
|
||||
$workflow = $this->createWorkflow([]);
|
||||
|
||||
$this->expectException(UnexpectedValueException::class);
|
||||
$this->expectExceptionMessage("Invalid workflow structure: Workflow must contain a 'root' step");
|
||||
$this->expectExceptionMessage("Invalid automation structure: Automation must contain a 'root' step");
|
||||
$this->walkWorkflow($workflow);
|
||||
}
|
||||
|
||||
@ -21,7 +21,7 @@ class WorkflowWalkerTest extends MailPoetUnitTest {
|
||||
$workflow = $this->createWorkflow(['root' => ['a']]);
|
||||
|
||||
$this->expectException(UnexpectedValueException::class);
|
||||
$this->expectExceptionMessage("Invalid workflow structure: Step with ID 'a' not found (referenced from 'root')");
|
||||
$this->expectExceptionMessage("Invalid automation structure: Step with ID 'a' not found (referenced from 'root')");
|
||||
$this->walkWorkflow($workflow);
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,7 @@ class AtLeastOnTriggerTest extends WorkflowRuleTest
|
||||
|
||||
|
||||
$this->expectException(UnexpectedValueException::class);
|
||||
$this->expectExceptionMessage('Invalid workflow structure: There must be at least one trigger in the workflow.');
|
||||
$this->expectExceptionMessage('Invalid automation structure: There must be at least one trigger in the automation.');
|
||||
(new WorkflowWalker())->walk($workflow, [new AtLeastOneTriggerRule()]);
|
||||
}
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ class ConsistentStepMapRuleTest extends WorkflowRuleTest {
|
||||
]]);
|
||||
|
||||
$this->expectException(UnexpectedValueException::class);
|
||||
$this->expectExceptionMessage("Invalid workflow structure: Step with ID 'a' stored under a mismatched index 'root'.");
|
||||
$this->expectExceptionMessage("Invalid automation structure: Step with ID 'a' stored under a mismatched index 'root'.");
|
||||
(new WorkflowWalker())->walk($workflow, [new ConsistentStepMapRule()]);
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,7 @@ class NoCycleRuleTest extends WorkflowRuleTest {
|
||||
]);
|
||||
|
||||
$this->expectException(UnexpectedValueException::class);
|
||||
$this->expectExceptionMessage('Invalid workflow structure: Cycle found in workflow graph');
|
||||
$this->expectExceptionMessage('Invalid automation structure: Cycle found in automation graph');
|
||||
(new WorkflowWalker())->walk($workflow, [new NoCycleRule()]);
|
||||
}
|
||||
|
||||
@ -27,7 +27,7 @@ class NoCycleRuleTest extends WorkflowRuleTest {
|
||||
]);
|
||||
|
||||
$this->expectException(UnexpectedValueException::class);
|
||||
$this->expectExceptionMessage('Invalid workflow structure: Cycle found in workflow graph');
|
||||
$this->expectExceptionMessage('Invalid automation structure: Cycle found in automation graph');
|
||||
(new WorkflowWalker())->walk($workflow, [new NoCycleRule()]);
|
||||
}
|
||||
|
||||
|
@ -15,7 +15,7 @@ class NoDuplicateEdgesTest extends WorkflowRuleTest {
|
||||
]);
|
||||
|
||||
$this->expectException(UnexpectedValueException::class);
|
||||
$this->expectExceptionMessage('Invalid workflow structure: Duplicate next step definition found');
|
||||
$this->expectExceptionMessage('Invalid automation structure: Duplicate next step definition found');
|
||||
(new WorkflowWalker())->walk($workflow, [new NoDuplicateEdgesRule()]);
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,7 @@ class NoJoinRuleTest extends WorkflowRuleTest {
|
||||
]);
|
||||
|
||||
$this->expectException(UnexpectedValueException::class);
|
||||
$this->expectExceptionMessage('Invalid workflow structure: Path join found in workflow graph');
|
||||
$this->expectExceptionMessage('Invalid automation structure: Path join found in automation graph');
|
||||
(new WorkflowWalker())->walk($workflow, [new NoJoinRule()]);
|
||||
}
|
||||
|
||||
@ -34,7 +34,7 @@ class NoJoinRuleTest extends WorkflowRuleTest {
|
||||
]);
|
||||
|
||||
$this->expectException(UnexpectedValueException::class);
|
||||
$this->expectExceptionMessage('Invalid workflow structure: Path join found in workflow graph');
|
||||
$this->expectExceptionMessage('Invalid automation structure: Path join found in automation graph');
|
||||
(new WorkflowWalker())->walk($workflow, [new NoJoinRule()]);
|
||||
}
|
||||
|
||||
@ -44,7 +44,7 @@ class NoJoinRuleTest extends WorkflowRuleTest {
|
||||
]);
|
||||
|
||||
$this->expectException(UnexpectedValueException::class);
|
||||
$this->expectExceptionMessage('Invalid workflow structure: Path join found in workflow graph');
|
||||
$this->expectExceptionMessage('Invalid automation structure: Path join found in automation graph');
|
||||
(new WorkflowWalker())->walk($workflow, [new NoJoinRule()]);
|
||||
}
|
||||
|
||||
|
@ -16,7 +16,7 @@ class NoSplitRuleTest extends WorkflowRuleTest {
|
||||
]);
|
||||
|
||||
$this->expectException(UnexpectedValueException::class);
|
||||
$this->expectExceptionMessage('Invalid workflow structure: Path split found in workflow graph');
|
||||
$this->expectExceptionMessage('Invalid automation structure: Path split found in automation graph');
|
||||
(new WorkflowWalker())->walk($workflow, [new NoSplitRule()]);
|
||||
}
|
||||
|
||||
@ -27,7 +27,7 @@ class NoSplitRuleTest extends WorkflowRuleTest {
|
||||
]);
|
||||
|
||||
$this->expectException(UnexpectedValueException::class);
|
||||
$this->expectExceptionMessage('Invalid workflow structure: Path split found in workflow graph');
|
||||
$this->expectExceptionMessage('Invalid automation structure: Path split found in automation graph');
|
||||
(new WorkflowWalker())->walk($workflow, [new NoSplitRule()]);
|
||||
}
|
||||
|
||||
|
@ -16,7 +16,7 @@ class NoUnreachableStepsRuleTest extends WorkflowRuleTest {
|
||||
]);
|
||||
|
||||
$this->expectException(UnexpectedValueException::class);
|
||||
$this->expectExceptionMessage('Invalid workflow structure: Unreachable steps found in workflow graph');
|
||||
$this->expectExceptionMessage('Invalid automation structure: Unreachable steps found in automation graph');
|
||||
(new WorkflowWalker())->walk($workflow, [new NoUnreachableStepsRule()]);
|
||||
}
|
||||
|
||||
@ -29,7 +29,7 @@ class NoUnreachableStepsRuleTest extends WorkflowRuleTest {
|
||||
]);
|
||||
|
||||
$this->expectException(UnexpectedValueException::class);
|
||||
$this->expectExceptionMessage('Invalid workflow structure: Unreachable steps found in workflow graph');
|
||||
$this->expectExceptionMessage('Invalid automation structure: Unreachable steps found in automation graph');
|
||||
$walker = new WorkflowWalker();
|
||||
(new WorkflowWalker())->walk($workflow, [new NoUnreachableStepsRule()]);
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ class TriggerNeedsNextStepsRuleTest extends WorkflowRuleTest
|
||||
$workflow = $this->make(Workflow::class, ['getSteps' => $steps, 'getStep' => function($id) use ($steps) { return $steps[$id]??null; }]);
|
||||
|
||||
$this->expectException(UnexpectedValueException::class);
|
||||
$this->expectExceptionMessage('Invalid workflow structure: A trigger needs to be followed by an action.');
|
||||
$this->expectExceptionMessage('Invalid automation structure: A trigger needs to be followed by an action.');
|
||||
(new WorkflowWalker())->walk($workflow, [new TriggerNeedsToBeFollowedByActionRule()]);
|
||||
}
|
||||
|
||||
@ -46,7 +46,7 @@ class TriggerNeedsNextStepsRuleTest extends WorkflowRuleTest
|
||||
|
||||
|
||||
$this->expectException(UnexpectedValueException::class);
|
||||
$this->expectExceptionMessage('Invalid workflow structure: A trigger needs to be followed by an action.');
|
||||
$this->expectExceptionMessage('Invalid automation structure: A trigger needs to be followed by an action.');
|
||||
(new WorkflowWalker())->walk($workflow, [new TriggerNeedsToBeFollowedByActionRule()]);
|
||||
}
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ class TriggersUnderRootRuleTest extends WorkflowRuleTest {
|
||||
]]);
|
||||
|
||||
$this->expectException(UnexpectedValueException::class);
|
||||
$this->expectExceptionMessage('Invalid workflow structure: Trigger must be a direct descendant of workflow root');
|
||||
$this->expectExceptionMessage('Invalid automation structure: Trigger must be a direct descendant of automation root');
|
||||
(new WorkflowWalker())->walk($workflow, [new TriggersUnderRootRule()]);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user