Fix regression issue where users couldn't click into folders (#6029)

This commit fixes the issue introduced in #6023

The clicks on folder names direct the users inside the folders; while
the clicks on file names don't download the files, and will open file
previews on a separate modal in the future. Additionally, when a file
has been selected using the checkbox, it can now be downloaded without
being inside a zip file.

Fixes #6026
This commit is contained in:
Kaan Kabalak
2018-06-07 20:43:51 -07:00
committed by Harshavardhana
parent 7e12c3e8b9
commit 39919708d6
7 changed files with 151 additions and 72 deletions

View File

@@ -15,7 +15,6 @@
*/
import React from "react"
import classNames from "classnames"
import { connect } from "react-redux"
import humanize from "humanize"
import Moment from "moment"
@@ -35,22 +34,19 @@ export const ObjectItem = ({
onClick
}) => {
return (
<div
className={
"fesl-row " +
classNames({
"fesl-row-selected": checked
})
}
data-type={getDataType(name, contentType)}
>
<div className={"fesl-row"} data-type={getDataType(name, contentType)}>
<div className="fesl-item fesl-item-icon">
<div className="fi-select">
<input
type="checkbox"
name={name}
checked={checked}
onChange={() => {
checked ? uncheckObject(name) : checkObject(name)
}}
/>
<i className="fis-icon" />
<i className="fis-helper" />
</div>
</div>
<div className="fesl-item fesl-item-name">
@@ -58,7 +54,9 @@ export const ObjectItem = ({
href="#"
onClick={e => {
e.preventDefault()
checked ? uncheckObject(name) : checkObject(name)
if (onClick) {
onClick()
}
}}
>
{name}