pull/5370/head
LianaHus 5 years ago committed by Liana Husikyan
parent 326814e530
commit eaaca91ae3
  1. 66
      src/app/tabs/staticanalysis/staticAnalysisView.js

@ -155,7 +155,7 @@ staticAnalysisView.prototype.checkModule = function (event) {
} }
staticAnalysisView.prototype.correctRunBtnDisabled = function () { staticAnalysisView.prototype.correctRunBtnDisabled = function () {
const selected = this.view.querySelectorAll('[name="staticanalysismodule"]:checked') const selected = this.view.querySelectorAll('[name="staticanalysismodule"]:checked')
if (this.lastCompilationResult && selected.length != 0) { if (this.lastCompilationResult && selected.length !== 0) {
this.runBtn.removeAttribute('disabled') this.runBtn.removeAttribute('disabled')
} else { } else {
this.runBtn.setAttribute('disabled', 'disabled') this.runBtn.setAttribute('disabled', 'disabled')
@ -174,42 +174,42 @@ staticAnalysisView.prototype.checkAll = function (event) {
staticAnalysisView.prototype.renderModules = function () { staticAnalysisView.prototype.renderModules = function () {
const groupedModules = utils.groupBy(preProcessModules(this.runner.modules()), 'categoryId') const groupedModules = utils.groupBy(preProcessModules(this.runner.modules()), 'categoryId')
const moduleEntries = Object.keys(groupedModules).map((categoryId, i) => { const moduleEntries = Object.keys(groupedModules).map((categoryId, i) => {
const category = groupedModules[categoryId] const category = groupedModules[categoryId]
const entriesDom = category.map((item, i) => { const entriesDom = category.map((item, i) => {
return yo`
<div class="form-check">
<input id="staticanalysismodule_${categoryId}_${i}"
type="checkbox"
class="form-check-input staticAnalysisItem"
name="staticanalysismodule"
index=${item._index}
checked="true"
style="vertical-align:bottom"
onclick="${(event) => this.checkModule(event)}"
>
<label for="staticanalysismodule_${categoryId}_${i}" class="form-check-label mb-1">
<p class="mb-0 font-weight-bold text-capitalize">${item.name}</p>
${item.description}
</label>
</div>
`
})
return yo` return yo`
<div class="form-check"> <div class="${css.block}">
<input id="staticanalysismodule_${categoryId}_${i}" <input type="radio" name="accordion" class="w-100 d-none card" id="heading${categoryId}"/>
type="checkbox" <label for="heading${categoryId}" style="cursor: pointer;" class="h6 card-header font-weight-bold border-bottom px-1 py-2 w-100">
class="form-check-input staticAnalysisItem" <span>${category[0].categoryDisplayName}</span>
name="staticanalysismodule" </label>
index=${item._index} <div class="w-100 d-block px-2 py-1 ${css.entries}">
checked="true" ${entriesDom}
style="vertical-align:bottom" </div>
onclick="${(event) => this.checkModule(event) }" </>
>
<label for="staticanalysismodule_${categoryId}_${i}" class="form-check-label mb-1">
<p class="mb-0 font-weight-bold text-capitalize">${item.name}</p>
${item.description}
</label>
</div>
` `
}) })
return yo` return yo`
<div class="${css.block}"> <div class="accordion" id="accordionModules">
<input type="radio" name="accordion" class="w-100 d-none card" id="heading${categoryId}"/> ${moduleEntries}
<label for="heading${categoryId}" style="cursor: pointer;" class="h6 card-header font-weight-bold border-bottom px-1 py-2 w-100"> </div>`
<span>${category[0].categoryDisplayName}</span>
</label>
<div class="w-100 d-block px-2 py-1 ${css.entries}">
${entriesDom}
</div>
</>
`
})
return yo`
<div class="accordion" id="accordionModules">
${moduleEntries}
</div>`
} }
module.exports = staticAnalysisView module.exports = staticAnalysisView

Loading…
Cancel
Save