From 5bbb94e5b5266af5ed770d0241605eb859699831 Mon Sep 17 00:00:00 2001 From: Ashish Baravaliya <49753983+AshishBarvaliya@users.noreply.github.com> Date: Thu, 29 Jun 2023 21:04:11 -0400 Subject: [PATCH] fix: Adding a file when adding a new row in the data browser doesn't show filename (#2471) --- src/components/BrowserCell/BrowserCell.react.js | 2 +- src/dashboard/Data/Browser/EditRowDialog.react.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/BrowserCell/BrowserCell.react.js b/src/components/BrowserCell/BrowserCell.react.js index 1e46dda562..9d16b142b4 100644 --- a/src/components/BrowserCell/BrowserCell.react.js +++ b/src/components/BrowserCell/BrowserCell.react.js @@ -131,7 +131,7 @@ export default class BrowserCell extends Component { } else if (this.props.type === 'Object' || this.props.type === 'Bytes') { this.copyableValue = content = JSON.stringify(this.props.value); } else if (this.props.type === 'File') { - const fileName = this.props.value.url() ? getFileName(this.props.value) : 'Uploading\u2026'; + const fileName = this.props.value ? this.props.value.url() ? getFileName(this.props.value) : this.props.value.name() : 'Uploading\u2026'; content = ; this.copyableValue = fileName; } else if (this.props.type === 'ACL') { diff --git a/src/dashboard/Data/Browser/EditRowDialog.react.js b/src/dashboard/Data/Browser/EditRowDialog.react.js index 345464b02e..bbe0f7a56a 100644 --- a/src/dashboard/Data/Browser/EditRowDialog.react.js +++ b/src/dashboard/Data/Browser/EditRowDialog.react.js @@ -352,7 +352,7 @@ export default class EditRowDialog extends React.Component { break; case 'File': let file = selectedObject[name]; - let fileName = file && file.url() ? getFileName(file) : ''; + let fileName = file ? file.url() ? getFileName(file) : file.name() : ''; inputComponent = (
{file && }