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
2413a190
Commit
2413a190
authored
Sep 24, 2019
by
LianaHus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added "delete from remix"
parent
70fbfbe2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
9 deletions
+18
-9
file-explorer.js
src/app/files/file-explorer.js
+12
-6
fileProvider.js
src/app/files/fileProvider.js
+6
-3
No files found.
src/app/files/file-explorer.js
View file @
2413a190
...
@@ -220,14 +220,20 @@ function fileExplorer (localRegistry, files, menuItems) {
...
@@ -220,14 +220,20 @@ function fileExplorer (localRegistry, files, menuItems) {
}
}
actions
[
'Delete'
]
=
()
=>
{
actions
[
'Delete'
]
=
()
=>
{
if
(
self
.
files
.
readonly
)
{
return
tooltip
(
'cannot delete file. '
+
self
.
files
.
type
+
' is a read only explorer'
)
}
if
(
self
.
files
.
readonly
)
{
return
tooltip
(
'cannot delete file. '
+
self
.
files
.
type
+
' is a read only explorer'
)
}
modalDialogCustom
.
confirm
(
'Delete a file'
,
'Are you sure you want to delete this file?'
,
()
=>
{
files
.
remove
(
key
)
},
()
=>
{})
modalDialogCustom
.
confirm
(
'Delete a file'
,
'Are you sure you want to delete this file?'
,
()
=>
{
files
.
remove
(
key
)
},
()
=>
{}
)
}
}
}
else
{
}
else
{
actions
[
'Copy to Browser explorer'
]
=
()
=>
{
actions
[
'Delete from remix'
]
=
()
=>
{
files
.
get
(
key
,
(
error
,
content
)
=>
{
modalDialogCustom
.
confirm
(
if
(
error
)
return
tooltip
(
error
)
'Delete from remix'
,
self
.
_deps
.
fileManager
.
setFile
(
`browser/
${
label
.
innerText
}
`
,
content
)
'Are you sure you want to delete this file from remix?'
,
})
()
=>
{
files
.
remove
(
key
)
},
()
=>
{}
)
}
}
}
}
MENU_HANDLE
=
contextMenu
(
event
,
actions
)
MENU_HANDLE
=
contextMenu
(
event
,
actions
)
...
...
src/app/files/fileProvider.js
View file @
2413a190
...
@@ -71,7 +71,7 @@ class FileProvider {
...
@@ -71,7 +71,7 @@ class FileProvider {
}
}
addReadOnly
(
path
,
content
,
url
)
{
addReadOnly
(
path
,
content
,
url
)
{
this
.
readonlyItems
.
push
(
'browser
/'
+
path
)
this
.
readonlyItems
.
push
(
this
.
type
+
'
/'
+
path
)
if
(
!
url
)
this
.
normalizedNames
[
url
]
=
path
if
(
!
url
)
this
.
normalizedNames
[
url
]
=
path
return
this
.
set
(
path
,
content
)
return
this
.
set
(
path
,
content
)
}
}
...
@@ -80,12 +80,15 @@ class FileProvider {
...
@@ -80,12 +80,15 @@ class FileProvider {
return
this
.
readonlyItems
.
includes
(
path
)
return
this
.
readonlyItems
.
includes
(
path
)
}
}
remove
(
path
)
{
_removeFromReadonlyList
(
path
)
{
// remove from readonly list
const
indexToRemove
=
this
.
readonlyItems
.
indexOf
(
path
)
const
indexToRemove
=
this
.
readonlyItems
.
indexOf
(
path
)
if
(
indexToRemove
!==
-
1
)
{
if
(
indexToRemove
!==
-
1
)
{
this
.
readonlyItems
.
splice
(
indexToRemove
,
1
)
this
.
readonlyItems
.
splice
(
indexToRemove
,
1
)
}
}
}
remove
(
path
)
{
this
.
_removeFromReadonlyList
(
path
)
var
unprefixedpath
=
this
.
removePrefix
(
path
)
var
unprefixedpath
=
this
.
removePrefix
(
path
)
if
(
!
this
.
_exists
(
unprefixedpath
))
{
if
(
!
this
.
_exists
(
unprefixedpath
))
{
...
...
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