fix: Fix hint in List
Fix hint render in BaseList component Change-Id: I57ee116bfc94dbe64bea66e9b9d13912cb95ab52
This commit is contained in:
parent
b14d532eb9
commit
74d8165834
@ -49,6 +49,7 @@ export default class BaseList extends React.Component {
|
||||
filters: {},
|
||||
timeFilter: {},
|
||||
autoRefresh: true,
|
||||
newHints: false,
|
||||
};
|
||||
|
||||
this.dataTimerTransition = null;
|
||||
@ -711,7 +712,7 @@ export default class BaseList extends React.Component {
|
||||
} else {
|
||||
this.setRefreshdataTimerAuto();
|
||||
}
|
||||
this.updateHints(datas);
|
||||
this.updateHintsByDatas(datas);
|
||||
return datas;
|
||||
};
|
||||
|
||||
@ -862,7 +863,17 @@ export default class BaseList extends React.Component {
|
||||
onCloseSuccessHint = () => {};
|
||||
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
updateHints(datas) {}
|
||||
updateHintsByOthers() {
|
||||
if (this.updateHints) {
|
||||
this.updateHints();
|
||||
this.setState({
|
||||
newHints: true,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
updateHintsByDatas(datas) {}
|
||||
|
||||
init() {
|
||||
this.store = { list: {} };
|
||||
@ -1048,6 +1059,16 @@ export default class BaseList extends React.Component {
|
||||
}
|
||||
|
||||
renderHint() {
|
||||
const { newHints } = this.state;
|
||||
if (
|
||||
!newHints &&
|
||||
!this.infoMessage &&
|
||||
!this.warnMessage &&
|
||||
!this.successMessage &&
|
||||
!this.errorMessage
|
||||
) {
|
||||
return null;
|
||||
}
|
||||
return (
|
||||
<div className={classnames(styles.hints, 'list-hints')}>
|
||||
{this.renderInfoHint()}
|
||||
|
@ -50,7 +50,6 @@ export default class Subnets extends Base {
|
||||
} else {
|
||||
this.setRefreshdataTimerAuto();
|
||||
}
|
||||
this.updateHints(datas);
|
||||
const ret = datas.map((item) => {
|
||||
const usageDetail = this.subnet_ip_availability.find(
|
||||
(i) => i.subnet_id === item.id
|
||||
|
Loading…
Reference in New Issue
Block a user