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
f4b0e303
Commit
f4b0e303
authored
Jul 13, 2021
by
joseph izang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
implement isActive logic for plugins
parent
b7e37f1c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
5 deletions
+8
-5
plugin-manager-component.js
.../remix-ide/src/app/components/plugin-manager-component.js
+2
-1
pluginCard.tsx
...remix-ui/plugin-manager/src/lib/components/pluginCard.tsx
+2
-2
types.d.ts
libs/remix-ui/plugin-manager/src/types.d.ts
+4
-2
No files found.
apps/remix-ide/src/app/components/plugin-manager-component.js
View file @
f4b0e303
...
@@ -106,6 +106,7 @@ class PluginManagerComponent extends ViewPlugin {
...
@@ -106,6 +106,7 @@ class PluginManagerComponent extends ViewPlugin {
this
.
filter
=
''
this
.
filter
=
''
this
.
activePlugins
=
[]
this
.
activePlugins
=
[]
this
.
inactivePlugins
=
[]
this
.
inactivePlugins
=
[]
this
.
activePlugins
=
this
.
appManager
.
actives
// this.appManager.event.on('activate', () => { this.reRender() })
// this.appManager.event.on('activate', () => { this.reRender() })
// this.appManager.event.on('deactivate', () => { this.reRender() })
// this.appManager.event.on('deactivate', () => { this.reRender() })
// this.engine.event.on('onRegistration', () => { this.reRender() })
// this.engine.event.on('onRegistration', () => { this.reRender() })
...
@@ -123,7 +124,7 @@ class PluginManagerComponent extends ViewPlugin {
...
@@ -123,7 +124,7 @@ class PluginManagerComponent extends ViewPlugin {
appManager
=
{
this
.
appManager
}
appManager
=
{
this
.
appManager
}
engine
=
{
this
.
engine
}
engine
=
{
this
.
engine
}
localPlugin
=
{
this
.
localPlugin
}
localPlugin
=
{
this
.
localPlugin
}
isActive
=
{()
=>
false
}
activePlugins
=
{
this
.
activePlugins
}
actives
=
{
this
.
activePlugins
}
actives
=
{
this
.
activePlugins
}
inactives
=
{
this
.
inactivePlugins
}
inactives
=
{
this
.
inactivePlugins
}
/>
,
/>
,
...
...
libs/remix-ui/plugin-manager/src/lib/components/pluginCard.tsx
View file @
f4b0e303
...
@@ -9,7 +9,7 @@ interface PluginCardProps {
...
@@ -9,7 +9,7 @@ interface PluginCardProps {
// eslint-disable-next-line no-empty-pattern
// eslint-disable-next-line no-empty-pattern
function
PluginCard
({
profile
}:
PluginCardProps
)
{
function
PluginCard
({
profile
}:
PluginCardProps
)
{
const
{
isActive
}
=
useContext
(
PluginManagerContext
)
const
{
activePlugins
}
=
useContext
(
PluginManagerContext
)
const
[
displayName
]
=
useState
<
string
>
((
profile
.
displayName
)
?
profile
.
displayName
:
profile
.
name
)
const
[
displayName
]
=
useState
<
string
>
((
profile
.
displayName
)
?
profile
.
displayName
:
profile
.
name
)
const
[
docLink
]
=
useState
<
JSX
.
Element
>
((
profile
.
documentation
)
?
(
const
[
docLink
]
=
useState
<
JSX
.
Element
>
((
profile
.
documentation
)
?
(
<
a
href=
{
profile
.
documentation
}
className=
"px-1"
title=
"link to documentation"
target=
"_blank"
rel=
"noreferrer"
>
<
a
href=
{
profile
.
documentation
}
className=
"px-1"
title=
"link to documentation"
target=
"_blank"
rel=
"noreferrer"
>
...
@@ -31,7 +31,7 @@ function PluginCard ({ profile }: PluginCardProps) {
...
@@ -31,7 +31,7 @@ function PluginCard ({ profile }: PluginCardProps) {
{
docLink
}
{
docLink
}
{
versionWarning
}
{
versionWarning
}
</
div
>
</
div
>
{
isActive
(
profile
.
name
)
?
(
{
activePlugins
.
includes
(
profile
.
name
)
?
(
<
Button
<
Button
buttonText=
"Deactivate"
buttonText=
"Deactivate"
/>)
:
<
Button
buttonText=
"Activate"
/>
/>)
:
<
Button
buttonText=
"Activate"
/>
...
...
libs/remix-ui/plugin-manager/src/types.d.ts
View file @
f4b0e303
...
@@ -107,11 +107,12 @@ export interface PluginManagerContextProviderProps {
...
@@ -107,11 +107,12 @@ export interface PluginManagerContextProviderProps {
localPlugin
:
LocalPlugin
localPlugin
:
LocalPlugin
_paq
:
_Paq
_paq
:
_Paq
filter
:
string
filter
:
string
activePlugins
:
string
[]
actives
:
Partial
<
PluginManagerProfile
>
[]
actives
:
Partial
<
PluginManagerProfile
>
[]
inactives
:
Partial
<
PluginManagerProfile
>
[]
inactives
:
Partial
<
PluginManagerProfile
>
[]
activatePlugin
:
(
name
:
string
)
=>
void
activatePlugin
:
(
name
:
string
)
=>
void
deActivatePlugin
:
(
name
:
string
)
=>
void
deActivatePlugin
:
(
name
:
string
)
=>
void
isActive
:
(
name
:
string
)
=>
boolean
isActive
?
:
(
name
:
string
)
=>
boolean
filterPlugins
:
()
=>
void
filterPlugins
:
()
=>
void
profile
:
Partial
<
PluginManagerProfile
>
profile
:
Partial
<
PluginManagerProfile
>
defaultProfile
:
DefaultLocalPlugin
defaultProfile
:
DefaultLocalPlugin
...
@@ -124,11 +125,12 @@ export interface RemixUiPluginManagerProps {
...
@@ -124,11 +125,12 @@ export interface RemixUiPluginManagerProps {
localPlugin
:
LocalPlugin
localPlugin
:
LocalPlugin
_paq
:
_Paq
_paq
:
_Paq
filter
:
string
filter
:
string
activePlugins
:
string
[]
actives
:
Partial
<
PluginManagerProfile
>
[]
actives
:
Partial
<
PluginManagerProfile
>
[]
inactives
:
Partial
<
PluginManagerProfile
>
[]
inactives
:
Partial
<
PluginManagerProfile
>
[]
activatePlugin
:
(
name
:
string
)
=>
void
activatePlugin
:
(
name
:
string
)
=>
void
deActivatePlugin
:
(
name
:
string
)
=>
void
deActivatePlugin
:
(
name
:
string
)
=>
void
isActive
:
(
name
:
string
)
=>
boolean
isActive
?
:
(
name
:
string
)
=>
boolean
filterPlugins
:
()
=>
void
filterPlugins
:
()
=>
void
profile
:
Partial
<
PluginManagerProfile
>
profile
:
Partial
<
PluginManagerProfile
>
headingLabel
:
string
headingLabel
:
string
...
...
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