Merge pull request #1453 from ethereum/matCont

track context menu special actions usage
fixDebugNodes
Liana Husikyan 3 years ago committed by GitHub
commit 26e4c8977f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      libs/remix-ui/file-explorer/src/lib/file-explorer-context-menu.tsx

@ -4,6 +4,13 @@ import { action, FileExplorerContextMenuProps } from './types'
import './css/file-explorer-context-menu.css'
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) => {
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)
@ -76,15 +83,19 @@ export const FileExplorerContextMenu = (props: FileExplorerContextMenuProps) =>
deletePath(getPath())
break
case 'Push changes to gist':
_paq.push(['trackEvent', 'fileExplorer', 'pushToChangesoGist'])
pushChangesToGist(path, type)
break
case 'Publish folder to gist':
_paq.push(['trackEvent', 'fileExplorer', 'publishFolderToGist'])
publishFolderToGist(path, type)
break
case 'Publish file to gist':
_paq.push(['trackEvent', 'fileExplorer', 'publishFileToGist'])
publishFileToGist(path, type)
break
case 'Run':
_paq.push(['trackEvent', 'fileExplorer', 'runScript'])
runScript(path)
break
case 'Copy':
@ -97,6 +108,7 @@ export const FileExplorerContextMenu = (props: FileExplorerContextMenuProps) =>
deletePath(getPath())
break
default:
_paq.push(['trackEvent', 'fileExplorer', 'customAction', item.name])
emit && emit({ ...item, path: [path] } as customAction)
break
}

Loading…
Cancel
Save