1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-16 07:08:55 +00:00

delete details choice and fix wiki comment panel

This commit is contained in:
Michael An
2019-05-30 12:11:52 +08:00
parent 59382d0b8b
commit fed0b0ca00
3 changed files with 9 additions and 15 deletions

View File

@@ -67,6 +67,7 @@ const propTypes = {
onItemsCopy: PropTypes.func.isRequired, onItemsCopy: PropTypes.func.isRequired,
onItemsDelete: PropTypes.func.isRequired, onItemsDelete: PropTypes.func.isRequired,
onFileTagChanged: PropTypes.func, onFileTagChanged: PropTypes.func,
showDirentDetail: PropTypes.func.isRequired,
}; };
class DirColumnView extends React.Component { class DirColumnView extends React.Component {
@@ -224,6 +225,7 @@ class DirColumnView extends React.Component {
onItemsCopy={this.props.onItemsCopy} onItemsCopy={this.props.onItemsCopy}
onItemsDelete={this.props.onItemsDelete} onItemsDelete={this.props.onItemsDelete}
onFileTagChanged={this.props.onFileTagChanged} onFileTagChanged={this.props.onFileTagChanged}
showDirentDetail={this.props.showDirentDetail}
/> />
)} )}
</div> </div>

View File

@@ -146,9 +146,6 @@ class DirentGridView extends React.Component{
case 'History': case 'History':
this.onHistory(currentObject); this.onHistory(currentObject);
break; break;
case 'Details':
this.onDetails(currentObject);
break;
case 'New Folder': case 'New Folder':
this.onCreateFolderToggle(currentObject); this.onCreateFolderToggle(currentObject);
break; break;
@@ -177,11 +174,6 @@ class DirentGridView extends React.Component{
}); });
} }
onDetails = (dirent) => {
this.props.onGridItemClick(dirent);
this.props.showDirentDetail();
}
onItemDownload = (currentObject, e) => { onItemDownload = (currentObject, e) => {
e.nativeEvent.stopImmediatePropagation(); e.nativeEvent.stopImmediatePropagation();
let dirent = currentObject; let dirent = currentObject;
@@ -243,7 +235,7 @@ class DirentGridView extends React.Component{
} }
onComnentItem = () => { onComnentItem = () => {
this.props.showDirentDetail('comments');
} }
onHistory = (currentObject) => { onHistory = (currentObject) => {
@@ -369,6 +361,7 @@ class DirentGridView extends React.Component{
let id = 'grid-item-contextmenu'; let id = 'grid-item-contextmenu';
let menuList = this.getDirentItemMenuList(dirent, true); let menuList = this.getDirentItemMenuList(dirent, true);
this.handleContextClick(event, id, menuList, dirent); this.handleContextClick(event, id, menuList, dirent);
this.props.onGridItemClick && this.props.onGridItemClick(dirent);
} }
handleContextClick = (event, id, menuList, currentObject = null) => { handleContextClick = (event, id, menuList, currentObject = null) => {
@@ -420,18 +413,18 @@ class DirentGridView extends React.Component{
} }
} }
let { RENAME, MOVE, COPY, PERMISSION, DETAILS, OPEN_VIA_CLIENT, LOCK, UNLOCK, COMMENT, HISTORY, ACCESS_LOG } = TextTranslation; let { RENAME, MOVE, COPY, PERMISSION, OPEN_VIA_CLIENT, LOCK, UNLOCK, COMMENT, HISTORY, ACCESS_LOG } = TextTranslation;
if (type === 'dir' && permission === 'rw') { if (type === 'dir' && permission === 'rw') {
if (can_set_folder_perm) { if (can_set_folder_perm) {
menuList = [...contextmenuList, RENAME, MOVE, COPY, 'Divider', PERMISSION, DETAILS, 'Divider', OPEN_VIA_CLIENT]; menuList = [...contextmenuList, RENAME, MOVE, COPY, 'Divider', PERMISSION, 'Divider', OPEN_VIA_CLIENT];
} else { } else {
menuList = [...contextmenuList, RENAME, MOVE, COPY, 'Divider', DETAILS, 'Divider', OPEN_VIA_CLIENT]; menuList = [...contextmenuList, RENAME, MOVE, COPY, 'Divider', OPEN_VIA_CLIENT];
} }
return menuList; return menuList;
} }
if (type === 'dir' && permission === 'r') { if (type === 'dir' && permission === 'r') {
menuList = currentRepoInfo.encrypted ? [...contextmenuList, COPY, DETAILS] : [DETAILS]; menuList = currentRepoInfo.encrypted ? [...contextmenuList, COPY] : [];
return menuList; return menuList;
} }
@@ -459,7 +452,6 @@ class DirentGridView extends React.Component{
if (fileAuditEnabled) { if (fileAuditEnabled) {
menuList.push(ACCESS_LOG); menuList.push(ACCESS_LOG);
} }
menuList.push(DETAILS);
menuList.push('Divider'); menuList.push('Divider');
menuList.push(OPEN_VIA_CLIENT); menuList.push(OPEN_VIA_CLIENT);
return menuList; return menuList;
@@ -474,7 +466,6 @@ class DirentGridView extends React.Component{
menuList.push(COMMENT); menuList.push(COMMENT);
} }
menuList.push(HISTORY); menuList.push(HISTORY);
menuList.push(DETAILS);
return menuList; return menuList;
} }

View File

@@ -316,6 +316,7 @@ class LibContentContainer extends React.Component {
onItemsCopy={this.props.onItemsCopy} onItemsCopy={this.props.onItemsCopy}
onItemsDelete={this.props.onItemsDelete} onItemsDelete={this.props.onItemsDelete}
onFileTagChanged={this.props.onFileTagChanged} onFileTagChanged={this.props.onFileTagChanged}
showDirentDetail={this.props.showDirentDetail}
/> />
)} )}
</Fragment> </Fragment>