diff options
author | Julien HENRY <julien.henry@sonarsource.com> | 2014-10-20 17:19:19 +0200 |
---|---|---|
committer | Julien HENRY <julien.henry@sonarsource.com> | 2014-10-20 17:19:19 +0200 |
commit | de0f79313e6bb951db1b02a8138b5e8366884518 (patch) | |
tree | bcc379b2a711189cd52636926d20b800381dc4c6 /server/sonar-web | |
parent | ec0211e72ad2e817cc099daba64833797bfc17c6 (diff) | |
parent | 14bf33fa1c0f4ac920775ee2d2363337fa3769c0 (diff) | |
download | sonarqube-de0f79313e6bb951db1b02a8138b5e8366884518.tar.gz sonarqube-de0f79313e6bb951db1b02a8138b5e8366884518.zip |
Merge remote-tracking branch 'origin/branch-4.5'
Conflicts:
sonar-batch/src/main/java/org/sonar/batch/DefaultDecoratorContext.java
Diffstat (limited to 'server/sonar-web')
6 files changed, 28 insertions, 10 deletions
diff --git a/server/sonar-web/src/main/coffee/coding-rules/views/coding-rules-detail-view.coffee b/server/sonar-web/src/main/coffee/coding-rules/views/coding-rules-detail-view.coffee index 16ba0bb7925..7a10db2512f 100644 --- a/server/sonar-web/src/main/coffee/coding-rules/views/coding-rules-detail-view.coffee +++ b/server/sonar-web/src/main/coffee/coding-rules/views/coding-rules-detail-view.coffee @@ -335,5 +335,5 @@ define [ isEditable: (@options.app.canWrite and (isManual or isCustom)) qualityProfilesVisible: qualityProfilesVisible subcharacteristic: @options.app.getSubcharacteristicName(@model.get 'debtSubChar') - createdAt: new Date(@model.get 'createdAt') + createdAt: moment(@model.get 'createdAt').toDate() allTags: _.union @model.get('sysTags'), @model.get('tags') diff --git a/server/sonar-web/src/main/coffee/component-viewer/main.coffee b/server/sonar-web/src/main/coffee/component-viewer/main.coffee index e6da45caa2f..5ba64c236a0 100644 --- a/server/sonar-web/src/main/coffee/component-viewer/main.coffee +++ b/server/sonar-web/src/main/coffee/component-viewer/main.coffee @@ -65,6 +65,8 @@ define [ SCROLL_OFFSET = 10 + LINES_LIMIT = 3000 + class ComponentViewer extends utils.mixOf Marionette.Layout, IssuesMixin, CoverageMixin, DuplicationsMixin, SCMMixin @@ -201,10 +203,15 @@ define [ $.get API_MEASURES, data, (data) => measuresList = data[0].msr || [] measures = @component.get 'measures' + lines = null measuresList.forEach (m) -> measures[m.key] = m.frmt_val || m.data + lines = m.val if m.key == 'ncloc' @component.set 'measures', measures - @augmentWithNclocData() + if lines < LINES_LIMIT + @augmentWithNclocData() + else + delete measures['ncloc_data'] requestTrends: (key, period) -> diff --git a/server/sonar-web/src/main/coffee/component-viewer/source.coffee b/server/sonar-web/src/main/coffee/component-viewer/source.coffee index bad93f7bc93..423a555c3a3 100644 --- a/server/sonar-web/src/main/coffee/component-viewer/source.coffee +++ b/server/sonar-web/src/main/coffee/component-viewer/source.coffee @@ -22,6 +22,7 @@ define [ $ = jQuery API_COVERAGE_TESTS = "#{baseUrl}/api/tests/test_cases" + LINES_LIMIT = 3000 ISSUES_LIMIT = 100 @@ -91,6 +92,7 @@ define [ $(expand).insertBefore rows.first() lines = _.size @model.get 'source' + lines = Math.min lines, LINES_LIMIT lastShown = rows.last().data('line-number') if lastShown < lines expand = @expandTemplate from: lastShown, to: lines, settings: @options.main.settings.toJSON() @@ -274,16 +276,17 @@ define [ source.forEach (sourceLine) => show = false line = sourceLine.lineNumber - @showBlocks.forEach (block) -> - show = true if block.from <= line && block.to >= line - _.extend sourceLine, show: show + if line <= LINES_LIMIT + @showBlocks.forEach (block) -> + show = true if block.from <= line && block.to >= line + _.extend sourceLine, show: show source prepareSource: -> source = @model.get 'formattedSource' if source? - @augmentWithShow source + _.first @augmentWithShow(source), LINES_LIMIT getStatColumnsCount: -> @@ -313,3 +316,5 @@ define [ showZeroLine: @showZeroLine() issuesLimit: ISSUES_LIMIT issuesLimitReached: @model.get('activeIssues')?.length > ISSUES_LIMIT + linesLimit: LINES_LIMIT + linesLimitReached: _.size(@model.get 'source') > LINES_LIMIT diff --git a/server/sonar-web/src/main/hbs/component-viewer/cw-source.hbs b/server/sonar-web/src/main/hbs/component-viewer/cw-source.hbs index 96f27fd2125..33c9134e6e4 100644 --- a/server/sonar-web/src/main/hbs/component-viewer/cw-source.hbs +++ b/server/sonar-web/src/main/hbs/component-viewer/cw-source.hbs @@ -4,14 +4,18 @@ {{else}} - {{#if state.duplicationsInDeletedFiles}} - <p class="marginbottom10 js-duplications-in-deleted-files">{{t 'duplications.dups_found_on_deleted_resource'}}</p> + {{#if linesLimitReached}} + <p class="message-alert marginbottom10">{{tp 'component_viewer.lines_limit_reached' linesLimit}}</p> {{/if}} {{#if issuesLimitReached}} <p class="message-alert marginbottom10">{{tp 'component_viewer.issues_limit_reached' issuesLimit}}</p> {{/if}} + {{#if state.duplicationsInDeletedFiles}} + <p class="marginbottom10 js-duplications-in-deleted-files">{{t 'duplications.dups_found_on_deleted_resource'}}</p> + {{/if}} + <table class="code"> {{#if showZeroLine}} <tr class="row row-hidden" data-line-number="0" id="{{uid}}-0"> diff --git a/server/sonar-web/src/main/less/icons.less b/server/sonar-web/src/main/less/icons.less index fa174f8b19b..1212069bb00 100644 --- a/server/sonar-web/src/main/less/icons.less +++ b/server/sonar-web/src/main/less/icons.less @@ -271,7 +271,9 @@ a[class^="icon-"], a[class*=" icon-"] { &:after { content: "\e60d"; position: absolute; - top: 0; left: 0; +// top: 0; + left: 0; + margin-top: 2px; } &.icon-checkbox-single:after { content: "\e60e"; } diff --git a/server/sonar-web/src/main/less/select-list.less b/server/sonar-web/src/main/less/select-list.less index d608d665000..e03bd93ba59 100644 --- a/server/sonar-web/src/main/less/select-list.less +++ b/server/sonar-web/src/main/less/select-list.less @@ -20,7 +20,7 @@ } .select-list-list-container.loading .select-list-list { - display: none; + visibility: hidden; } .select-list-list-container-readonly { |