Minor fixes

pull/5370/head
David Disu 3 years ago
parent 7e325e7be6
commit ddef85d6f3
  1. 2
      libs/remix-core-plugin/src/lib/constants/uups.ts
  2. 2
      libs/remix-core-plugin/src/lib/openzeppelin-proxy.ts
  3. 2
      libs/remix-ui/run-tab/src/lib/components/deployButton.tsx
  4. 8
      libs/remix-ui/run-tab/src/lib/components/universalDappUI.tsx

File diff suppressed because one or more lines are too long

@ -18,7 +18,7 @@ export class OpenZeppelinProxy extends Plugin {
async isConcerned(ast: ContractAST = {} as ContractAST) { async isConcerned(ast: ContractAST = {} as ContractAST) {
// check in the AST if it's an upgradable contract // check in the AST if it's an upgradable contract
if (ast.nodes && ast.nodes.find(node => node.absolutePath === UUPS)) { if (ast.nodes && ast.nodes.find(node => node.absolutePath && node.absolutePath.includes(UUPS))) {
this.kind = 'UUPS' this.kind = 'UUPS'
return true return true
} }

@ -12,7 +12,7 @@ export function DeployButton (props: DeployButtonProps) {
return ( return (
<> <>
{ props.deployOptions && (props.deployOptions || []).length > 0 ? { props.deployOptions && (props.deployOptions || []).length > 0 ?
<Dropdown as={ButtonGroup} autoClose="outside"> <Dropdown as={ButtonGroup}>
<button onClick={props.handleActionClick} title={props.buttonOptions.title} className={`udapp_instanceButton ${props.buttonOptions.widthClass} btn btn-sm ${props.buttonOptions.classList}`} data-id={props.buttonOptions.dataId}>{ props.deployOptions[props.selectedIndex] ? props.deployOptions[props.selectedIndex].title : 'Deploy' }</button> <button onClick={props.handleActionClick} title={props.buttonOptions.title} className={`udapp_instanceButton ${props.buttonOptions.widthClass} btn btn-sm ${props.buttonOptions.classList}`} data-id={props.buttonOptions.dataId}>{ props.deployOptions[props.selectedIndex] ? props.deployOptions[props.selectedIndex].title : 'Deploy' }</button>
<Dropdown.Toggle split id="dropdown-split-basic" className={`btn btn-sm dropdown-toggle dropdown-toggle-split ${props.buttonOptions.classList}`} style={{ maxWidth: 25, minWidth: 0, height: 32 }} /> <Dropdown.Toggle split id="dropdown-split-basic" className={`btn btn-sm dropdown-toggle dropdown-toggle-split ${props.buttonOptions.classList}`} style={{ maxWidth: 25, minWidth: 0, height: 32 }} />
<Dropdown.Menu className="deploy-items border-0"> <Dropdown.Menu className="deploy-items border-0">

@ -183,7 +183,7 @@ export function UniversalDappUI (props: UdappProps) {
const renderData = (item, parent, key: string | number, keyPath: string) => { const renderData = (item, parent, key: string | number, keyPath: string) => {
const data = extractDataDefault(item, parent) const data = extractDataDefault(item, parent)
const children = (data.children || []).map((child) => { const children = (data.children || []).map((child, index) => {
return ( return (
renderData(child.value, data, child.key, keyPath + '/' + child.key) renderData(child.value, data, child.key, keyPath + '/' + child.key)
) )
@ -236,7 +236,7 @@ export function UniversalDappUI (props: UdappProps) {
const lookupOnly = funcABI.stateMutability === 'view' || funcABI.stateMutability === 'pure' || isConstant const lookupOnly = funcABI.stateMutability === 'view' || funcABI.stateMutability === 'pure' || isConstant
const inputs = props.getFuncABIInputs(funcABI) const inputs = props.getFuncABIInputs(funcABI)
return <> return <div key={index}>
<ContractGUI <ContractGUI
funcABI={funcABI} funcABI={funcABI}
clickCallBack={(valArray: { name: string, type: string }[], inputsValues: string) => { clickCallBack={(valArray: { name: string, type: string }[], inputsValues: string) => {
@ -254,14 +254,14 @@ export function UniversalDappUI (props: UdappProps) {
const funcIndex = index.toString() const funcIndex = index.toString()
const response = props.instance.decodedResponse[key] const response = props.instance.decodedResponse[key]
return key === funcIndex ? Object.keys(response || {}).map((innerkey) => { return key === funcIndex ? Object.keys(response || {}).map((innerkey, index) => {
return renderData(props.instance.decodedResponse[key][innerkey], response, innerkey, innerkey) return renderData(props.instance.decodedResponse[key][innerkey], response, innerkey, innerkey)
}) : null }) : null
}) })
} }
</TreeView> </TreeView>
</div> </div>
</> </div>
}) })
} }
</div> </div>

Loading…
Cancel
Save