diff options
Diffstat (limited to 'server/sonar-web/src')
7 files changed, 38 insertions, 6 deletions
diff --git a/server/sonar-web/src/main/coffee/analysis-reports/views/report-view.coffee b/server/sonar-web/src/main/coffee/analysis-reports/views/report-view.coffee index 66411deeea8..81b6f8bd034 100644 --- a/server/sonar-web/src/main/coffee/analysis-reports/views/report-view.coffee +++ b/server/sonar-web/src/main/coffee/analysis-reports/views/report-view.coffee @@ -32,6 +32,7 @@ define [ @$el.addClass 'analysis-reports-report-pending' if status is 'PENDING' @$el.addClass 'analysis-reports-report-working' if status is 'WORKING' @$el.addClass 'analysis-reports-report-done' if status is 'SUCCESS' + @$el.addClass 'analysis-reports-report-cancelled' if status is 'CANCELLED' @$el.addClass 'analysis-reports-report-failed' if status is 'FAIL' diff --git a/server/sonar-web/src/main/hbs/source-viewer/source-viewer-duplication-popup.hbs b/server/sonar-web/src/main/hbs/source-viewer/source-viewer-duplication-popup.hbs index 4a596a1959d..433825e60cf 100644 --- a/server/sonar-web/src/main/hbs/source-viewer/source-viewer-duplication-popup.hbs +++ b/server/sonar-web/src/main/hbs/source-viewer/source-viewer-duplication-popup.hbs @@ -21,7 +21,7 @@ {{#notEq file.key ../component.key}} <div class="component-name-path"> - <a data-uuid="{{file.uuid}}" title="{{file.name}}"> + <a class="link-action" data-uuid="{{file.uuid}}" title="{{file.name}}"> <span>{{collapsedDirFromPath file.name}}</span><span class="component-name-file">{{fileFromPath file.name}}</span> </a> diff --git a/server/sonar-web/src/main/js/coding-rules/rule/custom-rule-creation-view.js b/server/sonar-web/src/main/js/coding-rules/rule/custom-rule-creation-view.js index 1443c801805..3ff81d43723 100644 --- a/server/sonar-web/src/main/js/coding-rules/rule/custom-rule-creation-view.js +++ b/server/sonar-web/src/main/js/coding-rules/rule/custom-rule-creation-view.js @@ -154,7 +154,15 @@ define([ this.$('.alert').addClass('hidden'); var that = this, url = baseUrl + '/api/rules/' + action; - return $.post(url, options).done(function () { + return $.ajax({ + url: url, + type: 'POST', + data: options, + statusCode: { + // do not show global error + 400: null + } + }).done(function () { if (that.options.templateRule) { that.options.app.controller.showDetails(that.options.templateRule); } else { diff --git a/server/sonar-web/src/main/js/coding-rules/rule/manual-rule-creation-view.js b/server/sonar-web/src/main/js/coding-rules/rule/manual-rule-creation-view.js index d9f2e20c2a3..6fd9ce49c3f 100644 --- a/server/sonar-web/src/main/js/coding-rules/rule/manual-rule-creation-view.js +++ b/server/sonar-web/src/main/js/coding-rules/rule/manual-rule-creation-view.js @@ -102,7 +102,15 @@ define([ sendRequest: function (action, options) { var that = this, url = baseUrl + '/api/rules/' + action; - return $.post(url, options).done(function (r) { + return $.ajax({ + url: url, + type: 'POST', + data: options, + statusCode: { + // do not show global error + 400: null + } + }).done(function (r) { if (typeof r === 'string') { r = JSON.parse(r); } diff --git a/server/sonar-web/src/main/js/coding-rules/rule/profile-activation-view.js b/server/sonar-web/src/main/js/coding-rules/rule/profile-activation-view.js index 18362015704..2e2e0f9be56 100644 --- a/server/sonar-web/src/main/js/coding-rules/rule/profile-activation-view.js +++ b/server/sonar-web/src/main/js/coding-rules/rule/profile-activation-view.js @@ -103,6 +103,10 @@ define([ rule_key: ruleKey, severity: severity, params: paramsHash + }, + statusCode: { + // do not show global error + 400: null } }).done(function () { that.trigger('profileActivated', severity, params); diff --git a/server/sonar-web/src/main/js/source-viewer/viewer.js b/server/sonar-web/src/main/js/source-viewer/viewer.js index 72f197f7008..66600022fa2 100644 --- a/server/sonar-web/src/main/js/source-viewer/viewer.js +++ b/server/sonar-web/src/main/js/source-viewer/viewer.js @@ -434,10 +434,16 @@ define([ blocks = this.model.get('duplications')[index - 1].blocks, inRemovedComponent = _.some(blocks, function (b) { return b._ref == null; - }); + }), + foundOne = false; blocks = _.filter(blocks, function (b) { - var outOfBounds = b.from > line || b.from + b.size < line; - return (b._ref != null) && ((b._ref !== '1') || (b._ref === '1' && outOfBounds)); + var outOfBounds = b.from > line || b.from + b.size < line, + currentFile = b._ref === '1', + isOk = (b._ref != null) && (!currentFile || (currentFile && (outOfBounds || foundOne))); + if (b._ref === '1' && !outOfBounds) { + foundOne = true; + } + return isOk; }); var popup = new DuplicationPopupView({ triggerEl: $(e.currentTarget), diff --git a/server/sonar-web/src/main/less/pages/analysis-reports.less b/server/sonar-web/src/main/less/pages/analysis-reports.less index df4abf70d11..b995f9412dd 100644 --- a/server/sonar-web/src/main/less/pages/analysis-reports.less +++ b/server/sonar-web/src/main/less/pages/analysis-reports.less @@ -27,6 +27,7 @@ @pendingColor: #fdfce2; @workingColor: #ecf9fc; @doneColor: #ecfced; +@cancelledColor: #fcecec; @failedColor: #fcecec; @@ -59,6 +60,10 @@ background-color: @doneColor !important; } +.analysis-reports-report-cancelled { + background-color: @cancelledColor !important; +} + .analysis-reports-report-failed { background-color: @failedColor !important; |