-restyle errors on compiler tab

-check for fatal error as well
-remove errors after file switch
pull/3094/head
LianaHus 6 years ago
parent bbf6dc1c82
commit 9ad1ac70b9
  1. 2
      src/app/staticanalysis/staticAnalysisView.js
  2. 9
      src/app/tabs/compile-tab.js
  3. 1
      src/app/tabs/compileTab/compilerContainer.js
  4. 2
      src/app/ui/renderer.js
  5. 4
      src/app/ui/styles/renderer-styles.js

@ -120,7 +120,7 @@ staticAnalysisView.prototype.run = function () {
}
warningCount++
var msg = yo`<span>${location} ${item.warning} ${item.more ? yo`<span><br><a href="${item.more}" target="blank">more</a></span>` : yo`<span></span>`}</span>`
self._deps.renderer.error(msg, warningContainer, {type: 'staticAnalysisWarning', useSpan: true})
self._deps.renderer.error(msg, warningContainer, {type: 'staticAnalysisWarning alert alert-warning', useSpan: true})
})
})
self.event.trigger('staticAnaysisWarning', [warningCount])

@ -99,14 +99,21 @@ class CompileTab extends CompilerApi {
this.fileManager.events.on('currentFileChanged', (name) => {
this.compilerContainer.currentFile = name
cleanupErrors()
onContentChanged()
})
this.fileManager.events.on('noFileSelected', () => {
this.compilerContainer.currentFile = ''
cleanupErrors()
onContentChanged()
})
const cleanupErrors = () => {
this._view.errorContainer.innerHTML = ''
this.events.emit('statusChanged', {key: '', title: '', type: ''})
}
this.compiler.event.register('compilationFinished', (success, data, source) => {
if (success) {
// forwarding the event to the appManager infra
@ -259,7 +266,7 @@ class CompileTab extends CompilerApi {
var result = yo`<div>${uploaded.map((value) => {
return yo`<div><b>${value.filename}</b> : <pre>${value.output.url}</pre></div>`
})}</div>`
modalDialogCustom.alert(yo`<span>Metadata published successfully.<br> <pre>${result}</pre> </span>`)
modalDialogCustom.alert(yo`<span>Metadata published successfully.<br> <span>${result}</span> </span>`)
}
}, (item) => { // triggered each time there's a new verified publish (means hash correspond)
this.swarmfileProvider.addReadOnly(item.hash, item.content)

@ -40,6 +40,7 @@ class CompilerContainer {
}
activate () {
this.currentFile = this.config.get('currentFile')
this.listenToEvents()
}

@ -90,7 +90,7 @@ Renderer.prototype.error = function (message, container, opt) {
var $pre = $(opt.useSpan ? yo`<span></span>` : yo`<pre></pre>`).html(message)
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)
var $error = $(yo`<div class="sol ${opt.type} ${classList}"><div class="close"><i class="fas fa-times"></i></div></div>`).prepend($pre)
$(container).append($error)
$error.click((ev) => {

@ -40,16 +40,12 @@ var css = yo`<style>
}
.sol.error {
background-color: var(--danger);
color: var(--white);
}
.sol.warning {
background-color: var(--warning);
}
.sol.staticAnalysisWarning {
background-color: var(--warning);
}
.sol.success {

Loading…
Cancel
Save