diff --git a/.circleci/config.yml b/.circleci/config.yml index 53a50ff692..ab5e15436f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -30,10 +30,7 @@ jobs: command: npm run lint - run: name: Remix IDE e2e Linting - command: npm run lint remix-ide-e2e - - run: npm run lint:libs - - run: npm run lint - - run: npm run lint remix-ide-e2e + command: npm run lint remix-ide-e2e remix-libs: docker: diff --git a/apps/remix-ide-e2e/src/commands/debugTransaction.ts b/apps/remix-ide-e2e/src/commands/debugTransaction.ts index 37a63acb9f..67955ea38d 100644 --- a/apps/remix-ide-e2e/src/commands/debugTransaction.ts +++ b/apps/remix-ide-e2e/src/commands/debugTransaction.ts @@ -14,12 +14,12 @@ class debugTransaction extends EventEmitter { } function checkStyle (browser: NightwatchBrowser, index: number, callback: VoidFunction) { - browser.pause(2000).execute(function (index: number) { + browser.pause(5000).execute(function (index: number) { const debugBtn = document.querySelectorAll('*[data-shared="txLoggerDebugButton"]')[index] as HTMLInputElement debugBtn && debugBtn.click() }, [index], function () { - browser.waitForElementVisible('*[data-id="buttonNavigatorJumpPreviousBreakpoint"]').perform(() => callback()) + browser.waitForElementVisible('*[data-id="buttonNavigatorJumpPreviousBreakpoint"]', 60000).perform(() => callback()) }) } diff --git a/apps/remix-ide-e2e/src/commands/goToVMTraceStep.ts b/apps/remix-ide-e2e/src/commands/goToVMTraceStep.ts index c9da6d8229..e84ab52367 100644 --- a/apps/remix-ide-e2e/src/commands/goToVMTraceStep.ts +++ b/apps/remix-ide-e2e/src/commands/goToVMTraceStep.ts @@ -10,25 +10,11 @@ class GoToVmTraceStep extends EventEmitter { } function goToVMtraceStep (browser: NightwatchBrowser, step: number, incr: number, done: VoidFunction) { - if (!incr) incr = 0 - browser.execute(function () { - return document.querySelector('#stepdetail').innerHTML - }, [], function (result) { - if (typeof result.value === 'string' && (result.value.indexOf('vm trace step:') !== -1 && result.value.indexOf(step.toString()) !== -1)) { + browser.execute(function (step) { (document.getElementById('slider') as HTMLInputElement).value = (step - 1).toString() }, [step]) + .setValue('*[data-id="slider"]', new Array(1).fill(browser.Keys.RIGHT_ARROW)) + .perform(() => { done() - } else if (incr > 1000) { - browser.assert.fail('goToVMtraceStep fails', 'info about error', '') - done() - } else { - incr++ - browser.click('#intoforward') - .perform(() => { - setTimeout(() => { - goToVMtraceStep(browser, step, incr, done) - }, 200) - }) - } - }) + }) } module.exports = GoToVmTraceStep diff --git a/apps/remix-ide-e2e/src/commands/testFunction.ts b/apps/remix-ide-e2e/src/commands/testFunction.ts index 802bb3103e..e16d613718 100644 --- a/apps/remix-ide-e2e/src/commands/testFunction.ts +++ b/apps/remix-ide-e2e/src/commands/testFunction.ts @@ -22,9 +22,10 @@ class TestFunction extends EventEmitter { }) }) .perform((done) => { - browser.waitForElementVisible(`[data-id="block_tx${txHash}"]`) + browser.waitForElementVisible(`[data-id="block_tx${txHash}"]`, 60000) .click(`[data-id="block_tx${txHash}"]`) - .waitForElementVisible(`*[data-id="txLoggerTable${txHash}"]`) + .waitForElementVisible(`*[data-id="txLoggerTable${txHash}"]`, 60000) + .pause(10000) // fetch and format transaction logs as key => pair object .elements('css selector', `*[data-shared="key_${txHash}"]`, (res) => { Array.isArray(res.value) && res.value.forEach(function (jsonWebElement) { diff --git a/apps/remix-ide/src/app.js b/apps/remix-ide/src/app.js index ce1919451a..eedcf7d778 100644 --- a/apps/remix-ide/src/app.js +++ b/apps/remix-ide/src/app.js @@ -450,7 +450,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org } await appManager.activatePlugin(['contentImport', 'theme', 'editor', 'fileManager', 'compilerMetadata', 'compilerArtefacts', 'network', 'web3Provider', 'offsetToLineColumnConverter']) - await appManager.activatePlugin(['mainPanel', 'menuicons']) + await appManager.activatePlugin(['mainPanel', 'menuicons', 'tabs']) await appManager.activatePlugin(['sidePanel']) // activating host plugin separately await appManager.activatePlugin(['home']) await appManager.activatePlugin(['hiddenPanel', 'pluginManager', 'fileExplorers', 'settings', 'contextualListener', 'terminal', 'fetchAndCompile']) diff --git a/apps/remix-ide/src/app/files/fileManager.js b/apps/remix-ide/src/app/files/fileManager.js index b1a3bdf914..932368c20b 100644 --- a/apps/remix-ide/src/app/files/fileManager.js +++ b/apps/remix-ide/src/app/files/fileManager.js @@ -398,6 +398,15 @@ class FileManager extends Plugin { return this._deps.config.get('currentFile') } + closeAllFiles () { + // TODO: Only keep `this.emit` (issue#2210) + this.emit('filesAllClosed') + this.events.emit('filesAllClosed') + for (const file in this.openedFiles) { + this.closeFile(file) + } + } + closeFile (name) { delete this.openedFiles[name] if (!Object.keys(this.openedFiles).length) { diff --git a/apps/remix-ide/src/app/panels/file-panel.js b/apps/remix-ide/src/app/panels/file-panel.js index bf5fd6ba05..7e44fc2520 100644 --- a/apps/remix-ide/src/app/panels/file-panel.js +++ b/apps/remix-ide/src/app/panels/file-panel.js @@ -225,7 +225,7 @@ module.exports = class Filepanel extends ViewPlugin { /** these are called by the react component, action is already finished whent it's called */ async setWorkspace (workspace) { - this._deps.fileManager.removeTabsOf(this._deps.fileProviders.workspace) + this._deps.fileManager.closeAllFiles() if (workspace.isLocalhost) { this.call('manager', 'activatePlugin', 'remixd') } else if (await this.call('manager', 'isActive', 'remixd')) { diff --git a/apps/remix-ide/src/app/panels/tab-proxy.js b/apps/remix-ide/src/app/panels/tab-proxy.js index 0bdef0c2ec..179a37065c 100644 --- a/apps/remix-ide/src/app/panels/tab-proxy.js +++ b/apps/remix-ide/src/app/panels/tab-proxy.js @@ -37,6 +37,11 @@ export class TabProxy extends Plugin { this.updateImgStyles() }) + fileManager.events.on('filesAllClosed', () => { + this.call('manager', 'activatePlugin', 'home') + this._view.filetabs.active = 'home' + }) + fileManager.events.on('fileRemoved', (name) => { const workspace = this.fileManager.currentWorkspace() diff --git a/apps/remix-ide/src/app/tabs/runTab/settings.js b/apps/remix-ide/src/app/tabs/runTab/settings.js index 8fc7da3700..c4ee816bc8 100644 --- a/apps/remix-ide/src/app/tabs/runTab/settings.js +++ b/apps/remix-ide/src/app/tabs/runTab/settings.js @@ -403,13 +403,13 @@ class SettingsUI { if (!accounts) accounts = [] if (this.accountListCallId > callid) return this.accountListCallId++ - for (var loadedaddress in this.loadedAccounts) { + for (const loadedaddress in this.loadedAccounts) { if (accounts.indexOf(loadedaddress) === -1) { txOrigin.removeChild(txOrigin.querySelector('option[value="' + loadedaddress + '"]')) delete this.loadedAccounts[loadedaddress] } } - for (var i in accounts) { + for (const i in accounts) { const address = accounts[i] if (!this.loadedAccounts[address]) { txOrigin.appendChild(yo``) diff --git a/apps/remix-ide/src/app/ui/landing-page/landing-page.js b/apps/remix-ide/src/app/ui/landing-page/landing-page.js index 009bbe50f4..4383acaf77 100644 --- a/apps/remix-ide/src/app/ui/landing-page/landing-page.js +++ b/apps/remix-ide/src/app/ui/landing-page/landing-page.js @@ -22,6 +22,7 @@ const css = csjs` user-select: none; } .text:hover { + cursor: pointer; text-decoration: underline; } .homeContainer { @@ -300,6 +301,11 @@ export class LandingPage extends ViewPlugin { await this.appManager.activatePlugin('pluginManager') this.verticalIcons.select('pluginManager') } + const startRestoreBackupZip = async () => { + await this.appManager.activatePlugin(['restorebackupzip']) + this.verticalIcons.select('restorebackupzip') + _paq.push(['trackEvent', 'pluginManager', 'userActivate', 'restorebackupzip']) + } const createNewFile = () => { this.call('fileExplorers', 'createNewFile') @@ -456,7 +462,7 @@ export class LandingPage extends ViewPlugin { ) } - const img = yo`` + const img = yo`` const playRemi = async () => { await document.getElementById('remiAudio').play() } // to retrieve medium posts document.body.appendChild(yo``) @@ -466,24 +472,46 @@ export class LandingPage extends ViewPlugin {
Migration tools:
+Help:
+connectToLocalhost()}>Connect to Localhost
-- - downloadFiles()}>Download all Files -
${this.websiteIcon} Featuring website @@ -538,10 +561,6 @@ export class LandingPage extends ViewPlugin { switchToPreviousVersion()}>Old experience
-- - migrateWorkspace()}>Migrate old filesystem to workspace -