diff --git a/src/app.js b/src/app.js index 69373f7a29..b98e337623 100644 --- a/src/app.js +++ b/src/app.js @@ -459,7 +459,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org let configProvider = self._components.filesProviders['config'] appManager.init([ - { profile: homepageProfile(), api: generateHomePage() }, + { profile: homepageProfile(), api: generateHomePage(appManager, appStore) }, { profile: this.profile(), api: this }, { profile: udapp.profile(), api: udapp }, { profile: fileManager.profile(), api: fileManager }, diff --git a/src/app/panels/file-panel.js b/src/app/panels/file-panel.js index bf69ecddd9..e26e815e5f 100644 --- a/src/app/panels/file-panel.js +++ b/src/app/panels/file-panel.js @@ -169,7 +169,8 @@ function filepanel (localRegistry) { self.profile = function () { return { - name: 'file explorers', + name: 'fileExplorers', + displayName: 'file explorers', methods: [], events: [], icon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB3aWR0aD0iMTc5MiIgaGVpZ2h0PSIxNzkyIiB2aWV3Qm94PSIwIDAgMTc5MiAxNzkyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0xNjk2IDM4NHE0MCAwIDY4IDI4dDI4IDY4djEyMTZxMCA0MC0yOCA2OHQtNjggMjhoLTk2MHEtNDAgMC02OC0yOHQtMjgtNjh2LTI4OGgtNTQ0cS00MCAwLTY4LTI4dC0yOC02OHYtNjcycTAtNDAgMjAtODh0NDgtNzZsNDA4LTQwOHEyOC0yOCA3Ni00OHQ4OC0yMGg0MTZxNDAgMCA2OCAyOHQyOCA2OHYzMjhxNjgtNDAgMTI4LTQwaDQxNnptLTU0NCAyMTNsLTI5OSAyOTloMjk5di0yOTl6bS02NDAtMzg0bC0yOTkgMjk5aDI5OXYtMjk5em0xOTYgNjQ3bDMxNi0zMTZ2LTQxNmgtMzg0djQxNnEwIDQwLTI4IDY4dC02OCAyOGgtNDE2djY0MGg1MTJ2LTI1NnEwLTQwIDIwLTg4dDQ4LTc2em05NTYgODA0di0xMTUyaC0zODR2NDE2cTAgNDAtMjggNjh0LTY4IDI4aC00MTZ2NjQwaDg5NnoiLz48L3N2Zz4=', diff --git a/src/app/tabs/analysis-tab.js b/src/app/tabs/analysis-tab.js index cd653bb7f0..17356068ad 100644 --- a/src/app/tabs/analysis-tab.js +++ b/src/app/tabs/analysis-tab.js @@ -11,7 +11,8 @@ class AnalysisTab { } profile () { return { - name: 'solidity static analysis', + name: 'solidityStaticAnalysis', + displayName: 'solidity static analysis', methods: [], events: [], icon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB3aWR0aD0iMjA0OCIgaGVpZ2h0PSIxNzkyIiB2aWV3Qm94PSIwIDAgMjA0OCAxNzkyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0yMDQ4IDE1MzZ2MTI4aC0yMDQ4di0xNTM2aDEyOHYxNDA4aDE5MjB6bS0xMjgtMTI0OHY0MzVxMCAyMS0xOS41IDI5LjV0LTM1LjUtNy41bC0xMjEtMTIxLTYzMyA2MzNxLTEwIDEwLTIzIDEwdC0yMy0xMGwtMjMzLTIzMy00MTYgNDE2LTE5Mi0xOTIgNTg1LTU4NXExMC0xMCAyMy0xMHQyMyAxMGwyMzMgMjMzIDQ2NC00NjQtMTIxLTEyMXEtMTYtMTYtNy41LTM1LjV0MjkuNS0xOS41aDQzNXExNCAwIDIzIDl0OSAyM3oiLz48L3N2Zz4=', diff --git a/src/app/tabs/run-tab.js b/src/app/tabs/run-tab.js index 5d0cc73f8a..d7a8303388 100644 --- a/src/app/tabs/run-tab.js +++ b/src/app/tabs/run-tab.js @@ -149,7 +149,8 @@ class RunTab { profile () { return { - name: 'run transactions', + name: 'run', + displayName: 'run transactions', methods: [], events: [], icon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB3aWR0aD0iMTc5MiIgaGVpZ2h0PSIxNzkyIiB2aWV3Qm94PSIwIDAgMTc5MiAxNzkyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0xNTc2IDkyN2wtMTMyOCA3MzhxLTIzIDEzLTM5LjUgM3QtMTYuNS0zNnYtMTQ3MnEwLTI2IDE2LjUtMzZ0MzkuNSAzbDEzMjggNzM4cTIzIDEzIDIzIDMxdC0yMyAzMXoiLz48L3N2Zz4=', diff --git a/src/app/tabs/test-tab.js b/src/app/tabs/test-tab.js index ea39a4531a..b42dbf4476 100644 --- a/src/app/tabs/test-tab.js +++ b/src/app/tabs/test-tab.js @@ -25,7 +25,8 @@ module.exports = class TestTab { } profile () { return { - name: 'solidity unit testing', + name: 'solidityUnitTesting', + displayName: 'solidity unit testing', methods: [], events: [], icon: 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB3aWR0aD0iMjMwNCIgaGVpZ2h0PSIxNzkyIiB2aWV3Qm94PSIwIDAgMjMwNCAxNzkyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0xNzI4IDQ0OGwtMzg0IDcwNGg3Njh6bS0xMjgwIDBsLTM4NCA3MDRoNzY4em04MjEtMTkycS0xNCA0MC00NS41IDcxLjV0LTcxLjUgNDUuNXYxMjkxaDYwOHExNCAwIDIzIDl0OSAyM3Y2NHEwIDE0LTkgMjN0LTIzIDloLTEzNDRxLTE0IDAtMjMtOXQtOS0yM3YtNjRxMC0xNCA5LTIzdDIzLTloNjA4di0xMjkxcS00MC0xNC03MS41LTQ1LjV0LTQ1LjUtNzEuNWgtNDkxcS0xNCAwLTIzLTl0LTktMjN2LTY0cTAtMTQgOS0yM3QyMy05aDQ5MXEyMS01NyA3MC05Mi41dDExMS0zNS41IDExMSAzNS41IDcwIDkyLjVoNDkxcTE0IDAgMjMgOXQ5IDIzdjY0cTAgMTQtOSAyM3QtMjMgOWgtNDkxem0tMTgxIDE2cTMzIDAgNTYuNS0yMy41dDIzLjUtNTYuNS0yMy41LTU2LjUtNTYuNS0yMy41LTU2LjUgMjMuNS0yMy41IDU2LjUgMjMuNSA1Ni41IDU2LjUgMjMuNXptMTA4OCA4ODBxMCA3My00Ni41IDEzMXQtMTE3LjUgOTEtMTQ0LjUgNDkuNS0xMzkuNSAxNi41LTEzOS41LTE2LjUtMTQ0LjUtNDkuNS0xMTcuNS05MS00Ni41LTEzMXEwLTExIDM1LTgxdDkyLTE3NC41IDEwNy0xOTUuNSAxMDItMTg0IDU2LTEwMHExOC0zMyA1Ni0zM3Q1NiAzM3E0IDcgNTYgMTAwdDEwMiAxODQgMTA3IDE5NS41IDkyIDE3NC41IDM1IDgxem0tMTI4MCAwcTAgNzMtNDYuNSAxMzF0LTExNy41IDkxLTE0NC41IDQ5LjUtMTM5LjUgMTYuNS0xMzkuNS0xNi41LTE0NC41LTQ5LjUtMTE3LjUtOTEtNDYuNS0xMzFxMC0xMSAzNS04MXQ5Mi0xNzQuNSAxMDctMTk1LjUgMTAyLTE4NCA1Ni0xMDBxMTgtMzMgNTYtMzN0NTYgMzNxNCA3IDU2IDEwMHQxMDIgMTg0IDEwNyAxOTUuNSA5MiAxNzQuNSAzNSA4MXoiLz48L3N2Zz4=', diff --git a/src/app/ui/landing-page/generate.js b/src/app/ui/landing-page/generate.js index 134be631a8..fc14675708 100644 --- a/src/app/ui/landing-page/generate.js +++ b/src/app/ui/landing-page/generate.js @@ -1,6 +1,7 @@ -/* global alert */ +/* global */ import LandingPage from './landing-page' import Section from './section' +import { defaultWorkspaces } from './workspace' export function homepageProfile () { return { @@ -13,7 +14,8 @@ export function homepageProfile () { } } -export function generateHomePage () { +export function generateHomePage (appManager) { + /* var actions1 = [ {label: 'new file', type: `callback`, payload: () => { alert(`-new file created-`) }}, {label: 'import from GitHub', type: `callback`, payload: () => { alert(`-imported from GitHub-`) }}, @@ -51,6 +53,12 @@ export function generateHomePage () { var section3 = new Section('Learn', actions3) var section4 = new Section('Plugins', actions4) var section5 = new Section('Help', actions5) + */ - return new LandingPage([section1, section2, section3, section4, section5]) + var sectionsWorkspaces = [] + defaultWorkspaces(appManager).forEach((workspace) => { + sectionsWorkspaces.push({label: workspace.title, type: 'callback', payload: () => { workspace.activate() }}) + }) + var sectionWorkspace = new Section('Workspaces', sectionsWorkspaces) + return new LandingPage([sectionWorkspace]) } diff --git a/src/app/ui/landing-page/workspace.js b/src/app/ui/landing-page/workspace.js new file mode 100644 index 0000000000..2f8399bfe3 --- /dev/null +++ b/src/app/ui/landing-page/workspace.js @@ -0,0 +1,50 @@ +export class Workspace { + constructor (title, description, activate, deactivate) { + this.title = title + this.description = description + this.activate = activate + this.deactivate = deactivate + } +} + +export const defaultWorkspaces = (appManager, appStore) => { + return [ + new Workspace('Close All Modules', '', () => { + appStore.getActives() + .filter(({profile}) => !profile.required) + .forEach((profile) => { appManager.deactivateOne(profile.name) }) + }, () => {}), + new Workspace('Solidity Basic', '', () => { + appManager.ensureActivated('solidity') + }, () => {}), + new Workspace('Solidity Unit testing', '', () => { + appManager.ensureActivated('solidity') + appManager.ensureActivated('solidityUnitTesting') + }, () => {}), + new Workspace('Solidity Full Environement', '', () => { + appManager.ensureActivated('solidity') + appManager.ensureActivated('run') + appManager.ensureActivated('solidityStaticAnalysis') + appManager.ensureActivated('solidityUnitTesting') + }, () => {}), + new Workspace('Vyper Basic', '', () => { + appManager.ensureActivated('vyper') + }, () => {}), + new Workspace('Pipeline', '', () => { + appManager.ensureActivated('solidity') + appManager.ensureActivated('run') + appManager.ensureActivated('pipeline') + }, () => {}), + new Workspace('Deploy and Run Solidity', '', () => { + appManager.ensureActivated('solidity') + appManager.ensureActivated('run') + }, () => {}), + new Workspace('Deploy and Run Vyper', '', () => { + appManager.ensureActivated('vyper') + appManager.ensureActivated('run') + }, () => {}), + new Workspace('Debugger', '', () => { + appManager.ensureActivated('debugger') + }, () => {}) + ] +} diff --git a/src/framingService.js b/src/framingService.js index fa50132742..e39bebbb19 100644 --- a/src/framingService.js +++ b/src/framingService.js @@ -2,12 +2,12 @@ export default { start: (appStore, swapPanelApi, verticalIconApi, mainPanelApi, resizeFeature) => { swapPanelApi.event.on('toggle', (moduleName) => { resizeFeature.panel1.clientWidth !== 0 ? resizeFeature.minimize() : resizeFeature.maximise() - if (moduleName === 'file explorers') { + if (moduleName === 'fileExplorers') { mainPanelApi.showContent('code editor') } }) swapPanelApi.event.on('showing', (moduleName) => { - if (moduleName === 'file explorers') { + if (moduleName === 'fileExplorers') { mainPanelApi.showContent('code editor') } resizeFeature.panel1.clientWidth === 0 ? resizeFeature.maximise() : '' @@ -21,7 +21,7 @@ export default { }) // mainPanelApi.event.on('showing', (moduleName) => {}) - verticalIconApi.select('file explorers') + verticalIconApi.select('fileExplorers') verticalIconApi.select('homepage') resizeFeature.minimize() } diff --git a/src/remixAppManager.js b/src/remixAppManager.js index 6bca9c35b5..744e0e2964 100644 --- a/src/remixAppManager.js +++ b/src/remixAppManager.js @@ -14,6 +14,10 @@ export class RemixAppManager extends AppManagerApi { } } + ensureActivated (module) { + if (!this.store.isActive(module)) this.activateOne(module) + } + proxy () { // that's temporary. should be removed when we can have proper notification registration return this.data.proxy diff --git a/test-browser/helpers/contracts.js b/test-browser/helpers/contracts.js index fef021a582..d7ac4df799 100644 --- a/test-browser/helpers/contracts.js +++ b/test-browser/helpers/contracts.js @@ -50,14 +50,14 @@ function getCompiledContracts (browser, compiled, callback) { } function selectContract (browser, contractName, callback) { - browser.clickLaunchIcon('settings').clickLaunchIcon('run transactions') + browser.clickLaunchIcon('settings').clickLaunchIcon('run') .setValue('#runTabView select[class^="contractNames"]', contractName).perform(() => { callback() }) } function createContract (browser, inputParams, callback) { - browser.clickLaunchIcon('settings').clickLaunchIcon('run transactions') + browser.clickLaunchIcon('settings').clickLaunchIcon('run') .setValue('div[class^="contractActionsContainerSingle"] input', inputParams, function () { browser.click('#runTabView button[class^="instanceButton"]').pause(500).perform(function () { callback() }) }) @@ -217,7 +217,7 @@ function setEditorValue (value, callback) { } function addInstance (browser, address, isValidFormat, isValidChecksum, callback) { - browser.clickLaunchIcon('run transactions').clearValue('.ataddressinput').setValue('.ataddressinput', address, function () { + browser.clickLaunchIcon('run').clearValue('.ataddressinput').setValue('.ataddressinput', address, function () { browser.click('div[class^="atAddress"]') .execute(function () { var ret = document.querySelector('div[class^="modalBody"] div').innerHTML @@ -265,7 +265,7 @@ function modalFooterOKClick () { } function addFile (browser, name, content, done) { - browser.clickLaunchIcon('run transactions').clickLaunchIcon('file explorers').click('.newFile') + browser.clickLaunchIcon('run').clickLaunchIcon('fileExplorers').click('.newFile') .perform((client, done) => { browser.execute(function (fileName) { if (fileName !== 'Untitled.sol') { @@ -372,7 +372,7 @@ function useFilter (browser, filter, test, done) { } function switchFile (browser, name, done) { - browser.clickLaunchIcon('settings').clickLaunchIcon('file explorers') + browser.clickLaunchIcon('settings').clickLaunchIcon('fileExplorers') .click('li[key="' + name + '"]') .pause(2000) .perform(() => { diff --git a/test-browser/helpers/init.js b/test-browser/helpers/init.js index f3c186a34d..3e913bdfd8 100644 --- a/test-browser/helpers/init.js +++ b/test-browser/helpers/init.js @@ -22,10 +22,10 @@ function initModules (browser, callback) { document.querySelector('div[title="pluginManager"]').scrollTop = document.querySelector('div[title="pluginManager"]').scrollHeight }, [], function () { browser.click('#pluginManager div[title="solidity"] button') - .click('#pluginManager div[title="run transactions"] button') - .click('#pluginManager div[title="solidity static analysis"] button') + .click('#pluginManager div[title="run"] button') + .click('#pluginManager div[title="solidityStaticAnalysis"] button') .click('#pluginManager div[title="debugger"] button') - .click('#icon-panel div[title="file explorers"]') + .click('#icon-panel div[title="fileExplorers"]') .perform(() => { callback() }) }) } diff --git a/test-browser/tests/ballot.js b/test-browser/tests/ballot.js index 2861632bc0..fe4fb245be 100644 --- a/test-browser/tests/ballot.js +++ b/test-browser/tests/ballot.js @@ -34,7 +34,7 @@ function runTests (browser, testData) { contractHelper.testContracts(browser, 'Untitled.sol', sources[0]['browser/Untitled.sol'], ['Ballot'], function () { done() }) - }).clickLaunchIcon('run transactions') + }).clickLaunchIcon('run') .setValue('input[placeholder="uint8 _numProposals"]', '1') .click('#runTabView button[class^="instanceButton"]') .waitForElementPresent('.instance:nth-of-type(2)') @@ -65,7 +65,7 @@ function runTests (browser, testData) { done() }) }) - .clickLaunchIcon('run transactions') + .clickLaunchIcon('run') .click('div[class^="udappClose"]') .perform((client, done) => { console.log('ballot.abi') @@ -79,7 +79,7 @@ function runTests (browser, testData) { done() }) }) - .clickLaunchIcon('file explorers') + .clickLaunchIcon('fileExplorers') .perform((client, done) => { console.log('addInstance 0x692a70D2e424a56D2C6C27aA97D1a86395877b3A') contractHelper.addInstance(browser, '0x692a70D2e424a56D2C6C27aA97D1a86395877b3A', true, true, () => { diff --git a/test-browser/tests/compiling.js b/test-browser/tests/compiling.js index fc82913722..7817299af6 100644 --- a/test-browser/tests/compiling.js +++ b/test-browser/tests/compiling.js @@ -38,7 +38,7 @@ function runTests (browser) { function testSimpleContract (browser, callback) { contractHelper.testContracts(browser, 'Untitled.sol', sources[0]['browser/Untitled.sol'], ['TestContract'], function () { - browser.clickLaunchIcon('run transactions') + browser.clickLaunchIcon('run') .click('#runTabView button[class^="instanceButton"]') .waitForElementPresent('.instance:nth-of-type(2)') .click('.instance:nth-of-type(2)') @@ -69,7 +69,7 @@ function testSimpleContract (browser, callback) { function testReturnValues (browser, callback) { contractHelper.testContracts(browser, 'returnValues.sol', sources[1]['browser/returnValues.sol'], ['testReturnValues'], function () { - browser.clickLaunchIcon('run transactions') + browser.clickLaunchIcon('run') .click('#runTabView button[class^="instanceButton"]') .waitForElementPresent('.instance:nth-of-type(2)') .click('.instance:nth-of-type(2)') @@ -107,7 +107,7 @@ function testReturnValues (browser, callback) { function testInputValues (browser, callback) { contractHelper.testContracts(browser, 'inputValues.sol', sources[2]['browser/inputValues.sol'], ['test'], function () { - browser.clickLaunchIcon('run transactions') + browser.clickLaunchIcon('run') .click('#runTabView button[class^="instanceButton"]') .waitForElementPresent('.instance:nth-of-type(2)') .click('.instance:nth-of-type(2)') diff --git a/test-browser/tests/sharedFolderExplorer.js b/test-browser/tests/sharedFolderExplorer.js index 23ff14a47d..eb822f04e2 100644 --- a/test-browser/tests/sharedFolderExplorer.js +++ b/test-browser/tests/sharedFolderExplorer.js @@ -71,7 +71,7 @@ function runTests (browser, testData) { } browser .waitForElementVisible('#icon-panel', 10000) - .clickLaunchIcon('file explorers') + .clickLaunchIcon('fileExplorers') .click('.websocketconn') .waitForElementVisible('#modal-footer-ok', 10000) .click('#modal-footer-ok') @@ -132,7 +132,7 @@ function runTests (browser, testData) { testImportFromRemixd(browser, () => { done() }) }) .perform(function () { - browser.clickLaunchIcon('file explorers').click('[data-path="localhost"]') // collapse and expand + browser.clickLaunchIcon('fileExplorers').click('[data-path="localhost"]') // collapse and expand .waitForElementNotVisible('[data-path="localhost/folder1"]') .click('[data-path="localhost"]') .waitForElementVisible('[data-path="localhost/folder1"]') diff --git a/test-browser/tests/simpleContract.js b/test-browser/tests/simpleContract.js index 6165039b1f..b82c737c82 100644 --- a/test-browser/tests/simpleContract.js +++ b/test-browser/tests/simpleContract.js @@ -24,7 +24,7 @@ function runTests (browser) { browser .waitForElementVisible('#icon-panel', 10000) .clickLaunchIcon('solidity') - .clickLaunchIcon('file explorers') + .clickLaunchIcon('fileExplorers') .click('#swap-panel label[data-path="browser"]') .perform(() => { // the first fn is used to pass browser to the other ones. diff --git a/test-browser/tests/staticanalysis.js b/test-browser/tests/staticanalysis.js index accb26ffcc..f0af4d2129 100644 --- a/test-browser/tests/staticanalysis.js +++ b/test-browser/tests/staticanalysis.js @@ -40,7 +40,7 @@ function runTests (browser) { .clickLaunchIcon('solidity') contractHelper.testContracts(browser, 'Untitled.sol', sources[0]['browser/Untitled.sol'], ['TooMuchGas', 'test1', 'test2'], function () { browser - .clickLaunchIcon('solidity static analysis') + .clickLaunchIcon('solidityStaticAnalysis') .click('#staticanalysisView button') .waitForElementPresent('#staticanalysisresult .staticAnalysisWarning', 2000, true, function () { dom.listSelectorContains(['browser/Untitled.sol:2:33:Use of tx.origin', diff --git a/test-browser/tests/units/testRecorder.js b/test-browser/tests/units/testRecorder.js index 745daa98c2..5f5f5f201d 100644 --- a/test-browser/tests/units/testRecorder.js +++ b/test-browser/tests/units/testRecorder.js @@ -10,7 +10,7 @@ module.exports = { browser.clickLaunchIcon = contractHelper.clickLaunchIcon contractHelper.addFile(browser, 'scenario.json', {content: records}, () => { browser - .clickLaunchIcon('run transactions') + .clickLaunchIcon('run') .click('div[class^="cardContainer"] i[class^="arrow"]') .click('#runTabView .runtransaction') .waitForElementPresent('.instance:nth-of-type(2)')