diff --git a/packages/ui/src/ui-component/button/FlowListMenu.jsx b/packages/ui/src/ui-component/button/FlowListMenu.jsx index 9ac85206..198b7f84 100644 --- a/packages/ui/src/ui-component/button/FlowListMenu.jsx +++ b/packages/ui/src/ui-component/button/FlowListMenu.jsx @@ -102,6 +102,24 @@ export default function FlowListMenu({ chatflow, isAgentCanvas, isAgentflowV2, s const title = isAgentCanvas ? 'Agents' : 'Chatflow' + const refreshFlows = async () => { + try { + const params = { + page: currentPage, + limit: pageLimit + } + if (isAgentCanvas && isAgentflowV2) { + await updateFlowsApi.request('AGENTFLOW', params) + } else if (isAgentCanvas) { + await updateFlowsApi.request('MULTIAGENT', params) + } else { + await updateFlowsApi.request(params) + } + } catch (error) { + if (setError) setError(error) + } + } + const handleClick = (event) => { setAnchorEl(event.currentTarget) } @@ -442,21 +460,25 @@ export default function FlowListMenu({ chatflow, isAgentCanvas, isAgentflowV2, s show={conversationStartersDialogOpen} dialogProps={conversationStartersDialogProps} onCancel={() => setConversationStartersDialogOpen(false)} + onConfirm={refreshFlows} /> setChatFeedbackDialogOpen(false)} + onConfirm={refreshFlows} /> setAllowedDomainsDialogOpen(false)} + onConfirm={refreshFlows} /> setSpeechToTextDialogOpen(false)} + onConfirm={refreshFlows} /> {exportTemplateDialogOpen && ( { +const AllowedDomainsDialog = ({ show, dialogProps, onCancel, onConfirm }) => { const portalElement = document.getElementById('portal') const dispatch = useDispatch() @@ -38,7 +38,7 @@ const AllowedDomainsDialog = ({ show, dialogProps, onCancel }) => { {dialogProps.title || 'Allowed Domains'} - + ) : null diff --git a/packages/ui/src/ui-component/dialog/ChatFeedbackDialog.jsx b/packages/ui/src/ui-component/dialog/ChatFeedbackDialog.jsx index a57e8ce4..d54ff752 100644 --- a/packages/ui/src/ui-component/dialog/ChatFeedbackDialog.jsx +++ b/packages/ui/src/ui-component/dialog/ChatFeedbackDialog.jsx @@ -13,7 +13,7 @@ import useNotifier from '@/utils/useNotifier' // Project imports import ChatFeedback from '@/ui-component/extended/ChatFeedback' -const ChatFeedbackDialog = ({ show, dialogProps, onCancel }) => { +const ChatFeedbackDialog = ({ show, dialogProps, onCancel, onConfirm }) => { const portalElement = document.getElementById('portal') const dispatch = useDispatch() @@ -38,7 +38,7 @@ const ChatFeedbackDialog = ({ show, dialogProps, onCancel }) => { {dialogProps.title || 'Allowed Domains'} - + ) : null diff --git a/packages/ui/src/ui-component/dialog/SpeechToTextDialog.jsx b/packages/ui/src/ui-component/dialog/SpeechToTextDialog.jsx index a01dafae..918313e3 100644 --- a/packages/ui/src/ui-component/dialog/SpeechToTextDialog.jsx +++ b/packages/ui/src/ui-component/dialog/SpeechToTextDialog.jsx @@ -13,7 +13,7 @@ import useNotifier from '@/utils/useNotifier' // Project imports import SpeechToText from '@/ui-component/extended/SpeechToText' -const SpeechToTextDialog = ({ show, dialogProps, onCancel }) => { +const SpeechToTextDialog = ({ show, dialogProps, onCancel, onConfirm }) => { const portalElement = document.getElementById('portal') const dispatch = useDispatch() @@ -38,7 +38,7 @@ const SpeechToTextDialog = ({ show, dialogProps, onCancel }) => { {dialogProps.title || 'Allowed Domains'} - + ) : null diff --git a/packages/ui/src/ui-component/dialog/StarterPromptsDialog.jsx b/packages/ui/src/ui-component/dialog/StarterPromptsDialog.jsx index 2bfb2f23..58ebc5be 100644 --- a/packages/ui/src/ui-component/dialog/StarterPromptsDialog.jsx +++ b/packages/ui/src/ui-component/dialog/StarterPromptsDialog.jsx @@ -13,7 +13,7 @@ import useNotifier from '@/utils/useNotifier' // Project imports import StarterPrompts from '@/ui-component/extended/StarterPrompts' -const StarterPromptsDialog = ({ show, dialogProps, onCancel }) => { +const StarterPromptsDialog = ({ show, dialogProps, onCancel, onConfirm }) => { const portalElement = document.getElementById('portal') const dispatch = useDispatch() @@ -38,7 +38,7 @@ const StarterPromptsDialog = ({ show, dialogProps, onCancel }) => { {dialogProps.title || 'Conversation Starter Prompts'} - + ) : null diff --git a/packages/ui/src/ui-component/extended/AllowedDomains.jsx b/packages/ui/src/ui-component/extended/AllowedDomains.jsx index b13d660d..75ae32a6 100644 --- a/packages/ui/src/ui-component/extended/AllowedDomains.jsx +++ b/packages/ui/src/ui-component/extended/AllowedDomains.jsx @@ -17,7 +17,7 @@ import useNotifier from '@/utils/useNotifier' // API import chatflowsApi from '@/api/chatflows' -const AllowedDomains = ({ dialogProps }) => { +const AllowedDomains = ({ dialogProps, onConfirm }) => { const dispatch = useDispatch() useNotifier() @@ -72,6 +72,7 @@ const AllowedDomains = ({ dialogProps }) => { } }) dispatch({ type: SET_CHATFLOW, chatflow: saveResp.data }) + onConfirm?.() } } catch (error) { enqueueSnackbar({ @@ -200,7 +201,8 @@ const AllowedDomains = ({ dialogProps }) => { } AllowedDomains.propTypes = { - dialogProps: PropTypes.object + dialogProps: PropTypes.object, + onConfirm: PropTypes.func } export default AllowedDomains diff --git a/packages/ui/src/ui-component/extended/ChatFeedback.jsx b/packages/ui/src/ui-component/extended/ChatFeedback.jsx index 0a6edca3..132d073e 100644 --- a/packages/ui/src/ui-component/extended/ChatFeedback.jsx +++ b/packages/ui/src/ui-component/extended/ChatFeedback.jsx @@ -17,7 +17,7 @@ import useNotifier from '@/utils/useNotifier' // API import chatflowsApi from '@/api/chatflows' -const ChatFeedback = ({ dialogProps }) => { +const ChatFeedback = ({ dialogProps, onConfirm }) => { const dispatch = useDispatch() useNotifier() @@ -57,6 +57,7 @@ const ChatFeedback = ({ dialogProps }) => { } }) dispatch({ type: SET_CHATFLOW, chatflow: saveResp.data }) + onConfirm?.() } } catch (error) { enqueueSnackbar({ @@ -102,7 +103,8 @@ const ChatFeedback = ({ dialogProps }) => { } ChatFeedback.propTypes = { - dialogProps: PropTypes.object + dialogProps: PropTypes.object, + onConfirm: PropTypes.func } export default ChatFeedback diff --git a/packages/ui/src/ui-component/extended/SpeechToText.jsx b/packages/ui/src/ui-component/extended/SpeechToText.jsx index d397cb2c..2c732b2d 100644 --- a/packages/ui/src/ui-component/extended/SpeechToText.jsx +++ b/packages/ui/src/ui-component/extended/SpeechToText.jsx @@ -239,7 +239,7 @@ const speechToTextProviders = { } } -const SpeechToText = ({ dialogProps }) => { +const SpeechToText = ({ dialogProps, onConfirm }) => { const dispatch = useDispatch() useNotifier() @@ -271,6 +271,7 @@ const SpeechToText = ({ dialogProps }) => { } }) dispatch({ type: SET_CHATFLOW, chatflow: saveResp.data }) + onConfirm?.() } } catch (error) { enqueueSnackbar({ @@ -490,7 +491,8 @@ const SpeechToText = ({ dialogProps }) => { } SpeechToText.propTypes = { - dialogProps: PropTypes.object + dialogProps: PropTypes.object, + onConfirm: PropTypes.func } export default SpeechToText diff --git a/packages/ui/src/ui-component/extended/StarterPrompts.jsx b/packages/ui/src/ui-component/extended/StarterPrompts.jsx index 8ed2baf5..31504fc5 100644 --- a/packages/ui/src/ui-component/extended/StarterPrompts.jsx +++ b/packages/ui/src/ui-component/extended/StarterPrompts.jsx @@ -16,7 +16,7 @@ import useNotifier from '@/utils/useNotifier' // API import chatflowsApi from '@/api/chatflows' -const StarterPrompts = ({ dialogProps }) => { +const StarterPrompts = ({ dialogProps, onConfirm }) => { const dispatch = useDispatch() useNotifier() @@ -78,6 +78,7 @@ const StarterPrompts = ({ dialogProps }) => { } }) dispatch({ type: SET_CHATFLOW, chatflow: saveResp.data }) + onConfirm?.() } } catch (error) { enqueueSnackbar({ @@ -206,9 +207,7 @@ const StarterPrompts = ({ dialogProps }) => { } StarterPrompts.propTypes = { - show: PropTypes.bool, dialogProps: PropTypes.object, - onCancel: PropTypes.func, onConfirm: PropTypes.func } diff --git a/packages/ui/src/views/credentials/index.jsx b/packages/ui/src/views/credentials/index.jsx index 7bd0fe11..3ab68e34 100644 --- a/packages/ui/src/views/credentials/index.jsx +++ b/packages/ui/src/views/credentials/index.jsx @@ -104,7 +104,7 @@ const Credentials = () => { setSearch(event.target.value) } function filterCredentials(data) { - return data.credentialName.toLowerCase().indexOf(search.toLowerCase()) > -1 + return data.name.toLowerCase().indexOf(search.toLowerCase()) > -1 } const listCredential = () => {