Merge branch 'master' into editorColors

pull/1742/head
Liana Husikyan 3 years ago committed by GitHub
commit 2872b4fc6c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 21
      .circleci/config.yml
  2. 3
      .gitmodules
  3. 1
      apps/remix-ide-e2e/src/tests/remixd.test.ts
  4. 3
      apps/remix-ide/.babelrc
  5. 35
      apps/remix-ide/src/app/panels/tab-proxy.js
  6. 2
      apps/remix-ide/src/assets/js/react-tabs.production.min.js
  7. 2
      babel.config.js
  8. 3
      libs/remix-ui/tabs/.babelrc
  9. 1
      libs/remix-ui/tabs/react-tabs
  10. 5
      libs/remix-ui/tabs/src/lib/remix-ui-tabs.tsx
  11. 12
      libs/remix-ui/workspace/src/lib/reducers/workspace.ts
  12. 1
      package.json

@ -72,6 +72,8 @@ jobs:
parallelism: 12 parallelism: 12
steps: steps:
- checkout - checkout
- run: git submodule sync --recursive
- run: git submodule update --recursive --init
- run: npm install - run: npm install
- run: npx nx build remix-ide --with-deps - run: npx nx build remix-ide --with-deps
- run: - run:
@ -105,6 +107,8 @@ jobs:
parallelism: 12 parallelism: 12
steps: steps:
- checkout - checkout
- run: git submodule sync --recursive
- run: git submodule update --recursive --init
- run: npm install - run: npm install
- run: npm run downloadsolc_assets - run: npm run downloadsolc_assets
- run: npx nx build remix-ide --with-deps - run: npx nx build remix-ide --with-deps
@ -139,6 +143,8 @@ jobs:
parallelism: 12 parallelism: 12
steps: steps:
- checkout - checkout
- run: git submodule sync --recursive
- run: git submodule update --recursive --init
- run: npm install - run: npm install
- run: npx nx build remix-ide --with-deps - run: npx nx build remix-ide --with-deps
- run: - run:
@ -172,6 +178,8 @@ jobs:
parallelism: 12 parallelism: 12
steps: steps:
- checkout - checkout
- run: git submodule sync --recursive
- run: git submodule update --recursive --init
- run: npm install - run: npm install
- run: npm run downloadsolc_assets - run: npm run downloadsolc_assets
- run: npx nx build remix-ide --with-deps - run: npx nx build remix-ide --with-deps
@ -206,6 +214,8 @@ jobs:
steps: steps:
- checkout - checkout
- run: git submodule sync --recursive
- run: git submodule update --recursive --init
- run: npm install - run: npm install
- run: npx nx build remix-ide --with-deps - run: npx nx build remix-ide --with-deps
- run: - run:
@ -239,6 +249,8 @@ jobs:
steps: steps:
- checkout - checkout
- run: git submodule sync --recursive
- run: git submodule update --recursive --init
- run: npm install - run: npm install
- run: npx nx build remix-ide --with-deps - run: npx nx build remix-ide --with-deps
- run: npx nx build remix-ide-e2e-src-local-plugin - run: npx nx build remix-ide-e2e-src-local-plugin
@ -254,6 +266,7 @@ jobs:
path: ./reports/tests path: ./reports/tests
- store_artifacts: - store_artifacts:
path: ./reports/screenshots path: ./reports/screenshots
deploy-remix-live: deploy-remix-live:
docker: docker:
# specify the version you desire here # specify the version you desire here
@ -272,6 +285,8 @@ jobs:
steps: steps:
- checkout - checkout
- run: git submodule sync --recursive
- run: git submodule update --recursive --init
- run: npm install - run: npm install
- run: npm run downloadsolc_assets - run: npm run downloadsolc_assets
- run: npm run build:production - run: npm run build:production
@ -300,6 +315,8 @@ jobs:
steps: steps:
- checkout - checkout
- run: git submodule sync --recursive
- run: git submodule update --recursive --init
- setup_remote_docker - setup_remote_docker
- run: npm install - run: npm install
- run: npm run downloadsolc_assets - run: npm run downloadsolc_assets
@ -326,6 +343,8 @@ jobs:
steps: steps:
- checkout - checkout
- run: git submodule sync --recursive
- run: git submodule update --recursive --init
- run: npm install - run: npm install
- run: npm run downloadsolc_assets - run: npm run downloadsolc_assets
- run: npm run build:production - run: npm run build:production
@ -354,6 +373,8 @@ jobs:
steps: steps:
- checkout - checkout
- run: git submodule sync --recursive
- run: git submodule update --recursive --init
- run: npm install - run: npm install
- run: npm run build:libs - run: npm run build:libs
- run: npm run downloadsolc_assets - run: npm run downloadsolc_assets

