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
33588ae0
Commit
33588ae0
authored
Oct 16, 2021
by
ioedeveloper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
register context menu after workspace initialization
parent
c5057116
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
79 additions
and
69 deletions
+79
-69
app.js
apps/remix-ide/src/app.js
+6
-1
file-panel.js
apps/remix-ide/src/app/panels/file-panel.js
+0
-1
remixAppManager.js
apps/remix-ide/src/remixAppManager.js
+19
-21
workspace.ts
libs/remix-ui/workspace/src/lib/reducers/workspace.ts
+52
-44
remix-ui-workspace.tsx
libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx
+2
-2
No files found.
apps/remix-ide/src/app.js
View file @
33588ae0
...
...
@@ -469,8 +469,13 @@ class App {
await
appManager
.
activatePlugin
([
'sidePanel'
])
// activating host plugin separately
await
appManager
.
activatePlugin
([
'home'
])
await
appManager
.
activatePlugin
([
'settings'
])
await
appManager
.
activatePlugin
([
'hiddenPanel'
,
'
filePanel'
,
'
pluginManager'
,
'contextualListener'
,
'terminal'
,
'blockchain'
,
'fetchAndCompile'
,
'contentImport'
])
await
appManager
.
activatePlugin
([
'hiddenPanel'
,
'pluginManager'
,
'contextualListener'
,
'terminal'
,
'blockchain'
,
'fetchAndCompile'
,
'contentImport'
])
await
appManager
.
registerContextMenuItems
()
appManager
.
on
(
'filePanel'
,
'workspaceInitializationCompleted'
,
async
()
=>
{
await
appManager
.
registerContextMenuItems
()
})
await
appManager
.
activatePlugin
([
'filePanel'
])
// Set workspace after initial activation
appManager
.
on
(
'editor'
,
'editorMounted'
,
()
=>
{
if
(
Array
.
isArray
(
workspace
))
{
...
...
apps/remix-ide/src/app/panels/file-panel.js
View file @
33588ae0
...
...
@@ -143,7 +143,6 @@ module.exports = class Filepanel extends ViewPlugin {
}
setWorkspace
(
workspace
)
{
console
.
log
(
'workspace: '
,
workspace
)
const
workspaceProvider
=
this
.
fileProviders
.
workspace
this
.
currentWorkspaceMetadata
=
{
name
:
workspace
.
name
,
isLocalhost
:
workspace
.
isLocalhost
,
absolutePath
:
`
${
workspaceProvider
.
workspacesPath
}
/
${
workspace
.
name
}
`
}
...
...
apps/remix-ide/src/remixAppManager.js
View file @
33588ae0
...
...
@@ -135,27 +135,25 @@ export class RemixAppManager extends PluginManager {
}
async
registerContextMenuItems
()
{
this
.
on
(
'filePanel'
,
'workspaceInitializationCompleted'
,
async
()
=>
{
await
this
.
call
(
'filePanel'
,
'registerContextMenuItem'
,
{
id
:
'flattener'
,
name
:
'flattenFileCustomAction'
,
label
:
'Flatten'
,
type
:
[],
extension
:
[
'.sol'
],
path
:
[],
pattern
:
[],
sticky
:
true
})
await
this
.
call
(
'filePanel'
,
'registerContextMenuItem'
,
{
id
:
'optimism-compiler'
,
name
:
'compileCustomAction'
,
label
:
'Compile with Optimism'
,
type
:
[],
extension
:
[
'.sol'
],
path
:
[],
pattern
:
[],
sticky
:
true
})
await
this
.
call
(
'filePanel'
,
'registerContextMenuItem'
,
{
id
:
'flattener'
,
name
:
'flattenFileCustomAction'
,
label
:
'Flatten'
,
type
:
[],
extension
:
[
'.sol'
],
path
:
[],
pattern
:
[],
sticky
:
true
})
await
this
.
call
(
'filePanel'
,
'registerContextMenuItem'
,
{
id
:
'optimism-compiler'
,
name
:
'compileCustomAction'
,
label
:
'Compile with Optimism'
,
type
:
[],
extension
:
[
'.sol'
],
path
:
[],
pattern
:
[],
sticky
:
true
})
}
}
...
...
libs/remix-ui/workspace/src/lib/reducers/workspace.ts
View file @
33588ae0
...
...
@@ -11,8 +11,10 @@ export interface BrowserState {
workspaces
:
string
[],
files
:
{
[
x
:
string
]:
Record
<
string
,
FileType
>
},
expandPath
:
string
[]
isRequesting
:
boolean
,
isSuccessful
:
boolean
,
isRequestingDirectory
:
boolean
,
isSuccessfulDirectory
:
boolean
,
isRequestingWorkspace
:
boolean
,
isSuccessfulWorkspace
:
boolean
,
error
:
string
,
contextMenu
:
{
registeredMenuItems
:
action
[],
...
...
@@ -24,8 +26,10 @@ export interface BrowserState {
sharedFolder
:
string
,
files
:
{
[
x
:
string
]:
Record
<
string
,
FileType
>
},
expandPath
:
string
[],
isRequesting
:
boolean
,
isSuccessful
:
boolean
,
isRequestingDirectory
:
boolean
,
isSuccessfulDirectory
:
boolean
,
isRequestingLocalhost
:
boolean
,
isSuccessfulLocalhost
:
boolean
,
error
:
string
,
contextMenu
:
{
registeredMenuItems
:
action
[],
...
...
@@ -54,8 +58,10 @@ export const browserInitialState: BrowserState = {
workspaces
:
[],
files
:
{},
expandPath
:
[],
isRequesting
:
false
,
isSuccessful
:
false
,
isRequestingDirectory
:
false
,
isSuccessfulDirectory
:
false
,
isRequestingWorkspace
:
false
,
isSuccessfulWorkspace
:
false
,
error
:
null
,
contextMenu
:
{
registeredMenuItems
:
[],
...
...
@@ -67,8 +73,10 @@ export const browserInitialState: BrowserState = {
sharedFolder
:
''
,
files
:
{},
expandPath
:
[],
isRequesting
:
false
,
isSuccessful
:
false
,
isRequestingDirectory
:
false
,
isSuccessfulDirectory
:
false
,
isRequestingLocalhost
:
false
,
isSuccessfulLocalhost
:
false
,
error
:
null
,
contextMenu
:
{
registeredMenuItems
:
[],
...
...
@@ -133,14 +141,14 @@ export const browserReducer = (state = browserInitialState, action: Action) => {
...
state
,
browser
:
{
...
state
.
browser
,
isRequesting
:
state
.
mode
===
'browser'
,
isSuccessful
:
false
,
isRequesting
Directory
:
state
.
mode
===
'browser'
,
isSuccessful
Directory
:
false
,
error
:
null
},
localhost
:
{
...
state
.
localhost
,
isRequesting
:
state
.
mode
===
'localhost'
,
isSuccessful
:
false
,
isRequesting
Directory
:
state
.
mode
===
'localhost'
,
isSuccessful
Directory
:
false
,
error
:
null
}
}
...
...
@@ -154,15 +162,15 @@ export const browserReducer = (state = browserInitialState, action: Action) => {
browser
:
{
...
state
.
browser
,
files
:
state
.
mode
===
'browser'
?
fetchDirectoryContent
(
state
,
payload
)
:
state
.
browser
.
files
,
isRequesting
:
false
,
isSuccessful
:
true
,
isRequesting
Directory
:
false
,
isSuccessful
Directory
:
true
,
error
:
null
},
localhost
:
{
...
state
.
localhost
,
files
:
state
.
mode
===
'localhost'
?
fetchDirectoryContent
(
state
,
payload
)
:
state
.
localhost
.
files
,
isRequesting
:
false
,
isSuccessful
:
true
,
isRequesting
Directory
:
false
,
isSuccessful
Directory
:
true
,
error
:
null
}
}
...
...
@@ -173,14 +181,14 @@ export const browserReducer = (state = browserInitialState, action: Action) => {
...
state
,
browser
:
{
...
state
.
browser
,
isRequesting
:
false
,
isSuccessful
:
false
,
isRequesting
Directory
:
false
,
isSuccessful
Directory
:
false
,
error
:
state
.
mode
===
'browser'
?
action
.
payload
:
null
},
localhost
:
{
...
state
.
localhost
,
isRequesting
:
false
,
isSuccessful
:
false
,
isRequesting
Directory
:
false
,
isSuccessful
Directory
:
false
,
error
:
state
.
mode
===
'localhost'
?
action
.
payload
:
null
}
}
...
...
@@ -191,14 +199,14 @@ export const browserReducer = (state = browserInitialState, action: Action) => {
...
state
,
browser
:
{
...
state
.
browser
,
isRequesting
:
state
.
mode
===
'browser'
,
isSuccessful
:
false
,
isRequesting
Workspace
:
state
.
mode
===
'browser'
,
isSuccessful
Workspace
:
false
,
error
:
null
},
localhost
:
{
...
state
.
localhost
,
isRequesting
:
state
.
mode
===
'localhost'
,
isSuccessful
:
false
,
isRequesting
Workspace
:
state
.
mode
===
'localhost'
,
isSuccessful
Workspace
:
false
,
error
:
null
}
}
...
...
@@ -212,15 +220,15 @@ export const browserReducer = (state = browserInitialState, action: Action) => {
browser
:
{
...
state
.
browser
,
files
:
state
.
mode
===
'browser'
?
fetchWorkspaceDirectoryContent
(
state
,
payload
)
:
state
.
browser
.
files
,
isRequesting
:
false
,
isSuccessful
:
true
,
isRequesting
Workspace
:
false
,
isSuccessful
Workspace
:
true
,
error
:
null
},
localhost
:
{
...
state
.
localhost
,
files
:
state
.
mode
===
'localhost'
?
fetchWorkspaceDirectoryContent
(
state
,
payload
)
:
state
.
localhost
.
files
,
isRequesting
:
false
,
isSuccessful
:
true
,
isRequesting
Workspace
:
false
,
isSuccessful
Workspace
:
true
,
error
:
null
}
}
...
...
@@ -231,14 +239,14 @@ export const browserReducer = (state = browserInitialState, action: Action) => {
...
state
,
browser
:
{
...
state
.
browser
,
isRequesting
:
false
,
isSuccessful
:
false
,
isRequesting
Workspace
:
false
,
isSuccessful
Workspace
:
false
,
error
:
state
.
mode
===
'browser'
?
action
.
payload
:
null
},
localhost
:
{
...
state
.
localhost
,
isRequesting
:
false
,
isSuccessful
:
false
,
isRequesting
Workspace
:
false
,
isSuccessful
Workspace
:
false
,
error
:
state
.
mode
===
'localhost'
?
action
.
payload
:
null
}
}
...
...
@@ -397,8 +405,8 @@ export const browserReducer = (state = browserInitialState, action: Action) => {
...
state
,
browser
:
{
...
state
.
browser
,
isRequesting
:
true
,
isSuccessful
:
false
,
isRequesting
Workspace
:
true
,
isSuccessful
Workspace
:
false
,
error
:
null
}
}
...
...
@@ -414,8 +422,8 @@ export const browserReducer = (state = browserInitialState, action: Action) => {
...
state
.
browser
,
currentWorkspace
:
payload
,
workspaces
:
workspaces
.
filter
(
workspace
=>
workspace
),
isRequesting
:
false
,
isSuccessful
:
true
,
isRequesting
Workspace
:
false
,
isSuccessful
Workspace
:
true
,
error
:
null
}
}
...
...
@@ -426,8 +434,8 @@ export const browserReducer = (state = browserInitialState, action: Action) => {
...
state
,
browser
:
{
...
state
.
browser
,
isRequesting
:
false
,
isSuccessful
:
false
,
isRequesting
Workspace
:
false
,
isSuccessful
Workspace
:
false
,
error
:
action
.
payload
}
}
...
...
@@ -538,8 +546,8 @@ export const browserReducer = (state = browserInitialState, action: Action) => {
...
state
,
localhost
:
{
...
state
.
localhost
,
isRequesting
:
true
,
isSuccessful
:
false
,
isRequesting
Localhost
:
true
,
isSuccessful
Localhost
:
false
,
error
:
null
}
}
...
...
@@ -550,8 +558,8 @@ export const browserReducer = (state = browserInitialState, action: Action) => {
...
state
,
localhost
:
{
...
state
.
localhost
,
isRequesting
:
false
,
isSuccessful
:
true
,
isRequesting
Localhost
:
false
,
isSuccessful
Localhost
:
true
,
error
:
null
}
}
...
...
@@ -564,8 +572,8 @@ export const browserReducer = (state = browserInitialState, action: Action) => {
...
state
,
localhost
:
{
...
state
.
localhost
,
isRequesting
:
false
,
isSuccessful
:
false
,
isRequesting
Localhost
:
false
,
isSuccessful
Localhost
:
false
,
error
:
payload
}
}
...
...
libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx
View file @
33588ae0
...
...
@@ -209,9 +209,9 @@ export function Workspace () {
}
</
div
>
{
global
.
fs
.
localhost
.
isRequesting
?
<
div
className=
"text-center py-5"
><
i
className=
"fas fa-spinner fa-pulse fa-2x"
></
i
></
div
>
global
.
fs
.
localhost
.
isRequesting
Localhost
?
<
div
className=
"text-center py-5"
><
i
className=
"fas fa-spinner fa-pulse fa-2x"
></
i
></
div
>
:
<
div
className=
'pl-2 filesystemexplorer remixui_treeview'
>
{
global
.
fs
.
mode
===
'localhost'
&&
global
.
fs
.
localhost
.
isSuccessful
&&
{
global
.
fs
.
mode
===
'localhost'
&&
global
.
fs
.
localhost
.
isSuccessful
Localhost
&&
<
FileExplorer
name=
'localhost'
menuItems=
{
[
'createNewFile'
,
'createNewFolder'
]
}
...
...
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