fix app loading

github
bunsenstraat 3 years ago
parent b19e1d94f6
commit b4045f538c
  1. 4
      apps/remix-ide-e2e/src/tests/workspace.test.ts
  2. 20
      apps/remix-ide/src/app.js
  3. 5
      apps/remix-ide/src/app/panels/file-panel.js

@ -5,7 +5,7 @@ import sauce from './sauce'
module.exports = {
before: function (browser: NightwatchBrowser, done: VoidFunction) {
init(browser, done, 'http://127.0.0.1:8080?activate=solidity,udapp&call=fileManager//open//contracts/3_Ballot.sol&deactivate=home', false)
init(browser, done, 'http://localhost:8080?activate=solidity,udapp&call=fileManager//open//contracts/3_Ballot.sol&deactivate=home', false)
},
CheckSolidityActivatedAndUDapp: function (browser: NightwatchBrowser) {
@ -19,7 +19,7 @@ module.exports = {
browser
.pause(5000)
.refresh()
.pause(2000)
.pause(5000)
.getEditorValue((content) => {
browser.assert.ok(content.indexOf('contract Ballot {') !== -1, 'content doesn\'t include Ballot contract')
})

@ -470,14 +470,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
console.log('couldn\'t register iframe plugins', e.message)
}
await appManager.activatePlugin(['theme', 'editor', 'fileManager', 'compilerMetadata', 'compilerArtefacts', 'network', 'web3Provider', 'offsetToLineColumnConverter'])
await appManager.activatePlugin(['mainPanel', 'menuicons', 'tabs'])
await appManager.activatePlugin(['sidePanel']) // activating host plugin separately
await appManager.activatePlugin(['home'])
await appManager.activatePlugin(['settings'])
await appManager.activatePlugin(['hiddenPanel', 'filePanel', 'pluginManager', 'contextualListener', 'terminal', 'blockchain', 'fetchAndCompile', 'contentImport'])
await appManager.registerContextMenuItems()
// Set workspace after initial activation
function setWorkSpace () {
if (Array.isArray(workspace)) {
appManager.activatePlugin(workspace).then(async () => {
try {
@ -509,6 +502,17 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
// activate solidity plugin
appManager.activatePlugin(['solidity', 'udapp'])
}
}
await appManager.activatePlugin(['theme', 'editor', 'fileManager', 'compilerMetadata', 'compilerArtefacts', 'network', 'web3Provider', 'offsetToLineColumnConverter'])
await appManager.activatePlugin(['mainPanel', 'menuicons', 'tabs'])
await appManager.activatePlugin(['sidePanel']) // activating host plugin separately
await appManager.activatePlugin(['home'])
await appManager.activatePlugin(['settings'])
appManager.on('filePanel', 'workspaceInit', () => { setWorkSpace() })
await appManager.activatePlugin(['hiddenPanel', 'filePanel', 'pluginManager', 'contextualListener', 'terminal', 'blockchain', 'fetchAndCompile', 'contentImport'])
await appManager.registerContextMenuItems()
// Set workspace after initial activation
// Load and start the service who manager layout and frame
const framingService = new FramingService(sidePanel, menuicons, mainview, this._components.resizeFeature)

@ -36,7 +36,7 @@ const profile = {
name: 'filePanel',
displayName: 'File explorers',
methods: ['createNewFile', 'uploadFile', 'getCurrentWorkspace', 'getWorkspaces', 'createWorkspace', 'setWorkspace', 'registerContextMenuItem'],
events: ['setWorkspace', 'renameWorkspace', 'deleteWorkspace', 'createWorkspace'],
events: ['setWorkspace', 'renameWorkspace', 'deleteWorkspace', 'createWorkspace', 'workspaceInit'],
icon: 'assets/img/fileManager.webp',
description: ' - ',
kind: 'fileexplorer',
@ -137,6 +137,7 @@ module.exports = class Filepanel extends ViewPlugin {
console.error(error)
return reject(error)
}
this.emit('workspaceInit')
resolve(Object.keys(items)
.filter((item) => items[item].isDirectory)
.map((folder) => folder.replace(workspacesPath + '/', '')))
@ -234,7 +235,6 @@ module.exports = class Filepanel extends ViewPlugin {
const workspaceRootPath = '/' + workspaceProvider.workspacesPath
const workspaceRootPathExists = await browserProvider.exists(workspaceRootPath)
const workspacePathExists = await browserProvider.exists(workspacePath)
console.log('CRS', workspacePath, workspaceRootPath, workspacePathExists, workspaceRootPathExists)
if (!workspaceRootPathExists) await browserProvider.createDir(workspaceRootPath)
if (!workspacePathExists) await browserProvider.createDir(workspacePath)
}
@ -252,7 +252,6 @@ module.exports = class Filepanel extends ViewPlugin {
if (await this.workspaceExists(workspaceName)) throw new Error('workspace already exists')
else {
const workspaceProvider = this._deps.fileProviders.workspace
console.log('create WS', workspaceName)
await this.processCreateWorkspace(workspaceName)
workspaceProvider.setWorkspace(workspaceName)
await this.request.setWorkspace(workspaceName) // tells the react component to switch to that workspace

Loading…
Cancel
Save