Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
1cc3bc4f
Commit
1cc3bc4f
authored
Aug 14, 2019
by
LianaHus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleaned up the code and added statemutability check
parent
ae158040
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
46 deletions
+28
-46
run-tab-styles.js
src/app/tabs/styles/run-tab-styles.js
+0
-12
multiParamManager.js
src/app/ui/multiParamManager.js
+28
-34
No files found.
src/app/tabs/styles/run-tab-styles.js
View file @
1cc3bc4f
...
@@ -158,18 +158,6 @@ var css = csjs`
...
@@ -158,18 +158,6 @@ var css = csjs`
display: flex;
display: flex;
align-items: center;
align-items: center;
}
}
.transact {
color: var(--warning);
margin-right: .3em;
}
.payable {
color: var(--warning);
margin-right: .3em;
}
.call {
color: var(--info);
margin-right: .3em;
}
.pendingContainer {
.pendingContainer {
display: flex;
display: flex;
align-items: baseline;
align-items: baseline;
...
...
src/app/ui/multiParamManager.js
View file @
1cc3bc4f
...
@@ -124,15 +124,10 @@ class MultiParamManager {
...
@@ -124,15 +124,10 @@ class MultiParamManager {
var
onClick
=
(
domEl
)
=>
{
var
onClick
=
(
domEl
)
=>
{
this
.
clickCallBack
(
this
.
funABI
.
inputs
,
this
.
basicInputField
.
value
)
this
.
clickCallBack
(
this
.
funABI
.
inputs
,
this
.
basicInputField
.
value
)
}
}
// TODO: if this is a lookup only make this button btn-info
let
funcButton
=
yo
`<button onclick=
${()
=>
onClick
()}
class="
${
css
.
instanceButton
}
btn btn-sm">
${
title
}
</button>`
// otherwise it needs to have btn-warning injected
// or do we need to only do this in 1 place - I have a feeling that this will happen in multiple places
this
.
contractActionsContainerSingle
=
yo
`
this
.
contractActionsContainerSingle
=
yo
`
<div class="
${
css
.
contractActionsContainerSingle
}
" >
<div class="
${
css
.
contractActionsContainerSingle
}
" >
<button onclick=
${()
=>
onClick
()}
class="
${
css
.
instanceButton
}
btn btn-sm">
${
funcButton
}
${
title
}
</button>
${
this
.
basicInputField
}
${
this
.
basicInputField
}
<i class="fas fa-angle-down
${
css
.
methCaret
}
" onclick=
${()
=>
this
.
switchMethodViewOn
()}
title=
${
title
}
></i>
<i class="fas fa-angle-down
${
css
.
methCaret
}
" onclick=
${()
=>
this
.
switchMethodViewOn
()}
title=
${
title
}
></i>
</div>`
</div>`
...
@@ -148,7 +143,7 @@ class MultiParamManager {
...
@@ -148,7 +143,7 @@ class MultiParamManager {
}
}
}
}
var
b
utton
=
yo
`<button onclick=
${()
=>
{
multiOnClick
()
}}
class
=
"${css.instanceButton}"
><
/button>
`
var
expandedB
utton
=
yo
`<button onclick=
${()
=>
{
multiOnClick
()
}}
class
=
"${css.instanceButton}"
><
/button>
`
this
.
contractActionsContainerMulti
=
yo
`<div class="
${
css
.
contractActionsContainerMulti
}
" >
this
.
contractActionsContainerMulti
=
yo
`<div class="
${
css
.
contractActionsContainerMulti
}
" >
<div class="
${
css
.
contractActionsContainerMultiInner
}
text-dark" >
<div class="
${
css
.
contractActionsContainerMultiInner
}
text-dark" >
...
@@ -158,7 +153,7 @@ class MultiParamManager {
...
@@ -158,7 +153,7 @@ class MultiParamManager {
</div>
</div>
${
this
.
multiFields
}
${
this
.
multiFields
}
<div class="
${
css
.
group
}
${
css
.
multiArg
}
" >
<div class="
${
css
.
group
}
${
css
.
multiArg
}
" >
${
b
utton
}
${
expandedB
utton
}
${
copyToClipboard
(
${
copyToClipboard
(
()
=>
{
()
=>
{
var
multiString
=
this
.
getMultiValsString
()
var
multiString
=
this
.
getMultiValsString
()
...
@@ -179,19 +174,32 @@ class MultiParamManager {
...
@@ -179,19 +174,32 @@ class MultiParamManager {
<
/div
>
<
/div
>
<
/div>
`
<
/div>
`
var
contractProperty
=
yo
`<div class="
${
css
.
contractProperty
}
">
${
this
.
contractActionsContainerSingle
}
${
this
.
contractActionsContainerMulti
}
</div>`
var
contractProperty
=
yo
`
// TODO: add class for btn-info to the button and remove stuff from the class
<div class="
${
css
.
contractProperty
}
">
${
this
.
contractActionsContainerSingle
}
${
this
.
contractActionsContainerMulti
}
</div>
`
if
(
this
.
lookupOnly
)
{
if
(
this
.
lookupOnly
)
{
contractProperty
.
classList
.
add
(
css
.
constant
)
// call. stateMutability is either pure or view
button
.
setAttribute
(
'title'
,
(
title
+
' - call'
))
expandedButton
.
setAttribute
(
'title'
,
(
title
+
' - call'
))
button
.
innerHTML
=
'call'
expandedButton
.
innerHTML
=
'call'
this
.
contractActionsContainerSingle
.
querySelector
(
`.
${
css
.
instanceButton
}
`
).
setAttribute
(
'title'
,
(
title
+
' - call'
))
expandedButton
.
classList
.
add
(
'btn-info'
)
this
.
contractActionsContainerSingle
.
querySelector
(
`.
${
css
.
instanceButton
}
`
).
classList
.
add
(
'btn-info'
)
funcButton
.
setAttribute
(
'title'
,
(
title
+
' - call'
))
button
.
classList
.
add
(
'btn-info'
)
funcButton
.
classList
.
add
(
'btn-info'
)
}
else if (this.funABI.stateMutability === 'payable' || this.funABI.payable === true) {
// transact. stateMutability = payable
expandedButton.setAttribute('title', (title + ' - transact (payable)'))
expandedButton.innerHTML = 'transact'
expandedButton.classList.add('btn-danger')
funcButton.setAttribute('title', (title + ' - transact (payable)'))
funcButton.classList.add('btn-danger')
} else {
} else {
this.contractActionsContainerSingle.querySelector(`
.
$
{
css
.
instanceButton
}
`
).
classList
.
add
(
'btn-warning'
)
// transact. stateMutability = not payable
button
.
innerHTML
=
'transact'
expandedButton.setAttribute('title', (title + ' - transact (not payable)'))
button
.
classList
.
add
(
'btn-warning'
)
expandedButton.innerHTML = 'transact'
expandedButton.classList.add('btn-warning')
funcButton.classList.add('btn-warning')
funcButton.setAttribute('title', (title + ' - transact (not payable)'))
}
}
if (this.funABI.inputs && this.funABI.inputs.length > 0) {
if (this.funABI.inputs && this.funABI.inputs.length > 0) {
...
@@ -204,20 +212,6 @@ class MultiParamManager {
...
@@ -204,20 +212,6 @@ class MultiParamManager {
this.basicInputField.style.visibility = 'hidden'
this.basicInputField.style.visibility = 'hidden'
}
}
if
(
this
.
funABI
.
payable
===
true
)
{
contractProperty
.
classList
.
add
(
css
.
payable
)
button
.
setAttribute
(
'title'
,
(
title
+
' - transact (payable)'
))
let
funButton
=
this
.
contractActionsContainerSingle
.
querySelector
(
'button'
)
funButton
.
setAttribute
(
'title'
,
(
title
+
' - transact (payable)'
))
funButton
.
classList
.
add
(
'btn-danger'
)
button
.
classList
.
add
(
'btn-danger'
)
}
if
(
!
this
.
lookupOnly
&&
this
.
funABI
.
payable
===
false
)
{
button
.
setAttribute
(
'title'
,
(
title
+
' - transact (not payable)'
))
this
.
contractActionsContainerSingle
.
querySelector
(
'button'
).
setAttribute
(
'title'
,
(
title
+
' - transact (not payable)'
))
}
return contractProperty
return contractProperty
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment