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
Hide 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 {
}
removePrefix
(
path
)
{
// if (!this.workspace) this.createWorkspace()
path
=
path
.
replace
(
/^
\/
|
\/
$/g
,
''
)
// remove first and last slash
if
(
path
.
startsWith
(
this
.
workspacesPath
+
'/'
+
this
.
workspace
))
return
path
if
(
path
.
startsWith
(
this
.
workspace
))
return
path
.
replace
(
this
.
workspace
,
this
.
workspacesPath
+
'/'
+
this
.
workspace
)
...
...
@@ -52,7 +51,6 @@ class WorkspaceFileProvider extends FileProvider {
}
resolveDirectory
(
path
,
callback
)
{
// if (!this.workspace) this.createWorkspace()
super
.
resolveDirectory
(
path
,
(
error
,
files
)
=>
{
if
(
error
)
return
callback
(
error
)
const
unscoped
=
{}
...
...
@@ -77,7 +75,6 @@ class WorkspaceFileProvider extends FileProvider {
}
_normalizePath
(
path
)
{
// if (!this.workspace) this.createWorkspace()
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 {
this
.
slitherHandle
=
new
SlitherHandle
()
this
.
workspaces
=
[]
this
.
appManager
=
appManager
this
.
workspaceStatus
=
{}
this
.
currentWorkspaceInfo
=
{}
}
onActivation
()
{
...
...
@@ -84,7 +84,7 @@ module.exports = class Filepanel extends ViewPlugin {
}
getCurrentWorkspace
()
{
return
this
.
workspaceStatus
return
this
.
currentWorkspaceInfo
}
getWorkspaces
()
{
...
...
@@ -120,7 +120,7 @@ module.exports = class Filepanel extends ViewPlugin {
setWorkspace
(
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
)
{
...
...
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
{
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
{
FileType
}
from
'../types'
// 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'
export
const
FileSystemContext
=
createContext
<
{
fs
:
BrowserState
,
// eslint-disable-next-line no-undef
modal
:(
title
:
string
,
message
:
string
|
JSX
.
Element
,
okLabel
:
string
,
okFn
:
()
=>
void
,
cancelLabel
?:
string
,
cancelFn
?:
()
=>
void
)
=>
void
,
dispatchInitWorkspace
:()
=>
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
{
ModalDialog
}
from
'@remix-ui/modal-dialog'
// eslint-disable-line
import
{
Toaster
}
from
'@remix-ui/toaster'
// eslint-disable-line
...
...
@@ -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
)
=>
{
setModals
(
modals
=>
{
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'
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
{
plugin
:
{
setWorkspace
:
({
name
:
string
,
isLocalhost
:
boolean
},
setEvent
:
boolean
)
=>
void
,
...
...
@@ -36,6 +41,7 @@ export interface WorkspaceState {
export
interface
Modal
{
hide
?:
boolean
title
:
string
// eslint-disable-next-line no-undef
message
:
string
|
JSX
.
Element
okLabel
:
string
okFn
:
()
=>
void
...
...
@@ -62,6 +68,7 @@ export interface FileExplorerProps {
focusEdit
:
string
,
focusElement
:
{
key
:
string
,
type
:
'file'
|
'folder'
|
'gist'
}[],
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
,
dispatchCreateNewFolder
:
(
path
:
string
,
rootDir
:
string
)
=>
Promise
<
void
>
,
readonly
:
boolean
,
...
...
@@ -90,10 +97,6 @@ export interface FileExplorerMenuProps {
publishToGist
:
(
path
?:
string
)
=>
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
{
actions
:
action
[],
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