Compare commits

..

No commits in common. "835db6e49fde95619eb0c7e91597a071d3eb1281" and "775393dfd177004a8195ba264d0b41e9406d3563" have entirely different histories.

2 changed files with 9 additions and 19 deletions

View File

@ -54,7 +54,6 @@ const FileUpload = ({
currentFiles.length === 0 currentFiles.length === 0
: !currentFiles : !currentFiles
setHasNoItems(noItems) setHasNoItems(noItems)
onChange(currentFiles)
}, [currentFiles, multiple]) }, [currentFiles, multiple])
const handleFileUpload = async (file) => { const handleFileUpload = async (file) => {
@ -69,9 +68,11 @@ const FileUpload = ({
// For multiple files, add to existing array // For multiple files, add to existing array
const newFiles = [...currentFiles, uploadedFile] const newFiles = [...currentFiles, uploadedFile]
setCurrentFiles(newFiles) setCurrentFiles(newFiles)
onChange(newFiles)
} else { } else {
// For single file, replace the value // For single file, replace the value
setCurrentFiles(uploadedFile) setCurrentFiles(uploadedFile)
onChange(uploadedFile)
} }
} }
} catch (error) { } catch (error) {
@ -87,9 +88,11 @@ const FileUpload = ({
// For multiple files, add to existing array // For multiple files, add to existing array
const newFiles = [...currentFiles, selectedFile] const newFiles = [...currentFiles, selectedFile]
setCurrentFiles(newFiles) setCurrentFiles(newFiles)
onChange(newFiles)
} else { } else {
// For single file, replace the value // For single file, replace the value
setCurrentFiles(selectedFile) setCurrentFiles(selectedFile)
onChange(selectedFile)
} }
// Clear the selection // Clear the selection
setSelectedFile(null) setSelectedFile(null)

View File

@ -1,6 +1,6 @@
import PropTypes from 'prop-types' import PropTypes from 'prop-types'
import { createElement } from 'react' import { createElement } from 'react'
import { Flex, Typography, Button, Space, Dropdown, Divider, Card } from 'antd' import { Flex, Typography, Button, Space, Dropdown, Divider } from 'antd'
import { UserOutlined } from '@ant-design/icons' import { UserOutlined } from '@ant-design/icons'
import { useContext } from 'react' import { useContext } from 'react'
import { useNavigate } from 'react-router-dom' import { useNavigate } from 'react-router-dom'
@ -17,9 +17,7 @@ const UserProfilePopover = ({ onClose }) => {
const navigate = useNavigate() const navigate = useNavigate()
const modelActions = User.actions || [] const modelActions = User.actions || []
const iconActions = modelActions.filter((a) => const iconActions = modelActions.filter((a) => ICON_ACTION_NAMES.includes(a.name))
ICON_ACTION_NAMES.includes(a.name)
)
const dropdownActions = modelActions.filter( const dropdownActions = modelActions.filter(
(a) => !ICON_ACTION_NAMES.includes(a.name) (a) => !ICON_ACTION_NAMES.includes(a.name)
) )
@ -98,20 +96,9 @@ const UserProfilePopover = ({ onClose }) => {
}} }}
/> />
) : ( ) : (
<Card <UserOutlined
style={{ borderRadius: '5px', width: 76, height: 76 }} style={{ fontSize: 48, color: 'var(--color-text-secondary)' }}
styles={{ body: { padding: 0, height: '100%' } }} />
>
<Flex justify='center' align='center' style={{ height: '100%' }}>
<UserOutlined
style={{
fontSize: 32,
color: 'var(--color-text-secondary)',
marginBottom: 2
}}
/>
</Flex>
</Card>
)} )}
<Flex vertical style={{ minWidth: 0 }}> <Flex vertical style={{ minWidth: 0 }}>
{fullName && ( {fullName && (