+++ /dev/null
-define [
- 'backbone.marionette'
-], (
- Marionette
-) ->
-
- $ = jQuery
-
-
- class extends Marionette.ItemView
- className: 'overlay-popup'
-
-
- events: ->
- 'click .overlay-popup-close': 'close'
-
-
- onRender: ->
- @$el.isolatedScroll()
- @$el.detach().appendTo $('body')
- key 'escape', 'overlay-popup', => @close()
- @keyScope = key.getScope()
- key.setScope 'overlay-popup'
-
-
- onClose: ->
- key.unbind 'overlay-popup'
- key.setScope @keyScope
$.get "#{baseUrl}/api/rules/show", key: ruleKey, (r) =>
ruleOverlay = new RuleOverlay
model: new Backbone.Model r.rule
+ large: true
ruleOverlay.render()
define [
- 'common/overlay'
+ 'common/modals'
'templates/issue'
], (
- Overlay
+ ModalView
Templates
) ->
- class extends Overlay
+ class extends ModalView
template: Templates['issue-rule']
-<h3 class="coding-rules-detail-header">
- {{name}}
- <a class="coding-rules-detail-permalink" target="_blank" href="{{permalink}}">
- <i class="icon-link"></i> {{t 'coding_rules.permalink'}}
- </a>
-</h3>
+<div class="modal-container">
+ <h3 class="coding-rules-detail-header">
+ {{name}}
+ <a class="coding-rules-detail-permalink" target="_blank" href="{{permalink}}">
+ <i class="icon-link"></i> {{t 'coding_rules.permalink'}}
+ </a>
+ </h3>
-<span class="subtitle">{{key}}</span>
+ <span class="subtitle">{{key}}</span>
-<ul class="coding-rules-detail-properties">
- <li class="coding-rules-detail-property coding-rules-detail-tag-list">
- <i class="icon-tags"></i>
- <span>{{#if allTags}}{{join allTags ', '}}{{else}}{{t 'coding_rules.no_tags'}}{{/if}}</span>
- </li>
- {{#if debtCharName}}
- <li class="coding-rules-detail-property">{{debtCharName}}{{#if debtSubCharName}} > {{debtSubCharName}}{{/if}}</li>
- {{/if}}
-</ul>
+ <ul class="coding-rules-detail-properties">
+ <li class="coding-rules-detail-property coding-rules-detail-tag-list">
+ <i class="icon-tags"></i>
+ <span>{{#if allTags}}{{join allTags ', '}}{{else}}{{t 'coding_rules.no_tags'}}{{/if}}</span>
+ </li>
+ {{#if debtCharName}}
+ <li class="coding-rules-detail-property">{{debtCharName}}{{#if debtSubCharName}} > {{debtSubCharName}}{{/if}}</li>
+ {{/if}}
+ </ul>
-<div class="coding-rules-detail-description rule-desc markdown">{{{htmlDesc}}}</div>
+ <div class="coding-rules-detail-description rule-desc markdown">{{{htmlDesc}}}</div>
+</div>
<div class="modal-foot">
- <a class="overlay-popup-close" title="{{t 'close'}}">{{t 'close'}}</a>
+ <a class="js-modal-close" title="{{t 'close'}}">{{t 'close'}}</a>
</div>
-<div class="source-viewer-header-component source-viewer-measures-component">
- {{#unless removed}}
- {{#if projectName}}
- <div class="source-viewer-header-component-project">
- {{qualifierIcon 'TRK'}} <a href="{{dashboardUrl project}}">{{projectName}}</a>
- {{#if subProjectName}}
-
- {{qualifierIcon 'TRK'}} <a href="{{dashboardUrl subProject}}">{{subProjectName}}</a>
- {{/if}}
- </div>
- {{/if}}
-
- <div class="source-viewer-header-component-name">
- {{qualifierIcon q}} {{default path longName}}
- </div>
- {{else}}
- <div class="source-viewer-header-component-project removed">{{removedMessage}}</div>
- {{/unless}}
-</div>
+<div class="modal-container source-viewer-measures-modal">
+ <div class="source-viewer-header-component source-viewer-measures-component">
+ {{#unless removed}}
+ {{#if projectName}}
+ <div class="source-viewer-header-component-project">
+ {{qualifierIcon 'TRK'}} <a href="{{dashboardUrl project}}">{{projectName}}</a>
+ {{#if subProjectName}}
+
+ {{qualifierIcon 'TRK'}} <a href="{{dashboardUrl subProject}}">{{subProjectName}}</a>
+ {{/if}}
+ </div>
+ {{/if}}
-<div class="source-viewer-measures">
- {{#unless isUnitTest}}
- <div class="source-viewer-measures-section">
- <div class="source-viewer-measures-card">
- {{> '_source-viewer-measures-lines'}}
+ <div class="source-viewer-header-component-name">
+ {{qualifierIcon q}} {{default path longName}}
</div>
- </div>
-
- <div class="source-viewer-measures-section">
- {{> '_source-viewer-measures-issues'}}
- </div>
+ {{else}}
+ <div class="source-viewer-header-component-project removed">{{removedMessage}}</div>
+ {{/unless}}
+ </div>
- {{#any measures.coverage measures.it_coverage}}
+ <div class="source-viewer-measures">
+ {{#unless isUnitTest}}
<div class="source-viewer-measures-section">
<div class="source-viewer-measures-card">
- {{> '_source-viewer-measures-coverage'}}
+ {{> '_source-viewer-measures-lines'}}
</div>
</div>
- {{/any}}
-
- <div class="source-viewer-measures-section">
- {{> '_source-viewer-measures-duplications'}}
- </div>
- {{else}}
- <div class="source-viewer-measures-section">
- {{> '_source-viewer-measures-tests'}}
- </div>
- {{> '_source-viewer-measures-test-cases'}}
- {{/unless}}
-</div>
-<a class="js-show-all-measures">{{t 'component_viewer.show_all_measures'}}</a>
+ <div class="source-viewer-measures-section">
+ {{> '_source-viewer-measures-issues'}}
+ </div>
+
+ {{#any measures.coverage measures.it_coverage}}
+ <div class="source-viewer-measures-section">
+ <div class="source-viewer-measures-card">
+ {{> '_source-viewer-measures-coverage'}}
+ </div>
+ </div>
+ {{/any}}
+
+ <div class="source-viewer-measures-section">
+ {{> '_source-viewer-measures-duplications'}}
+ </div>
+ {{else}}
+ <div class="source-viewer-measures-section">
+ {{> '_source-viewer-measures-tests'}}
+ </div>
+ {{> '_source-viewer-measures-test-cases'}}
+ {{/unless}}
+ </div>
+
+ <a class="js-show-all-measures">{{t 'component_viewer.show_all_measures'}}</a>
-<div class="source-viewer-measures source-viewer-measures-secondary js-all-measures hidden">
- {{> '_source-viewer-measures-all'}}
+ <div class="source-viewer-measures source-viewer-measures-secondary js-all-measures hidden">
+ {{> '_source-viewer-measures-all'}}
+ </div>
</div>
<div class="modal-foot">
- <a class="overlay-popup-close" title="{{t 'close'}}">{{t 'close'}}</a>
+ <a class="js-modal-close" title="{{t 'close'}}">{{t 'close'}}</a>
</div>
return false;
});
this.show();
+ if (!!this.options.large) {
+ this.$el.addClass('modal-large');
+ }
},
show: function () {
},
showMeasures: function () {
- var overlay = new MeasuresOverlay({ model: this.model });
- overlay.show();
+ new MeasuresOverlay({
+ model: this.model,
+ large: true
+ }).render();
}
});
define([
- 'common/overlay',
+ 'common/modals',
'templates/source-viewer'
-], function (Overlay, Templates) {
+], function (ModalView, Templates) {
var $ = jQuery;
- return Overlay.extend({
- className: 'overlay-popup source-viewer-measures-overlay',
+ return ModalView.extend({
template: Templates['source-viewer-measures'],
testsOrder: ['ERROR', 'FAILURE', 'OK', 'SKIPPED'],
+ initialize: function () {
+ var that = this,
+ p = window.process.addBackgroundProcess(),
+ requests = [this.requestMeasures(), this.requestIssues()];
+ if (this.model.get('isUnitTest')) {
+ requests.push(this.requestTests());
+ }
+ $.when.apply($, requests).done(function () {
+ that.render();
+ window.process.finishBackgroundProcess(p);
+ }).fail(function () {
+ window.process.failBackgroundProcess(p);
+ });
+ },
+
events: function () {
- return _.extend(Overlay.prototype.events.apply(this, arguments), {
+ return _.extend(ModalView.prototype.events.apply(this, arguments), {
'click .js-sort-tests-by-duration': 'sortTestsByDuration',
'click .js-sort-tests-by-name': 'sortTestsByName',
'click .js-sort-tests-by-status': 'sortTestsByStatus',
},
onRender: function () {
- Overlay.prototype.onRender.apply(this, arguments);
+ ModalView.prototype.onRender.apply(this, arguments);
this.$('.js-pie-chart').pieChart();
if (this.selectedTest != null) {
this.scrollToTest();
this.$el.scrollTop(position);
},
- show: function () {
- var that = this,
- p = window.process.addBackgroundProcess(),
- requests = [this.requestMeasures(), this.requestIssues()];
- if (this.model.get('isUnitTest')) {
- requests.push(this.requestTests());
- }
- $.when.apply($, requests).done(function () {
- that.render();
- window.process.finishBackgroundProcess(p);
- }).fail(function () {
- window.process.failBackgroundProcess(p);
- });
- },
-
getMetrics: function () {
var metrics = '',
url = baseUrl + '/api/metrics';
},
serializeData: function () {
- return _.extend(Overlay.prototype.serializeData.apply(this, arguments), {
+ return _.extend(ModalView.prototype.serializeData.apply(this, arguments), {
testSorting: this.testSorting,
selectedTest: this.selectedTest,
coveredFiles: this.coveredFiles || []
opacity: 1;
}
+.modal-large {
+ width: 1080px;
+ margin-left: -540px;
+}
+
.modal-overlay {
position: fixed;
z-index: 8999;
.modal-open {
overflow: hidden;
}
+
+.modal-container {
+ max-height: 70vh;
+ padding: 10px;
+ .box-sizing(border-box);
+ overflow-x: hidden;
+ overflow-y: scroll;
+}
margin: 0 10px 30px;
}
+.source-viewer-measures-modal {
+ background-color: @barBackgroundColor;
+}
+
.source-viewer-measures {
.clearfix;
+ margin: 0 -10px;
background-color: @barBackgroundColor;
.bubble-popup-section {
.source-viewer-measures-section {
float: left;
- width: 270px;
+ width: 25%;
margin: -20px 0;
}
.source-viewer-measures-section-big {
- width: 540px;
+ width: 50%;
}
.source-viewer-measures-section-full {