From 1244d63dede59ea7cfac25407b5df3bd0fcacc00 Mon Sep 17 00:00:00 2001 From: lianahus Date: Wed, 19 Oct 2022 10:34:49 +0200 Subject: [PATCH 01/31] scroll functionality for FP and GS sections in home tab --- .../src/lib/components/customNavButtons.tsx | 19 ++++-- .../src/lib/components/homeTabFeatured.tsx | 25 ++++---- .../lib/components/homeTabFeaturedPlugins.tsx | 51 +++++++++++++--- .../src/lib/components/homeTabGetStarted.tsx | 60 +++++++++++++++++-- .../src/lib/components/homeTabLearn.tsx | 6 +- .../src/lib/components/pluginButton.tsx | 2 +- .../src/lib/components/workspaceTemplate.tsx | 2 +- .../home-tab/src/lib/remix-ui-home-tab.css | 2 - 8 files changed, 133 insertions(+), 34 deletions(-) diff --git a/libs/remix-ui/home-tab/src/lib/components/customNavButtons.tsx b/libs/remix-ui/home-tab/src/lib/components/customNavButtons.tsx index f298eba01d..4791e600d3 100644 --- a/libs/remix-ui/home-tab/src/lib/components/customNavButtons.tsx +++ b/libs/remix-ui/home-tab/src/lib/components/customNavButtons.tsx @@ -2,15 +2,24 @@ import React from 'react' const CustomNavButtons = ({ next, previous, goToSlide, ...rest }) => { - const { carouselState: { currentSlide, totalItems } } = rest + const { carouselState: { currentSlide, totalItems, itemWidth, containerWidth } } = rest return (
- -
diff --git a/libs/remix-ui/home-tab/src/lib/components/homeTabFeatured.tsx b/libs/remix-ui/home-tab/src/lib/components/homeTabFeatured.tsx index 8741d7779f..18798c3f4f 100644 --- a/libs/remix-ui/home-tab/src/lib/components/homeTabFeatured.tsx +++ b/libs/remix-ui/home-tab/src/lib/components/homeTabFeatured.tsx @@ -18,7 +18,7 @@ function HomeTabFeatured() {
- + } arrows={false} @@ -40,26 +40,31 @@ function HomeTabFeatured() { dotListClass="position-relative mt-2" >
- -
+ +
JUMP INTO WEB3
- The Remix Project is a rich toolset which can be used for the entire journey of contract development by users of any knowledge level, and as a learning lab for teaching and experimenting with Ethereum. +

The Remix Project is a rich toolset which can be used for the entire journey of contract development by users of any knowledge level, and as a learning lab for teaching and experimenting with Ethereum.

+ More
-
+
REMIX REWARDS
-

NFTs for our users!

- Remix Project rewards contributors, beta testers, and UX research participants with NFTs deployed on Optimism. Remix Reward holders are able to mint a second “Remixer” user NFT badge to give to any other user of their choice +

NFTs for our users!

+

+ Remix Project rewards contributors, beta testers, and UX research participants with NFTs deployed on Optimism. Remix Reward holders are able to mint a second “Remixer” user NFT badge to give to any other user of their choice. +

+ More
-
+
BETA TESTING
-

Our community supports us.

- You can join Beta Testing before each release of Remix IDE. Help us test now and get a handle on new features! +

Our community supports us.

+

You can join Beta Testing before each release of Remix IDE. Help us test now and get a handle on new features!

+ More
diff --git a/libs/remix-ui/home-tab/src/lib/components/homeTabFeaturedPlugins.tsx b/libs/remix-ui/home-tab/src/lib/components/homeTabFeaturedPlugins.tsx index 84b2fb4f57..41a4d8f36c 100644 --- a/libs/remix-ui/home-tab/src/lib/components/homeTabFeaturedPlugins.tsx +++ b/libs/remix-ui/home-tab/src/lib/components/homeTabFeaturedPlugins.tsx @@ -5,6 +5,7 @@ import { ThemeContext, themes } from '../themeContext' import Carousel from 'react-multi-carousel' import 'react-multi-carousel/lib/styles.css' import CustomNavButtons from './customNavButtons' +const itemsToShow = 5 declare global { interface Window { _paq: any @@ -20,16 +21,39 @@ function HomeTabFeaturedPlugins ({plugin}: HomeTabFeaturedPluginsProps) { const themeFilter = useContext(ThemeContext) const carouselRef = useRef(null) + const carouselRefDiv = useRef(null) - // Todo doesn't work useEffect(() => { - window.addEventListener("scroll", handleScroll) + document.addEventListener("wheel", handleScroll) return () => { - window.removeEventListener("scroll", handleScroll) + document.removeEventListener("wheel", handleScroll) } }, []) + function isDescendant(parent, child) { + let node = child.parentNode; + while (node != null) { + if (node === parent) { + return true; + } + node = node.parentNode; + } + return false; +} const handleScroll = (e) => { + if (isDescendant(carouselRefDiv.current, e.target)) { + e.stopPropagation() + let nextSlide = 0 + if (e.wheelDelta < 0) { + nextSlide = carouselRef.current.state.currentSlide + 1; + if ((carouselRef.current.state.totalItems - carouselRef.current.state.currentSlide) * carouselRef.current.state.itemWidth + 5 < carouselRef.current.state.containerWidth) return // 5 is approx margins + carouselRef.current.goToSlide(nextSlide) + } else { + nextSlide = carouselRef.current.state.currentSlide - 1; + if (nextSlide < 0) nextSlide = 0 + carouselRef.current.goToSlide(nextSlide) + } + } } const startSolidity = async () => { @@ -61,17 +85,30 @@ function HomeTabFeaturedPlugins ({plugin}: HomeTabFeaturedPluginsProps) { return (
-
+
} + focusOnSelect={true} + customButtonGroup={ + + } arrows={false} swipeable={false} draggable={true} showDots={false} - responsive={{ desktop: { breakpoint: { max: 3000, min: 1024 }, items: 5} }} + responsive={ + { + superLargeDesktop: { + breakpoint: { max: 4000, min: 3000 }, + items: itemsToShow + }, + desktop: { + breakpoint: { max: 3000, min: 1024 }, + items: itemsToShow + } + } + } renderButtonGroupOutside={true} ssr={true} // means to render carousel on server-side. keyBoardControl={true} diff --git a/libs/remix-ui/home-tab/src/lib/components/homeTabGetStarted.tsx b/libs/remix-ui/home-tab/src/lib/components/homeTabGetStarted.tsx index f27f489198..b3bd1cd3b5 100644 --- a/libs/remix-ui/home-tab/src/lib/components/homeTabGetStarted.tsx +++ b/libs/remix-ui/home-tab/src/lib/components/homeTabGetStarted.tsx @@ -18,6 +18,41 @@ interface HomeTabGetStartedProps { function HomeTabGetStarted ({plugin}: HomeTabGetStartedProps) { const themeFilter = useContext(ThemeContext) + const carouselRef = useRef(null) + const carouselRefDiv = useRef(null) + + useEffect(() => { + document.addEventListener("wheel", handleScroll) + return () => { + document.removeEventListener("wheel", handleScroll) + } + }, []) + + function isDescendant(parent, child) { + let node = child.parentNode; + while (node != null) { + if (node === parent) { + return true; + } + node = node.parentNode; + } + return false; +} + const handleScroll = (e) => { + if (isDescendant(carouselRefDiv.current, e.target)) { + e.stopPropagation() + let nextSlide = 0 + if (e.wheelDelta < 0) { + nextSlide = carouselRef.current.state.currentSlide + 1; + if ((carouselRef.current.state.totalItems - carouselRef.current.state.currentSlide) * carouselRef.current.state.itemWidth + 5 < carouselRef.current.state.containerWidth) return // 5 is approx margins + carouselRef.current.goToSlide(nextSlide) + } else { + nextSlide = carouselRef.current.state.currentSlide - 1; + if (nextSlide < 0) nextSlide = 0 + carouselRef.current.goToSlide(nextSlide) + } + } + } const createWorkspace = async (templateName) => { await plugin.appManager.activatePlugin('filePanel') @@ -36,16 +71,31 @@ function HomeTabGetStarted ({plugin}: HomeTabGetStartedProps) { - Project Templates -
+
- } + + } arrows={false} swipeable={false} draggable={true} showDots={false} - responsive={{ desktop: { breakpoint: { max: 3000, min: 1024 }, items: 5} }} + responsive={ + { + superLargeDesktop: { + breakpoint: { max: 4000, min: 3000 }, + items: 5 + }, + desktop: { + breakpoint: { max: 3000, min: 1024 }, + items: 5, + partialVisibilityGutter: 0 + } + } + } renderButtonGroupOutside={true} ssr={true} // means to render carousel on server-side. keyBoardControl={true} diff --git a/libs/remix-ui/home-tab/src/lib/components/homeTabLearn.tsx b/libs/remix-ui/home-tab/src/lib/components/homeTabLearn.tsx index 0fdc6ab5ff..e9d1a345b3 100644 --- a/libs/remix-ui/home-tab/src/lib/components/homeTabLearn.tsx +++ b/libs/remix-ui/home-tab/src/lib/components/homeTabLearn.tsx @@ -50,20 +50,20 @@ function HomeTabLearn ({plugin}: HomeTabLearnProps) {
}
}
} diff --git a/libs/remix-ui/home-tab/src/lib/components/pluginButton.tsx b/libs/remix-ui/home-tab/src/lib/components/pluginButton.tsx index 803c9f7ec4..8a8470304d 100644 --- a/libs/remix-ui/home-tab/src/lib/components/pluginButton.tsx +++ b/libs/remix-ui/home-tab/src/lib/components/pluginButton.tsx @@ -23,7 +23,7 @@ function PluginButton ({ imgPath, envID, envText, callback, l2, description, rem onClick={() => callback()} > -
+
{description}
diff --git a/libs/remix-ui/home-tab/src/lib/components/workspaceTemplate.tsx b/libs/remix-ui/home-tab/src/lib/components/workspaceTemplate.tsx index ad079053a8..4610236f79 100644 --- a/libs/remix-ui/home-tab/src/lib/components/workspaceTemplate.tsx +++ b/libs/remix-ui/home-tab/src/lib/components/workspaceTemplate.tsx @@ -16,7 +16,7 @@ function WorkspaceTemplate ({ gsID, workspaceTitle, description, callback }: Wor data-id={'landingPageStart' + gsID} onClick={() => callback()} > -
+
{description}
diff --git a/libs/remix-ui/home-tab/src/lib/remix-ui-home-tab.css b/libs/remix-ui/home-tab/src/lib/remix-ui-home-tab.css index d6ced30e67..011a179161 100644 --- a/libs/remix-ui/home-tab/src/lib/remix-ui-home-tab.css +++ b/libs/remix-ui/home-tab/src/lib/remix-ui-home-tab.css @@ -1,11 +1,9 @@ .remixui_home_text { - cursor: pointer; font-size: 0.8rem; font-weight: normal; max-width: 300px; } .remixui_home_text:hover { - cursor: pointer; text-decoration: underline; } .remixui_home_homeContainer { From 97931ebaff3f9bbf2a68a54acf3cb85f9d8ad614 Mon Sep 17 00:00:00 2001 From: lianahus Date: Wed, 19 Oct 2022 10:39:22 +0200 Subject: [PATCH 02/31] cleanup --- .../home-tab/src/lib/components/homeTabFeaturedPlugins.tsx | 5 ++--- .../home-tab/src/lib/components/homeTabGetStarted.tsx | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/libs/remix-ui/home-tab/src/lib/components/homeTabFeaturedPlugins.tsx b/libs/remix-ui/home-tab/src/lib/components/homeTabFeaturedPlugins.tsx index 41a4d8f36c..4b811c89c9 100644 --- a/libs/remix-ui/home-tab/src/lib/components/homeTabFeaturedPlugins.tsx +++ b/libs/remix-ui/home-tab/src/lib/components/homeTabFeaturedPlugins.tsx @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ -import React, { useEffect, useState, useRef, useContext } from 'react' +import React, { useEffect, useRef, useContext } from 'react' import PluginButton from './pluginButton' -import { ThemeContext, themes } from '../themeContext' +import { ThemeContext } from '../themeContext' import Carousel from 'react-multi-carousel' import 'react-multi-carousel/lib/styles.css' import CustomNavButtons from './customNavButtons' @@ -12,7 +12,6 @@ declare global { } } const _paq = window._paq = window._paq || [] //eslint-disable-line - interface HomeTabFeaturedPluginsProps { plugin: any } diff --git a/libs/remix-ui/home-tab/src/lib/components/homeTabGetStarted.tsx b/libs/remix-ui/home-tab/src/lib/components/homeTabGetStarted.tsx index b3bd1cd3b5..1c1d43d39c 100644 --- a/libs/remix-ui/home-tab/src/lib/components/homeTabGetStarted.tsx +++ b/libs/remix-ui/home-tab/src/lib/components/homeTabGetStarted.tsx @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ -import React, { useEffect, useState, useRef, useContext } from 'react' -import { ThemeContext, themes } from '../themeContext' +import React, { useEffect, useRef, useContext } from 'react' +import { ThemeContext} from '../themeContext' import Carousel from 'react-multi-carousel' import WorkspaceTemplate from './workspaceTemplate' import 'react-multi-carousel/lib/styles.css' @@ -11,7 +11,6 @@ declare global { } } const _paq = window._paq = window._paq || [] //eslint-disable-line - interface HomeTabGetStartedProps { plugin: any } From bdcf65dd67a1df648940c42269b2c1baf4f6dad8 Mon Sep 17 00:00:00 2001 From: lianahus Date: Wed, 19 Oct 2022 10:42:22 +0200 Subject: [PATCH 03/31] indent --- .../home-tab/src/lib/components/customNavButtons.tsx | 2 +- .../src/lib/components/homeTabFeaturedPlugins.tsx | 11 ++++++----- .../home-tab/src/lib/components/homeTabGetStarted.tsx | 11 ++++++----- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/libs/remix-ui/home-tab/src/lib/components/customNavButtons.tsx b/libs/remix-ui/home-tab/src/lib/components/customNavButtons.tsx index 4791e600d3..9418051754 100644 --- a/libs/remix-ui/home-tab/src/lib/components/customNavButtons.tsx +++ b/libs/remix-ui/home-tab/src/lib/components/customNavButtons.tsx @@ -16,7 +16,7 @@ const CustomNavButtons = ({ next, previous, goToSlide, ...rest }) => { className={ ((totalItems - currentSlide) * itemWidth + 5) < containerWidth ? 'disable py-1 border btn' : 'py-1 border btn'} onClick={() => { - if (currentSlide + 1 < totalItems) goToSlide(currentSlide + 1) + if (currentSlide + 1 < totalItems) goToSlide(currentSlide + 1) }} disabled ={((totalItems - currentSlide) * itemWidth + 5) < containerWidth} > diff --git a/libs/remix-ui/home-tab/src/lib/components/homeTabFeaturedPlugins.tsx b/libs/remix-ui/home-tab/src/lib/components/homeTabFeaturedPlugins.tsx index 4b811c89c9..7aeb423957 100644 --- a/libs/remix-ui/home-tab/src/lib/components/homeTabFeaturedPlugins.tsx +++ b/libs/remix-ui/home-tab/src/lib/components/homeTabFeaturedPlugins.tsx @@ -32,13 +32,14 @@ function HomeTabFeaturedPlugins ({plugin}: HomeTabFeaturedPluginsProps) { function isDescendant(parent, child) { let node = child.parentNode; while (node != null) { - if (node === parent) { - return true; - } - node = node.parentNode; + if (node === parent) { + return true; + } + node = node.parentNode; } return false; -} + } + const handleScroll = (e) => { if (isDescendant(carouselRefDiv.current, e.target)) { e.stopPropagation() diff --git a/libs/remix-ui/home-tab/src/lib/components/homeTabGetStarted.tsx b/libs/remix-ui/home-tab/src/lib/components/homeTabGetStarted.tsx index 1c1d43d39c..bea7384767 100644 --- a/libs/remix-ui/home-tab/src/lib/components/homeTabGetStarted.tsx +++ b/libs/remix-ui/home-tab/src/lib/components/homeTabGetStarted.tsx @@ -30,13 +30,14 @@ function HomeTabGetStarted ({plugin}: HomeTabGetStartedProps) { function isDescendant(parent, child) { let node = child.parentNode; while (node != null) { - if (node === parent) { - return true; - } - node = node.parentNode; + if (node === parent) { + return true; + } + node = node.parentNode; } return false; -} + } + const handleScroll = (e) => { if (isDescendant(carouselRefDiv.current, e.target)) { e.stopPropagation() From f573625b6dc5ba25ee14a9bd732187b115618ef4 Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Mon, 12 Sep 2022 23:30:13 +0100 Subject: [PATCH 04/31] add tooltip to runAndDeployAtAddress Button --- .../src/lib/components/contractDropdownUI.tsx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx b/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx index b9eb9fd7c7..9571895a9d 100644 --- a/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx @@ -2,10 +2,10 @@ import React, { useEffect, useRef, useState } from 'react' import { ContractDropdownProps, DeployMode } from '../types' import { ContractData, FuncABI } from '@remix-project/core-plugin' +import { OverlayTrigger, Tooltip } from 'react-bootstrap' // eslint-disable-line import * as ethJSUtil from 'ethereumjs-util' import { ContractGUI } from './contractGUI' import { deployWithProxyMsg, upgradeWithProxyMsg } from '@remix-ui/helper' -import { OverlayTrigger, Tooltip } from 'react-bootstrap' const _paq = window._paq = window._paq || [] export function ContractDropdownUI(props: ContractDropdownProps) { @@ -115,7 +115,6 @@ export function ContractDropdownUI(props: ContractDropdownProps) { const initSelectedContract = () => { const contracts = contractList[currentFile] - if (contracts && contracts.length > 0) { const contract = contracts.find(contract => contract.alias === currentContract) @@ -324,8 +323,14 @@ export function ContractDropdownUI(props: ContractDropdownProps) { }
or
-
- +
+ + {atAddressOptions.title} + + }> + + Date: Tue, 13 Sep 2022 01:28:43 +0100 Subject: [PATCH 05/31] format code in contractDropdownUI. add more tooltips to account component in run and deploy --- .../run-tab/src/lib/components/account.tsx | 21 +++++++++++++++---- .../src/lib/components/contractDropdownUI.tsx | 6 +++--- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/libs/remix-ui/run-tab/src/lib/components/account.tsx b/libs/remix-ui/run-tab/src/lib/components/account.tsx index 1429d8d33a..0dd64facc9 100644 --- a/libs/remix-ui/run-tab/src/lib/components/account.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/account.tsx @@ -3,6 +3,7 @@ import React, { useEffect, useState, useRef } from 'react' import { CopyToClipboard } from '@remix-ui/clipboard' import { AccountProps } from '../types' import { PassphrasePrompt } from './passphrase' +import { OverlayTrigger, Tooltip } from 'react-bootstrap' export function AccountUI (props: AccountProps) { const { selectedAccount, loadedAccounts } = props.accounts @@ -150,9 +151,15 @@ export function AccountUI (props: AccountProps) {
- + + {"Sign a message using this account"} + + }> + +
) diff --git a/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx b/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx index 9571895a9d..a298709e25 100644 --- a/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx @@ -328,9 +328,9 @@ export function ContractDropdownUI(props: ContractDropdownProps) { {atAddressOptions.title} - }> - - + }> + + Date: Tue, 13 Sep 2022 14:21:42 +0100 Subject: [PATCH 06/31] environment info tooltip --- .../run-tab/src/lib/components/environment.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/libs/remix-ui/run-tab/src/lib/components/environment.tsx b/libs/remix-ui/run-tab/src/lib/components/environment.tsx index 3e8b020613..b4a875b1b5 100644 --- a/libs/remix-ui/run-tab/src/lib/components/environment.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/environment.tsx @@ -6,7 +6,7 @@ import { CustomMenu, CustomToggle } from '@remix-ui/helper' import { OverlayTrigger, Tooltip } from 'react-bootstrap' // eslint-disable-line export function EnvironmentUI (props: EnvironmentProps) { - + const handleChangeExEnv = (env: string) => { const provider = props.providers.providerList.find(exEnv => exEnv.value === env) @@ -49,7 +49,7 @@ export function EnvironmentUI (props: EnvironmentProps) { }> - } + } { @@ -67,7 +67,13 @@ export function EnvironmentUI (props: EnvironmentProps) { } - + + {"Click for docs about Environment"} + + }> + +
) From 5b9f62c0a0304392a2fff99c1d24aee679716ece Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Tue, 13 Sep 2022 23:54:20 +0100 Subject: [PATCH 07/31] finished switching native browser tooltips to custom in Run and Deploy Transactions --- .../src/lib/components/contractDropdownUI.tsx | 37 +++++++++++-------- .../src/lib/components/contractGUI.tsx | 18 +++++++-- .../run-tab/src/lib/components/gasPrice.tsx | 9 ++++- .../src/lib/components/recorderCardUI.tsx | 24 +++++++++--- .../run-tab/src/lib/components/value.tsx | 8 +++- 5 files changed, 70 insertions(+), 26 deletions(-) diff --git a/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx b/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx index a298709e25..c8e6c17ffb 100644 --- a/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx @@ -302,22 +302,27 @@ export function ContractDropdownUI(props: ContractDropdownProps) { savedProxyAddress={proxyKey} />
- - + + + {"Publishing the source code and metadata to IPFS facilitates source code verification using Sourcify and will greatly foster contract adoption (auditing, debugging, calling it, etc...)"} + + }> + +
: '' } diff --git a/libs/remix-ui/run-tab/src/lib/components/contractGUI.tsx b/libs/remix-ui/run-tab/src/lib/components/contractGUI.tsx index ad5716f45c..f3cfe6ad15 100644 --- a/libs/remix-ui/run-tab/src/lib/components/contractGUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/contractGUI.tsx @@ -3,6 +3,7 @@ import React, { useEffect, useRef, useState } from 'react' import * as remixLib from '@remix-project/remix-lib' import { ContractGUIProps } from '../types' import { CopyToClipboard } from '@remix-ui/clipboard' +import { OverlayTrigger, Tooltip } from 'react-bootstrap' const txFormat = remixLib.execution.txFormat const txHelper = remixLib.execution.txHelper @@ -235,15 +236,26 @@ export function ContractGUI (props: ContractGUIProps) { return (
0) || (props.funcABI.type === 'fallback') || (props.funcABI.type === 'receive') ? 'udapp_hasArgs' : ''}`}>
- + + {buttonOptions.title} + + }> + + + + {props.funcABI.type === 'fallback' || props.funcABI.type === 'receive' ? `'(${props.funcABI.type}')` : props.inputs} + + }> 0) || (props.funcABI.type === 'fallback') || (props.funcABI.type === 'receive')) ? 'hidden' : 'visible' }} /> +
{ - props.initializerOptions && props.initializerOptions.initializeInputs ? + props.initializerOptions && props.initializerOptions.initializeInputs ? : null diff --git a/libs/remix-ui/run-tab/src/lib/components/gasPrice.tsx b/libs/remix-ui/run-tab/src/lib/components/gasPrice.tsx index a7c5335abd..1dcd3fb57f 100644 --- a/libs/remix-ui/run-tab/src/lib/components/gasPrice.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/gasPrice.tsx @@ -1,5 +1,6 @@ // eslint-disable-next-line no-use-before-define import React from 'react' +import { OverlayTrigger, Tooltip } from 'react-bootstrap' import { GasPriceProps } from '../types' export function GasPriceUI (props: GasPriceProps) { @@ -10,7 +11,13 @@ export function GasPriceUI (props: GasPriceProps) { return (
- + + {"The default gas limit is 3M. Adjust as needed."} + + }> + +
) } diff --git a/libs/remix-ui/run-tab/src/lib/components/recorderCardUI.tsx b/libs/remix-ui/run-tab/src/lib/components/recorderCardUI.tsx index 6108a7f1b8..1716b89ae8 100644 --- a/libs/remix-ui/run-tab/src/lib/components/recorderCardUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/recorderCardUI.tsx @@ -59,19 +59,33 @@ export function RecorderUI (props: RecorderProps) {
- - Save {props.count} transaction{props.count === 1 ? '' : 's'} as scenario file + + + { + props.count === 0 ? 'No transactions to save' + : props.count === 1 ? `Save ${props.count} transaction as scenario file` + : `Save ${props.count} transactions as scenario file` + } + }> - + + + Run transaction(s) from the current scenario file }> - + + +
diff --git a/libs/remix-ui/run-tab/src/lib/components/value.tsx b/libs/remix-ui/run-tab/src/lib/components/value.tsx index 6728639a45..3e23867aee 100644 --- a/libs/remix-ui/run-tab/src/lib/components/value.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/value.tsx @@ -3,6 +3,7 @@ import React, { useEffect, useRef, useState } from 'react' import { BN } from 'ethereumjs-util' import { isNumeric } from '@remix-ui/helper' import { ValueProps } from '../types' +import { OverlayTrigger, Tooltip } from 'react-bootstrap' export function ValueUI (props: ValueProps) { const [sendValue, setSendValue] = useState(props.sendValue) @@ -49,6 +50,11 @@ export function ValueUI (props: ValueProps) {
+ + {"Enter an amount and choose its unit"} + + }> + {buttonOptions.title} }> - + @@ -252,8 +252,8 @@ export function ContractGUI (props: ContractGUIProps) { className="form-control" data-id={props.funcABI.type === 'fallback' || props.funcABI.type === 'receive' ? `'(${props.funcABI.type}')` : 'multiParamManagerBasicInputField'} placeholder={props.inputs} - data-title={props.funcABI.type === 'fallback' || props.funcABI.type === 'receive' ? `'(${props.funcABI.type}')` : props.inputs} onChange={handleBasicInput} + data-title={props.funcABI.type === 'fallback' || props.funcABI.type === 'receive' ? `'(${props.funcABI.type}')` : props.inputs} ref={basicInputRef} style={{ visibility: !((props.funcABI.inputs && props.funcABI.inputs.length > 0) || (props.funcABI.type === 'fallback') || (props.funcABI.type === 'receive')) ? 'hidden' : 'visible' }} /> From a057233e01238869394e3fc7ee4e9f548afcb3b7 Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Thu, 15 Sep 2022 02:05:23 +0100 Subject: [PATCH 11/31] fix e2e firefox --- apps/remix-ide-e2e/src/commands/testConstantFunction.ts | 6 +++--- libs/remix-ui/run-tab/src/lib/components/contractGUI.tsx | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/remix-ide-e2e/src/commands/testConstantFunction.ts b/apps/remix-ide-e2e/src/commands/testConstantFunction.ts index 00f9512814..4893264f13 100644 --- a/apps/remix-ide-e2e/src/commands/testConstantFunction.ts +++ b/apps/remix-ide-e2e/src/commands/testConstantFunction.ts @@ -15,13 +15,13 @@ class TestConstantFunction extends EventEmitter { } function testConstantFunction (browser: NightwatchBrowser, address: string, fnFullName: string, expectedInput: NightwatchTestConstantFunctionExpectedInput, expectedOutput: string, cb: VoidFunction) { - browser.waitForElementPresent('.instance button[title="' + fnFullName + '"]').perform(function (client, done) { + browser.waitForElementPresent('.instance button[data-title="' + fnFullName + '"]').perform(function (client, done) { client.execute(function () { document.querySelector('#runTabView').scrollTop = document.querySelector('#runTabView').scrollHeight }, [], function () { if (expectedInput) { - client.waitForElementPresent('#runTabView input[title="' + expectedInput.types + '"]') - .setValue('#runTabView input[title="' + expectedInput.types + '"]', expectedInput.values) + client.waitForElementPresent('#runTabView input[data-title="' + expectedInput.types + '"]') + .setValue('#runTabView input[data-title="' + expectedInput.types + '"]', expectedInput.values) } done() }) diff --git a/libs/remix-ui/run-tab/src/lib/components/contractGUI.tsx b/libs/remix-ui/run-tab/src/lib/components/contractGUI.tsx index 66311f2a8e..1001521c63 100644 --- a/libs/remix-ui/run-tab/src/lib/components/contractGUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/contractGUI.tsx @@ -241,7 +241,7 @@ export function ContractGUI (props: ContractGUIProps) { {buttonOptions.title} }> - + From 28abd586458bde63c16a1e9844856006ae1db745 Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Fri, 16 Sep 2022 14:00:30 +0100 Subject: [PATCH 12/31] fix e2e --- apps/remix-ide-e2e/src/tests/debugger.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/debugger.test.ts b/apps/remix-ide-e2e/src/tests/debugger.test.ts index 6c8aba64dd..388c93ff08 100644 --- a/apps/remix-ide-e2e/src/tests/debugger.test.ts +++ b/apps/remix-ide-e2e/src/tests/debugger.test.ts @@ -30,8 +30,8 @@ module.exports = { browser.waitForElementVisible('*[data-id="verticalIconsKindudapp"]') .clickLaunchIcon('udapp') .clickInstance(0) - .scrollAndClick('*[title="string name, uint256 goal"]') - .setValue('*[title="string name, uint256 goal"]', '"toast", 999') + .scrollAndClick('*[data-title="string name, uint256 goal"]') + .setValue('*[data-title="string name, uint256 goal"]', '"toast", 999') .click('*[data-id="createProject - transact (not payable)"]') .debugTransaction(0) .pause(2000) From b942f9945d0251ebffbd459c45c741cb5c187dd4 Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Fri, 16 Sep 2022 14:36:45 +0100 Subject: [PATCH 13/31] fix testConstantFunction e2e test --- apps/remix-ide-e2e/src/commands/testConstantFunction.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/remix-ide-e2e/src/commands/testConstantFunction.ts b/apps/remix-ide-e2e/src/commands/testConstantFunction.ts index 4893264f13..3216bc39ed 100644 --- a/apps/remix-ide-e2e/src/commands/testConstantFunction.ts +++ b/apps/remix-ide-e2e/src/commands/testConstantFunction.ts @@ -26,7 +26,7 @@ function testConstantFunction (browser: NightwatchBrowser, address: string, fnFu done() }) }) - .click(`#instance${address} button[title="${fnFullName}"]`) + .click(`#instance${address} button[data-title="${fnFullName}"]`) .pause(1000) .waitForElementPresent('#instance' + address + ' .udapp_contractActionsContainer .udapp_value') .scrollInto('#instance' + address + ' .udapp_contractActionsContainer .udapp_value') From e4c51d6cab4a6f1d98a2ee73fa2ed9c422bba949 Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Fri, 16 Sep 2022 15:04:57 +0100 Subject: [PATCH 14/31] fix tooltip for transaction count --- .../run-tab/src/lib/components/contractDropdownUI.tsx | 4 +++- .../run-tab/src/lib/components/recorderCardUI.tsx | 8 +++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx b/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx index fcfadddd12..462b7a3b62 100644 --- a/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx @@ -334,7 +334,9 @@ export function ContractDropdownUI(props: ContractDropdownProps) { {atAddressOptions.title} }> - + + +
-
{props.count}
+ + {'The number of recorded transactions'} + + }> +
{props.count}
+
Save transactions (deployed contracts and function executions) and replay them in another environment.
e.g Transactions created in Remix VM can be replayed in the Injected Provider. From a90dd199dcc5cf53074a7bac7cbfa377e9716c2b Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Mon, 19 Sep 2022 13:58:02 +0100 Subject: [PATCH 15/31] add data attribute to button --- apps/remix-ide-e2e/src/commands/addAtAddressInstance.ts | 2 +- libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/remix-ide-e2e/src/commands/addAtAddressInstance.ts b/apps/remix-ide-e2e/src/commands/addAtAddressInstance.ts index 86624a900d..ddfadbbe82 100644 --- a/apps/remix-ide-e2e/src/commands/addAtAddressInstance.ts +++ b/apps/remix-ide-e2e/src/commands/addAtAddressInstance.ts @@ -21,7 +21,7 @@ function addInstance (browser: NightwatchBrowser, address: string, isValidFormat .setValue('.ataddressinput', address, function () { if (!isValidFormat || !isValidChecksum) browser.assert.elementPresent('button[id^="runAndDeployAtAdressButton"]:disabled') else if (isAbi) { - browser.click('button[id^="runAndDeployAtAdressButton"]') + browser.click('button[data-id="runAndDeployAtAdressButton"]') .waitForElementPresent('[data-id="udappNotify-modal-footer-ok-react"]') .execute(function () { const modal = document.querySelector('[data-id="udappNotify-modal-footer-ok-react"]') as any diff --git a/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx b/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx index 462b7a3b62..51896848cc 100644 --- a/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx @@ -335,7 +335,7 @@ export function ContractDropdownUI(props: ContractDropdownProps) { }> - +
Date: Tue, 20 Sep 2022 21:08:10 +0100 Subject: [PATCH 16/31] change click command to use css selector locator strategy --- apps/remix-ide-e2e/src/commands/addAtAddressInstance.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/remix-ide-e2e/src/commands/addAtAddressInstance.ts b/apps/remix-ide-e2e/src/commands/addAtAddressInstance.ts index ddfadbbe82..d18102e2ca 100644 --- a/apps/remix-ide-e2e/src/commands/addAtAddressInstance.ts +++ b/apps/remix-ide-e2e/src/commands/addAtAddressInstance.ts @@ -21,7 +21,12 @@ function addInstance (browser: NightwatchBrowser, address: string, isValidFormat .setValue('.ataddressinput', address, function () { if (!isValidFormat || !isValidChecksum) browser.assert.elementPresent('button[id^="runAndDeployAtAdressButton"]:disabled') else if (isAbi) { - browser.click('button[data-id="runAndDeployAtAdressButton"]') + browser + // .click('button[data-id="runAndDeployAtAdressButton"]') + .click({ + locateStrategy: 'css selector', + selector: 'span > button[id="runAndDeployAtAdressButton"]' + }) .waitForElementPresent('[data-id="udappNotify-modal-footer-ok-react"]') .execute(function () { const modal = document.querySelector('[data-id="udappNotify-modal-footer-ok-react"]') as any From 52900bc1f87721ea6b803e76d124646ce7a12596 Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Tue, 20 Sep 2022 22:18:39 +0100 Subject: [PATCH 17/31] fix e2e --- .../src/commands/addAtAddressInstance.ts | 9 ++++-- .../src/lib/components/contractDropdownUI.tsx | 30 +++++++++---------- 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/apps/remix-ide-e2e/src/commands/addAtAddressInstance.ts b/apps/remix-ide-e2e/src/commands/addAtAddressInstance.ts index d18102e2ca..e95ea43179 100644 --- a/apps/remix-ide-e2e/src/commands/addAtAddressInstance.ts +++ b/apps/remix-ide-e2e/src/commands/addAtAddressInstance.ts @@ -22,10 +22,13 @@ function addInstance (browser: NightwatchBrowser, address: string, isValidFormat if (!isValidFormat || !isValidChecksum) browser.assert.elementPresent('button[id^="runAndDeployAtAdressButton"]:disabled') else if (isAbi) { browser - // .click('button[data-id="runAndDeployAtAdressButton"]') + .isVisible({ + selector: '//span[@data-id="runAndDeployAtAddressButton"]', + locateStrategy: 'xpath' + }) .click({ - locateStrategy: 'css selector', - selector: 'span > button[id="runAndDeployAtAdressButton"]' + selector: '//button[@data-id="runAndDeployAtAdressButton"]', + locateStrategy: 'xpath' }) .waitForElementPresent('[data-id="udappNotify-modal-footer-ok-react"]') .execute(function () { diff --git a/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx b/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx index 51896848cc..6596d1e126 100644 --- a/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx @@ -302,14 +302,14 @@ export function ContractDropdownUI(props: ContractDropdownProps) { savedProxyAddress={proxyKey} />
- + {"Publishing the source code and metadata to IPFS facilitates source code verification using Sourcify and will greatly foster contract adoption (auditing, debugging, calling it, etc...)"} @@ -330,13 +330,13 @@ export function ContractDropdownUI(props: ContractDropdownProps) {
or
- {atAddressOptions.title} - - }> - - - + + {atAddressOptions.title} + + }> + + + Date: Tue, 20 Sep 2022 22:39:09 +0100 Subject: [PATCH 18/31] fix element props for e2e --- apps/remix-ide-e2e/src/commands/addAtAddressInstance.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/remix-ide-e2e/src/commands/addAtAddressInstance.ts b/apps/remix-ide-e2e/src/commands/addAtAddressInstance.ts index e95ea43179..e7d1eb4b10 100644 --- a/apps/remix-ide-e2e/src/commands/addAtAddressInstance.ts +++ b/apps/remix-ide-e2e/src/commands/addAtAddressInstance.ts @@ -27,7 +27,7 @@ function addInstance (browser: NightwatchBrowser, address: string, isValidFormat locateStrategy: 'xpath' }) .click({ - selector: '//button[@data-id="runAndDeployAtAdressButton"]', + selector: '//button[@id="runAndDeployAtAdressButton"]', locateStrategy: 'xpath' }) .waitForElementPresent('[data-id="udappNotify-modal-footer-ok-react"]') From 468db78a6581862aad1a2dc5f753a1054873743d Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Tue, 20 Sep 2022 23:17:57 +0100 Subject: [PATCH 19/31] change click command --- apps/remix-ide-e2e/src/commands/addAtAddressInstance.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/apps/remix-ide-e2e/src/commands/addAtAddressInstance.ts b/apps/remix-ide-e2e/src/commands/addAtAddressInstance.ts index e7d1eb4b10..2cef412369 100644 --- a/apps/remix-ide-e2e/src/commands/addAtAddressInstance.ts +++ b/apps/remix-ide-e2e/src/commands/addAtAddressInstance.ts @@ -26,10 +26,7 @@ function addInstance (browser: NightwatchBrowser, address: string, isValidFormat selector: '//span[@data-id="runAndDeployAtAddressButton"]', locateStrategy: 'xpath' }) - .click({ - selector: '//button[@id="runAndDeployAtAdressButton"]', - locateStrategy: 'xpath' - }) + .click('//button[@id="runAndDeployAtAdressButton"]') .waitForElementPresent('[data-id="udappNotify-modal-footer-ok-react"]') .execute(function () { const modal = document.querySelector('[data-id="udappNotify-modal-footer-ok-react"]') as any From 87bc37c5c78ed989995a21ae28e53ebdd9265f82 Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Tue, 20 Sep 2022 23:28:32 +0100 Subject: [PATCH 20/31] more e2e changes --- apps/remix-ide-e2e/src/commands/addAtAddressInstance.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/apps/remix-ide-e2e/src/commands/addAtAddressInstance.ts b/apps/remix-ide-e2e/src/commands/addAtAddressInstance.ts index 2cef412369..30300e8ac0 100644 --- a/apps/remix-ide-e2e/src/commands/addAtAddressInstance.ts +++ b/apps/remix-ide-e2e/src/commands/addAtAddressInstance.ts @@ -21,11 +21,7 @@ function addInstance (browser: NightwatchBrowser, address: string, isValidFormat .setValue('.ataddressinput', address, function () { if (!isValidFormat || !isValidChecksum) browser.assert.elementPresent('button[id^="runAndDeployAtAdressButton"]:disabled') else if (isAbi) { - browser - .isVisible({ - selector: '//span[@data-id="runAndDeployAtAddressButton"]', - locateStrategy: 'xpath' - }) + browser.useXpath() .click('//button[@id="runAndDeployAtAdressButton"]') .waitForElementPresent('[data-id="udappNotify-modal-footer-ok-react"]') .execute(function () { From d7de3c9859b51db98b58765cb4b033b4b086be60 Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Wed, 21 Sep 2022 00:30:07 +0100 Subject: [PATCH 21/31] remove surrounding span --- libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx b/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx index 6596d1e126..33ba5395a7 100644 --- a/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx @@ -334,9 +334,7 @@ export function ContractDropdownUI(props: ContractDropdownProps) { {atAddressOptions.title} }> - - Date: Wed, 21 Sep 2022 00:56:41 +0100 Subject: [PATCH 22/31] remove overlay required pointerevent aleration --- libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx b/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx index 33ba5395a7..7eadbc7f93 100644 --- a/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx @@ -334,7 +334,7 @@ export function ContractDropdownUI(props: ContractDropdownProps) { {atAddressOptions.title} }> - + Date: Wed, 21 Sep 2022 14:29:52 +0100 Subject: [PATCH 23/31] more tooltips --- .../src/commands/addAtAddressInstance.ts | 2 +- .../src/lib/components/contractGUI.tsx | 300 +++++++++++++----- .../src/lib/components/universalDappUI.tsx | 163 +++++++--- 3 files changed, 340 insertions(+), 125 deletions(-) diff --git a/apps/remix-ide-e2e/src/commands/addAtAddressInstance.ts b/apps/remix-ide-e2e/src/commands/addAtAddressInstance.ts index 30300e8ac0..1c8c32ec75 100644 --- a/apps/remix-ide-e2e/src/commands/addAtAddressInstance.ts +++ b/apps/remix-ide-e2e/src/commands/addAtAddressInstance.ts @@ -23,7 +23,7 @@ function addInstance (browser: NightwatchBrowser, address: string, isValidFormat else if (isAbi) { browser.useXpath() .click('//button[@id="runAndDeployAtAdressButton"]') - .waitForElementPresent('[data-id="udappNotify-modal-footer-ok-react"]') + .waitForElementPresent('[data-id="udappNotify-modal-footer-ok-react"]', 5000) .execute(function () { const modal = document.querySelector('[data-id="udappNotify-modal-footer-ok-react"]') as any diff --git a/libs/remix-ui/run-tab/src/lib/components/contractGUI.tsx b/libs/remix-ui/run-tab/src/lib/components/contractGUI.tsx index 1001521c63..0237665932 100644 --- a/libs/remix-ui/run-tab/src/lib/components/contractGUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/contractGUI.tsx @@ -234,78 +234,179 @@ export function ContractGUI (props: ContractGUIProps) { } return ( -
0) || (props.funcABI.type === 'fallback') || (props.funcABI.type === 'receive') ? 'udapp_hasArgs' : ''}`}> -
- - {buttonOptions.title} - - }> - +
0) || + props.funcABI.type === "fallback" || + props.funcABI.type === "receive" + ? "udapp_hasArgs" + : "" + }`} + > +
+ + {buttonOptions.title} + + } + > + - - {props.funcABI.type === 'fallback' || props.funcABI.type === 'receive' ? `'(${props.funcABI.type}')` : props.inputs} - - }> - 0) || (props.funcABI.type === 'fallback') || (props.funcABI.type === 'receive')) ? 'hidden' : 'visible' }} /> + + + {props.funcABI.type === "fallback" || + props.funcABI.type === "receive" + ? `'(${props.funcABI.type}')` + : props.inputs} + + + } + > + 0) || + props.funcABI.type === "fallback" || + props.funcABI.type === "receive" + ) + ? "hidden" + : "visible", + }} + /> 0) ? 'hidden' : 'visible' }}> + style={{ + visibility: !( + props.funcABI.inputs && props.funcABI.inputs.length > 0 + ) + ? "hidden" + : "visible", + }} + >
-
+
-
{title}
- +
+ {title} +
+
{props.funcABI.inputs.map((inp, index) => { return (
- { multiFields.current[index] = el }} className="form-control" placeholder={inp.type} title={inp.name} data-id={`multiParamManagerInput${inp.name}`} /> -
) + { + multiFields.current[index] = el; + }} + className="form-control" + placeholder={inp.type} + title={inp.name} + data-id={`multiParamManagerInput${inp.name}`} + /> +
+ ); })}
- + - + - + +
- { props.deployOption && (props.deployOption || []).length > 0 ? + {props.deployOption && (props.deployOption || []).length > 0 ? ( <> -
+
- { - props.initializerOptions && props.initializerOptions.initializeInputs ? + {props.initializerOptions && + props.initializerOptions.initializeInputs ? ( - - : null - } + + + ) : null}
- { - props.initializerOptions && props.initializerOptions.initializeInputs ? -
-
{ - props.initializerOptions.inputs.inputs.map((inp, index) => { - return ( -
- - { initializeFields.current[index] = el }} style={{ height: 32 }} className="form-control udapp_input" placeholder={inp.type} title={inp.name} /> -
- )}) - } -
-
: null - } -
+ {props.initializerOptions && + props.initializerOptions.initializeInputs ? ( +
+
+ {props.initializerOptions.inputs.inputs.map((inp, index) => { + return ( +
+ + { + initializeFields.current[index] = el; + }} + style={{ height: 32 }} + className="form-control udapp_input" + placeholder={inp.type} + title={inp.name} + /> +
+ ); + })} +
+
+ ) : null} +
- +
-
+
- { - !useLastProxy ? + {!useLastProxy ? (
- - -
: - { proxyAddress || 'No proxy address available' } - } + + +
+ ) : ( + + {proxyAddress || "No proxy address available"} + + )}
- : null - } + + ) : null}
- ) + ); } diff --git a/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx b/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx index 4c2deaebcb..10035c787c 100644 --- a/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx @@ -7,6 +7,7 @@ import * as remixLib from '@remix-project/remix-lib' import * as ethJSUtil from 'ethereumjs-util' import { ContractGUI } from './contractGUI' import { TreeView, TreeViewItem } from '@remix-ui/tree-view' +import { OverlayTrigger, Tooltip } from 'react-bootstrap' // eslint-disable-line import { BN } from 'ethereumjs-util' import { is0XPrefixed, isHexadecimal, isNumeric, shortenAddress } from '@remix-ui/helper' @@ -210,19 +211,37 @@ export function UniversalDappUI (props: UdappProps) { } return ( -
+
- - + +
- {props.instance.name} at {shortenAddress(address)} ({props.context}) + {props.instance.name} at {shortenAddress(address)} ( + {props.context})
- +
-
+
-
- -
- { - contractABI && contractABI.map((funcABI, index) => { - if (funcABI.type !== 'function') return null - const isConstant = funcABI.constant !== undefined ? funcABI.constant : false - const lookupOnly = funcABI.stateMutability === 'view' || funcABI.stateMutability === 'pure' || isConstant - const inputs = props.getFuncABIInputs(funcABI) +
+ +
+ {contractABI && + contractABI.map((funcABI, index) => { + if (funcABI.type !== "function") return null; + const isConstant = + funcABI.constant !== undefined ? funcABI.constant : false; + const lookupOnly = + funcABI.stateMutability === "view" || + funcABI.stateMutability === "pure" || + isConstant; + const inputs = props.getFuncABIInputs(funcABI); - return
- { - runTransaction(lookupOnly, funcABI, valArray, inputsValues, index) - }} - inputs={inputs} - evmBC={evmBC} - lookupOnly={lookupOnly} - key={index} - /> -
- - { - Object.keys(props.instance.decodedResponse || {}).map((key) => { - const funcIndex = index.toString() - const response = props.instance.decodedResponse[key] + return ( +
+ { + runTransaction( + lookupOnly, + funcABI, + valArray, + inputsValues, + index + ); + }} + inputs={inputs} + evmBC={evmBC} + lookupOnly={lookupOnly} + key={index} + /> +
+ + {Object.keys(props.instance.decodedResponse || {}).map( + (key) => { + const funcIndex = index.toString(); + const response = props.instance.decodedResponse[key]; - return key === funcIndex ? Object.keys(response || {}).map((innerkey, index) => { - return renderData(props.instance.decodedResponse[key][innerkey], response, innerkey, innerkey) - }) : null - }) - } - + return key === funcIndex + ? Object.keys(response || {}).map( + (innerkey, index) => { + return renderData( + props.instance.decodedResponse[key][ + innerkey + ], + response, + innerkey, + innerkey + ); + } + ) + : null; + } + )} + +
-
- }) - } + ); + })}
- +
- +
- ) + ); } From 020ec4b3419b3286b480fbf0ededf8698e62f796 Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Wed, 21 Sep 2022 14:52:29 +0100 Subject: [PATCH 24/31] restore previous changes after conflict resolution --- apps/remix-ide-e2e/src/tests/debugger.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/debugger.test.ts b/apps/remix-ide-e2e/src/tests/debugger.test.ts index 388c93ff08..a53720996c 100644 --- a/apps/remix-ide-e2e/src/tests/debugger.test.ts +++ b/apps/remix-ide-e2e/src/tests/debugger.test.ts @@ -19,7 +19,7 @@ module.exports = { .clickLaunchIcon('solidity').click('*[data-id="compilerContainerCompileBtn"]') .pause(4000) .clickLaunchIcon('udapp') - .waitForElementPresent('*[title="Deploy - transact (not payable)"]', 60000) + .waitForElementPresent('*[data-title="Deploy - transact (not payable)"]', 60000) .click('*[title="Deploy - transact (not payable)"]') .debugTransaction(0) .waitForElementContainsText('*[data-id="sidePanelSwapitTitle"]', 'DEBUGGER', 60000) @@ -159,7 +159,7 @@ module.exports = { .clickLaunchIcon('solidity') .testContracts('locals.sol', sources[3]['locals.sol'], ['testLocals']) .clickLaunchIcon('udapp') - .waitForElementPresent('*[title="Deploy - transact (not payable)"]', 40000) + .waitForElementPresent('*[data-title="Deploy - transact (not payable)"]', 40000) .createContract('') .pause(2000) .clearConsole() From d7f32d336943cf00731effd3d3682b8448e31794 Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Wed, 21 Sep 2022 15:49:06 +0100 Subject: [PATCH 25/31] fix debugger test --- apps/remix-ide-e2e/src/tests/debugger.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/remix-ide-e2e/src/tests/debugger.test.ts b/apps/remix-ide-e2e/src/tests/debugger.test.ts index a53720996c..8d27cb9ed4 100644 --- a/apps/remix-ide-e2e/src/tests/debugger.test.ts +++ b/apps/remix-ide-e2e/src/tests/debugger.test.ts @@ -88,7 +88,7 @@ module.exports = { .clickLaunchIcon('solidity') .testContracts('externalImport.sol', sources[1]['externalImport.sol'], ['ERC20']) .clickLaunchIcon('udapp') - .waitForElementPresent('*[title="Deploy - transact (not payable)"]', 35000) + .waitForElementPresent('*[data-title="Deploy - transact (not payable)"]', 35000) .selectContract('ERC20') .createContract('"tokenName", "symbol"') .debugTransaction(0) From a562af16569ea36b6a5cfec50d5e7f7fb0abd096 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Wed, 21 Sep 2022 21:59:34 +0200 Subject: [PATCH 26/31] Update addAtAddressInstance.ts --- apps/remix-ide-e2e/src/commands/addAtAddressInstance.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/remix-ide-e2e/src/commands/addAtAddressInstance.ts b/apps/remix-ide-e2e/src/commands/addAtAddressInstance.ts index 1c8c32ec75..f19cead596 100644 --- a/apps/remix-ide-e2e/src/commands/addAtAddressInstance.ts +++ b/apps/remix-ide-e2e/src/commands/addAtAddressInstance.ts @@ -21,8 +21,11 @@ function addInstance (browser: NightwatchBrowser, address: string, isValidFormat .setValue('.ataddressinput', address, function () { if (!isValidFormat || !isValidChecksum) browser.assert.elementPresent('button[id^="runAndDeployAtAdressButton"]:disabled') else if (isAbi) { - browser.useXpath() - .click('//button[@id="runAndDeployAtAdressButton"]') + browser + .click({ + selector:'//button[@id="runAndDeployAtAdressButton"]', + locateStrategy: 'xpath' + }) .waitForElementPresent('[data-id="udappNotify-modal-footer-ok-react"]', 5000) .execute(function () { const modal = document.querySelector('[data-id="udappNotify-modal-footer-ok-react"]') as any From e417d6255a1098762cee791320d7637fd2f3772c Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Thu, 22 Sep 2022 01:41:38 +0100 Subject: [PATCH 27/31] fix debugTransactions command failing e2e --- apps/remix-ide-e2e/src/tests/debugger.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/remix-ide-e2e/src/tests/debugger.test.ts b/apps/remix-ide-e2e/src/tests/debugger.test.ts index 8d27cb9ed4..56965e31a9 100644 --- a/apps/remix-ide-e2e/src/tests/debugger.test.ts +++ b/apps/remix-ide-e2e/src/tests/debugger.test.ts @@ -20,7 +20,7 @@ module.exports = { .pause(4000) .clickLaunchIcon('udapp') .waitForElementPresent('*[data-title="Deploy - transact (not payable)"]', 60000) - .click('*[title="Deploy - transact (not payable)"]') + .click('*[data-title="Deploy - transact (not payable)"]') .debugTransaction(0) .waitForElementContainsText('*[data-id="sidePanelSwapitTitle"]', 'DEBUGGER', 60000) .clearConsole() From bfc4c14795120603872c7aa66f0b038657def058 Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Mon, 17 Oct 2022 22:54:20 +0100 Subject: [PATCH 28/31] address review comments --- .../src/lib/components/contractDropdownUI.tsx | 40 ++++++++++++----- .../src/lib/components/universalDappUI.tsx | 44 +++++++++++++------ 2 files changed, 60 insertions(+), 24 deletions(-) diff --git a/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx b/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx index 7eadbc7f93..a128fc1cf4 100644 --- a/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx @@ -275,13 +275,25 @@ export function ContractDropdownUI(props: ContractDropdownProps) { : null}
- {(contractList[currentFile] || []).map((contract, index) => { return })} + {abiLabel.content}
@@ -329,20 +341,28 @@ export function ContractDropdownUI(props: ContractDropdownProps) {
or
- {atAddressOptions.title} }> - +
+ +
+
+ + {"address of contract"} + + }> + -
diff --git a/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx b/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx index 10035c787c..a144be38b8 100644 --- a/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx @@ -347,21 +347,37 @@ export function UniversalDappUI (props: UdappProps) {
- - + + + + Send data to contract. + + } + > + +
From dfa4c14789aaed4493368de42fc1c9f702b1ec0d Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Tue, 18 Oct 2022 00:25:35 +0100 Subject: [PATCH 29/31] finish addressing review comments --- .../src/lib/components/contractDropdownUI.tsx | 4 +- .../src/lib/components/contractGUI.tsx | 30 +++++++++------ .../src/lib/components/deployButton.tsx | 17 +++++++-- .../src/lib/components/deployInput.tsx | 28 +++++++++----- .../lib/components/instanceContainerUI.tsx | 37 +++++++++++++++---- .../src/lib/components/multiDeployInput.tsx | 12 +++++- .../src/lib/components/universalDappUI.tsx | 22 +++++++---- 7 files changed, 108 insertions(+), 42 deletions(-) diff --git a/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx b/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx index a128fc1cf4..a4b9cbc23d 100644 --- a/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx @@ -323,8 +323,8 @@ export function ContractDropdownUI(props: ContractDropdownProps) { checked={props.ipfsCheckedState} /> - {"Publishing the source code and metadata to IPFS facilitates source code verification using Sourcify and will greatly foster contract adoption (auditing, debugging, calling it, etc...)"} + + Publishing the source code and metadata to IPFS facilitates source code verification
using Sourcify and will greatly foster contract adoption (auditing, debugging, calling it, etc...)
}>
- + +
Date: Wed, 19 Oct 2022 12:27:52 +0100 Subject: [PATCH 30/31] fix ballot e2e --- apps/remix-ide-e2e/src/commands/addAtAddressInstance.ts | 2 +- libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/remix-ide-e2e/src/commands/addAtAddressInstance.ts b/apps/remix-ide-e2e/src/commands/addAtAddressInstance.ts index f19cead596..efe876f1c0 100644 --- a/apps/remix-ide-e2e/src/commands/addAtAddressInstance.ts +++ b/apps/remix-ide-e2e/src/commands/addAtAddressInstance.ts @@ -23,7 +23,7 @@ function addInstance (browser: NightwatchBrowser, address: string, isValidFormat else if (isAbi) { browser .click({ - selector:'//button[@id="runAndDeployAtAdressButton"]', + selector: '//*[@id="runAndDeployAtAdressButtonContaner"]', locateStrategy: 'xpath' }) .waitForElementPresent('[data-id="udappNotify-modal-footer-ok-react"]', 5000) diff --git a/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx b/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx index a4b9cbc23d..20fa74da86 100644 --- a/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx @@ -346,7 +346,7 @@ export function ContractDropdownUI(props: ContractDropdownProps) { {atAddressOptions.title} }> -
+
From dd96c0776b4f6509437967d1c8c33a5dfcd6de2e Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Wed, 19 Oct 2022 14:28:50 +0100 Subject: [PATCH 31/31] switch to xpath selector for e2e --- apps/remix-ide-e2e/src/commands/addAtAddressInstance.ts | 7 +++++-- .../run-tab/src/lib/components/contractDropdownUI.tsx | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/apps/remix-ide-e2e/src/commands/addAtAddressInstance.ts b/apps/remix-ide-e2e/src/commands/addAtAddressInstance.ts index efe876f1c0..48270c6b9b 100644 --- a/apps/remix-ide-e2e/src/commands/addAtAddressInstance.ts +++ b/apps/remix-ide-e2e/src/commands/addAtAddressInstance.ts @@ -23,7 +23,7 @@ function addInstance (browser: NightwatchBrowser, address: string, isValidFormat else if (isAbi) { browser .click({ - selector: '//*[@id="runAndDeployAtAdressButtonContaner"]', + selector: '//*[@id="runAndDeployAtAdressButtonContainer"]', locateStrategy: 'xpath' }) .waitForElementPresent('[data-id="udappNotify-modal-footer-ok-react"]', 5000) @@ -33,7 +33,10 @@ function addInstance (browser: NightwatchBrowser, address: string, isValidFormat modal.click() }) } else { - browser.click('button[id^="runAndDeployAtAdressButton"]') + browser.click({ + selector: '//*[@id="runAndDeployAtAdressButtonContainer"]', + locateStrategy: 'xpath' + }) } callback() }) diff --git a/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx b/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx index 20fa74da86..0d5ad43701 100644 --- a/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx @@ -346,7 +346,7 @@ export function ContractDropdownUI(props: ContractDropdownProps) { {atAddressOptions.title} }> -
+