瀏覽代碼

SONAR-21455 Fix loading back project list with incorrect data being loaded

tags/10.4.0.87286
7PH 4 月之前
父節點
當前提交
42d11b5f12
共有 1 個檔案被更改,包括 19 行新增20 行删除
  1. 19
    20
      server/sonar-web/src/main/js/apps/projects/components/AllProjects.tsx

+ 19
- 20
server/sonar-web/src/main/js/apps/projects/components/AllProjects.tsx 查看文件

@@ -105,24 +105,6 @@ export class AllProjects extends React.PureComponent<Props, State> {
removeSideBarClass();
}

fetchProjects = (query: Query) => {
const { isFavorite } = this.props;

this.setState({ loading: true, query });

fetchProjects({ isFavorite, query }).then((response) => {
if (this.mounted) {
this.setState({
facets: response.facets,
loading: false,
pageIndex: 1,
projects: response.projects,
total: response.total,
});
}
}, this.stopLoading);
};

fetchMoreProjects = () => {
const { isFavorite } = this.props;
const { pageIndex, projects, query } = this.state;
@@ -192,9 +174,26 @@ export class AllProjects extends React.PureComponent<Props, State> {
};

handleQueryChange() {
const query = parseUrlQuery(this.props.location.query);
const { isFavorite } = this.props;

const queryRaw = this.props.location.query;
const query = parseUrlQuery(queryRaw);

this.setState({ loading: true, query });

this.fetchProjects(query);
fetchProjects({ isFavorite, query }).then((response) => {
// We ignore the request if the query changed since the time it was initiated
// If that happened, another query will be initiated anyway
if (this.mounted && queryRaw === this.props.location.query) {
this.setState({
facets: response.facets,
loading: false,
pageIndex: 1,
projects: response.projects,
total: response.total,
});
}
}, this.stopLoading);
}

handleSortChange = (sort: string, desc: boolean) => {

Loading…
取消
儲存