update after review

pull/5370/head
LianaHus 5 years ago
parent f7a39b036e
commit 1426cad1a6
  1. 47
      package-lock.json
  2. 2
      package.json
  3. 6
      src/app.js
  4. 20
      src/app/components/plugin-manager-component.js
  5. 18
      src/app/panels/tab-proxy.js
  6. 2
      src/app/panels/terminal.js
  7. 8
      src/app/tabs/test-tab.js

47
package-lock.json generated

@ -1778,9 +1778,9 @@
"integrity": "sha512-ePDxG9UuU9Kobk90ZUjtmDW8IT9U7aRb1/Rl9683MRNM+ur0ocHL2v7TPH2ajTiVSBUFbbeW8vKIt9jrb0JIAA==" "integrity": "sha512-ePDxG9UuU9Kobk90ZUjtmDW8IT9U7aRb1/Rl9683MRNM+ur0ocHL2v7TPH2ajTiVSBUFbbeW8vKIt9jrb0JIAA=="
}, },
"@remixproject/engine": { "@remixproject/engine": {
"version": "0.2.0-alpha.1", "version": "0.2.0-alpha.4",
"resolved": "https://registry.npmjs.org/@remixproject/engine/-/engine-0.2.0-alpha.1.tgz", "resolved": "https://registry.npmjs.org/@remixproject/engine/-/engine-0.2.0-alpha.4.tgz",
"integrity": "sha512-KeYCDBa02MddlyCDSF7YGTZgVcOWeNt4MEcTT/IMpHRyAht0apAq+2MDCMH3l1/wZ3ggiH0ZV12KxM/ZcQ92UQ==" "integrity": "sha512-AY6HaF7Y4fR1oOdz60B2zt+gGftaT5fZWSl5ka7UuDHZUzeouNMx4O1+Uk4376Mv+M3vdmpGFo6KgfsZj6wSJw=="
}, },
"@resolver-engine/core": { "@resolver-engine/core": {
"version": "0.3.3", "version": "0.3.3",
@ -6737,8 +6737,7 @@
}, },
"ansi-regex": { "ansi-regex": {
"version": "2.1.1", "version": "2.1.1",
"bundled": true, "bundled": true
"optional": true
}, },
"aproba": { "aproba": {
"version": "1.2.0", "version": "1.2.0",
@ -6756,13 +6755,11 @@
}, },
"balanced-match": { "balanced-match": {
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "bundled": true
"optional": true
}, },
"brace-expansion": { "brace-expansion": {
"version": "1.1.11", "version": "1.1.11",
"bundled": true, "bundled": true,
"optional": true,
"requires": { "requires": {
"balanced-match": "^1.0.0", "balanced-match": "^1.0.0",
"concat-map": "0.0.1" "concat-map": "0.0.1"
@ -6775,18 +6772,15 @@
}, },
"code-point-at": { "code-point-at": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true, "bundled": true
"optional": true
}, },
"concat-map": { "concat-map": {
"version": "0.0.1", "version": "0.0.1",
"bundled": true, "bundled": true
"optional": true
}, },
"console-control-strings": { "console-control-strings": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true, "bundled": true
"optional": true
}, },
"core-util-is": { "core-util-is": {
"version": "1.0.2", "version": "1.0.2",
@ -6889,8 +6883,7 @@
}, },
"inherits": { "inherits": {
"version": "2.0.4", "version": "2.0.4",
"bundled": true, "bundled": true
"optional": true
}, },
"ini": { "ini": {
"version": "1.3.5", "version": "1.3.5",
@ -6900,7 +6893,6 @@
"is-fullwidth-code-point": { "is-fullwidth-code-point": {
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "bundled": true,
"optional": true,
"requires": { "requires": {
"number-is-nan": "^1.0.0" "number-is-nan": "^1.0.0"
} }
@ -6913,20 +6905,17 @@
"minimatch": { "minimatch": {
"version": "3.0.4", "version": "3.0.4",
"bundled": true, "bundled": true,
"optional": true,
"requires": { "requires": {
"brace-expansion": "^1.1.7" "brace-expansion": "^1.1.7"
} }
}, },
"minimist": { "minimist": {
"version": "0.0.8", "version": "0.0.8",
"bundled": true, "bundled": true
"optional": true
}, },
"minipass": { "minipass": {
"version": "2.9.0", "version": "2.9.0",
"bundled": true, "bundled": true,
"optional": true,
"requires": { "requires": {
"safe-buffer": "^5.1.2", "safe-buffer": "^5.1.2",
"yallist": "^3.0.0" "yallist": "^3.0.0"
@ -6943,7 +6932,6 @@
"mkdirp": { "mkdirp": {
"version": "0.5.1", "version": "0.5.1",
"bundled": true, "bundled": true,
"optional": true,
"requires": { "requires": {
"minimist": "0.0.8" "minimist": "0.0.8"
} }
@ -7024,8 +7012,7 @@
}, },
"number-is-nan": { "number-is-nan": {
"version": "1.0.1", "version": "1.0.1",
"bundled": true, "bundled": true
"optional": true
}, },
"object-assign": { "object-assign": {
"version": "4.1.1", "version": "4.1.1",
@ -7035,7 +7022,6 @@
"once": { "once": {
"version": "1.4.0", "version": "1.4.0",
"bundled": true, "bundled": true,
"optional": true,
"requires": { "requires": {
"wrappy": "1" "wrappy": "1"
} }
@ -7111,8 +7097,7 @@
}, },
"safe-buffer": { "safe-buffer": {
"version": "5.1.2", "version": "5.1.2",
"bundled": true, "bundled": true
"optional": true
}, },
"safer-buffer": { "safer-buffer": {
"version": "2.1.2", "version": "2.1.2",
@ -7142,7 +7127,6 @@
"string-width": { "string-width": {
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "bundled": true,
"optional": true,
"requires": { "requires": {
"code-point-at": "^1.0.0", "code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0", "is-fullwidth-code-point": "^1.0.0",
@ -7160,7 +7144,6 @@
"strip-ansi": { "strip-ansi": {
"version": "3.0.1", "version": "3.0.1",
"bundled": true, "bundled": true,
"optional": true,
"requires": { "requires": {
"ansi-regex": "^2.0.0" "ansi-regex": "^2.0.0"
} }
@ -7199,13 +7182,11 @@
}, },
"wrappy": { "wrappy": {
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "bundled": true
"optional": true
}, },
"yallist": { "yallist": {
"version": "3.1.1", "version": "3.1.1",
"bundled": true, "bundled": true
"optional": true
} }
} }
}, },

@ -78,7 +78,7 @@
"yo-yoify": "^3.7.3" "yo-yoify": "^3.7.3"
}, },
"dependencies": { "dependencies": {
"@remixproject/engine": "^0.2.0-alpha.1", "@remixproject/engine": "^0.2.0-alpha.4",
"http-server": "^0.11.1", "http-server": "^0.11.1",
"remixd": "0.1.8-alpha.10", "remixd": "0.1.8-alpha.10",
"standard": "^8.5.0" "standard": "^8.5.0"

@ -308,9 +308,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
const mainview = new MainView(contextualListener, editor, appPanel, fileManager, appManager, terminal) const mainview = new MainView(contextualListener, editor, appPanel, fileManager, appManager, terminal)
registry.put({ api: mainview, name: 'mainview' }) registry.put({ api: mainview, name: 'mainview' })
engine.register([ engine.register(appPanel)
appPanel
])
// those views depend on app_manager // those views depend on app_manager
const menuicons = new VerticalIcons(appManager) const menuicons = new VerticalIcons(appManager)
@ -415,6 +413,6 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
} }
if (isElectron()) { if (isElectron()) {
appManager.activatePlugin(['remixd']) appManager.activatePlugin('remixd')
} }
} }

@ -87,7 +87,11 @@ class PluginManagerComponent extends ViewPlugin {
this.appManager.event.on('added', () => { this.reRender() }) this.appManager.event.on('added', () => { this.reRender() })
} }
renderItem (profile, isActive) { isActive (name) {
return this.appManager.actives.includes(name)
}
renderItem (profile) {
const displayName = (profile.displayName) ? profile.displayName : profile.name const displayName = (profile.displayName) ? profile.displayName : profile.name
// Check version of the plugin // Check version of the plugin
@ -101,11 +105,12 @@ class PluginManagerComponent extends ViewPlugin {
versionWarning = yo`<small title="Version Beta" class="${css.versionWarning} plugin-version">beta</small>` versionWarning = yo`<small title="Version Beta" class="${css.versionWarning} plugin-version">beta</small>`
} }
const activationButton = isActive const activationButton = this.isActive(profile.name)
? yo` ? yo`
<button onclick="${_ => this.appManager.deactivatePlugin(profile.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 Deactivate
</button>` </button>
`
: yo` : yo`
<button onclick="${_ => this.appManager.activatePlugin(profile.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 Activate
@ -161,7 +166,7 @@ class PluginManagerComponent extends ViewPlugin {
} }
// Filter all active and inactive modules that are not required // Filter all active and inactive modules that are not required
const isActive = (name) => { return this.appManager.actives.includes(name) }
const {actives, inactives} = this.appManager.getAll() const {actives, inactives} = this.appManager.getAll()
.filter(isFiltered) .filter(isFiltered)
@ -169,7 +174,8 @@ class PluginManagerComponent extends ViewPlugin {
.filter(isNotHome) .filter(isNotHome)
.sort(sortByName) .sort(sortByName)
.reduce(({actives, inactives}, profile) => { .reduce(({actives, inactives}, profile) => {
return isActive(profile.name) ? { actives: [...actives, profile], inactives } return this.isActive(profile.name)
? { actives: [...actives, profile], inactives }
: { inactives: [...inactives, profile], actives } : { inactives: [...inactives, profile], actives }
}, { actives: [], inactives: [] }) }, { actives: [], inactives: [] })
@ -201,11 +207,11 @@ class PluginManagerComponent extends ViewPlugin {
<section data-id="pluginManagerComponentPluginManagerSection"> <section data-id="pluginManagerComponentPluginManagerSection">
${activeTile} ${activeTile}
<div class="list-group list-group-flush plugins-list-group" data-id="pluginManagerComponentActiveTile"> <div class="list-group list-group-flush plugins-list-group" data-id="pluginManagerComponentActiveTile">
${actives.map(profile => this.renderItem(profile, isActive(profile.name)))} ${actives.map(profile => this.renderItem(profile))}
</div> </div>
${inactiveTile} ${inactiveTile}
<div class="list-group list-group-flush plugins-list-group" data-id="pluginManagerComponentInactiveTile"> <div class="list-group list-group-flush plugins-list-group" data-id="pluginManagerComponentInactiveTile">
${inactives.map(profile => this.renderItem(profile, isActive(profile.name)))} ${inactives.map(profile => this.renderItem(profile))}
</div> </div>
</section> </section>
${settings} ${settings}

@ -49,19 +49,19 @@ export class TabProxy {
}) })
}) })
appManager.event.on('activate', (profile) => { appManager.event.on('activate', ({ name, location, displayName, icon }) => {
if (profile.location === 'mainPanel') { if (location === 'mainPanel') {
this.addTab( this.addTab(
profile.name, name,
profile.displayName, displayName,
() => this.event.emit('switchApp', profile.name), () => this.event.emit('switchApp', name),
() => { () => {
this.event.emit('closeApp', profile.name) this.event.emit('closeApp', name)
this.appManager.deactivatePlugin(profile.name) this.appManager.deactivatePlugin(name)
}, },
profile.icon icon
) )
this.switchTab(profile.name) this.switchTab(name)
} }
}) })

@ -45,7 +45,7 @@ class Terminal extends Plugin {
self._api = api self._api = api
self._opts = opts self._opts = opts
self.data = { self.data = {
lineLength: opts.lineLength || 80, // ??? lineLength: opts.lineLength || 80, // ????
session: [], session: [],
activeFilters: { commands: {}, input: '' }, activeFilters: { commands: {}, input: '' },
filterFns: {} filterFns: {}

@ -30,11 +30,11 @@ module.exports = class TestTab extends ViewPlugin {
this.appManager = appManager this.appManager = appManager
this.renderer = renderer this.renderer = renderer
this.baseurl = 'https://solc-bin.ethereum.org/bin' this.baseurl = 'https://solc-bin.ethereum.org/bin'
appManager.event.on('activate', (profile) => { appManager.event.on('activate', (name) => {
if (profile.name === 'solidity') this.updateRunAction(fileManager.currentFile()) if (name === 'solidity') this.updateRunAction(fileManager.currentFile())
}) })
appManager.event.on('deactivate', (profile) => { appManager.event.on('deactivate', (name) => {
if (profile.name === 'solidity') this.updateRunAction(fileManager.currentFile()) if (name === 'solidity') this.updateRunAction(fileManager.currentFile())
}) })
} }

Loading…
Cancel
Save