Merge branch 'master' into regex

pull/5370/head
bunsenstraat 3 years ago committed by GitHub
commit 0914ea5f1d
  1. 2
      libs/remix-ui/settings/src/lib/remix-ui-settings.tsx
  2. 2
      libs/remix-ui/terminal/src/lib/components/RenderCall.tsx
  3. 11
      libs/remix-ui/workspace/src/lib/actions/index.ts
  4. 6
      libs/remix-ui/workspace/src/lib/components/file-explorer-context-menu.tsx
  5. 9
      libs/remix-ui/workspace/src/lib/components/file-explorer.tsx
  6. 1
      libs/remix-ui/workspace/src/lib/contexts/index.ts
  7. 7
      libs/remix-ui/workspace/src/lib/providers/FileSystemProvider.tsx
  8. 2
      libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx
  9. 2
      libs/remix-ui/workspace/src/lib/types/index.ts
  10. 6
      libs/remix-ui/workspace/src/lib/utils/index.ts

@ -198,7 +198,7 @@ export const RemixUiSettings = (props: RemixUiSettingsProps) => {
<div className="border-top"> <div className="border-top">
<div className="card-body pt-3 pb-2"> <div className="card-body pt-3 pb-2">
<h6 className="card-title">{ swarmSettingsTitle }</h6> <h6 className="card-title">{ swarmSettingsTitle }</h6>
<div className=""><label>PRIVATE BEE ADDRESS:</label> <div className="pt-2"><label>PRIVATE BEE ADDRESS:</label>
<div className="text-secondary mb-0 h6"> <div className="text-secondary mb-0 h6">
<input id="swarmprivatebeeaddress" data-id="settingsPrivateBeeAddress" className="form-control" onChange={handleSavePrivateBeeAddress} value={ privateBeeAddress } /> <input id="swarmprivatebeeaddress" data-id="settingsPrivateBeeAddress" className="form-control" onChange={handleSavePrivateBeeAddress} value={ privateBeeAddress } />
</div> </div>

@ -34,7 +34,7 @@ const RenderCall = ({ tx, resolvedData, logs, index, plugin, showTableHash, txDe
<div className='remix_ui_terminal_buttons'> <div className='remix_ui_terminal_buttons'>
<div className="remix_ui_terminal_debug btn btn-primary btn-sm" onClick={(event) => debug(event, tx)}>Debug</div> <div className="remix_ui_terminal_debug btn btn-primary btn-sm" onClick={(event) => debug(event, tx)}>Debug</div>
</div> </div>
<i className="remix_ui_terminal_arrow fas fa-angle-down"></i> <i className={`remix_ui_terminal_arrow fas ${(showTableHash.includes(tx.hash)) ? 'fa-angle-up' : 'fa-angle-down'}`}></i>
</div> </div>
{showTableHash.includes(tx.hash) ? showTable({ {showTableHash.includes(tx.hash) ? showTable({
hash: tx.hash, hash: tx.hash,

@ -256,17 +256,6 @@ export const runScript = async (path: string) => {
}) })
} }
export const runScriptWithMocha = async (path: string) => {
const provider = plugin.fileManager.currentFileProvider()
provider.get(path, (error, content: string) => {
if (error) {
return dispatch(displayPopUp(error))
}
if (content) content = content + '\n' + 'mocha.run()'
plugin.call('scriptRunner', 'execute', content)
})
}
export const emitContextMenuEvent = async (cmd: customAction) => { export const emitContextMenuEvent = async (cmd: customAction) => {
await plugin.call(cmd.id, cmd.name, cmd) await plugin.call(cmd.id, cmd.name, cmd)
} }

@ -12,7 +12,7 @@ declare global {
const _paq = window._paq = window._paq || [] //eslint-disable-line 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, runScriptWithMocha, 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)
useEffect(() => { useEffect(() => {
contextMenuRef.current.focus() contextMenuRef.current.focus()
@ -98,10 +98,6 @@ export const FileExplorerContextMenu = (props: FileExplorerContextMenuProps) =>
_paq.push(['trackEvent', 'fileExplorer', 'runScript']) _paq.push(['trackEvent', 'fileExplorer', 'runScript'])
runScript(path) runScript(path)
break break
case 'Run with Mocha':
_paq.push(['trackEvent', 'fileExplorer', 'runScriptWithMocha'])
runScriptWithMocha(path)
break
case 'Copy': case 'Copy':
copy(path, type) copy(path, type)
break break

@ -221,14 +221,6 @@ export const FileExplorer = (props: FileExplorerProps) => {
} }
} }
const runScriptWithMocha = async (path: string) => {
try {
props.dispatchRunScriptWithMocha(path)
} catch (error) {
props.toast('Run script with Mocha failed')
}
}
const emitContextMenuEvent = (cmd: customAction) => { const emitContextMenuEvent = (cmd: customAction) => {
try { try {
props.dispatchEmitContextMenuEvent(cmd) props.dispatchEmitContextMenuEvent(cmd)
@ -462,7 +454,6 @@ export const FileExplorer = (props: FileExplorerProps) => {
deletePath={deletePath} deletePath={deletePath}
renamePath={editModeOn} renamePath={editModeOn}
runScript={runScript} runScript={runScript}
runScriptWithMocha={runScriptWithMocha}
copy={handleCopyClick} copy={handleCopyClick}
paste={handlePasteClick} paste={handlePasteClick}
emit={emitContextMenuEvent} emit={emitContextMenuEvent}

@ -25,7 +25,6 @@ export const FileSystemContext = createContext<{
dispatchCopyFile: (src: string, dest: string) => Promise<void>, dispatchCopyFile: (src: string, dest: string) => Promise<void>,
dispatchCopyFolder: (src: string, dest: string) => Promise<void>, dispatchCopyFolder: (src: string, dest: string) => Promise<void>,
dispatchRunScript: (path: string) => Promise<void>, dispatchRunScript: (path: string) => Promise<void>,
dispatchRunScriptWithMocha: (path: string) => Promise<void>,
dispatchEmitContextMenuEvent: (cmd: customAction) => Promise<void>, dispatchEmitContextMenuEvent: (cmd: customAction) => Promise<void>,
dispatchHandleClickFile: (path: string, type: 'file' | 'folder' | 'gist') => Promise<void> dispatchHandleClickFile: (path: string, type: 'file' | 'folder' | 'gist') => Promise<void>
dispatchHandleExpandPath: (paths: string[]) => Promise<void> dispatchHandleExpandPath: (paths: string[]) => Promise<void>

@ -5,7 +5,7 @@ import { Toaster } from '@remix-ui/toaster' // eslint-disable-line
// eslint-disable-next-line @typescript-eslint/no-unused-vars // eslint-disable-next-line @typescript-eslint/no-unused-vars
import { FileSystemContext } from '../contexts' import { FileSystemContext } from '../contexts'
import { browserReducer, browserInitialState } from '../reducers/workspace' import { browserReducer, browserInitialState } from '../reducers/workspace'
import { initWorkspace, fetchDirectory, removeInputField, deleteWorkspace, clearPopUp, publishToGist, createNewFile, setFocusElement, createNewFolder, deletePath, renamePath, copyFile, copyFolder, runScript, runScriptWithMocha, emitContextMenuEvent, handleClickFile, handleExpandPath, addInputField, createWorkspace, fetchWorkspaceDirectory, renameWorkspace, switchToWorkspace, uploadFile } from '../actions' import { initWorkspace, fetchDirectory, removeInputField, deleteWorkspace, clearPopUp, publishToGist, createNewFile, setFocusElement, createNewFolder, deletePath, renamePath, copyFile, copyFolder, runScript, emitContextMenuEvent, handleClickFile, handleExpandPath, addInputField, createWorkspace, fetchWorkspaceDirectory, renameWorkspace, switchToWorkspace, uploadFile } from '../actions'
import { Modal, WorkspaceProps } from '../types' import { Modal, WorkspaceProps } from '../types'
// eslint-disable-next-line @typescript-eslint/no-unused-vars // eslint-disable-next-line @typescript-eslint/no-unused-vars
import { Workspace } from '../remix-ui-workspace' import { Workspace } from '../remix-ui-workspace'
@ -103,10 +103,6 @@ export const FileSystemProvider = (props: WorkspaceProps) => {
await runScript(path) await runScript(path)
} }
const dispatchRunScriptWithMocha = async (path: string) => {
await runScriptWithMocha(path)
}
const dispatchEmitContextMenuEvent = async (cmd: customAction) => { const dispatchEmitContextMenuEvent = async (cmd: customAction) => {
await emitContextMenuEvent(cmd) await emitContextMenuEvent(cmd)
} }
@ -216,7 +212,6 @@ export const FileSystemProvider = (props: WorkspaceProps) => {
dispatchCopyFile, dispatchCopyFile,
dispatchCopyFolder, dispatchCopyFolder,
dispatchRunScript, dispatchRunScript,
dispatchRunScriptWithMocha,
dispatchEmitContextMenuEvent, dispatchEmitContextMenuEvent,
dispatchHandleClickFile, dispatchHandleClickFile,
dispatchHandleExpandPath dispatchHandleExpandPath

@ -198,7 +198,6 @@ export function Workspace () {
dispatchCopyFolder={global.dispatchCopyFolder} dispatchCopyFolder={global.dispatchCopyFolder}
dispatchPublishToGist={global.dispatchPublishToGist} dispatchPublishToGist={global.dispatchPublishToGist}
dispatchRunScript={global.dispatchRunScript} dispatchRunScript={global.dispatchRunScript}
dispatchRunScriptWithMocha={global.dispatchRunScriptWithMocha}
dispatchEmitContextMenuEvent={global.dispatchEmitContextMenuEvent} dispatchEmitContextMenuEvent={global.dispatchEmitContextMenuEvent}
dispatchHandleClickFile={global.dispatchHandleClickFile} dispatchHandleClickFile={global.dispatchHandleClickFile}
dispatchSetFocusElement={global.dispatchSetFocusElement} dispatchSetFocusElement={global.dispatchSetFocusElement}
@ -234,7 +233,6 @@ export function Workspace () {
dispatchCopyFolder={global.dispatchCopyFolder} dispatchCopyFolder={global.dispatchCopyFolder}
dispatchPublishToGist={global.dispatchPublishToGist} dispatchPublishToGist={global.dispatchPublishToGist}
dispatchRunScript={global.dispatchRunScript} dispatchRunScript={global.dispatchRunScript}
dispatchRunScriptWithMocha={global.dispatchRunScriptWithMocha}
dispatchEmitContextMenuEvent={global.dispatchEmitContextMenuEvent} dispatchEmitContextMenuEvent={global.dispatchEmitContextMenuEvent}
dispatchHandleClickFile={global.dispatchHandleClickFile} dispatchHandleClickFile={global.dispatchHandleClickFile}
dispatchSetFocusElement={global.dispatchSetFocusElement} dispatchSetFocusElement={global.dispatchSetFocusElement}

@ -87,7 +87,6 @@ export interface FileExplorerProps {
dispatchCopyFile: (src: string, dest: string) => Promise<void>, dispatchCopyFile: (src: string, dest: string) => Promise<void>,
dispatchCopyFolder: (src: string, dest: string) => Promise<void>, dispatchCopyFolder: (src: string, dest: string) => Promise<void>,
dispatchRunScript: (path: string) => Promise<void>, dispatchRunScript: (path: string) => Promise<void>,
dispatchRunScriptWithMocha: (path: string) => Promise<void>,
dispatchPublishToGist: (path?: string, type?: string) => Promise<void>, dispatchPublishToGist: (path?: string, type?: string) => Promise<void>,
dispatchEmitContextMenuEvent: (cmd: customAction) => Promise<void>, dispatchEmitContextMenuEvent: (cmd: customAction) => Promise<void>,
dispatchHandleClickFile: (path: string, type: 'file' | 'folder' | 'gist') => Promise<void>, dispatchHandleClickFile: (path: string, type: 'file' | 'folder' | 'gist') => Promise<void>,
@ -118,7 +117,6 @@ export interface FileExplorerContextMenuProps {
publishFolderToGist?: (path?: string, type?: string) => void, publishFolderToGist?: (path?: string, type?: string) => void,
publishFileToGist?: (path?: string, type?: string) => void, publishFileToGist?: (path?: string, type?: string) => void,
runScript?: (path: string) => void, runScript?: (path: string) => void,
runScriptWithMocha?: (path: string) => void,
emit?: (cmd: customAction) => void, emit?: (cmd: customAction) => void,
pageX: number, pageX: number,
pageY: number, pageY: number,

@ -30,12 +30,6 @@ export const contextMenuActions: MenuItems = [{
extension: ['.js'], extension: ['.js'],
multiselect: false, multiselect: false,
label: '' label: ''
}, {
id: 'runWithMocha',
name: 'Run with Mocha',
extension: ['.js'],
multiselect: false,
label: ''
}, { }, {
id: 'pushChangesToGist', id: 'pushChangesToGist',
name: 'Push changes to gist', name: 'Push changes to gist',

Loading…
Cancel
Save