Fixed Issue #659 (#964)

* Fixed Issue #659

* Undo changes in package.json and package-lock.json

* Resolved error
This commit is contained in:
Ankur Ingale 2019-03-22 02:38:46 +05:30 committed by Cassie Tarakajian
parent 2c876cda45
commit 80765e03c7
3 changed files with 30 additions and 7 deletions

View file

@ -156,7 +156,6 @@ export class FileNode extends React.Component {
ref={(element) => { this[`fileOptions-${this.props.id}`] = element; }}
tabIndex="0"
onClick={this.toggleFileOptions}
onBlur={() => setTimeout(this.hideFileOptions, 200)}
>
<InlineSVG src={downArrowUrl} />
</button>
@ -168,7 +167,10 @@ export class FileNode extends React.Component {
<li>
<button
aria-label="add file"
onClick={this.props.newFile}
onClick={() => {
this.props.newFile();
setTimeout(() => this.hideFileOptions(), 0);
}}
className="sidebar__file-item-option"
>
Add File
@ -183,7 +185,10 @@ export class FileNode extends React.Component {
<li>
<button
aria-label="add folder"
onClick={this.props.newFolder}
onClick={() => {
this.props.newFolder();
setTimeout(() => this.hideFileOptions(), 0);
}}
className="sidebar__file-item-option"
>
Add Folder
@ -198,6 +203,7 @@ export class FileNode extends React.Component {
this.originalFileName = this.props.name;
this.showEditFileName();
setTimeout(() => this.fileNameInput.focus(), 0);
setTimeout(() => this.hideFileOptions(), 0);
}}
className="sidebar__file-item-option"
>
@ -213,6 +219,9 @@ export class FileNode extends React.Component {
setTimeout(() => this.props.deleteFile(this.props.id, this.props.parentId), 100);
}
}}
onBlur={() => {
setTimeout(this.hideFileOptions, 200);
}}
className="sidebar__file-item-option"
>
Delete

View file

@ -65,18 +65,30 @@ class Sidebar extends React.Component {
tabIndex="0"
ref={(element) => { this.sidebarOptions = element; }}
onClick={this.toggleProjectOptions}
onBlur={() => setTimeout(this.props.closeProjectOptions, 200)}
>
<InlineSVG src={downArrowUrl} />
</button>
<ul className="sidebar__project-options">
<li>
<button aria-label="add folder" onClick={this.props.newFolder} >
<button
aria-label="add folder"
onClick={() => {
this.props.newFolder();
setTimeout(this.props.closeProjectOptions, 0);
}}
>
Add folder
</button>
</li>
<li>
<button aria-label="add file" onClick={this.props.newFile} >
<button
aria-label="add file"
onClick={() => {
this.props.newFile();
setTimeout(this.props.closeProjectOptions, 0);
}}
onBlur={() => { setTimeout(this.props.closeProjectOptions, 200); }}
>
Add file
</button>
</li>

View file

@ -110,7 +110,9 @@ export function getProject(req, res) {
function deleteFilesFromS3(files) {
deleteObjectsFromS3(files.filter((file) => {
if (file.url) {
if (!process.env.S3_DATE || (process.env.S3_DATE && isBefore(new Date(process.env.S3_DATE), new Date(file.createdAt)))) {
if (!process.env.S3_DATE || (
process.env.S3_DATE &&
isBefore(new Date(process.env.S3_DATE), new Date(file.createdAt)))) {
return true;
}
}