aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrégoire Aubert <gregoire.aubert@sonarsource.com>2017-10-04 14:19:40 +0200
committerGrégoire Aubert <gregoire.aubert@sonarsource.com>2017-10-05 10:40:08 +0200
commit07b59f8361992acb5da2dd0ae4fbb08979bc691b (patch)
treea7b9a14b88fb685adaea98664685022ef5e4df5e
parenta9d2422b125b9d89cd8efeef69b43439d41d0bf5 (diff)
downloadsonarqube-07b59f8361992acb5da2dd0ae4fbb08979bc691b.tar.gz
sonarqube-07b59f8361992acb5da2dd0ae4fbb08979bc691b.zip
Remove focus after click on system info page download button
-rw-r--r--server/sonar-web/src/main/js/apps/system/components/PageActions.tsx3
-rw-r--r--server/sonar-web/src/main/js/apps/system/components/__tests__/__snapshots__/PageActions-test.tsx.snap2
2 files changed, 5 insertions, 0 deletions
diff --git a/server/sonar-web/src/main/js/apps/system/components/PageActions.tsx b/server/sonar-web/src/main/js/apps/system/components/PageActions.tsx
index ccb612945ce..60d9e1ba6aa 100644
--- a/server/sonar-web/src/main/js/apps/system/components/PageActions.tsx
+++ b/server/sonar-web/src/main/js/apps/system/components/PageActions.tsx
@@ -70,6 +70,8 @@ export default class PageActions extends React.PureComponent<Props, State> {
handleServerRestartOpen = () => this.setState({ openRestartForm: true });
handleServerRestartClose = () => this.setState({ openRestartForm: false });
+ removeElementFocus = (event: React.SyntheticEvent<HTMLElement>) => event.currentTarget.blur();
+
render() {
const infoUrl = getBaseUrl() + '/api/system/info';
const logsUrl = getBaseUrl() + '/api/system/logs';
@@ -137,6 +139,7 @@ export default class PageActions extends React.PureComponent<Props, State> {
href={infoUrl}
id="download-link"
className="button spacer-left"
+ onClick={this.removeElementFocus}
download="sonarqube_system_info.json"
target="_blank">
{translate('system.download_system_info')}
diff --git a/server/sonar-web/src/main/js/apps/system/components/__tests__/__snapshots__/PageActions-test.tsx.snap b/server/sonar-web/src/main/js/apps/system/components/__tests__/__snapshots__/PageActions-test.tsx.snap
index 42536fee501..7677001d16f 100644
--- a/server/sonar-web/src/main/js/apps/system/components/__tests__/__snapshots__/PageActions-test.tsx.snap
+++ b/server/sonar-web/src/main/js/apps/system/components/__tests__/__snapshots__/PageActions-test.tsx.snap
@@ -84,6 +84,7 @@ exports[`should render correctly 1`] = `
download="sonarqube_system_info.json"
href="/api/system/info"
id="download-link"
+ onClick={[Function]}
target="_blank"
>
system.download_system_info
@@ -126,6 +127,7 @@ exports[`should render without restart and log download 1`] = `
download="sonarqube_system_info.json"
href="/api/system/info"
id="download-link"
+ onClick={[Function]}
target="_blank"
>
system.download_system_info