Skip to content

Commit

Permalink
fix: plugin input type options & save button (labring#2590)
Browse files Browse the repository at this point in the history
  • Loading branch information
newfish-cmyk authored Sep 2, 2024
1 parent fdab383 commit 84de95d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
11 changes: 8 additions & 3 deletions projects/app/src/pages/app/detail/components/Plugin/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useCallback, useMemo, useState } from 'react';
import React, { useCallback, useEffect, useMemo, useState } from 'react';
import {
Box,
Flex,
Expand Down Expand Up @@ -41,7 +41,6 @@ const Header = () => {

const { appDetail, onSaveApp, currentTab } = useContextSelector(AppContext, (v) => v);
const isV2Workflow = appDetail?.version === 'v2';

const {
isOpen: isOpenBackConfirm,
onOpen: onOpenBackConfirm,
Expand All @@ -52,7 +51,6 @@ const Header = () => {
onOpen: onSaveAndPublishModalOpen,
onClose: onSaveAndPublishModalClose
} = useDisclosure();

const [isSave, setIsSave] = useState(false);

const {
Expand Down Expand Up @@ -251,6 +249,8 @@ const Header = () => {
status: 'success',
title: t('app:saved_success')
});
onClose();
setIsSave(false);
}}
>
<MyIcon name={'core/workflow/upload'} w={'16px'} mr={2} />
Expand All @@ -268,6 +268,7 @@ const Header = () => {
onSaveAndPublishModalOpen();
}
onClose();
setIsSave(false);
}}
>
<MyIcon name={'core/workflow/publish'} w={'16px'} mr={2} />
Expand Down Expand Up @@ -314,6 +315,10 @@ const Header = () => {
await onClickSave({});
onCloseBackConfirm();
onBack();
toast({
status: 'success',
title: t('app:saved_success')
});
}}
>
{t('common:common.Save_and_exit')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,8 @@ const Header = () => {
status: 'success',
title: t('app:saved_success')
});
onClose();
setIsSave(false);
}}
>
<MyIcon name={'core/workflow/upload'} w={'16px'} mr={2} />
Expand All @@ -266,6 +268,7 @@ const Header = () => {
onSaveAndPublishModalOpen();
}
onClose();
setIsSave(false);
}}
>
<MyIcon name={'core/workflow/publish'} w={'16px'} mr={2} />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Box, Button, Input, ModalBody, ModalFooter } from '@chakra-ui/react';
import { formatTime2YMDHMS } from '@fastgpt/global/common/string/time';
import MyModal from '@fastgpt/web/components/common/MyModal';
import { useToast } from '@fastgpt/web/hooks/useToast';
import { useForm } from 'react-hook-form';
Expand All @@ -21,7 +22,7 @@ const SaveAndPublishModal = ({
const { toast } = useToast();
const { register, handleSubmit } = useForm<FormType>({
defaultValues: {
versionName: '',
versionName: formatTime2YMDHMS(new Date()),
isPublish: undefined
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,6 @@ const FieldEditModal = ({
}
],
[
{
icon: 'core/workflow/inputType/selectApp',
label: t('common:core.workflow.inputType.selectApp'),
value: FlowNodeInputTypeEnum.selectApp,
defaultValueType: WorkflowIOValueTypeEnum.selectApp
},
{
icon: 'core/workflow/inputType/selectLLM',
label: t('common:core.workflow.inputType.selectLLMModel'),
Expand Down

0 comments on commit 84de95d

Please sign in to comment.