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
3f3eb07d
Commit
3f3eb07d
authored
May 14, 2019
by
Rob Stupay
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
check if plugin name has been used
parent
58cfe7c7
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
local-plugin.js
src/app/components/local-plugin.js
+1
-2
plugin-manager-component.js
src/app/components/plugin-manager-component.js
+5
-0
No files found.
src/app/components/local-plugin.js
View file @
3f3eb07d
...
@@ -40,8 +40,7 @@ module.exports = class LocalPlugin {
...
@@ -40,8 +40,7 @@ module.exports = class LocalPlugin {
...
this
.
profile
,
...
this
.
profile
,
hash
:
`local-
${
this
.
profile
.
name
}
`
hash
:
`local-
${
this
.
profile
.
name
}
`
}
}
profile
.
events
=
profile
.
events
||
[]
profile
.
events
=
(
profile
.
events
||
[]).
filter
(
item
=>
item
!==
''
)
profile
.
events
=
profile
.
events
.
filter
((
item
)
=>
{
return
item
!==
''
})
if
(
!
profile
.
location
)
throw
new
Error
(
'Plugin should have a location'
)
if
(
!
profile
.
location
)
throw
new
Error
(
'Plugin should have a location'
)
if
(
!
profile
.
name
)
throw
new
Error
(
'Plugin should have a name'
)
if
(
!
profile
.
name
)
throw
new
Error
(
'Plugin should have a name'
)
...
...
src/app/components/plugin-manager-component.js
View file @
3f3eb07d
...
@@ -4,6 +4,7 @@ const EventEmitter = require('events')
...
@@ -4,6 +4,7 @@ const EventEmitter = require('events')
const
LocalPlugin
=
require
(
'./local-plugin'
)
const
LocalPlugin
=
require
(
'./local-plugin'
)
import
{
Plugin
,
BaseApi
}
from
'remix-plugin'
import
{
Plugin
,
BaseApi
}
from
'remix-plugin'
import
{
PluginManagerSettings
}
from
'./plugin-manager-settings'
import
{
PluginManagerSettings
}
from
'./plugin-manager-settings'
const
addToolTip
=
require
(
'../ui/tooltip'
)
const
css
=
csjs
`
const
css
=
csjs
`
.pluginSearch {
.pluginSearch {
...
@@ -109,11 +110,15 @@ class PluginManagerComponent extends BaseApi {
...
@@ -109,11 +110,15 @@ class PluginManagerComponent extends BaseApi {
try
{
try
{
const
profile
=
await
this
.
localPlugin
.
open
(
this
.
store
.
getAll
())
const
profile
=
await
this
.
localPlugin
.
open
(
this
.
store
.
getAll
())
if
(
!
profile
)
return
if
(
!
profile
)
return
if
(
this
.
store
.
ids
.
includes
(
profile
.
name
))
{
throw
new
Error
(
'This name has already been used'
)
}
this
.
appManager
.
registerOne
(
new
Plugin
(
profile
))
this
.
appManager
.
registerOne
(
new
Plugin
(
profile
))
this
.
appManager
.
activateOne
(
profile
.
name
)
this
.
appManager
.
activateOne
(
profile
.
name
)
}
catch
(
err
)
{
}
catch
(
err
)
{
// TODO : Use an alert to handle this error instead of a console.log
// TODO : Use an alert to handle this error instead of a console.log
console
.
log
(
`Cannot create Plugin :
${
err
.
message
}
`
)
console
.
log
(
`Cannot create Plugin :
${
err
.
message
}
`
)
addToolTip
(
`Cannot create Plugin :
${
err
.
message
}
`
)
}
}
}
}
...
...
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