align checkboxes

pull/1/head
LianaHus 5 years ago committed by Aniket
parent b58f034d26
commit f465d4620a
  1. 6
      src/app/tabs/staticanalysis/staticAnalysisView.js
  2. 15
      src/app/tabs/test-tab.js

@ -162,17 +162,17 @@ staticAnalysisView.prototype.renderModules = function () {
var category = groupedModules[categoryId] var category = groupedModules[categoryId]
var entriesDom = category.map((item, i) => { var entriesDom = category.map((item, i) => {
return yo` return yo`
<div class="d-flex"> <div class="form-check">
<input id="staticanalysismodule_${categoryId}_${i}" <input id="staticanalysismodule_${categoryId}_${i}"
type="checkbox" type="checkbox"
class="staticAnalysisItem" class="form-check-input staticAnalysisItem"
name="staticanalysismodule" name="staticanalysismodule"
index=${item._index} index=${item._index}
checked="true" checked="true"
style="vertical-align:bottom" style="vertical-align:bottom"
onclick="${function (event) { self.checkModule(event) }}" onclick="${function (event) { self.checkModule(event) }}"
> >
<label for="staticanalysismodule_${categoryId}_${i}" class="pl-2 mb-1"> <label for="staticanalysismodule_${categoryId}_${i}" class="form-check-label mb-1">
${item.name} ${item.name}
${item.description} ${item.description}
</label> </label>

@ -75,7 +75,7 @@ module.exports = class TestTab extends ViewPlugin {
listTests () { listTests () {
return this.data.allTests.map( return this.data.allTests.map(
test => yo` test => yo`
<div class="singleTestLabel d-flex py-1"> <div class="singleTestLabel d-flex align-items-center py-1">
<input class="singleTest" id="singleTest${test}" onchange=${(e) => this.toggleCheckbox(e.target.checked, test)} type="checkbox" checked="true"> <input class="singleTest" id="singleTest${test}" onchange=${(e) => this.toggleCheckbox(e.target.checked, test)} type="checkbox" checked="true">
<label class="text-nowrap pl-2 mb-0" for="singleTest${test}">${test}</label> <label class="text-nowrap pl-2 mb-0" for="singleTest${test}">${test}</label>
</div>` </div>`
@ -146,17 +146,18 @@ module.exports = class TestTab extends ViewPlugin {
return return
} }
this.testsSummary.appendChild(yo`<div class=${css.summaryTitle}> ${filename} </div>`) this.testsSummary.appendChild(yo`<div class=${css.summaryTitle}> ${filename} </div>`)
if (result) {
if (result.totalPassing > 0) { if (result.totalPassing > 0) {
this.testsSummary.appendChild(yo`<div class="text-success" >${result.totalPassing} passing (${result.totalTime}s)</div>`) this.testsSummary.appendChild(yo`<div class="text-success">${result.totalPassing} passing (${result.totalTime}s)</div>`)
this.testsSummary.appendChild(yo`<br>`) this.testsSummary.appendChild(yo`<br>`)
} }
if (result) {
if (result.totalFailing > 0) { if (result.totalFailing > 0) {
this.testsSummary.appendChild(yo`<div class="text-danger" >${result.totalFailing} failing</div>`) this.testsSummary.appendChild(yo`<div class="text-danger">${result.totalFailing} failing</div>`)
this.testsSummary.appendChild(yo`<br>`) this.testsSummary.appendChild(yo`<br>`)
} }
result.errors.forEach((error, index) => { result.errors.forEach((error, index) => {
this.testsSummary.appendChild(yo`<div class="text-danger" >${error.context} - ${error.value} </div>`) this.testsSummary.appendChild(yo`<div class="text-danger">${error.context} - ${error.value} </div>`)
this.testsSummary.appendChild(yo`<div class="${css.testFailureSummary} text-danger" >${error.message}</div>`) this.testsSummary.appendChild(yo`<div class="${css.testFailureSummary} text-danger" >${error.message}</div>`)
this.testsSummary.appendChild(yo`<br>`) this.testsSummary.appendChild(yo`<br>`)
}) })
@ -245,7 +246,7 @@ module.exports = class TestTab extends ViewPlugin {
const tests = this.data.selectedTests const tests = this.data.selectedTests
if (!tests) return if (!tests) return
this.loading.hidden = tests.length === 0 this.loading.hidden = tests.length === 0
async.eachOfSeries(tests, (value, key, callback) => { this.runTest(value, callback) }) async.eachOfSeries(tests, (value, key, callback) => { if (this.hasBeenStopped) return; this.runTest(value, callback) })
} }
stopTests () { stopTests () {
@ -325,7 +326,7 @@ module.exports = class TestTab extends ViewPlugin {
selectAll () { selectAll () {
return yo` return yo`
<div class="d-flex mx-3 pb-2 mt-2 border-bottom"> <div class="d-flex align-items-center mx-3 pb-2 mt-2 border-bottom">
<input id="checkAllTests" <input id="checkAllTests"
type="checkbox" type="checkbox"
data-id="testTabCheckAllTests" data-id="testTabCheckAllTests"

Loading…
Cancel
Save