diff options
author | Stas Vilchik <stas.vilchik@sonarsource.com> | 2017-11-03 15:12:29 +0100 |
---|---|---|
committer | Stas Vilchik <stas.vilchik@sonarsource.com> | 2017-11-06 08:55:48 +0100 |
commit | f740cb5fde92c4c77aab732390cc2b7a2b39e813 (patch) | |
tree | b88158014663e8ca30faa18865e90dfa2b14bd39 /server/sonar-web | |
parent | 5326c7cc97db482803c11f06a45a7e497824765d (diff) | |
download | sonarqube-f740cb5fde92c4c77aab732390cc2b7a2b39e813.tar.gz sonarqube-f740cb5fde92c4c77aab732390cc2b7a2b39e813.zip |
SONAR-10044 fix projects permalink redirection
Diffstat (limited to 'server/sonar-web')
-rw-r--r-- | server/sonar-web/src/main/js/apps/projects/components/AllProjects.tsx | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/server/sonar-web/src/main/js/apps/projects/components/AllProjects.tsx b/server/sonar-web/src/main/js/apps/projects/components/AllProjects.tsx index 65bdfac3f43..cd5f60bd1eb 100644 --- a/server/sonar-web/src/main/js/apps/projects/components/AllProjects.tsx +++ b/server/sonar-web/src/main/js/apps/projects/components/AllProjects.tsx @@ -71,7 +71,9 @@ export default class AllProjects extends React.PureComponent<Props, State> { } this.handleQueryChange(true); const footer = document.getElementById('footer'); - footer && footer.classList.add('page-footer-with-sidebar'); + if (footer) { + footer.classList.add('page-footer-with-sidebar'); + } } componentDidUpdate(prevProps: Props) { @@ -83,7 +85,9 @@ export default class AllProjects extends React.PureComponent<Props, State> { componentWillUnmount() { this.mounted = false; const footer = document.getElementById('footer'); - footer && footer.classList.remove('page-footer-with-sidebar'); + if (footer) { + footer.classList.remove('page-footer-with-sidebar'); + } } getView = () => this.state.query.view || 'overall'; @@ -92,7 +96,8 @@ export default class AllProjects extends React.PureComponent<Props, State> { getSort = () => this.state.query.sort || 'name'; - isFiltered = () => Object.values(this.state.query).some(value => value !== undefined); + isFiltered = (query = this.state.query) => + Object.values(query).some(value => value !== undefined); stopLoading = () => { if (this.mounted) { @@ -197,7 +202,7 @@ export default class AllProjects extends React.PureComponent<Props, State> { const savedOptionsSet = savedOptions.sort || savedOptions.view || savedOptions.visualization; // if there is no filter, but there are saved preferences in the localStorage - if (initialMount && !this.isFiltered() && savedOptionsSet) { + if (initialMount && !this.isFiltered(query) && savedOptionsSet) { this.context.router.replace({ pathname: this.props.location.pathname, query: savedOptions }); } else { this.fetchProjects(query); |