mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-03 07:55:36 +00:00
fix: metadata bug
This commit is contained in:
@@ -107,7 +107,7 @@ class DirentDetails extends React.Component {
|
|||||||
repoInfo={this.props.currentRepoInfo}
|
repoInfo={this.props.currentRepoInfo}
|
||||||
dirent={dirent}
|
dirent={dirent}
|
||||||
direntDetail={direntDetail}
|
direntDetail={direntDetail}
|
||||||
path={this.props.dirent ? path + '/' + dirent.name : path}
|
path={this.props.dirent ? Utils.joinPath(path, dirent.name) : path}
|
||||||
/>
|
/>
|
||||||
:
|
:
|
||||||
<FileDetails
|
<FileDetails
|
||||||
|
@@ -1,10 +1,9 @@
|
|||||||
import React, { Fragment, memo, useCallback, useMemo } from 'react';
|
import React, { Fragment, useCallback, useMemo } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import classnames from 'classnames';
|
import classnames from 'classnames';
|
||||||
import { DragSource, DropTarget } from 'react-dnd';
|
import { DragSource, DropTarget } from 'react-dnd';
|
||||||
import { Icon, CustomizeSelect } from '@seafile/sf-metadata-ui-component';
|
import { Icon, CustomizeSelect } from '@seafile/sf-metadata-ui-component';
|
||||||
import { gettext } from '../../../../../utils/constants';
|
import { gettext } from '../../../../../utils/constants';
|
||||||
import ObjectUtils from '../../../../utils/object-utils';
|
|
||||||
import { getColumnByKey } from '../../../../utils/column';
|
import { getColumnByKey } from '../../../../utils/column';
|
||||||
import { COLUMNS_ICON_CONFIG, SORT_TYPE, SORT_COLUMN_OPTIONS } from '../../../../constants';
|
import { COLUMNS_ICON_CONFIG, SORT_TYPE, SORT_COLUMN_OPTIONS } from '../../../../constants';
|
||||||
import { getGroupbyGranularityByColumn, isShowGroupCountType, getSelectedCountType, getDefaultCountType } from '../../../../utils/group';
|
import { getGroupbyGranularityByColumn, isShowGroupCountType, getSelectedCountType, getDefaultCountType } from '../../../../utils/group';
|
||||||
@@ -59,7 +58,7 @@ const dropCollect = (connect, monitor) => ({
|
|||||||
sort_type: 'xxx',
|
sort_type: 'xxx',
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
const GroupbyItem = memo(({
|
const GroupbyItem = ({
|
||||||
isOver, isDragging, canDrop, connectDragSource, connectDragPreview, connectDropTarget,
|
isOver, isDragging, canDrop, connectDragSource, connectDragPreview, connectDropTarget,
|
||||||
showDragBtn, index, readOnly, groupby, columns, onDelete, onUpdate
|
showDragBtn, index, readOnly, groupby, columns, onDelete, onUpdate
|
||||||
}) => {
|
}) => {
|
||||||
@@ -220,16 +219,7 @@ const GroupbyItem = memo(({
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
}, (props, nextProps) => {
|
};
|
||||||
const isChanged =
|
|
||||||
props.index !== nextProps.index ||
|
|
||||||
!ObjectUtils.isSameObject(props.groupby, nextProps.groupby) ||
|
|
||||||
props.isDragging !== nextProps.isDragging ||
|
|
||||||
props.isOver !== nextProps.isOver ||
|
|
||||||
props.canDrop !== nextProps.canDrop ||
|
|
||||||
props.showDragBtn !== nextProps.showDragBtn;
|
|
||||||
return !isChanged;
|
|
||||||
});
|
|
||||||
|
|
||||||
GroupbyItem.propTypes = {
|
GroupbyItem.propTypes = {
|
||||||
index: PropTypes.number,
|
index: PropTypes.number,
|
||||||
|
@@ -220,20 +220,20 @@ const HeaderDropdownMenu = ({ column, view, renameColumn, modifyColumnData, dele
|
|||||||
onChange={openOptionPopover}
|
onChange={openOptionPopover}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{type === CellType.NUMBER && (
|
{/* {type === CellType.NUMBER && (
|
||||||
|
TODO:
|
||||||
<DropdownItem
|
<DropdownItem
|
||||||
disabled={!canModifyColumnData}
|
disabled={canModifyColumnData}
|
||||||
target="sf-metadata-edit-column-format"
|
target="sf-metadata-edit-column-format"
|
||||||
iconName="set-up"
|
iconName="set-up"
|
||||||
title={gettext('Edit format settings')}
|
title={gettext('Edit format settings')}
|
||||||
tip={gettext('You do not have permission')}
|
onChange={() => {}}
|
||||||
onChange={openOptionPopover}
|
|
||||||
/>
|
/>
|
||||||
)}
|
)} */}
|
||||||
{type === CellType.DATE && (
|
{type === CellType.DATE && (
|
||||||
<>{renderDateFormat(canModifyColumnData)}</>
|
<>{renderDateFormat(canModifyColumnData)}</>
|
||||||
)}
|
)}
|
||||||
{[CellType.DATE, CellType.SINGLE_SELECT, CellType.NUMBER, CellType.MULTIPLE_SELECT].includes(column.type) && (
|
{[CellType.DATE, CellType.SINGLE_SELECT, CellType.MULTIPLE_SELECT].includes(column.type) && (
|
||||||
<DefaultDropdownItem key="divider-item" divider />
|
<DefaultDropdownItem key="divider-item" divider />
|
||||||
)}
|
)}
|
||||||
<DropdownItem
|
<DropdownItem
|
||||||
|
@@ -1551,7 +1551,7 @@ class LibContentView extends React.Component {
|
|||||||
currentDirent: dirent && dirent.isActive ? null : dirent
|
currentDirent: dirent && dirent.isActive ? null : dirent
|
||||||
});
|
});
|
||||||
let direntList = this.state.direntList.map(item => {
|
let direntList = this.state.direntList.map(item => {
|
||||||
if (item.name === dirent.name) {
|
if (dirent && item.name === dirent.name) {
|
||||||
item.isSelected = !item.isSelected;
|
item.isSelected = !item.isSelected;
|
||||||
}
|
}
|
||||||
return item;
|
return item;
|
||||||
@@ -2044,7 +2044,8 @@ class LibContentView extends React.Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
getMarkDownFileName = () => {
|
getMarkDownFileName = () => {
|
||||||
return this.markdownFileName || this.state.currentDirent.name || '';
|
const { currentDirent } = this.state;
|
||||||
|
return this.markdownFileName || (currentDirent && currentDirent.name) || '';
|
||||||
};
|
};
|
||||||
|
|
||||||
openMarkdownFile = () => {
|
openMarkdownFile = () => {
|
||||||
@@ -2144,7 +2145,7 @@ class LibContentView extends React.Component {
|
|||||||
direntList,
|
direntList,
|
||||||
selectedDirentList: []
|
selectedDirentList: []
|
||||||
});
|
});
|
||||||
const dirent = {};
|
const dirent = null;
|
||||||
this.onDirentSelected(dirent);
|
this.onDirentSelected(dirent);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user