Merge branch 'master' into parserfix

pull/5370/head
bunsenstraat 2 years ago committed by GitHub
commit 847cc50f41
  1. 7
      libs/remix-ui/workspace/src/lib/components/file-explorer-context-menu.tsx
  2. 2
      libs/remix-ui/workspace/src/lib/components/file-explorer-menu.tsx
  3. 7
      libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx

@ -72,15 +72,19 @@ export const FileExplorerContextMenu = (props: FileExplorerContextMenuProps) =>
switch (item.name) { switch (item.name) {
case 'New File': case 'New File':
createNewFile(path) createNewFile(path)
_paq.push(['trackEvent', 'fileExplorer', 'contextMenu', 'newFile'])
break break
case 'New Folder': case 'New Folder':
createNewFolder(path) createNewFolder(path)
_paq.push(['trackEvent', 'fileExplorer', 'contextMenu', 'newFolder'])
break break
case 'Rename': case 'Rename':
renamePath(path, type) renamePath(path, type)
_paq.push(['trackEvent', 'fileExplorer', 'contextMenu', 'rename'])
break break
case 'Delete': case 'Delete':
deletePath(getPath()) deletePath(getPath())
_paq.push(['trackEvent', 'fileExplorer', 'contextMenu', 'delete'])
break break
case 'Push changes to gist': case 'Push changes to gist':
_paq.push(['trackEvent', 'fileExplorer', 'pushToChangesoGist']) _paq.push(['trackEvent', 'fileExplorer', 'pushToChangesoGist'])
@ -100,12 +104,15 @@ export const FileExplorerContextMenu = (props: FileExplorerContextMenuProps) =>
break break
case 'Copy': case 'Copy':
copy(path, type) copy(path, type)
_paq.push(['trackEvent', 'fileExplorer', 'contextMenu', 'copy'])
break break
case 'Paste': case 'Paste':
paste(path, type) paste(path, type)
_paq.push(['trackEvent', 'fileExplorer', 'contextMenu', 'paste'])
break break
case 'Delete All': case 'Delete All':
deletePath(getPath()) deletePath(getPath())
_paq.push(['trackEvent', 'fileExplorer', 'contextMenu', 'deleteAll'])
break break
default: default:
_paq.push(['trackEvent', 'fileExplorer', 'customAction', `${item.id}/${item.name}`]) _paq.push(['trackEvent', 'fileExplorer', 'customAction', `${item.id}/${item.name}`])

@ -1,5 +1,6 @@
import React, { useState, useEffect } from 'react' //eslint-disable-line import React, { useState, useEffect } from 'react' //eslint-disable-line
import { FileExplorerMenuProps } from '../types' import { FileExplorerMenuProps } from '../types'
const _paq = window._paq = window._paq || []
export const FileExplorerMenu = (props: FileExplorerMenuProps) => { export const FileExplorerMenu = (props: FileExplorerMenuProps) => {
const [state, setState] = useState({ const [state, setState] = useState({
@ -72,6 +73,7 @@ export const FileExplorerMenu = (props: FileExplorerMenuProps) => {
data-id={'fileExplorerNewFile' + action} data-id={'fileExplorerNewFile' + action}
onClick={(e) => { onClick={(e) => {
e.stopPropagation() e.stopPropagation()
_paq.push(['trackEvent', 'fileExplorer', 'fileAction', action])
if (action === 'createNewFile') { if (action === 'createNewFile') {
props.createNewFile() props.createNewFile()
} else if (action === 'createNewFolder') { } else if (action === 'createNewFolder') {

@ -5,6 +5,7 @@ import { FileExplorer } from './components/file-explorer' // eslint-disable-line
import { FileSystemContext } from './contexts' import { FileSystemContext } from './contexts'
import './css/remix-ui-workspace.css' import './css/remix-ui-workspace.css'
import { ROOT_PATH } from './utils/constants' import { ROOT_PATH } from './utils/constants'
const _paq = window._paq = window._paq || []
const canUpload = window.File || window.FileReader || window.FileList || window.Blob const canUpload = window.File || window.FileReader || window.FileList || window.Blob
@ -205,6 +206,7 @@ export function Workspace () {
onClick={(e) => { onClick={(e) => {
e.stopPropagation() e.stopPropagation()
createWorkspace() createWorkspace()
_paq.push(['trackEvent', 'fileExplorer', 'workspaceMenu', 'workspaceCreate'])
}} }}
className='far fa-plus-square remixui_menuicon' className='far fa-plus-square remixui_menuicon'
title='Create'> title='Create'>
@ -216,6 +218,7 @@ export function Workspace () {
onClick={(e) => { onClick={(e) => {
e.stopPropagation() e.stopPropagation()
renameCurrentWorkspace() renameCurrentWorkspace()
_paq.push(['trackEvent', 'fileExplorer', 'workspaceMenu', 'workspaceRename'])
}} }}
className='far fa-edit remixui_menuicon' className='far fa-edit remixui_menuicon'
title='Rename'> title='Rename'>
@ -227,6 +230,7 @@ export function Workspace () {
onClick={(e) => { onClick={(e) => {
e.stopPropagation() e.stopPropagation()
deleteCurrentWorkspace() deleteCurrentWorkspace()
_paq.push(['trackEvent', 'fileExplorer', 'workspaceMenu', 'workspaceDelete'])
}} }}
className='far fa-trash remixui_menuicon' className='far fa-trash remixui_menuicon'
title='Delete'> title='Delete'>
@ -238,6 +242,7 @@ export function Workspace () {
onClick={(e) => { onClick={(e) => {
e.stopPropagation() e.stopPropagation()
downloadWorkspaces() downloadWorkspaces()
_paq.push(['trackEvent', 'fileExplorer', 'workspaceMenu', 'workspacesDownload'])
}} }}
className='far fa-download remixui_menuicon' className='far fa-download remixui_menuicon'
title='Download Workspaces'> title='Download Workspaces'>
@ -249,6 +254,7 @@ export function Workspace () {
onClick={(e) => { onClick={(e) => {
e.stopPropagation() e.stopPropagation()
restoreBackup() restoreBackup()
_paq.push(['trackEvent', 'fileExplorer', 'workspaceMenu', 'workspacesRestore'])
}} }}
className='far fa-upload remixui_menuicon' className='far fa-upload remixui_menuicon'
title='Restore Workspaces Backup'> title='Restore Workspaces Backup'>
@ -260,6 +266,7 @@ export function Workspace () {
onClick={(e) => { onClick={(e) => {
e.stopPropagation() e.stopPropagation()
cloneGitRepository() cloneGitRepository()
_paq.push(['trackEvent', 'fileExplorer', 'workspaceMenu', 'cloneGitRepository'])
}} }}
className='far fa-clone remixui_menuicon' className='far fa-clone remixui_menuicon'
title='Clone Git Repository'> title='Clone Git Repository'>

Loading…
Cancel
Save