refactor analysis tab

pull/1/head
Iuri Matias 6 years ago committed by yann300
parent fd927e6678
commit 9196b042df
  1. 41
      src/app/tabs/analysis-tab.js

@ -2,19 +2,15 @@ var yo = require('yo-yo')
var csjs = require('csjs-inject')
var StaticAnalysis = require('../staticanalysis/staticAnalysisView')
var globalRegistry = require('../../global/registry')
var EventManager = require('../../lib/events')
module.exports = class AnalysisTab {
constructor (localRegistry) {
const self = this
self.event = new EventManager()
self._view = { el: null }
self.data = {}
self._components = {}
self._components.registry = localRegistry || globalRegistry
self._deps = {}
class AnalysisTab {
constructor (registry) {
this.event = new EventManager()
this.registry = registry
}
<<<<<<< HEAD
profile () {
return {
name: 'solidity static analysis',
@ -24,22 +20,25 @@ module.exports = class AnalysisTab {
description: ' - '
}
}
=======
>>>>>>> 2b6206e1... refactor analysis tab
render () {
const self = this
var staticanalysis = new StaticAnalysis()
staticanalysis.event.register('staticAnaysisWarning', (count) => {
if (count > 0) {
const msg = `Static Analysis raised ${count} warning(s) that requires your attention. Check Solidity Static Analysis Module for more information.`
const settings = { type: 'staticAnalysisWarning', useSpan: true }
self.event.trigger('newStaticAnaysisWarningMessage', [msg, settings])
}
if (count <= 0) return
const msg = `Static Analysis raised ${count} warning(s) that requires your attention. Check Solidity Static Analysis Module for more information.`
const settings = { type: 'staticAnalysisWarning', useSpan: true }
this.event.trigger('newStaticAnaysisWarningMessage', [msg, settings])
})
self._components.registry.put({api: staticanalysis, name: 'staticanalysis'})
if (self._view.el) return self._view.el
self._view.el = yo`
this.registry.put({api: staticanalysis, name: 'staticanalysis'})
if (this.el) return this.el
this.el = yo`
<div class="${css.analysisTabView} "id="staticanalysisView">${staticanalysis.render()}</div>`
return self._view.el
return this.el
}
}
const css = csjs`
@ -50,3 +49,5 @@ const css = csjs`
flex-direction: column;
}
`
module.exports = AnalysisTab

Loading…
Cancel
Save