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
26e4c897
Unverified
Commit
26e4c897
authored
Aug 10, 2021
by
Liana Husikyan
Committed by
GitHub
Aug 10, 2021
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1453 from ethereum/matCont
track context menu special actions usage
parents
03cf7407
5fcc5aa6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
file-explorer-context-menu.tsx
...x-ui/file-explorer/src/lib/file-explorer-context-menu.tsx
+12
-0
No files found.
libs/remix-ui/file-explorer/src/lib/file-explorer-context-menu.tsx
View file @
26e4c897
...
@@ -4,6 +4,13 @@ import { action, FileExplorerContextMenuProps } from './types'
...
@@ -4,6 +4,13 @@ import { action, FileExplorerContextMenuProps } from './types'
import
'./css/file-explorer-context-menu.css'
import
'./css/file-explorer-context-menu.css'
import
{
customAction
}
from
'@remixproject/plugin-api/lib/file-system/file-panel'
import
{
customAction
}
from
'@remixproject/plugin-api/lib/file-system/file-panel'
declare
global
{
interface
Window
{
_paq
:
any
}
}
const
_paq
=
window
.
_paq
=
window
.
_paq
||
[]
//eslint-disable-line
export
const
FileExplorerContextMenu
=
(
props
:
FileExplorerContextMenuProps
)
=>
{
export
const
FileExplorerContextMenu
=
(
props
:
FileExplorerContextMenuProps
)
=>
{
const
{
actions
,
createNewFile
,
createNewFolder
,
deletePath
,
renamePath
,
hideContextMenu
,
pushChangesToGist
,
publishFileToGist
,
publishFolderToGist
,
copy
,
paste
,
runScript
,
emit
,
pageX
,
pageY
,
path
,
type
,
focus
,
...
otherProps
}
=
props
const
{
actions
,
createNewFile
,
createNewFolder
,
deletePath
,
renamePath
,
hideContextMenu
,
pushChangesToGist
,
publishFileToGist
,
publishFolderToGist
,
copy
,
paste
,
runScript
,
emit
,
pageX
,
pageY
,
path
,
type
,
focus
,
...
otherProps
}
=
props
const
contextMenuRef
=
useRef
(
null
)
const
contextMenuRef
=
useRef
(
null
)
...
@@ -76,15 +83,19 @@ export const FileExplorerContextMenu = (props: FileExplorerContextMenuProps) =>
...
@@ -76,15 +83,19 @@ export const FileExplorerContextMenu = (props: FileExplorerContextMenuProps) =>
deletePath
(
getPath
())
deletePath
(
getPath
())
break
break
case
'Push changes to gist'
:
case
'Push changes to gist'
:
_paq
.
push
([
'trackEvent'
,
'fileExplorer'
,
'pushToChangesoGist'
])
pushChangesToGist
(
path
,
type
)
pushChangesToGist
(
path
,
type
)
break
break
case
'Publish folder to gist'
:
case
'Publish folder to gist'
:
_paq
.
push
([
'trackEvent'
,
'fileExplorer'
,
'publishFolderToGist'
])
publishFolderToGist
(
path
,
type
)
publishFolderToGist
(
path
,
type
)
break
break
case
'Publish file to gist'
:
case
'Publish file to gist'
:
_paq
.
push
([
'trackEvent'
,
'fileExplorer'
,
'publishFileToGist'
])
publishFileToGist
(
path
,
type
)
publishFileToGist
(
path
,
type
)
break
break
case
'Run'
:
case
'Run'
:
_paq
.
push
([
'trackEvent'
,
'fileExplorer'
,
'runScript'
])
runScript
(
path
)
runScript
(
path
)
break
break
case
'Copy'
:
case
'Copy'
:
...
@@ -97,6 +108,7 @@ export const FileExplorerContextMenu = (props: FileExplorerContextMenuProps) =>
...
@@ -97,6 +108,7 @@ export const FileExplorerContextMenu = (props: FileExplorerContextMenuProps) =>
deletePath
(
getPath
())
deletePath
(
getPath
())
break
break
default
:
default
:
_paq
.
push
([
'trackEvent'
,
'fileExplorer'
,
'customAction'
,
item
.
name
])
emit
&&
emit
({
...
item
,
path
:
[
path
]
}
as
customAction
)
emit
&&
emit
({
...
item
,
path
:
[
path
]
}
as
customAction
)
break
break
}
}
...
...
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