From c356e214784a79f988d785021f6bf901aa34601b Mon Sep 17 00:00:00 2001 From: zhangjingwei Date: Fri, 17 Nov 2023 16:00:43 +0800 Subject: [PATCH] feat: update refresh detail top without silence 1. For some list tab in the detail page, when submit actions in the list tab, the detail info and the list tab is better to refresh without silence. 2. Refresh the whole user detail page when the set/remove default project of the user Change-Id: I2fcbe8d79eb90250ed05509540bb2e29a310755d --- src/containers/List/index.jsx | 6 +++++- src/containers/TabDetail/index.jsx | 4 ++-- src/pages/identity/containers/Project/index.jsx | 4 ++++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/containers/List/index.jsx b/src/containers/List/index.jsx index 1150c063..4f10fc8b 100644 --- a/src/containers/List/index.jsx +++ b/src/containers/List/index.jsx @@ -443,6 +443,10 @@ export default class BaseList extends React.Component { return null; } + get refreshDetailDataWithSilence() { + return true; + } + setRefreshDataTimerTransition = () => { this.stopRefreshAuto(); if (this.dataTimerTransition) { @@ -930,7 +934,7 @@ export default class BaseList extends React.Component { refreshDetailData = () => { const { refreshDetail } = this.props; - refreshDetail && refreshDetail(); + refreshDetail && refreshDetail(this.refreshDetailDataWithSilence); }; handleRefresh = (force) => { diff --git a/src/containers/TabDetail/index.jsx b/src/containers/TabDetail/index.jsx index 0c99f36e..0a6cc431 100644 --- a/src/containers/TabDetail/index.jsx +++ b/src/containers/TabDetail/index.jsx @@ -294,8 +294,8 @@ export default class DetailBase extends React.Component { this.fetchData(params, silent); }; - refreshDetailByTab = () => { - this.fetchDataWithPolicy(true); + refreshDetailByTab = (silence = true) => { + this.fetchDataWithPolicy(silence); }; refreshDetailByAction = (silence) => { diff --git a/src/pages/identity/containers/Project/index.jsx b/src/pages/identity/containers/Project/index.jsx index 934af6b4..07ad4f09 100644 --- a/src/pages/identity/containers/Project/index.jsx +++ b/src/pages/identity/containers/Project/index.jsx @@ -60,6 +60,10 @@ export class Projects extends Base { return this.inUserDetail; } + get refreshDetailDataWithSilence() { + return !this.inUserDetail; + } + getUserProjectRole = (record) => { // return [{role, groups}] const { users = {}, groups = {} } = record || {};