mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-20 10:58:33 +00:00
fix warnings and rename unsafe lifecycle function (#5814)
This commit is contained in:
@@ -38,7 +38,7 @@ class SearchInput extends Component {
|
||||
}
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
UNSAFE_componentWillReceiveProps(nextProps) {
|
||||
if (nextProps.value !== this.props.value) {
|
||||
this.setState({searchValue: nextProps.value});
|
||||
}
|
||||
|
@@ -23,7 +23,7 @@ class DeleteRepoDialog extends Component {
|
||||
};
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
UNSAFE_componentWillReceiveProps(nextProps) {
|
||||
if (!nextProps.isRepoDeleted) {
|
||||
this.setState({isRequestSended: false});
|
||||
}
|
||||
|
@@ -22,7 +22,7 @@ class SearchInput extends Component {
|
||||
}
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
UNSAFE_componentWillReceiveProps(nextProps) {
|
||||
if (nextProps.value !== this.props.value) {
|
||||
this.setState({searchValue: nextProps.value});
|
||||
}
|
||||
|
@@ -23,7 +23,7 @@ class Rename extends React.Component {
|
||||
this.newInput = React.createRef();
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
UNSAFE_componentWillMount() {
|
||||
this.setState({newName: this.props.currentNode.object.name});
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ class Rename extends React.Component {
|
||||
this.changeState(currentNode);
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
UNSAFE_componentWillReceiveProps(nextProps) {
|
||||
this.changeState(nextProps.currentNode);
|
||||
}
|
||||
|
||||
|
@@ -23,7 +23,7 @@ class Rename extends React.Component {
|
||||
this.newInput = React.createRef();
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
UNSAFE_componentWillMount() {
|
||||
this.setState({newName: this.props.dirent.name});
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ class Rename extends React.Component {
|
||||
this.changeState(dirent);
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
UNSAFE_componentWillReceiveProps(nextProps) {
|
||||
this.changeState(nextProps.dirent);
|
||||
}
|
||||
|
||||
|
@@ -54,7 +54,7 @@ class DirColumnNav extends React.Component {
|
||||
this.isNodeMenuShow = true;
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
UNSAFE_componentWillReceiveProps(nextProps) {
|
||||
this.setState({opNode: nextProps.currentNode});
|
||||
}
|
||||
|
||||
|
@@ -135,7 +135,7 @@ class DirColumnView extends React.Component {
|
||||
return '';
|
||||
};
|
||||
|
||||
componentWillMount() {
|
||||
UNSAFE_componentWillMount() {
|
||||
let rate = this.getCookie('navRate');
|
||||
if (rate) {
|
||||
this.setState({
|
||||
|
@@ -36,7 +36,7 @@ class DirentDetail extends React.Component {
|
||||
this.loadDirentInfo(dirent, path, repoID);
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
UNSAFE_componentWillReceiveProps(nextProps) {
|
||||
let { dirent, path, repoID } = nextProps;
|
||||
if (this.props.dirent !== nextProps.dirent) {
|
||||
this.loadDirentInfo(dirent, path, repoID);
|
||||
|
@@ -26,7 +26,7 @@ class LibDetail extends React.Component {
|
||||
this.getFileCounts(repo);
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
UNSAFE_componentWillReceiveProps(nextProps) {
|
||||
if (nextProps.currentRepo.repo_id !== this.props.currentRepo.repo_id) {
|
||||
this.getFileCounts(nextProps.currentRepo);
|
||||
}
|
||||
|
@@ -42,7 +42,7 @@ class DirentGridItem extends React.Component {
|
||||
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
UNSAFE_componentWillReceiveProps(nextProps) {
|
||||
this.setState({isGridSelected: false}, () => {
|
||||
if (nextProps.activeDirent && nextProps.activeDirent.name === nextProps.dirent.name) {
|
||||
this.setState({isGridSelected: true});
|
||||
|
@@ -95,7 +95,7 @@ class DirentListItem extends React.Component {
|
||||
this.tagListTitleID = `tag-list-title-${uuidv4()}`;
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
UNSAFE_componentWillReceiveProps(nextProps) {
|
||||
if (nextProps.isItemFreezed !== this.props.isItemFreezed && !nextProps.isItemFreezed) {
|
||||
this.setState({
|
||||
highlight: false,
|
||||
|
@@ -40,7 +40,7 @@ class ItemDropdownMenu extends React.Component {
|
||||
this.setState({menuList: menuList});
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) { // for toolbar item operation
|
||||
UNSAFE_componentWillReceiveProps(nextProps) { // for toolbar item operation
|
||||
let { item } = nextProps;
|
||||
if (item.name !== this.props.item.name) {
|
||||
let menuList = this.props.getMenuList(item);
|
||||
|
@@ -23,7 +23,7 @@ class UploadListItem extends React.Component {
|
||||
};
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
UNSAFE_componentWillReceiveProps(nextProps) {
|
||||
let { resumableFile } = nextProps;
|
||||
let uploadState = UPLOAD_UPLOADING;
|
||||
|
||||
|
@@ -42,7 +42,7 @@ class IndexContentViewer extends React.Component {
|
||||
};
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
UNSAFE_componentWillMount() {
|
||||
this.getRootNode();
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ class IndexContentViewer extends React.Component {
|
||||
this.bindClickEvent();
|
||||
}
|
||||
|
||||
componentWillReceiveProps() {
|
||||
UNSAFE_componentWillReceiveProps() {
|
||||
this.removeClickEvent();
|
||||
}
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import CodeMirror from '@uiw/react-codemirror';
|
||||
import { EditorView } from "@codemirror/view"
|
||||
import { EditorView } from '@codemirror/view';
|
||||
import { loadLanguage } from '@uiw/codemirror-extensions-langs';
|
||||
import { Utils } from '../../utils/utils';
|
||||
|
||||
|
@@ -75,7 +75,7 @@ class SelectEditor extends React.Component {
|
||||
});
|
||||
};
|
||||
|
||||
componentWillReceiveProps() {
|
||||
UNSAFE_componentWillReceiveProps() {
|
||||
this.setOptions();
|
||||
}
|
||||
|
||||
|
@@ -9,7 +9,6 @@ import CommonOperationConfirmationDialog from '../../components/dialog/common-op
|
||||
|
||||
const propTypes = {
|
||||
item: PropTypes.object.isRequired,
|
||||
permissionOptions: PropTypes.array,
|
||||
showLinkDetails : PropTypes.func.isRequired,
|
||||
toggleSelectLink: PropTypes.func.isRequired,
|
||||
deleteLink: PropTypes.func.isRequired
|
||||
@@ -80,7 +79,7 @@ class LinkItem extends React.Component {
|
||||
|
||||
render() {
|
||||
const { isItemOpVisible } = this.state;
|
||||
const { item, permissionOptions } = this.props;
|
||||
const { item } = this.props;
|
||||
const { isSelected = false, permissions, link, expire_date } = item;
|
||||
const currentPermission = Utils.getShareLinkPermissionStr(permissions);
|
||||
return (
|
||||
|
@@ -23,7 +23,7 @@ class UploadListItem extends React.Component {
|
||||
};
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
UNSAFE_componentWillReceiveProps(nextProps) {
|
||||
let { resumableFile } = nextProps;
|
||||
let uploadState = UPLOAD_UPLOADING;
|
||||
|
||||
|
@@ -30,7 +30,7 @@ class TermsPreviewWidget extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
UNSAFE_componentWillReceiveProps(nextProps) {
|
||||
let mdFile = nextProps.content;
|
||||
this.formatterLongTextValue(mdFile);
|
||||
}
|
||||
|
@@ -44,7 +44,7 @@ class TreeNodeView extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
UNSAFE_componentWillReceiveProps(nextProps) {
|
||||
if (!nextProps.isItemFreezed) {
|
||||
this.setState({
|
||||
isShowOperationMenu: false,
|
||||
|
@@ -43,7 +43,7 @@ class WikiMarkdownViewer extends React.Component {
|
||||
this.getTitlesInfo();
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
UNSAFE_componentWillReceiveProps(nextProps) {
|
||||
if (this.props.markdownContent === nextProps.markdownContent) {
|
||||
return;
|
||||
}
|
||||
|
@@ -50,7 +50,7 @@ class WikiOutline extends React.Component {
|
||||
};
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
UNSAFE_componentWillReceiveProps(nextProps) {
|
||||
let _this = this;
|
||||
let activeId = nextProps.activeId;
|
||||
let navItems = nextProps.navItems;
|
||||
|
Reference in New Issue
Block a user