Skip to content

Commit

Permalink
fix: sandbox outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
c121914yu committed Jul 6, 2024
1 parent 230f031 commit 266b710
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 17 deletions.
7 changes: 6 additions & 1 deletion packages/global/core/workflow/template/output.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,10 @@ export const Output_Template_AddOutput: FlowNodeOutputItemType = {
key: NodeOutputKeyEnum.addOutputParam,
type: FlowNodeOutputTypeEnum.dynamic,
valueType: WorkflowIOValueTypeEnum.dynamic,
label: ''
label: '',
customFieldConfig: {
selectValueTypeList: Object.values(WorkflowIOValueTypeEnum),
showDescription: false,
showDefaultValue: false
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const CodeNode: FlowNodeTemplateType = {
outputs: [
{
...Output_Template_AddOutput,
description: '将代码中 return 的对象作为输出,传递给后续的节点'
description: '将代码中 return 的对象作为输出,传递给后续的节点。变量名需要对应 return 的 key'
},
{
id: NodeOutputKeyEnum.rawResponse,
Expand Down
31 changes: 16 additions & 15 deletions projects/app/src/pages/app/detail/components/InfoModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,25 +63,26 @@ const InfoModal = ({ onClose }: { onClose: () => void }) => {
const avatar = getValues('avatar');

// submit config
const { mutate: saveSubmitSuccess, isLoading: btnLoading } = useRequest({
mutationFn: async (data: AppSchema) => {
const { runAsync: saveSubmitSuccess, loading: btnLoading } = useRequest2(
async (data: AppSchema) => {
await updateAppDetail({
name: data.name,
avatar: data.avatar,
intro: data.intro,
defaultPermission: data.defaultPermission
});
},
onSuccess() {
onClose();
toast({
title: t('common.Update Success'),
status: 'success'
});
reloadApp();
},
errorToast: t('common.Update Failed')
});
{
onSuccess() {
toast({
title: t('common.Update Success'),
status: 'success'
});
reloadApp();
},
errorToast: t('common.Update Failed')
}
);

const saveSubmitError = useCallback(() => {
// deep search message
Expand All @@ -101,8 +102,8 @@ const InfoModal = ({ onClose }: { onClose: () => void }) => {
}, [errors, t, toast]);

const saveUpdateModel = useCallback(
() => handleSubmit((data) => saveSubmitSuccess(data), saveSubmitError)(),
[handleSubmit, saveSubmitError, saveSubmitSuccess]
() => handleSubmit((data) => saveSubmitSuccess(data).then(onClose), saveSubmitError)(),
[handleSubmit, onClose, saveSubmitError, saveSubmitSuccess]
);

const onSelectFile = useCallback(
Expand Down Expand Up @@ -210,7 +211,7 @@ const InfoModal = ({ onClose }: { onClose: () => void }) => {
isInheritPermission={appDetail.inheritPermission}
onChange={(v) => {
setValue('defaultPermission', v);
handleSubmit((data) => saveSubmitSuccess(data), saveSubmitError)();
return handleSubmit((data) => saveSubmitSuccess(data), saveSubmitError)();
}}
hasParent={!!appDetail.parentId}
/>
Expand Down

0 comments on commit 266b710

Please sign in to comment.