mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-14 14:21:23 +00:00
View repo content in list mode (#2579)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import React, { Fragment } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { gettext } from '../../utils/constants';
|
||||
import { gettext, siteRoot } from '../../utils/constants';
|
||||
import { seafileAPI } from '../../utils/seafile-api';
|
||||
import URLDecorator from '../../utils/url-decorator';
|
||||
import Toast from '../toast';
|
||||
@@ -14,7 +14,6 @@ import CopyDirentDialog from '../dialog/copy-dirent-dialog';
|
||||
const propTypes = {
|
||||
path: PropTypes.string.isRequired,
|
||||
repoID: PropTypes.string.isRequired,
|
||||
serviceUrl: PropTypes.string.isRequired,
|
||||
isItemFreezed: PropTypes.bool.isRequired,
|
||||
dirent: PropTypes.object.isRequired,
|
||||
onItemClick: PropTypes.func.isRequired,
|
||||
@@ -139,8 +138,7 @@ class DirentListItem extends React.Component {
|
||||
}
|
||||
|
||||
onItemClick = () => {
|
||||
let direntPath = this.getDirentPath(this.props.dirent);
|
||||
this.props.onItemClick(direntPath);
|
||||
this.props.onItemClick(this.props.dirent);
|
||||
}
|
||||
|
||||
onItemDelete = (e) => {
|
||||
@@ -244,8 +242,7 @@ class DirentListItem extends React.Component {
|
||||
}
|
||||
|
||||
onDetailsItem = () => {
|
||||
let direntPath = this.getDirentPath(this.props.dirent);
|
||||
this.props.onItemDetails(this.props.dirent, direntPath);
|
||||
this.props.onItemDetails(this.props.dirent);
|
||||
this.onItemMenuHide();
|
||||
}
|
||||
|
||||
@@ -368,7 +365,7 @@ class DirentListItem extends React.Component {
|
||||
}
|
||||
|
||||
render() {
|
||||
let { dirent, serviceUrl } = this.props;
|
||||
let { dirent } = this.props;
|
||||
return (
|
||||
<Fragment>
|
||||
<tr className={this.state.highlight ? 'tr-highlight' : ''} onMouseEnter={this.onMouseEnter} onMouseOver={this.onMouseOver} onMouseLeave={this.onMouseLeave}>
|
||||
@@ -381,8 +378,8 @@ class DirentListItem extends React.Component {
|
||||
</td>
|
||||
<td className="icon">
|
||||
<div className="dir-icon">
|
||||
<img src={dirent.type === 'dir' ? serviceUrl + '/media/img/folder-192.png' : serviceUrl + '/media/img/file/192/txt.png'} alt={gettext('file icon')}></img>
|
||||
{dirent.is_locked && <img className="locked" src={serviceUrl + '/media/img/file-locked-32.png'} alt={gettext('locked')}></img>}
|
||||
<img src={dirent.type === 'dir' ? siteRoot + 'media/img/folder-192.png' : siteRoot + 'media/img/file/192/txt.png'} alt={gettext('file icon')}></img>
|
||||
{dirent.is_locked && <img className="locked" src={siteRoot + 'media/img/file-locked-32.png'} alt={gettext('locked')}></img>}
|
||||
</div>
|
||||
</td>
|
||||
<td className="name a-simulate">
|
||||
|
@@ -7,7 +7,6 @@ import DirentListItem from './dirent-list-item';
|
||||
const propTypes = {
|
||||
path: PropTypes.string.isRequired,
|
||||
repoID: PropTypes.string.isRequired,
|
||||
serviceUrl: PropTypes.string.isRequired,
|
||||
isRepoOwner: PropTypes.bool,
|
||||
currentRepo: PropTypes.object,
|
||||
isAllItemSelected: PropTypes.bool.isRequired,
|
||||
@@ -45,8 +44,8 @@ class DirentListView extends React.Component {
|
||||
this.onFreezedItem();
|
||||
}
|
||||
|
||||
onItemDetails = (dirent, direntPath) => {
|
||||
this.props.onItemDetails(dirent, direntPath);
|
||||
onItemDetails = (dirent) => {
|
||||
this.props.onItemDetails(dirent);
|
||||
}
|
||||
|
||||
render() {
|
||||
@@ -81,7 +80,6 @@ class DirentListView extends React.Component {
|
||||
dirent={dirent}
|
||||
path={this.props.path}
|
||||
repoID={this.props.repoID}
|
||||
serviceUrl={this.props.serviceUrl}
|
||||
currentRepo={this.props.currentRepo}
|
||||
isRepoOwner={this.props.isRepoOwner}
|
||||
onItemClick={this.props.onItemClick}
|
||||
|
Reference in New Issue
Block a user