3
.gitmodules vendored

@ -0,0 +1,3 @@
[submodule "libs/remix-ui/tabs/react-tabs"]
path = libs/remix-ui/tabs/react-tabs
url = https://github.com/reactjs/react-tabs

@ -152,7 +152,6 @@ function runTests (browser: NightwatchBrowser) {
}) })
.clickLaunchIcon('filePanel') .clickLaunchIcon('filePanel')
.waitForElementVisible('[data-path="folder1"]') .waitForElementVisible('[data-path="folder1"]')
.click('[data-path="folder1"]')
.waitForElementVisible('[data-path="folder1/contract1.sol"]') .waitForElementVisible('[data-path="folder1/contract1.sol"]')
.waitForElementVisible('[data-path="folder1/renamed_contract_' + browserName + '.sol"]') // check if renamed file is preset .waitForElementVisible('[data-path="folder1/renamed_contract_' + browserName + '.sol"]') // check if renamed file is preset
.waitForElementNotPresent('[data-path="folder1/contract_' + browserName + '.sol"]') // check if renamed (old) file is not present .waitForElementNotPresent('[data-path="folder1/contract_' + browserName + '.sol"]') // check if renamed (old) file is not present

@ -1,3 +1,4 @@
{ {
"presets": ["@babel/preset-env", "@babel/preset-react"] "presets": ["@babel/preset-env", "@babel/preset-react"],
"plugins": ["@babel/plugin-proposal-class-properties"]
} }

@ -229,19 +229,21 @@ export class TabProxy extends Plugin {
}) })
formatPath.shift() formatPath.shift()
if (formatPath.length > 0) { if (formatPath.length > 0) {
const duplicateTabName = this.loadedTabs.find(({ title }) => title === formatPath.join('/')).name const index = this.loadedTabs.findIndex(({ title }) => title === formatPath.join('/'))
const duplicateTabPath = duplicateTabName.split('/') if (index > -1) {
const duplicateTabFormatPath = [...duplicateTabPath].reverse() const duplicateTabName = this.loadedTabs[index].name
const duplicateTabTitle = duplicateTabFormatPath.slice(0, titleLength).reverse().join('/') const duplicateTabPath = duplicateTabName.split('/')
const duplicateTabFormatPath = [...duplicateTabPath].reverse()
this.loadedTabs.push({ const duplicateTabTitle = duplicateTabFormatPath.slice(0, titleLength).reverse().join('/')
id: duplicateTabName, this.loadedTabs[index] = {
name: duplicateTabName, id: duplicateTabName,
title: duplicateTabTitle, name: duplicateTabName,
icon, title: duplicateTabTitle,
tooltip: duplicateTabName, icon,
iconClass: helper.getPathIcon(duplicateTabName) tooltip: duplicateTabName,
}) iconClass: helper.getPathIcon(duplicateTabName)
}
}
} }
break break
} }
@ -306,13 +308,8 @@ export class TabProxy extends Plugin {
} }
renderTabsbar () { renderTabsbar () {
window.React = React
const script = document.createElement('script')
script.type = 'text/javascript'
script.src = 'assets/js/react-tabs.production.min.js'
document.head.appendChild(script)
script.addEventListener('load', () => this.renderComponent())
this.el = document.createElement('div') this.el = document.createElement('div')
this.renderComponent()
return this.el return this.el
} }
} }

File diff suppressed because one or more lines are too long

