From bd07c52526cc5e23ce01620236ac148abb039873 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 12 Apr 2021 21:18:20 +0200 Subject: [PATCH 01/21] Close all tabs when workspace changes (#1105) fix https://github.com/ethereum/remix-project/issues/989 --- apps/remix-ide/src/app.js | 2 +- apps/remix-ide/src/app/files/fileManager.js | 9 +++++++++ apps/remix-ide/src/app/panels/file-panel.js | 2 +- apps/remix-ide/src/app/panels/tab-proxy.js | 5 +++++ libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx | 6 +++--- 5 files changed, 19 insertions(+), 5 deletions(-) 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/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx b/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx index dbde392b20..79ff47d672 100644 --- a/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx +++ b/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx @@ -223,7 +223,7 @@ export const Workspace = (props: WorkspaceProps) => { } const setWorkspace = async (name) => { - props.setWorkspace({ name, isLocalhost: name === LOCALHOST }) + await props.setWorkspace({ name, isLocalhost: name === LOCALHOST }) if (name === LOCALHOST) { props.workspace.clearWorkspace() } else if (name === NO_WORKSPACE) { @@ -238,8 +238,8 @@ export const Workspace = (props: WorkspaceProps) => { } const remixdExplorer = { - hide: () => { - if (state.currentWorkspace === LOCALHOST) setWorkspace(NO_WORKSPACE) + hide: async () => { + await setWorkspace(NO_WORKSPACE) props.fileManager.setMode('browser') setState(prevState => { return { ...prevState, hideRemixdExplorer: true, loadingLocalhost: false } From cc92ffd616277eb82c01a0e5e1c0a166bc07e396 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Mon, 12 Apr 2021 21:57:52 +0200 Subject: [PATCH 02/21] alert user when full while migrating (#1072) test it by doing this a couple of times in your console ``` let r = await fetch('https://raw.githubusercontent.com/ethereum/remix-project/179c9634fb7469d9799a93de6b7dfa4aabc982ed/package-lock.json') window.remixFileSystem.writeFileSync(`${Date.now()}.json`, await r.text()) ``` it will fill up the storage, after 2 times or so. then run the migration. this will give you how much is used, after 9mb it starts to fail ``` var _lsTotal=0,_xLen,_x;for(_x in localStorage){ if(!localStorage.hasOwnProperty(_x)){continue;} _xLen= ((localStorage[_x].length + _x.length)* 2);_lsTotal+=_xLen; console.log(_x.substr(0,50)+" = "+ (_xLen/1024).toFixed(2)+" KB")};console.log("Total = " + (_lsTotal / 1024).toFixed(2) + " KB"); ``` --- apps/remix-ide/src/migrateFileSystem.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/remix-ide/src/migrateFileSystem.js b/apps/remix-ide/src/migrateFileSystem.js index ab47956743..414c11780d 100644 --- a/apps/remix-ide/src/migrateFileSystem.js +++ b/apps/remix-ide/src/migrateFileSystem.js @@ -1,6 +1,6 @@ import { Storage } from '@remix-project/remix-lib' import { joinPath } from './lib/helper' - +const modalDialogCustom = require('./app/ui/modal-dialog-custom') /* Migrating the files to the BrowserFS storage instead or raw localstorage */ @@ -53,7 +53,11 @@ const populateWorkspace = async (workspace, json, browserProvider) => { browserProvider.createDir(joinPath(workspace, item)) await populateWorkspace(workspace, json[item].children, browserProvider) } else { - await browserProvider.set(joinPath(workspace, item), json[item].content) + await browserProvider.set(joinPath(workspace, item), json[item].content, (err) => { + if (err && err.message) { + modalDialogCustom.alert(`There was an error migrating your files: ${err.message}`) + } + }) } } } From c198e7bbd6c7a7ddfba4e9a8bf9f39e5f9a8dfe2 Mon Sep 17 00:00:00 2001 From: lianahus Date: Wed, 7 Apr 2021 13:02:30 +0200 Subject: [PATCH 03/21] draft --- .../src/app/ui/landing-page/landing-page.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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..fe530dfd57 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 @@ -466,9 +466,21 @@ export class LandingPage extends ViewPlugin {
-
+
${img} +
+
Issues with File Explorer?
+
  • use [Migrate File system] tool

    +

    or

    +
  • [Download your old files] in a zip manully
  • +
  • Use [UploadZipp] tool to load them in your current workspace
  • +
    +
    Still not working?
    +
  • find help in [Gitter Channel]
  • +

    or

    +
  • Open an issue in [GithubIssues]
  • +
    From 4d7afc30293bc0f21020881c079315bcf174245d Mon Sep 17 00:00:00 2001 From: lianahus Date: Wed, 7 Apr 2021 13:41:31 +0200 Subject: [PATCH 04/21] updated links --- .../src/app/ui/landing-page/landing-page.js | 27 ++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) 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 fe530dfd57..bfd669860b 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 { @@ -471,15 +472,29 @@ export class LandingPage extends ViewPlugin {
    Issues with File Explorer?
    -
  • use [Migrate File system] tool

    + +
  • use
  • + migrateWorkspace()}>Migrate File system + tool +

    or

    -
  • [Download your old files] in a zip manully
  • -
  • Use [UploadZipp] tool to load them in your current workspace
  • + +
  • manually
  • + downloadFiles()}>Download all Files + as a zip +
    +
  • use [UploadZipp] tool to load them in your current workspace

  • Still not working?
    -
  • find help in [Gitter Channel]
  • + +
  • find help in
  • + Gitter channel +

    or

    -
  • Open an issue in [GithubIssues]
  • + +
  • open an issue in
  • + Github +
    @@ -541,7 +556,7 @@ export class LandingPage extends ViewPlugin {

    Gitter channel -

    +

    ${this.websiteIcon} Featuring website From 6036bd200312f02ee241dcf42960cb29ea387892 Mon Sep 17 00:00:00 2001 From: lianahus Date: Thu, 8 Apr 2021 12:47:47 +0200 Subject: [PATCH 05/21] layout updated refactoring linter --- .../src/app/ui/landing-page/landing-page.js | 72 +++++++++---------- 1 file changed, 33 insertions(+), 39 deletions(-) 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 bfd669860b..85f2851192 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 @@ -301,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') @@ -457,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``) @@ -470,31 +475,29 @@ export class LandingPage extends ViewPlugin {

    ${img} -
    -
    Issues with File Explorer?
    - -
  • use
  • - migrateWorkspace()}>Migrate File system - tool -
    -

    or

    - -
  • manually
  • +
    +
    Quicklinks
    + + migrateWorkspace()}>Migrate File system + to workspace + +

    2-step solution:

    +
  • + manually downloadFiles()}>Download all Files - as a zip - -
  • use [UploadZipp] tool to load them in your current workspace
  • -
    -
    Still not working?
    - -
  • find help in
  • - Gitter channel -
    -

    or

    - -
  • open an issue in
  • - Github -
    + as a backup zip + +
  • + use + startRestoreBackupZip()}>Restore Backup Zip + to current workspace +
  • +

    Help:

    + + Guide for migrating the File System to workspace + Gitter channel + Report on Github +
    @@ -522,22 +525,17 @@ export class LandingPage extends ViewPlugin {

    connectToLocalhost()}>Connect to Localhost

    -

    - - downloadFiles()}>Download all Files -

    @@ -565,10 +563,6 @@ export class LandingPage extends ViewPlugin { switchToPreviousVersion()}>Old experience

    -

    - - migrateWorkspace()}>Migrate old filesystem to workspace -

    From ac01027a6d0a47233aae02867c4d7593798a0955 Mon Sep 17 00:00:00 2001 From: lianahus Date: Mon, 12 Apr 2021 09:28:30 +0200 Subject: [PATCH 06/21] fixed the plugin activation --- apps/remix-ide/src/app/ui/landing-page/landing-page.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 85f2851192..2fbcab262f 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 @@ -302,9 +302,9 @@ export class LandingPage extends ViewPlugin { this.verticalIcons.select('pluginManager') } const startRestoreBackupZip = async () => { - await this.appManager.activatePlugin(['restoreBackupZip']) - this.verticalIcons.select('restoreBackupZip') - _paq.push(['trackEvent', 'pluginManager', 'userActivate', 'restoreBackupZip']) + await this.appManager.activatePlugin(['restorebackupzip']) + this.verticalIcons.select('restorebackupzip') + _paq.push(['trackEvent', 'pluginManager', 'userActivate', 'restorebackupzip']) } const createNewFile = () => { From 93a583e2e27c372774946798a59d482c4ad6ac82 Mon Sep 17 00:00:00 2001 From: lianahus Date: Mon, 12 Apr 2021 15:55:18 +0200 Subject: [PATCH 07/21] updated with Rob --- .../remix-ide/src/app/tabs/runTab/settings.js | 4 +- .../src/app/ui/landing-page/landing-page.js | 42 +++++++++---------- 2 files changed, 22 insertions(+), 24 deletions(-) diff --git a/apps/remix-ide/src/app/tabs/runTab/settings.js b/apps/remix-ide/src/app/tabs/runTab/settings.js index 8fc7da3700..a53606a510 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 (let 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 (let 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 2fbcab262f..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 @@ -476,25 +476,23 @@ export class LandingPage extends ViewPlugin { ${img}
    -
    Quicklinks
    - - migrateWorkspace()}>Migrate File system - to workspace - -

    2-step solution:

    +
    Quicklinks
    + Guide for migrating the old File System +

    Migration tools:

  • - manually - downloadFiles()}>Download all Files - as a backup zip + + migrateWorkspace()}>Basic migration +
  • - use - startRestoreBackupZip()}>Restore Backup Zip - to current workspace + downloadFiles()}>Download all Files + as a backup zip
  • +
  • + startRestoreBackupZip()}>Restore filesfrom backup zip +
  • Help:

    - Guide for migrating the File System to workspace Gitter channel Report on Github @@ -504,16 +502,16 @@ export class LandingPage extends ViewPlugin {
    -

    Featured Plugins

    -
    - ${this.solEnv} - ${this.learnEthEnv} - ${this.solhintEnv} - ${this.sourcifyEnv} - ${this.debuggerEnv} - ${this.moreEnv} +

    Featured Plugins

    +
    + ${this.solEnv} + ${this.learnEthEnv} + ${this.solhintEnv} + ${this.sourcifyEnv} + ${this.debuggerEnv} + ${this.moreEnv} +
    -

    File

    From eb0eb38ba50d8d2271b23cb82b14581f77840cc1 Mon Sep 17 00:00:00 2001 From: lianahus Date: Mon, 12 Apr 2021 22:14:09 +0200 Subject: [PATCH 08/21] linter --- apps/remix-ide/src/app/tabs/runTab/settings.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/remix-ide/src/app/tabs/runTab/settings.js b/apps/remix-ide/src/app/tabs/runTab/settings.js index a53606a510..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 (let 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 (let i in accounts) { + for (const i in accounts) { const address = accounts[i] if (!this.loadedAccounts[address]) { txOrigin.appendChild(yo``) From 3b4aa31f2d225ea05c677fdf863fa03fdc115280 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Tue, 13 Apr 2021 10:19:44 +0530 Subject: [PATCH 09/21] release management --- release-process.md => release-management.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename release-process.md => release-management.md (99%) diff --git a/release-process.md b/release-management.md similarity index 99% rename from release-process.md rename to release-management.md index 354fd23b3a..0b81f93395 100644 --- a/release-process.md +++ b/release-management.md @@ -12,7 +12,7 @@ More generally and a non negligeable part of the planning is to properly ensure ## Configuring releases: Release managers will oversee the various aspects of a project before it is due to be deployed, ensuring everyone is on track and meeting the agreed timeline. -## Quality Checks: +## Quality checks: The quality of the release needs to be reviewed before a project is officially launched. The release manager is in charge of ensuring manual testing is properly planned and done. Also that unit testing and e2e for new feaures have been included. From 865c18694b09cf622f0e2e1eed2f109ddfea4c27 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Tue, 13 Apr 2021 10:28:39 +0530 Subject: [PATCH 10/21] release process --- release-process.md | 79 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 release-process.md diff --git a/release-process.md b/release-process.md new file mode 100644 index 0000000000..ceb1caccbc --- /dev/null +++ b/release-process.md @@ -0,0 +1,79 @@ +# Release process + +This document includes: + - how to publish remix libs to NPM + - how to update remix.ethereum.org + - how to update remix-alpha.ethereum.org + - how to update remix-beta.ethereum.org + - how to release remix IDE + +## Remix libs release + - git fetch origin master + - git checkout origin/master + - git checkout -b bumpLibsVersion + - npm run publish:libs (this command uses lerna) + - commit + +## Remix IDE release Part 1. First push master to beta. Feature Freeze + - git co -b remix_beta origin/remix_beta + - git reset --hard -master-commit-hash- + - git push -f origin remix_beta + +## Testing phase +## In case of fixing bugs push PR's also to beta to include in Release + +## Remix IDE release Part 2. Bump the version in beta and release + + - git fetch origin remix_beta + - git checkout origin/remix_beta + - git checkout -b bumpVersion + - update package.json version + - remove package-lock.json version and generate a new one with `npm install` + - merge PR to origin/remix_beta + - git fetch origin remix_beta + - git checkout origin/remix_beta + - git tag v(version-number) + - git push --tags + - github-changes -o ethereum -r remix-project -a --only-pulls --use-commit-body --branch remix_beta --only-merges --between-tags previous_version...next_version + - publish a release in github using the changelog + +## Remix IDE release Part 3. Bump dev branch (master) + + - git fetch origin master + - git checkout origin/master + - git checkout -b bumpDevVersion + - update package.json version: bump the version and add the tag `dev` if not already present. + - remove package-lock.json version and generate a new one with `npm install` + - create a PR and merge it to origin/master + +## Remix IDE release Part 4. remix.ethereum.org update + +This is not strictly speaking a release. Updating the remix site is done through the Travis build: + + - git co -b remix_live origin/remix_live + - git reset --hard -master-commit-hash- (or remix_beta-commit-hash-) + - git push -f origin remix_live + + CircleCI will build automaticaly and remix.ethereum.org will be updated + +## Remix IDE release Part 5. Update Zip in release + - after remix_live is updated, drop the zip (from https://github.com/ethereum/remix-live/) to the release. + +## Remix-ide beta release + - git fetch origin master + - git checkout origin/master + - git checkout -b bumpVersion + - update package.json version to the new version "vx.x.x-beta.1" + - remove package-lock/json version and generate a new one with `npm install` + - merge PR + - git fetch origin master + - git checkout origin/master + - git tag v(version-number) (with "vx.x.x-beta.1") + - git push --tags + - github-changes -o ethereum -r remix-project -a --only-pulls --use-commit-body --only-merges --between-tags previous_version...next_version + - publish a beta release in github using the changelog + - drop zip file to the beta release (from https://github.com/ethereum/remix-live-alpha) + +## remix-alpha.ethereum.org update + +remix-alpha.ethereum.org is automaticaly updated every time commits are pushed to master \ No newline at end of file From 2776a0a99923beec215739eac32581782b18749c Mon Sep 17 00:00:00 2001 From: filip mertens Date: Tue, 13 Apr 2021 14:44:58 +0200 Subject: [PATCH 11/21] close all files before deleting workspace --- libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx b/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx index 79ff47d672..6a41a942bc 100644 --- a/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx +++ b/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx @@ -208,6 +208,7 @@ export const Workspace = (props: WorkspaceProps) => { } const onFinishDeleteWorkspace = async () => { + await props.fileManager.closeAllFiles() const workspacesPath = props.workspace.workspacesPath props.browser.remove(workspacesPath + '/' + state.currentWorkspace) const name = state.currentWorkspace From 8000f9dbafebf80ca18a24216095dd4741736045 Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 13 Apr 2021 19:27:27 +0200 Subject: [PATCH 12/21] Update label migration failed (#1115) --- apps/remix-ide/src/migrateFileSystem.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/remix-ide/src/migrateFileSystem.js b/apps/remix-ide/src/migrateFileSystem.js index 414c11780d..94ef8c0b7d 100644 --- a/apps/remix-ide/src/migrateFileSystem.js +++ b/apps/remix-ide/src/migrateFileSystem.js @@ -1,5 +1,6 @@ import { Storage } from '@remix-project/remix-lib' import { joinPath } from './lib/helper' +import yo from 'yo-yo' const modalDialogCustom = require('./app/ui/modal-dialog-custom') /* Migrating the files to the BrowserFS storage instead or raw localstorage @@ -55,7 +56,7 @@ const populateWorkspace = async (workspace, json, browserProvider) => { } else { await browserProvider.set(joinPath(workspace, item), json[item].content, (err) => { if (err && err.message) { - modalDialogCustom.alert(`There was an error migrating your files: ${err.message}`) + modalDialogCustom.alert(yo`
    There was an error migrating your files:${err.message}
    Please use the ‘Download all Files' action, clear the local storage and re-import your files manually or use the 'Restore files' action.
    `) } }) } From ea71718d524240618125c142f7aada6845c9db3c Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 13 Apr 2021 19:55:50 +0200 Subject: [PATCH 13/21] Fix upload file on sub folder (#1113) --- libs/remix-ui/file-explorer/src/lib/file-explorer.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/remix-ui/file-explorer/src/lib/file-explorer.tsx b/libs/remix-ui/file-explorer/src/lib/file-explorer.tsx index f02aae45a5..33bfd203fa 100644 --- a/libs/remix-ui/file-explorer/src/lib/file-explorer.tsx +++ b/libs/remix-ui/file-explorer/src/lib/file-explorer.tsx @@ -1001,7 +1001,7 @@ export const FileExplorer = (props: FileExplorerProps) => {
    { e.stopPropagation() if (e && (e.target as any).getAttribute('data-id') === 'fileExplorerUploadFileuploadFile') return // we don't want to let propagate the input of type file - + if (e && (e.target as any).getAttribute('data-id') === 'fileExplorerFileUpload') return // we don't want to let propagate the input of type file let expandPath = [] if (!state.expandPath.includes(props.name)) { From c77ae1e322d526d593541d61ac86cf6f8a8cb875 Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 13 Apr 2021 17:16:52 +0200 Subject: [PATCH 14/21] attempt fixing GoToVmTraceStep --- .../src/commands/goToVMTraceStep.ts | 22 ++++--------------- 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/apps/remix-ide-e2e/src/commands/goToVMTraceStep.ts b/apps/remix-ide-e2e/src/commands/goToVMTraceStep.ts index c9da6d8229..88b2be44fa 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)) { - 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) + browser.execute(function () { document.getElementById('slider')['value'] = number - 1 }) // It only moves slider to 50 but vm traces are not updated + .setValue('*[data-id="slider"]', new Array(1).fill(browser.Keys.RIGHT_ARROW)) + .perform(() => { + done() }) - } - }) } module.exports = GoToVmTraceStep From 602431dac2b3df4e3ca7ed67692a13407fd376d1 Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 13 Apr 2021 17:18:29 +0200 Subject: [PATCH 15/21] Update goToVMTraceStep.ts --- apps/remix-ide-e2e/src/commands/goToVMTraceStep.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/remix-ide-e2e/src/commands/goToVMTraceStep.ts b/apps/remix-ide-e2e/src/commands/goToVMTraceStep.ts index 88b2be44fa..e7218ad99e 100644 --- a/apps/remix-ide-e2e/src/commands/goToVMTraceStep.ts +++ b/apps/remix-ide-e2e/src/commands/goToVMTraceStep.ts @@ -10,7 +10,7 @@ class GoToVmTraceStep extends EventEmitter { } function goToVMtraceStep (browser: NightwatchBrowser, step: number, incr: number, done: VoidFunction) { - browser.execute(function () { document.getElementById('slider')['value'] = number - 1 }) // It only moves slider to 50 but vm traces are not updated + browser.execute(function () { document.getElementById('slider')['value'] = step - 1 }) // It only moves slider to 50 but vm traces are not updated .setValue('*[data-id="slider"]', new Array(1).fill(browser.Keys.RIGHT_ARROW)) .perform(() => { done() From 454ae4c5105cc922ab2a6b840761af1fd6d7974d Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 13 Apr 2021 17:22:12 +0200 Subject: [PATCH 16/21] remove comment --- apps/remix-ide-e2e/src/commands/goToVMTraceStep.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/remix-ide-e2e/src/commands/goToVMTraceStep.ts b/apps/remix-ide-e2e/src/commands/goToVMTraceStep.ts index e7218ad99e..6e14c8e3da 100644 --- a/apps/remix-ide-e2e/src/commands/goToVMTraceStep.ts +++ b/apps/remix-ide-e2e/src/commands/goToVMTraceStep.ts @@ -10,7 +10,7 @@ class GoToVmTraceStep extends EventEmitter { } function goToVMtraceStep (browser: NightwatchBrowser, step: number, incr: number, done: VoidFunction) { - browser.execute(function () { document.getElementById('slider')['value'] = step - 1 }) // It only moves slider to 50 but vm traces are not updated + browser.execute(function () { document.getElementById('slider')['value'] = step - 1 }) .setValue('*[data-id="slider"]', new Array(1).fill(browser.Keys.RIGHT_ARROW)) .perform(() => { done() From cc667aaabf0c015be3b6b29b61bdfcd766aaa1cd Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Tue, 13 Apr 2021 16:46:18 +0100 Subject: [PATCH 17/21] e2e linting --- apps/remix-ide-e2e/src/commands/goToVMTraceStep.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/remix-ide-e2e/src/commands/goToVMTraceStep.ts b/apps/remix-ide-e2e/src/commands/goToVMTraceStep.ts index 6e14c8e3da..aba2c5cb43 100644 --- a/apps/remix-ide-e2e/src/commands/goToVMTraceStep.ts +++ b/apps/remix-ide-e2e/src/commands/goToVMTraceStep.ts @@ -10,11 +10,11 @@ class GoToVmTraceStep extends EventEmitter { } function goToVMtraceStep (browser: NightwatchBrowser, step: number, incr: number, done: VoidFunction) { - browser.execute(function () { document.getElementById('slider')['value'] = step - 1 }) - .setValue('*[data-id="slider"]', new Array(1).fill(browser.Keys.RIGHT_ARROW)) - .perform(() => { - done() - }) + browser.execute(function () { (document.getElementById('slider') as HTMLInputElement).value = (step - 1).toString() }) + .setValue('*[data-id="slider"]', new Array(1).fill(browser.Keys.RIGHT_ARROW)) + .perform(() => { + done() + }) } module.exports = GoToVmTraceStep From 166858e1122dd8e54c07e37c90ee0881774560df Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Tue, 13 Apr 2021 16:56:14 +0100 Subject: [PATCH 18/21] Include delay to PR --- apps/remix-ide-e2e/src/commands/debugTransaction.ts | 4 ++-- apps/remix-ide-e2e/src/commands/testFunction.ts | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) 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/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) { From fc84e64be9eb13a884dadc845eb0be91191f8755 Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Tue, 13 Apr 2021 17:04:18 +0100 Subject: [PATCH 19/21] Remove duplicate linting steps --- .circleci/config.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) 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: From 8b983b9a00b874ae3c54e92cc7b6b4be6e748630 Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Tue, 13 Apr 2021 17:35:21 +0100 Subject: [PATCH 20/21] Fix highlight line --- apps/remix-ide-e2e/src/tests/debugger.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/remix-ide-e2e/src/tests/debugger.spec.ts b/apps/remix-ide-e2e/src/tests/debugger.spec.ts index 87a515f6ee..9d3b27fd0e 100644 --- a/apps/remix-ide-e2e/src/tests/debugger.spec.ts +++ b/apps/remix-ide-e2e/src/tests/debugger.spec.ts @@ -127,7 +127,7 @@ module.exports = { But the debugger uses now validSourcelocation, which means file is not -1. In that case the source highlight at 261 should be the same as for step 262 */ - .waitForElementPresent('.highlightLine7') + .waitForElementPresent('.highlightLine6') .goToVMTraceStep(266) .pause(1000) .checkVariableDebug('soliditylocals', localVariable_step266_ABIEncoder) // locals should not be initiated at this point, only idAsk should From 853b57292a6f311f6cda6faaeaf0bd988823096b Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Tue, 13 Apr 2021 18:00:43 +0100 Subject: [PATCH 21/21] Fix trace step --- apps/remix-ide-e2e/src/commands/goToVMTraceStep.ts | 2 +- apps/remix-ide-e2e/src/tests/debugger.spec.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/remix-ide-e2e/src/commands/goToVMTraceStep.ts b/apps/remix-ide-e2e/src/commands/goToVMTraceStep.ts index aba2c5cb43..e84ab52367 100644 --- a/apps/remix-ide-e2e/src/commands/goToVMTraceStep.ts +++ b/apps/remix-ide-e2e/src/commands/goToVMTraceStep.ts @@ -10,7 +10,7 @@ class GoToVmTraceStep extends EventEmitter { } function goToVMtraceStep (browser: NightwatchBrowser, step: number, incr: number, done: VoidFunction) { - browser.execute(function () { (document.getElementById('slider') as HTMLInputElement).value = (step - 1).toString() }) + 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() diff --git a/apps/remix-ide-e2e/src/tests/debugger.spec.ts b/apps/remix-ide-e2e/src/tests/debugger.spec.ts index 9d3b27fd0e..87a515f6ee 100644 --- a/apps/remix-ide-e2e/src/tests/debugger.spec.ts +++ b/apps/remix-ide-e2e/src/tests/debugger.spec.ts @@ -127,7 +127,7 @@ module.exports = { But the debugger uses now validSourcelocation, which means file is not -1. In that case the source highlight at 261 should be the same as for step 262 */ - .waitForElementPresent('.highlightLine6') + .waitForElementPresent('.highlightLine7') .goToVMTraceStep(266) .pause(1000) .checkVariableDebug('soliditylocals', localVariable_step266_ABIEncoder) // locals should not be initiated at this point, only idAsk should