Commit 7c5ad393 authored by ioedeveloper's avatar ioedeveloper

Fixed expand path bug

parent 783e92d0
...@@ -119,7 +119,6 @@ const removePluginActions = (plugin) => { ...@@ -119,7 +119,6 @@ const removePluginActions = (plugin) => {
} }
const fileAdded = async (filePath: string) => { const fileAdded = async (filePath: string) => {
console.log('fileAdded: ', filePath)
await dispatch(fileAddedSuccess(filePath)) await dispatch(fileAddedSuccess(filePath))
if (filePath.includes('_test.sol')) { if (filePath.includes('_test.sol')) {
plugin.emit('newTestFileCreated', filePath) plugin.emit('newTestFileCreated', filePath)
...@@ -127,7 +126,6 @@ const fileAdded = async (filePath: string) => { ...@@ -127,7 +126,6 @@ const fileAdded = async (filePath: string) => {
} }
const folderAdded = async (folderPath: string) => { const folderAdded = async (folderPath: string) => {
console.log('folderAdded: ', folderPath)
const provider = plugin.fileManager.currentFileProvider() const provider = plugin.fileManager.currentFileProvider()
const path = extractParentFromKey(folderPath) || provider.workspace || provider.type || '' const path = extractParentFromKey(folderPath) || provider.workspace || provider.type || ''
...@@ -180,7 +178,9 @@ const executeEvent = async (eventName: 'fileAdded' | 'folderAdded' | 'fileRemove ...@@ -180,7 +178,9 @@ const executeEvent = async (eventName: 'fileAdded' | 'folderAdded' | 'fileRemove
pendingEvents[eventName + args[0]] = { eventName, path: args[0] } pendingEvents[eventName + args[0]] = { eventName, path: args[0] }
switch (eventName) { switch (eventName) {
case 'fileAdded': case 'fileAdded':
await fileAdded(args[0]) setTimeout(() => {
fileAdded(args[0])
}, 0)
delete pendingEvents[eventName + args[0]] delete pendingEvents[eventName + args[0]]
if (queuedEvents.length) { if (queuedEvents.length) {
const next = queuedEvents.pop() const next = queuedEvents.pop()
...@@ -190,7 +190,9 @@ const executeEvent = async (eventName: 'fileAdded' | 'folderAdded' | 'fileRemove ...@@ -190,7 +190,9 @@ const executeEvent = async (eventName: 'fileAdded' | 'folderAdded' | 'fileRemove
break break
case 'folderAdded': case 'folderAdded':
await folderAdded(args[0]) setTimeout(() => {
folderAdded(args[0])
}, 0)
delete pendingEvents[eventName + args[0]] delete pendingEvents[eventName + args[0]]
if (queuedEvents.length) { if (queuedEvents.length) {
const next = queuedEvents.pop() const next = queuedEvents.pop()
...@@ -200,7 +202,9 @@ const executeEvent = async (eventName: 'fileAdded' | 'folderAdded' | 'fileRemove ...@@ -200,7 +202,9 @@ const executeEvent = async (eventName: 'fileAdded' | 'folderAdded' | 'fileRemove
break break
case 'fileRemoved': case 'fileRemoved':
await fileRemoved(args[0]) setTimeout(() => {
fileRemoved(args[0])
}, 0)
delete pendingEvents[eventName + args[0]] delete pendingEvents[eventName + args[0]]
if (queuedEvents.length) { if (queuedEvents.length) {
const next = queuedEvents.pop() const next = queuedEvents.pop()
...@@ -210,7 +214,9 @@ const executeEvent = async (eventName: 'fileAdded' | 'folderAdded' | 'fileRemove ...@@ -210,7 +214,9 @@ const executeEvent = async (eventName: 'fileAdded' | 'folderAdded' | 'fileRemove
break break
case 'fileRenamed': case 'fileRenamed':
await fileRenamed(args[0]) setTimeout(() => {
fileRenamed(args[0])
}, 0)
delete pendingEvents[eventName + args[0]] delete pendingEvents[eventName + args[0]]
if (queuedEvents.length) { if (queuedEvents.length) {
const next = queuedEvents.pop() const next = queuedEvents.pop()
...@@ -220,7 +226,9 @@ const executeEvent = async (eventName: 'fileAdded' | 'folderAdded' | 'fileRemove ...@@ -220,7 +226,9 @@ const executeEvent = async (eventName: 'fileAdded' | 'folderAdded' | 'fileRemove
break break
case 'rootFolderChanged': case 'rootFolderChanged':
await rootFolderChanged(args[0]) setTimeout(() => {
rootFolderChanged(args[0])
}, 0)
delete pendingEvents[eventName + args[0]] delete pendingEvents[eventName + args[0]]
if (queuedEvents.length) { if (queuedEvents.length) {
const next = queuedEvents.pop() const next = queuedEvents.pop()
......
...@@ -200,3 +200,10 @@ export const removeContextMenuItem = (plugin) => { ...@@ -200,3 +200,10 @@ export const removeContextMenuItem = (plugin) => {
payload: plugin payload: plugin
} }
} }
export const setExpandPath = (paths: string[]) => {
return {
type: 'SET_EXPAND_PATH',
payload: paths
}
}
...@@ -4,7 +4,7 @@ import axios, { AxiosResponse } from 'axios' ...@@ -4,7 +4,7 @@ import axios, { AxiosResponse } from 'axios'
import { checkSpecialChars, checkSlash, extractNameFromKey, createNonClashingNameAsync } from '@remix-ui/helper' import { checkSpecialChars, checkSlash, extractNameFromKey, createNonClashingNameAsync } from '@remix-ui/helper'
import Gists from 'gists' import Gists from 'gists'
import { customAction } from '@remixproject/plugin-api/lib/file-system/file-panel/type' import { customAction } from '@remixproject/plugin-api/lib/file-system/file-panel/type'
import { addInputFieldSuccess, createWorkspaceError, createWorkspaceRequest, createWorkspaceSuccess, displayNotification, displayPopUp, fetchDirectoryError, fetchDirectoryRequest, fetchDirectorySuccess, fetchWorkspaceDirectoryError, fetchWorkspaceDirectoryRequest, fetchWorkspaceDirectorySuccess, focusElement, hideNotification, hidePopUp, removeInputFieldSuccess, setCurrentWorkspace, setDeleteWorkspace, setMode, setRenameWorkspace, setWorkspaces } from './payload' import { addInputFieldSuccess, createWorkspaceError, createWorkspaceRequest, createWorkspaceSuccess, displayNotification, displayPopUp, fetchDirectoryError, fetchDirectoryRequest, fetchDirectorySuccess, fetchWorkspaceDirectoryError, fetchWorkspaceDirectoryRequest, fetchWorkspaceDirectorySuccess, focusElement, hideNotification, hidePopUp, removeInputFieldSuccess, setCurrentWorkspace, setDeleteWorkspace, setExpandPath, setMode, setRenameWorkspace, setWorkspaces } from './payload'
import { listenOnPluginEvents, listenOnProviderEvents } from './events' import { listenOnPluginEvents, listenOnProviderEvents } from './events'
const QueryParams = require('../../../../../../apps/remix-ide/src/lib/query-params') const QueryParams = require('../../../../../../apps/remix-ide/src/lib/query-params')
...@@ -26,14 +26,17 @@ export const initWorkspace = (filePanelPlugin) => async (reducerDispatch: React. ...@@ -26,14 +26,17 @@ export const initWorkspace = (filePanelPlugin) => async (reducerDispatch: React.
dispatch(setWorkspaces(workspaces)) dispatch(setWorkspaces(workspaces))
if (params.gist) { if (params.gist) {
await createWorkspaceTemplate('gist-sample', true, 'gist-template') await createWorkspaceTemplate('gist-sample', 'gist-template')
await loadWorkspacePreset('gist-template')
dispatch(setCurrentWorkspace('gist-sample')) dispatch(setCurrentWorkspace('gist-sample'))
} else if (params.code || params.url) { } else if (params.code || params.url) {
await createWorkspaceTemplate('code-sample', true, 'code-template') await createWorkspaceTemplate('code-sample', 'code-template')
await loadWorkspacePreset('code-template')
dispatch(setCurrentWorkspace('code-sample')) dispatch(setCurrentWorkspace('code-sample'))
} else { } else {
if (workspaces.length === 0) { if (workspaces.length === 0) {
await createWorkspaceTemplate('default_workspace') await createWorkspaceTemplate('default_workspace', 'default-template')
await loadWorkspacePreset('default-template')
dispatch(setCurrentWorkspace('default_workspace')) dispatch(setCurrentWorkspace('default_workspace'))
} else { } else {
if (workspaces.length > 0) { if (workspaces.length > 0) {
...@@ -106,14 +109,14 @@ export const removeInputField = async (path: string) => { ...@@ -106,14 +109,14 @@ export const removeInputField = async (path: string) => {
} }
export const createWorkspace = async (workspaceName: string) => { export const createWorkspace = async (workspaceName: string) => {
console.log('workspaceName: ', workspaceName) const promise = createWorkspaceTemplate(workspaceName, 'default-template')
const promise = createWorkspaceTemplate(workspaceName, true, 'default-template')
dispatch(createWorkspaceRequest(promise)) dispatch(createWorkspaceRequest(promise))
promise.then(async () => { promise.then(async () => {
await plugin.fileManager.closeAllFiles() await plugin.fileManager.closeAllFiles()
dispatch(createWorkspaceSuccess(workspaceName)) dispatch(createWorkspaceSuccess(workspaceName))
switchToWorkspace(workspaceName) await loadWorkspacePreset('default-template')
// await switchToWorkspace(workspaceName)
}).catch((error) => { }).catch((error) => {
dispatch(createWorkspaceError({ error })) dispatch(createWorkspaceError({ error }))
}) })
...@@ -389,7 +392,11 @@ export const handleClickFile = async (path: string, type: 'file' | 'folder' | 'g ...@@ -389,7 +392,11 @@ export const handleClickFile = async (path: string, type: 'file' | 'folder' | 'g
dispatch(focusElement([{ key: path, type }])) dispatch(focusElement([{ key: path, type }]))
} }
const createWorkspaceTemplate = async (workspaceName: string, setDefaults = true, template: 'gist-template' | 'code-template' | 'default-template' = 'default-template') => { export const handleExpandPath = (paths: string[]) => {
dispatch(setExpandPath(paths))
}
const createWorkspaceTemplate = async (workspaceName: string, template: 'gist-template' | 'code-template' | 'default-template' = 'default-template') => {
if (!workspaceName) throw new Error('workspace name cannot be empty') if (!workspaceName) throw new Error('workspace name cannot be empty')
if (checkSpecialChars(workspaceName) || checkSlash(workspaceName)) throw new Error('special characters are not allowed') if (checkSpecialChars(workspaceName) || checkSlash(workspaceName)) throw new Error('special characters are not allowed')
if (await workspaceExists(workspaceName) && template === 'default-template') throw new Error('workspace already exists') if (await workspaceExists(workspaceName) && template === 'default-template') throw new Error('workspace already exists')
...@@ -397,14 +404,17 @@ const createWorkspaceTemplate = async (workspaceName: string, setDefaults = true ...@@ -397,14 +404,17 @@ const createWorkspaceTemplate = async (workspaceName: string, setDefaults = true
const workspaceProvider = plugin.fileProviders.workspace const workspaceProvider = plugin.fileProviders.workspace
await workspaceProvider.createWorkspace(workspaceName) await workspaceProvider.createWorkspace(workspaceName)
if (setDefaults) { }
}
const loadWorkspacePreset = async (template: 'gist-template' | 'code-template' | 'default-template' = 'default-template') => {
const workspaceProvider = plugin.fileProviders.workspace
const params = queryParams.get() const params = queryParams.get()
switch (template) { switch (template) {
case 'code-template': case 'code-template':
// creates a new workspace code-sample and loads code from url params. // creates a new workspace code-sample and loads code from url params.
try { try {
await workspaceProvider.createWorkspace(workspaceName)
let path = ''; let content = '' let path = ''; let content = ''
if (params.code) { if (params.code) {
...@@ -470,8 +480,6 @@ const createWorkspaceTemplate = async (workspaceName: string, setDefaults = true ...@@ -470,8 +480,6 @@ const createWorkspaceTemplate = async (workspaceName: string, setDefaults = true
} }
break break
} }
}
}
} }
const workspaceExists = async (name: string) => { const workspaceExists = async (name: string) => {
......
...@@ -10,6 +10,7 @@ import '../css/file-explorer.css' ...@@ -10,6 +10,7 @@ import '../css/file-explorer.css'
import { checkSpecialChars, extractNameFromKey, extractParentFromKey, joinPath } from '@remix-ui/helper' import { checkSpecialChars, extractNameFromKey, extractParentFromKey, joinPath } from '@remix-ui/helper'
// eslint-disable-next-line @typescript-eslint/no-unused-vars // eslint-disable-next-line @typescript-eslint/no-unused-vars
import { FileRender } from './file-render' import { FileRender } from './file-render'
import { handleExpandPath } from '../actions/workspace'
export const FileExplorer = (props: FileExplorerProps) => { export const FileExplorer = (props: FileExplorerProps) => {
const { name, contextMenuItems, removedContextMenuItems, files } = props const { name, contextMenuItems, removedContextMenuItems, files } = props
...@@ -29,7 +30,6 @@ export const FileExplorer = (props: FileExplorerProps) => { ...@@ -29,7 +30,6 @@ export const FileExplorer = (props: FileExplorerProps) => {
isNew: false, isNew: false,
lastEdit: '' lastEdit: ''
}, },
expandPath: [name],
mouseOverElement: null, mouseOverElement: null,
showContextMenu: false, showContextMenu: false,
reservedKeywords: [name, 'gist-'], reservedKeywords: [name, 'gist-'],
...@@ -38,12 +38,6 @@ export const FileExplorer = (props: FileExplorerProps) => { ...@@ -38,12 +38,6 @@ export const FileExplorer = (props: FileExplorerProps) => {
const [canPaste, setCanPaste] = useState(false) const [canPaste, setCanPaste] = useState(false)
useEffect(() => { useEffect(() => {
setState(prevState => {
return { ...prevState, expandPath: [...new Set([...prevState.expandPath, ...props.expandPath])] }
})
}, [props.expandPath])
useEffect(() => {
if (contextMenuItems) { if (contextMenuItems) {
addMenuItems(contextMenuItems) addMenuItems(contextMenuItems)
} }
...@@ -177,11 +171,9 @@ export const FileExplorer = (props: FileExplorerProps) => { ...@@ -177,11 +171,9 @@ export const FileExplorer = (props: FileExplorerProps) => {
const uploadFile = (target) => { const uploadFile = (target) => {
const parentFolder = getFocusedFolder() const parentFolder = getFocusedFolder()
const expandPath = [...new Set([...state.expandPath, parentFolder])] const expandPath = [...new Set([...props.expandPath, parentFolder])]
setState(prevState => { props.dispatchHandleExpandPath(expandPath)
return { ...prevState, expandPath }
})
props.dispatchUploadFile(target, parentFolder) props.dispatchUploadFile(target, parentFolder)
} }
...@@ -270,17 +262,15 @@ export const FileExplorer = (props: FileExplorerProps) => { ...@@ -270,17 +262,15 @@ export const FileExplorer = (props: FileExplorerProps) => {
} else { } else {
let expandPath = [] let expandPath = []
if (!state.expandPath.includes(path)) { if (!props.expandPath.includes(path)) {
expandPath = [...new Set([...state.expandPath, path])] expandPath = [...new Set([...props.expandPath, path])]
props.dispatchFetchDirectory(path) props.dispatchFetchDirectory(path)
} else { } else {
expandPath = [...new Set(state.expandPath.filter(key => key && (typeof key === 'string') && !key.startsWith(path)))] expandPath = [...new Set(props.expandPath.filter(key => key && (typeof key === 'string') && !key.startsWith(path)))]
} }
props.dispatchSetFocusElement([{ key: path, type }]) props.dispatchSetFocusElement([{ key: path, type }])
setState(prevState => { props.dispatchHandleExpandPath(expandPath)
return { ...prevState, expandPath }
})
} }
} }
...@@ -360,24 +350,20 @@ export const FileExplorer = (props: FileExplorerProps) => { ...@@ -360,24 +350,20 @@ export const FileExplorer = (props: FileExplorerProps) => {
const handleNewFileInput = async (parentFolder?: string) => { const handleNewFileInput = async (parentFolder?: string) => {
if (!parentFolder) parentFolder = getFocusedFolder() if (!parentFolder) parentFolder = getFocusedFolder()
const expandPath = [...new Set([...state.expandPath, parentFolder])] const expandPath = [...new Set([...props.expandPath, parentFolder])]
await props.dispatchAddInputField(parentFolder, 'file') await props.dispatchAddInputField(parentFolder, 'file')
setState(prevState => { props.dispatchHandleExpandPath(expandPath)
return { ...prevState, expandPath }
})
editModeOn(parentFolder + '/blank', 'file', true) editModeOn(parentFolder + '/blank', 'file', true)
} }
const handleNewFolderInput = async (parentFolder?: string) => { const handleNewFolderInput = async (parentFolder?: string) => {
if (!parentFolder) parentFolder = getFocusedFolder() if (!parentFolder) parentFolder = getFocusedFolder()
else if ((parentFolder.indexOf('.sol') !== -1) || (parentFolder.indexOf('.js') !== -1)) parentFolder = extractParentFromKey(parentFolder) else if ((parentFolder.indexOf('.sol') !== -1) || (parentFolder.indexOf('.js') !== -1)) parentFolder = extractParentFromKey(parentFolder)
const expandPath = [...new Set([...state.expandPath, parentFolder])] const expandPath = [...new Set([...props.expandPath, parentFolder])]
await props.dispatchAddInputField(parentFolder, 'folder') await props.dispatchAddInputField(parentFolder, 'folder')
setState(prevState => { props.dispatchHandleExpandPath(expandPath)
return { ...prevState, expandPath }
})
editModeOn(parentFolder + '/blank', 'folder', true) editModeOn(parentFolder + '/blank', 'folder', true)
} }
...@@ -413,14 +399,12 @@ export const FileExplorer = (props: FileExplorerProps) => { ...@@ -413,14 +399,12 @@ export const FileExplorer = (props: FileExplorerProps) => {
if (e && (e.target as any).getAttribute('data-id') === 'fileExplorerFileUpload') return // we don't want to let propagate the input of type file if (e && (e.target as any).getAttribute('data-id') === 'fileExplorerFileUpload') return // we don't want to let propagate the input of type file
let expandPath = [] let expandPath = []
if (!state.expandPath.includes(props.name)) { if (!props.expandPath.includes(props.name)) {
expandPath = [props.name, ...new Set([...state.expandPath])] expandPath = [props.name, ...new Set([...props.expandPath])]
} else { } else {
expandPath = [...new Set(state.expandPath.filter(key => key && (typeof key === 'string') && !key.startsWith(props.name)))] expandPath = [...new Set(props.expandPath.filter(key => key && (typeof key === 'string') && !key.startsWith(props.name)))]
} }
setState(prevState => { handleExpandPath(expandPath)
return { ...prevState, expandPath }
})
} }
return ( return (
...@@ -451,7 +435,7 @@ export const FileExplorer = (props: FileExplorerProps) => { ...@@ -451,7 +435,7 @@ export const FileExplorer = (props: FileExplorerProps) => {
focusEdit={state.focusEdit} focusEdit={state.focusEdit}
focusElement={props.focusElement} focusElement={props.focusElement}
ctrlKey={state.ctrlKey} ctrlKey={state.ctrlKey}
expandPath={state.expandPath} expandPath={props.expandPath}
editModeOff={editModeOff} editModeOff={editModeOff}
handleClickFile={handleClickFile} handleClickFile={handleClickFile}
handleClickFolder={handleClickFolder} handleClickFolder={handleClickFolder}
......
...@@ -27,4 +27,5 @@ export const FileSystemContext = createContext<{ ...@@ -27,4 +27,5 @@ export const FileSystemContext = createContext<{
dispatchRunScript: (path: string) => Promise<void>, dispatchRunScript: (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>
}>(null) }>(null)
...@@ -5,7 +5,7 @@ import { Toaster } from '@remix-ui/toaster' // eslint-disable-line ...@@ -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, addInputField, removeInputField, createWorkspace, fetchWorkspaceDirectory, switchToWorkspace, renameWorkspace, deleteWorkspace, clearPopUp, publishToGist, uploadFile, createNewFile, setFocusElement, createNewFolder, deletePath, renamePath, copyFile, copyFolder, runScript, emitContextMenuEvent, handleClickFile } from '../actions/workspace' import { initWorkspace, fetchDirectory, addInputField, removeInputField, createWorkspace, fetchWorkspaceDirectory, switchToWorkspace, renameWorkspace, deleteWorkspace, clearPopUp, publishToGist, uploadFile, createNewFile, setFocusElement, createNewFolder, deletePath, renamePath, copyFile, copyFolder, runScript, emitContextMenuEvent, handleClickFile, handleExpandPath } from '../actions/workspace'
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'
...@@ -111,6 +111,10 @@ export const FileSystemProvider = (props: WorkspaceProps) => { ...@@ -111,6 +111,10 @@ export const FileSystemProvider = (props: WorkspaceProps) => {
await handleClickFile(path, type) await handleClickFile(path, type)
} }
const dispatchHandleExpandPath = async (paths: string[]) => {
await handleExpandPath(paths)
}
useEffect(() => { useEffect(() => {
if (modals.length > 0) { if (modals.length > 0) {
setFocusModal(() => { setFocusModal(() => {
...@@ -205,7 +209,8 @@ export const FileSystemProvider = (props: WorkspaceProps) => { ...@@ -205,7 +209,8 @@ export const FileSystemProvider = (props: WorkspaceProps) => {
dispatchCopyFolder, dispatchCopyFolder,
dispatchRunScript, dispatchRunScript,
dispatchEmitContextMenuEvent, dispatchEmitContextMenuEvent,
dispatchHandleClickFile dispatchHandleClickFile,
dispatchHandleExpandPath
} }
return ( return (
<FileSystemContext.Provider value={value}> <FileSystemContext.Provider value={value}>
......
...@@ -517,6 +517,22 @@ export const browserReducer = (state = browserInitialState, action: Action) => { ...@@ -517,6 +517,22 @@ export const browserReducer = (state = browserInitialState, action: Action) => {
} }
} }
case 'SET_EXPAND_PATH': {
const payload = action.payload as string[]
return {
...state,
browser: {
...state.browser,
expandPath: state.mode === 'browser' ? payload : state.browser.expandPath
},
localhost: {
...state.localhost,
expandPath: state.mode === 'localhost' ? payload : state.localhost.expandPath
}
}
}
default: default:
throw new Error() throw new Error()
} }
......
...@@ -99,6 +99,7 @@ export function Workspace () { ...@@ -99,6 +99,7 @@ export function Workspace () {
const switchWorkspace = async (name: string) => { const switchWorkspace = async (name: string) => {
try { try {
await global.dispatchSwitchToWorkspace(name) await global.dispatchSwitchToWorkspace(name)
global.dispatchHandleExpandPath([])
} catch (e) { } catch (e) {
global.modal('Switch To Workspace', e.message, 'OK', () => {}, '') global.modal('Switch To Workspace', e.message, 'OK', () => {}, '')
console.error(e) console.error(e)
...@@ -208,6 +209,7 @@ export function Workspace () { ...@@ -208,6 +209,7 @@ export function Workspace () {
dispatchFetchDirectory={global.dispatchFetchDirectory} dispatchFetchDirectory={global.dispatchFetchDirectory}
dispatchRemoveInputField={global.dispatchRemoveInputField} dispatchRemoveInputField={global.dispatchRemoveInputField}
dispatchAddInputField={global.dispatchAddInputField} dispatchAddInputField={global.dispatchAddInputField}
dispatchHandleExpandPath={global.dispatchHandleExpandPath}
/> />
} }
</div> </div>
...@@ -242,6 +244,7 @@ export function Workspace () { ...@@ -242,6 +244,7 @@ export function Workspace () {
dispatchFetchDirectory={global.dispatchFetchDirectory} dispatchFetchDirectory={global.dispatchFetchDirectory}
dispatchRemoveInputField={global.dispatchRemoveInputField} dispatchRemoveInputField={global.dispatchRemoveInputField}
dispatchAddInputField={global.dispatchAddInputField} dispatchAddInputField={global.dispatchAddInputField}
dispatchHandleExpandPath={global.dispatchHandleExpandPath}
/> />
} }
</div> </div>
......
...@@ -78,7 +78,8 @@ export interface FileExplorerProps { ...@@ -78,7 +78,8 @@ export interface FileExplorerProps {
dispatchSetFocusElement: (elements: { key: string, type: 'file' | 'folder' | 'gist' }[]) => Promise<void>, dispatchSetFocusElement: (elements: { key: string, type: 'file' | 'folder' | 'gist' }[]) => Promise<void>,
dispatchFetchDirectory:(path: string) => Promise<void>, dispatchFetchDirectory:(path: string) => Promise<void>,
dispatchRemoveInputField:(path: string) => Promise<void>, dispatchRemoveInputField:(path: string) => Promise<void>,
dispatchAddInputField:(path: string, type: 'file' | 'folder') => Promise<void> dispatchAddInputField:(path: string, type: 'file' | 'folder') => Promise<void>,
dispatchHandleExpandPath: (paths: string[]) => Promise<void>
} }
export interface FileExplorerMenuProps { export interface FileExplorerMenuProps {
...@@ -141,7 +142,6 @@ export interface FileExplorerState { ...@@ -141,7 +142,6 @@ export interface FileExplorerState {
isNew: boolean isNew: boolean
lastEdit: string lastEdit: string
} }
expandPath: string[]
mouseOverElement: string mouseOverElement: string
showContextMenu: boolean showContextMenu: boolean
reservedKeywords: string[] reservedKeywords: string[]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment