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
e585e0b5
Commit
e585e0b5
authored
Oct 13, 2021
by
ioedeveloper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix linting, remove comments and rename workspaceStatus
parent
cfd58670
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
15 additions
and
13 deletions
+15
-13
workspaceFileProvider.js
apps/remix-ide/src/app/files/workspaceFileProvider.js
+0
-3
file-panel.js
apps/remix-ide/src/app/panels/file-panel.js
+3
-3
file-label.tsx
libs/remix-ui/workspace/src/lib/components/file-label.tsx
+1
-1
file-render.tsx
libs/remix-ui/workspace/src/lib/components/file-render.tsx
+1
-1
index.ts
libs/remix-ui/workspace/src/lib/contexts/index.ts
+1
-0
FileSystemProvider.tsx
...mix-ui/workspace/src/lib/providers/FileSystemProvider.tsx
+2
-1
index.ts
libs/remix-ui/workspace/src/lib/types/index.ts
+7
-4
No files found.
apps/remix-ide/src/app/files/workspaceFileProvider.js
View file @
e585e0b5
...
@@ -31,7 +31,6 @@ class WorkspaceFileProvider extends FileProvider {
...
@@ -31,7 +31,6 @@ class WorkspaceFileProvider extends FileProvider {
}
}
removePrefix
(
path
)
{
removePrefix
(
path
)
{
// if (!this.workspace) this.createWorkspace()
path
=
path
.
replace
(
/^
\/
|
\/
$/g
,
''
)
// remove first and last slash
path
=
path
.
replace
(
/^
\/
|
\/
$/g
,
''
)
// remove first and last slash
if
(
path
.
startsWith
(
this
.
workspacesPath
+
'/'
+
this
.
workspace
))
return
path
if
(
path
.
startsWith
(
this
.
workspacesPath
+
'/'
+
this
.
workspace
))
return
path
if
(
path
.
startsWith
(
this
.
workspace
))
return
path
.
replace
(
this
.
workspace
,
this
.
workspacesPath
+
'/'
+
this
.
workspace
)
if
(
path
.
startsWith
(
this
.
workspace
))
return
path
.
replace
(
this
.
workspace
,
this
.
workspacesPath
+
'/'
+
this
.
workspace
)
...
@@ -52,7 +51,6 @@ class WorkspaceFileProvider extends FileProvider {
...
@@ -52,7 +51,6 @@ class WorkspaceFileProvider extends FileProvider {
}
}
resolveDirectory
(
path
,
callback
)
{
resolveDirectory
(
path
,
callback
)
{
// if (!this.workspace) this.createWorkspace()
super
.
resolveDirectory
(
path
,
(
error
,
files
)
=>
{
super
.
resolveDirectory
(
path
,
(
error
,
files
)
=>
{
if
(
error
)
return
callback
(
error
)
if
(
error
)
return
callback
(
error
)
const
unscoped
=
{}
const
unscoped
=
{}
...
@@ -77,7 +75,6 @@ class WorkspaceFileProvider extends FileProvider {
...
@@ -77,7 +75,6 @@ class WorkspaceFileProvider extends FileProvider {
}
}
_normalizePath
(
path
)
{
_normalizePath
(
path
)
{
// if (!this.workspace) this.createWorkspace()
return
path
.
replace
(
this
.
workspacesPath
+
'/'
+
this
.
workspace
+
'/'
,
''
)
return
path
.
replace
(
this
.
workspacesPath
+
'/'
+
this
.
workspace
+
'/'
,
''
)
}
}
...
...
apps/remix-ide/src/app/panels/file-panel.js
View file @
e585e0b5
...
@@ -54,7 +54,7 @@ module.exports = class Filepanel extends ViewPlugin {
...
@@ -54,7 +54,7 @@ module.exports = class Filepanel extends ViewPlugin {
this
.
slitherHandle
=
new
SlitherHandle
()
this
.
slitherHandle
=
new
SlitherHandle
()
this
.
workspaces
=
[]
this
.
workspaces
=
[]
this
.
appManager
=
appManager
this
.
appManager
=
appManager
this
.
workspaceStatus
=
{}
this
.
currentWorkspaceInfo
=
{}
}
}
onActivation
()
{
onActivation
()
{
...
@@ -84,7 +84,7 @@ module.exports = class Filepanel extends ViewPlugin {
...
@@ -84,7 +84,7 @@ module.exports = class Filepanel extends ViewPlugin {
}
}
getCurrentWorkspace
()
{
getCurrentWorkspace
()
{
return
this
.
workspaceStatus
return
this
.
currentWorkspaceInfo
}
}
getWorkspaces
()
{
getWorkspaces
()
{
...
@@ -120,7 +120,7 @@ module.exports = class Filepanel extends ViewPlugin {
...
@@ -120,7 +120,7 @@ module.exports = class Filepanel extends ViewPlugin {
setWorkspace
(
workspace
)
{
setWorkspace
(
workspace
)
{
const
workspaceProvider
=
this
.
fileProviders
.
workspace
const
workspaceProvider
=
this
.
fileProviders
.
workspace
this
.
workspaceStatus
=
{
name
:
workspace
.
name
,
isLocalhost
:
workspace
.
isLocalhost
,
absolutePath
:
`
${
workspaceProvider
.
workspacesPath
}
/
${
workspace
.
name
}
`
}
this
.
currentWorkspaceInfo
=
{
name
:
workspace
.
name
,
isLocalhost
:
workspace
.
isLocalhost
,
absolutePath
:
`
${
workspaceProvider
.
workspacesPath
}
/
${
workspace
.
name
}
`
}
}
}
workspaceDeleted
(
workspace
)
{
workspaceDeleted
(
workspace
)
{
...
...
libs/remix-ui/workspace/src/lib/components/file-label.tsx
View file @
e585e0b5
// eslint-disable-next-line
@typescript-eslint/no-unused-vars
// eslint-disable-next-line
no-use-before-define
import
React
,
{
useEffect
,
useRef
,
useState
}
from
'react'
import
React
,
{
useEffect
,
useRef
,
useState
}
from
'react'
import
{
FileType
}
from
'../types'
import
{
FileType
}
from
'../types'
...
...
libs/remix-ui/workspace/src/lib/components/file-render.tsx
View file @
e585e0b5
// eslint-disable-next-line
@typescript-eslint/no-unused-vars
// eslint-disable-next-line
no-use-before-define
import
React
,
{
SyntheticEvent
,
useEffect
,
useState
}
from
'react'
import
React
,
{
SyntheticEvent
,
useEffect
,
useState
}
from
'react'
import
{
FileType
}
from
'../types'
import
{
FileType
}
from
'../types'
// eslint-disable-next-line @typescript-eslint/no-unused-vars
// eslint-disable-next-line @typescript-eslint/no-unused-vars
...
...
libs/remix-ui/workspace/src/lib/contexts/index.ts
View file @
e585e0b5
...
@@ -4,6 +4,7 @@ import { BrowserState } from '../reducers/workspace'
...
@@ -4,6 +4,7 @@ import { BrowserState } from '../reducers/workspace'
export
const
FileSystemContext
=
createContext
<
{
export
const
FileSystemContext
=
createContext
<
{
fs
:
BrowserState
,
fs
:
BrowserState
,
// eslint-disable-next-line no-undef
modal
:(
title
:
string
,
message
:
string
|
JSX
.
Element
,
okLabel
:
string
,
okFn
:
()
=>
void
,
cancelLabel
?:
string
,
cancelFn
?:
()
=>
void
)
=>
void
,
modal
:(
title
:
string
,
message
:
string
|
JSX
.
Element
,
okLabel
:
string
,
okFn
:
()
=>
void
,
cancelLabel
?:
string
,
cancelFn
?:
()
=>
void
)
=>
void
,
dispatchInitWorkspace
:()
=>
Promise
<
void
>
,
dispatchInitWorkspace
:()
=>
Promise
<
void
>
,
dispatchFetchDirectory
:(
path
:
string
)
=>
Promise
<
void
>
,
dispatchFetchDirectory
:(
path
:
string
)
=>
Promise
<
void
>
,
...
...
libs/remix-ui/workspace/src/lib/providers/FileSystemProvider.tsx
View file @
e585e0b5
// eslint-disable-next-line
@typescript-eslint/no-unused-vars
// eslint-disable-next-line
no-use-before-define
import
React
,
{
useReducer
,
useState
,
useEffect
,
SyntheticEvent
}
from
'react'
import
React
,
{
useReducer
,
useState
,
useEffect
,
SyntheticEvent
}
from
'react'
import
{
ModalDialog
}
from
'@remix-ui/modal-dialog'
// eslint-disable-line
import
{
ModalDialog
}
from
'@remix-ui/modal-dialog'
// eslint-disable-line
import
{
Toaster
}
from
'@remix-ui/toaster'
// eslint-disable-line
import
{
Toaster
}
from
'@remix-ui/toaster'
// eslint-disable-line
...
@@ -166,6 +166,7 @@ export const FileSystemProvider = (props: WorkspaceProps) => {
...
@@ -166,6 +166,7 @@ export const FileSystemProvider = (props: WorkspaceProps) => {
})
})
}
}
// eslint-disable-next-line no-undef
const
modal
=
(
title
:
string
,
message
:
string
|
JSX
.
Element
,
okLabel
:
string
,
okFn
:
()
=>
void
,
cancelLabel
?:
string
,
cancelFn
?:
()
=>
void
)
=>
{
const
modal
=
(
title
:
string
,
message
:
string
|
JSX
.
Element
,
okLabel
:
string
,
okFn
:
()
=>
void
,
cancelLabel
?:
string
,
cancelFn
?:
()
=>
void
)
=>
{
setModals
(
modals
=>
{
setModals
(
modals
=>
{
modals
.
push
({
message
,
title
,
okLabel
,
okFn
,
cancelLabel
,
cancelFn
})
modals
.
push
({
message
,
title
,
okLabel
,
okFn
,
cancelLabel
,
cancelFn
})
...
...
libs/remix-ui/workspace/src/lib/types/index.ts
View file @
e585e0b5
import
React
from
'react'
import
{
customAction
}
from
'@remixproject/plugin-api/lib/file-system/file-panel'
import
{
customAction
}
from
'@remixproject/plugin-api/lib/file-system/file-panel'
export
type
action
=
{
name
:
string
,
type
?:
Array
<
'folder'
|
'gist'
|
'file'
>
,
path
?:
string
[],
extension
?:
string
[],
pattern
?:
string
[],
id
:
string
,
multiselect
:
boolean
,
label
:
string
,
sticky
?:
boolean
}
export
type
MenuItems
=
action
[]
export
interface
WorkspaceProps
{
export
interface
WorkspaceProps
{
plugin
:
{
plugin
:
{
setWorkspace
:
({
name
:
string
,
isLocalhost
:
boolean
},
setEvent
:
boolean
)
=>
void
,
setWorkspace
:
({
name
:
string
,
isLocalhost
:
boolean
},
setEvent
:
boolean
)
=>
void
,
...
@@ -36,6 +41,7 @@ export interface WorkspaceState {
...
@@ -36,6 +41,7 @@ export interface WorkspaceState {
export
interface
Modal
{
export
interface
Modal
{
hide
?:
boolean
hide
?:
boolean
title
:
string
title
:
string
// eslint-disable-next-line no-undef
message
:
string
|
JSX
.
Element
message
:
string
|
JSX
.
Element
okLabel
:
string
okLabel
:
string
okFn
:
()
=>
void
okFn
:
()
=>
void
...
@@ -62,6 +68,7 @@ export interface FileExplorerProps {
...
@@ -62,6 +68,7 @@ export interface FileExplorerProps {
focusEdit
:
string
,
focusEdit
:
string
,
focusElement
:
{
key
:
string
,
type
:
'file'
|
'folder'
|
'gist'
}[],
focusElement
:
{
key
:
string
,
type
:
'file'
|
'folder'
|
'gist'
}[],
dispatchCreateNewFile
:
(
path
:
string
,
rootDir
:
string
)
=>
Promise
<
void
>
,
dispatchCreateNewFile
:
(
path
:
string
,
rootDir
:
string
)
=>
Promise
<
void
>
,
// eslint-disable-next-line no-undef
modal
:(
title
:
string
,
message
:
string
|
JSX
.
Element
,
okLabel
:
string
,
okFn
:
()
=>
void
,
cancelLabel
?:
string
,
cancelFn
?:
()
=>
void
)
=>
void
,
modal
:(
title
:
string
,
message
:
string
|
JSX
.
Element
,
okLabel
:
string
,
okFn
:
()
=>
void
,
cancelLabel
?:
string
,
cancelFn
?:
()
=>
void
)
=>
void
,
dispatchCreateNewFolder
:
(
path
:
string
,
rootDir
:
string
)
=>
Promise
<
void
>
,
dispatchCreateNewFolder
:
(
path
:
string
,
rootDir
:
string
)
=>
Promise
<
void
>
,
readonly
:
boolean
,
readonly
:
boolean
,
...
@@ -90,10 +97,6 @@ export interface FileExplorerMenuProps {
...
@@ -90,10 +97,6 @@ export interface FileExplorerMenuProps {
publishToGist
:
(
path
?:
string
)
=>
void
,
publishToGist
:
(
path
?:
string
)
=>
void
,
uploadFile
:
(
target
:
EventTarget
&
HTMLInputElement
)
=>
void
uploadFile
:
(
target
:
EventTarget
&
HTMLInputElement
)
=>
void
}
}
export
type
action
=
{
name
:
string
,
type
?:
Array
<
'folder'
|
'gist'
|
'file'
>
,
path
?:
string
[],
extension
?:
string
[],
pattern
?:
string
[],
id
:
string
,
multiselect
:
boolean
,
label
:
string
,
sticky
?:
boolean
}
export
type
MenuItems
=
action
[]
export
interface
FileExplorerContextMenuProps
{
export
interface
FileExplorerContextMenuProps
{
actions
:
action
[],
actions
:
action
[],
createNewFile
:
(
folder
?:
string
)
=>
void
,
createNewFile
:
(
folder
?:
string
)
=>
void
,
...
...
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