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
745485f3
Commit
745485f3
authored
Nov 19, 2019
by
LianaHus
Committed by
Liana Husikyan
Nov 29, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed the css of "Add custom"
improved filtering
parent
3c8ade6b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
12 deletions
+13
-12
compilerContainer.js
src/app/tabs/compileTab/compilerContainer.js
+12
-12
switchFile.js
test-browser/commands/switchFile.js
+1
-0
No files found.
src/app/tabs/compileTab/compilerContainer.js
View file @
745485f3
...
@@ -124,7 +124,7 @@ class CompilerContainer {
...
@@ -124,7 +124,7 @@ class CompilerContainer {
const
pragmaStr
=
pragmaArr
[
0
].
replace
(
'pragma solidity'
,
''
).
trim
()
const
pragmaStr
=
pragmaArr
[
0
].
replace
(
'pragma solidity'
,
''
).
trim
()
const
pragma
=
pragmaStr
.
substring
(
0
,
pragmaStr
.
length
-
1
)
const
pragma
=
pragmaStr
.
substring
(
0
,
pragmaStr
.
length
-
1
)
const
fixedVersions
=
this
.
data
.
allversions
.
filter
(
obj
=>
!
obj
.
prerelease
).
map
(
obj
=>
obj
.
version
)
const
fixedVersions
=
this
.
data
.
allversions
.
filter
(
obj
=>
!
obj
.
prerelease
).
map
(
obj
=>
obj
.
version
)
if
(
!
semver
.
satisfies
(
this
.
_retrieveVersion
(),
pragma
))
{
if
(
fixedVersions
.
includes
(
this
.
data
.
selectedVersion
)
&&
!
semver
.
satisfies
(
this
.
_retrieveVersion
(),
pragma
))
{
const
compilerToLoad
=
semver
.
maxSatisfying
(
fixedVersions
,
pragma
)
const
compilerToLoad
=
semver
.
maxSatisfying
(
fixedVersions
,
pragma
)
const
compilerPath
=
this
.
data
.
allversions
.
filter
(
obj
=>
!
obj
.
prerelease
&&
obj
.
version
===
compilerToLoad
)[
0
].
path
const
compilerPath
=
this
.
data
.
allversions
.
filter
(
obj
=>
!
obj
.
prerelease
&&
obj
.
version
===
compilerToLoad
)[
0
].
path
if
(
this
.
data
.
selectedVersion
!==
compilerPath
)
{
if
(
this
.
data
.
selectedVersion
!==
compilerPath
)
{
...
@@ -208,9 +208,11 @@ class CompilerContainer {
...
@@ -208,9 +208,11 @@ class CompilerContainer {
<header class="navbar navbar-light p-2 bg-light">
<header class="navbar navbar-light p-2 bg-light">
<div class="row w-100 no-gutters mb-2">
<div class="row w-100 no-gutters mb-2">
<div class="col-sm-4">
<div class="col-sm-4">
<div class="d-flex flex-row">
<div class="d-flex flex-row justify-content-end">
<label class="
${
css
.
compilerLabel
}
input-group-text pl-0 border-0" for="versionSelector">Compiler</label>
<label class="
${
css
.
compilerLabel
}
input-group-text pr-0 border-0" for="versionSelector">
<button class="far fa-plus-square border-0 bg-light btn-sm" onclick=
${
this
.
loadCompiler
.
bind
(
this
)}
title="Add a custom compiler with URL"></button>
<button class="far fa-plus-square border-0 bg-light text-dark btn-sm" onclick=
${
this
.
loadCompiler
.
bind
(
this
)}
title="Add a custom compiler with URL"></button>
Compiler
</label>
</div>
</div>
</div>
</div>
<div class="col-sm-8">
<div class="col-sm-8">
...
@@ -263,11 +265,11 @@ class CompilerContainer {
...
@@ -263,11 +265,11 @@ class CompilerContainer {
return
this
.
_view
.
compileContainer
return
this
.
_view
.
compileContainer
}
}
loadCompiler
()
{
loadCompiler
()
{
modalDialogCustom
.
prompt
(
modalDialogCustom
.
prompt
(
'Add a custom compiler'
,
'Add a custom compiler'
,
"URL"
,
'URL'
,
'https://203137-40892817-gh.circle-artifacts.com/0/soljson.js'
,
'https://203137-40892817-gh.circle-artifacts.com/0/soljson.js'
,
// removed me before merge
(
url
)
=>
{
(
url
)
=>
{
this
.
addCustomCompiler
(
url
)
this
.
addCustomCompiler
(
url
)
}
}
...
@@ -276,6 +278,7 @@ class CompilerContainer {
...
@@ -276,6 +278,7 @@ class CompilerContainer {
addCustomCompiler
(
url
)
{
addCustomCompiler
(
url
)
{
this
.
data
.
selectedVersion
=
this
.
_view
.
versionSelector
.
value
this
.
data
.
selectedVersion
=
this
.
_view
.
versionSelector
.
value
this
.
data
.
customVersion
=
this
.
_view
.
versionSelector
.
value
// todo remove
this
.
_updateVersionSelector
(
url
)
this
.
_updateVersionSelector
(
url
)
}
}
...
@@ -354,6 +357,7 @@ class CompilerContainer {
...
@@ -354,6 +357,7 @@ class CompilerContainer {
let
url
let
url
if
(
customUrl
)
{
if
(
customUrl
)
{
this
.
data
.
selectedVersion
=
customUrl
this
.
data
.
selectedVersion
=
customUrl
this
.
data
.
version
=
'custom'
// TODO REMOVE
this
.
_view
.
versionSelector
.
appendChild
(
yo
`<option value="
${
customUrl
}
" selected>custom</option>`
)
this
.
_view
.
versionSelector
.
appendChild
(
yo
`<option value="
${
customUrl
}
" selected>custom</option>`
)
url
=
customUrl
url
=
customUrl
}
else
if
(
this
.
data
.
selectedVersion
===
'builtin'
)
{
}
else
if
(
this
.
data
.
selectedVersion
===
'builtin'
)
{
...
@@ -382,12 +386,8 @@ class CompilerContainer {
...
@@ -382,12 +386,8 @@ class CompilerContainer {
}
}
_updateLanguageSelector
()
{
_updateLanguageSelector
()
{
<<<<<<<
HEAD
// This is the first version when Yul is available
// This is the first version when Yul is available
if
(
this
.
_retrieveVersion
()
!==
'custom'
||
semver
.
lt
(
this
.
_retrieveVersion
(),
'v0.5.7+commit.6da8b019.js'
))
{
=======
if
(
!
semver
.
valid
(
this
.
_retrieveVersion
())
||
semver
.
lt
(
this
.
_retrieveVersion
(),
'v0.5.7+commit.6da8b019.js'
))
{
if
(
!
semver
.
valid
(
this
.
_retrieveVersion
())
||
semver
.
lt
(
this
.
_retrieveVersion
(),
'v0.5.7+commit.6da8b019.js'
))
{
>>>>>>>
4
d2e414d
...
added
default
to
test
this
.
_view
.
languageSelector
.
setAttribute
(
'disabled'
,
''
)
this
.
_view
.
languageSelector
.
setAttribute
(
'disabled'
,
''
)
this
.
_view
.
languageSelector
.
value
=
'Solidity'
this
.
_view
.
languageSelector
.
value
=
'Solidity'
this
.
compileTabLogic
.
setLanguage
(
'Solidity'
)
this
.
compileTabLogic
.
setLanguage
(
'Solidity'
)
...
@@ -397,7 +397,7 @@ class CompilerContainer {
...
@@ -397,7 +397,7 @@ class CompilerContainer {
}
}
setVersionText
(
text
)
{
setVersionText
(
text
)
{
this
.
data
.
version
=
text
this
.
data
.
version
=
text
// todo remove
if
(
this
.
_view
.
version
)
this
.
_view
.
version
.
innerText
=
text
if
(
this
.
_view
.
version
)
this
.
_view
.
version
.
innerText
=
text
}
}
...
...
test-browser/commands/switchFile.js
View file @
745485f3
...
@@ -12,6 +12,7 @@ class SwitchFile extends EventEmitter {
...
@@ -12,6 +12,7 @@ class SwitchFile extends EventEmitter {
}
}
}
}
// click on fileExplorer can toggle it. We go through settings to be sure FE is open
function
switchFile
(
browser
,
name
,
done
)
{
function
switchFile
(
browser
,
name
,
done
)
{
browser
.
clickLaunchIcon
(
'settings'
).
clickLaunchIcon
(
'fileExplorers'
)
browser
.
clickLaunchIcon
(
'settings'
).
clickLaunchIcon
(
'fileExplorers'
)
.
click
(
'li[key="'
+
name
+
'"]'
)
.
click
(
'li[key="'
+
name
+
'"]'
)
...
...
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