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
5baa82c5
Commit
5baa82c5
authored
Jan 12, 2021
by
ioedeveloper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed duplicate new file
parent
861fcfa0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
32 deletions
+20
-32
.env
.env
+3
-2
addFile.ts
apps/remix-ide-e2e/src/commands/addFile.ts
+5
-14
file-explorer.tsx
libs/remix-ui/file-explorer/src/lib/file-explorer.tsx
+12
-16
No files found.
.env
View file @
5baa82c5
gist_token=ef5df4e3822bf121f1aee4616ea110309e2d49f5
gist_token=ef5df4e3822bf121f1aee4616ea110309e2d49f5
account_passphrase=
<passphrase>
account_passphrase=
explain uniform adapt basic blue onion rebel pull rice erase volcano couple
account_password=
<password>
account_password=
remix_is_cool
NODE_OPTIONS=--max-old-space-size=2048
NODE_OPTIONS=--max-old-space-size=2048
\ No newline at end of file
apps/remix-ide-e2e/src/commands/addFile.ts
View file @
5baa82c5
...
@@ -15,20 +15,11 @@ class AddFile extends EventEmitter {
...
@@ -15,20 +15,11 @@ class AddFile extends EventEmitter {
function
addFile
(
browser
:
NightwatchBrowser
,
name
:
string
,
content
:
NightwatchContractContent
,
done
:
VoidFunction
)
{
function
addFile
(
browser
:
NightwatchBrowser
,
name
:
string
,
content
:
NightwatchContractContent
,
done
:
VoidFunction
)
{
browser
.
clickLaunchIcon
(
'udapp'
).
clickLaunchIcon
(
'fileExplorers'
).
click
(
'.newFile'
)
browser
.
clickLaunchIcon
(
'udapp'
).
clickLaunchIcon
(
'fileExplorers'
).
click
(
'.newFile'
)
.
waitForElementVisible
(
'#modal-dialog'
)
.
pause
(
2000
)
.
perform
((
client
,
done
)
=>
{
.
keys
(
name
)
browser
.
execute
(
function
(
fileName
)
{
.
keys
(
browser
.
Keys
.
ENTER
)
if
(
fileName
!==
'Untitled.sol'
)
{
.
pause
(
1000
)
document
.
querySelector
(
'#modal-dialog #prompt_text'
).
setAttribute
(
'value'
,
fileName
)
.
click
(
'[data-id="treeViewLitreeViewItembrowser/Greet.sol"]'
)
}
const
elem
=
document
.
querySelector
(
'#modal-footer-ok'
)
as
HTMLElement
elem
.
click
()
},
[
name
],
function
(
result
)
{
console
.
log
(
result
)
done
()
})
})
.
setEditorValue
(
content
.
content
)
.
setEditorValue
(
content
.
content
)
.
pause
(
1000
)
.
pause
(
1000
)
.
perform
(
function
()
{
.
perform
(
function
()
{
...
...
libs/remix-ui/file-explorer/src/lib/file-explorer.tsx
View file @
5baa82c5
...
@@ -156,8 +156,8 @@ export const FileExplorer = (props: FileExplorerProps) => {
...
@@ -156,8 +156,8 @@ export const FileExplorer = (props: FileExplorerProps) => {
filesProvider
.
event
.
register
(
'fileRenamed'
,
fileRenamed
)
filesProvider
.
event
.
register
(
'fileRenamed'
,
fileRenamed
)
},
[
state
.
files
])
},
[
state
.
files
])
const
resolveDirectory
=
async
(
folderPath
,
dir
:
File
[]):
Promise
<
File
[]
>
=>
{
const
resolveDirectory
=
async
(
folderPath
,
dir
:
File
[]
,
isChild
=
false
):
Promise
<
File
[]
>
=>
{
if
(
(
extractParentFromKey
(
state
.
focusEdit
.
element
)
===
name
)
&&
(
dir
.
findIndex
(({
path
})
=>
path
===
state
.
focusEdit
.
element
)
===
-
1
))
{
if
(
!
isChild
&&
(
state
.
focusEdit
.
element
===
'browser/blank'
)
&&
state
.
focusEdit
.
isNew
&&
(
dir
.
findIndex
(({
path
})
=>
path
===
'browser/blank'
)
===
-
1
))
{
dir
=
state
.
focusEdit
.
type
===
'file'
?
[...
dir
,
{
dir
=
state
.
focusEdit
.
type
===
'file'
?
[...
dir
,
{
path
:
state
.
focusEdit
.
element
,
path
:
state
.
focusEdit
.
element
,
name
:
''
,
name
:
''
,
...
@@ -171,25 +171,21 @@ export const FileExplorer = (props: FileExplorerProps) => {
...
@@ -171,25 +171,21 @@ export const FileExplorer = (props: FileExplorerProps) => {
dir
=
await
Promise
.
all
(
dir
.
map
(
async
(
file
)
=>
{
dir
=
await
Promise
.
all
(
dir
.
map
(
async
(
file
)
=>
{
if
(
file
.
path
===
folderPath
)
{
if
(
file
.
path
===
folderPath
)
{
if
((
extractParentFromKey
(
state
.
focusEdit
.
element
)
===
folderPath
)
&&
state
.
focusEdit
.
isNew
)
{
if
((
extractParentFromKey
(
state
.
focusEdit
.
element
)
===
folderPath
)
&&
state
.
focusEdit
.
isNew
)
{
if
(
file
.
child
&&
(
file
.
child
.
findIndex
(({
path
})
=>
path
===
state
.
focusEdit
.
element
)
===
-
1
))
{
file
.
child
=
state
.
focusEdit
.
type
===
'file'
?
[...
await
fetchDirectoryContent
(
folderPath
),
{
file
.
child
=
state
.
focusEdit
.
type
===
'file'
?
[...
await
fetchDirectoryContent
(
folderPath
),
{
path
:
state
.
focusEdit
.
element
,
path
:
state
.
focusEdit
.
element
,
name
:
''
,
name
:
''
,
isDirectory
:
false
isDirectory
:
false
}]
:
[{
}]
:
[{
path
:
state
.
focusEdit
.
element
,
path
:
state
.
focusEdit
.
element
,
name
:
''
,
name
:
''
,
isDirectory
:
true
isDirectory
:
true
},
...
await
fetchDirectoryContent
(
folderPath
)]
},
...
await
fetchDirectoryContent
(
folderPath
)]
}
else
{
file
.
child
=
await
fetchDirectoryContent
(
folderPath
)
}
}
else
{
}
else
{
file
.
child
=
await
fetchDirectoryContent
(
folderPath
)
file
.
child
=
await
fetchDirectoryContent
(
folderPath
)
}
}
return
file
return
file
}
else
if
(
file
.
child
)
{
}
else
if
(
file
.
child
)
{
file
.
child
=
await
resolveDirectory
(
folderPath
,
file
.
child
)
file
.
child
=
await
resolveDirectory
(
folderPath
,
file
.
child
,
true
)
return
file
return
file
}
else
{
}
else
{
return
file
return
file
...
...
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