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
e6a36a3f
Commit
e6a36a3f
authored
May 11, 2021
by
ioedeveloper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Wait for workspace creation before fetching
parent
c991d4ab
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
10 deletions
+16
-10
file-explorer.js
apps/remix-ide/src/app/files/file-explorer.js
+0
-0
file-panel.js
apps/remix-ide/src/app/panels/file-panel.js
+12
-8
fileSystem.ts
libs/remix-ui/file-explorer/src/lib/actions/fileSystem.ts
+4
-2
package-lock.json
package-lock.json
+0
-0
No files found.
apps/remix-ide/src/app/files/file-explorer.js
deleted
100644 → 0
View file @
c991d4ab
This diff is collapsed.
Click to expand it.
apps/remix-ide/src/app/panels/file-panel.js
View file @
e6a36a3f
...
@@ -4,7 +4,7 @@ import * as packageJson from '../../../../../package.json'
...
@@ -4,7 +4,7 @@ import * as packageJson from '../../../../../package.json'
import
React
from
'react'
// eslint-disable-line
import
React
from
'react'
// eslint-disable-line
import
ReactDOM
from
'react-dom'
import
ReactDOM
from
'react-dom'
import
{
Workspace
}
from
'@remix-ui/workspace'
// eslint-disable-line
import
{
Workspace
}
from
'@remix-ui/workspace'
// eslint-disable-line
import
{
bufferToHex
,
keccakFromString
}
from
'ethereumjs-util'
import
*
as
ethutil
from
'ethereumjs-util'
import
{
checkSpecialChars
,
checkSlash
}
from
'../../lib/helper'
import
{
checkSpecialChars
,
checkSlash
}
from
'../../lib/helper'
var
EventManager
=
require
(
'../../lib/events'
)
var
EventManager
=
require
(
'../../lib/events'
)
var
{
RemixdHandle
}
=
require
(
'../files/remixd-handle.js'
)
var
{
RemixdHandle
}
=
require
(
'../files/remixd-handle.js'
)
...
@@ -154,7 +154,7 @@ module.exports = class Filepanel extends ViewPlugin {
...
@@ -154,7 +154,7 @@ module.exports = class Filepanel extends ViewPlugin {
try
{
try
{
await
this
.
processCreateWorkspace
(
'code-sample'
)
await
this
.
processCreateWorkspace
(
'code-sample'
)
this
.
_deps
.
fileProviders
.
workspace
.
setWorkspace
(
'code-sample'
)
this
.
_deps
.
fileProviders
.
workspace
.
setWorkspace
(
'code-sample'
)
var
hash
=
bufferToHex
(
keccakFromString
(
params
.
code
))
var
hash
=
ethutil
.
bufferToHex
(
ethutil
.
keccak
(
params
.
code
))
const
fileName
=
'contract-'
+
hash
.
replace
(
'0x'
,
''
).
substring
(
0
,
10
)
+
'.sol'
const
fileName
=
'contract-'
+
hash
.
replace
(
'0x'
,
''
).
substring
(
0
,
10
)
+
'.sol'
const
path
=
fileName
const
path
=
fileName
await
this
.
_deps
.
fileProviders
.
workspace
.
set
(
path
,
atob
(
params
.
code
))
await
this
.
_deps
.
fileProviders
.
workspace
.
set
(
path
,
atob
(
params
.
code
))
...
@@ -166,12 +166,16 @@ module.exports = class Filepanel extends ViewPlugin {
...
@@ -166,12 +166,16 @@ module.exports = class Filepanel extends ViewPlugin {
return
return
}
}
// insert example contracts if there are no files to show
// insert example contracts if there are no files to show
this
.
_deps
.
fileProviders
.
browser
.
resolveDirectory
(
'/'
,
async
(
error
,
filesList
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
if
(
error
)
console
.
error
(
error
)
this
.
_deps
.
fileProviders
.
browser
.
resolveDirectory
(
'/'
,
async
(
error
,
filesList
)
=>
{
if
(
Object
.
keys
(
filesList
).
length
===
0
)
{
if
(
error
)
console
.
error
(
error
)
await
this
.
createWorkspace
(
'default_workspace'
)
if
(
Object
.
keys
(
filesList
).
length
===
0
)
{
}
await
this
.
createWorkspace
(
'default_workspace'
)
this
.
getWorkspaces
()
}
const
workspaces
=
await
this
.
getWorkspaces
()
resolve
(
workspaces
)
})
})
})
}
}
...
...
libs/remix-ui/file-explorer/src/lib/actions/fileSystem.ts
View file @
e6a36a3f
...
@@ -182,7 +182,8 @@ export const fileRenamedSuccess = (path: string, removePath: string, files) => {
...
@@ -182,7 +182,8 @@ export const fileRenamedSuccess = (path: string, removePath: string, files) => {
export
const
init
=
(
provider
,
workspaceName
:
string
,
plugin
,
registry
)
=>
(
dispatch
:
React
.
Dispatch
<
any
>
)
=>
{
export
const
init
=
(
provider
,
workspaceName
:
string
,
plugin
,
registry
)
=>
(
dispatch
:
React
.
Dispatch
<
any
>
)
=>
{
if
(
provider
)
{
if
(
provider
)
{
provider
.
event
.
register
(
'fileAdded'
,
async
(
filePath
)
=>
{
provider
.
event
.
register
(
'fileAdded'
,
async
(
filePath
)
=>
{
const
path
=
extractParentFromKey
(
filePath
)
?
extractParentFromKey
(
filePath
)
===
'/.workspaces'
?
workspaceName
:
extractParentFromKey
(
filePath
)
:
workspaceName
if
(
extractParentFromKey
(
filePath
)
===
'/.workspaces'
)
return
const
path
=
extractParentFromKey
(
filePath
)
||
workspaceName
const
data
=
await
fetchDirectoryContent
(
provider
,
path
)
const
data
=
await
fetchDirectoryContent
(
provider
,
path
)
dispatch
(
fileAddedSuccess
(
path
,
data
))
dispatch
(
fileAddedSuccess
(
path
,
data
))
...
@@ -191,7 +192,8 @@ export const init = (provider, workspaceName: string, plugin, registry) => (disp
...
@@ -191,7 +192,8 @@ export const init = (provider, workspaceName: string, plugin, registry) => (disp
}
}
})
})
provider
.
event
.
register
(
'folderAdded'
,
async
(
folderPath
)
=>
{
provider
.
event
.
register
(
'folderAdded'
,
async
(
folderPath
)
=>
{
const
path
=
extractParentFromKey
(
folderPath
)
?
extractParentFromKey
(
folderPath
)
===
'/.workspaces'
?
workspaceName
:
extractParentFromKey
(
folderPath
)
:
workspaceName
if
(
extractParentFromKey
(
folderPath
)
===
'/.workspaces'
)
return
const
path
=
extractParentFromKey
(
folderPath
)
||
workspaceName
const
data
=
await
fetchDirectoryContent
(
provider
,
path
)
const
data
=
await
fetchDirectoryContent
(
provider
,
path
)
dispatch
(
folderAddedSuccess
(
path
,
data
))
dispatch
(
folderAddedSuccess
(
path
,
data
))
...
...
package-lock.json
View file @
e6a36a3f
This source diff could not be displayed because it is too large. You can
view the blob
instead.
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