mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 05:36:05 +00:00
refactor(plugin-workflow): adjust canvas style
This commit is contained in:
parent
8370ba2bc4
commit
590c0aa644
@ -10,6 +10,7 @@
|
|||||||
import { useForm } from '@formily/react';
|
import { useForm } from '@formily/react';
|
||||||
import { Cascader } from 'antd';
|
import { Cascader } from 'antd';
|
||||||
import React, { useCallback, useEffect, useState } from 'react';
|
import React, { useCallback, useEffect, useState } from 'react';
|
||||||
|
import { BarChartOutlined } from '@ant-design/icons';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
SchemaComponentContext,
|
SchemaComponentContext,
|
||||||
@ -169,6 +170,7 @@ export default class extends Instruction {
|
|||||||
type = 'aggregate';
|
type = 'aggregate';
|
||||||
group = 'collection';
|
group = 'collection';
|
||||||
description = `{{t("Counting, summing, finding maximum, minimum, and average values for multiple records of a collection or associated data of a record.", { ns: "${NAMESPACE}" })}}`;
|
description = `{{t("Counting, summing, finding maximum, minimum, and average values for multiple records of a collection or associated data of a record.", { ns: "${NAMESPACE}" })}}`;
|
||||||
|
icon = (<BarChartOutlined style={{}} />);
|
||||||
fieldset = {
|
fieldset = {
|
||||||
aggregator: {
|
aggregator: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
|
@ -9,8 +9,10 @@
|
|||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { InputNumber, Select } from 'antd';
|
import { InputNumber, Select } from 'antd';
|
||||||
import { css, useCompile, usePlugin } from '@nocobase/client';
|
import { HourglassOutlined } from '@ant-design/icons';
|
||||||
import WorkflowPlugin, { Instruction, JOB_STATUS } from '@nocobase/plugin-workflow/client';
|
|
||||||
|
import { css, useCompile } from '@nocobase/client';
|
||||||
|
import { Instruction, JOB_STATUS } from '@nocobase/plugin-workflow/client';
|
||||||
|
|
||||||
import { NAMESPACE } from '../locale';
|
import { NAMESPACE } from '../locale';
|
||||||
|
|
||||||
@ -68,6 +70,7 @@ export default class extends Instruction {
|
|||||||
type = 'delay';
|
type = 'delay';
|
||||||
group = 'control';
|
group = 'control';
|
||||||
description = `{{t("Delay a period of time and then continue or exit the process. Can be used to set wait or timeout times in parallel branches.", { ns: "${NAMESPACE}" })}}`;
|
description = `{{t("Delay a period of time and then continue or exit the process. Can be used to set wait or timeout times in parallel branches.", { ns: "${NAMESPACE}" })}}`;
|
||||||
|
icon = (<HourglassOutlined style={{}} />);
|
||||||
fieldset = {
|
fieldset = {
|
||||||
duration: {
|
duration: {
|
||||||
type: 'number',
|
type: 'number',
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import { FunctionOutlined } from '@ant-design/icons';
|
||||||
|
|
||||||
import { SchemaInitializerItemType, Variable, useCollectionManager_deprecated } from '@nocobase/client';
|
import { SchemaInitializerItemType, Variable, useCollectionManager_deprecated } from '@nocobase/client';
|
||||||
import {
|
import {
|
||||||
@ -47,6 +48,7 @@ export default class extends Instruction {
|
|||||||
type = 'dynamic-calculation';
|
type = 'dynamic-calculation';
|
||||||
group = 'calculation';
|
group = 'calculation';
|
||||||
description = `{{t("Calculate an expression based on a calculation engine and obtain a value as the result. Variables in the upstream nodes can be used in the expression. The expression is dynamic one from an expression collections.", { ns: "${NAMESPACE}" })}}`;
|
description = `{{t("Calculate an expression based on a calculation engine and obtain a value as the result. Variables in the upstream nodes can be used in the expression. The expression is dynamic one from an expression collections.", { ns: "${NAMESPACE}" })}}`;
|
||||||
|
icon = (<FunctionOutlined />);
|
||||||
fieldset = {
|
fieldset = {
|
||||||
expression: {
|
expression: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import React, { useCallback } from 'react';
|
import React, { useCallback } from 'react';
|
||||||
import { ArrowUpOutlined } from '@ant-design/icons';
|
import { ArrowUpOutlined, RollbackOutlined } from '@ant-design/icons';
|
||||||
import { Card, Checkbox } from 'antd';
|
import { Card, Checkbox } from 'antd';
|
||||||
import { FormLayout, FormItem } from '@formily/antd-v5';
|
import { FormLayout, FormItem } from '@formily/antd-v5';
|
||||||
import { useForm } from '@formily/react';
|
import { useForm } from '@formily/react';
|
||||||
@ -28,7 +28,6 @@ import {
|
|||||||
Instruction,
|
Instruction,
|
||||||
RadioWithTooltip,
|
RadioWithTooltip,
|
||||||
renderEngineReference,
|
renderEngineReference,
|
||||||
RadioWithTooltipOption,
|
|
||||||
CalculationConfig,
|
CalculationConfig,
|
||||||
useWorkflowVariableOptions,
|
useWorkflowVariableOptions,
|
||||||
UseVariableOptions,
|
UseVariableOptions,
|
||||||
@ -246,6 +245,7 @@ export default class extends Instruction {
|
|||||||
type = 'loop';
|
type = 'loop';
|
||||||
group = 'control';
|
group = 'control';
|
||||||
description = `{{t("By using a loop node, you can perform the same operation on multiple sets of data. The source of these sets can be either multiple records from a query node or multiple associated records of a single record. Loop node can also be used for iterating a certain number of times or for looping through each character in a string. However, excessive looping may cause performance issues, so use with caution.", { ns: "${NAMESPACE}" })}}`;
|
description = `{{t("By using a loop node, you can perform the same operation on multiple sets of data. The source of these sets can be either multiple records from a query node or multiple associated records of a single record. Loop node can also be used for iterating a certain number of times or for looping through each character in a string. However, excessive looping may cause performance issues, so use with caution.", { ns: "${NAMESPACE}" })}}`;
|
||||||
|
icon = (<RollbackOutlined style={{}} />);
|
||||||
fieldset = {
|
fieldset = {
|
||||||
target: {
|
target: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
@ -381,7 +381,7 @@ export default class extends Instruction {
|
|||||||
className={cx(
|
className={cx(
|
||||||
styles.branchBlockClass,
|
styles.branchBlockClass,
|
||||||
css`
|
css`
|
||||||
padding-left: 20em;
|
padding-left: 16em;
|
||||||
`,
|
`,
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
@ -389,7 +389,7 @@ export default class extends Instruction {
|
|||||||
|
|
||||||
<div className={styles.branchClass}>
|
<div className={styles.branchClass}>
|
||||||
<div className="workflow-branch-lines" />
|
<div className="workflow-branch-lines" />
|
||||||
<div className={cx(styles.addButtonClass, styles.loopLineClass)}>
|
<div className={styles.loopLineClass}>
|
||||||
<ArrowUpOutlined />
|
<ArrowUpOutlined />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -7,6 +7,8 @@
|
|||||||
* For more information, please refer to: https://www.nocobase.com/agreement.
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import React from 'react';
|
||||||
|
import { MailOutlined } from '@ant-design/icons';
|
||||||
import { ArrayItems } from '@formily/antd-v5';
|
import { ArrayItems } from '@formily/antd-v5';
|
||||||
|
|
||||||
import { SchemaComponentContext, css } from '@nocobase/client';
|
import { SchemaComponentContext, css } from '@nocobase/client';
|
||||||
@ -32,6 +34,7 @@ export default class extends Instruction {
|
|||||||
type = 'mailer';
|
type = 'mailer';
|
||||||
group = 'extended';
|
group = 'extended';
|
||||||
description = `{{t("Send email. You can use the variables in the upstream nodes as receivers, subject and content of the email.", { ns: "${NAMESPACE}" })}}`;
|
description = `{{t("Send email. You can use the variables in the upstream nodes as receivers, subject and content of the email.", { ns: "${NAMESPACE}" })}}`;
|
||||||
|
icon = (<MailOutlined style={{}} />);
|
||||||
fieldset = {
|
fieldset = {
|
||||||
provider: {
|
provider: {
|
||||||
type: 'object',
|
type: 'object',
|
||||||
|
@ -7,6 +7,9 @@
|
|||||||
* For more information, please refer to: https://www.nocobase.com/agreement.
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import React from 'react';
|
||||||
|
import { SolutionOutlined } from '@ant-design/icons';
|
||||||
|
|
||||||
import { SchemaInitializerItemType, useCollectionManager_deprecated, useCompile, usePlugin } from '@nocobase/client';
|
import { SchemaInitializerItemType, useCollectionManager_deprecated, useCompile, usePlugin } from '@nocobase/client';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@ -75,6 +78,7 @@ export default class extends Instruction {
|
|||||||
type = 'manual';
|
type = 'manual';
|
||||||
group = 'manual';
|
group = 'manual';
|
||||||
description = `{{t("Could be used for manually submitting data, and determine whether to continue or exit. Workflow will generate a todo item for assigned user when it reaches a manual node, and continue processing after user submits the form.", { ns: "${NAMESPACE}" })}}`;
|
description = `{{t("Could be used for manually submitting data, and determine whether to continue or exit. Workflow will generate a todo item for assigned user when it reaches a manual node, and continue processing after user submits the form.", { ns: "${NAMESPACE}" })}}`;
|
||||||
|
icon = (<SolutionOutlined />);
|
||||||
fieldset = {
|
fieldset = {
|
||||||
assignees: {
|
assignees: {
|
||||||
type: 'array',
|
type: 'array',
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
* For more information, please refer to: https://www.nocobase.com/agreement.
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
||||||
*/
|
*/
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import { NotificationOutlined } from '@ant-design/icons';
|
||||||
import { Instruction, useWorkflowVariableOptions } from '@nocobase/plugin-workflow/client';
|
import { Instruction, useWorkflowVariableOptions } from '@nocobase/plugin-workflow/client';
|
||||||
import { MessageConfigForm } from '@nocobase/plugin-notification-manager/client';
|
import { MessageConfigForm } from '@nocobase/plugin-notification-manager/client';
|
||||||
|
|
||||||
@ -22,6 +23,7 @@ export default class extends Instruction {
|
|||||||
type = 'notification';
|
type = 'notification';
|
||||||
group = 'extended';
|
group = 'extended';
|
||||||
description = `{{t("Send notification. You can use the variables in the upstream nodes as content and ohter config.", { ns: "${NAMESPACE}" })}}`;
|
description = `{{t("Send notification. You can use the variables in the upstream nodes as content and ohter config.", { ns: "${NAMESPACE}" })}}`;
|
||||||
|
icon = (<NotificationOutlined />);
|
||||||
fieldset = {
|
fieldset = {
|
||||||
message: {
|
message: {
|
||||||
type: 'void',
|
type: 'void',
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { Button, Tooltip } from 'antd';
|
import { Button, Tooltip } from 'antd';
|
||||||
import { PlusOutlined } from '@ant-design/icons';
|
import { ApartmentOutlined, PlusOutlined } from '@ant-design/icons';
|
||||||
|
|
||||||
import { css } from '@nocobase/client';
|
import { css } from '@nocobase/client';
|
||||||
|
|
||||||
@ -30,6 +30,7 @@ export default class extends Instruction {
|
|||||||
type = 'parallel';
|
type = 'parallel';
|
||||||
group = 'control';
|
group = 'control';
|
||||||
description = `{{t("Run multiple branch processes in parallel.", { ns: "${NAMESPACE}" })}}`;
|
description = `{{t("Run multiple branch processes in parallel.", { ns: "${NAMESPACE}" })}}`;
|
||||||
|
icon = (<ApartmentOutlined style={{}} />);
|
||||||
fieldset = {
|
fieldset = {
|
||||||
mode: {
|
mode: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
|
@ -11,7 +11,9 @@ import { onFieldValueChange } from '@formily/core';
|
|||||||
import { uid } from '@formily/shared';
|
import { uid } from '@formily/shared';
|
||||||
import { useForm, useField, useFormEffects } from '@formily/react';
|
import { useForm, useField, useFormEffects } from '@formily/react';
|
||||||
import { ArrayItems } from '@formily/antd-v5';
|
import { ArrayItems } from '@formily/antd-v5';
|
||||||
|
import { GlobalOutlined } from '@ant-design/icons';
|
||||||
|
|
||||||
|
import { SchemaComponent, css } from '@nocobase/client';
|
||||||
import {
|
import {
|
||||||
Instruction,
|
Instruction,
|
||||||
WorkflowVariableJSON,
|
WorkflowVariableJSON,
|
||||||
@ -21,7 +23,6 @@ import {
|
|||||||
} from '@nocobase/plugin-workflow/client';
|
} from '@nocobase/plugin-workflow/client';
|
||||||
|
|
||||||
import { NAMESPACE, useLang } from '../locale';
|
import { NAMESPACE, useLang } from '../locale';
|
||||||
import { SchemaComponent, css } from '@nocobase/client';
|
|
||||||
|
|
||||||
const BodySchema = {
|
const BodySchema = {
|
||||||
'application/json': {
|
'application/json': {
|
||||||
@ -155,6 +156,7 @@ export default class extends Instruction {
|
|||||||
type = 'request';
|
type = 'request';
|
||||||
group = 'extended';
|
group = 'extended';
|
||||||
description = `{{t("Send HTTP request to a URL. You can use the variables in the upstream nodes as request headers, parameters and request body.", { ns: "${NAMESPACE}" })}}`;
|
description = `{{t("Send HTTP request to a URL. You can use the variables in the upstream nodes as request headers, parameters and request body.", { ns: "${NAMESPACE}" })}}`;
|
||||||
|
icon = (<GlobalOutlined />);
|
||||||
fieldset = {
|
fieldset = {
|
||||||
method: {
|
method: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
|
@ -12,6 +12,7 @@ import { DEFAULT_DATA_SOURCE_KEY, css } from '@nocobase/client';
|
|||||||
import { Instruction, WorkflowVariableRawTextArea, defaultFieldNames } from '@nocobase/plugin-workflow/client';
|
import { Instruction, WorkflowVariableRawTextArea, defaultFieldNames } from '@nocobase/plugin-workflow/client';
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import { ConsoleSqlOutlined } from '@ant-design/icons';
|
||||||
import { Trans } from 'react-i18next';
|
import { Trans } from 'react-i18next';
|
||||||
import { NAMESPACE } from '../locale';
|
import { NAMESPACE } from '../locale';
|
||||||
|
|
||||||
@ -20,6 +21,7 @@ export default class extends Instruction {
|
|||||||
type = 'sql';
|
type = 'sql';
|
||||||
group = 'collection';
|
group = 'collection';
|
||||||
description = `{{t("Execute a SQL statement in database.", { ns: "${NAMESPACE}" })}}`;
|
description = `{{t("Execute a SQL statement in database.", { ns: "${NAMESPACE}" })}}`;
|
||||||
|
icon = (<ConsoleSqlOutlined style={{}} />);
|
||||||
fieldset = {
|
fieldset = {
|
||||||
dataSource: {
|
dataSource: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
|
@ -14,6 +14,7 @@ import { observer, useForm } from '@formily/react';
|
|||||||
import {
|
import {
|
||||||
ActionContextProvider,
|
ActionContextProvider,
|
||||||
css,
|
css,
|
||||||
|
cx,
|
||||||
SchemaComponent,
|
SchemaComponent,
|
||||||
useActionContext,
|
useActionContext,
|
||||||
useAPIClient,
|
useAPIClient,
|
||||||
@ -68,6 +69,7 @@ export function AddButton(props: AddButtonProps) {
|
|||||||
'aria-label': item.type,
|
'aria-label': item.type,
|
||||||
key: item.type,
|
key: item.type,
|
||||||
label: item.title,
|
label: item.title,
|
||||||
|
icon: item.icon,
|
||||||
})),
|
})),
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
@ -89,7 +91,7 @@ export function AddButton(props: AddButtonProps) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.addButtonClass}>
|
<div className={cx(styles.addButtonClass, 'workflow-add-node-button')}>
|
||||||
<Dropdown
|
<Dropdown
|
||||||
menu={{
|
menu={{
|
||||||
items: groups,
|
items: groups,
|
||||||
@ -101,6 +103,10 @@ export function AddButton(props: AddButtonProps) {
|
|||||||
max-height: 30em;
|
max-height: 30em;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
}
|
}
|
||||||
|
.ant-dropdown-menu-item-group-list {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 1fr 1fr;
|
||||||
|
}
|
||||||
`}
|
`}
|
||||||
>
|
>
|
||||||
<Button
|
<Button
|
||||||
|
@ -43,8 +43,8 @@ export function Branch({
|
|||||||
<div className={cx('workflow-branch', styles.branchClass, className)}>
|
<div className={cx('workflow-branch', styles.branchClass, className)}>
|
||||||
<div className="workflow-branch-lines" />
|
<div className="workflow-branch-lines" />
|
||||||
{controller}
|
{controller}
|
||||||
<AddButton aria-label={getAriaLabel()} upstream={from} branchIndex={branchIndex} />
|
|
||||||
<div className="workflow-node-list">
|
<div className="workflow-node-list">
|
||||||
|
<AddButton aria-label={getAriaLabel()} upstream={from} branchIndex={branchIndex} />
|
||||||
{list.map((item) => (
|
{list.map((item) => (
|
||||||
<Node data={item} key={item.id} />
|
<Node data={item} key={item.id} />
|
||||||
))}
|
))}
|
||||||
|
@ -7,6 +7,9 @@
|
|||||||
* For more information, please refer to: https://www.nocobase.com/agreement.
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import React from 'react';
|
||||||
|
import { CalculatorOutlined } from '@ant-design/icons';
|
||||||
|
|
||||||
import { SchemaInitializerItemType } from '@nocobase/client';
|
import { SchemaInitializerItemType } from '@nocobase/client';
|
||||||
import { Evaluator, evaluators, getOptions } from '@nocobase/evaluators/client';
|
import { Evaluator, evaluators, getOptions } from '@nocobase/evaluators/client';
|
||||||
|
|
||||||
@ -22,6 +25,7 @@ export default class extends Instruction {
|
|||||||
type = 'calculation';
|
type = 'calculation';
|
||||||
group = 'calculation';
|
group = 'calculation';
|
||||||
description = `{{t("Calculate an expression based on a calculation engine and obtain a value as the result. Variables in the upstream nodes can be used in the expression.", { ns: "${NAMESPACE}" })}}`;
|
description = `{{t("Calculate an expression based on a calculation engine and obtain a value as the result. Variables in the upstream nodes can be used in the expression.", { ns: "${NAMESPACE}" })}}`;
|
||||||
|
icon = (<CalculatorOutlined style={{}} />);
|
||||||
fieldset = {
|
fieldset = {
|
||||||
engine: {
|
engine: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
|
@ -19,6 +19,7 @@ import { lang, NAMESPACE } from '../locale';
|
|||||||
import useStyles from '../style';
|
import useStyles from '../style';
|
||||||
import { useWorkflowVariableOptions, WorkflowVariableTextArea } from '../variable';
|
import { useWorkflowVariableOptions, WorkflowVariableTextArea } from '../variable';
|
||||||
import { CalculationConfig } from '../components/Calculation';
|
import { CalculationConfig } from '../components/Calculation';
|
||||||
|
import { QuestionCircleOutlined } from '@ant-design/icons';
|
||||||
|
|
||||||
const BRANCH_INDEX = {
|
const BRANCH_INDEX = {
|
||||||
DEFAULT: null,
|
DEFAULT: null,
|
||||||
@ -31,6 +32,7 @@ export default class extends Instruction {
|
|||||||
type = 'condition';
|
type = 'condition';
|
||||||
group = 'control';
|
group = 'control';
|
||||||
description = `{{t('Based on boolean result of the calculation to determine whether to "continue" or "exit" the process, or continue on different branches of "yes" and "no".', { ns: "${NAMESPACE}" })}}`;
|
description = `{{t('Based on boolean result of the calculation to determine whether to "continue" or "exit" the process, or continue on different branches of "yes" and "no".', { ns: "${NAMESPACE}" })}}`;
|
||||||
|
icon = (<QuestionCircleOutlined style={{}} />);
|
||||||
fieldset = {
|
fieldset = {
|
||||||
rejectOnFalse: {
|
rejectOnFalse: {
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
|
@ -7,6 +7,9 @@
|
|||||||
* For more information, please refer to: https://www.nocobase.com/agreement.
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import React from 'react';
|
||||||
|
import { FileAddOutlined } from '@ant-design/icons';
|
||||||
|
|
||||||
import { SchemaInitializerItemType, parseCollectionName, useCollectionDataSource, useCompile } from '@nocobase/client';
|
import { SchemaInitializerItemType, parseCollectionName, useCollectionDataSource, useCompile } from '@nocobase/client';
|
||||||
|
|
||||||
import { CollectionBlockInitializer } from '../components/CollectionBlockInitializer';
|
import { CollectionBlockInitializer } from '../components/CollectionBlockInitializer';
|
||||||
@ -52,6 +55,7 @@ export default class extends Instruction {
|
|||||||
type = 'create';
|
type = 'create';
|
||||||
group = 'collection';
|
group = 'collection';
|
||||||
description = `{{t("Add new record to a collection. You can use variables from upstream nodes to assign values to fields.", { ns: "${NAMESPACE}" })}}`;
|
description = `{{t("Add new record to a collection. You can use variables from upstream nodes to assign values to fields.", { ns: "${NAMESPACE}" })}}`;
|
||||||
|
icon = (<FileAddOutlined style={{}} />);
|
||||||
fieldset = {
|
fieldset = {
|
||||||
collection: {
|
collection: {
|
||||||
...collection,
|
...collection,
|
||||||
|
@ -7,6 +7,9 @@
|
|||||||
* For more information, please refer to: https://www.nocobase.com/agreement.
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import React from 'react';
|
||||||
|
import { DeleteOutlined } from '@ant-design/icons';
|
||||||
|
|
||||||
import { useCollectionDataSource } from '@nocobase/client';
|
import { useCollectionDataSource } from '@nocobase/client';
|
||||||
import { isValidFilter } from '@nocobase/utils/client';
|
import { isValidFilter } from '@nocobase/utils/client';
|
||||||
|
|
||||||
@ -20,6 +23,7 @@ export default class extends Instruction {
|
|||||||
type = 'destroy';
|
type = 'destroy';
|
||||||
group = 'collection';
|
group = 'collection';
|
||||||
description = `{{t("Delete records of a collection. Could use variables in workflow context as filter. All records match the filter will be deleted.", { ns: "${NAMESPACE}" })}}`;
|
description = `{{t("Delete records of a collection. Could use variables in workflow context as filter. All records match the filter will be deleted.", { ns: "${NAMESPACE}" })}}`;
|
||||||
|
icon = (<DeleteOutlined style={{}} />);
|
||||||
fieldset = {
|
fieldset = {
|
||||||
collection: {
|
collection: {
|
||||||
...collection,
|
...collection,
|
||||||
|
@ -7,6 +7,9 @@
|
|||||||
* For more information, please refer to: https://www.nocobase.com/agreement.
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import React from 'react';
|
||||||
|
import { StopOutlined } from '@ant-design/icons';
|
||||||
|
|
||||||
import { Instruction } from '.';
|
import { Instruction } from '.';
|
||||||
import { NAMESPACE } from '../locale';
|
import { NAMESPACE } from '../locale';
|
||||||
import { JOB_STATUS } from '../constants';
|
import { JOB_STATUS } from '../constants';
|
||||||
@ -16,6 +19,7 @@ export default class extends Instruction {
|
|||||||
type = 'end';
|
type = 'end';
|
||||||
group = 'control';
|
group = 'control';
|
||||||
description = `{{t("End the process immediately, with set status.", { ns: "${NAMESPACE}" })}}`;
|
description = `{{t("End the process immediately, with set status.", { ns: "${NAMESPACE}" })}}`;
|
||||||
|
icon = (<StopOutlined style={{}} />);
|
||||||
fieldset = {
|
fieldset = {
|
||||||
endStatus: {
|
endStatus: {
|
||||||
type: 'number',
|
type: 'number',
|
||||||
|
@ -60,6 +60,7 @@ export abstract class Instruction {
|
|||||||
type: string;
|
type: string;
|
||||||
group: string;
|
group: string;
|
||||||
description?: string;
|
description?: string;
|
||||||
|
icon?: JSX.Element;
|
||||||
/**
|
/**
|
||||||
* @deprecated migrate to `presetFieldset` instead
|
* @deprecated migrate to `presetFieldset` instead
|
||||||
*/
|
*/
|
||||||
@ -612,7 +613,7 @@ export function NodeDefaultView(props) {
|
|||||||
>
|
>
|
||||||
<div className={styles.nodeHeaderClass}>
|
<div className={styles.nodeHeaderClass}>
|
||||||
<div className={cx(styles.nodeMetaClass, 'workflow-node-meta')}>
|
<div className={cx(styles.nodeMetaClass, 'workflow-node-meta')}>
|
||||||
<Tag>{typeTitle}</Tag>
|
<Tag icon={instruction.icon}>{typeTitle}</Tag>
|
||||||
<span className="workflow-node-id">{data.id}</span>
|
<span className="workflow-node-id">{data.id}</span>
|
||||||
</div>
|
</div>
|
||||||
<div className="workflow-node-actions">
|
<div className="workflow-node-actions">
|
||||||
@ -648,15 +649,15 @@ export function NodeDefaultView(props) {
|
|||||||
type: 'void',
|
type: 'void',
|
||||||
properties: {
|
properties: {
|
||||||
...(instruction.view ? { view: instruction.view } : {}),
|
...(instruction.view ? { view: instruction.view } : {}),
|
||||||
button: {
|
// button: {
|
||||||
type: 'void',
|
// type: 'void',
|
||||||
'x-content': detailText,
|
// 'x-content': detailText,
|
||||||
'x-component': Button,
|
// 'x-component': Button,
|
||||||
'x-component-props': {
|
// 'x-component-props': {
|
||||||
type: 'link',
|
// type: 'link',
|
||||||
className: 'workflow-node-config-button',
|
// className: 'workflow-node-config-button',
|
||||||
},
|
// },
|
||||||
},
|
// },
|
||||||
[data.id]: {
|
[data.id]: {
|
||||||
type: 'void',
|
type: 'void',
|
||||||
title: (
|
title: (
|
||||||
|
@ -7,6 +7,8 @@
|
|||||||
* For more information, please refer to: https://www.nocobase.com/agreement.
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import React from 'react';
|
||||||
|
import { FileSearchOutlined } from '@ant-design/icons';
|
||||||
import { ArrayItems } from '@formily/antd-v5';
|
import { ArrayItems } from '@formily/antd-v5';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@ -62,6 +64,7 @@ export default class extends Instruction {
|
|||||||
type = 'query';
|
type = 'query';
|
||||||
group = 'collection';
|
group = 'collection';
|
||||||
description = `{{t("Query records from a collection. You can use variables from upstream nodes as query conditions.", { ns: "${NAMESPACE}" })}}`;
|
description = `{{t("Query records from a collection. You can use variables from upstream nodes as query conditions.", { ns: "${NAMESPACE}" })}}`;
|
||||||
|
icon = (<FileSearchOutlined style={{}} />);
|
||||||
fieldset = {
|
fieldset = {
|
||||||
collection: {
|
collection: {
|
||||||
...collection,
|
...collection,
|
||||||
|
@ -7,7 +7,8 @@
|
|||||||
* For more information, please refer to: https://www.nocobase.com/agreement.
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { uid } from '@formily/shared';
|
import React from 'react';
|
||||||
|
import { EditOutlined } from '@ant-design/icons';
|
||||||
|
|
||||||
import { useCollectionDataSource } from '@nocobase/client';
|
import { useCollectionDataSource } from '@nocobase/client';
|
||||||
import { isValidFilter } from '@nocobase/utils/client';
|
import { isValidFilter } from '@nocobase/utils/client';
|
||||||
@ -26,6 +27,7 @@ export default class extends Instruction {
|
|||||||
type = 'update';
|
type = 'update';
|
||||||
group = 'collection';
|
group = 'collection';
|
||||||
description = `{{t("Update records of a collection. You can use variables from upstream nodes as query conditions and field values.", { ns: "${NAMESPACE}" })}}`;
|
description = `{{t("Update records of a collection. You can use variables from upstream nodes as query conditions and field values.", { ns: "${NAMESPACE}" })}}`;
|
||||||
|
icon = (<EditOutlined style={{}} />);
|
||||||
fieldset = {
|
fieldset = {
|
||||||
collection: {
|
collection: {
|
||||||
...collection,
|
...collection,
|
||||||
|
@ -150,11 +150,22 @@ const useStyles = createStyles(({ css, token }) => {
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
position: relative;
|
position: relative;
|
||||||
min-width: 20em;
|
min-width: 16em;
|
||||||
padding: 0 2em;
|
padding: 0 2em;
|
||||||
|
|
||||||
.workflow-node-list {
|
.workflow-node-list {
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
> :last-child {
|
||||||
|
> .workflow-add-node-button {
|
||||||
|
&:after {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.workflow-branch-lines {
|
.workflow-branch-lines {
|
||||||
@ -240,7 +251,7 @@ const useStyles = createStyles(({ css, token }) => {
|
|||||||
|
|
||||||
nodeCardClass: css`
|
nodeCardClass: css`
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 20em;
|
width: 16em;
|
||||||
background: ${token.colorBgContainer};
|
background: ${token.colorBgContainer};
|
||||||
padding: 1em;
|
padding: 1em;
|
||||||
box-shadow: ${token.boxShadowTertiary};
|
box-shadow: ${token.boxShadowTertiary};
|
||||||
@ -361,14 +372,32 @@ const useStyles = createStyles(({ css, token }) => {
|
|||||||
`,
|
`,
|
||||||
|
|
||||||
addButtonClass: css`
|
addButtonClass: css`
|
||||||
|
position: relative;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
padding: 2em 0;
|
padding: 1em 0;
|
||||||
|
|
||||||
> .ant-btn {
|
> .ant-btn {
|
||||||
&:disabled {
|
&:disabled {
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&:after {
|
||||||
|
content: '';
|
||||||
|
display: block;
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0.1em;
|
||||||
|
left: calc(50% - 0.25em);
|
||||||
|
width: 0.5em;
|
||||||
|
height: 0.5em;
|
||||||
|
border: 1px solid ${token.colorBorder};
|
||||||
|
border-width: 0 1px 1px 0;
|
||||||
|
transform: rotate(45deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
&:first-child:last-child:after {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
`,
|
`,
|
||||||
|
|
||||||
conditionClass: css`
|
conditionClass: css`
|
||||||
@ -394,6 +423,9 @@ const useStyles = createStyles(({ css, token }) => {
|
|||||||
transform: translateY(-50%);
|
transform: translateY(-50%);
|
||||||
width: 2em;
|
width: 2em;
|
||||||
height: 6em;
|
height: 6em;
|
||||||
|
flex-shrink: 0;
|
||||||
|
padding: 2em 0;
|
||||||
|
font-size: 14px;
|
||||||
`,
|
`,
|
||||||
|
|
||||||
terminalClass: css`
|
terminalClass: css`
|
||||||
|
@ -301,15 +301,15 @@ export const TriggerConfig = () => {
|
|||||||
name: `workflow-trigger-${workflow.id}`,
|
name: `workflow-trigger-${workflow.id}`,
|
||||||
type: 'void',
|
type: 'void',
|
||||||
properties: {
|
properties: {
|
||||||
config: {
|
// config: {
|
||||||
type: 'void',
|
// type: 'void',
|
||||||
'x-content': detailText,
|
// 'x-content': detailText,
|
||||||
'x-component': Button,
|
// 'x-component': Button,
|
||||||
'x-component-props': {
|
// 'x-component-props': {
|
||||||
type: 'link',
|
// type: 'link',
|
||||||
className: 'workflow-node-config-button',
|
// className: 'workflow-node-config-button',
|
||||||
},
|
// },
|
||||||
},
|
// },
|
||||||
drawer: {
|
drawer: {
|
||||||
type: 'void',
|
type: 'void',
|
||||||
title: titleText,
|
title: titleText,
|
||||||
|
Loading…
Reference in New Issue
Block a user