mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-29 11:01:18 +03:00
UX Changes: Fixed 2 edge cases, (1) UI-tag not added, when the user clicks the submit without hitting enter and (2) server side error when the update/rename is attempted before any flow is opened
This commit is contained in:
@@ -355,8 +355,12 @@ export class App {
|
|||||||
this.AppDataSource.getRepository(ChatFlow).merge(chatflow, updateChatFlow)
|
this.AppDataSource.getRepository(ChatFlow).merge(chatflow, updateChatFlow)
|
||||||
const result = await this.AppDataSource.getRepository(ChatFlow).save(chatflow)
|
const result = await this.AppDataSource.getRepository(ChatFlow).save(chatflow)
|
||||||
|
|
||||||
// Update chatflowpool inSync to false, to build Langchain again because data has been changed
|
// chatFlowPool is initialized only when a flow is opened
|
||||||
this.chatflowPool.updateInSync(chatflow.id, false)
|
// if the user attempts to rename/update category without opening any flow, chatFlowPool will be undefined
|
||||||
|
if (this.chatflowPool) {
|
||||||
|
// Update chatflowpool inSync to false, to build Langchain again because data has been changed
|
||||||
|
this.chatflowPool.updateInSync(chatflow.id, false)
|
||||||
|
}
|
||||||
|
|
||||||
return res.json(result)
|
return res.json(result)
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import Button from '@mui/material/Button'
|
|||||||
import TextField from '@mui/material/TextField'
|
import TextField from '@mui/material/TextField'
|
||||||
import Chip from '@mui/material/Chip'
|
import Chip from '@mui/material/Chip'
|
||||||
import PropTypes from 'prop-types'
|
import PropTypes from 'prop-types'
|
||||||
import { DialogActions, DialogContent, DialogTitle } from '@mui/material'
|
import { DialogActions, DialogContent, DialogTitle, Typography } from '@mui/material'
|
||||||
|
|
||||||
const TagDialog = ({ isOpen, onClose, tags, setTags, onSubmit }) => {
|
const TagDialog = ({ isOpen, onClose, tags, setTags, onSubmit }) => {
|
||||||
const [inputValue, setInputValue] = useState('')
|
const [inputValue, setInputValue] = useState('')
|
||||||
@@ -30,6 +30,9 @@ const TagDialog = ({ isOpen, onClose, tags, setTags, onSubmit }) => {
|
|||||||
|
|
||||||
const handleSubmit = (event) => {
|
const handleSubmit = (event) => {
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
|
if (inputValue.trim() && !tags.includes(inputValue)) {
|
||||||
|
setTags([...tags, inputValue])
|
||||||
|
}
|
||||||
onSubmit(tags)
|
onSubmit(tags)
|
||||||
onClose()
|
onClose()
|
||||||
}
|
}
|
||||||
@@ -67,6 +70,9 @@ const TagDialog = ({ isOpen, onClose, tags, setTags, onSubmit }) => {
|
|||||||
label='Add a tag'
|
label='Add a tag'
|
||||||
variant='outlined'
|
variant='outlined'
|
||||||
/>
|
/>
|
||||||
|
<Typography variant='body2' sx={{ fontStyle: 'italic' }} color='text.secondary'>
|
||||||
|
Enter a tag and press enter to add it to the list. You can add as many tags as you want.
|
||||||
|
</Typography>
|
||||||
</form>
|
</form>
|
||||||
</Box>
|
</Box>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
|
|||||||
Reference in New Issue
Block a user