-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Files with computed name #607
base: fix-login-button-603
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -86,7 +86,7 @@ const NodeValueRender = ({node = false, nodeDef}) => { | |
return ( | ||
<> | ||
<Container> | ||
{node?.value ? ( | ||
{node?.value && node?.value?.fileName ? ( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it could be simply node?.value?.fileName There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. there are also helper methods in arena-core for this, e.g. NodeValues.getFileName |
||
<> | ||
<FilePreview node={node} nodeDef={nodeDef} /> | ||
<DeleteFileButton | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,13 @@ const useFile = ({nodeDef, node, isImage = false}) => { | |
fileUuid: node?.value?.fileUuid || uuidv4(), | ||
}; | ||
|
||
const fileKeys = ['fileName', 'fileSize', 'fileUuid', 'uri']; | ||
const fileKeys = [ | ||
'fileName', | ||
'fileSize', | ||
'fileUuid', | ||
'uri', | ||
'fileNameCalculated', | ||
]; | ||
const fileValueFiltered = Object.keys(value).reduce((acc, key) => { | ||
if (fileKeys.includes(key)) { | ||
acc[key] = value[key]; | ||
|
@@ -59,7 +65,7 @@ const useFile = ({nodeDef, node, isImage = false}) => { | |
const deleteFile = useCallback(() => { | ||
handleDelete({ | ||
node, | ||
label: node?.value?.fileName, | ||
label: node?.value?.fileNameCalculated, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. in this case, if fileNameCalculated is missing it should default to something else |
||
requestConfirm: true, | ||
isImage: true, | ||
}); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this one looks wrong, it should be:
const {fileName: fileNameUuid, fileNameCalculated} =
node?.value ?? {}