aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorssjenka <ssjenka@ops-slave-centos7-1.internal.sonarsource.com>2016-09-23 08:01:50 +0200
committerssjenka <ssjenka@ops-slave-centos7-1.internal.sonarsource.com>2016-09-23 08:01:50 +0200
commit14e7b33a8c1a1ea992e6dc171b8648cb129202af (patch)
tree312207d211a5ff2e25692ba35a8590ebb1196376
parent1254f51378c109ab72392723926df8e4c5050f65 (diff)
parentf1d39edb71ebda9fbca85962abb6ec0046521757 (diff)
downloadsonarqube-14e7b33a8c1a1ea992e6dc171b8648cb129202af.tar.gz
sonarqube-14e7b33a8c1a1ea992e6dc171b8648cb129202af.zip
Automatic merge from branch-6.1
* origin/branch-6.1: Fix Javadoc of org.sonar.api.batch.sensor.highlighting.TypeOfText SONAR-5856 add wildcards help fix image paths update wording on quality profiles page SONAR-8021 fix "null" error SONAR-5856 fix default value for boolean fields
-rw-r--r--server/sonar-web/src/main/js/apps/settings/__tests__/utils-test.js14
-rw-r--r--server/sonar-web/src/main/js/apps/settings/components/App.js5
-rw-r--r--server/sonar-web/src/main/js/apps/settings/components/WildcardsHelp.js124
-rw-r--r--server/sonar-web/src/main/js/apps/settings/utils.js3
-rw-r--r--server/sonar-web/src/main/less/components/navigator/base.less4
-rw-r--r--server/sonar-web/src/main/less/components/navigator/filters.less4
-rw-r--r--server/sonar-web/src/main/less/deprecated.less10
-rw-r--r--server/sonar-web/src/main/less/select2-sonar.less6
-rwxr-xr-xserver/sonar-web/src/main/less/select2.less16
-rw-r--r--server/sonar-web/src/main/less/style.less36
-rw-r--r--sonar-core/src/main/resources/org/sonar/l10n/core.properties2
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/highlighting/TypeOfText.java2
12 files changed, 183 insertions, 43 deletions
diff --git a/server/sonar-web/src/main/js/apps/settings/__tests__/utils-test.js b/server/sonar-web/src/main/js/apps/settings/__tests__/utils-test.js
index 4a401058aff..6e27ddf5300 100644
--- a/server/sonar-web/src/main/js/apps/settings/__tests__/utils-test.js
+++ b/server/sonar-web/src/main/js/apps/settings/__tests__/utils-test.js
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import { getEmptyValue } from '../utils';
+import { getEmptyValue, getDefaultValue } from '../utils';
import { TYPE_PROPERTY_SET, TYPE_STRING, TYPE_SINGLE_SELECT_LIST, TYPE_BOOLEAN } from '../constants';
const fields = [
@@ -41,3 +41,15 @@ describe('#getEmptyValue()', () => {
expect(getEmptyValue(setting)).toEqual([null]);
});
});
+
+describe('#getDefaultValue()', () => {
+ const check = (parentValue, expected) => {
+ const setting = { definition: { type: TYPE_BOOLEAN }, parentValue };
+ expect(getDefaultValue(setting)).toEqual(expected);
+ };
+
+ it('should work for boolean field when passing true', () => check(true, 'settings.boolean.true'));
+ it('should work for boolean field when passing "true"', () => check('true', 'settings.boolean.true'));
+ it('should work for boolean field when passing false', () => check(false, 'settings.boolean.false'));
+ it('should work for boolean field when passing "false"', () => check('false', 'settings.boolean.false'));
+});
diff --git a/server/sonar-web/src/main/js/apps/settings/components/App.js b/server/sonar-web/src/main/js/apps/settings/components/App.js
index 424675ba502..c80dcbfc680 100644
--- a/server/sonar-web/src/main/js/apps/settings/components/App.js
+++ b/server/sonar-web/src/main/js/apps/settings/components/App.js
@@ -24,6 +24,7 @@ import PageHeader from './PageHeader';
import CategoryDefinitionsList from './CategoryDefinitionsList';
import AllCategoriesList from './AllCategoriesList';
import GlobalMessagesContainer from './GlobalMessagesContainer';
+import WildcardsHelp from './WildcardsHelp';
import { fetchSettings } from '../store/actions';
import { getDefaultCategory } from '../store/rootReducer';
import '../styles.css';
@@ -83,6 +84,10 @@ class App extends React.Component {
<CategoryDefinitionsList
component={this.props.component}
category={selectedCategory}/>
+
+ {selectedCategory === 'exclusions' && (
+ <WildcardsHelp/>
+ )}
</div>
</div>
</div>
diff --git a/server/sonar-web/src/main/js/apps/settings/components/WildcardsHelp.js b/server/sonar-web/src/main/js/apps/settings/components/WildcardsHelp.js
new file mode 100644
index 00000000000..69375b91780
--- /dev/null
+++ b/server/sonar-web/src/main/js/apps/settings/components/WildcardsHelp.js
@@ -0,0 +1,124 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2016 SonarSource SA
+ * mailto:contact AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+import React from 'react';
+
+export default class WildcardsHelp extends React.Component {
+ render () {
+ return (
+ <div className="huge-spacer-top">
+ <h2 className="spacer-bottom">Wildcards</h2>
+ <p className="spacer-bottom">Following rules are applied:</p>
+
+ <table className="data spacer-bottom">
+ <tbody>
+ <tr>
+ <td>*</td>
+ <td>Match zero or more characters</td>
+ </tr>
+ <tr>
+ <td>**</td>
+ <td>Match zero or more directories</td>
+ </tr>
+ <tr>
+ <td>?</td>
+ <td>Match a single character</td>
+ </tr>
+ </tbody>
+ </table>
+
+ <table className="data zebra">
+ <thead>
+ <tr>
+ <th>Example</th>
+ <th>Matches</th>
+ <th>Does not match</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>**/foo/*.js</td>
+ <td>
+ <ul>
+ <li>src/foo/bar.js</li>
+ <li>lib/ui/foo/bar.js</li>
+ </ul>
+ </td>
+ <td>
+ <ul>
+ <li>src/bar.js</li>
+ <li>src/foo2/bar.js</li>
+ </ul>
+ </td>
+ </tr>
+ <tr>
+ <td>src/foo/*bar*.js</td>
+ <td>
+ <ul>
+ <li>src/foo/bar.js</li>
+ <li>src/foo/bar1.js</li>
+ <li>src/foo/bar123.js</li>
+ <li>src/foo/123bar123.js</li>
+ </ul>
+ </td>
+ <td>
+ <ul>
+ <li>src/foo/ui/bar.js</li>
+ <li>src/bar.js</li>
+ </ul>
+ </td>
+ </tr>
+ <tr>
+ <td>src/foo/**</td>
+ <td>
+ <ul>
+ <li>src/foo/bar.js</li>
+ <li>src/foo/ui/bar.js</li>
+ </ul>
+ </td>
+ <td>
+ <ul>
+ <li>src/bar/foo/bar.js</li>
+ <li>src/bar.js</li>
+ </ul>
+ </td>
+ </tr>
+ <tr>
+ <td>**/foo?.js
+ </td>
+ <td>
+ <ul>
+ <li>src/foo1.js</li>
+ <li>src/bar/foo1.js</li>
+ </ul>
+ </td>
+ <td>
+ <ul>
+ <li>src/foo.js</li>
+ <li>src/foo12.js</li>
+ <li>src/12foo3.js</li>
+ </ul>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ );
+ }
+}
diff --git a/server/sonar-web/src/main/js/apps/settings/utils.js b/server/sonar-web/src/main/js/apps/settings/utils.js
index 5b40e2ed999..7814c009c14 100644
--- a/server/sonar-web/src/main/js/apps/settings/utils.js
+++ b/server/sonar-web/src/main/js/apps/settings/utils.js
@@ -133,7 +133,8 @@ export function getDefaultValue (setting) {
}
if (setting.definition.type === TYPE_BOOLEAN) {
- return parentValue ? translate('settings.boolean.true') : translate('settings.boolean.false');
+ const isTrue = parentValue === true || parentValue === 'true';
+ return isTrue ? translate('settings.boolean.true') : translate('settings.boolean.false');
}
return parentValue;
diff --git a/server/sonar-web/src/main/less/components/navigator/base.less b/server/sonar-web/src/main/less/components/navigator/base.less
index b04fcc89f0b..86dc0e06fad 100644
--- a/server/sonar-web/src/main/less/components/navigator/base.less
+++ b/server/sonar-web/src/main/less/components/navigator/base.less
@@ -110,7 +110,7 @@
position: absolute;
z-index: @navigator-fetching-z-index;
top: 0; bottom: 0; left: 0; right: 0;
- background: #fff url(../../images/loading.gif) no-repeat 4px 4px;
+ background: #fff url(../../../images/loading.gif) no-repeat 4px 4px;
}
}
@@ -329,7 +329,7 @@
overflow: auto;
&.loading {
- background: @white url("../../images/loading.gif") no-repeat 4px 2px;
+ background: @white url("../../../images/loading.gif") no-repeat 4px 2px;
}
}
diff --git a/server/sonar-web/src/main/less/components/navigator/filters.less b/server/sonar-web/src/main/less/components/navigator/filters.less
index 23220dc6a03..51a52071fe1 100644
--- a/server/sonar-web/src/main/less/components/navigator/filters.less
+++ b/server/sonar-web/src/main/less/components/navigator/filters.less
@@ -301,7 +301,7 @@
display: block;
width: 16px;
height: 16px;
- background: #fff url(../../images/loading.gif) no-repeat center center;
+ background: #fff url(../../../images/loading.gif) no-repeat center center;
}
&.fetching-error {
@@ -331,7 +331,7 @@
.navigator-filter-favorite-toggle {
width: 16px;
height: @navigatorFiltersHeight;
- background: url(../../images/navigator/favorite-filters@2x.png) no-repeat center center;
+ background: url(../../../images/navigator/favorite-filters@2x.png) no-repeat center center;
background-size: 16px 14px;
}
diff --git a/server/sonar-web/src/main/less/deprecated.less b/server/sonar-web/src/main/less/deprecated.less
index c63f07efa0b..bb8bb2652e5 100644
--- a/server/sonar-web/src/main/less/deprecated.less
+++ b/server/sonar-web/src/main/less/deprecated.less
@@ -31,7 +31,7 @@
}
.loading {
- background: url("../../images/loading.gif") no-repeat 4px 2px;
+ background: url("../images/loading.gif") no-repeat 4px 2px;
color: #444;
padding: 3px 25px;
}
@@ -264,7 +264,7 @@ th.operations, td.operations {
}
.source_options td {
- background: url("../../images/sep12.png") no-repeat scroll 0 50% transparent;
+ background: url("../images/sep12.png") no-repeat scroll 0 50% transparent;
padding: 0 10px;
}
@@ -403,13 +403,13 @@ div.autocompleteNote {
}
a.external {
- background: url('../../images/links/external.png') no-repeat 100% 0;
+ background: url('../images/links/external.png') no-repeat 100% 0;
padding: 0 16px 0 0;
}
.fav {
display: inline-block;
- background: url('../../images/star.png') no-repeat 100% 0;
+ background: url('../images/star.png') no-repeat 100% 0;
width: 16px;
height: 16px;
vertical-align: text-bottom;
@@ -417,7 +417,7 @@ a.external {
.notfav {
display: inline-block;
- background: url('../../images/star_off.png') no-repeat 100% 0;
+ background: url('../images/star_off.png') no-repeat 100% 0;
width: 16px;
height: 16px;
vertical-align: text-bottom;
diff --git a/server/sonar-web/src/main/less/select2-sonar.less b/server/sonar-web/src/main/less/select2-sonar.less
index 606d3c06c41..196401120e8 100644
--- a/server/sonar-web/src/main/less/select2-sonar.less
+++ b/server/sonar-web/src/main/less/select2-sonar.less
@@ -20,9 +20,9 @@
@import (reference) "mixins";
@import (reference) "variables";
-@imagesPath: '../../images/select2.png';
-@imagesPath2x: '../../images/select2x2.png';
-@spinnerPath: '../../images/spinner.gif';
+@imagesPath: '../images/select2.png';
+@imagesPath2x: '../images/select2x2.png';
+@spinnerPath: '../images/spinner.gif';
.select2-container {
vertical-align: middle;
diff --git a/server/sonar-web/src/main/less/select2.less b/server/sonar-web/src/main/less/select2.less
index ead62d565a7..a3e3669d612 100755
--- a/server/sonar-web/src/main/less/select2.less
+++ b/server/sonar-web/src/main/less/select2.less
@@ -71,7 +71,7 @@ Version: 3.2 Timestamp: Mon Sep 10 10:38:04 PDT 2012
width: 12px;
height: 12px;
font-size: 1px;
- background: url('../../images/select2.png') right top no-repeat;
+ background: url('../images/select2.png') right top no-repeat;
cursor: pointer;
text-decoration: none;
border: 0;
@@ -119,7 +119,7 @@ Version: 3.2 Timestamp: Mon Sep 10 10:38:04 PDT 2012
}
.select2-container .select2-choice div b {
- background: url('../../images/select2.png') no-repeat 0 1px;
+ background: url('../images/select2.png') no-repeat 0 1px;
display: block;
width: 100%;
height: 100%;
@@ -143,7 +143,7 @@ Version: 3.2 Timestamp: Mon Sep 10 10:38:04 PDT 2012
}
.select2-search input {
- background: #fff url('../../images/select2.png') no-repeat 100% -22px, linear-gradient(to bottom, #fff 85%, #eee 99%);
+ background: #fff url('../images/select2.png') no-repeat 100% -22px, linear-gradient(to bottom, #fff 85%, #eee 99%);
padding: 4px 20px 4px 5px;
outline: 0;
border: 1px solid #aaa;
@@ -162,7 +162,7 @@ Version: 3.2 Timestamp: Mon Sep 10 10:38:04 PDT 2012
}
.select2-search input.select2-active {
- background: #ffff url('../../images/spinner.gif') no-repeat 100%, linear-gradient(to bottom, #fff 85%, #eee 99%);
+ background: #ffff url('../images/spinner.gif') no-repeat 100%, linear-gradient(to bottom, #fff 85%, #eee 99%);
}
.select2-container-active .select2-choice,
@@ -259,7 +259,7 @@ Version: 3.2 Timestamp: Mon Sep 10 10:38:04 PDT 2012
}
.select2-more-results.select2-active {
- background: #f4f4f4 url('../../images/spinner.gif') no-repeat 100%;
+ background: #f4f4f4 url('../images/spinner.gif') no-repeat 100%;
}
.select2-more-results {
@@ -331,7 +331,7 @@ Version: 3.2 Timestamp: Mon Sep 10 10:38:04 PDT 2012
}
.select2-container-multi .select2-choices .select2-search-field input.select2-active {
- background: #fff url('../../images/spinner.gif') no-repeat 100% !important;
+ background: #fff url('../images/spinner.gif') no-repeat 100% !important;
}
.select2-default {
@@ -368,7 +368,7 @@ Version: 3.2 Timestamp: Mon Sep 10 10:38:04 PDT 2012
width: 12px;
height: 13px;
font-size: 1px;
- background: url('../../images/select2.png') right top no-repeat;
+ background: url('../images/select2.png') right top no-repeat;
outline: none;
}
@@ -417,7 +417,7 @@ Version: 3.2 Timestamp: Mon Sep 10 10:38:04 PDT 2012
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
.select2-search input, .select2-search-choice-close, .select2-container .select2-choice abbr, .select2-container .select2-choice div b {
- background-image: url(../../images/select2x2.png) !important;
+ background-image: url(../images/select2x2.png) !important;
background-repeat: no-repeat !important;
background-size: 60px 40px !important;
}
diff --git a/server/sonar-web/src/main/less/style.less b/server/sonar-web/src/main/less/style.less
index 7434276f08b..5743af7c82e 100644
--- a/server/sonar-web/src/main/less/style.less
+++ b/server/sonar-web/src/main/less/style.less
@@ -151,7 +151,7 @@ ul.headerLine li {
}
ul.headerLine li.sep {
- background: url("../../images/sep12.png") no-repeat scroll 50% 50% transparent;
+ background: url("../images/sep12.png") no-repeat scroll 50% 50% transparent;
padding: 0 5px 0 5px;
}
@@ -167,39 +167,39 @@ select.withIcons option, span.withIcons {
}
option.status_open {
- background-image: url('../../images/status/OPEN.png');
+ background-image: url('../images/status/OPEN.png');
}
option.status_reopened {
- background-image: url('../../images/status/REOPENED.png');
+ background-image: url('../images/status/REOPENED.png');
}
option.status_resolved {
- background-image: url('../../images/status/RESOLVED.png');
+ background-image: url('../images/status/RESOLVED.png');
}
option.status_closed {
- background-image: url('../../images/status/CLOSED.png');
+ background-image: url('../images/status/CLOSED.png');
}
option.sev_INFO, span.sev_INFO {
- background-image: url('../../images/priority/INFO.png');
+ background-image: url('../images/priority/INFO.png');
}
option.sev_MINOR, span.sev_MINOR {
- background-image: url('../../images/priority/MINOR.png');
+ background-image: url('../images/priority/MINOR.png');
}
option.sev_MAJOR, span.sev_MAJOR {
- background-image: url('../../images/priority/MAJOR.png');
+ background-image: url('../images/priority/MAJOR.png');
}
option.sev_CRITICAL, span.sev_CRITICAL {
- background-image: url('../../images/priority/CRITICAL.png');
+ background-image: url('../images/priority/CRITICAL.png');
}
option.sev_BLOCKER, span.sev_BLOCKER {
- background-image: url('../../images/priority/BLOCKER.png');
+ background-image: url('../images/priority/BLOCKER.png');
}
/* ------------------- VARIATIONS ------------------- */
@@ -230,7 +230,7 @@ option.sev_BLOCKER, span.sev_BLOCKER {
color: #444;
vertical-align: bottom;
font-weight: bold;
- background: url('../../images/information.png') no-repeat left center;
+ background: url('../images/information.png') no-repeat left center;
}
.help p {
@@ -327,7 +327,7 @@ ul.bullet {
ul.bullet li {
padding: 2px 0;
- list-style-image: url("../../images/bullet.png");
+ list-style-image: url("../images/bullet.png");
}
.rule_title {
@@ -625,7 +625,7 @@ table.without-header {
}
.line-info {
- background: url('../../images/information.png') no-repeat scroll left 50% transparent;
+ background: url('../images/information.png') no-repeat scroll left 50% transparent;
padding-left: 18px
}
@@ -687,25 +687,25 @@ table.nowrap td.small, td.nowrap.small, th.nowrap.small {
.csv {
display: block;
- background: url("../../images/csv.png") no-repeat scroll left 50% transparent;
+ background: url("../images/csv.png") no-repeat scroll left 50% transparent;
padding: 2px 0 2px 20px;
}
.add {
display: block;
- background: url("../../images/add.png") no-repeat scroll left 50% transparent;
+ background: url("../images/add.png") no-repeat scroll left 50% transparent;
padding: 2px 0 2px 20px;
}
.restore {
display: block;
- background: url("../../images/restore.gif") no-repeat scroll left 50% transparent;
+ background: url("../images/restore.gif") no-repeat scroll left 50% transparent;
padding: 2px 0 2px 20px;
}
.compare {
display: block;
- background: url("../../images/compare.png") no-repeat scroll left 50% transparent;
+ background: url("../images/compare.png") no-repeat scroll left 50% transparent;
padding: 2px 0 2px 20px;
}
@@ -719,7 +719,7 @@ table.nowrap td.small, td.nowrap.small, th.nowrap.small {
}
.link-more {
- background-image: url('../../images/bullet_arrow_down.png');
+ background-image: url('../images/bullet_arrow_down.png');
background-repeat: no-repeat;
padding-right: 20px;
background-position: right center;
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 b3243cc9690..2791676fa90 100644
--- a/sonar-core/src/main/resources/org/sonar/l10n/core.properties
+++ b/sonar-core/src/main/resources/org/sonar/l10n/core.properties
@@ -2753,7 +2753,7 @@ quality_profiles.list.used=Used
quality_profiles.x_activated_out_of_y={0} rules activated out of {1} available
quality_profiles.change_projects=Change Projects
quality_profiles.not_found=The requested quality profile was not found.
-quality_profiles.latest_new_rules=Latest New Rules
+quality_profiles.latest_new_rules=Recently Added Rules
quality_profiles.latest_new_rules.activated={0}, activated on {1} profile(s)
quality_profiles.latest_new_rules.not_activated={0}, not yet activated
quality_profiles.deprecated_rules=Deprecated Rules
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/highlighting/TypeOfText.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/highlighting/TypeOfText.java
index 6089f6f2161..194b75efead 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/highlighting/TypeOfText.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/highlighting/TypeOfText.java
@@ -20,8 +20,6 @@
package org.sonar.api.batch.sensor.highlighting;
/**
- * Experimental, do not use.
- * <br>
* Possible types for highlighting code. See sonar-colorizer.css
* @since 5.1
*/