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
64e07648
Commit
64e07648
authored
Feb 18, 2020
by
yann300
Committed by
LianaHus
Feb 26, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix plugins list
parent
d6d5a6b4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
26 deletions
+24
-26
plugin-manager-component.js
src/app/components/plugin-manager-component.js
+22
-24
test-tab.js
src/app/tabs/test-tab.js
+2
-2
No files found.
src/app/components/plugin-manager-component.js
View file @
64e07648
...
...
@@ -87,35 +87,32 @@ class PluginManagerComponent extends ViewPlugin {
this
.
appManager
.
event
.
on
(
'added'
,
()
=>
{
this
.
reRender
()
})
}
renderItem
(
name
)
{
const
api
=
this
.
appManager
.
getPlugin
(
name
)
if
(
!
api
)
return
const
isActive
=
this
.
appManager
.
isActive
(
name
)
const
displayName
=
(
api
.
profile
.
displayName
)
?
api
.
profile
.
displayName
:
name
renderItem
(
profile
,
isActive
)
{
const
displayName
=
(
profile
.
displayName
)
?
profile
.
displayName
:
profile
.
name
// Check version of the plugin
let
versionWarning
// Alpha
if
(
api
.
profile
.
version
&&
api
.
profile
.
version
.
match
(
/
\b(\w
*alpha
\w
*
)\b
/g
))
{
if
(
profile
.
version
&&
profile
.
version
.
match
(
/
\b(\w
*alpha
\w
*
)\b
/g
))
{
versionWarning
=
yo
`<small title="Version Alpha" class="
${
css
.
versionWarning
}
plugin-version">alpha</small>`
}
// Beta
if
(
api
.
profile
.
version
&&
api
.
profile
.
version
.
match
(
/
\b(\w
*beta
\w
*
)\b
/g
))
{
if
(
profile
.
version
&&
profile
.
version
.
match
(
/
\b(\w
*beta
\w
*
)\b
/g
))
{
versionWarning
=
yo
`<small title="Version Beta" class="
${
css
.
versionWarning
}
plugin-version">beta</small>`
}
const
activationButton
=
isActive
?
yo
`
<button onclick="
${
_
=>
this
.
appManager
.
deactivatePlugin
(
name
)}
" class="btn btn-secondary btn-sm" data-id="pluginManagerComponentDeactivateButton
${
name
}
">
<button onclick="
${
_
=>
this
.
appManager
.
deactivatePlugin
(
profile
.
name
)}
" class="btn btn-secondary btn-sm" data-id="pluginManagerComponentDeactivateButton
${
name
}
">
Deactivate
</button>`
:
yo
`
<button onclick="
${
_
=>
this
.
appManager
.
activatePlugin
(
name
)}
" class="btn btn-success btn-sm" data-id="pluginManagerComponentActivateButton
${
name
}
">
<button onclick="
${
_
=>
this
.
appManager
.
activatePlugin
(
profile
.
name
)}
" class="btn btn-success btn-sm" data-id="pluginManagerComponentActivateButton
${
name
}
">
Activate
</button>`
return
yo
`
<article id="remixPluginManagerListItem_
${
name
}
" class="list-group-item py-1 plugins-list-group-item" title="
${
displayName
}
" >
<article id="remixPluginManagerListItem_
${
profile
.
name
}
" class="list-group-item py-1 plugins-list-group-item" title="
${
displayName
}
" >
<div class="
${
css
.
row
}
justify-content-between align-items-center mb-2">
<h6 class="
${
css
.
displayName
}
plugin-name">
${
displayName
}
...
...
@@ -123,7 +120,7 @@ class PluginManagerComponent extends ViewPlugin {
</h6>
${
activationButton
}
</div>
<p class="
${
css
.
description
}
text-body plugin-text">
${
api
.
profile
.
description
}
</p>
<p class="
${
css
.
description
}
text-body plugin-text">
${
profile
.
description
}
</p>
</article>
`
}
...
...
@@ -154,25 +151,26 @@ class PluginManagerComponent extends ViewPlugin {
render
()
{
// Filtering helpers
const
isFiltered
=
(
api
)
=>
(
api
.
profile
.
displayName
?
api
.
profile
.
displayName
:
api
.
name
).
toLowerCase
().
includes
(
this
.
filter
)
const
isNotRequired
=
(
{
profile
}
)
=>
!
this
.
appManager
.
isRequired
(
profile
.
name
)
const
isNotHome
=
(
{
profile
}
)
=>
profile
.
name
!==
'home'
const
sortByName
=
(
a
,
b
)
=>
{
const
nameA
=
((
a
.
profile
.
displayName
)
?
a
.
profile
.
displayName
:
a
.
profile
.
name
).
toUpperCase
()
const
nameB
=
((
b
.
profile
.
displayName
)
?
b
.
profile
.
displayName
:
b
.
profile
.
name
).
toUpperCase
()
const
isFiltered
=
(
profile
)
=>
(
profile
.
displayName
?
profile
.
displayName
:
profile
.
name
).
toLowerCase
().
includes
(
this
.
filter
)
const
isNotRequired
=
(
profile
)
=>
!
this
.
appManager
.
isRequired
(
profile
.
name
)
const
isNotHome
=
(
profile
)
=>
profile
.
name
!==
'home'
const
sortByName
=
(
profileA
,
profileB
)
=>
{
const
nameA
=
((
profileA
.
displayName
)
?
profileA
.
displayName
:
profileA
.
name
).
toUpperCase
()
const
nameB
=
((
profileB
.
displayName
)
?
profileB
.
displayName
:
profileB
.
name
).
toUpperCase
()
return
(
nameA
<
nameB
)
?
-
1
:
(
nameA
>
nameB
)
?
1
:
0
}
// Filter all active and inactive modules that are not required
const
{
actives
,
inactives
}
=
this
.
appManager
.
getAll
()
const
isActive
=
(
name
)
=>
{
return
this
.
appManager
.
actives
.
includes
(
name
)
}
const
{
actives
,
inactives
}
=
this
.
appManager
.
getAll
()
.
filter
(
isFiltered
)
.
filter
(
isNotRequired
)
.
filter
(
isNotHome
)
.
sort
(
sortByName
)
.
reduce
(({
actives
,
inactives
},
api
)
=>
{
return
this
.
appManager
.
isActive
(
api
.
name
)
?
{
actives
:
[...
actives
,
api
.
name
],
inactives
}
:
{
inactives
:
[...
inactives
,
api
.
name
],
actives
}
.
reduce
(({
actives
,
inactives
},
profile
)
=>
{
return
isActive
(
profile
.
name
)
?
{
actives
:
[...
actives
,
profile
],
inactives
}
:
{
inactives
:
[...
inactives
,
profile
],
actives
}
},
{
actives
:
[],
inactives
:
[]
})
const
activeTile
=
actives
.
length
!==
0
...
...
@@ -203,11 +201,11 @@ class PluginManagerComponent extends ViewPlugin {
<section data-id="pluginManagerComponentPluginManagerSection">
${
activeTile
}
<div class="list-group list-group-flush plugins-list-group" data-id="pluginManagerComponentActiveTile">
${
actives
.
map
(
name
=>
this
.
renderItem
(
name
))}
${
actives
.
map
(
profile
=>
this
.
renderItem
(
profile
,
isActive
(
profile
.
name
)
))}
</div>
${
inactiveTile
}
<div class="list-group list-group-flush plugins-list-group" data-id="pluginManagerComponentInactiveTile">
${
inactives
.
map
(
name
=>
this
.
renderItem
(
name
))}
${
inactives
.
map
(
profile
=>
this
.
renderItem
(
profile
,
isActive
(
profile
.
name
)
))}
</div>
</section>
${
settings
}
...
...
src/app/tabs/test-tab.js
View file @
64e07648
...
...
@@ -225,9 +225,9 @@ module.exports = class TestTab extends ViewPlugin {
return
this
.
generateFileActionElement
}
async
updateRunAction
(
currentFile
)
{
updateRunAction
(
currentFile
)
{
let
el
=
yo
`<button id="runTestsTabRunAction" class="
${
css
.
runButton
}
btn btn-primary" onclick="
${
this
.
runTests
.
bind
(
this
)}
">Run Tests</button>`
const
isSolidityActive
=
await
this
.
appManager
.
isActive
(
'solidity'
)
const
isSolidityActive
=
this
.
appManager
.
actives
.
includes
(
'solidity'
)
if
(
!
currentFile
||
!
isSolidityActive
)
{
el
.
setAttribute
(
'disabled'
,
'disabled'
)
if
(
!
currentFile
)
el
.
setAttribute
(
'title'
,
'No file selected'
)
...
...
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