${displayName}
@@ -123,7 +132,7 @@ class PluginManagerComponent extends ViewPlugin {
${activationButton}
- ${api.profile.description}
+ ${profile.description}
`
}
@@ -141,10 +150,9 @@ class PluginManagerComponent extends ViewPlugin {
if (this.appManager.getIds().includes(profile.name)) {
throw new Error('This name has already been used')
}
-
const plugin = profile.type === 'iframe' ? new IframePlugin(profile) : new WebsocketPlugin(profile)
- this.appManager.registerOne(plugin)
- this.appManager.activateOne(profile.name)
+ this.engine.register(plugin)
+ this.appManager.activatePlugin(plugin.name)
} catch (err) {
// TODO : Use an alert to handle this error instead of a console.log
console.log(`Cannot create Plugin : ${err.message}`)
@@ -154,25 +162,25 @@ 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 {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 this.isActive(profile.name)
+ ? { actives: [...actives, profile], inactives }
+ : { inactives: [...inactives, profile], actives }
}, { actives: [], inactives: [] })
const activeTile = actives.length !== 0
@@ -203,11 +211,11 @@ class PluginManagerComponent extends ViewPlugin {