clean native/required plugin list

pull/5370/head
yann300 7 months ago committed by Aniket
parent 48e0b8fd1e
commit 655a6e147f
  1. 4
      apps/remix-ide-e2e/src/tests/runAndDeploy_injected.test.ts
  2. 23
      apps/remix-ide/src/remixAppManager.js
  3. 90
      libs/remix-ui/run-tab/src/lib/components/account.tsx

@ -44,7 +44,7 @@ module.exports = {
.waitForElementVisible('*[data-id="remixIdeIconPanel"]', 10000)
.click('*[data-id="landingPageStartSolidity"]')
.clickLaunchIcon('udapp')
.switchEnvironment('MetaMask')
.switchEnvironment('injected-MetaMask')
.waitForElementPresent('*[data-id="settingsNetworkEnv"]')
.assert.containsText('*[data-id="settingsNetworkEnv"]', 'Sepolia (11155111) network')
.pause(5000)
@ -123,7 +123,7 @@ module.exports = {
.waitForElementVisible('*[data-id="remixIdeIconPanel"]', 10000)
.click('*[data-id="landingPageStartSolidity"]')
.clickLaunchIcon('udapp')
.switchEnvironment('MetaMask')
.switchEnvironment('injected-MetaMask')
.waitForElementPresent('*[data-id="settingsNetworkEnv"]')
.assert.containsText('*[data-id="settingsNetworkEnv"]', 'Main (1) network')
},

@ -52,11 +52,6 @@ let requiredModules = [ // services + layout views + system views
'ganache-provider',
'foundry-provider',
'basic-http-provider',
'injected-trustwallet',
'injected-optimism-provider',
'injected-arbitrum-one-provider',
'injected-ephemery-testnet-provider',
'injected-skale-chaos-testnet-provider',
'vm-custom-fork',
'vm-goerli-fork',
'vm-mainnet-fork',
@ -97,7 +92,12 @@ const sensitiveCalls = {
web3Provider: ['sendAsync']
}
const isInjectedProvicer = (name) => {
return name.startsWith('injected')
}
export function isNative(name) {
// nativePlugin allows to bypass the permission request
const nativePlugins = [
'vyper',
@ -116,19 +116,16 @@ export function isNative(name) {
'ganache-provider',
'foundry-provider',
'basic-http-provider',
'injected-optimism-provider',
'tabs',
'injected-arbitrum-one-provider',
'injected-skale-chaos-testnet-provider',
'injected-ephemery-testnet-provider',
'doc-gen',
'doc-viewer',
'circuit-compiler',
'compilationDetails',
'vyperCompilationDetails',
'remixGuide',
'walletconnect'
]
return nativePlugins.includes(name) || requiredModules.includes(name)
return nativePlugins.includes(name) || requiredModules.includes(name) || isInjectedProvicer(name)
}
/**
@ -162,7 +159,7 @@ export class RemixAppManager extends PluginManager {
}
async canDeactivatePlugin(from, to) {
if (requiredModules.includes(to.name)) return false
if (this.isRequired(to.name)) return false
return isNative(from.name)
}
@ -207,7 +204,7 @@ export class RemixAppManager extends PluginManager {
)
this.event.emit('activate', plugin)
this.emit('activate', plugin)
if (!requiredModules.includes(plugin.name)) _paq.push(['trackEvent', 'pluginManager', 'activate', plugin.name])
if (!this.isRequired(plugin.name)) _paq.push(['trackEvent', 'pluginManager', 'activate', plugin.name])
}
getAll() {
@ -235,7 +232,7 @@ export class RemixAppManager extends PluginManager {
isRequired(name) {
// excluding internal use plugins
return requiredModules.includes(name)
return requiredModules.includes(name) || isInjectedProvicer(name)
}
async registeredPlugins() {

@ -33,61 +33,61 @@ export function AccountUI(props: AccountProps) {
})
} else {
switch (selectExEnv) {
case 'vm-cancun':
setPlusOpt({
classList: '',
title: intl.formatMessage({id: 'udapp.createNewAccount'})
})
break
case 'vm-cancun':
setPlusOpt({
classList: '',
title: intl.formatMessage({id: 'udapp.createNewAccount'})
})
break
case 'vm-paris':
setPlusOpt({
classList: '',
title: intl.formatMessage({id: 'udapp.createNewAccount'})
})
break
case 'vm-paris':
setPlusOpt({
classList: '',
title: intl.formatMessage({id: 'udapp.createNewAccount'})
})
break
case 'vm-london':
setPlusOpt({
classList: '',
title: intl.formatMessage({id: 'udapp.createNewAccount'})
})
break
case 'vm-london':
setPlusOpt({
classList: '',
title: intl.formatMessage({id: 'udapp.createNewAccount'})
})
break
case 'vm-berlin':
case 'vm-berlin':
setPlusOpt({
classList: '',
title: intl.formatMessage({id: 'udapp.createNewAccount'})
})
break
case 'vm-shanghai':
setPlusOpt({
classList: '',
title: intl.formatMessage({id: 'udapp.createNewAccount'})
})
break
case 'web3':
if (!personalMode) {
setPlusOpt({
classList: '',
title: intl.formatMessage({id: 'udapp.createNewAccount'})
classList: 'disableMouseEvents',
title: intl.formatMessage({id: 'udapp.web3Title'})
})
break
case 'vm-shanghai':
} else {
setPlusOpt({
classList: '',
title: intl.formatMessage({id: 'udapp.createNewAccount'})
})
break
case 'web3':
if (!personalMode) {
setPlusOpt({
classList: 'disableMouseEvents',
title: intl.formatMessage({id: 'udapp.web3Title'})
})
} else {
setPlusOpt({
classList: '',
title: intl.formatMessage({id: 'udapp.createNewAccount'})
})
}
break
default:
setPlusOpt({
classList: 'disableMouseEvents',
title: intl.formatMessage({id: 'udapp.defaultTitle'}, {selectExEnv})
})
}
break
default:
setPlusOpt({
classList: 'disableMouseEvents',
title: intl.formatMessage({id: 'udapp.defaultTitle'}, {selectExEnv})
})
}
}
}, [selectExEnv, personalMode])

Loading…
Cancel
Save