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
14c22658
Unverified
Commit
14c22658
authored
Jun 28, 2018
by
yann300
Committed by
GitHub
Jun 28, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1349 from shyft-greg/master
Add ability to filter out compiler warnings
parents
d8664909
102151ed
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
0 deletions
+22
-0
compile-tab.js
src/app/tabs/compile-tab.js
+17
-0
universal-dapp-styles.js
src/universal-dapp-styles.js
+5
-0
No files found.
src/app/tabs/compile-tab.js
View file @
14c22658
...
...
@@ -29,6 +29,7 @@ module.exports = class CompileTab {
contractEl
:
null
}
self
.
data
=
{
hideWarnings
:
self
.
_opts
.
config
.
get
(
'hideWarnings'
)
||
false
,
autoCompile
:
self
.
_opts
.
config
.
get
(
'autoCompile'
),
compileTimeout
:
null
,
contractsDetails
:
{},
...
...
@@ -113,7 +114,13 @@ module.exports = class CompileTab {
if
(
data
.
errors
&&
data
.
errors
.
length
)
{
error
=
true
data
.
errors
.
forEach
(
function
(
err
)
{
if
(
self
.
_opts
.
config
.
get
(
'hideWarnings'
))
{
if
(
err
.
severity
!==
'warning'
)
{
self
.
_opts
.
renderer
.
error
(
err
.
formattedMessage
,
self
.
_view
.
errorContainer
,
{
type
:
err
.
severity
})
}
}
else
{
self
.
_opts
.
renderer
.
error
(
err
.
formattedMessage
,
self
.
_view
.
errorContainer
,
{
type
:
err
.
severity
})
}
})
}
if
(
!
error
&&
data
.
contracts
)
{
...
...
@@ -137,7 +144,9 @@ module.exports = class CompileTab {
self
.
_view
.
compileIcon
=
yo
`<i class="fa fa-refresh
${
css
.
icon
}
" aria-hidden="true"></i>`
self
.
_view
.
compileButton
=
yo
`<div class="
${
css
.
compileButton
}
" onclick=
${
compile
}
id="compile" title="Compile source code">
${
self
.
_view
.
compileIcon
}
Start to compile</div>`
self
.
_view
.
autoCompile
=
yo
`<input class="
${
css
.
autocompile
}
" onchange=
${
updateAutoCompile
}
id="autoCompile" type="checkbox" title="Auto compile">`
self
.
_view
.
hideWarningsBox
=
yo
`<input class="
${
css
.
autocompile
}
" onchange=
${
hideWarnings
}
id="hideWarningsBox" type="checkbox" title="Hide warnings">`
if
(
self
.
data
.
autoCompile
)
self
.
_view
.
autoCompile
.
setAttribute
(
'checked'
,
''
)
if
(
self
.
data
.
hideWarnings
)
self
.
_view
.
hideWarningsBox
.
setAttribute
(
'checked'
,
''
)
self
.
_view
.
compileContainer
=
yo
`
<div class="
${
css
.
compileContainer
}
">
<div class="
${
css
.
compileButtons
}
">
...
...
@@ -147,6 +156,10 @@ module.exports = class CompileTab {
<span class="
${
css
.
autocompileText
}
">Auto compile</span>
</div>
${
self
.
_view
.
warnCompilationSlow
}
<div class=
${
css
.
hideWarningsContainer
}
>
${
self
.
_view
.
hideWarningsBox
}
<span class="
${
css
.
autocompileText
}
">Hide warnings</span>
</div>
</div>
</div>`
self
.
_view
.
errorContainer
=
yo
`<div class='error'></div>`
...
...
@@ -181,6 +194,10 @@ module.exports = class CompileTab {
}
function
updateAutoCompile
(
event
)
{
self
.
_opts
.
config
.
set
(
'autoCompile'
,
self
.
_view
.
autoCompile
.
checked
)
}
function
compile
(
event
)
{
self
.
_api
.
runCompiler
()
}
function
hideWarnings
(
event
)
{
self
.
_opts
.
config
.
set
(
'hideWarnings'
,
self
.
_view
.
hideWarningsBox
.
checked
)
self
.
_api
.
runCompiler
()
}
function
details
()
{
const
select
=
self
.
_view
.
contractNames
if
(
select
.
children
.
length
>
0
&&
select
.
selectedIndex
>=
0
)
{
...
...
src/universal-dapp-styles.js
View file @
14c22658
...
...
@@ -241,6 +241,11 @@ var css = csjs`
padding-right: 26px;
padding-top: 5px;
float: right;
},
.hideWarningsContainer {
display: flex;
align-items: center;
margin-left: 2%
}
`
...
...
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