Merge branch 'feature-fixes'

This commit is contained in:
Dmitry Khomutov 2017-09-17 20:09:41 +07:00
commit 00744c269b
13 changed files with 286 additions and 258 deletions

View file

@ -94,8 +94,11 @@ Type=simple
ExecStart=/your/path/bin/console php-censor:worker
Restart=always
User=php-censor #Could be changed
Group=php-censor #Could be changed
#Could be changed
User=php-censor
#Could be changed
Group=php-censor
[Install]
WantedBy=multi-user.target

View file

@ -1,4 +1,3 @@
var PHPCensor = {
intervals: {},
@ -296,7 +295,9 @@ var PHPCensorConfirmDialog = Class.extend({
/*
Bind the close event of the dialog to the set of onClose* methods
*/
this.$dialog.on('hidden.bs.modal', function () {this.onClose()}.bind(this));
this.$dialog.on('hidden.bs.modal', function () {
this.onClose()
}.bind(this));
this.$dialog.on('hidden.bs.modal', function () {
if (this.confirmed) {
this.onCloseConfirmed();
@ -336,17 +337,20 @@ var PHPCensorConfirmDialog = Class.extend({
/**
* Called only when confirmed dialog was closed
*/
onCloseConfirmed: function () {},
onCloseConfirmed: function () {
},
/**
* Called only when canceled dialog was closed
*/
onCloseCanceled: function () {},
onCloseCanceled: function () {
},
/**
* Called always when the dialog was closed
*/
onClose: function () {},
onClose: function () {
},
showStatusMessage: function (message, closeTimeout) {
this.$confirmBtn.hide();
@ -371,12 +375,10 @@ var PHPCensorConfirmDialog = Class.extend({
/**
* Used to initialise the project form:
*/
function setupProjectForm()
{
function setupProjectForm() {
$('.github-container').hide();
$('#element-reference').change(function()
{
$('#element-reference').change(function () {
var el = $(this);
var val = el.val();
var type = $('#element-type').val();
@ -457,7 +459,8 @@ function setupProjectForm()
var Lang = {
get: function () {
var args = Array.prototype.slice.call(arguments);;
var args = Array.prototype.slice.call(arguments);
;
var string = args.shift();
if (STRINGS[string]) {

View file

@ -23,6 +23,7 @@ var codeceptionPlugin = ActiveBuild.UiPlugin.extend({
$(window).on('build-updated', function () {
if (!self.rendered) {
self.displayOnUpdate = true;
query_data();
query_meta_data();
}
@ -32,8 +33,11 @@ var codeceptionPlugin = ActiveBuild.UiPlugin.extend({
render: function () {
return $('<table class="table table-hover" id="codeception-data">' +
'<thead>' +
'<tr><th>'+Lang.get('codeception_suite')+'</th>' +
'<tr><th>' + Lang.get('status') + '</th>' +
'<th>' + Lang.get('codeception_suite') + '</th>' +
'<th>' + Lang.get('codeception_feature') + '</th>' +
'<th>' + Lang.get('file') + '</th>' +
'<th>' + Lang.get('message') + '</th>' +
'<th>' + Lang.get('codeception_time') + '</th></tr>' +
'</thead><tbody></tbody><tfoot></tfoot></table>');
},
@ -49,6 +53,7 @@ var codeceptionPlugin = ActiveBuild.UiPlugin.extend({
var tests = this.lastData[0].meta_value;
var tbody = $('#codeception-data tbody');
tbody.empty();
if (tests.length == 0) {
@ -57,28 +62,15 @@ var codeceptionPlugin = ActiveBuild.UiPlugin.extend({
}
for (var i in tests) {
var rows = $('<tr data-toggle="collapse" data-target="#collapse'+i+'">' +
'<td><strong>'+tests[i].suite+'</strong</td>' +
var rows = $('<tr>' +
'<td>' + (tests[i].pass ? '<span class="label label-success">' + Lang.get('success') + '</span>' : '<span class="label label-danger">' + Lang.get('failed') + '</span>') + '</td>' +
'<td>' + tests[i].suite + '</td>' +
'<td>' + tests[i].feature + '</td>' +
'<td>' + tests[i].file + '</td>' +
'<td>' + ((tests[i].message) ? tests[i].message : '') + '</td>' +
'<td>' + tests[i].time + '</td>' +
'</tr>' +
'<tr id="collapse'+i+'" class="collapse" >' +
'<td></td><td colspan="2">' +
'<small><strong>'+Lang.get('name')+':</strong> '+tests[i].name+'</small><br />' +
'<small><strong>'+Lang.get('file')+':</strong> '+tests[i].file+'</small><br />' +
(tests[i].message
? '<small><strong>'+Lang.get('message')+':</strong> '+tests[i].message+'</small>'
: '') +
'</td>' +
'</tr>');
if (!tests[i].pass) {
rows.first().addClass('danger');
} else {
rows.first().addClass('success');
}
tbody.append(rows);
}
@ -97,6 +89,7 @@ var codeceptionPlugin = ActiveBuild.UiPlugin.extend({
var data = this.lastMeta[0].meta_value;
var tfoot = $('#codeception-data tfoot');
tfoot.empty();
var row = $('<tr>' +

View file

@ -25,6 +25,7 @@ var locPlugin = ActiveBuild.UiPlugin.extend({
render: function () {
var self = this;
var container = $('<div id="phploc-lines" style="width: 100%; height: 300px"></div>');
container.append('<canvas id="phploc-lines-chart" style="width: 100%; height: 300px"></canvas>');
$(document).on('shown.bs.tab', function () {
@ -50,26 +51,26 @@ var locPlugin = ActiveBuild.UiPlugin.extend({
datasets: [
{
label: Lang.get('lines'),
strokeColor: "rgba(60,141,188,1)",
pointColor: "rgba(60,141,188,1)",
strokeColor: "#555299",
pointColor: "#555299",
data: []
},
{
label: Lang.get('logical_lines'),
strokeColor: "rgba(245,105,84,1)",
pointColor: "rgba(245,105,84,1)",
strokeColor: "#00A65A",
pointColor: "#00A65A",
data: []
},
{
label: Lang.get('comment_lines'),
strokeColor: "rgba(0,166,90,1)",
pointColor: "rgba(0,166,90,1)",
strokeColor: "#8AA4AF",
pointColor: "#8AA4AF",
data: []
},
{
label: Lang.get('noncomment_lines'),
strokeColor: "rgba(0,192,239,1)",
pointColor: "rgba(0,192,239,1)",
strokeColor: "#00A7D0",
pointColor: "#00A7D0",
data: []
}
]

View file

@ -17,6 +17,7 @@ var phpspecPlugin = ActiveBuild.UiPlugin.extend({
$(window).on('build-updated', function () {
if (!self.rendered) {
self.displayOnUpdate = true;
query();
}
});
@ -24,12 +25,14 @@ var phpspecPlugin = ActiveBuild.UiPlugin.extend({
render: function () {
return $('<table class="table table-striped" id="phpspec-data">' +
return $('<table class="table table-hover" id="phpspec-data">' +
'<thead>' +
'<tr>' +
' <th>' + Lang.get('status') + '</th>' +
' <th>' + Lang.get('suite') + '</th>' +
' <th>' + Lang.get('test') + '</th>' +
' <th>'+Lang.get('result')+'</th>' +
' <th>' + Lang.get('test_message') + '</th>' +
' <th>' + Lang.get('codeception_time') + '</th>' +
'</tr>' +
'</thead><tbody></tbody></table>');
},
@ -45,6 +48,7 @@ var phpspecPlugin = ActiveBuild.UiPlugin.extend({
var tests = this.lastData[0].meta_value;
var tbody = $('#phpspec-data tbody');
tbody.empty();
for (var i in tests.suites) {
@ -55,18 +59,14 @@ var phpspecPlugin = ActiveBuild.UiPlugin.extend({
var row = $(
'<tr>' +
'<td>' + ((test_case.status == 'passed') ? '<span class="label label-success">' + Lang.get('success') + '</span>' : '<span class="label label-danger">' + Lang.get('failed') + '</span>') + '</td>' +
'<td>' + test_suite.name + '</td>' +
'<td title="' + Lang.get('took_n_seconds', test_case['time']) + '">' + test_case.name + '</td>' +
'<td>' + (test_case.message ? test_case.message : Lang.get('ok')) + '</td>' +
'<td>' + test_case.name + '</td>' +
'<td>' + (test_case.message ? test_case.message : '') + '</td>' +
'<td>' + test_case['time'] + '</td>' +
'</tr>'
);
if (test_case.status != 'passed') {
row.addClass('danger');
} else {
row.addClass('success');
}
tbody.append(row);
}
}

View file

@ -42,6 +42,7 @@ var phptalPlugin = ActiveBuild.UiPlugin.extend({
var errors = this.lastData[0].meta_value;
var tbody = $('#phptal-data tbody');
tbody.empty();
if (errors.length == 0) {

View file

@ -30,7 +30,6 @@ var phpunitPlugin = ActiveBuild.UiPlugin.extend({
},
render: function () {
return $('<table class="table table-hover" id="phpunit-data">' +
'<thead>' +
'<tr>' +
@ -53,11 +52,13 @@ var phpunitPlugin = ActiveBuild.UiPlugin.extend({
var tests = this.lastData[0].meta_value;
var thead = $('#phpunit-data thead tr');
var tbody = $('#phpunit-data tbody');
thead.empty().append('<th>' + Lang.get('status') + '</th><th>' + Lang.get('test_message') + '</th><th>' + Lang.get('trace') + '</th>');
tbody.empty();
if (tests.length == 0) {
$('#build-phpunit-errors').hide();
return;
}
@ -104,14 +105,14 @@ var phpunitPlugin = ActiveBuild.UiPlugin.extend({
$('#build-phpunit-errors').show();
},
repr: function(data)
{
repr: function (data) {
switch (typeof(data)) {
case 'boolean':
return '<span class="boolean">' + (data ? 'true' : 'false') + '</span>';
case 'string':
return '<span class="string">"' + data + '"</span>';
case 'undefined': case null:
case 'undefined':
case null:
return '<span class="null">null</span>';
case 'object':
var rows = [];

View file

@ -2,8 +2,20 @@ var SummaryPlugin = ActiveBuild.UiPlugin.extend({
id: 'build-summary',
css: 'col-xs-12',
title: Lang.get('build-summary'),
statusLabels: [Lang.get('pending'), Lang.get('running'), Lang.get('success'), Lang.get('failed'), Lang.get('failed_allowed')],
statusClasses: ['info', 'warning', 'success', 'danger', 'danger'],
statusLabels: [
Lang.get('pending'),
Lang.get('running'),
Lang.get('success'),
Lang.get('failed'),
Lang.get('failed_allowed')
],
statusClasses: [
'info',
'warning',
'success',
'danger',
'danger'
],
register: function () {
var self = this;
@ -38,6 +50,7 @@ var SummaryPlugin = ActiveBuild.UiPlugin.extend({
var tbody = $('#plugin-summary tbody'),
summary = e.queryData[0].meta_value;
tbody.empty();
for (var stage in summary) {

View file

@ -44,6 +44,7 @@ var warningsPlugin = ActiveBuild.UiPlugin.extend({
render: function () {
var self = this;
var container = $('<div id="build-warnings" style="width: 100%; height: 300px"></div>');
container.append('<canvas id="build-warnings-linechart" style="width: 100%; height: 300px"></canvas>');
$(document).on('shown.bs.tab', function () {
@ -83,7 +84,18 @@ var warningsPlugin = ActiveBuild.UiPlugin.extend({
var self = this;
self.rendered = true;
var colors = ['#4D4D4D', '#5DA5DA', '#FAA43A', '#60BD68', '#F17CB0', '#B2912F', '#B276B2', '#DECF3F', '#F15854', '#4D4D4D'];
var colors = [
'#FF0084',
'#D33724',
'#FF851B',
'#F7BE64',
'#B5BBC8',
'#555299',
'#7EDEDE',
'#00A7D0',
'#B5BBC8',
'#001F3F'
];
self.chartData = {
labels: [],

View file

@ -7,7 +7,8 @@
var initializing = false, fnTest = /xyz/.test(function () {xyz;}) ? /\b_super\b/ : /.*/;
// The base Class implementation (does nothing)
this.Class = function(){};
this.Class = function () {
};
// Create a new Class that inherits from this class
Class.extend = function (prop) {

View file

@ -158,7 +158,7 @@ class BuildStatusController extends Controller
}
}
$cacheDir = RUNTIME_DIR . '/status_cache/';
$cacheDir = RUNTIME_DIR . 'status_cache/';
$cacheFile = $cacheDir . md5($imageUrl) . '.svg';
if (!is_file($cacheFile)) {
$image = file_get_contents($imageUrl);

View file

@ -312,7 +312,7 @@ PHP Censor',
'seconds' => 'сек.',
'plugin' => 'Плагин',
'stage_setup' => 'Установка',
'stage_test' => 'тестирование',
'stage_test' => 'Тестирование',
'stage_complete' => 'Завершение',
'stage_success' => 'Успешное завершение',
'stage_failure' => 'Провал',