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
Show file tree
Hide file tree
Changes from 43 commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
e5fc23a
Agent: add initial background script
sohkai Aug 27, 2019
10c5cc6
Agent: update script to pass transaction hashes
sohkai Aug 27, 2019
c6e2bc2
Agent: rename `address` to `token` for token address inside tokenTran…
sohkai Aug 27, 2019
2d2a365
Agent: handle ProxyDeposit events
sohkai Aug 27, 2019
b674ea3
Integrate darkmode, fix script initialization, heavy component refactor
Evalir Feb 14, 2020
dc08652
Add correct transaction types
Evalir Feb 17, 2020
d325f8a
Temporarily correct transfer bugs to repair build
Evalir Feb 17, 2020
c42f205
Fix dataview design debt
Evalir Feb 17, 2020
2b0b4a5
Working multiple token transfers
Evalir Feb 18, 2020
680d559
Update aragon ui, use tokenIconUrl() for tokens
Evalir Feb 18, 2020
e06595f
Fix token icons
Evalir Feb 18, 2020
1085ae1
Add custom badge functionality
Evalir Feb 19, 2020
bd5bbc8
Fix token display, add colors to entry expansion
Evalir Feb 19, 2020
8d1d283
Fix double scroll UI bug :-)
Evalir Feb 19, 2020
5b64d49
Fix mobile network bug, add initial filtering
Evalir Feb 20, 2020
4b4ed03
Demo-ready
Evalir Feb 20, 2020
65a5a21
Find target contract interaction if there are no token transfers, mod…
Evalir Feb 20, 2020
02427d1
Minor cosmetic refactor
Evalir Feb 20, 2020
e0c7359
Refactor script, memoize transaction list
Evalir Feb 20, 2020
29e82d6
Cosmetic code cleanup
Evalir Feb 21, 2020
ba4f435
Revert empty results memoization
Evalir Feb 21, 2020
e0ea6cb
Refactor transactions, add proper mobile view and other points from d…
Evalir Feb 27, 2020
8978d65
Code cleanup
Evalir Feb 27, 2020
c4b3e7d
ESLint: add exhaustive deps
bpierre Feb 28, 2020
dcc3be1
ESLint fixes
bpierre Feb 28, 2020
bfcb6f6
Optimize SVG
bpierre Mar 1, 2020
eab5bff
Add code review suggestions
Evalir Mar 2, 2020
f54be2d
Correct format error, remove console logs
Evalir Mar 2, 2020
255748b
Remove lodash throttle, remove firefox translate3d fix
Evalir Mar 2, 2020
2ddb817
Remove unused prop
bpierre Mar 2, 2020
d88e4f1
Use ROUNDING_AMOUNT
bpierre Mar 2, 2020
f481717
Fix addresses not resolving on CSV
Evalir Mar 2, 2020
a1e326d
Fix badges taking column width
Evalir Mar 2, 2020
c1f3a0e
Non-breaking spaces
bpierre Mar 2, 2020
813d22f
Create CSV data on demand
bpierre Mar 2, 2020
a4a29c7
Merge branch 'agent-readonly-ui' of github.com:aragon/aragon-apps int…
bpierre Mar 2, 2020
4628555
Date formats
bpierre Mar 2, 2020
2ded25b
Use DataView empty state
bpierre Mar 2, 2020
e4e080b
Code style
bpierre Mar 2, 2020
c8ac569
CSV files: escape double quotes in content
bpierre Mar 3, 2020
021e81b
CSV: add type
bpierre Mar 3, 2020
b4d4b31
Remove TRANSACTION_TYPES_STRING
bpierre Mar 3, 2020
0fe37e3
Merge branch 'master' into agent-readonly-ui
bpierre Mar 3, 2020
560a623
Merge branch 'master' into agent-readonly-ui
Evalir Mar 6, 2020
bc22da5
Fix aragonUI update breaking changes
Evalir Mar 6, 2020
9950bcf
Manually checkout the other apps
bpierre Mar 6, 2020
956e538
Manually checkout future-apps
bpierre Mar 6, 2020
e8d2acc
More cleanup after the manual checkout
bpierre Mar 6, 2020
38d796d
Remove unused component
bpierre Mar 7, 2020
74cf959
Apply most code review suggestions
Evalir Mar 8, 2020
0a93f26
Merge branch 'agent-readonly-ui' of https://github.com/aragon/aragon-…
Evalir Mar 9, 2020
e734e9c
Change 'marshal' to 'marshalTransactionDetails'
Evalir Mar 11, 2020
8938ace
Remove agent ABIs, fix entity logic for badges, minor cosmetic code c…
Evalir Mar 11, 2020
160a8ac
Add agent app address and transaction hash to file
Evalir Mar 11, 2020
09b7807
use event target to get the target contract
Evalir Mar 11, 2020
e3adf63
Remove console log and unused findTargetFromReceipt function in token…
Evalir Mar 11, 2020
ca89180
Merge branch 'master' into agent-readonly-ui
Evalir Mar 11, 2020
2b0a618
Merge branch 'master' into agent-readonly-ui
Evalir Mar 11, 2020
6f2e235
Update manifest.json and add screenshots
Evalir Mar 11, 2020
727f62f
Agent: Fix test color on dataview expansion
Evalir Mar 11, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions apps/agent/app/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@
"prettier/react"
],
"parser": "babel-eslint",
"plugins": ["prettier", "react"],
"plugins": ["prettier", "react", "react-hooks"],
"rules": {
"valid-jsdoc": "error",
"react/prop-types": 0,
"linebreak-style": ["error", "unix"]
"linebreak-style": ["error", "unix"],
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn"
}
}
9 changes: 5 additions & 4 deletions apps/agent/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@
"private": true,
"license": "AGPL-3.0-or-later",
"dependencies": {
"@aragon/api": "^2.0.0-beta.9",
"@aragon/api-react": "^2.0.0-beta.9",
"@aragon/api": "^2.0.0-beta.6",
"@aragon/api-react": "^2.0.0-beta.6",
Evalir marked this conversation as resolved.
Show resolved Hide resolved
"@aragon/templates-tokens": "^1.2.0",
"@aragon/ui": "^1.2.1",
"@aragon/ui": "^1.3.0",
"@babel/polyfill": "^7.0.0",
"date-fns": "2.0.0-alpha.22",
"file-saver": "^2.0.2",
"lodash.throttle": "^4.1.1",
"prop-types": "^15.7.2",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"rxjs": "^6.5.2",
"styled-components": "^4.3.2",
"web3-eth-abi": "^1.2.1",
"web3-utils": "^1.2.0"
},
"devDependencies": {
Expand All @@ -35,6 +35,7 @@
"eslint-plugin-prettier": "^2.7.0",
"eslint-plugin-promise": "^4.0.1",
"eslint-plugin-react": "^7.5.1",
"eslint-plugin-react-hooks": "^2.4.0",
"eslint-plugin-standard": "^4.0.0",
"parcel-bundler": "^1.10.1",
"prettier": "^1.11.1"
Expand Down
69 changes: 37 additions & 32 deletions apps/agent/app/src/App.js
Original file line number Diff line number Diff line change
@@ -1,43 +1,48 @@
import React, { useEffect } from 'react'
import { Main, Header, SyncIndicator, useLayout } from '@aragon/ui'
import React, { useCallback } from 'react'
import { useAragonApi } from '@aragon/api-react'
import InstallFrame from './components/InstallFrame'
import { Header, Main, SyncIndicator } from '@aragon/ui'
import Balances from './components/Balances'
import { IdentityProvider } from './components/IdentityManager/IdentityManager'
import ComingSoon from './components/ComingSoon'
import InstallFrame from './components/InstallFrame'
import Transactions from './components/Transactions'

function App({ api, appState, isSyncing }) {
const { layoutName } = useLayout()
const compactMode = layoutName === 'small'
const { balances, transactions, tokens, proxyAddress } = appState
const handleResolveLocalIdentity = address => {
return api.resolveAddressIdentity(address).toPromise()
}
const handleShowLocalIdentityModal = address => {
return api.requestAddressIdentityModification(address).toPromise()
}
function App() {
const { api, appState, guiStyle } = useAragonApi()
const { balances, isSyncing, transactions, tokens, proxyAddress } = appState
const { appearance } = guiStyle

return (
<IdentityProvider
onResolve={handleResolveLocalIdentity}
onShowLocalIdentityModal={handleShowLocalIdentityModal}
>
<div css="min-width: 320px">
<SyncIndicator visible={isSyncing} />
<Header primary="Agent" />
<InstallFrame />
<ComingSoon />
</div>
</IdentityProvider>
const handleResolveLocalIdentity = useCallback(
address => {
return api.resolveAddressIdentity(address).toPromise()
},
[api]
)
}

export default () => {
const { api, appState, guiStyle } = useAragonApi()
const { appearance } = guiStyle
const handleShowLocalIdentityModal = useCallback(
address => {
return api.requestAddressIdentityModification(address).toPromise()
},
[api]
)

return (
<Main theme={appearance} assetsUrl="./aragon-ui">
<App api={api} appState={appState} isSyncing={appState.isSyncing} />
<Main assetsUrl="./aragon-ui" theme={appearance}>
<IdentityProvider
onResolve={handleResolveLocalIdentity}
onShowLocalIdentityModal={handleShowLocalIdentityModal}
>
<SyncIndicator visible={isSyncing} shift={50} />
<Header primary="Agent" />
<InstallFrame />
<Balances balances={balances} />
<Transactions
agentAddress={proxyAddress}
transactions={transactions}
tokens={tokens}
/>
</IdentityProvider>
</Main>
)
}

export default App
6 changes: 4 additions & 2 deletions apps/agent/app/src/app-state-reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ const compareBalancesByEthAndSymbol = (tokenA, tokenB) => {
}

function appStateReducer(state) {
const { balances, transactions } = state || { balances: [], transactions: [] }

const { balances = [], transactions = [] } = state || {
balances: [],
transactions: [],
}
const balancesBn = balances
.map(balance => ({
...balance,
Expand Down
Loading