Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
b3fdafee
Commit
b3fdafee
authored
Feb 19, 2019
by
Iuri Matias
Committed by
yann300
Mar 15, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor compile tab
parent
3e8ccdf6
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
22 deletions
+32
-22
app.js
src/app.js
+9
-1
analysis-tab.js
src/app/tabs/analysis-tab.js
+3
-0
compile-tab.js
src/app/tabs/compile-tab.js
+20
-21
No files found.
src/app.js
View file @
b3fdafee
...
...
@@ -432,7 +432,15 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
let
filePanel
=
new
FilePanel
()
registry
.
put
({
api
:
filePanel
,
name
:
'filepanel'
})
let
compileTab
=
new
CompileTab
(
registry
)
let
compileTab
=
new
CompileTab
(
registry
.
get
(
'editor'
).
api
,
registry
.
get
(
'config'
).
api
,
registry
.
get
(
'renderer'
).
api
,
registry
.
get
(
'fileproviders/swarm'
).
api
,
registry
.
get
(
'filemanager'
).
api
,
registry
.
get
(
'fileproviders'
).
api
,
registry
.
get
(
'pluginmanager'
).
api
)
let
run
=
new
RunTab
(
registry
.
get
(
'udapp'
).
api
,
registry
.
get
(
'udappUI'
).
api
,
...
...
src/app/tabs/analysis-tab.js
View file @
b3fdafee
...
...
@@ -12,6 +12,7 @@ class AnalysisTab extends ApiFactory {
this
.
event
=
new
EventManager
()
this
.
registry
=
registry
}
get
profile
()
{
return
{
name
:
'solidityStaticAnalysis'
,
...
...
@@ -23,6 +24,7 @@ class AnalysisTab extends ApiFactory {
kind
:
'analysis'
}
}
render
()
{
var
staticanalysis
=
new
StaticAnalysis
()
this
.
registry
.
put
({
api
:
staticanalysis
,
name
:
'staticanalysis'
})
...
...
@@ -31,6 +33,7 @@ class AnalysisTab extends ApiFactory {
this
.
el
=
yo
`<div class="
${
css
.
analysisTabView
}
" id="staticanalysisView">
${
staticanalysis
.
render
()}
</div>`
return
this
.
el
}
}
module
.
exports
=
AnalysisTab
src/app/tabs/compile-tab.js
View file @
b3fdafee
...
...
@@ -21,7 +21,7 @@ import { ApiFactory } from 'remix-plugin'
class
CompileTab
extends
ApiFactory
{
constructor
(
registry
)
{
constructor
(
editor
,
config
,
renderer
,
swarmfileProvider
,
fileManager
,
fileProviders
,
pluginManager
)
{
super
()
this
.
events
=
new
EventEmitter
()
this
.
_view
=
{
...
...
@@ -34,27 +34,26 @@ class CompileTab extends ApiFactory {
this
.
queryParams
=
new
QueryParams
()
// dependencies
this
.
_deps
=
{
editor
:
registry
.
get
(
'editor'
).
api
,
config
:
registry
.
get
(
'config'
).
api
,
renderer
:
registry
.
get
(
'renderer'
).
api
,
swarmfileProvider
:
registry
.
get
(
'fileproviders/swarm'
).
api
,
fileManager
:
registry
.
get
(
'filemanager'
).
api
,
fileProviders
:
registry
.
get
(
'fileproviders'
).
api
,
pluginManager
:
registry
.
get
(
'pluginmanager'
).
api
}
this
.
editor
=
editor
this
.
config
=
config
this
.
renderer
=
renderer
this
.
swarmfileProvider
=
swarmfileProvider
this
.
fileManager
=
fileManager
this
.
fileProviders
=
fileProviders
this
.
pluginManager
=
pluginManager
this
.
data
=
{
contractsDetails
:
{}
}
this
.
compileTabLogic
=
new
CompileTabLogic
(
this
.
queryParams
,
this
.
_deps
.
fileManager
,
this
.
_deps
.
editor
,
this
.
_deps
.
config
,
this
.
_dep
s
.
fileProviders
)
this
.
compileTabLogic
=
new
CompileTabLogic
(
this
.
queryParams
,
this
.
fileManager
,
this
.
editor
,
this
.
config
,
thi
s
.
fileProviders
)
this
.
compiler
=
this
.
compileTabLogic
.
compiler
this
.
compileTabLogic
.
init
()
this
.
compilerContainer
=
new
CompilerContainer
(
this
.
compileTabLogic
,
this
.
_deps
.
editor
,
this
.
_deps
.
config
,
this
.
editor
,
this
.
config
,
this
.
queryParams
)
}
...
...
@@ -82,7 +81,7 @@ class CompileTab extends ApiFactory {
}
})
this
.
_deps
.
fileManager
.
events
.
on
(
'currentFileChanged'
,
(
name
)
=>
{
this
.
fileManager
.
events
.
on
(
'currentFileChanged'
,
(
name
)
=>
{
this
.
compilerContainer
.
currentFile
=
name
})
this
.
compiler
.
event
.
register
(
'compilationFinished'
,
(
success
,
data
,
source
)
=>
{
...
...
@@ -106,7 +105,7 @@ class CompileTab extends ApiFactory {
yo
.
update
(
this
.
_view
.
contractSelection
,
contractSelection
)
if
(
data
[
'error'
])
{
this
.
_deps
.
renderer
.
error
(
data
[
'error'
].
formattedMessage
,
this
.
_view
.
errorContainer
,
{
type
:
data
[
'error'
].
severity
||
'error'
})
this
.
renderer
.
error
(
data
[
'error'
].
formattedMessage
,
this
.
_view
.
errorContainer
,
{
type
:
data
[
'error'
].
severity
||
'error'
})
if
(
data
[
'error'
].
mode
===
'panic'
)
{
return
modalDialogCustom
.
alert
(
yo
`<div><i class="fa fa-exclamation-circle
${
css
.
panicError
}
" aria-hidden="true"></i>
The compiler returned with the following internal error: <br> <b>
${
data
[
'error'
].
formattedMessage
}
.<br>
...
...
@@ -117,12 +116,12 @@ class CompileTab extends ApiFactory {
}
if
(
data
.
errors
&&
data
.
errors
.
length
)
{
data
.
errors
.
forEach
((
err
)
=>
{
if
(
this
.
_deps
.
config
.
get
(
'hideWarnings'
))
{
if
(
this
.
config
.
get
(
'hideWarnings'
))
{
if
(
err
.
severity
!==
'warning'
)
{
this
.
_deps
.
renderer
.
error
(
err
.
formattedMessage
,
this
.
_view
.
errorContainer
,
{
type
:
err
.
severity
})
this
.
renderer
.
error
(
err
.
formattedMessage
,
this
.
_view
.
errorContainer
,
{
type
:
err
.
severity
})
}
}
else
{
this
.
_deps
.
renderer
.
error
(
err
.
formattedMessage
,
this
.
_view
.
errorContainer
,
{
type
:
err
.
severity
})
this
.
renderer
.
error
(
err
.
formattedMessage
,
this
.
_view
.
errorContainer
,
{
type
:
err
.
severity
})
}
})
}
...
...
@@ -215,7 +214,7 @@ class CompileTab extends ApiFactory {
if
(
contract
.
metadata
===
undefined
||
contract
.
metadata
.
length
===
0
)
{
modalDialogCustom
.
alert
(
'This contract may be abstract, may not implement an abstract parent
\'
s methods completely or not invoke an inherited contract
\'
s constructor correctly.'
)
}
else
{
publishOnSwarm
(
contract
,
this
.
_deps
.
fileManager
,
function
(
err
,
uploaded
)
{
publishOnSwarm
(
contract
,
this
.
fileManager
,
function
(
err
,
uploaded
)
{
if
(
err
)
{
try
{
err
=
JSON
.
stringify
(
err
)
...
...
@@ -229,7 +228,7 @@ class CompileTab extends ApiFactory {
modalDialogCustom
.
alert
(
yo
`<span>Metadata published successfully.<br> <pre>
${
result
}
</pre> </span>`
)
}
},
(
item
)
=>
{
// triggered each time there's a new verified publish (means hash correspond)
this
.
_deps
.
swarmfileProvider
.
addReadOnly
(
item
.
hash
,
item
.
content
)
this
.
swarmfileProvider
.
addReadOnly
(
item
.
hash
,
item
.
content
)
})
}
}
...
...
@@ -339,7 +338,7 @@ class CompileTab extends ApiFactory {
this
.
_view
.
errorContainer
=
yo
`<div></div>`
this
.
_view
.
contractSelection
=
this
.
contractSelection
()
this
.
_view
.
compilerContainer
=
this
.
compilerContainer
.
render
()
const
currentFile
=
this
.
_deps
.
fileManager
.
currentFile
()
const
currentFile
=
this
.
fileManager
.
currentFile
()
if
(
currentFile
)
this
.
compilerContainer
.
currentFile
=
currentFile
this
.
_view
.
el
=
yo
`
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment