mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-22 07:01:07 +03:00
Bugfix/Credential Filter (#5553)
* update credential filter by name * update FlowListMenu and dialog components with refresh functionality
This commit is contained in:
@@ -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}
|
||||
/>
|
||||
<ChatFeedbackDialog
|
||||
show={chatFeedbackDialogOpen}
|
||||
dialogProps={chatFeedbackDialogProps}
|
||||
onCancel={() => setChatFeedbackDialogOpen(false)}
|
||||
onConfirm={refreshFlows}
|
||||
/>
|
||||
<AllowedDomainsDialog
|
||||
show={allowedDomainsDialogOpen}
|
||||
dialogProps={allowedDomainsDialogProps}
|
||||
onCancel={() => setAllowedDomainsDialogOpen(false)}
|
||||
onConfirm={refreshFlows}
|
||||
/>
|
||||
<SpeechToTextDialog
|
||||
show={speechToTextDialogOpen}
|
||||
dialogProps={speechToTextDialogProps}
|
||||
onCancel={() => setSpeechToTextDialogOpen(false)}
|
||||
onConfirm={refreshFlows}
|
||||
/>
|
||||
{exportTemplateDialogOpen && (
|
||||
<ExportAsTemplateDialog
|
||||
|
||||
@@ -13,7 +13,7 @@ import useNotifier from '@/utils/useNotifier'
|
||||
// Project imports
|
||||
import AllowedDomains from '@/ui-component/extended/AllowedDomains'
|
||||
|
||||
const AllowedDomainsDialog = ({ show, dialogProps, onCancel }) => {
|
||||
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'}
|
||||
</DialogTitle>
|
||||
<DialogContent>
|
||||
<AllowedDomains dialogProps={dialogProps} />
|
||||
<AllowedDomains dialogProps={dialogProps} onConfirm={onConfirm} />
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
) : null
|
||||
|
||||
@@ -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'}
|
||||
</DialogTitle>
|
||||
<DialogContent>
|
||||
<ChatFeedback dialogProps={dialogProps} />
|
||||
<ChatFeedback dialogProps={dialogProps} onConfirm={onConfirm} />
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
) : null
|
||||
|
||||
@@ -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'}
|
||||
</DialogTitle>
|
||||
<DialogContent>
|
||||
<SpeechToText dialogProps={dialogProps} />
|
||||
<SpeechToText dialogProps={dialogProps} onConfirm={onConfirm} />
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
) : null
|
||||
|
||||
@@ -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'}
|
||||
</DialogTitle>
|
||||
<DialogContent>
|
||||
<StarterPrompts dialogProps={dialogProps} />
|
||||
<StarterPrompts dialogProps={dialogProps} onConfirm={onConfirm} />
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
) : null
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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 = () => {
|
||||
|
||||
Reference in New Issue
Block a user