@ -1,4 +1,4 @@
module.exports = { module.exports = {
"presets": ["@babel/preset-react", "@babel/preset-typescript"], "presets": ["@babel/preset-react", "@babel/preset-typescript"],
"plugins": ["@babel/plugin-transform-modules-commonjs"] "plugins": ["@babel/plugin-transform-modules-commonjs", "@babel/plugin-proposal-class-properties"]
} }

@ -1,3 +1,4 @@
{ {
"presets": [["@nrwl/web/babel", { "useBuiltIns": "usage" }]] "presets": [["@nrwl/web/babel", { "useBuiltIns": "usage" }]],
"plugins": ["@babel/plugin-proposal-class-properties"]
} }

@ -0,0 +1 @@
Subproject commit 5a1fb0dc4b79f811e63e2f029786ff36b68bcbf4

@ -1,5 +1,5 @@
import React, { useState, useRef, useEffect, useReducer } from 'react' // eslint-disable-line import React, { useState, useRef, useEffect, useReducer } from 'react' // eslint-disable-line
// import { Tab, Tabs, TabList, TabPanel } from 'react-tabs' import { Tab, Tabs, TabList, TabPanel } from '../../react-tabs/src/index'
import './remix-ui-tabs.css' import './remix-ui-tabs.css'
/* eslint-disable-next-line */ /* eslint-disable-next-line */
@ -17,10 +17,7 @@ export interface TabsUIApi {
active: () => string active: () => string
} }
declare var ReactTabs: any
export const TabsUI = (props: TabsUIProps) => { export const TabsUI = (props: TabsUIProps) => {
const { Tab, Tabs, TabList, TabPanel } = ReactTabs
const [selectedIndex, setSelectedIndex] = useState(-1) const [selectedIndex, setSelectedIndex] = useState(-1)
const currentIndexRef = useRef(-1) const currentIndexRef = useRef(-1)
const tabsRef = useRef({}) const tabsRef = useRef({})

@ -504,11 +504,11 @@ export const browserReducer = (state = browserInitialState, action: Action) => {
...state, ...state,
browser: { browser: {
...state.browser, ...state.browser,
contextMenu: state.mode === 'browser' ? addContextMenuItem(state, payload) : state.browser.contextMenu contextMenu: addContextMenuItem(state, payload)
}, },
localhost: { localhost: {
...state.localhost, ...state.localhost,
contextMenu: state.mode === 'localhost' ? addContextMenuItem(state, payload) : state.localhost.contextMenu contextMenu: addContextMenuItem(state, payload)
} }
} }
} }
@ -520,11 +520,11 @@ export const browserReducer = (state = browserInitialState, action: Action) => {
...state, ...state,
browser: { browser: {
...state.browser, ...state.browser,
contextMenu: state.mode === 'browser' ? removeContextMenuItem(state, payload) : state.browser.contextMenu contextMenu: removeContextMenuItem(state, payload)
}, },
localhost: { localhost: {
...state.localhost, ...state.localhost,
contextMenu: state.mode === 'localhost' ? removeContextMenuItem(state, payload) : state.localhost.contextMenu contextMenu: removeContextMenuItem(state, payload)
} }
} }
} }
@ -536,11 +536,11 @@ export const browserReducer = (state = browserInitialState, action: Action) => {
...state, ...state,
browser: { browser: {
...state.browser, ...state.browser,
expandPath: state.mode === 'browser' ? payload : state.browser.expandPath expandPath: payload
}, },
localhost: { localhost: {
...state.localhost, ...state.localhost,
expandPath: state.mode === 'localhost' ? payload : state.localhost.expandPath expandPath: payload
} }
} }
} }

@ -136,6 +136,7 @@
] ]
}, },
"dependencies": { "dependencies": {
"@babel/plugin-proposal-class-properties": "^7.16.0",
"@erebos/bzz-node": "^0.13.0", "@erebos/bzz-node": "^0.13.0",
"@ethereumjs/block": "^3.5.1", "@ethereumjs/block": "^3.5.1",
"@ethereumjs/common": "^2.5.0", "@ethereumjs/common": "^2.5.0",

Loading…
Cancel
Save