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