1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-21 19:37:28 +00:00

feat: react warning (#7467)

Co-authored-by: 杨国璇 <ygx@Hello-word.local>
This commit is contained in:
杨国璇
2025-02-17 11:50:29 +08:00
committed by GitHub
parent 91b9a7840f
commit 06410d217d
33 changed files with 105 additions and 154 deletions

View File

@@ -20,7 +20,7 @@ const TagsEditor = ({
record,
value: oldValue,
editorPosition = { left: 0, top: 0 },
canAddTag,
canAddTag = true,
onPressTab,
addNewTag,
selectTag,
@@ -268,8 +268,4 @@ TagsEditor.propTypes = {
deselectTag: PropTypes.func,
};
TagsEditor.defaultProps = {
canAddTag: false,
};
export default TagsEditor;

View File

@@ -10,19 +10,19 @@ const SFTable = ({
table,
visibleColumns,
headerSettings,
recordsIds,
groupbys,
groups,
showSequenceColumn,
isGroupView,
showRecordAsTree,
recordsIds = [],
groupbys = [],
groups = [],
showSequenceColumn = true,
isGroupView = false,
showRecordAsTree = false,
recordsTree,
treeNodeKeyRecordIdMap,
keyTreeNodeFoldedMap,
noRecordsTipsText,
isLoadingMoreRecords,
hasMoreRecords,
showGridFooter,
isLoadingMoreRecords = false,
hasMoreRecords = false,
showGridFooter = true,
onGridKeyDown,
onGridKeyUp,
loadMore,
@@ -160,21 +160,4 @@ SFTable.propTypes = {
loadAll: PropTypes.func,
};
SFTable.defaultProps = {
recordsIds: [],
groupbys: [],
groups: [],
isGroupView: false,
showRecordAsTree: false,
showSequenceColumn: true,
hasMoreRecords: false,
isLoadingMoreRecords: false,
showGridFooter: true,
canModifyRecords: false,
supportCopy: false,
supportCut: false,
supportPaste: false,
supportDragFill: false,
};
export default SFTable;

View File

@@ -24,7 +24,7 @@ const Cell = ({
ColumnDropdownMenu,
column,
columnIndex,
style: propsStyle,
style: propsStyle = null,
draggingColumnKey,
draggingColumnIndex,
dragOverColumnKey,
@@ -233,10 +233,6 @@ const Cell = ({
);
};
Cell.defaultProps = {
style: null,
};
Cell.propTypes = {
groupOffsetLeft: PropTypes.number,
height: PropTypes.number,

View File

@@ -4,7 +4,16 @@ import { UncontrolledTooltip, DropdownItem } from 'reactstrap';
import classnames from 'classnames';
import { Icon } from '@seafile/sf-metadata-ui-component';
const ColumnDropdownItem = ({ disabled, iconName, target, title, tip, className, onChange, onMouseEnter }) => {
const ColumnDropdownItem = ({
disabled = false,
iconName,
target,
title,
tip,
className = '',
onChange = () => {},
onMouseEnter = () => {},
}) => {
const [isShowToolTip, setToolTipShow] = useState(false);
useEffect(() => {
@@ -62,11 +71,4 @@ ColumnDropdownItem.propTypes = {
onMouseEnter: PropTypes.func.isRequired,
};
ColumnDropdownItem.defaultProps = {
onChange: () => {},
onMouseEnter: () => {},
disabled: false,
className: '',
};
export default ColumnDropdownItem;

View File

@@ -21,7 +21,7 @@ const HeaderDropdownMenu = ({ column, ColumnDropdownMenu, customProps }) => {
const renderDropdownMenu = useCallback(() => {
return (
<DropdownMenu
positionFixed
positionFixed={true}
flip={false}
modifiers={[{ name: 'preventOverflow', options: { boundary: document.body } }]}
className="sf-table-dropdown-menu"

View File

@@ -10,7 +10,7 @@ import { NODE_CONTENT_LEFT_INDENT, NODE_ICON_LEFT_INDENT } from '../../../../con
import './index.css';
const Cell = React.memo(({
needBindEvents,
needBindEvents = true,
column,
record,
groupRecordIndex,
@@ -193,10 +193,6 @@ const Cell = React.memo(({
return !cellCompare(props, nextProps);
});
Cell.defaultProps = {
needBindEvents: true
};
Cell.propTypes = {
frozen: PropTypes.bool,
isCellSelected: PropTypes.bool,