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

Govern integration #331

Merged
merged 81 commits into from
Apr 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
fccad77
Added basic injected wallet and added Subgraph queries for DAOs
BhanuSanghi-Dev Apr 13, 2021
a8eb796
Added all subgraph data for daos
BhanuSanghi-Dev Apr 13, 2021
85d267b
Footer in progress
bhanusanghi Apr 13, 2021
94777b7
Corrected subgraph query
bhanusanghi Apr 13, 2021
77a3332
create dao with happy path testing, no global config option yet
yuetloo Apr 13, 2021
00099a6
add more test cases for createDao
yuetloo Apr 14, 2021
bd0f663
add configuration option for dao factory address
yuetloo Apr 14, 2021
58f86ac
renamed filename to follow convention
yuetloo Apr 14, 2021
db57b52
Added subgraph for fetching proposals and for fetching proposal details
bhanusanghi Apr 14, 2021
c8f2145
Feature/new proposal flow (#322)
reddyismav Apr 14, 2021
89fdb9f
few typescript type fixes and routing fix, an id param cannot be pass…
reddyismav Apr 14, 2021
ad1c33b
Updated correct url change
bhanusanghi Apr 15, 2021
0fb1451
Corrected url
bhanusanghi Apr 15, 2021
58de235
create esm and umd bundles
yuetloo Apr 15, 2021
b0e9ac3
add example using createDao for web
yuetloo Apr 15, 2021
08425b9
updated doc for createDao
yuetloo Apr 15, 2021
453c2c1
Merge branch 'develop' into feature/create-dao
yuetloo Apr 15, 2021
a8c5cce
Merge branch 'develop' into feature/create-dao
yuetloo Apr 15, 2021
ec17e90
fix merge with develop error
yuetloo Apr 15, 2021
d4aba47
Merge branch 'develop' into feat/new-govern
cbrzn Apr 15, 2021
8de9677
add proposal scheduling - TODO fix test with bad config
yuetloo Apr 15, 2021
8226afa
[WIP] chore: newGover implementation in ts library
cbrzn Apr 15, 2021
4391a7b
fix test failure with schedule proposal
yuetloo Apr 15, 2021
afbe72b
chore: refactor of new govern finished with green tests
cbrzn Apr 16, 2021
34771a2
WIP: add challenge, veto, resolve, execute proposal.. test still fail…
yuetloo Apr 16, 2021
d875ec1
fix: rollup json added
cbrzn Apr 16, 2021
986a277
update govern queue abi
yuetloo Apr 16, 2021
58e7cd5
Merge remote-tracking branch 'origin/develop' into feature/create-dao
yuetloo Apr 16, 2021
ac3a2c4
merged from new-govern branch
yuetloo Apr 16, 2021
9cafcd7
scree 1 and 2 in progress
Rekard0 Apr 16, 2021
f8e0f54
fix merge issue
yuetloo Apr 16, 2021
56923bd
schedule proposal with a resolver
yuetloo Apr 16, 2021
63be293
screen 3 in progress
Rekard0 Apr 16, 2021
26790b0
essential UI for all 4 screen
Rekard0 Apr 16, 2021
456c9f4
clean up
Rekard0 Apr 16, 2021
f93344f
set nonce in schedule
yuetloo Apr 16, 2021
f7a5510
Added Wallet and Proposal Details page.
bhanusanghi Apr 16, 2021
a34df64
Merged DAO Creation Page
bhanusanghi Apr 16, 2021
cc6882b
new proposal button
reddyismav Apr 16, 2021
bc4c431
create dao references used for input fields and checkboxes
reddyismav Apr 16, 2021
ec905de
make proposal nonce nullable
yuetloo Apr 16, 2021
ae0e6b6
input field value missed
reddyismav Apr 16, 2021
4756be6
chore: removed governBaseFactory abi json
cbrzn Apr 16, 2021
16c98e5
Merge branch 'feature/create-dao' of github.com:aragon/govern into fe…
cbrzn Apr 16, 2021
bcd8d6d
Corrected input fields
bhanusanghi Apr 16, 2021
b0bf222
chore: entirely removed abis from govern package
cbrzn Apr 16, 2021
d9f83cc
fix: remove json plugin from umdconfig in rollup
cbrzn Apr 16, 2021
e8a6899
chore: register abi json converted to human readable
cbrzn Apr 16, 2021
241098b
Merged Proposal package functionality
bhanusanghi Apr 16, 2021
7186211
challenge works now, but, resolve still fail with DM_INVALID_ADJUDICA…
yuetloo Apr 16, 2021
a933e41
exclude files from jest test coverage
yuetloo Apr 17, 2021
a31ac99
skip challenge test as its now failing with CLK_TOO_MANY_TRANSITIONS
yuetloo Apr 17, 2021
303390c
add alchemy archive node
novaknole Apr 17, 2021
6085ffc
run more tests
novaknole Apr 17, 2021
f34bfef
fix depcheck error - ethers missing
yuetloo Apr 17, 2021
1f3fa24
Merge branch 'feature/create-dao' of github.com:aragon/govern into fe…
yuetloo Apr 17, 2021
86662e1
grant veto power to test user to do veto test - unable to grant veto …
yuetloo Apr 17, 2021
0ceb852
Changed Routing, New Proposal testing in progress
bhanusanghi Apr 19, 2021
583cb9c
Merge remote-tracking branch 'origin/feature/create-dao' into govern-…
bhanusanghi Apr 19, 2021
14c7f20
Added govern package with yarn link. Corrected variable name
bhanusanghi Apr 19, 2021
2479e32
Updated data to session storage
bhanusanghi Apr 19, 2021
4bc1378
Working test proposal creation
bhanusanghi Apr 19, 2021
3f0bd80
Govern: fix veto test
novaknole Apr 19, 2021
e8ba2ac
bring back test command
novaknole Apr 19, 2021
741d749
fix resolve test failure
yuetloo Apr 19, 2021
c5a884f
merge veto fixes
yuetloo Apr 19, 2021
e185a75
Added HashRouter and now storing values in session storage, Added Cha…
bhanusanghi Apr 19, 2021
7c494e8
New Proposal Flow.
reddyismav Apr 19, 2021
0def3ca
grid css fix
reddyismav Apr 19, 2021
343b4ae
Added - DAO config fetch
bhanusanghi Apr 20, 2021
6a723b3
Added extra data pull for challenge proposal
bhanusanghi Apr 20, 2021
08fb9fa
Merge branch 'feature/create-dao' into govern-integration
bhanusanghi Apr 20, 2021
063f3f7
checkbox component
Rekard0 Apr 20, 2021
791cad1
blueswitch component
Rekard0 Apr 20, 2021
d937161
blue porgressbar component
Rekard0 Apr 20, 2021
9b244f4
cleaning up create-dao views impelemnting new components
Rekard0 Apr 20, 2021
daa642b
Added execute proposal function WIP
bhanusanghi Apr 20, 2021
c2dd564
Removed debuggers
bhanusanghi Apr 20, 2021
270912c
Merge branch 'govern-integration' of github.com:aragon/govern into go…
Rekard0 Apr 20, 2021
1ca7b3c
Footer added and lint fixes
reddyismav Apr 21, 2021
7f7e704
develop merged into govern-integration. Conflicts solved
reddyismav Apr 21, 2021
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
19 changes: 19 additions & 0 deletions docs/developers/govern-js.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,25 @@ import { query } from '@aragon/govern'
const query = await query(myQuery, {...});
```

### createDao(args, options) ⇒ ``Promise<TransactionResponse>``

Create

| Param | Type | Description |
| -------- | ------------------------------- | --------------------------------------- |
| args | <code>CreateDaoParams</code> | Dao name, Dao token, useProxies option |
| options | <code>CreateDaoOptions</code> | EIP 1193 provider, Dao factory address |

Examples:

For Node.js:
``` typescript
import { createDao } from '@aragon/govern'

const result = await createDao(args, options);
```


### configure(config) ⇒ ``void``

Overwrites the default configuration of govern.
Expand Down
1 change: 1 addition & 0 deletions packages/govern-console/.eslintcache

Large diffs are not rendered by default.

28,552 changes: 28,552 additions & 0 deletions packages/govern-console/package-lock.json

Large diffs are not rendered by default.

17 changes: 4 additions & 13 deletions packages/govern-console/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import React from 'react';
import { Web3ReactProvider } from '@web3-react/core';
import Home from 'containers/HomePage/HomePage';
import { Web3Provider } from '@ethersproject/providers';
import { BrowserRouter as Router } from 'react-router-dom';
import { UseWalletProvider } from 'use-wallet';
import { HashRouter as Router } from 'react-router-dom';
import { WalletProvider } from './EthersWallet';

function getLibrary(provider: any): Web3Provider {
const library = new Web3Provider(provider);
Expand All @@ -13,19 +13,10 @@ function getLibrary(provider: any): Web3Provider {

export default function App() {
return (
<UseWalletProvider
chainId={4}
connectors={
{
// This is how connectors get configured
// portis: { dAppId: 'my-dapp-id-123-xyz' },
// test test test test
}
}
>
<WalletProvider>
<Router>
<Home />
</Router>
</UseWalletProvider>
</WalletProvider>
);
}
41 changes: 41 additions & 0 deletions packages/govern-console/src/EthersWallet.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import React, { useContext, useMemo } from 'react';
import { providers as EthersProviders } from 'ethers';
import { UseWalletProvider, useWallet } from 'use-wallet';

const WalletAugmentedContext = React.createContext({});

function useWalletAugmented() {
return useContext(WalletAugmentedContext);
}

// Adds Ethers.js to the useWallet() object
const WalletAugmented: React.FC<unknown> = ({ children }) => {
const wallet = useWallet();
const ethereum: any = wallet.ethereum;

const ethersProvider = useMemo(
() => (ethereum ? new EthersProviders.Web3Provider(ethereum) : null),
[ethereum],
);

const contextValue = useMemo(() => ({ ...wallet, ethersProvider }), [
wallet,
ethersProvider,
]);

return (
<WalletAugmentedContext.Provider value={contextValue}>
{children}
</WalletAugmentedContext.Provider>
);
};

const WalletProvider: React.FC<unknown> = ({ children }) => {
return (
<UseWalletProvider chainId={4}>
<WalletAugmented>{children}</WalletAugmented>
</UseWalletProvider>
);
};

export { useWalletAugmented as useWallet, WalletProvider };
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/* eslint-disable */
import React from 'react';
// also exported from '@storybook/react' if you can deal with breaking changes in 6.1

import { Story, Meta } from '@storybook/react';

import { BlueCheckbox } from './BlueCheckbox';

export default {
title: 'Blue-checkbox',
component: BlueCheckbox,
argTypes: {
backgroundColor: { control: 'color' },
},
} as Meta;

const Template: Story = (args) => <BlueCheckbox {...args} />;

export const blue_checkbox = Template.bind({});
16 changes: 16 additions & 0 deletions packages/govern-console/src/components/Checkboxs/BlueCheckbox.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/* eslint-disable */
import Checkbox, { CheckboxProps } from '@material-ui/core/Checkbox';
import checkedIcon from '../../images/svgs/check_box_checked.svg';
import unCheckedIcon from '../../images/svgs/check_box_unchecked.svg';

export const BlueCheckbox = (props: CheckboxProps) => {
return (
<Checkbox
disableRipple
color="default"
checkedIcon={<img src={checkedIcon} />}
icon={<img src={unCheckedIcon} />}
{...props}
/>
);
};
76 changes: 74 additions & 2 deletions packages/govern-console/src/components/Footer/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,79 @@
import React from 'react';
import { styled, useTheme } from '@material-ui/core/styles';
import Typography from '@material-ui/core/Typography';
import governIcon from 'images/aragon-icon.svg';
import aragonText from 'images/svgs/Aragon.svg';
import discordIcon from 'images/svgs/discord.svg';
import messageIcon from 'images/svgs/message.svg';
import twitterIcon from 'images/svgs/twitter.svg';
import youtubeIcon from 'images/svgs/youtube.svg';
import Wallet from 'components/Wallet/Wallet';
import { useHistory } from 'react-router-dom';

const Footer = ({ ...args }) => {
return <div></div>;
const Footer = ({}) => {
const history = useHistory();
const HeaderWrapperDiv = styled('div')({
height: '106px',
width: '100%',
display: 'block',
});
const TitleText = styled(Typography)({
fontFamily: 'Manrope',
fontStyle: 'normal',
fontWeight: 'normal',
fontSize: '18px',
lineHeight: '25px',
color: '#7483B2',
width: '200px',
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
});
const Navbar = styled('div')({
display: 'flex',
width: '100%',
flexDirection: 'row',
justifyContent: 'space-between',
height: '100%',
});
const Title = styled('div')({
display: 'flex',
width: 'fit-content',
cursor: 'pointer',
marginLeft: '50px',
});
const Account = styled('div')({
display: 'flex',
width: '200px',
flexDirection: 'row',
justifyContent: 'space-between',
alignItems: 'center',
marginRight: '50px',
});

const redirectToHomePage = () => {
history.push('/');
};

return (
<HeaderWrapperDiv id="header">
<Navbar id="navbar">
<Title id="navbar_title" onClick={redirectToHomePage}>
<img
src={governIcon}
style={{ height: '31px', width: '35px', paddingTop: '35px' }}
/>
<img src={aragonText} />
</Title>
<Account id="account">
<img src={youtubeIcon} />
<img src={twitterIcon} />
<img src={discordIcon} />
<img src={messageIcon} />
</Account>
</Navbar>
</HeaderWrapperDiv>
);
};

export default Footer;
10 changes: 8 additions & 2 deletions packages/govern-console/src/components/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ import { styled, useTheme } from '@material-ui/core/styles';
import Typography from '@material-ui/core/Typography';
import governIcon from 'images/aragon-icon.svg';
import Wallet from 'components/Wallet/Wallet';
// import
import { useHistory } from 'react-router-dom';

const Header = ({}) => {
const history = useHistory();
const HeaderWrapperDiv = styled('div')({
height: '106px',
width: '100%',
Expand Down Expand Up @@ -43,10 +44,15 @@ const Header = ({}) => {
justifyContent: 'flex-end',
alignItems: 'center',
});

const redirectToHomePage = () => {
history.push('/');
};

return (
<HeaderWrapperDiv id="header">
<Navbar id="navbar">
<Title id="navbar_title">
<Title id="navbar_title" onClick={redirectToHomePage}>
<img src={governIcon} />
<TitleText>Govern Console</TitleText>
</Title>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export interface InputFieldProps {
* Width of the input box
*/
width: string;
value?: string;
}

export const InputField: React.FC<InputFieldProps> = ({
Expand All @@ -32,6 +33,7 @@ export const InputField: React.FC<InputFieldProps> = ({
label,
height,
width,
value,
...props
}) => {
const theme = useTheme();
Expand All @@ -56,6 +58,7 @@ export const InputField: React.FC<InputFieldProps> = ({
},
input: {
padding: '0px 0px 0px 24px',
boxSizing: 'border-box',
margin: '0px',
color: `${theme.custom.black}`,
fontSize: 16,
Expand Down Expand Up @@ -88,6 +91,7 @@ export const InputField: React.FC<InputFieldProps> = ({
InputLabelProps={{ shrink: true, classes: inputLabelClasses }}
InputProps={{ classes: inputBaseClasses, disableUnderline: true }}
onChange={(e) => onInputChange(e.target.value)}
value={value}
/>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/* eslint-disable */
import React from 'react';
// also exported from '@storybook/react' if you can deal with breaking changes in 6.1

import { Story, Meta } from '@storybook/react';

import { BlueProgressBar } from './BlueProgressBar';
import { LinearProgressProps } from '@material-ui/core/LinearProgress';

export default {
title: 'Blue-progressBar',
component: BlueProgressBar,
argTypes: {
backgroundColor: { control: 'color' },
},
} as Meta;

const Template: Story<LinearProgressProps> = (args) => (
<BlueProgressBar {...args} />
);

export const blue_progress_bar = Template.bind({});

blue_progress_bar.args = {
value: 50,
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/* eslint-disable */
import LinearProgress, {
LinearProgressProps,
} from '@material-ui/core/LinearProgress';
import { makeStyles } from '@material-ui/core/styles';

const useStyles = makeStyles({
determinate: {
flexGrow: 1,
width: '100%',
height: '11px',
borderRadius: '10px',
backgroundColor: '#ECFAFF',
},
barColorPrimary: {
width: '100%',
height: '11px',
borderRadius: '50px',
backgroundColor: '#00B3EC',
},
});

export const BlueProgressBar = (props: LinearProgressProps) => {
const classes = useStyles();

return (
<LinearProgress
variant={'determinate'}
classes={{
determinate: classes.determinate,
barColorPrimary: classes.barColorPrimary,
}}
{...props}
/>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ const Template: Story<ProposalOptionsProps> = (args) => {
updateOptions([...options, { value: '' }]);
};
const onDeleteOption = (index: number) => {
debugger;
const tempOptions = [...options];
tempOptions.splice(index, 1);
updateOptions(tempOptions);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/* eslint-disable */
import React from 'react';
// also exported from '@storybook/react' if you can deal with breaking changes in 6.1

import { Story, Meta } from '@storybook/react';

import { BlueSwitch, SwitchProps } from './BlueSwitch';

export default {
title: 'Blue-Switch',
component: BlueSwitch,
argTypes: {
backgroundColor: { control: 'color' },
},
} as Meta;

const Template: Story<SwitchProps> = (args) => <BlueSwitch {...args} />;

export const Blue_Switch = Template.bind({});

Blue_Switch.args = {
disabled: true,
};
Loading