diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2016-07-26 09:59:03 +0200 |
---|---|---|
committer | Stas Vilchik <vilchiks@gmail.com> | 2016-07-26 09:59:11 +0200 |
commit | 8ff6ccecd8edb2b0e7f84058bb6a2ec7d01178a3 (patch) | |
tree | 2dd51371c9fcc4b46b05fdc3ec24abdacc483941 | |
parent | 97fae6de6b4edb242575ee19e099597d44a79541 (diff) | |
download | sonarqube-8ff6ccecd8edb2b0e7f84058bb6a2ec7d01178a3.tar.gz sonarqube-8ff6ccecd8edb2b0e7f84058bb6a2ec7d01178a3.zip |
add nice message when no results on permission pages
-rw-r--r-- | server/sonar-web/src/main/js/apps/permissions/shared/components/HoldersList.js | 13 | ||||
-rw-r--r-- | sonar-core/src/main/resources/org/sonar/l10n/core.properties | 1 |
2 files changed, 14 insertions, 0 deletions
diff --git a/server/sonar-web/src/main/js/apps/permissions/shared/components/HoldersList.js b/server/sonar-web/src/main/js/apps/permissions/shared/components/HoldersList.js index 63fb560ea89..ea5a6f1c4bb 100644 --- a/server/sonar-web/src/main/js/apps/permissions/shared/components/HoldersList.js +++ b/server/sonar-web/src/main/js/apps/permissions/shared/components/HoldersList.js @@ -21,6 +21,7 @@ import React from 'react'; import UserHolder from './UserHolder'; import GroupHolder from './GroupHolder'; import { TooltipsContainer } from '../../../../components/mixins/tooltips-mixin'; +import { translate } from '../../../../helpers/l10n'; export default class HoldersList extends React.Component { static propTypes = { @@ -73,6 +74,17 @@ export default class HoldersList extends React.Component { ); } + renderEmpty () { + const columns = this.props.permissions.length + 1; + return ( + <tr> + <td colSpan={columns}> + {translate('no_results_search')} + </td> + </tr> + ); + } + render () { const users = this.props.users.map(user => ( <UserHolder @@ -99,6 +111,7 @@ export default class HoldersList extends React.Component { <table className="data zebra permissions-table"> {this.renderTableHeader()} <tbody> + {users.length === 0 && groups.length === 0 && this.renderEmpty()} {users} {groups} </tbody> diff --git a/sonar-core/src/main/resources/org/sonar/l10n/core.properties b/sonar-core/src/main/resources/org/sonar/l10n/core.properties index c2ed6ed763c..414dab3f54c 100644 --- a/sonar-core/src/main/resources/org/sonar/l10n/core.properties +++ b/sonar-core/src/main/resources/org/sonar/l10n/core.properties @@ -242,6 +242,7 @@ new_window=New window no_data=No data no_lines_match_your_filter_criteria=No lines match your filter criteria. no_results=No results +no_results_search=No results. Try to modify the search query to get some results. not_authorized=You are not authorized. not_authorized_to_access_project=You are not authorized to access to this '{0}' project over_x_days=over {0} days |