Merge pull request #1378 from processing/missing-upload
Fixes #1361 - upload option missing for folder
This commit is contained in:
commit
65606f4f7d
1 changed files with 46 additions and 35 deletions
|
@ -185,40 +185,50 @@ export class FileNode extends React.Component {
|
||||||
{(() => { // eslint-disable-line
|
{(() => { // eslint-disable-line
|
||||||
if (this.props.fileType === 'folder') {
|
if (this.props.fileType === 'folder') {
|
||||||
return (
|
return (
|
||||||
<li>
|
<React.Fragment>
|
||||||
<button
|
|
||||||
aria-label="add file"
|
|
||||||
onClick={() => {
|
|
||||||
this.props.newFile(this.props.id);
|
|
||||||
setTimeout(() => this.hideFileOptions(), 0);
|
|
||||||
}}
|
|
||||||
onBlur={this.onBlurComponent}
|
|
||||||
onFocus={this.onFocusComponent}
|
|
||||||
className="sidebar__file-item-option"
|
|
||||||
>
|
|
||||||
Add File
|
|
||||||
</button>
|
|
||||||
</li>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
})()}
|
|
||||||
{(() => { // eslint-disable-line
|
|
||||||
if (this.props.fileType === 'folder') {
|
|
||||||
return (
|
|
||||||
<li>
|
<li>
|
||||||
<button
|
<button
|
||||||
aria-label="add folder"
|
aria-label="add folder"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
this.props.newFolder(this.props.id);
|
this.props.newFolder(this.props.id);
|
||||||
setTimeout(() => this.hideFileOptions(), 0);
|
setTimeout(this.hideFileOptions, 0);
|
||||||
}}
|
}}
|
||||||
onBlur={this.onBlurComponent}
|
onBlur={this.onBlurComponent}
|
||||||
onFocus={this.onFocusComponent}
|
onFocus={this.onFocusComponent}
|
||||||
className="sidebar__file-item-option"
|
className="sidebar__file-item-option"
|
||||||
>
|
>
|
||||||
Add Folder
|
Create folder
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
|
<li>
|
||||||
|
<button
|
||||||
|
aria-label="add file"
|
||||||
|
onClick={() => {
|
||||||
|
this.props.newFile(this.props.id);
|
||||||
|
setTimeout(this.hideFileOptions, 0);
|
||||||
|
}}
|
||||||
|
onBlur={this.onBlurComponent}
|
||||||
|
onFocus={this.onFocusComponent}
|
||||||
|
className="sidebar__file-item-option"
|
||||||
|
>
|
||||||
|
Create file
|
||||||
|
</button>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<button
|
||||||
|
aria-label="upload file"
|
||||||
|
onClick={() => {
|
||||||
|
this.props.openUploadFileModal(this.props.id);
|
||||||
|
setTimeout(this.hideFileOptions, 0);
|
||||||
|
}}
|
||||||
|
onBlur={this.onBlurComponent}
|
||||||
|
onFocus={this.onFocusComponent}
|
||||||
|
>
|
||||||
|
Upload file
|
||||||
|
</button>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</React.Fragment>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
})()}
|
})()}
|
||||||
|
@ -289,7 +299,8 @@ FileNode.propTypes = {
|
||||||
newFolder: PropTypes.func.isRequired,
|
newFolder: PropTypes.func.isRequired,
|
||||||
showFolderChildren: PropTypes.func.isRequired,
|
showFolderChildren: PropTypes.func.isRequired,
|
||||||
hideFolderChildren: PropTypes.func.isRequired,
|
hideFolderChildren: PropTypes.func.isRequired,
|
||||||
canEdit: PropTypes.bool.isRequired
|
canEdit: PropTypes.bool.isRequired,
|
||||||
|
openUploadFileModal: PropTypes.func.isRequired
|
||||||
};
|
};
|
||||||
|
|
||||||
FileNode.defaultProps = {
|
FileNode.defaultProps = {
|
||||||
|
|
Loading…
Reference in a new issue