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
dbaeefc8
Commit
dbaeefc8
authored
May 17, 2021
by
ioedeveloper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Display different modal messages for publish to gist cases
parent
e51bfffc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
5 deletions
+40
-5
file-explorer-context-menu.tsx
...x-ui/file-explorer/src/lib/file-explorer-context-menu.tsx
+4
-4
file-explorer.tsx
libs/remix-ui/file-explorer/src/lib/file-explorer.tsx
+33
-1
index.ts
libs/remix-ui/file-explorer/src/lib/types/index.ts
+3
-0
No files found.
libs/remix-ui/file-explorer/src/lib/file-explorer-context-menu.tsx
View file @
dbaeefc8
...
...
@@ -4,7 +4,7 @@ import { FileExplorerContextMenuProps } from './types'
import
'./css/file-explorer-context-menu.css'
export
const
FileExplorerContextMenu
=
(
props
:
FileExplorerContextMenuProps
)
=>
{
const
{
actions
,
createNewFile
,
createNewFolder
,
deletePath
,
renamePath
,
hideContextMenu
,
pu
blish
ToGist
,
runScript
,
emit
,
pageX
,
pageY
,
path
,
type
,
...
otherProps
}
=
props
const
{
actions
,
createNewFile
,
createNewFolder
,
deletePath
,
renamePath
,
hideContextMenu
,
pu
shChangesToGist
,
publishFileToGist
,
publishFolder
ToGist
,
runScript
,
emit
,
pageX
,
pageY
,
path
,
type
,
...
otherProps
}
=
props
const
contextMenuRef
=
useRef
(
null
)
useEffect
(()
=>
{
...
...
@@ -50,13 +50,13 @@ export const FileExplorerContextMenu = (props: FileExplorerContextMenuProps) =>
deletePath
(
path
)
break
case
'Push changes to gist'
:
pu
blish
ToGist
(
path
,
type
)
pu
shChanges
ToGist
(
path
,
type
)
break
case
'Publish folder to gist'
:
publishToGist
(
path
,
type
)
publish
Folder
ToGist
(
path
,
type
)
break
case
'Publish file to gist'
:
publishToGist
(
path
,
type
)
publish
File
ToGist
(
path
,
type
)
break
case
'Run'
:
runScript
(
path
)
...
...
libs/remix-ui/file-explorer/src/lib/file-explorer.tsx
View file @
dbaeefc8
...
...
@@ -382,6 +382,36 @@ export const FileExplorer = (props: FileExplorerProps) => {
modal
(
'Create a public gist'
,
`Are you sure you want to anonymously publish all your files in the
${
name
}
workspace as a public gist on github.com?`
,
'OK'
,
()
=>
toGist
(
path
,
type
),
'Cancel'
,
()
=>
{})
}
const
pushChangesToGist
=
(
path
?:
string
,
type
?:
string
)
=>
{
modal
(
'Create a public gist'
,
'Are you sure you want to push changes to remote gist file on github.com?'
,
{
label
:
'OK'
,
fn
:
()
=>
toGist
(
path
,
type
)
},
{
label
:
'Cancel'
,
fn
:
()
=>
{}
})
}
const
publishFolderToGist
=
(
path
?:
string
,
type
?:
string
)
=>
{
modal
(
'Create a public gist'
,
`Are you sure you want to anonymously publish all your files in the
${
path
}
folder as a public gist on github.com?`
,
{
label
:
'OK'
,
fn
:
()
=>
toGist
(
path
,
type
)
},
{
label
:
'Cancel'
,
fn
:
()
=>
{}
})
}
const
publishFileToGist
=
(
path
?:
string
,
type
?:
string
)
=>
{
modal
(
'Create a public gist'
,
`Are you sure you want to anonymously publish
${
path
}
file as a public gist on github.com?`
,
{
label
:
'OK'
,
fn
:
()
=>
toGist
(
path
,
type
)
},
{
label
:
'Cancel'
,
fn
:
()
=>
{}
})
}
const
toGist
=
(
path
?:
string
,
type
?:
string
)
=>
{
const
filesProvider
=
fileSystem
.
provider
.
provider
const
proccedResult
=
function
(
error
,
data
)
{
...
...
@@ -865,7 +895,9 @@ export const FileExplorer = (props: FileExplorerProps) => {
e
.
stopPropagation
()
handleMouseOver
(
state
.
focusContext
.
element
)
}
}
publishToGist=
{
publishToGist
}
pushChangesToGist=
{
pushChangesToGist
}
publishFolderToGist=
{
publishFolderToGist
}
publishFileToGist=
{
publishFileToGist
}
/>
}
</
div
>
...
...
libs/remix-ui/file-explorer/src/lib/types/index.ts
View file @
dbaeefc8
...
...
@@ -37,6 +37,9 @@ export interface FileExplorerContextMenuProps {
renamePath
:
(
path
:
string
,
type
:
string
)
=>
void
,
hideContextMenu
:
()
=>
void
,
publishToGist
?:
(
path
?:
string
,
type
?:
string
)
=>
void
,
pushChangesToGist
?:
(
path
?:
string
,
type
?:
string
)
=>
void
,
publishFolderToGist
?:
(
path
?:
string
,
type
?:
string
)
=>
void
,
publishFileToGist
?:
(
path
?:
string
,
type
?:
string
)
=>
void
,
runScript
?:
(
path
:
string
)
=>
void
,
emit
?:
(
id
:
string
,
path
:
string
)
=>
void
,
pageX
:
number
,
...
...
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