fix(workflow): create node script (#1856)
This commit is contained in:
@@ -13,7 +13,7 @@ import { type FormData } from './types';
|
||||
import { FormRender } from './form';
|
||||
import { transformOnInit, transformOnSubmit } from './data-transformer';
|
||||
|
||||
export const {{CONSTANT_NAME_PLACE_HOLDER}}_FORM_META: FormMetaV2<FormData> = {
|
||||
export const <%= it.CONSTANT_NAME_PLACE_HOLDER %>_FORM_META: FormMetaV2<FormData> = {
|
||||
// 节点表单渲染
|
||||
render: () => <FormRender />,
|
||||
|
||||
@@ -17,7 +17,7 @@ export const FormRender = () => (
|
||||
<OutputsField
|
||||
title={I18n.t('workflow_detail_node_output')}
|
||||
tooltip={I18n.t('node_http_response_data')}
|
||||
id="{{CAMEL_NAME_PLACE_HOLDER}}-node-outputs"
|
||||
id="<%= it.CAMEL_NAME_PLACE_HOLDER %>-node-outputs"
|
||||
name="outputs"
|
||||
topLevelReadonly={true}
|
||||
customReadonly
|
||||
@@ -0,0 +1,2 @@
|
||||
export { <%= it.CONSTANT_NAME_PLACE_HOLDER %>_NODE_REGISTRY } from './node-registry';
|
||||
export { <%= it.PASCAL_NAME_PLACE_HOLDER %>Content } from './node-content';
|
||||
@@ -1,2 +0,0 @@
|
||||
export { {{CONSTANT_NAME_PLACE_HOLDER}}_NODE_REGISTRY } from './node-registry';
|
||||
export { {{PASCAL_NAME_PLACE_HOLDER}}Content } from './node-content';
|
||||
@@ -1,6 +1,6 @@
|
||||
import { InputParameters, Outputs } from '../common/components';
|
||||
|
||||
export function {{PASCAL_NAME_PLACE_HOLDER}}Content() {
|
||||
export function <%= it.PASCAL_NAME_PLACE_HOLDER %>Content() {
|
||||
return (
|
||||
<>
|
||||
<InputParameters />
|
||||
@@ -7,21 +7,19 @@ import {
|
||||
type WorkflowNodeRegistry,
|
||||
} from '@coze-workflow/base';
|
||||
|
||||
import { {{CONSTANT_NAME_PLACE_HOLDER}}_FORM_META } from './form-meta';
|
||||
import { <%= it.CONSTANT_NAME_PLACE_HOLDER %>_FORM_META } from './form-meta';
|
||||
import { INPUT_PATH } from './constants';
|
||||
{{#if SUPPORT_TEST}}
|
||||
import { test, type NodeTestMeta } from './node-test';
|
||||
{{/if}}
|
||||
|
||||
export const {{CONSTANT_NAME_PLACE_HOLDER}}_NODE_REGISTRY: WorkflowNodeRegistry{{#if SUPPORT_TEST}}<NodeTestMeta>{{/if}} = {
|
||||
type: StandardNodeType.{{PASCAL_NAME_PLACE_HOLDER}},
|
||||
export const <%= it.CONSTANT_NAME_PLACE_HOLDER %>_NODE_REGISTRY: WorkflowNodeRegistry<NodeTestMeta> = {
|
||||
type: StandardNodeType.<%= it.PASCAL_NAME_PLACE_HOLDER %>,
|
||||
meta: {
|
||||
nodeDTOType: StandardNodeType.{{PASCAL_NAME_PLACE_HOLDER}},
|
||||
nodeDTOType: StandardNodeType.<%= it.PASCAL_NAME_PLACE_HOLDER %>,
|
||||
size: { width: 360, height: 130.7 },
|
||||
nodeMetaPath: DEFAULT_NODE_META_PATH,
|
||||
outputsPath: DEFAULT_OUTPUTS_PATH,
|
||||
inputParametersPath: INPUT_PATH,
|
||||
test{{#unless SUPPORT_TEST}}: false{{/unless}},
|
||||
test,
|
||||
},
|
||||
formMeta: {{CONSTANT_NAME_PLACE_HOLDER}}_FORM_META,
|
||||
formMeta: <%= it.CONSTANT_NAME_PLACE_HOLDER %>_FORM_META,
|
||||
};
|
||||
@@ -0,0 +1,5 @@
|
||||
import type { NodeTestMeta } from '@/test-run-kit';
|
||||
|
||||
const test: NodeTestMeta = <%= it.IS_SUPPORT_TEST %>;
|
||||
|
||||
export { test, type NodeTestMeta };
|
||||
@@ -1,5 +0,0 @@
|
||||
import type { NodeTestMeta } from '@/test-run-kit';
|
||||
|
||||
const test: NodeTestMeta = true;
|
||||
|
||||
export { test, type NodeTestMeta };
|
||||
Reference in New Issue
Block a user