From 6ae7edd7c1df55e729b1d06b759298618cc2f186 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 4 Mar 2021 12:02:37 +0100 Subject: [PATCH] do not automatically create a folder --- .../src/app/tabs/styles/test-tab-styles.js | 3 +++ apps/remix-ide/src/app/tabs/test-tab.js | 20 ++++++++++++++----- .../remix-ide/src/app/tabs/testTab/testTab.js | 3 +++ 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/apps/remix-ide/src/app/tabs/styles/test-tab-styles.js b/apps/remix-ide/src/app/tabs/styles/test-tab-styles.js index ce267b02bf..b6cce75aeb 100644 --- a/apps/remix-ide/src/app/tabs/styles/test-tab-styles.js +++ b/apps/remix-ide/src/app/tabs/styles/test-tab-styles.js @@ -48,5 +48,8 @@ var css = csjs` .labelOnBtn { border: hidden; } + .inputFolder { + width: 80%; + } ` module.exports = css diff --git a/apps/remix-ide/src/app/tabs/test-tab.js b/apps/remix-ide/src/app/tabs/test-tab.js index 2154232d23..36dcbed3a6 100644 --- a/apps/remix-ide/src/app/tabs/test-tab.js +++ b/apps/remix-ide/src/app/tabs/test-tab.js @@ -573,18 +573,28 @@ module.exports = class TestTab extends ViewPlugin { this.inputPath = yo` { if (e.keyCode === 191) this.updateDirList() }} - onchange=${(e) => this.updateCurrentPath(e)}/>` + onkeydown=${(e) => { if (e.keyCode === 191) this.updateDirList() }}/>` + + const createTestFolder = yo`` const availablePaths = yo`
- ${this.inputPath} - ${this.uiPathList} +
+ ${this.inputPath} + ${createTestFolder} + ${this.uiPathList} +
` this.updateDirList() diff --git a/apps/remix-ide/src/app/tabs/testTab/testTab.js b/apps/remix-ide/src/app/tabs/testTab/testTab.js index f0c85c773f..77c8fb4102 100644 --- a/apps/remix-ide/src/app/tabs/testTab/testTab.js +++ b/apps/remix-ide/src/app/tabs/testTab/testTab.js @@ -11,6 +11,9 @@ class TestTabLogic { setCurrentPath (path) { if (path.indexOf('/') === 0) return this.currentPath = path + } + + generateTestFolder (path) { const fileProvider = this.fileManager.fileProviderOf(path.split('/')[0]) fileProvider.exists(path, (e, res) => { if (!res) fileProvider.createDir(path) }) }