Don't display dependent modules in the plugin manager (#903)

fix https://github.com/ethereum/remix-project/issues/849
pull/913/head
yann300 4 years ago committed by GitHub
parent 50b1ca6e43
commit 83c457d194
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      apps/remix-ide/src/app/components/plugin-manager-component.js
  2. 6
      apps/remix-ide/src/remixAppManager.js

@ -187,6 +187,7 @@ class PluginManagerComponent extends ViewPlugin {
// Filtering helpers // Filtering helpers
const isFiltered = (profile) => (profile.displayName ? profile.displayName : profile.name).toLowerCase().includes(this.filter) const isFiltered = (profile) => (profile.displayName ? profile.displayName : profile.name).toLowerCase().includes(this.filter)
const isNotRequired = (profile) => !this.appManager.isRequired(profile.name) const isNotRequired = (profile) => !this.appManager.isRequired(profile.name)
const isNotDependent = (profile) => !this.appManager.isDependent(profile.name)
const isNotHome = (profile) => profile.name !== 'home' const isNotHome = (profile) => profile.name !== 'home'
const sortByName = (profileA, profileB) => { const sortByName = (profileA, profileB) => {
const nameA = ((profileA.displayName) ? profileA.displayName : profileA.name).toUpperCase() const nameA = ((profileA.displayName) ? profileA.displayName : profileA.name).toUpperCase()
@ -198,6 +199,7 @@ class PluginManagerComponent extends ViewPlugin {
const { actives, inactives } = this.appManager.getAll() const { actives, inactives } = this.appManager.getAll()
.filter(isFiltered) .filter(isFiltered)
.filter(isNotRequired) .filter(isNotRequired)
.filter(isNotDependent)
.filter(isNotHome) .filter(isNotHome)
.sort(sortByName) .sort(sortByName)
.reduce(({ actives, inactives }, profile) => { .reduce(({ actives, inactives }, profile) => {

@ -11,6 +11,8 @@ const requiredModules = [ // services + layout views + system views
'fileManager', 'contentImport', 'web3Provider', 'scriptRunner', 'fetchAndCompile', 'mainPanel', 'hiddenPanel', 'sidePanel', 'menuicons', 'fileManager', 'contentImport', 'web3Provider', 'scriptRunner', 'fetchAndCompile', 'mainPanel', 'hiddenPanel', 'sidePanel', 'menuicons',
'fileExplorers', 'terminal', 'settings', 'pluginManager', 'tabs', 'udapp'] 'fileExplorers', 'terminal', 'settings', 'pluginManager', 'tabs', 'udapp']
const dependentModules = ['git'] // module which shouldn't be manually activated (e.g git is activated by remixd)
export function isNative (name) { export function isNative (name) {
const nativePlugins = ['vyper', 'workshops', 'debugger', 'remixd', 'menuicons'] const nativePlugins = ['vyper', 'workshops', 'debugger', 'remixd', 'menuicons']
return nativePlugins.includes(name) || requiredModules.includes(name) return nativePlugins.includes(name) || requiredModules.includes(name)
@ -85,6 +87,10 @@ export class RemixAppManager extends PluginManager {
_paq.push(['trackEvent', 'pluginManager', 'deactivate', plugin.name]) _paq.push(['trackEvent', 'pluginManager', 'deactivate', plugin.name])
} }
isDependent (name) {
return dependentModules.includes(name)
}
isRequired (name) { isRequired (name) {
// excluding internal use plugins // excluding internal use plugins
return requiredModules.includes(name) return requiredModules.includes(name)

Loading…
Cancel
Save