Commit ddfc094a authored by LianaHus's avatar LianaHus

-restyle errors on compiler tab

-check for fatal error as well -remove errors after file switch
parent e8509680
...@@ -120,7 +120,7 @@ staticAnalysisView.prototype.run = function () { ...@@ -120,7 +120,7 @@ staticAnalysisView.prototype.run = function () {
} }
warningCount++ 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>` 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]) self.event.trigger('staticAnaysisWarning', [warningCount])
......
...@@ -99,14 +99,21 @@ class CompileTab extends CompilerApi { ...@@ -99,14 +99,21 @@ class CompileTab extends CompilerApi {
this.fileManager.events.on('currentFileChanged', (name) => { this.fileManager.events.on('currentFileChanged', (name) => {
this.compilerContainer.currentFile = name this.compilerContainer.currentFile = name
cleanupErrors()
onContentChanged() onContentChanged()
}) })
this.fileManager.events.on('noFileSelected', () => { this.fileManager.events.on('noFileSelected', () => {
this.compilerContainer.currentFile = '' this.compilerContainer.currentFile = ''
cleanupErrors()
onContentChanged() onContentChanged()
}) })
const cleanupErrors = () => {
this._view.errorContainer.innerHTML = ''
this.events.emit('statusChanged', {key: '', title: '', type: ''})
}
this.compiler.event.register('compilationFinished', (success, data, source) => { this.compiler.event.register('compilationFinished', (success, data, source) => {
if (success) { if (success) {
// forwarding the event to the appManager infra // forwarding the event to the appManager infra
...@@ -259,7 +266,7 @@ class CompileTab extends CompilerApi { ...@@ -259,7 +266,7 @@ class CompileTab extends CompilerApi {
var result = yo`<div>${uploaded.map((value) => { var result = yo`<div>${uploaded.map((value) => {
return yo`<div><b>${value.filename}</b> : <pre>${value.output.url}</pre></div>` return yo`<div><b>${value.filename}</b> : <pre>${value.output.url}</pre></div>`
})}</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) }, (item) => { // triggered each time there's a new verified publish (means hash correspond)
this.swarmfileProvider.addReadOnly(item.hash, item.content) this.swarmfileProvider.addReadOnly(item.hash, item.content)
......
...@@ -40,6 +40,7 @@ class CompilerContainer { ...@@ -40,6 +40,7 @@ class CompilerContainer {
} }
activate () { activate () {
this.currentFile = this.config.get('currentFile')
this.listenToEvents() this.listenToEvents()
} }
......
...@@ -90,7 +90,7 @@ Renderer.prototype.error = function (message, container, opt) { ...@@ -90,7 +90,7 @@ Renderer.prototype.error = function (message, container, opt) {
var $pre = $(opt.useSpan ? yo`<span></span>` : yo`<pre></pre>`).html(message) var $pre = $(opt.useSpan ? yo`<span></span>` : yo`<pre></pre>`).html(message)
let classList = opt.type === 'error' ? 'alert alert-danger' : 'alert alert-warning' 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) $(container).append($error)
$error.click((ev) => { $error.click((ev) => {
......
...@@ -40,16 +40,12 @@ var css = yo`<style> ...@@ -40,16 +40,12 @@ var css = yo`<style>
} }
.sol.error { .sol.error {
background-color: var(--danger);
color: var(--white);
} }
.sol.warning { .sol.warning {
background-color: var(--warning);
} }
.sol.staticAnalysisWarning { .sol.staticAnalysisWarning {
background-color: var(--warning);
} }
.sol.success { .sol.success {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment