aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorssjenka <ssjenka@ops-slave-centos7-1.internal.sonarsource.com>2016-07-27 08:01:51 +0200
committerssjenka <ssjenka@ops-slave-centos7-1.internal.sonarsource.com>2016-07-27 08:01:51 +0200
commite4ba85fe304aaad519e574b8f4e172b733389752 (patch)
treeeec8e39c67b4b5ea9dcaa749ac044dff61e1e336
parent536ef50c354725e0f742026863162a0d90e9d2fd (diff)
parent8ff6ccecd8edb2b0e7f84058bb6a2ec7d01178a3 (diff)
downloadsonarqube-e4ba85fe304aaad519e574b8f4e172b733389752.tar.gz
sonarqube-e4ba85fe304aaad519e574b8f4e172b733389752.zip
Automatic merge from branch-6.0
* origin/branch-6.0: add nice message when no results on permission pages
-rw-r--r--server/sonar-web/src/main/js/apps/permissions/shared/components/HoldersList.js13
-rw-r--r--sonar-core/src/main/resources/org/sonar/l10n/core.properties1
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 673543d3296..a1ca10f5d9a 100644
--- a/sonar-core/src/main/resources/org/sonar/l10n/core.properties
+++ b/sonar-core/src/main/resources/org/sonar/l10n/core.properties
@@ -243,6 +243,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