From dc5e5b4f8b8bf7cdbfa72f862389769f11ef2247 Mon Sep 17 00:00:00 2001 From: Jan Jakes Date: Wed, 2 Nov 2022 21:29:35 +0100 Subject: [PATCH] Use "automation" instead of "workflow" in user-facing strings [MAILPOET-4758] --- .../components/actions/trash-button.tsx | 4 +- .../components/header/document_actions.tsx | 4 +- .../editor/components/header/errors.tsx | 4 +- .../editor/components/sidebar/header.tsx | 8 +-- .../components/workflow/empty-workflow.tsx | 2 +- .../editor/components/workflow/index.tsx | 2 +- .../editor/components/workflow/statistics.tsx | 6 +- .../steps/send_email/edit/edit_newsletter.tsx | 2 +- .../listing/components/cells/subscribers.tsx | 6 +- .../listing/components/menu/delete.tsx | 2 +- .../listing/components/menu/trash.tsx | 6 +- .../src/automation/listing/store/actions.tsx | 4 +- .../listing/workflow-listing-notices.tsx | 2 +- .../sections/build-your-own-section.tsx | 4 +- .../components/template-list-item.tsx | 2 +- .../lib/AdminPages/Pages/AutomationEditor.php | 2 +- .../CreateWorkflowFromTemplateController.php | 2 +- .../Builder/DuplicateWorkflowController.php | 2 +- mailpoet/lib/Automation/Engine/Exceptions.php | 58 +++++++++---------- .../WorkflowGraph/WorkflowWalker.php | 2 +- .../WorkflowRules/AtLeastOneTriggerRule.php | 2 +- .../Validation/WorkflowRules/NoCycleRule.php | 2 +- .../Validation/WorkflowRules/NoJoinRule.php | 2 +- .../Validation/WorkflowRules/NoSplitRule.php | 2 +- .../WorkflowRules/NoUnreachableStepsRule.php | 2 +- .../WorkflowRules/TriggersUnderRootRule.php | 2 +- .../Engine/Control/StepHandlerTest.php | 2 +- .../Engine/Storage/WorkflowStorageTest.php | 2 +- .../Workflows/WorkflowsDeleteEndpointTest.php | 2 +- .../WorkflowGraph/WorkflowWalkerTest.php | 4 +- .../WorkflowRules/AtLeastOnTriggerTest.php | 2 +- .../ConsistentStepMapRuleTest.php | 2 +- .../WorkflowRules/NoCycleRuleTest.php | 4 +- .../WorkflowRules/NoDuplicateEdgesTest.php | 2 +- .../WorkflowRules/NoJoinRuleTest.php | 6 +- .../WorkflowRules/NoSplitRuleTest.php | 4 +- .../NoUnreachableStepsRuleTest.php | 4 +- .../TriggerNeedsNextStepsRuleTest.php | 4 +- .../TriggersUnderRootRuleTest.php | 2 +- 39 files changed, 88 insertions(+), 88 deletions(-) diff --git a/mailpoet/assets/js/src/automation/editor/components/actions/trash-button.tsx b/mailpoet/assets/js/src/automation/editor/components/actions/trash-button.tsx index 557f41117d..615a11ba91 100644 --- a/mailpoet/assets/js/src/automation/editor/components/actions/trash-button.tsx +++ b/mailpoet/assets/js/src/automation/editor/components/actions/trash-button.tsx @@ -21,7 +21,7 @@ export function TrashButton(): JSX.Element { <> { 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, )}
diff --git a/mailpoet/assets/js/src/automation/editor/components/header/document_actions.tsx b/mailpoet/assets/js/src/automation/editor/components/header/document_actions.tsx index 854840843d..a833fedaf2 100644 --- a/mailpoet/assets/js/src/automation/editor/components/header/document_actions.tsx +++ b/mailpoet/assets/js/src/automation/editor/components/header/document_actions.tsx @@ -68,7 +68,7 @@ export function DocumentActions({ children }): JSX.Element { as="h1" > - {__('Editing workflow:', 'mailpoet')} + {__('Editing automation:', 'mailpoet')} {workflowName} @@ -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')} diff --git a/mailpoet/assets/js/src/automation/editor/components/header/errors.tsx b/mailpoet/assets/js/src/automation/editor/components/header/errors.tsx index 4b2e2ed206..a368bf008a 100644 --- a/mailpoet/assets/js/src/automation/editor/components/header/errors.tsx +++ b/mailpoet/assets/js/src/automation/editor/components/header/errors.tsx @@ -151,12 +151,12 @@ export function Errors(): JSX.Element | null {
{ - // 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') }
diff --git a/mailpoet/assets/js/src/automation/editor/components/sidebar/header.tsx b/mailpoet/assets/js/src/automation/editor/components/sidebar/header.tsx index 3ff51df3ae..9dbf102cc8 100644 --- a/mailpoet/assets/js/src/automation/editor/components/sidebar/header.tsx +++ b/mailpoet/assets/js/src/automation/editor/components/sidebar/header.tsx @@ -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')}
  • diff --git a/mailpoet/assets/js/src/automation/editor/components/workflow/empty-workflow.tsx b/mailpoet/assets/js/src/automation/editor/components/workflow/empty-workflow.tsx index 0931368e5c..665fbc3374 100644 --- a/mailpoet/assets/js/src/automation/editor/components/workflow/empty-workflow.tsx +++ b/mailpoet/assets/js/src/automation/editor/components/workflow/empty-workflow.tsx @@ -3,7 +3,7 @@ import { __ } from '@wordpress/i18n'; export function EmptyWorkflow(): JSX.Element { return (
    - {__('No workflow data.', 'mailpoet')} + {__('No automation data.', 'mailpoet')}
    ); } diff --git a/mailpoet/assets/js/src/automation/editor/components/workflow/index.tsx b/mailpoet/assets/js/src/automation/editor/components/workflow/index.tsx index cf5ef55db5..58bc18dbca 100644 --- a/mailpoet/assets/js/src/automation/editor/components/workflow/index.tsx +++ b/mailpoet/assets/js/src/automation/editor/components/workflow/index.tsx @@ -90,7 +90,7 @@ export function Workflow(): JSX.Element { diff --git a/mailpoet/assets/js/src/automation/editor/components/workflow/statistics.tsx b/mailpoet/assets/js/src/automation/editor/components/workflow/statistics.tsx index 67ef606659..17c3ee95f6 100644 --- a/mailpoet/assets/js/src/automation/editor/components/workflow/statistics.tsx +++ b/mailpoet/assets/js/src/automation/editor/components/workflow/statistics.tsx @@ -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, }, diff --git a/mailpoet/assets/js/src/automation/integrations/mailpoet/steps/send_email/edit/edit_newsletter.tsx b/mailpoet/assets/js/src/automation/integrations/mailpoet/steps/send_email/edit/edit_newsletter.tsx index 1e183e372e..f105c2aa3b 100644 --- a/mailpoet/assets/js/src/automation/integrations/mailpoet/steps/send_email/edit/edit_newsletter.tsx +++ b/mailpoet/assets/js/src/automation/integrations/mailpoet/steps/send_email/edit/edit_newsletter.tsx @@ -97,7 +97,7 @@ export function EditNewsletter(): JSX.Element { {emailIdError && ( {__( - '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', )} diff --git a/mailpoet/assets/js/src/automation/listing/components/cells/subscribers.tsx b/mailpoet/assets/js/src/automation/listing/components/cells/subscribers.tsx index 008d6ad2ca..87d6e1dd86 100644 --- a/mailpoet/assets/js/src/automation/listing/components/cells/subscribers.tsx +++ b/mailpoet/assets/js/src/automation/listing/components/cells/subscribers.tsx @@ -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, }, diff --git a/mailpoet/assets/js/src/automation/listing/components/menu/delete.tsx b/mailpoet/assets/js/src/automation/listing/components/menu/delete.tsx index b5d74f3fd7..4151ebf58a 100644 --- a/mailpoet/assets/js/src/automation/listing/components/menu/delete.tsx +++ b/mailpoet/assets/js/src/automation/listing/components/menu/delete.tsx @@ -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', diff --git a/mailpoet/assets/js/src/automation/listing/components/menu/trash.tsx b/mailpoet/assets/js/src/automation/listing/components/menu/trash.tsx index bbfedd31a9..32e488acfa 100644 --- a/mailpoet/assets/js/src/automation/listing/components/menu/trash.tsx +++ b/mailpoet/assets/js/src/automation/listing/components/menu/trash.tsx @@ -24,16 +24,16 @@ export const useTrashButton = (workflow: Workflow): Item | undefined => { slot: ( 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, diff --git a/mailpoet/assets/js/src/automation/listing/store/actions.tsx b/mailpoet/assets/js/src/automation/listing/store/actions.tsx index 922e714e04..726ed9776f 100644 --- a/mailpoet/assets/js/src/automation/listing/store/actions.tsx +++ b/mailpoet/assets/js/src/automation/listing/store/actions.tsx @@ -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}{' '}

    ), diff --git a/mailpoet/assets/js/src/automation/listing/workflow-listing-notices.tsx b/mailpoet/assets/js/src/automation/listing/workflow-listing-notices.tsx index bfe962e71b..595b5a7f89 100644 --- a/mailpoet/assets/js/src/automation/listing/workflow-listing-notices.tsx +++ b/mailpoet/assets/js/src/automation/listing/workflow-listing-notices.tsx @@ -47,7 +47,7 @@ export function WorkflowListingNotices(): JSX.Element { if (workflowDeleted) { return ( -

    {__('1 workflow moved to the Trash.', 'mailpoet')}

    +

    {__('1 automation moved to the Trash.', 'mailpoet')}

    ); } diff --git a/mailpoet/assets/js/src/automation/sections/build-your-own-section.tsx b/mailpoet/assets/js/src/automation/sections/build-your-own-section.tsx index 17f969c321..d1ffa8f064 100644 --- a/mailpoet/assets/js/src/automation/sections/build-your-own-section.tsx +++ b/mailpoet/assets/js/src/automation/sections/build-your-own-section.tsx @@ -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 {
    -

    {__('Build your own automation workflows', 'mailpoet')}

    +

    {__('Build your own automations', 'mailpoet')}

    {__( 'Create customized email sequences with our new automation editor.', diff --git a/mailpoet/assets/js/src/automation/templates/components/template-list-item.tsx b/mailpoet/assets/js/src/automation/templates/components/template-list-item.tsx index 6d1a958314..47b4daa59d 100644 --- a/mailpoet/assets/js/src/automation/templates/components/template-list-item.tsx +++ b/mailpoet/assets/js/src/automation/templates/components/template-list-item.tsx @@ -37,7 +37,7 @@ export function TemplateListItem({

    {error.data ? error.data.message - : __('Could not create workflow.', 'mailpoet')} + : __('Could not create automation.', 'mailpoet')}

    ); diff --git a/mailpoet/lib/AdminPages/Pages/AutomationEditor.php b/mailpoet/lib/AdminPages/Pages/AutomationEditor.php index ce66b226a6..86ec9701d5 100644 --- a/mailpoet/lib/AdminPages/Pages/AutomationEditor.php +++ b/mailpoet/lib/AdminPages/Pages/AutomationEditor.php @@ -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'); diff --git a/mailpoet/lib/Automation/Engine/Builder/CreateWorkflowFromTemplateController.php b/mailpoet/lib/Automation/Engine/Builder/CreateWorkflowFromTemplateController.php index 4d722d77fc..93293e606d 100644 --- a/mailpoet/lib/Automation/Engine/Builder/CreateWorkflowFromTemplateController.php +++ b/mailpoet/lib/Automation/Engine/Builder/CreateWorkflowFromTemplateController.php @@ -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; } diff --git a/mailpoet/lib/Automation/Engine/Builder/DuplicateWorkflowController.php b/mailpoet/lib/Automation/Engine/Builder/DuplicateWorkflowController.php index b02a65c897..3dd14571f5 100644 --- a/mailpoet/lib/Automation/Engine/Builder/DuplicateWorkflowController.php +++ b/mailpoet/lib/Automation/Engine/Builder/DuplicateWorkflowController.php @@ -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) { diff --git a/mailpoet/lib/Automation/Engine/Exceptions.php b/mailpoet/lib/Automation/Engine/Exceptions.php index a312ef0ecd..7478cfb52e 100644 --- a/mailpoet/lib/Automation/Engine/Exceptions.php +++ b/mailpoet/lib/Automation/Engine/Exceptions.php @@ -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)); } } diff --git a/mailpoet/lib/Automation/Engine/Validation/WorkflowGraph/WorkflowWalker.php b/mailpoet/lib/Automation/Engine/Validation/WorkflowGraph/WorkflowWalker.php index 3bdcb553f5..96ec1b5358 100644 --- a/mailpoet/lib/Automation/Engine/Validation/WorkflowGraph/WorkflowWalker.php +++ b/mailpoet/lib/Automation/Engine/Validation/WorkflowGraph/WorkflowWalker.php @@ -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) { diff --git a/mailpoet/lib/Automation/Engine/Validation/WorkflowRules/AtLeastOneTriggerRule.php b/mailpoet/lib/Automation/Engine/Validation/WorkflowRules/AtLeastOneTriggerRule.php index 3d02fbf617..9aba6f21b8 100644 --- a/mailpoet/lib/Automation/Engine/Validation/WorkflowRules/AtLeastOneTriggerRule.php +++ b/mailpoet/lib/Automation/Engine/Validation/WorkflowRules/AtLeastOneTriggerRule.php @@ -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); } } diff --git a/mailpoet/lib/Automation/Engine/Validation/WorkflowRules/NoCycleRule.php b/mailpoet/lib/Automation/Engine/Validation/WorkflowRules/NoCycleRule.php index a26f9c4ff5..58af60f511 100644 --- a/mailpoet/lib/Automation/Engine/Validation/WorkflowRules/NoCycleRule.php +++ b/mailpoet/lib/Automation/Engine/Validation/WorkflowRules/NoCycleRule.php @@ -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); } } } diff --git a/mailpoet/lib/Automation/Engine/Validation/WorkflowRules/NoJoinRule.php b/mailpoet/lib/Automation/Engine/Validation/WorkflowRules/NoJoinRule.php index bdba9cd2ca..89ca1804a0 100644 --- a/mailpoet/lib/Automation/Engine/Validation/WorkflowRules/NoJoinRule.php +++ b/mailpoet/lib/Automation/Engine/Validation/WorkflowRules/NoJoinRule.php @@ -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); } } } diff --git a/mailpoet/lib/Automation/Engine/Validation/WorkflowRules/NoSplitRule.php b/mailpoet/lib/Automation/Engine/Validation/WorkflowRules/NoSplitRule.php index 308757e20c..279cc82cb3 100644 --- a/mailpoet/lib/Automation/Engine/Validation/WorkflowRules/NoSplitRule.php +++ b/mailpoet/lib/Automation/Engine/Validation/WorkflowRules/NoSplitRule.php @@ -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); } } diff --git a/mailpoet/lib/Automation/Engine/Validation/WorkflowRules/NoUnreachableStepsRule.php b/mailpoet/lib/Automation/Engine/Validation/WorkflowRules/NoUnreachableStepsRule.php index 8016502865..2f35a1a3e8 100644 --- a/mailpoet/lib/Automation/Engine/Validation/WorkflowRules/NoUnreachableStepsRule.php +++ b/mailpoet/lib/Automation/Engine/Validation/WorkflowRules/NoUnreachableStepsRule.php @@ -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); } } } diff --git a/mailpoet/lib/Automation/Engine/Validation/WorkflowRules/TriggersUnderRootRule.php b/mailpoet/lib/Automation/Engine/Validation/WorkflowRules/TriggersUnderRootRule.php index e3fa66af8a..f4d6264887 100644 --- a/mailpoet/lib/Automation/Engine/Validation/WorkflowRules/TriggersUnderRootRule.php +++ b/mailpoet/lib/Automation/Engine/Validation/WorkflowRules/TriggersUnderRootRule.php @@ -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); } } } diff --git a/mailpoet/tests/integration/Automation/Engine/Control/StepHandlerTest.php b/mailpoet/tests/integration/Automation/Engine/Control/StepHandlerTest.php index c15e3d164f..4a45f03364 100644 --- a/mailpoet/tests/integration/Automation/Engine/Control/StepHandlerTest.php +++ b/mailpoet/tests/integration/Automation/Engine/Control/StepHandlerTest.php @@ -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); diff --git a/mailpoet/tests/integration/Automation/Engine/Storage/WorkflowStorageTest.php b/mailpoet/tests/integration/Automation/Engine/Storage/WorkflowStorageTest.php index bbd38955ee..fcd68c6703 100644 --- a/mailpoet/tests/integration/Automation/Engine/Storage/WorkflowStorageTest.php +++ b/mailpoet/tests/integration/Automation/Engine/Storage/WorkflowStorageTest.php @@ -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; } diff --git a/mailpoet/tests/integration/REST/Automation/Workflows/WorkflowsDeleteEndpointTest.php b/mailpoet/tests/integration/REST/Automation/Workflows/WorkflowsDeleteEndpointTest.php index 619fcbb8d1..21ffe5f476 100644 --- a/mailpoet/tests/integration/REST/Automation/Workflows/WorkflowsDeleteEndpointTest.php +++ b/mailpoet/tests/integration/REST/Automation/Workflows/WorkflowsDeleteEndpointTest.php @@ -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); diff --git a/mailpoet/tests/unit/Automation/Engine/Validation/WorkflowGraph/WorkflowWalkerTest.php b/mailpoet/tests/unit/Automation/Engine/Validation/WorkflowGraph/WorkflowWalkerTest.php index a2f83225c6..512148763d 100644 --- a/mailpoet/tests/unit/Automation/Engine/Validation/WorkflowGraph/WorkflowWalkerTest.php +++ b/mailpoet/tests/unit/Automation/Engine/Validation/WorkflowGraph/WorkflowWalkerTest.php @@ -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); } diff --git a/mailpoet/tests/unit/Automation/Engine/Validation/WorkflowRules/AtLeastOnTriggerTest.php b/mailpoet/tests/unit/Automation/Engine/Validation/WorkflowRules/AtLeastOnTriggerTest.php index 2589d66f4a..cb3d78bb29 100644 --- a/mailpoet/tests/unit/Automation/Engine/Validation/WorkflowRules/AtLeastOnTriggerTest.php +++ b/mailpoet/tests/unit/Automation/Engine/Validation/WorkflowRules/AtLeastOnTriggerTest.php @@ -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()]); } } diff --git a/mailpoet/tests/unit/Automation/Engine/Validation/WorkflowRules/ConsistentStepMapRuleTest.php b/mailpoet/tests/unit/Automation/Engine/Validation/WorkflowRules/ConsistentStepMapRuleTest.php index cc156fd7f4..4cc65ae65c 100644 --- a/mailpoet/tests/unit/Automation/Engine/Validation/WorkflowRules/ConsistentStepMapRuleTest.php +++ b/mailpoet/tests/unit/Automation/Engine/Validation/WorkflowRules/ConsistentStepMapRuleTest.php @@ -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()]); } diff --git a/mailpoet/tests/unit/Automation/Engine/Validation/WorkflowRules/NoCycleRuleTest.php b/mailpoet/tests/unit/Automation/Engine/Validation/WorkflowRules/NoCycleRuleTest.php index 082c2899e8..12a4cb07b3 100644 --- a/mailpoet/tests/unit/Automation/Engine/Validation/WorkflowRules/NoCycleRuleTest.php +++ b/mailpoet/tests/unit/Automation/Engine/Validation/WorkflowRules/NoCycleRuleTest.php @@ -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()]); } diff --git a/mailpoet/tests/unit/Automation/Engine/Validation/WorkflowRules/NoDuplicateEdgesTest.php b/mailpoet/tests/unit/Automation/Engine/Validation/WorkflowRules/NoDuplicateEdgesTest.php index 40fc44c657..b8f64d649a 100644 --- a/mailpoet/tests/unit/Automation/Engine/Validation/WorkflowRules/NoDuplicateEdgesTest.php +++ b/mailpoet/tests/unit/Automation/Engine/Validation/WorkflowRules/NoDuplicateEdgesTest.php @@ -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()]); } diff --git a/mailpoet/tests/unit/Automation/Engine/Validation/WorkflowRules/NoJoinRuleTest.php b/mailpoet/tests/unit/Automation/Engine/Validation/WorkflowRules/NoJoinRuleTest.php index c5e9658861..107980aa17 100644 --- a/mailpoet/tests/unit/Automation/Engine/Validation/WorkflowRules/NoJoinRuleTest.php +++ b/mailpoet/tests/unit/Automation/Engine/Validation/WorkflowRules/NoJoinRuleTest.php @@ -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()]); } diff --git a/mailpoet/tests/unit/Automation/Engine/Validation/WorkflowRules/NoSplitRuleTest.php b/mailpoet/tests/unit/Automation/Engine/Validation/WorkflowRules/NoSplitRuleTest.php index a2abae42f7..a182fd98d3 100644 --- a/mailpoet/tests/unit/Automation/Engine/Validation/WorkflowRules/NoSplitRuleTest.php +++ b/mailpoet/tests/unit/Automation/Engine/Validation/WorkflowRules/NoSplitRuleTest.php @@ -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()]); } diff --git a/mailpoet/tests/unit/Automation/Engine/Validation/WorkflowRules/NoUnreachableStepsRuleTest.php b/mailpoet/tests/unit/Automation/Engine/Validation/WorkflowRules/NoUnreachableStepsRuleTest.php index 439573ba51..5880ab427c 100644 --- a/mailpoet/tests/unit/Automation/Engine/Validation/WorkflowRules/NoUnreachableStepsRuleTest.php +++ b/mailpoet/tests/unit/Automation/Engine/Validation/WorkflowRules/NoUnreachableStepsRuleTest.php @@ -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()]); } diff --git a/mailpoet/tests/unit/Automation/Engine/Validation/WorkflowRules/TriggerNeedsNextStepsRuleTest.php b/mailpoet/tests/unit/Automation/Engine/Validation/WorkflowRules/TriggerNeedsNextStepsRuleTest.php index a02fe6aabe..faa859a11a 100644 --- a/mailpoet/tests/unit/Automation/Engine/Validation/WorkflowRules/TriggerNeedsNextStepsRuleTest.php +++ b/mailpoet/tests/unit/Automation/Engine/Validation/WorkflowRules/TriggerNeedsNextStepsRuleTest.php @@ -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()]); } } diff --git a/mailpoet/tests/unit/Automation/Engine/Validation/WorkflowRules/TriggersUnderRootRuleTest.php b/mailpoet/tests/unit/Automation/Engine/Validation/WorkflowRules/TriggersUnderRootRuleTest.php index 467255d018..d26966e378 100644 --- a/mailpoet/tests/unit/Automation/Engine/Validation/WorkflowRules/TriggersUnderRootRuleTest.php +++ b/mailpoet/tests/unit/Automation/Engine/Validation/WorkflowRules/TriggersUnderRootRuleTest.php @@ -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()]); }