Skip to content
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

Agent: read-only UI #1082

Merged
merged 60 commits into from
Mar 12, 2020
Merged

Agent: read-only UI #1082

merged 60 commits into from
Mar 12, 2020

Conversation

Evalir
Copy link
Contributor

@Evalir Evalir commented Feb 14, 2020

This PR gives the Agent App a read-only UI for balances and transactions. Further improvements will be made in the future with this initial implementation.

Todos:

  • Refactor all heavily used components to functional (done)
  • Workout last background script issues and test heavily on agent-based DAOs.
    • Remove bugs on Multiple transactions: No token transfers are being found.
    • Make all tokens display correctly (price, image)
    • UI issues with sync indicator making the page bigger than it should be
  • Fix transfer filtering
  • Add custom badge functionality
  • Remove frontend inconsistencies with the design.
  • Flesh out last edge cases when dealing with multiple transactions or call scripts.

@welcome
Copy link

welcome bot commented Feb 14, 2020

Thanks for opening this pull request! Someone will review it soon 🔍

@Evalir Evalir marked this pull request as ready for review February 20, 2020 12:28
@auto-assign auto-assign bot requested review from bpierre and sohkai February 20, 2020 12:28
bpierre added 3 commits March 6, 2020 09:43
They got included in the merge commit 0fe37e3, even though the merge
commit indicates a clean merge (no changes at all).
Copy link
Contributor

@sohkai sohkai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't looked at a few of the components, but leaving a few notes here first :).

Overall looking really good, let's save some of the web3-specific stuff that I commented on for the end!

apps/agent/app/package.json Outdated Show resolved Hide resolved
apps/agent/app/src/lib/token-utils.js Show resolved Hide resolved
apps/finance/app/src/components/EmptyFilteredTransfers.js Outdated Show resolved Hide resolved
apps/agent/app/src/script.js Show resolved Hide resolved
apps/agent/app/src/script.js Show resolved Hide resolved
apps/agent/app/src/script.js Show resolved Hide resolved
apps/agent/app/src/script.js Outdated Show resolved Hide resolved
apps/agent/app/src/lib/token-utils.js Outdated Show resolved Hide resolved
apps/agent/app/src/lib/utils.js Outdated Show resolved Hide resolved
apps/agent/app/src/lib/utils.js Show resolved Hide resolved
Copy link
Contributor

@sohkai sohkai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple more notes and suggestions on the components themselves and most should be pretty quick to address!

I noticed we could do another round of clean up in the agent/app folder itself; let's:

  • Run the linter
  • Remove any unused components and assets

apps/agent/app/src/components/Transactions.js Show resolved Hide resolved
apps/agent/app/src/components/Transactions.js Outdated Show resolved Hide resolved
apps/agent/app/src/components/Transactions.js Show resolved Hide resolved
apps/agent/app/src/components/Transactions.js Outdated Show resolved Hide resolved
apps/agent/app/src/components/Transactions.js Outdated Show resolved Hide resolved
apps/agent/app/src/components/useDownloadData.js Outdated Show resolved Hide resolved
apps/agent/app/src/components/useDownloadData.js Outdated Show resolved Hide resolved
apps/agent/app/src/components/useFilteredTransactions.js Outdated Show resolved Hide resolved
apps/agent/app/src/components/useFilteredTransactions.js Outdated Show resolved Hide resolved
apps/agent/app/src/script.js Outdated Show resolved Hide resolved
apps/agent/app/src/abi/agent-execute-event.json Outdated Show resolved Hide resolved
@@ -47,6 +50,8 @@ function useFilteredTransactions({ transactions, tokens }) {

// Exclude by date range
if (
// We're not checking for and end date because we will always
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finance checks both the start and end dates in its filtering implementation, but a small change we could make is to program defensively (and against any "app assumptions") in both of these apps by using something like:

!selectedDateRange.start && isAfter(new Date(date), selectedDateRange.start) &&
!selectedDateRange.end && isAfter(new Date(date), selectedDateRange.end)

apps/agent/app/src/components/Transactions.js Outdated Show resolved Hide resolved
apps/agent/app/src/components/Transactions.js Show resolved Hide resolved
apps/agent/app/src/components/Transactions.js Outdated Show resolved Hide resolved
apps/agent/app/src/components/useDownloadData.js Outdated Show resolved Hide resolved
@sohkai sohkai mentioned this pull request Mar 11, 2020
5 tasks
@@ -278,20 +289,9 @@ async function newExecution(state, event, settings) {
})
.filter(Boolean)

if (ethValue && ethValue !== '0') {
tokenTransfers.push({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah actually, I just realized a better way to do this is with [].unshift()

Copy link
Contributor

@sohkai sohkai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few last comments but looks good to merge otherwise!

Let's just make sure to update the current app's text before merging this one :).

@Evalir Evalir merged commit a15d86e into master Mar 12, 2020
@Evalir Evalir deleted the agent-readonly-ui branch March 12, 2020 00:14
ramilexe pushed a commit to ConsiderItDone/aragon-apps that referenced this pull request Dec 9, 2021
* Agent: add initial background script

* Agent: update script to pass transaction hashes

* Agent: rename `address` to `token` for token address inside tokenTransfers

* Agent: handle ProxyDeposit events

* Integrate darkmode, fix script initialization, heavy component refactor

* Add correct transaction types

* Temporarily correct transfer bugs to repair build

* Fix dataview design debt

* Working multiple token transfers

* Update aragon ui, use tokenIconUrl() for tokens

* Fix token icons

* Add custom badge functionality

* Fix token display, add colors to entry expansion

* Fix double scroll UI bug :-)

* Fix mobile network bug, add initial filtering

* Demo-ready

* Find target contract interaction if there are no token transfers, modify badges, cosmetic enhancements

* Minor cosmetic refactor

* Refactor script, memoize transaction list

* Cosmetic code cleanup

* Revert empty results memoization

* Refactor transactions, add proper mobile view and other points from design QA

* Code cleanup

* ESLint: add exhaustive deps

* ESLint fixes

* Optimize SVG

* Add code review suggestions

* Correct format error, remove console logs

* Remove lodash throttle, remove firefox translate3d fix

* Remove unused prop

* Use ROUNDING_AMOUNT

* Fix addresses not resolving on CSV

* Fix badges taking column width

* Non-breaking spaces

* Create CSV data on demand

* Date formats

* Use DataView empty state

* Code style

* CSV files: escape double quotes in content

* CSV: add type

* Remove TRANSACTION_TYPES_STRING

* Fix aragonUI update breaking changes

* Manually checkout the other apps

They got included in the merge commit 0fe37e3, even though the merge
commit indicates a clean merge (no changes at all).

* Manually checkout future-apps

* More cleanup after the manual checkout

* Remove unused component

* Apply most code review suggestions

* Change 'marshal' to 'marshalTransactionDetails'

* Remove agent ABIs, fix entity logic for badges, minor cosmetic code changes

* Add agent app address and transaction hash to file

* use event target to get the target contract

* Remove console log and unused findTargetFromReceipt function in token-utils

* Update manifest.json and add screenshots

* Agent: Fix test color on dataview expansion

Co-authored-by: Brett Sun <qisheng.brett.sun@gmail.com>
Co-authored-by: Pierre Bertet <hello@pierre.world>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants