diff --git a/src/app/components/vertical-icons-component.js b/src/app/components/vertical-icons-component.js index b85d84fc6c..41c41b9067 100644 --- a/src/app/components/vertical-icons-component.js +++ b/src/app/components/vertical-icons-component.js @@ -52,7 +52,14 @@ class VerticalIconComponent { listenOnStatus (api) { if (!api.events) return const fn = (status) => { - this.setIconStatus(api.profile.name, status) + if ( + status.type === 'warning' || + status.type === 'danger' || + status.key === 'code' || + status.key === 'check' || + (status.key === '' && status.type === '' && status.title === '')) { + this.setIconStatus(api.profile.name, status) + } } this.iconStatus[api.profile.name] = fn api.events.on('statusChanged', this.iconStatus[api.profile.name]) @@ -90,17 +97,33 @@ class VerticalIconComponent { let key = helper.checkSpecialChars(status.key) ? '' : status.key let type = helper.checkSpecialChars(status.type) ? '' : status.type let title = helper.checkSpecialChars(status.title) ? '' : status.title - el.appendChild(yo``) + + let classes = css.status + switch (key) { + case 'check': + classes += ' badge badge-pill badge-' + type + ' text-' + type + break + case 'code': + classes += ' fas fa-sync text-' + type + break + default: + classes += ' badge badge-pill badge-' + type + } + + el.appendChild(yo``) // el.classList = "" doesn't work on all browser use instead var classList = el.classList while (classList.length > 0) { classList.remove(classList.item(0)) } - el.classList.add(`${css.icon}`) - //el.classList.add('border') - //el.classList.add(`border-${type}`) } } diff --git a/src/app/staticanalysis/staticAnalysisView.js b/src/app/staticanalysis/staticAnalysisView.js index beace33ca6..d44b2108da 100644 --- a/src/app/staticanalysis/staticAnalysisView.js +++ b/src/app/staticanalysis/staticAnalysisView.js @@ -99,7 +99,7 @@ staticAnalysisView.prototype.run = function () { var warningContainer = $('#staticanalysisresult') warningContainer.empty() var self = this - if (this.lastCompilationResult) { + if (this.lastCompilationResult && selected.length) { var warningCount = 0 this.runner.run(this.lastCompilationResult, selected, function (results) { results.map(function (result, i) { @@ -126,8 +126,10 @@ staticAnalysisView.prototype.run = function () { self.event.trigger('staticAnaysisWarning', [warningCount]) }) } else { - warningContainer.html('No compiled AST available') - self.event.trigger('staticAnaysisWarning', [0]) + if (selected.length) { + warningContainer.html('No compiled AST available') + } + self.event.trigger('staticAnaysisWarning', [-1]) } } diff --git a/src/app/tabs/compile-tab.js b/src/app/tabs/compile-tab.js index e5cb75a7ac..3a8275ca1f 100644 --- a/src/app/tabs/compile-tab.js +++ b/src/app/tabs/compile-tab.js @@ -122,7 +122,7 @@ class CompileTab extends CompilerApi { ) }) } else { - this.events.emit('statusChanged', {key: 'exclamation', title: 'compilation failed', type: 'danger'}) + this.events.emit('statusChanged', {key: data.errors.length.toString(), title: 'compilation failed', type: 'danger'}) } // Update contract Selection let contractMap = {}