diff --git a/apps/remix-ide-e2e/src/tests/gist.test.ts b/apps/remix-ide-e2e/src/tests/gist.test.ts index ce348cbdae..0fd6efa234 100644 --- a/apps/remix-ide-e2e/src/tests/gist.test.ts +++ b/apps/remix-ide-e2e/src/tests/gist.test.ts @@ -36,9 +36,9 @@ module.exports = { .addFile('File.sol', { content: '' }) .executeScript(`remix.loadgist('${gistid}')`) // .perform((done) => { if (runtimeBrowser === 'chrome') { browser.openFile('gists') } done() }) - .waitForElementVisible(`[data-id="treeViewLitreeViewItem${gistid}"]`) - .click(`[data-id="treeViewLitreeViewItem${gistid}"]`) - .openFile(`${gistid}/README.txt`) + .waitForElementVisible(`[data-id="treeViewLitreeViewItemgist-${gistid}"]`) + .click(`[data-id="treeViewLitreeViewItemgist-${gistid}"]`) + .openFile(`gist-${gistid}/README.txt`) // Remix publish to gist /* .click('*[data-id="fileExplorerNewFilepublishToGist"]') .pause(2000) @@ -140,9 +140,9 @@ module.exports = { }) .setValue('*[data-id="gisthandlerModalDialogModalBody-react"] input[data-id="modalDialogCustomPromp"]', testData.validGistId) .modalFooterOKClick('gisthandler') - .openFile(`${testData.validGistId}/README.txt`) - .waitForElementVisible(`div[title='default_workspace/${testData.validGistId}/README.txt']`) - .assert.containsText(`div[title='default_workspace/${testData.validGistId}/README.txt'] > span`, 'README.txt') + .openFile(`gist-${testData.validGistId}/README.txt`) + .waitForElementVisible(`div[title='default_workspace/gist-${testData.validGistId}/README.txt']`) + .assert.containsText(`div[title='default_workspace/gist-${testData.validGistId}/README.txt'] > span`, 'README.txt') .end() } } diff --git a/apps/remix-ide/src/app/tabs/test-tab.js b/apps/remix-ide/src/app/tabs/test-tab.js index 7f634bd9d1..606bc2821b 100644 --- a/apps/remix-ide/src/app/tabs/test-tab.js +++ b/apps/remix-ide/src/app/tabs/test-tab.js @@ -146,7 +146,7 @@ module.exports = class TestTab extends ViewPlugin { renderComponent (testDirPath) { this.dispatch({ testTab: this, - helper: this.helper, + helper: helper, testDirPath: testDirPath }) } diff --git a/libs/remix-core-plugin/src/lib/gist-handler.ts b/libs/remix-core-plugin/src/lib/gist-handler.ts index 0ef36a62ec..7c0ed92542 100644 --- a/libs/remix-core-plugin/src/lib/gist-handler.ts +++ b/libs/remix-core-plugin/src/lib/gist-handler.ts @@ -116,7 +116,7 @@ export class GistHandler extends Plugin { const obj: StringByString = {} Object.keys(data.files).forEach((element) => { const path = element.replace(/\.\.\./g, '/') - obj['/' + gistId + '/' + path] = data.files[element] + obj['/gist-' + gistId + '/' + path] = data.files[element] }) this.call('fileManager', 'setBatchFiles', obj, 'workspace', true, async (errorSavingFiles: any) => { if (errorSavingFiles) { diff --git a/libs/remix-ui/editor/src/lib/remix-ui-editor.tsx b/libs/remix-ui/editor/src/lib/remix-ui-editor.tsx index 769abf9528..23c0128b01 100644 --- a/libs/remix-ui/editor/src/lib/remix-ui-editor.tsx +++ b/libs/remix-ui/editor/src/lib/remix-ui-editor.tsx @@ -271,7 +271,10 @@ export const EditorUI = (props: EditorUIProps) => { props.editorAPI.clearDecorationsByPlugin = (filePath: string, plugin: string, typeOfDecoration: string, registeredDecorations: any, currentDecorations: any) => { const model = editorModelsState[filePath]?.model - if (!model) return + if (!model) return { + currentDecorations: [], + registeredDecorations: [] + } const decorations = [] const newRegisteredDecorations = [] if (registeredDecorations) { @@ -290,7 +293,9 @@ export const EditorUI = (props: EditorUIProps) => { props.editorAPI.keepDecorationsFor = (filePath: string, plugin: string, typeOfDecoration: string, registeredDecorations: any, currentDecorations: any) => { const model = editorModelsState[filePath]?.model - if (!model) return + if (!model) return { + currentDecorations: [] + } const decorations = [] if (registeredDecorations) { for (const decoration of registeredDecorations) { diff --git a/libs/remix-ui/workspace/src/lib/reducers/workspace.ts b/libs/remix-ui/workspace/src/lib/reducers/workspace.ts index df80d46ee0..8d33cb226d 100644 --- a/libs/remix-ui/workspace/src/lib/reducers/workspace.ts +++ b/libs/remix-ui/workspace/src/lib/reducers/workspace.ts @@ -641,7 +641,7 @@ const removeInputField = (state: BrowserState, path: string): { [x: string]: Rec files = _.setWith(files, _path, { isDirectory: true, path, - name: extractNameFromKey(path).indexOf('gist-') === 0 ? extractNameFromKey(path).split('-')[1] : extractNameFromKey(path), + name: extractNameFromKey(path), type: extractNameFromKey(path).indexOf('gist-') === 0 ? 'gist' : 'folder', child: prevFiles ? prevFiles.child : {} }, Object) @@ -742,7 +742,7 @@ const normalize = (filesList, directory?: string, newInputType?: 'folder' | 'fil if (filesList[key].isDirectory) { folders[extractNameFromKey(key)] = { path, - name: extractNameFromKey(path).indexOf('gist-') === 0 ? extractNameFromKey(path).split('-')[1] : extractNameFromKey(path), + name: extractNameFromKey(path), isDirectory: filesList[key].isDirectory, type: extractNameFromKey(path).indexOf('gist-') === 0 ? 'gist' : 'folder' }