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
c9916460
Commit
c9916460
authored
Jun 25, 2020
by
LianaHus
Committed by
ioedeveloper
Jul 13, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
generate the list of paths
parent
0c3271e1
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
5 deletions
+45
-5
fileManager.js
apps/remix-ide/src/app/files/fileManager.js
+33
-0
fileProvider.js
apps/remix-ide/src/app/files/fileProvider.js
+1
-1
test-tab.js
apps/remix-ide/src/app/tabs/test-tab.js
+6
-4
testTab.js
apps/remix-ide/src/app/tabs/testTab/testTab.js
+5
-0
No files found.
apps/remix-ide/src/app/files/fileManager.js
View file @
c9916460
...
...
@@ -493,6 +493,39 @@ class FileManager extends Plugin {
return
this
.
_deps
.
filesProviders
[
'browser'
]
}
allPaths
()
{
const
dirPaths
=
[]
const
findPaths
=
(
path
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
if
(
this
.
isDirectory
(
path
))
{
if
(
!
dirPaths
.
includes
(
path
))
{
dirPaths
.
push
(
path
)
console
.
log
(
'adding .. '
,
path
)
}
this
.
readdir
(
path
).
then
((
ls
)
=>
{
const
promises
=
Object
.
keys
(
ls
).
map
((
item
,
index
)
=>
{
const
curPath
=
`browser/
${
item
}
`
if
(
ls
[
item
].
isDirectory
)
{
return
findPaths
(
curPath
)
}
else
{
return
new
Promise
((
resolve
,
reject
)
=>
{
resolve
()
})
}
})
Promise
.
all
(
promises
).
then
(()
=>
{
resolve
(
dirPaths
)
})
})
}
else
{
resolve
(
dirPaths
)
}
})
}
const
br
=
findPaths
(
'browser'
)
const
lh
=
findPaths
(
'localhost'
)
return
Promise
.
all
([
br
,
lh
])
}
saveCurrentFile
()
{
var
currentFile
=
this
.
_deps
.
config
.
get
(
'currentFile'
)
if
(
currentFile
&&
this
.
editor
.
current
())
{
...
...
apps/remix-ide/src/app/files/fileProvider.js
View file @
c9916460
...
...
@@ -226,7 +226,7 @@ class FileProvider {
if
(
files
)
{
files
.
forEach
(
element
=>
{
const
absPath
=
(
path
===
'/'
?
''
:
path
)
+
'/'
+
element
ret
[
absPath
.
indexOf
(
'/'
)
===
0
?
absPath
.
replace
(
'/'
,
''
)
:
absPath
]
=
{
isDirectory
:
window
.
remixFileSystem
.
statSync
(
absPath
).
isDirectory
()
}
ret
[
absPath
.
indexOf
(
'/'
)
===
0
?
absPath
.
substr
(
1
,
absPath
.
length
)
:
absPath
]
=
{
isDirectory
:
window
.
remixFileSystem
.
statSync
(
absPath
).
isDirectory
()
}
// ^ ret does not accept path starting with '/'
})
}
...
...
apps/remix-ide/src/app/tabs/test-tab.js
View file @
c9916460
...
...
@@ -486,8 +486,7 @@ module.exports = class TestTab extends ViewPlugin {
}
allPaths () {
const paths = ['browser', 'browser/test']
return paths
return this.testTabLogic.allPaths()
}
render () {
...
...
@@ -510,10 +509,13 @@ module.exports = class TestTab extends ViewPlugin {
${
this
.
uiPathList
}
</div>
`
let
options
=
[
'browser'
,
'browser/test'
]
// this.allPaths()
this
.
allPaths
().
then
((
options
)
=>
{
console
.
log
(
'options '
,
options
,
' length is '
,
options
.
length
)
options
.
forEach
((
path
)
=>
{
console
.
log
(
'option '
,
path
)
this
.
uiPathList
.
appendChild
(
yo
`<option>
${
path
}
</option>`
)
})
})
this
.
testsExecutionStopped
.
hidden
=
true
this
.
testsExecutionStoppedError
.
hidden
=
true
...
...
@@ -523,7 +525,7 @@ module.exports = class TestTab extends ViewPlugin {
<div class="
${
css
.
testTabView
}
px-2" id="testView">
<div class="
${
css
.
infoBox
}
">
<p class="text-lg"> Test your smart contract in Solidity.</p>
<p> Click on "Generate" to generate a sample test file in
.
</p>
<p> Click on "Generate" to generate a sample test file in
a:
</p>
${
availablePaths
}
</div>
<div class="
${
css
.
tests
}
">
...
...
apps/remix-ide/src/app/tabs/testTab/testTab.js
View file @
c9916460
const
helper
=
require
(
'../../../lib/helper.js'
)
const
modalDialogCustom
=
require
(
'../../ui/modal-dialog-custom'
)
const
remixPath
=
require
(
'path'
)
class
TestTabLogic
{
constructor
(
fileManager
)
{
...
...
@@ -31,6 +32,10 @@ class TestTabLogic {
})
}
allPaths
()
{
return
this
.
fileManager
.
allPaths
()
}
async
getTests
(
cb
)
{
if
(
!
this
.
currentPath
)
return
cb
(
null
,
[])
const
provider
=
this
.
fileManager
.
fileProviderOf
(
this
.
currentPath
)
...
...
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