refactor(plugin-workflow): add new status for 'retry needed' scenarios (#2765)

This commit is contained in:
Junyi 2023-10-09 10:49:40 +08:00 committed by GitHub
parent 67f01db779
commit 9bac4f54f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 0 deletions

View File

@ -7,6 +7,7 @@ import {
ExclamationOutlined,
HourglassOutlined,
LoadingOutlined,
RedoOutlined,
} from '@ant-design/icons';
import { NAMESPACE } from './locale';
@ -19,6 +20,7 @@ export const EXECUTION_STATUS = {
ABORTED: -3,
CANCELED: -4,
REJECTED: -5,
RETRY_NEEDED: -6,
};
export const ExecutionStatusOptions = [
@ -78,6 +80,13 @@ export const ExecutionStatusOptions = [
icon: <MinusOutlined />,
description: `{{t("Rejected from a manual node.", { ns: "${NAMESPACE}" })}}`,
},
{
value: EXECUTION_STATUS.RETRY_NEEDED,
label: `{{t("Retry needed", { ns: "${NAMESPACE}" })}}`,
color: 'volcano',
icon: <RedoOutlined />,
description: `{{t("General failed but should do another try.", { ns: "${NAMESPACE}" })}}`,
},
];
export const ExecutionStatusOptionsMap = ExecutionStatusOptions.reduce(
@ -93,6 +102,7 @@ export const JOB_STATUS = {
ABORTED: -3,
CANCELED: -4,
REJECTED: -5,
RETRY_NEEDED: -6,
};
export const JobStatusOptions = [
@ -133,6 +143,12 @@ export const JobStatusOptions = [
color: 'volcano',
icon: <MinusOutlined />,
},
{
value: JOB_STATUS.RETRY_NEEDED,
label: `{{t("Retry needed", { ns: "${NAMESPACE}" })}}`,
color: 'volcano',
icon: <RedoOutlined />,
},
];
export const JobStatusOptionsMap = JobStatusOptions.reduce(

View File

@ -1,3 +1,4 @@
export * from './constants';
export * from './Branch';
export * from './FlowContext';
export * from './nodes';

View File

@ -20,6 +20,7 @@ export default class Processor {
[JOB_STATUS.ABORTED]: EXECUTION_STATUS.ABORTED,
[JOB_STATUS.CANCELED]: EXECUTION_STATUS.CANCELED,
[JOB_STATUS.REJECTED]: EXECUTION_STATUS.REJECTED,
[JOB_STATUS.RETRY_NEEDED]: EXECUTION_STATUS.RETRY_NEEDED,
};
logger: Logger;

View File

@ -7,6 +7,7 @@ export const EXECUTION_STATUS = {
ABORTED: -3,
CANCELED: -4,
REJECTED: -5,
RETRY_NEEDED: -6,
};
export const JOB_STATUS = {
@ -17,6 +18,7 @@ export const JOB_STATUS = {
ABORTED: -3,
CANCELED: -4,
REJECTED: -5,
RETRY_NEEDED: -6,
};
export const BRANCH_INDEX = {