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
ce60f2d6
Unverified
Commit
ce60f2d6
authored
Sep 13, 2021
by
bunsenstraat
Committed by
GitHub
Sep 13, 2021
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1580 from ethereum/fixlocal
fix whitespaces and canactivate
parents
d0a29649
a69a392c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
5 deletions
+8
-5
LocalPluginForm.tsx
...-ui/plugin-manager/src/lib/components/LocalPluginForm.tsx
+6
-4
types.d.ts
libs/remix-ui/plugin-manager/src/types.d.ts
+2
-1
No files found.
libs/remix-ui/plugin-manager/src/lib/components/LocalPluginForm.tsx
View file @
ce60f2d6
...
...
@@ -20,7 +20,8 @@ const initialState: FormStateProps = {
type
:
'iframe'
,
hash
:
''
,
methods
:
[],
location
:
'sidePanel'
location
:
'sidePanel'
,
canActivate
:
[]
}
const
defaultProfile
=
{
...
...
@@ -48,9 +49,10 @@ function LocalPluginForm ({ closeModal, visible, pluginManager }: LocalPluginFor
setName
(
storagePlugin
.
name
)
setUrl
(
storagePlugin
.
url
)
setLocation
(
storagePlugin
.
location
as
'sidePanel'
|
'mainPanel'
|
'none'
)
setMethods
(
storagePlugin
.
methods
)
setMethods
(
Array
.
isArray
(
storagePlugin
.
methods
)
?
storagePlugin
.
methods
.
join
(
','
)
:
storagePlugin
.
methods
)
setType
(
storagePlugin
.
type
)
setDisplayName
(
storagePlugin
.
displayName
)
setCanactivate
(
Array
.
isArray
(
storagePlugin
.
canActivate
)
?
storagePlugin
.
canActivate
.
join
(
','
)
:
storagePlugin
.
canActivate
)
},
[])
const
handleModalOkClick
=
async
()
=>
{
...
...
@@ -61,7 +63,7 @@ function LocalPluginForm ({ closeModal, visible, pluginManager }: LocalPluginFor
}
if
(
!
location
)
throw
new
Error
(
'Plugin should have a location'
)
if
(
!
url
)
throw
new
Error
(
'Plugin should have an URL'
)
const
newMethods
=
typeof
methods
===
'string'
?
methods
.
split
(
','
).
filter
(
val
=>
val
)
:
[]
const
newMethods
=
typeof
methods
===
'string'
?
methods
.
split
(
','
).
filter
(
val
=>
val
)
.
map
(
val
=>
{
return
val
.
trim
()
})
:
[]
const
targetPlugin
=
{
name
:
name
,
displayName
:
displayName
,
...
...
@@ -75,7 +77,7 @@ function LocalPluginForm ({ closeModal, visible, pluginManager }: LocalPluginFor
type
:
type
,
location
:
location
,
icon
:
'assets/img/localPlugin.webp'
,
canActivate
:
typeof
canactivate
===
'string'
?
canactivate
.
split
(
','
).
filter
(
val
=>
val
)
:
[]
canActivate
:
typeof
canactivate
===
'string'
?
canactivate
.
split
(
','
).
filter
(
val
=>
val
)
.
map
(
val
=>
{
return
val
.
trim
()
})
:
[]
}
const
localPlugin
=
type
===
'iframe'
?
new
IframePlugin
(
initialState
)
:
new
WebsocketPlugin
(
initialState
)
localPlugin
.
profile
.
hash
=
`local-
${
name
}
`
...
...
libs/remix-ui/plugin-manager/src/types.d.ts
View file @
ce60f2d6
...
...
@@ -178,8 +178,9 @@ export interface FormStateProps {
url
:
string
type
:
'iframe'
|
'ws'
hash
:
string
methods
:
any
methods
:
string
[]
location
:
string
canActivate
:
string
[]
}
export
type
PluginManagerProfile
=
Profile
&
{
...
...
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