added warnings status update

pull/3094/head
LianaHus 6 years ago
parent 1095db22dd
commit a6825bc0e5
  1. 11
      src/app/tabs/compile-tab.js
  2. 3
      src/app/ui/renderer.js

@ -111,7 +111,13 @@ class CompileTab extends CompilerApi {
if (success) {
// forwarding the event to the appManager infra
this.events.emit('compilationFinished', source.target, source, 'soljson', data)
this.events.emit('statusChanged', {key: 'check', title: 'compilation successful', type: 'success'})
if (data.errors) {
this.events.emit('statusChanged', {
key: data.errors.length.toString(),
title: 'compilation finished successful with warning' + data.errors.length > 1 ? 's' : '',
type: 'warning'
})
} else this.events.emit('statusChanged', {key: 'check', title: 'compilation successful', type: 'success'})
// Store the contracts
this.data.contractsDetails = {}
this.compiler.visitContracts((contract) => {
@ -122,7 +128,8 @@ class CompileTab extends CompilerApi {
)
})
} else {
this.events.emit('statusChanged', {key: data.errors.length.toString(), title: 'compilation failed', type: 'danger'})
const count = errorList.filter(error => error.severity === 'error').length.toString()
this.events.emit('statusChanged', {key: count, title: 'compilation failed', type: 'danger'})
}
// Update contract Selection
let contractMap = {}

@ -89,7 +89,8 @@ Renderer.prototype.error = function (message, container, opt) {
var $pre = $(opt.useSpan ? yo`<span></span>` : yo`<pre></pre>`).html(message)
var $error = $(yo`<div class="sol ${opt.type}"><div class="close"><i class="fas fa-times"></i></div></div>`).prepend($pre)
let classList = opt.type === 'error' ? 'alert alert-danger' : 'alert alert-warning'
var $error = $(yo`<div class="${classList}"><div class="close"><i class="fas fa-times"></i></div></div>`).prepend($pre)
$(container).append($error)
$error.click((ev) => {

Loading…
Cancel
Save