Update user friendly errors for translations (#15000)
Force msg typing instead of string for user friendly errors
This commit is contained in:
+2
-2
@@ -1,4 +1,4 @@
|
||||
import { t } from '@lingui/core/macro';
|
||||
import { msg } from '@lingui/core/macro';
|
||||
|
||||
import {
|
||||
WorkflowQueryValidationException,
|
||||
@@ -14,7 +14,7 @@ export const assertWorkflowStatusesNotSet = (
|
||||
'Statuses cannot be set manually.',
|
||||
WorkflowQueryValidationExceptionCode.FORBIDDEN,
|
||||
{
|
||||
userFriendlyMessage: t`Statuses cannot be set manually.`,
|
||||
userFriendlyMessage: msg`Statuses cannot be set manually.`,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
import { t } from '@lingui/core/macro';
|
||||
import { msg } from '@lingui/core/macro';
|
||||
|
||||
import { type WorkflowVersionWorkspaceEntity } from 'src/modules/workflow/common/standard-objects/workflow-version.workspace-entity';
|
||||
import { type WorkflowAction } from 'src/modules/workflow/workflow-executor/workflow-actions/types/workflow-action.type';
|
||||
@@ -17,7 +17,7 @@ export function assertWorkflowVersionHasSteps(
|
||||
'Workflow version does not contain at least one step',
|
||||
WorkflowTriggerExceptionCode.INVALID_WORKFLOW_VERSION,
|
||||
{
|
||||
userFriendlyMessage: t`Workflow version does not contain at least one step`,
|
||||
userFriendlyMessage: msg`Workflow version does not contain at least one step`,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
import { t } from '@lingui/core/macro';
|
||||
import { msg } from '@lingui/core/macro';
|
||||
|
||||
import {
|
||||
WorkflowQueryValidationException,
|
||||
@@ -17,7 +17,7 @@ export const assertWorkflowVersionIsDraft = (
|
||||
'Workflow version is not in draft status',
|
||||
WorkflowQueryValidationExceptionCode.FORBIDDEN,
|
||||
{
|
||||
userFriendlyMessage: t`Workflow version is not in draft status`,
|
||||
userFriendlyMessage: msg`Workflow version is not in draft status`,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
import { t } from '@lingui/core/macro';
|
||||
import { msg } from '@lingui/core/macro';
|
||||
|
||||
import { type WorkflowVersionWorkspaceEntity } from 'src/modules/workflow/common/standard-objects/workflow-version.workspace-entity';
|
||||
import {
|
||||
@@ -20,7 +20,7 @@ export function assertWorkflowVersionTriggerIsDefined(
|
||||
'Workflow version does not contain trigger',
|
||||
WorkflowTriggerExceptionCode.INVALID_WORKFLOW_VERSION,
|
||||
{
|
||||
userFriendlyMessage: t`Workflow version does not contain trigger`,
|
||||
userFriendlyMessage: msg`Workflow version does not contain trigger`,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
|
||||
import { t } from '@lingui/core/macro';
|
||||
import { msg } from '@lingui/core/macro';
|
||||
import { IsNull, Not } from 'typeorm';
|
||||
|
||||
import {
|
||||
@@ -40,7 +40,7 @@ export class WorkflowVersionValidationWorkspaceService {
|
||||
'Cannot create workflow version with status other than draft',
|
||||
WorkflowQueryValidationExceptionCode.FORBIDDEN,
|
||||
{
|
||||
userFriendlyMessage: t`Cannot create workflow version with status other than draft`,
|
||||
userFriendlyMessage: msg`Cannot create workflow version with status other than draft`,
|
||||
},
|
||||
);
|
||||
}
|
||||
@@ -67,7 +67,7 @@ export class WorkflowVersionValidationWorkspaceService {
|
||||
'Cannot create multiple draft versions for the same workflow',
|
||||
WorkflowQueryValidationExceptionCode.FORBIDDEN,
|
||||
{
|
||||
userFriendlyMessage: t`Cannot create multiple draft versions for the same workflow`,
|
||||
userFriendlyMessage: msg`Cannot create multiple draft versions for the same workflow`,
|
||||
},
|
||||
);
|
||||
}
|
||||
@@ -97,7 +97,7 @@ export class WorkflowVersionValidationWorkspaceService {
|
||||
'Cannot update workflow version status manually',
|
||||
WorkflowQueryValidationExceptionCode.FORBIDDEN,
|
||||
{
|
||||
userFriendlyMessage: t`Cannot update workflow version status manually`,
|
||||
userFriendlyMessage: msg`Cannot update workflow version status manually`,
|
||||
},
|
||||
);
|
||||
}
|
||||
@@ -143,7 +143,7 @@ export class WorkflowVersionValidationWorkspaceService {
|
||||
'The initial version of a workflow can not be deleted',
|
||||
WorkflowQueryValidationExceptionCode.FORBIDDEN,
|
||||
{
|
||||
userFriendlyMessage: t`The initial version of a workflow can not be deleted`,
|
||||
userFriendlyMessage: msg`The initial version of a workflow can not be deleted`,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user