-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: Transaction Insights #12881
Conversation
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So there are few changes we need to this PR.
Here is how I would handle them, in order of priority:
- Rebase onto develop, so that the changes from this PR are not duplicated Created a Nickname popover #12632
- Refactor to use the current "Popover" pattern for showing modals, and then refactor to use react-redux hooks within functional components instead of "container" components. The "Popover" pattern is to import the respective popover component into the appropriate parent, pass the props from that parent directly to the component, and then conditionally render the component (and not to use redux for storing the data or indicating whether the popover should be shown).
ui/components/app/qr-hardware-popover/qr-hardware-popover.js
is an example - It is probably best to have the confirm screen changes and the transaction details changes in separate PRs. This PR is big. Separate PRs will help code reviewers focus and it is possible that some of the code review can be parallelized if in separate PRs
- Move the logic in the useEffect of the transaction-decoding component to help methods in a util file
- Address the small comments
There is also some clean up that needs to happen of css, but that can be separate.
ui/components/app/transaction-list-item-details/transaction-list-item-details.component.js
Outdated
Show resolved
Hide resolved
ui/components/app/transaction-list-item-details/transaction-list-item-details.component.js
Outdated
Show resolved
Hide resolved
ui/components/app/transaction-decoding/transaction-decoding.component.js
Outdated
Show resolved
Hide resolved
ui/components/app/transaction-decoding/transaction-decoding.component.js
Outdated
Show resolved
Hide resolved
ui/components/app/transaction-decoding/components/ui/copy-raw-data/index.scss
Outdated
Show resolved
Hide resolved
ui/components/app/transaction-decoding/transaction-decoding.component.js
Outdated
Show resolved
Hide resolved
ui/components/app/transaction-list-item-details/transaction-list-item-details.component.js
Show resolved
Hide resolved
ui/components/app/transaction-decoding/transaction-decoding.component.js
Outdated
Show resolved
Hide resolved
ui/components/app/transaction-decoding/components/ui/copy-raw-data/copy-raw-data.component.js
Outdated
Show resolved
Hide resolved
a0c309d
to
3ca30e9
Compare
I have read the CLA Document and I hereby sign the CLA |
Gabe raised the issue that the "copy transaction button" copies the text |
ui/components/app/transaction-decoding/components/decoding/address/address.component.js
Outdated
Show resolved
Hide resolved
I have read the CLA Document and I hereby sign the CLA |
70b4e64
to
851af60
Compare
@@ -0,0 +1,72 @@ | |||
import React, { useState } from 'react'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -0,0 +1,72 @@ | |||
import React, { useState } from 'react'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -0,0 +1,38 @@ | |||
import React, { useContext } from 'react'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -0,0 +1,224 @@ | |||
import React, { useContext, useEffect, useState } from 'react'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -4,16 +4,17 @@ import copyToClipboard from 'copy-to-clipboard'; | |||
import { getBlockExplorerLink } from '@metamask/etherscan-link'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -0,0 +1,51 @@ | |||
import React, { useState, useRef, useEffect } from 'react'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This component handles the togglable dropdown ux and functionality shown below:
disclosure.mp4
@@ -8,6 +8,7 @@ import { shortenAddress } from '../../../helpers/utils/util'; | |||
import AccountMismatchWarning from '../account-mismatch-warning/account-mismatch-warning.component'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes in this file account for the new behaviour of clicking the address shown at the top of the confirm screen (and in the transaction details modal):
sendertorecipientnew.mp4
ui/components/app/transaction-decoding/transaction-decoding.component.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 nice work
Please address feedbacks before merging.
className="address__name" | ||
onClick={() => setShowNicknamePopovers(true)} | ||
> | ||
{addressOnly |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a blocker but I'd prefer if this was assigned as a variable above the JSX.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in 671e006
|
||
return ( | ||
<div className="copy-raw-data"> | ||
<Tooltip position="right" title={copied ? 'Copied!' : ''}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should use copiedExclamation
localization here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} | ||
|
||
&__icon { | ||
padding-right: 6px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
padding-inline-end
would be more friend to RTL.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
font-size: 14px; | ||
position: relative; | ||
margin: 12px 0 4px; | ||
padding-left: 22px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
padding-inline-start
would be good here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cursor: pointer; | ||
|
||
& + .tx-insight-content { | ||
padding-left: 14px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
padding-inline-start
would be good here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Explanation:
This PR adds the Transactions Insights feature and supporting functionality. This will give users more information about what is happening when sending a transaction to a contract. The core of the functionality is displayed below:
transactioninsights.mp4
To achieve this, this PR uses https://github.com/trufflesuite/truffle/tree/develop/packages/decoder to decode transaction details which are retrieved from a codefi api
The above screen capture demonstrates the transaction decoding feature and the use of the new modals for viewing and editing account and nickname information.
In addition, the PR adds the transaction decoding to the transaction details modal that is opened when clicking list items in the transaction activity list. This addition also updates the styles/layouts of that modal.
Manual testing steps:
This can be done on the Kovan network.
Screenshots and videos:
transaction-insights-activity-list.mp4