From 2a8580dd94d7e09983643ebf8a1501da598fbfba Mon Sep 17 00:00:00 2001 From: mrrobot16 Date: Sun, 2 Feb 2020 22:06:35 -0500 Subject: [PATCH 01/38] migrating latest signal features commits --- src/genericSchemeRegistry/index.ts | 2 + .../schemes/Signals.json | 130 ++++++++++++++++++ 2 files changed, 132 insertions(+) create mode 100644 src/genericSchemeRegistry/schemes/Signals.json diff --git a/src/genericSchemeRegistry/index.ts b/src/genericSchemeRegistry/index.ts index e7b3e31ff..74dfd6a81 100644 --- a/src/genericSchemeRegistry/index.ts +++ b/src/genericSchemeRegistry/index.ts @@ -9,6 +9,7 @@ const gpInfo = require("./schemes/GenesisProtocol.json"); const ensRegistryInfo = require("./schemes/ENSRegistry.json"); const ensPublicResolverInfo = require("./schemes/ENSPublicResolver.json"); const registryLookupInfo = require("./schemes/RegistryLookup.json"); +const signals = require("./schemes/Signals.json") const KNOWNSCHEMES = [ dutchXInfo, @@ -16,6 +17,7 @@ const KNOWNSCHEMES = [ ensPublicResolverInfo, gpInfo, registryLookupInfo, + signals, ]; const SCHEMEADDRESSES: {[network: string]: { [address: string]: any}} = { diff --git a/src/genericSchemeRegistry/schemes/Signals.json b/src/genericSchemeRegistry/schemes/Signals.json new file mode 100644 index 000000000..7ae85aefa --- /dev/null +++ b/src/genericSchemeRegistry/schemes/Signals.json @@ -0,0 +1,130 @@ +{ + "name": "Signals Scheme", + "addresses": { + "main": [ + "0xe06d896da40b73cb02650220e480e20f38e7be18" + ], + "rinkeby": [ + "0xe06d896da40b73cb02650220e480e20f38e7be18" + ], + "private": [ + "0xe06d896da40b73cb02650220e480e20f38e7be18" + ] + }, + "actions": [ + { + "id": "createSignalType", + "label": "Create Signal Attribute", + "description": "Create a signal attribute", + "notes": "docs/link", + "fields": [ + { + "name": "approved", + "defaultValue": 1, + "label": "Update data of the selected signal type", + "labelTrue": "Name", + "labelFalse": "Description" + }, + { + "label": "Signal Data", + "name": "signalData", + "placeholder": "Data (Name, Description)" + } + ], + "abi": { + "constant": false, + "inputs": [ + { + "name": "approved", + "type": "bool" + }, + { + "name": "signalType", + "type": "string" + } + ], + "name": "updateSignalData", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + } + }, + { + "id": "updateSignalType", + "label": "Update Signal Attribute", + "description": "Update a signal attribute", + "notes": "docs/link", + "fields": [ + { + "name": "approved", + "defaultValue": 1, + "label": "Update data of the selected signal type", + "labelTrue": "Name", + "labelFalse": "Description" + }, + { + "label": "Signal Data", + "name": "signalData", + "placeholder": "Data (Name, Description)" + } + ], + "abi": { + "constant": false, + "inputs": [ + { + "name": "approved", + "type": "bool" + }, + { + "name": "signalType", + "type": "string" + } + ], + "name": "updateSignalData", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + } + }, + { + "id": "deleteSignalType", + "label": "Delete Signal Attribute", + "description": "Delete a signal attribute", + "notes": "docs/link", + "fields": [ + { + "name": "approved", + "defaultValue": 1, + "label": "Update data of the selected signal type", + "labelTrue": "Name", + "labelFalse": "Description" + }, + { + "label": "Signal Data", + "name": "signalData", + "placeholder": "Data (Name, Description)" + } + ], + "abi": { + "constant": false, + "inputs": [ + { + "name": "approved", + "type": "bool" + }, + { + "name": "signalType", + "type": "string" + } + ], + "name": "updateSignalData", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + } + } + ] +} \ No newline at end of file From e44df7ebc0aaf084bf894699a4c267821fbd525f Mon Sep 17 00:00:00 2001 From: mrrobot16 Date: Tue, 3 Mar 2020 23:19:31 -0500 Subject: [PATCH 02/38] Added DAO Header component in this branch --- src/assets/images/bg-test.jpeg | Bin 0 -> 13624 bytes src/components/Account/AccountImage.tsx | 5 +- src/components/Dao/DaoHeader.scss | 71 ++++++++++++++++++ src/components/Dao/DaoHeader.tsx | 95 ++++++++++++++++++++++++ src/components/Dao/DaoSchemesPage.scss | 10 +++ src/components/Dao/DaoSchemesPage.tsx | 4 +- 6 files changed, 182 insertions(+), 3 deletions(-) create mode 100644 src/assets/images/bg-test.jpeg create mode 100644 src/components/Dao/DaoHeader.scss create mode 100644 src/components/Dao/DaoHeader.tsx diff --git a/src/assets/images/bg-test.jpeg b/src/assets/images/bg-test.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..f8c2c6b7aceadec7a9382ed5d4381427c47e0b33 GIT binary patch literal 13624 zcmZ{~bx>SQ@GiV)kU)??aCZ;x2_9?-4vV|HLvYvN1lI+YUEJMWf-UYAG$>17LmqaZ6U3qU{s01#dk@UjXB1E8b6!N!3Ui009XB85Q*n3d$SAH?N-{yv{^I#-sj-BB5&H5{!yZlT2u@UP(UFd{dK-~BgMB@pyFr{_V<}3=f@`?3~ z`I%@5>SB~^IUR5$S1u}CP?|Dz!9-+@B3s`Um}i|&e~v!pk4EGSTA0%}kg&JHw%c_#f7&vVbM%i-$Q@GI6Wi)4A+MO`PD7T*Cpt#npvKj##PH^< z|7u3o2WLp@T9?vVEfh42&B#d9b5t@7ya1FHk&jL?v(#Gw^ZYGRx4to5m5Q?J?`oDC zmG*yK8i>*}BEx?p@0(kFHo_53|eba>l5>3zl&JxD6zT}7z0=GdwmbCmrtr^+lzluDIKwZ|mEB=Krcd$3BNCzVg*g;=KL zEnvWbMV9h2)(xHROjA821XfT=-KtJexucl&hc$?FSFu!t;6q57HAA(4*ImsAJ7dPE zp8fLEH7_UqWr==yhu*8p`*?$DJnYioSreK%S~iuS{Yv`b#HDszlVLI|u_JlixV7er z)%5iaL~-b}xy`zMc^8J>X$^~%NwhneXchC>;!=bZ`B{wch>Gf9sJ9&o|Pqm&`h;a?6yQ3fl~Z>L)u z88~U}ryBJb>0>;6NFXy!TR`r__2mK!X}qxil#UEM!Y1AUKm0ntQftN}(N~8?z-fxI ze5RVms>~*(7o8?9VP7pcc4Bf;g_vVcED5WMfo5W+O2(77M!C=yusYWglVW1;?!K)0?;#z?D0v<6R>>HXWO|t-Zo=npd3@V~&5)RzkhF}ZoY`fC34FH_nD`CFrm z{JH#uA?2ndRA7hC$z|GLw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Fh&wrV4mM@dY+2o|9ltm5_Jb9rKWfRJOCqNtrWBB+t9{L|IH zvI;jpMl;%Blk{te_xB&|g>>`(eOri<7vnn;db7!N~ zuYkl%HrjBiKPV6F>{sw+Y7A8mZ1T;4RmYfvO*!3~0~r2+7urz@SSG!GKlA%k8R(>? zy(q9k!>)OA*c?mN-VONHETLxo8S_ z8t|EGtvEiEwSbo+2;_$ske$Mo6hjG^TshfOZw3xnJ?NDhxy$B04>7-QjUuv1I2io+ zFwmZ2QF+MX5m0mt68|Z8!R}HW@P@+w z{c8uvL`JzkMK3Y{TL-d{%>9YOHZ+Z-O_M z#&|U$M}It4X~19KnqW=fVneJ(9ADT%qick7bYn@&?dvp|XJK8gSWUJ@qU3;h(mpPK z@Eub<_ylr9if3)0GdB@p!3U~c1e?Amn8;#|62^0!YeVfHE1SeE%scwLERTy3OIP^X zimhSnH%G0u8VymnFE&g8Z8fs;Am { public render(): RenderOutput { - const { accountAddress, profile, width } = this.props; + const { accountAddress, profile, width, style } = this.props; let url; if (profile && profile.image && profile.image[0] && profile.image[0].contentUrl) { @@ -25,6 +26,6 @@ export default class AccountImage extends React.Component { }); } - return (); + return (); } } diff --git a/src/components/Dao/DaoHeader.scss b/src/components/Dao/DaoHeader.scss new file mode 100644 index 000000000..3f0844e8b --- /dev/null +++ b/src/components/Dao/DaoHeader.scss @@ -0,0 +1,71 @@ +.header-wrap { + background: white; + margin: 8rem 2.5% 40px 0; + padding: 25px; + position: relative; + border-radius: 20px 20px 0 0; +} + +.reputation-holders { + display: block; + position: absolute; + font-size: 10px; + font-weight: normal; + color: $gray-1; + white-space: nowrap; +} + +.dao-name { + font-size: 24px; + color: #689bd6; +} + +.dao-info { + margin-left: 15%; + top: 15px; + position: absolute; +} + +.dao-description { + font-family: $body-font; + color: $black; + font-weight: 500; + font-size: 13px; + width: 75%; +} + +.circular--square { + border-radius: 50%; + border-color: white; + border-style: solid +} + +.dao-img { + // margin-left: 15% + top: -40px; + position: absolute +} + +.holdings { + margin-left: 85%; + padding: 15px; + border: 1px solid #dbd7d7; + border-radius: 7px; + margin-bottom: 15px +} + +.holdings .holdings-ammount { + margin-top: 5px; + color: #565a5d; + font-size: 12px +} + +.holdings .holdings-ammount .holdings-name { + float: right; + margin-right: 25px +} + +.dao-header { + position: absolute; + top: 50px; +} \ No newline at end of file diff --git a/src/components/Dao/DaoHeader.tsx b/src/components/Dao/DaoHeader.tsx new file mode 100644 index 000000000..46ceb036e --- /dev/null +++ b/src/components/Dao/DaoHeader.tsx @@ -0,0 +1,95 @@ +import * as React from "react"; +import { IDAOState, Scheme } from "@daostack/client"; + +import withSubscription, { ISubscriptionProps } from "components/Shared/withSubscription"; +import AccountImage from "components/Account/AccountImage"; +import * as css from "./DaoHeader.scss"; + + + +interface IExternalProps { + daoState: IDAOState; +} + +type IProps = IExternalProps & ISubscriptionProps; + +class DaoHeaderComponent extends React.Component { + + render() { + const dummyData = { + daoImg: "/assets/images/generic-user-avatar.png", + reputationHolders: 134, + holdings: [ + { name: "GEN", amount: 0.24653 }, + { name: "ETH", amount: 16.01 }, + { name: "DAI", amount: 148.19 }, + ], + description: ` + ${this.props.daoState.name} is an independent, global community of people working together to build and promote Decentralized Autonomous Organizations (DAOs). + It’s the perfect place to get involved with DAOstack and get your feet wet in a real-life DAO. + `, + }; + + return ( +
+
+ +
+
+ + { this.props.daoState.name } + + + { dummyData.reputationHolders } Reputation Holders + +
+ +
+ Holdings + { + dummyData.holdings.map((holding, index) => { + return ( +
+ { holding.amount } +
+ { holding.name } +
+
+ ); + }) + } +
+ +

+ This is the { this.props.daoState.name } Header +
+ { dummyData.description } +
+

+
+ ); + } +} + +const DaoHeader = withSubscription({ + wrappedComponent: DaoHeaderComponent, + checkForUpdate: [], + createObservable: (props: IExternalProps) => { + const dao = props.daoState.dao; + return dao.schemes({}, { fetchAllData: true, subscribe: true }); + }, +}); + +const styles = { + circularSquare: { + borderRadius: "50%", + borderColor: "white", + borderStyle: "solid", + } +} + +export default DaoHeader; \ No newline at end of file diff --git a/src/components/Dao/DaoSchemesPage.scss b/src/components/Dao/DaoSchemesPage.scss index 37d11b23f..21e29bc4d 100644 --- a/src/components/Dao/DaoSchemesPage.scss +++ b/src/components/Dao/DaoSchemesPage.scss @@ -41,6 +41,16 @@ padding-top: 30px; } +.daoHeaderBackground { + // @TODO Image is repeating, check this later when using real image + // background-image: url(/assets/images/bg-test.jpeg); + width: 115%; + position: absolute; + display: flex; + height: 30%; + top:0; + right: 0; +} @media only screen and (max-width: 425px) { .wrapper h1 { diff --git a/src/components/Dao/DaoSchemesPage.tsx b/src/components/Dao/DaoSchemesPage.tsx index 874668db7..9f2ba0c0b 100644 --- a/src/components/Dao/DaoSchemesPage.tsx +++ b/src/components/Dao/DaoSchemesPage.tsx @@ -13,6 +13,7 @@ import { CSSTransition, TransitionGroup } from "react-transition-group"; import * as css from "./DaoSchemesPage.scss"; import ProposalSchemeCard from "./ProposalSchemeCard"; import SimpleSchemeCard from "./SimpleSchemeCard"; +import DAOHeader from "./DaoHeader"; const Fade = ({ children, ...props }: any) => ( { return (
+
{dao.name} - +

All Plugins

From 8436d1f66e1896a5b786367e5c17be913cf73c99 Mon Sep 17 00:00:00 2001 From: mrrobot16 Date: Thu, 5 Mar 2020 18:58:51 -0500 Subject: [PATCH 03/38] Getting signal data and displaying it in the UI --- src/assets/images/bg-test.jpeg | Bin 13624 -> 0 bytes src/components/Dao/DaoHeader.tsx | 36 +++++++++++++-------- src/components/Dao/DaoSchemesPage.tsx | 45 ++++++++++++++++++++++---- 3 files changed, 61 insertions(+), 20 deletions(-) delete mode 100644 src/assets/images/bg-test.jpeg diff --git a/src/assets/images/bg-test.jpeg b/src/assets/images/bg-test.jpeg deleted file mode 100644 index f8c2c6b7aceadec7a9382ed5d4381427c47e0b33..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 13624 zcmZ{~bx>SQ@GiV)kU)??aCZ;x2_9?-4vV|HLvYvN1lI+YUEJMWf-UYAG$>17LmqaZ6U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v1I2io+ zFwmZ2QF+MX5m0mt68|Z8!R}HW@P@+w z{c8uvL`JzkMK3Y{TL-d{%>9YOHZ+Z-O_M z#&|U$M}It4X~19KnqW=fVneJ(9ADT%qick7bYn@&?dvp|XJK8gSWUJ@qU3;h(mpPK z@Eub<_ylr9if3)0GdB@p!3U~c1e?Amn8;#|62^0!YeVfHE1SeE%scwLERTy3OIP^X zimhSnH%G0u8VymnFE&g8Z8fs;Am; - -class DaoHeaderComponent extends React.Component { +type IProps = IExternalProps & ISubscriptionProps<[Scheme[], Signal | any]>; +class DaoHeaderComponent extends React.Component { render() { - const dummyData = { + const { daoState, signal } = this.props; + const { name, memberCount, address } = daoState; + const parsedSignal = JSON.parse(signal.data); + console.log('parsedSignal', parsedSignal); + const data = { daoImg: "/assets/images/generic-user-avatar.png", - reputationHolders: 134, + reputationHolders: memberCount, holdings: [ { name: "GEN", amount: 0.24653 }, { name: "ETH", amount: 16.01 }, { name: "DAI", amount: 148.19 }, ], description: ` - ${this.props.daoState.name} is an independent, global community of people working together to build and promote Decentralized Autonomous Organizations (DAOs). + ${name} is an independent, global community of people working together to build and promote Decentralized Autonomous Organizations (DAOs). It’s the perfect place to get involved with DAOstack and get your feet wet in a real-life DAO. `, }; @@ -33,25 +40,26 @@ class DaoHeaderComponent extends React.Component { return (
+ {/* Logo will go here instead of AccountImage this is just a placeholder */}
- { this.props.daoState.name } + { signal.name ? signal.name : name } - { dummyData.reputationHolders } Reputation Holders + { data.reputationHolders } Reputation Holders
Holdings { - dummyData.holdings.map((holding, index) => { + data.holdings.map((holding, index) => { return (
{ holding.amount } @@ -65,9 +73,9 @@ class DaoHeaderComponent extends React.Component {

- This is the { this.props.daoState.name } Header + This is the { name } Header
- { dummyData.description } + { data.description }

@@ -90,6 +98,6 @@ const styles = { borderColor: "white", borderStyle: "solid", } -} +}; export default DaoHeader; \ No newline at end of file diff --git a/src/components/Dao/DaoSchemesPage.tsx b/src/components/Dao/DaoSchemesPage.tsx index 9f2ba0c0b..d09e57967 100644 --- a/src/components/Dao/DaoSchemesPage.tsx +++ b/src/components/Dao/DaoSchemesPage.tsx @@ -14,6 +14,9 @@ import * as css from "./DaoSchemesPage.scss"; import ProposalSchemeCard from "./ProposalSchemeCard"; import SimpleSchemeCard from "./SimpleSchemeCard"; import DAOHeader from "./DaoHeader"; +import gql from "graphql-tag"; +import { getArc } from "arc"; +import { combineLatest } from "rxjs"; const Fade = ({ children, ...props }: any) => ( ( ); +const DAOHeaderBackground = (props: any) => ( +
+); + type IExternalProps = { daoState: IDAOState; } & RouteComponentProps; -type IProps = IExternalProps & ISubscriptionProps; +interface Signal { + id: string; + data: any | string; +}; + +type IProps = IExternalProps & ISubscriptionProps<[Scheme[], Signal[] | any]>; class DaoSchemesPage extends React.Component { @@ -49,7 +64,11 @@ class DaoSchemesPage extends React.Component { public render() { const { data } = this.props; const dao = this.props.daoState; - const allSchemes = data; + const [allSchemes, signalsData] = data; + const { signals } = signalsData.data; + const signal = signals.length > 0 ? signals[0] : null; + const daoHeaderBackground = signal ? JSON.parse(signal.data).Header : null; + const backgroundImage = daoHeaderBackground ? daoHeaderBackground : null; const contributionReward = allSchemes.filter((scheme: Scheme) => scheme.staticState.name === "ContributionReward"); const knownSchemes = allSchemes.filter((scheme: Scheme) => scheme.staticState.name !== "ContributionReward" && KNOWN_SCHEME_NAMES.indexOf(scheme.staticState.name) >= 0); @@ -79,9 +98,9 @@ class DaoSchemesPage extends React.Component { return (
-
- {dao.name} - + { backgroundImage && } + {dao.name} + { signal && }

All Plugins

@@ -106,7 +125,21 @@ export default withSubscription({ errorComponent: (props) => {props.error.message}, checkForUpdate: [], createObservable: (props: IExternalProps) => { + const arc = getArc(); const dao = props.daoState.dao; - return dao.schemes({}, { fetchAllData: true, subscribe: true }); + const schemes = dao.schemes({}, { fetchAllData: true, subscribe: true }); + // const DAOAddress = props.daoState.address; + // Currently only one dao has signal data + const DAOAddress = "0x771d0279e094b547f0b42d72dd6bfcce278d9a20"; + const signalQuery = gql` + { + signals(where: { id: "${DAOAddress}" } ) { + id + data + } + } + `; + const signalSchemeData = arc.getObservable(signalQuery); + return combineLatest(schemes, signalSchemeData); }, }); From ee3ac8acef1f78960acdd371463d3acca998c968 Mon Sep 17 00:00:00 2001 From: Shubhendu Shekhar Date: Tue, 10 Mar 2020 16:52:21 +0100 Subject: [PATCH 04/38] add action to save ipfs data --- src/actions/arcActions.ts | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/actions/arcActions.ts b/src/actions/arcActions.ts index 390b05b69..6e02d5966 100644 --- a/src/actions/arcActions.ts +++ b/src/actions/arcActions.ts @@ -1,4 +1,5 @@ -import { Address, DAO, IProposalCreateOptions, IProposalOutcome, ITransactionState, ITransactionUpdate, ReputationFromTokenScheme, Scheme } from "@daostack/client"; +import { Address, DAO, IProposalCreateOptions, IProposalOutcome, ITransactionState, + ITransactionUpdate, ReputationFromTokenScheme, Scheme } from "@daostack/client"; import { IAsyncAction } from "actions/async"; import { getArc } from "arc"; import { toWei } from "lib/util"; @@ -38,11 +39,28 @@ export const operationNotifierObserver = (dispatch: Redux.Dispatch, tx ]; }; +export function saveSignalDescription(signalDescription: any): ThunkAction { + return async (_getState: () => IRootState) => { + const arc = getArc(); + let ipfsDataToSave: object = {}; + if (signalDescription.key && signalDescription.value !== undefined) { + if (!arc.ipfsProvider) { + throw Error("No ipfsProvider set on Arc instance - cannot save data on IPFS"); + } + ipfsDataToSave = { + key: signalDescription.key, + value: signalDescription.value, + }; + } + return await arc.ipfs.addAndPinString(Buffer.from(JSON.stringify(ipfsDataToSave))); + }; +} + export function createProposal(proposalOptions: IProposalCreateOptions): ThunkAction { return async (dispatch: Redux.Dispatch, _getState: () => IRootState) => { try { const arc = getArc(); - + const dao = new DAO(proposalOptions.dao, arc); const observer = operationNotifierObserver(dispatch, "Create proposal"); From 774ed7cff5a5f44e720169dcd9068cdce8800f43 Mon Sep 17 00:00:00 2001 From: Shubhendu Shekhar Date: Tue, 10 Mar 2020 16:52:39 +0100 Subject: [PATCH 05/38] update signal scheme url --- src/settings.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/settings.ts b/src/settings.ts index 2c458b736..42d0f72be 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -126,8 +126,8 @@ export const settings = { web3ConnectProviderOptions: {}, }, rinkeby: { - graphqlHttpProvider: process.env.ARC_GRAPHQLHTTPPROVIDER || "https://api.thegraph.com/subgraphs-daostack/name/daostack/v38_3_rinkeby", - graphqlWsProvider: process.env.ARC_GRAPHQLWSPROVIDER || "wss://api.thegraph.com/subgraphs-daostack/name/daostack/v38_3_rinkeby", + graphqlHttpProvider: process.env.ARC_GRAPHQLHTTPPROVIDER || "https://api.thegraph.com/subgraphs/name/shekhar-shubhendu/signal-scheme-one", + graphqlWsProvider: process.env.ARC_GRAPHQLWSPROVIDER || "wss://api.thegraph.com/subgraphs/name/shekhar-shubhendu/signal-scheme-one", graphqlSubscribeToQueries: false, web3Provider: process.env.ARC_WEB3PROVIDER || "wss://rinkeby.infura.io/ws/v3/e0cdf3bfda9b468fa908aa6ab03d5ba2", web3ProviderRead: process.env.ARC_WEB3PROVIDERREAD || "wss://rinkeby.infura.io/ws/v3/e0cdf3bfda9b468fa908aa6ab03d5ba2", From 12c1b580359a4dbc208f087dfeb022fce0842256 Mon Sep 17 00:00:00 2001 From: Shubhendu Shekhar Date: Tue, 10 Mar 2020 16:53:01 +0100 Subject: [PATCH 06/38] update Signals.json --- .../schemes/Signals.json | 74 +++++++++---------- 1 file changed, 33 insertions(+), 41 deletions(-) diff --git a/src/genericSchemeRegistry/schemes/Signals.json b/src/genericSchemeRegistry/schemes/Signals.json index 7ae85aefa..86ba86b07 100644 --- a/src/genericSchemeRegistry/schemes/Signals.json +++ b/src/genericSchemeRegistry/schemes/Signals.json @@ -13,37 +13,38 @@ }, "actions": [ { - "id": "createSignalType", + "id": "createSignalData", "label": "Create Signal Attribute", "description": "Create a signal attribute", "notes": "docs/link", "fields": [ { - "name": "approved", - "defaultValue": 1, - "label": "Update data of the selected signal type", - "labelTrue": "Name", - "labelFalse": "Description" + "name": "key", + "label": "Attribute to add", + "placeholder": "Attribute type to add e.g. Header, Icon" }, { - "label": "Signal Data", - "name": "signalData", - "placeholder": "Data (Name, Description)" + "name": "value", + "label": "Attribute value", + "placeholder": "Attribute value", + "defaultValue": "" } ], "abi": { "constant": false, "inputs": [ { - "name": "approved", - "type": "bool" + "internalType": "string", + "name": "_descriptionHash", + "type": "string" }, { - "name": "signalType", + "internalType": "string", + "name": "_descriptionHash", "type": "string" } ], - "name": "updateSignalData", + "name": "signal", "outputs": [], "payable": false, "stateMutability": "nonpayable", @@ -57,31 +58,32 @@ "notes": "docs/link", "fields": [ { - "name": "approved", - "defaultValue": 1, - "label": "Update data of the selected signal type", - "labelTrue": "Name", - "labelFalse": "Description" + "name": "key", + "label": "Attribute to update", + "placeholder": "Attribute type to add e.g. Header, Icon" }, { - "label": "Signal Data", - "name": "signalData", - "placeholder": "Data (Name, Description)" + "name": "value", + "label": "Attribute value", + "placeholder": "Attribute value", + "defaultValue": "" } ], "abi": { "constant": false, "inputs": [ { - "name": "approved", - "type": "bool" + "internalType": "string", + "name": "_descriptionHash", + "type": "string" }, { - "name": "signalType", + "internalType": "string", + "name": "_descriptionHash", "type": "string" } ], - "name": "updateSignalData", + "name": "signal", "outputs": [], "payable": false, "stateMutability": "nonpayable", @@ -95,31 +97,21 @@ "notes": "docs/link", "fields": [ { - "name": "approved", - "defaultValue": 1, - "label": "Update data of the selected signal type", - "labelTrue": "Name", - "labelFalse": "Description" - }, - { - "label": "Signal Data", - "name": "signalData", - "placeholder": "Data (Name, Description)" + "name": "key", + "label": "Attribute to delete", + "placeholder": "Attribute type to add e.g. Header, Icon" } ], "abi": { "constant": false, "inputs": [ { - "name": "approved", - "type": "bool" - }, - { - "name": "signalType", + "internalType": "string", + "name": "_descriptionHash", "type": "string" } ], - "name": "updateSignalData", + "name": "signal", "outputs": [], "payable": false, "stateMutability": "nonpayable", From 867e99ebc614174c43316779163267d0297f9e8e Mon Sep 17 00:00:00 2001 From: Shubhendu Shekhar Date: Tue, 10 Mar 2020 16:53:47 +0100 Subject: [PATCH 07/38] update logic to save/update/delete signals data --- .../CreateKnownGenericSchemeProposal.tsx | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/src/components/Proposal/Create/SchemeForms/CreateKnownGenericSchemeProposal.tsx b/src/components/Proposal/Create/SchemeForms/CreateKnownGenericSchemeProposal.tsx index f551a41c4..73b8d799e 100644 --- a/src/components/Proposal/Create/SchemeForms/CreateKnownGenericSchemeProposal.tsx +++ b/src/components/Proposal/Create/SchemeForms/CreateKnownGenericSchemeProposal.tsx @@ -37,11 +37,13 @@ const mapStateToProps = (state: IRootState, ownProps: IStateProps) => { interface IDispatchProps { createProposal: typeof arcActions.createProposal; + saveSignalData: typeof arcActions.saveSignalDescription; showNotification: typeof showNotification; } const mapDispatchToProps = { createProposal: arcActions.createProposal, + saveSignalData: arcActions.saveSignalDescription, showNotification, }; @@ -82,26 +84,36 @@ class CreateKnownSchemeProposal extends React.Component { private handleSubmit = async (values: IFormValues, { setSubmitting }: any ): Promise => { if (!await enableWalletProvider({ showNotification: this.props.showNotification })) { return; } - const currentAction = this.state.currentAction; - const callValues = []; for (const field of currentAction.getFields()) { const callValue = field.callValue(values[field.name]); values[field.name] = callValue; callValues.push(callValue); } - let callData = ""; try { - callData = this.props.genericSchemeInfo.encodeABI(currentAction, callValues); + + if(values.key) { + const ipfsValue = { + key: values.key, + value: "", + }; + if(currentAction.id !== "deleteSignalType") { + ipfsValue.value = values.value; + currentAction.abi.inputs.pop(); + } + const ipfsData = await this.props.saveSignalData(ipfsValue); + callData = this.props.genericSchemeInfo.encodeABI(currentAction, [ipfsData]); + } else { + callData = this.props.genericSchemeInfo.encodeABI(currentAction, callValues); + } } catch (err) { showNotification(NotificationStatus.Failure, err.message); setSubmitting(false); return; } setSubmitting(false); - const proposalValues = { ...values, callData, From f67a8c8687c60af8668bdf9b8887866a3e21e4ff Mon Sep 17 00:00:00 2001 From: Shubhendu Shekhar Date: Tue, 10 Mar 2020 16:54:19 +0100 Subject: [PATCH 08/38] linting and small fixes. remove hardcoded address --- src/components/Dao/DaoHeader.tsx | 4 ++-- src/components/Dao/DaoSchemesPage.tsx | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/Dao/DaoHeader.tsx b/src/components/Dao/DaoHeader.tsx index 529ee8ac1..3ef766bae 100644 --- a/src/components/Dao/DaoHeader.tsx +++ b/src/components/Dao/DaoHeader.tsx @@ -97,7 +97,7 @@ const styles = { borderRadius: "50%", borderColor: "white", borderStyle: "solid", - } + }, }; -export default DaoHeader; \ No newline at end of file +export default DaoHeader; diff --git a/src/components/Dao/DaoSchemesPage.tsx b/src/components/Dao/DaoSchemesPage.tsx index d09e57967..fd6adbcca 100644 --- a/src/components/Dao/DaoSchemesPage.tsx +++ b/src/components/Dao/DaoSchemesPage.tsx @@ -98,9 +98,9 @@ class DaoSchemesPage extends React.Component { return (
- { backgroundImage && } - {dao.name} - { signal && } + { backgroundImage && } + {dao.name} + { signal && }

All Plugins

@@ -130,7 +130,7 @@ export default withSubscription({ const schemes = dao.schemes({}, { fetchAllData: true, subscribe: true }); // const DAOAddress = props.daoState.address; // Currently only one dao has signal data - const DAOAddress = "0x771d0279e094b547f0b42d72dd6bfcce278d9a20"; + const DAOAddress = dao.id; const signalQuery = gql` { signals(where: { id: "${DAOAddress}" } ) { From 25a18c595484c0be9b8f770aa53a93788bb24de7 Mon Sep 17 00:00:00 2001 From: Doug Kent Date: Thu, 5 Mar 2020 08:51:33 -0600 Subject: [PATCH 09/38] in history, open proposal in new tab on ctrl-click (#1474) * open proposal in new tab with ctrl-click * typo * handle mac command key --- src/components/Proposal/ProposalHistoryRow.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/Proposal/ProposalHistoryRow.tsx b/src/components/Proposal/ProposalHistoryRow.tsx index 1210f9a6b..f4afc68ee 100644 --- a/src/components/Proposal/ProposalHistoryRow.tsx +++ b/src/components/Proposal/ProposalHistoryRow.tsx @@ -68,9 +68,14 @@ class ProposalHistoryRow extends React.Component { } } - private gotoProposal = () => { + private gotoProposal = (e: any) => { const { daoState, history, proposal } = this.props; - history.push("/dao/" + daoState.address + "/proposal/" + proposal.id); + const url = `/dao/${daoState.address}/proposal/${proposal.id}`; + if (e.ctrlKey || ((navigator.platform === "MacIntel") && e.metaKey)) { + window.open(url, "_blank"); + } else { + history.push(url); + } } public render(): RenderOutput { From 243108ea34bc75156dff705f51977a0864d990e9 Mon Sep 17 00:00:00 2001 From: Doug Kent Date: Thu, 5 Mar 2020 08:52:06 -0600 Subject: [PATCH 10/38] show DAO total rep in sidebar (#1473) --- src/layouts/SidebarMenu.tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/layouts/SidebarMenu.tsx b/src/layouts/SidebarMenu.tsx index 24edd5256..1378c071f 100644 --- a/src/layouts/SidebarMenu.tsx +++ b/src/layouts/SidebarMenu.tsx @@ -11,7 +11,7 @@ import FollowButton from "components/Shared/FollowButton"; import withSubscription, { ISubscriptionProps } from "components/Shared/withSubscription"; import { generate } from "geopattern"; import Analytics from "lib/analytics"; -import { baseTokenName, ethErrorHandler, formatTokens, genName, getExchangesList, supportedTokens } from "lib/util"; +import { baseTokenName, ethErrorHandler, formatTokens, genName, getExchangesList, supportedTokens, fromWei } from "lib/util"; import { parse } from "query-string"; import * as React from "react"; import { matchPath, Link, RouteComponentProps } from "react-router-dom"; @@ -20,6 +20,7 @@ import { IRootState } from "reducers"; import { connect } from "react-redux"; import { combineLatest, of, from } from "rxjs"; +import Tooltip from "rc-tooltip"; import * as css from "./SidebarMenu.scss"; type IExternalProps = RouteComponentProps; @@ -193,6 +194,14 @@ class SidebarMenu extends React.Component {
    +
  • + + {formatTokens(dao.reputationTotalSupply)} REP + +
  • + {Object.keys(supportedTokens()).map((tokenAddress) => { From 59cef6356ac17b232687833ca34dd8dd273c5066 Mon Sep 17 00:00:00 2001 From: Tibet Sprague Date: Wed, 4 Mar 2020 10:35:08 -0800 Subject: [PATCH 11/38] In create proposal form tab directly from title to description Fixes: https://github.com/daostack/alchemy/issues/964 --- package-lock.json | 33 ++++++------------- package.json | 2 +- .../Create/SchemeForms/MarkdownField.tsx | 8 +++++ 3 files changed, 19 insertions(+), 24 deletions(-) diff --git a/package-lock.json b/package-lock.json index d8d2ffd20..32fc76687 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8714,8 +8714,7 @@ "arrify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", - "dev": true + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=" }, "asap": { "version": "2.0.6", @@ -13575,8 +13574,7 @@ "diff": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", - "dev": true + "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==" }, "diff-sequences": { "version": "24.9.0", @@ -25665,8 +25663,7 @@ "make-error": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.5.tgz", - "integrity": "sha512-c3sIjNUow0+8swNwVpqoH4YCShKNFkMaw6oH1mNS2haDZQqkeZFlHS3dhoeEbKKmJB4vXpJucU6oH75aDYeE9g==", - "dev": true + "integrity": "sha512-c3sIjNUow0+8swNwVpqoH4YCShKNFkMaw6oH1mNS2haDZQqkeZFlHS3dhoeEbKKmJB4vXpJucU6oH75aDYeE9g==" }, "makeerror": { "version": "1.0.11", @@ -32977,9 +32974,9 @@ } }, "react-mde": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/react-mde/-/react-mde-7.9.0.tgz", - "integrity": "sha512-nXLMDArq5Xsbn2OZLgoUXDIa5+Z8DBCJttPicTvyatMrSYmTBGCj+SqoqlRJuIfch6ldWgNSsjTDgJvk1Lk+nQ==" + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/react-mde/-/react-mde-8.1.0.tgz", + "integrity": "sha512-ARh2tNEO49xvTNZ7YyygRi5SVZYiJs0inAAorEbmyQRLGSvcSYkh4gCeq4wVzjQsgk/oemZEt3QzQ/6g3pTYEw==" }, "react-on-screen": { "version": "2.1.1", @@ -37455,7 +37452,6 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-5.0.1.tgz", "integrity": "sha512-XK7QmDcNHVmZkVtkiwNDWiERRHPyU8nBqZB1+iv2UhOG0q3RQ9HsZ2CMqISlFbxjrYFGfG2mX7bW4dAyxBVzUw==", - "dev": true, "requires": { "arrify": "^1.0.0", "chalk": "^2.3.0", @@ -37471,7 +37467,6 @@ "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, "requires": { "color-convert": "^1.9.0" } @@ -37480,7 +37475,6 @@ "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, "requires": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", @@ -37490,14 +37484,12 @@ "minimist": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "dev": true + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" }, "mkdirp": { "version": "0.5.1", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", - "dev": true, "requires": { "minimist": "0.0.8" }, @@ -37505,22 +37497,19 @@ "minimist": { "version": "0.0.8", "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" } } }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" }, "source-map-support": { "version": "0.5.16", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.16.tgz", "integrity": "sha512-efyLRJDr68D9hBBNIPWFjhpFzURh+KJykQwvMyW5UiZzYwoF6l4YMMDIJJEyFWxWCqfyxLzz6tSfUFR+kXXsVQ==", - "dev": true, "requires": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" @@ -37530,7 +37519,6 @@ "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, "requires": { "has-flag": "^3.0.0" } @@ -40174,8 +40162,7 @@ "yn": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/yn/-/yn-2.0.0.tgz", - "integrity": "sha1-5a2ryKz0CPY4X8dklWhMiOavaJo=", - "dev": true + "integrity": "sha1-5a2ryKz0CPY4X8dklWhMiOavaJo=" }, "zcash-bitcore-lib": { "version": "0.13.20-rc3", diff --git a/package.json b/package.json index 31588a202..afa6ef9cd 100644 --- a/package.json +++ b/package.json @@ -119,7 +119,7 @@ "react-linkify": "^0.2.2", "react-lottie": "^1.2.3", "react-markdown": "^4.0.8", - "react-mde": "^7.4.1", + "react-mde": "^8.1.0", "react-on-screen": "^2.1.1", "react-redux": "^5.1.1", "react-router-dom": "^4.2.2", diff --git a/src/components/Proposal/Create/SchemeForms/MarkdownField.tsx b/src/components/Proposal/Create/SchemeForms/MarkdownField.tsx index bf968682d..44257177e 100644 --- a/src/components/Proposal/Create/SchemeForms/MarkdownField.tsx +++ b/src/components/Proposal/Create/SchemeForms/MarkdownField.tsx @@ -53,6 +53,14 @@ export default class MarkdownField extends React.Component { onTabChange={this.onTabChange} selectedTab={this.state.selectedTab} value={field.value} + childProps={{ + writeButton: { + tabIndex: -1 + }, + previewButton: { + tabIndex: -1 + }, + }} />
); From 89848736b30b45de5d2046be96084a1f410448b7 Mon Sep 17 00:00:00 2001 From: Tibet Sprague Date: Wed, 4 Mar 2020 12:29:34 -0800 Subject: [PATCH 12/38] Lint fix --- src/components/Proposal/Create/SchemeForms/MarkdownField.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Proposal/Create/SchemeForms/MarkdownField.tsx b/src/components/Proposal/Create/SchemeForms/MarkdownField.tsx index 44257177e..1f58fe455 100644 --- a/src/components/Proposal/Create/SchemeForms/MarkdownField.tsx +++ b/src/components/Proposal/Create/SchemeForms/MarkdownField.tsx @@ -55,10 +55,10 @@ export default class MarkdownField extends React.Component { value={field.value} childProps={{ writeButton: { - tabIndex: -1 + tabIndex: -1, }, previewButton: { - tabIndex: -1 + tabIndex: -1, }, }} /> From 805a2b3afd110fd184eb56572f6881f37ddc61f1 Mon Sep 17 00:00:00 2001 From: Tibet Sprague Date: Fri, 6 Mar 2020 12:53:11 -0800 Subject: [PATCH 13/38] Require NETWORK env var on Heroku and default to rinkeby --- app.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app.json b/app.json index 1591993d6..a8232a33e 100644 --- a/app.json +++ b/app.json @@ -7,6 +7,10 @@ "required": true, "value": "staging" }, + "NETWORK": { + "required": true, + "value": "rinkeby" + }, "DISQUS_SITE": { "required": true, "value": "daostack-alchemy-staging" From 67bed9a41b31954b632527987fdb494d03e9f00a Mon Sep 17 00:00:00 2001 From: Tibet Sprague Date: Wed, 26 Feb 2020 10:32:09 -0800 Subject: [PATCH 14/38] Close modals by pressing ESC --- .../Proposal/Create/CreateProposalPage.tsx | 13 +++++++++++ .../Proposal/Voting/VotersModal.tsx | 15 ++++++++++++ src/components/Shared/PreTransactionModal.tsx | 1 - src/components/Shared/SocialShareModal.tsx | 23 +++++++++++++++---- src/components/Shared/ThreeboxModal.tsx | 15 ++++++++++++ 5 files changed, 62 insertions(+), 5 deletions(-) diff --git a/src/components/Proposal/Create/CreateProposalPage.tsx b/src/components/Proposal/Create/CreateProposalPage.tsx index aa7bdaa19..a06097006 100644 --- a/src/components/Proposal/Create/CreateProposalPage.tsx +++ b/src/components/Proposal/Create/CreateProposalPage.tsx @@ -61,6 +61,8 @@ class CreateProposalPage extends React.Component { } public async componentDidMount() { + document.addEventListener("keydown", this.handleKeyPress, false); + Analytics.track("Page View", { "Page Name": Page.CreateProposal, "DAO Address": this.props.daoAvatarAddress, @@ -79,6 +81,17 @@ class CreateProposalPage extends React.Component { this.setState(newState); } + public componentWillUnmount(){ + document.removeEventListener("keydown", this.handleKeyPress, false); + } + + private handleKeyPress = (e: any) => { + // Close modal on ESC key press + if (e.keyCode === 27) { + this.doClose(); + } + } + public render(): RenderOutput { const { daoAvatarAddress } = this.props; const scheme = this.props.data; diff --git a/src/components/Proposal/Voting/VotersModal.tsx b/src/components/Proposal/Voting/VotersModal.tsx index 10f43f0ad..5e7572d5b 100644 --- a/src/components/Proposal/Voting/VotersModal.tsx +++ b/src/components/Proposal/Voting/VotersModal.tsx @@ -70,6 +70,21 @@ type IProps = IExternalProps & IStateProps & ISubscriptionProps { + public async componentDidMount() { + document.addEventListener("keydown", this.handleKeyPress, false); + } + + public componentWillUnmount(){ + document.removeEventListener("keydown", this.handleKeyPress, false); + } + + private handleKeyPress = (e: any) => { + // Close modal on ESC key press + if (e.keyCode === 27) { + this.props.closeAction(); + } + } + public async handleClickDone() { this.props.closeAction(); } diff --git a/src/components/Shared/PreTransactionModal.tsx b/src/components/Shared/PreTransactionModal.tsx index a8f270379..2700cefd0 100644 --- a/src/components/Shared/PreTransactionModal.tsx +++ b/src/components/Shared/PreTransactionModal.tsx @@ -102,7 +102,6 @@ class PreTransactionModal extends React.Component { // Do action on Enter key press if (e.keyCode === 13) { if (actionType === ActionTypes.StakeFail || actionType === ActionTypes.StakePass) { - console.log(this.state.stakeAmount, fromWei(currentAccountGens), this.state.stakeAmount > 0); if (this.state.stakeAmount > 0 && this.state.stakeAmount <= fromWei(currentAccountGens)) { this.handleClickAction(); } diff --git a/src/components/Shared/SocialShareModal.tsx b/src/components/Shared/SocialShareModal.tsx index 62333acbd..370e14ce3 100644 --- a/src/components/Shared/SocialShareModal.tsx +++ b/src/components/Shared/SocialShareModal.tsx @@ -29,6 +29,21 @@ export default class SocialShareModal extends React.Component { }; } + public async componentDidMount() { + document.addEventListener("keydown", this.handleKeyPress, false); + } + + public componentWillUnmount(){ + document.removeEventListener("keydown", this.handleKeyPress, false); + } + + private handleKeyPress = (e: any) => { + // Close modal on ESC key press + if (e.keyCode === 27) { + this.props.closeHandler(e); + } + } + private showCopiedFeedback(): void { this.setState({ showCopiedFeedback: true }); setTimeout(() => this.hideCopiedFeedback(), 5000); @@ -43,11 +58,11 @@ export default class SocialShareModal extends React.Component { private selectTwitter(_event: any): void { const sharingUrl = `https://twitter.com/intent/tweet/?text=${this.sharingMsgTwitter}&url=${this.props.url}`; - window.open(sharingUrl, "_blank"); + window.open(sharingUrl, "_blank"); } private selectReddit(_event: any): void { const sharingUrl = `https://reddit.com/submit/?url=${this.props.url}&resubmit=true&title=${this.sharingMsg}`; - window.open(sharingUrl, "_blank"); + window.open(sharingUrl, "_blank"); } private selectFacebook(_event: any): void { const sharingUrl = `https://facebook.com/sharer/sharer.php?u=${this.props.url}`; @@ -55,7 +70,7 @@ export default class SocialShareModal extends React.Component { } private selectTelegram(_event: any): void { const sharingUrl = `https://telegram.me/share/url?text=${this.sharingMsg}&url=${this.props.url}`; - window.open(sharingUrl, "_blank"); + window.open(sharingUrl, "_blank"); } private copyUrl(_event: any) { copyToClipboard(this.props.url); @@ -78,7 +93,7 @@ export default class SocialShareModal extends React.Component {
Link
- { this.state.showCopiedFeedback ? + { this.state.showCopiedFeedback ?
copied
: "" } diff --git a/src/components/Shared/ThreeboxModal.tsx b/src/components/Shared/ThreeboxModal.tsx index 10a80db98..df3789d95 100644 --- a/src/components/Shared/ThreeboxModal.tsx +++ b/src/components/Shared/ThreeboxModal.tsx @@ -32,6 +32,21 @@ class ThreeboxModal extends React.Component { }; } + public async componentDidMount() { + document.addEventListener("keydown", this.handleKeyPress, false); + } + + public componentWillUnmount(){ + document.removeEventListener("keydown", this.handleKeyPress, false); + } + + private handleKeyPress = (e: any) => { + // Close modal on ESC key press + if (e.keyCode === 27) { + this.props.closeHandler(e); + } + } + private handleClickGo = async (e: any): Promise => { this.props.action(); this.props.closeHandler(e); From dd125338771e7ca0d7d168f104713a4d4f7b34ce Mon Sep 17 00:00:00 2001 From: Tibet Sprague Date: Wed, 26 Feb 2020 10:33:06 -0800 Subject: [PATCH 15/38] Fix styling of submit button on profile page when submitting --- src/components/Account/Account.scss | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/Account/Account.scss b/src/components/Account/Account.scss index c3dbe4907..5da5f2fab 100644 --- a/src/components/Account/Account.scss +++ b/src/components/Account/Account.scss @@ -341,6 +341,8 @@ input { .loading { width: 18px; display: none; + margin: 0; + vertical-align: middle; } } .submitButton:disabled .loading { From ad3e3249ff11b3d86273a8175a97b2324326d473 Mon Sep 17 00:00:00 2001 From: Tibet Sprague Date: Wed, 26 Feb 2020 10:33:37 -0800 Subject: [PATCH 16/38] Make sure tooltip on redemptions button doesn't cover the button --- src/components/Proposal/ActionButton.tsx | 2 +- src/components/Shared/PreTransactionModal.scss | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components/Proposal/ActionButton.tsx b/src/components/Proposal/ActionButton.tsx index d33b50ec6..fd9371620 100644 --- a/src/components/Proposal/ActionButton.tsx +++ b/src/components/Proposal/ActionButton.tsx @@ -254,7 +254,7 @@ class ActionButton extends React.Component { : displayRedeemButton ?
- + +
+
+ {yesVotes.length ? +
{yesVotes.map((vote) => )}
+ : +
No one has voted For
+ } +
+
+ {noVotes.length ? +
{noVotes.map((vote) => )}
+ : +
No one has voted Against
+ }
-
- +
} + footer={
} + /> ); } } diff --git a/src/components/Shared/ModalPopup.scss b/src/components/Shared/ModalPopup.scss new file mode 100644 index 000000000..184eb4fa1 --- /dev/null +++ b/src/components/Shared/ModalPopup.scss @@ -0,0 +1,56 @@ +.modalWindow { + position: absolute; + left: 50%; + top: 50%; + transform: translate(-50%,-50%); + transition: all .25s ease; + border-radius: 15px 15px 15px 15px; + z-index: 99999999999999999; +} + +.header { + background-color: rgba(18, 46, 91, 1.000); + padding: 12px 20px; + color: $white; + z-index: 100000; + position: relative; + border-radius: 15px 15px 0 0; + font-size: 21px; +} + +.body { + height: 100%; + padding: 20px; + background-color: white; +} + +.footer { + padding: 10px; + border-top: $gray-border-2; + background: white; + border-radius: 0 0 15px 15px; + position: relative; +} + +.footer::after { + content: ""; + clear: right; +} + +@media only screen and (max-width: 425px) { + .modalWindow { + top: 0; + left: 0; + transform: none; + width: 100% !important; + border-radius: 0; + } + + .header { + border-radius: 0; + } + + .footer { + border-radius: 0; + } +} \ No newline at end of file diff --git a/src/components/Shared/ModalPopup.tsx b/src/components/Shared/ModalPopup.tsx new file mode 100644 index 000000000..c42bdaf3f --- /dev/null +++ b/src/components/Shared/ModalPopup.tsx @@ -0,0 +1,43 @@ +import * as React from "react"; +import { Modal } from "react-router-modal"; +import * as css from "./ModalPopup.scss"; + +interface IProps { + closeHandler: (event: any) => void; + body: any; + footer?: any; + header: any; + width: number; +} + +export default class ModalPopup extends React.Component { + + public async componentDidMount() { + document.addEventListener("keydown", this.handleKeyPress, false); + } + + public componentWillUnmount() { + document.removeEventListener("keydown", this.handleKeyPress, false); + } + + private handleKeyPress = (e: any) => { + // Close modal on ESC key press + if (e.keyCode === 27) { + this.props.closeHandler(e); + } + } + + public render(): RenderOutput { + const { closeHandler, body, footer, header, width } = this.props; + + return ( + +
+
{header}
+
{body}
+ {footer ?
{footer}
: ""} +
+
+ ); + } +} diff --git a/src/components/Shared/SocialShareModal.scss b/src/components/Shared/SocialShareModal.scss index e7b71538c..5b8cb3810 100644 --- a/src/components/Shared/SocialShareModal.scss +++ b/src/components/Shared/SocialShareModal.scss @@ -1,163 +1,118 @@ -.modalWindow { - width: 318px; - position: absolute; - left: 50%; - top: 50%; - transform: translate(-50%,-50%); - transition: all .25s ease; - border-radius: 15px 15px 0 0; - z-index: 99999999999999999; + +.icon { + display: inline-block; + + img { + height: 21px; + margin-right: 10px; + position: relative; + top:4px; + } } -.header { - background-color: rgba(18, 46, 91, 1.000); - padding: 12px 20px; - color: $white; - z-index: 100000; +.headerTitle { + display: inline-block; position: relative; - border-radius: 15px 15px 0 0; - font-size: 21px; +} - .icon { - display: inline-block; +.closeButton { + color: #9aa9b5; + position: fixed; + display: inline-block; + right: 16px; + cursor: pointer; +} - img { - height: 21px; - margin-right: 10px; - position: relative; - top:4px; - } - } +.link { + padding: 10px; .title { display: inline-block; - position: relative; + height: 18px; + font-size: 16px; + color: #4f6176; + margin-bottom: 4px; } - .closeButton { + .url { + display:inline-block; + width:240px; + overflow: hidden; + text-overflow: ellipsis; + font-family: "Open Sans"; + font-size: 13px; + font-weight: normal; + font-style: normal; + font-stretch: normal; + line-height: 1; + letter-spacing: 0.2px; color: #9aa9b5; - position: fixed; - display: inline-block; - right: 16px; + margin-right: 6px; + } + + .copyButton { cursor: pointer; + display: inline-block; + img { + height: 13px; + } + } + + .copied { + display: inline-block; + position: fixed; + right: 20px; + font-family: "Open Sans"; + font-size: 11px; + font-weight: normal; + font-style: normal; + font-stretch: normal; + line-height: normal; + letter-spacing: normal; + color: #0071ff; } } -.content { - height: 100%; - background-color: white; +hr { + color: #e5ebf2; + margin: 0 0 12px 0; +} - .link { - padding: 24px 30px 24px 30px; +.socialSitesList { + margin-bottom: 12px; - .title { - display: inline-block; - height: 18px; - font-size: 16px; - font-weight: normal; - font-style: normal; - font-stretch: normal; - line-height: normal; - letter-spacing: normal; - color: #4f6176; - margin-bottom: 4px; - } - - .url { - display:inline-block; - width:240px; - overflow: hidden; - text-overflow: ellipsis; - font-family: "Open Sans"; - font-size: 13px; - font-weight: normal; - font-style: normal; - font-stretch: normal; - line-height: 1; - letter-spacing: 0.2px; - color: #9aa9b5; - margin-right: 6px; - } + .socialSite { + padding-left: 20px; + padding-right: 30px; + padding-top: 10px; + padding-bottom: 10px; + cursor: pointer; - .copyButton { - cursor: pointer; + .icon { display: inline-block; + margin-right: 8px; img { - height: 13px; + width: 40px; + height: 40px; } } - .copied { + .name { + position: relative; + bottom: 12px; display: inline-block; - position: fixed; - right: 20px; font-family: "Open Sans"; - font-size: 11px; + font-size: 16px; font-weight: normal; font-style: normal; font-stretch: normal; line-height: normal; letter-spacing: normal; - color: #0071ff; + color: #4f6176; } } - hr { - color: #e5ebf2; - margin: 0 0 12px 0; - } - - .socialSitesList { - margin-bottom: 12px; - - .socialSite { - padding-left: 30px; - padding-right: 30px; - padding-top: 10px; - padding-bottom: 10px; - cursor: pointer; - - .icon { - display: inline-block; - margin-right: 8px; - img { - width: 40px; - height: 40px; - } - } - - .name { - position: relative; - bottom: 12px; - display: inline-block; - font-family: "Open Sans"; - font-size: 16px; - font-weight: normal; - font-style: normal; - font-stretch: normal; - line-height: normal; - letter-spacing: normal; - color: #4f6176; - } - } - - .socialSite:hover { - background-color: #e1ebf7; - } + .socialSite:hover { + background-color: #e1ebf7; } } - - - -@media only screen and (max-width: 425px) { - .modalWindow { - width: 318px; - position: absolute; - left: 50%; - top: 20px; - transform: translate(-50%, 0); - transition: all .25s ease; - border-radius: 15px 15px 0 0; - z-index: 99999999999999999; - } -} \ No newline at end of file diff --git a/src/components/Shared/SocialShareModal.tsx b/src/components/Shared/SocialShareModal.tsx index 370e14ce3..dd41f3fa7 100644 --- a/src/components/Shared/SocialShareModal.tsx +++ b/src/components/Shared/SocialShareModal.tsx @@ -1,6 +1,6 @@ -import * as React from "react"; -import { Modal } from "react-router-modal"; +import ModalPopup from "components/shared/ModalPopup"; import { copyToClipboard } from "lib/util"; +import * as React from "react"; import Tooltip from "rc-tooltip"; import * as css from "./SocialShareModal.scss"; @@ -29,21 +29,6 @@ export default class SocialShareModal extends React.Component { }; } - public async componentDidMount() { - document.addEventListener("keydown", this.handleKeyPress, false); - } - - public componentWillUnmount(){ - document.removeEventListener("keydown", this.handleKeyPress, false); - } - - private handleKeyPress = (e: any) => { - // Close modal on ESC key press - if (e.keyCode === 27) { - this.props.closeHandler(e); - } - } - private showCopiedFeedback(): void { this.setState({ showCopiedFeedback: true }); setTimeout(() => this.hideCopiedFeedback(), 5000); @@ -77,43 +62,38 @@ export default class SocialShareModal extends React.Component { this.showCopiedFeedback(); } - - public render(): RenderOutput { return ( - -
-
-
-
Share
- -
-
-
-
-
-
Link
- { this.state.showCopiedFeedback ? -
copied
- : "" - } - -
{this.props.url}
-
- -
-
-
-
-
-
Twitter
-
Reddit
-
Facebook
-
Telegram
-
-
-
-
+ +
+
Share
+ +
+
+ } + body={
+
Link
+ { this.state.showCopiedFeedback ? +
copied
+ : "" + } + +
{this.props.url}
+
+ +
+
+
} + footer={
+
Twitter
+
Reddit
+
Facebook
+
Telegram
+
} + /> ); } } diff --git a/src/components/Shared/ThreeboxModal.scss b/src/components/Shared/ThreeboxModal.scss index 6f5e46921..5088c825f 100644 --- a/src/components/Shared/ThreeboxModal.scss +++ b/src/components/Shared/ThreeboxModal.scss @@ -1,29 +1,5 @@ -.modalWindow { - width: 510px; - position: absolute; - left: 50%; - top: 50%; - transform: translate(-50%,-50%); - transition: all .25s ease; - border-radius: 15px 15px 15px 15px; - z-index: 99999999999999999; - font-family: OpenSans; -} - -.header { - background-color: rgba(18, 46, 91, 1.000); - padding: 12px 20px; - color: $white; - z-index: 100000; - position: relative; - border-radius: 15px 15px 0 0; - font-size: 21px; -} - -.content { +.body { height: 100%; - background-color: white; - padding: 20px; text-align: center; font-size: 16px; color: #4f6176; @@ -52,18 +28,14 @@ } .footer { - padding: 20px 0; - border-top: $gray-border-2; - background: white; text-align: right; position: relative; - border-radius: 0 0 15px 15px; span { font-size: 11px; position: absolute; left: 25px; - top: 25px; + top: 5px; } button { @@ -85,27 +57,4 @@ color: #0071ff; background-color: white; } -} - -.footer::after { - content: ""; - clear: right; -} - -@media only screen and (max-width: 425px) { - .modalWindow { - top: 0; - left: 0; - transform: none; - width: 100%; - border-radius: 0; - } - - .header { - border-radius: 0; - } - - .footer { - border-radius: 0; - } } \ No newline at end of file diff --git a/src/components/Shared/ThreeboxModal.tsx b/src/components/Shared/ThreeboxModal.tsx index df3789d95..f035df358 100644 --- a/src/components/Shared/ThreeboxModal.tsx +++ b/src/components/Shared/ThreeboxModal.tsx @@ -1,8 +1,6 @@ -//import * as classNames from "classnames"; -//import Tooltip from "rc-tooltip"; import * as React from "react"; import { connect } from "react-redux"; -import { Modal } from "react-router-modal"; +import ModalPopup from "components/shared/ModalPopup"; import { showNotification } from "reducers/notifications"; import * as css from "./ThreeboxModal.scss"; @@ -32,21 +30,6 @@ class ThreeboxModal extends React.Component { }; } - public async componentDidMount() { - document.addEventListener("keydown", this.handleKeyPress, false); - } - - public componentWillUnmount(){ - document.removeEventListener("keydown", this.handleKeyPress, false); - } - - private handleKeyPress = (e: any) => { - // Close modal on ESC key press - if (e.keyCode === 27) { - this.props.closeHandler(e); - } - } - private handleClickGo = async (e: any): Promise => { this.props.action(); this.props.closeHandler(e); @@ -60,12 +43,12 @@ class ThreeboxModal extends React.Component { public render(): RenderOutput { return ( - -
-
- Connect -
-
+

We're using 3Box to save your personal data

@@ -78,6 +61,8 @@ class ThreeboxModal extends React.Component { Afterwards you won't need to sign more messages during this session.
+ )} + footer={(
Don't show this again
-
-
+ )} + /> ); } } From e57fb2281d09eb535171f1ed77d1a51c4623998a Mon Sep 17 00:00:00 2001 From: Tibet Sprague Date: Tue, 3 Mar 2020 17:10:03 -0800 Subject: [PATCH 18/38] Fix paths --- src/components/Proposal/Voting/VotersModal.tsx | 2 +- src/components/Shared/SocialShareModal.tsx | 2 +- src/components/Shared/ThreeboxModal.tsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/Proposal/Voting/VotersModal.tsx b/src/components/Proposal/Voting/VotersModal.tsx index f5757a13f..0a6d50a32 100644 --- a/src/components/Proposal/Voting/VotersModal.tsx +++ b/src/components/Proposal/Voting/VotersModal.tsx @@ -4,7 +4,7 @@ import classNames from "classnames"; import AccountImage from "components/Account/AccountImage"; import AccountProfileName from "components/Account/AccountProfileName"; import Reputation from "components/Account/Reputation"; -import ModalPopup from "components/shared/ModalPopup"; +import ModalPopup from "components/Shared/ModalPopup"; import withSubscription, { ISubscriptionProps } from "components/Shared/withSubscription"; import * as React from "react"; import { IProfileState, IProfilesState } from "reducers/profilesReducer"; diff --git a/src/components/Shared/SocialShareModal.tsx b/src/components/Shared/SocialShareModal.tsx index dd41f3fa7..28f91a697 100644 --- a/src/components/Shared/SocialShareModal.tsx +++ b/src/components/Shared/SocialShareModal.tsx @@ -1,4 +1,4 @@ -import ModalPopup from "components/shared/ModalPopup"; +import ModalPopup from "components/Shared/ModalPopup"; import { copyToClipboard } from "lib/util"; import * as React from "react"; import Tooltip from "rc-tooltip"; diff --git a/src/components/Shared/ThreeboxModal.tsx b/src/components/Shared/ThreeboxModal.tsx index f035df358..7258714f2 100644 --- a/src/components/Shared/ThreeboxModal.tsx +++ b/src/components/Shared/ThreeboxModal.tsx @@ -1,6 +1,6 @@ import * as React from "react"; import { connect } from "react-redux"; -import ModalPopup from "components/shared/ModalPopup"; +import ModalPopup from "components/Shared/ModalPopup"; import { showNotification } from "reducers/notifications"; import * as css from "./ThreeboxModal.scss"; From 09c55271347b7d5a7b4423659531f16a0ac4d5d2 Mon Sep 17 00:00:00 2001 From: Tibet Sprague Date: Thu, 5 Mar 2020 16:06:20 -0800 Subject: [PATCH 19/38] Enforce required permissions when adding/editing known Schemes Also move all scheme utilities into a new lib/schemeUtils.ts file --- src/components/Dao/DaoSchemesPage.tsx | 2 +- src/components/Dao/ProposalSchemeCard.tsx | 3 +- src/components/Dao/SimpleSchemeCard.tsx | 2 +- .../Proposal/Create/CreateProposalPage.tsx | 2 +- .../CreateSchemeRegistrarProposal.tsx | 62 +++++- .../Proposal/ProposalDetailsPage.tsx | 5 +- .../Proposal/ProposalHistoryRow.tsx | 3 +- .../ProposalSummarySchemeRegistrar.tsx | 3 +- .../Competition/Details.tsx | 35 +-- src/components/Scheme/ReputationFromToken.tsx | 3 +- src/components/Scheme/SchemeContainer.tsx | 8 +- src/components/Scheme/SchemeInfoPage.tsx | 3 +- src/components/Scheme/SchemeProposalsPage.tsx | 2 +- src/lib/schemeUtils.ts | 209 ++++++++++++++++++ src/lib/util.ts | 176 +-------------- 15 files changed, 303 insertions(+), 215 deletions(-) create mode 100644 src/lib/schemeUtils.ts diff --git a/src/components/Dao/DaoSchemesPage.tsx b/src/components/Dao/DaoSchemesPage.tsx index 1d2507574..874668db7 100644 --- a/src/components/Dao/DaoSchemesPage.tsx +++ b/src/components/Dao/DaoSchemesPage.tsx @@ -3,7 +3,7 @@ import Loading from "components/Shared/Loading"; import withSubscription, { ISubscriptionProps } from "components/Shared/withSubscription"; import UnknownSchemeCard from "components/Dao/UnknownSchemeCard"; import Analytics from "lib/analytics"; -import { KNOWN_SCHEME_NAMES, PROPOSAL_SCHEME_NAMES } from "lib/util"; +import { KNOWN_SCHEME_NAMES, PROPOSAL_SCHEME_NAMES } from "lib/schemeUtils"; import { Page } from "pages"; import * as React from "react"; import { BreadcrumbsItem } from "react-breadcrumbs-dynamic"; diff --git a/src/components/Dao/ProposalSchemeCard.tsx b/src/components/Dao/ProposalSchemeCard.tsx index b4f2ba65f..46d725a15 100644 --- a/src/components/Dao/ProposalSchemeCard.tsx +++ b/src/components/Dao/ProposalSchemeCard.tsx @@ -4,7 +4,8 @@ import VoteGraph from "components/Proposal/Voting/VoteGraph"; import ProposalCountdown from "components/Shared/ProposalCountdown"; import Loading from "components/Shared/Loading"; import withSubscription, { ISubscriptionProps } from "components/Shared/withSubscription"; -import { humanProposalTitle, schemeName } from "lib/util"; +import { humanProposalTitle } from "lib/util"; +import { schemeName } from "lib/schemeUtils"; import * as React from "react"; import { Link } from "react-router-dom"; import { combineLatest } from "rxjs"; diff --git a/src/components/Dao/SimpleSchemeCard.tsx b/src/components/Dao/SimpleSchemeCard.tsx index e3eaa29ca..7a69efa12 100644 --- a/src/components/Dao/SimpleSchemeCard.tsx +++ b/src/components/Dao/SimpleSchemeCard.tsx @@ -1,5 +1,5 @@ import { IDAOState, ISchemeState, Scheme } from "@daostack/client"; -import { schemeName } from "lib/util"; +import { schemeName } from "lib/schemeUtils"; import * as React from "react"; import { Link } from "react-router-dom"; import * as css from "./SchemeCard.scss"; diff --git a/src/components/Proposal/Create/CreateProposalPage.tsx b/src/components/Proposal/Create/CreateProposalPage.tsx index a06097006..841a1061a 100644 --- a/src/components/Proposal/Create/CreateProposalPage.tsx +++ b/src/components/Proposal/Create/CreateProposalPage.tsx @@ -16,7 +16,7 @@ import { IRootState } from "reducers"; import { RouteComponentProps } from "react-router-dom"; import { CrxRewarderComponentType, getCrxRewarderComponent, rewarderContractName } from "components/Scheme/ContributionRewardExtRewarders/rewardersProps"; import CreateContributionRewardProposal from "components/Proposal/Create/SchemeForms/CreateContributionRewardProposal"; -import { schemeName } from "lib/util"; +import { schemeName } from "lib/schemeUtils"; import * as css from "./CreateProposal.scss"; type IExternalProps = RouteComponentProps; diff --git a/src/components/Proposal/Create/SchemeForms/CreateSchemeRegistrarProposal.tsx b/src/components/Proposal/Create/SchemeForms/CreateSchemeRegistrarProposal.tsx index dc769412c..749ef09e7 100644 --- a/src/components/Proposal/Create/SchemeForms/CreateSchemeRegistrarProposal.tsx +++ b/src/components/Proposal/Create/SchemeForms/CreateSchemeRegistrarProposal.tsx @@ -1,3 +1,4 @@ +/* eslint-disable no-bitwise */ import { enableWalletProvider, getArc } from "arc"; import Loading from "components/Shared/Loading"; @@ -8,7 +9,8 @@ import TrainingTooltip from "components/Shared/TrainingTooltip"; import { createProposal } from "actions/arcActions"; import { showNotification, NotificationStatus } from "reducers/notifications"; import Analytics from "lib/analytics"; -import { schemeNameAndAddress, isValidUrl, GetSchemeIsActiveActions, getSchemeIsActive } from "lib/util"; +import { isValidUrl } from "lib/util"; +import { GetSchemeIsActiveActions, getSchemeIsActive, REQUIRED_SCHEME_PERMISSIONS, schemeNameAndAddress, SchemePermissions } from "lib/schemeUtils"; import { exportUrl, importUrlValues } from "lib/proposalUtils"; import { ErrorMessage, Field, Form, Formik, FormikProps } from "formik"; import classNames from "classnames"; @@ -59,6 +61,7 @@ interface IFormValues { interface IState { currentTab: string; tags: Array; + requiredPermissions: number; } class CreateSchemeRegistrarProposal extends React.Component { @@ -90,9 +93,19 @@ class CreateSchemeRegistrarProposal extends React.Component { this.state = { currentTab: this.initialFormValues.currentTab, tags: this.initialFormValues.tags, + requiredPermissions: 0, }; } + public handleChangeScheme = (e: any) => { + const arc = getArc(); + try { + // If we know about this contract then require the minimum permissions for it + const contractInfo = arc.getContractInfo(e.target.value); + this.setState({ requiredPermissions: REQUIRED_SCHEME_PERMISSIONS[contractInfo.name] }); + /* eslint-disable-next-line no-empty */ + } catch (e) {} + } public async handleSubmit(values: IFormValues, { setSubmitting }: any ): Promise { if (!await enableWalletProvider({ showNotification: this.props.showNotification })) { return; } @@ -167,7 +180,7 @@ class CreateSchemeRegistrarProposal extends React.Component { const schemes = this.props.data; const { handleClose } = this.props; - const currentTab = this.state.currentTab; + const { currentTab, requiredPermissions } = this.state; const arc = getArc(); @@ -267,6 +280,7 @@ class CreateSchemeRegistrarProposal extends React.Component { render={({ errors, touched, + handleChange, isSubmitting, setFieldValue, values, @@ -351,6 +365,11 @@ class CreateSchemeRegistrarProposal extends React.Component { id="schemeToAddInput" placeholder="Enter plugin address" name="schemeToAdd" + onChange={(e: any) => { + // call the built-in handleChange + handleChange(e); + this.handleChangeScheme(e); + }} />
@@ -365,7 +384,11 @@ class CreateSchemeRegistrarProposal extends React.Component { name="schemeToEdit" component="select" className={css.schemeSelect} - defaultValue={this.initialFormValues} + onChange={(e: any) => { + // call the built-in handleChange + handleChange(e); + this.handleChangeScheme(e); + }} > {schemes.map((scheme, _i) => { @@ -392,28 +415,52 @@ class CreateSchemeRegistrarProposal extends React.Component { Permissions
- +
- +
- +
- + @@ -440,7 +487,6 @@ class CreateSchemeRegistrarProposal extends React.Component { name="schemeToRemove" component="select" className={css.schemeSelect} - defaultValue={this.initialFormValues.schemeToRemove} > {schemes.map((scheme, _i) => { diff --git a/src/components/Proposal/ProposalDetailsPage.tsx b/src/components/Proposal/ProposalDetailsPage.tsx index d51037bd4..eff4fcea2 100644 --- a/src/components/Proposal/ProposalDetailsPage.tsx +++ b/src/components/Proposal/ProposalDetailsPage.tsx @@ -5,7 +5,8 @@ import AccountProfileName from "components/Account/AccountProfileName"; import ProposalCountdown from "components/Shared/ProposalCountdown"; import FollowButton from "components/Shared/FollowButton"; import { DiscussionEmbed } from "disqus-react"; -import { humanProposalTitle, schemeName, ensureHttps } from "lib/util"; +import { humanProposalTitle, ensureHttps } from "lib/util"; +import { schemeName } from "lib/schemeUtils"; import Analytics from "lib/analytics"; import { Page } from "pages"; import * as React from "react"; @@ -148,7 +149,7 @@ class ProposalDetailsPage extends React.Component {
- +
{ constructor(props: IProps) { super(props); - this.state = { + this.state = { showingCreateSubmission: false, showingSubmissionDetails: null, status: this.getCompetitionState(), @@ -96,11 +97,11 @@ class CompetitionDetails extends React.Component { * externally to the Competition code in Alchemy, and thus the params * won't show up in `match`. (Wasn't able to figure out a clean/easy way to * configure such a route, and the behavior may be better this way anyway; - * not using React's router I believe helps to keep the history and + * not using React's router I believe helps to keep the history and * browser back/forward button behavior nice and clean.) */ const parts = window.location.pathname.split("/"); - + if (parts.length === 9) { const urlSubmissionId = parts[8]; let urlSubmission: ICompetitionSuggestionState = null; @@ -116,14 +117,14 @@ class CompetitionDetails extends React.Component { } } } - + private onEndCountdown = () => { // give it time to catch up with timer inprecision setTimeout(() => this.setState({ status: this.getCompetitionState() }), 1000); } private openNewSubmissionModal = async (): Promise => { - + const { showNotification } = this.props; if (!await enableWalletProvider({ showNotification })) { return; } @@ -183,7 +184,7 @@ class CompetitionDetails extends React.Component { return
No Winners
- { + { hasSubmissions ? "None of the competition submissions received any votes. Competition rewards will be returned to the DAO." : "This competition received no submissions. Competition rewards will be returned to the DAO." @@ -203,7 +204,7 @@ class CompetitionDetails extends React.Component { const voted = votesMap.has(submission.id); return ( - { status.overWithWinners ? + { status.overWithWinners ?
{ } public render(): RenderOutput { - + const status = this.state.status; const { daoState, proposalState } = this.props; const submissions = this.props.data[0]; @@ -254,7 +255,7 @@ class CompetitionDetails extends React.Component { const numSubmissions = submissions.length; const hasSubmissions = !!numSubmissions; - const submissionsAreDisabled = notStarted || + const submissionsAreDisabled = notStarted || // note that winningOutcome is the *current* state, not necessarily the *final* outcome (!proposalState.executedAt || (proposalState.winningOutcome !== IProposalOutcome.Pass)) || (isAddress(competition.admin) && (this.props.currentAccountAddress !== competition.admin)) @@ -269,14 +270,14 @@ class CompetitionDetails extends React.Component { {humanProposalTitle(proposalState, 40)}
- +
Go to Proposal >
{ status.now.isBefore(status.competition.suggestionsEndTime) ?
- { + { {
- + { hasSubmissions ?
{numSubmissions} Submissions
@@ -372,7 +373,7 @@ class CompetitionDetails extends React.Component {
- + {this.state.showingCreateSubmission ? {}); // end cache priming return combineLatest( // we do not need to subscribe here (second argument = false), because we already subscribed in the line above - getProposalSubmissions(props.proposalState.id, true), + getProposalSubmissions(props.proposalState.id, true), // the next construction gets the suggestions for which the user has voted props.currentAccountAddress ? getCompetitionVotes(props.proposalState.id, props.currentAccountAddress, true) .pipe( map((votes: Array) => { const set = new Set(); votes.forEach(vote => { - set.add(vote.staticState.suggestion); + set.add(vote.staticState.suggestion); }); return set; }) diff --git a/src/components/Scheme/ReputationFromToken.tsx b/src/components/Scheme/ReputationFromToken.tsx index 8c3073fb7..558d4c363 100644 --- a/src/components/Scheme/ReputationFromToken.tsx +++ b/src/components/Scheme/ReputationFromToken.tsx @@ -9,7 +9,8 @@ import { NotificationStatus } from "reducers/notifications"; import { redeemReputationFromToken } from "actions/arcActions"; import { enableWalletProvider, getArc } from "arc"; import { ErrorMessage, Field, Form, Formik, FormikProps } from "formik"; -import { schemeName, fromWei } from "lib/util"; +import { fromWei } from "lib/util"; +import { schemeName } from "lib/schemeUtils"; import * as React from "react"; import { BreadcrumbsItem } from "react-breadcrumbs-dynamic"; import * as Sticky from "react-stickynode"; diff --git a/src/components/Scheme/SchemeContainer.tsx b/src/components/Scheme/SchemeContainer.tsx index 52360b884..1b521b6d3 100644 --- a/src/components/Scheme/SchemeContainer.tsx +++ b/src/components/Scheme/SchemeContainer.tsx @@ -5,7 +5,7 @@ import { enableWalletProvider, getArc } from "arc"; import classNames from "classnames"; import Loading from "components/Shared/Loading"; import withSubscription, { ISubscriptionProps } from "components/Shared/withSubscription"; -import { schemeName, getSchemeIsActive} from "lib/util"; +import { schemeName, getSchemeIsActive} from "lib/schemeUtils"; import * as React from "react"; import { BreadcrumbsItem } from "react-breadcrumbs-dynamic"; import { Helmet } from "react-helmet"; @@ -77,7 +77,7 @@ class SchemeContainer extends React.Component { private schemeInfoPageHtml = (props: any) => ; private schemeProposalsPageHtml = (isActive: boolean) => (props: any) => ; - private contributionsRewardExtTabHtml = () => (props: any) => + private contributionsRewardExtTabHtml = () => (props: any) => { if (!this.state.crxListComponent) { return null; @@ -126,10 +126,10 @@ class SchemeContainer extends React.Component { [css.active]: this.props.location.pathname.includes("crx"), }); const schemeFriendlyName = schemeName(schemeState, schemeState.address); - + return (
- + {schemeFriendlyName} diff --git a/src/components/Scheme/SchemeInfoPage.tsx b/src/components/Scheme/SchemeInfoPage.tsx index 061ca38fd..879c0ad18 100644 --- a/src/components/Scheme/SchemeInfoPage.tsx +++ b/src/components/Scheme/SchemeInfoPage.tsx @@ -3,7 +3,8 @@ import * as React from "react"; import { BreadcrumbsItem } from "react-breadcrumbs-dynamic"; import { Address, ISchemeState, IGenesisProtocolParams, IDAOState } from "@daostack/client"; -import { copyToClipboard, fromWei, linkToEtherScan, schemeName, roundUp } from "lib/util"; +import { copyToClipboard, fromWei, linkToEtherScan, roundUp } from "lib/util"; +import { schemeName } from "lib/schemeUtils"; import * as moment from "moment"; import { NotificationStatus, showNotification } from "reducers/notifications"; import { connect } from "react-redux"; diff --git a/src/components/Scheme/SchemeProposalsPage.tsx b/src/components/Scheme/SchemeProposalsPage.tsx index a963be6f4..8ed896065 100644 --- a/src/components/Scheme/SchemeProposalsPage.tsx +++ b/src/components/Scheme/SchemeProposalsPage.tsx @@ -5,7 +5,7 @@ import Loading from "components/Shared/Loading"; import withSubscription, { ISubscriptionProps } from "components/Shared/withSubscription"; import gql from "graphql-tag"; import Analytics from "lib/analytics"; -import { schemeName} from "lib/util"; +import { schemeName } from "lib/schemeUtils"; import { Page } from "pages"; import * as React from "react"; import { BreadcrumbsItem } from "react-breadcrumbs-dynamic"; diff --git a/src/lib/schemeUtils.ts b/src/lib/schemeUtils.ts new file mode 100644 index 000000000..a182bd981 --- /dev/null +++ b/src/lib/schemeUtils.ts @@ -0,0 +1,209 @@ +/* eslint-disable no-bitwise */ +import { + Address, + IContractInfo, + ISchemeState} from "@daostack/client"; +import { rewarderContractName } from "components/Scheme/ContributionRewardExtRewarders/rewardersProps"; +import { GenericSchemeRegistry } from "genericSchemeRegistry"; + +/** + * gotta load moment in order to use moment-timezone directly + */ +import "moment"; +import * as moment from "moment-timezone"; + +import { getArc } from "../arc"; + +export enum SchemePermissions { + None = 0, + IsRegistered = 1, // Always added by default in the controller + CanRegisterSchemes = 2, + CanAddRemoveGlobalConstraints = 4, + CanUpgradeController = 8, + CanCallDelegateCall = 0x10, + All = 0x1f, +} + +/** + * These are the permissions that are the minimum that each scheme must have to + * be able to perform its full range of functionality. + * + * Note that '1' is always assigned to a scheme by the Controller when the + * scheme is registered with the controller. + */ +export const REQUIRED_SCHEME_PERMISSIONS: any = { + "ContributionReward": SchemePermissions.IsRegistered, + "GlobalConstraintRegistrar": SchemePermissions.IsRegistered | SchemePermissions.CanAddRemoveGlobalConstraints, + "SchemeRegistrar": SchemePermissions.All, // TODO: is this correct? + "UpgradeScheme": SchemePermissions.IsRegistered | SchemePermissions.CanRegisterSchemes | SchemePermissions.CanUpgradeController, + "VestingScheme": SchemePermissions.IsRegistered, + "VoteInOrganizationScheme": SchemePermissions.IsRegistered | SchemePermissions.CanCallDelegateCall, +}; + +/** schemes that we know how to interpret */ +export const KNOWN_SCHEME_NAMES = [ + "ContributionReward", + "GenericScheme", + "ReputationFromToken", + "SchemeRegistrar", + "UGenericScheme", + "Competition", + "ContributionRewardExt", +]; + +export const PROPOSAL_SCHEME_NAMES = [ + "ContributionReward", + "GenericScheme", + "SchemeRegistrar", + "UGenericScheme", + "Competition", + "ContributionRewardExt", +]; + +/** + * return true if the address is the address of a known scheme (which we know how to represent) + * @param address [description] + * @return [description] + */ +export function isKnownScheme(address: Address) { + const arc = getArc(); + let contractInfo; + try { + contractInfo = arc.getContractInfo(address); + } catch (err) { + if (err.message.match(/no contract/i)) { + return false; + } + throw err; + } + + if (KNOWN_SCHEME_NAMES.includes(contractInfo.name)) { + return true; + } else { + return false; + } +} + +export function schemeName(scheme: ISchemeState|IContractInfo, fallback?: string) { + let name: string; + if (scheme.name === "GenericScheme" || scheme.name === "UGenericScheme") { + if ((scheme as any).genericSchemeParams || ((scheme as any).uGenericSchemeParams)) { + const genericSchemeRegistry = new GenericSchemeRegistry(); + let contractToCall; + const schemeState = scheme as ISchemeState; + if (schemeState.genericSchemeParams) { + contractToCall = schemeState.genericSchemeParams.contractToCall; + } else { + contractToCall = schemeState.uGenericSchemeParams.contractToCall; + } + const genericSchemeInfo = genericSchemeRegistry.getSchemeInfo(contractToCall); + if (genericSchemeInfo) { + name = genericSchemeInfo.specs.name; + } else { + // Adding the address is a bit long for a title + // name = `Blockchain Interaction (${contractToCall})`; + name = "Blockchain Interaction"; + } + } else { + // this should never happen... + name = "Blockchain Interaction"; + } + } else if (scheme.name === "ContributionReward") { + name ="Funding and Voting Power"; + } else if (scheme.name === "SchemeRegistrar") { + name ="Scheme Manager"; + } else if (scheme.name) { + if (scheme.name === "ContributionRewardExt") { + name = rewarderContractName(scheme as ISchemeState); + } else { + // add spaces before capital letters to approximate a human-readable title + name = `${scheme.name[0]}${scheme.name.slice(1).replace(/([A-Z])/g, " $1")}`; + } + } else { + name = fallback; + } + return name; +} + +/** + * given the address (of a scheme), return a friendly string represeting the scheme's address and it'sname + * @param address [description] + * @return [description] + */ +export function schemeNameAndAddress(address: string) { + const arc = getArc(); + try { + const contractInfo = arc.getContractInfo(address); + const name = schemeName(contractInfo); + + if (name) { + return `${address.slice(0, 4)}...${address.slice(-4)} (${name})`; + } else { + return `${address.slice(0, 4)}...${address.slice(-4)}`; + } + } catch (err) { + if (err.message.match(/No contract/)) { + return `${address.slice(0, 4)}...${address.slice(-4)}`; + } + } +} + +export enum GetSchemeIsActiveActions { + Register=1, + Remove +} + +const schemeActionPropNames = new Map>([ + [ + "SchemeRegistrar" , new Map([ + [GetSchemeIsActiveActions.Register, "voteRegisterParams"], + [GetSchemeIsActiveActions.Remove, "voteRemoveParams"], + ]), + ], +]); + +export function getSchemeIsActive(scheme: ISchemeState, action?: GetSchemeIsActiveActions): boolean { + let votingMachineParamsPropertyName: string; + let schemeName = `${scheme.name[0].toLowerCase()}${scheme.name.slice(1)}`; + if (schemeName === "genericScheme") { + if (scheme.uGenericSchemeParams) { + schemeName = "uGenericScheme"; + } + } + + if (action) { // then the name of the voting machine properties property depends on the action + const schemeActionsMap = schemeActionPropNames.get(scheme.name); + + if (!schemeActionsMap) { + throw new Error(`getSchemeIsActive: unknown scheme: ${scheme.name}`); + } + const propName = schemeActionsMap.get(action); + if (!propName) { + throw new Error(`getSchemeIsActive: unknown action: ${scheme.name}:${action}`); + } + votingMachineParamsPropertyName = propName; + } else { + /** + * if scheme is SchemeRegistrar, then it is active if any of its actions are active + */ + if (scheme.name === "SchemeRegistrar") { + return getSchemeIsActive(scheme, GetSchemeIsActiveActions.Register) || getSchemeIsActive(scheme, GetSchemeIsActiveActions.Remove); + } else { + votingMachineParamsPropertyName = "voteParams"; + } + } + + const schemeParams = (scheme as any)[`${schemeName}Params`][votingMachineParamsPropertyName]; + if (!schemeParams) { + // eslint-disable-next-line no-console + console.warn(` getSchemeIsActive: scheme parameters not found at "voteParams": ${scheme.name}`); + return true; + } + if ((typeof(schemeParams.activationTime) === undefined) || (schemeParams.activationTime === null)) { + // eslint-disable-next-line no-console + console.warn(` getSchemeIsActive: voting machine appears not to be GenesisProtocol: ${scheme.name}`); + return true; + } else { + return moment(schemeParams.activationTime*1000).isSameOrBefore(moment()); + } +} diff --git a/src/lib/util.ts b/src/lib/util.ts index 785df9b4e..18ed5424e 100644 --- a/src/lib/util.ts +++ b/src/lib/util.ts @@ -1,14 +1,10 @@ import { promisify } from "util"; import { targetedNetwork } from "arc"; -import { GenericSchemeRegistry } from "genericSchemeRegistry"; -import { rewarderContractName } from "components/Scheme/ContributionRewardExtRewarders/rewardersProps"; import { Address, - IContractInfo, IProposalStage, IProposalState, - IRewardState, - ISchemeState} from "@daostack/client"; + IRewardState} from "@daostack/client"; import { of } from "rxjs"; import { catchError } from "rxjs/operators"; @@ -229,114 +225,6 @@ export function sleep(milliseconds: number): Promise { return new Promise((resolve: () => void): any => setTimeout(resolve, milliseconds)); } -/** schemes that we know how to interpret */ -export const KNOWN_SCHEME_NAMES = [ - "ContributionReward", - "GenericScheme", - "ReputationFromToken", - "SchemeRegistrar", - "UGenericScheme", - "Competition", - "ContributionRewardExt", -]; - -export const PROPOSAL_SCHEME_NAMES = [ - "ContributionReward", - "GenericScheme", - "SchemeRegistrar", - "UGenericScheme", - "Competition", - "ContributionRewardExt", -]; - -/** - * return true if the address is the address of a known scheme (which we know how to represent) - * @param address [description] - * @return [description] - */ -export function isKnownScheme(address: Address) { - const arc = getArc(); - let contractInfo; - try { - contractInfo = arc.getContractInfo(address); - } catch (err) { - if (err.message.match(/no contract/i)) { - return false; - } - throw err; - } - - if (KNOWN_SCHEME_NAMES.includes(contractInfo.name)) { - return true; - } else { - return false; - } -} - -export function schemeName(scheme: ISchemeState|IContractInfo, fallback?: string) { - let name: string; - if (scheme.name === "GenericScheme" || scheme.name === "UGenericScheme") { - if ((scheme as any).genericSchemeParams || ((scheme as any).uGenericSchemeParams)) { - const genericSchemeRegistry = new GenericSchemeRegistry(); - let contractToCall; - const schemeState = scheme as ISchemeState; - if (schemeState.genericSchemeParams) { - contractToCall = schemeState.genericSchemeParams.contractToCall; - } else { - contractToCall = schemeState.uGenericSchemeParams.contractToCall; - } - const genericSchemeInfo = genericSchemeRegistry.getSchemeInfo(contractToCall); - if (genericSchemeInfo) { - name = genericSchemeInfo.specs.name; - } else { - // Adding the address is a bit long for a title - // name = `Blockchain Interaction (${contractToCall})`; - name = "Blockchain Interaction"; - } - } else { - // this should never happen... - name = "Blockchain Interaction"; - } - } else if (scheme.name === "ContributionReward") { - name ="Funding and Voting Power"; - } else if (scheme.name === "SchemeRegistrar") { - name ="Plugin Manager"; - } else if (scheme.name) { - if (scheme.name === "ContributionRewardExt") { - name = rewarderContractName(scheme as ISchemeState); - } else { - // add spaces before capital letters to approximate a human-readable title - name = `${scheme.name[0]}${scheme.name.slice(1).replace(/([A-Z])/g, " $1")}`; - } - } else { - name = fallback; - } - return name; -} - -/** - * given the address (of a scheme), return a friendly string represeting the scheme's address and it'sname - * @param address [description] - * @return [description] - */ -export function schemeNameAndAddress(address: string) { - const arc = getArc(); - try { - const contractInfo = arc.getContractInfo(address); - const name = schemeName(contractInfo); - - if (name) { - return `${address.slice(0, 4)}...${address.slice(-4)} (${name})`; - } else { - return `${address.slice(0, 4)}...${address.slice(-4)}`; - } - } catch (err) { - if (err.message.match(/No contract/)) { - return `${address.slice(0, 4)}...${address.slice(-4)}`; - } - } -} - /** * return network id, independent of the presence of Arc * @param web3Provider @@ -534,68 +422,6 @@ export function isValidUrl(str: string, emptyOk = true): boolean { return (emptyOk && (!str || !str.trim())) || (str && pattern.test(str)); } - - -export enum GetSchemeIsActiveActions { - Register=1, - Remove -} - -const schemeActionPropNames = new Map>([ - [ - "SchemeRegistrar" , new Map([ - [GetSchemeIsActiveActions.Register, "voteRegisterParams"], - [GetSchemeIsActiveActions.Remove, "voteRemoveParams"], - ]), - ], -]); - -export function getSchemeIsActive(scheme: ISchemeState, action?: GetSchemeIsActiveActions): boolean { - let votingMachineParamsPropertyName: string; - let schemeName = `${scheme.name[0].toLowerCase()}${scheme.name.slice(1)}`; - if (schemeName === "genericScheme") { - if (scheme.uGenericSchemeParams) { - schemeName = "uGenericScheme"; - } - } - - if (action) { // then the name of the voting machine properties property depends on the action - const schemeActionsMap = schemeActionPropNames.get(scheme.name); - - if (!schemeActionsMap) { - throw new Error(`getSchemeIsActive: unknown scheme: ${scheme.name}`); - } - const propName = schemeActionsMap.get(action); - if (!propName) { - throw new Error(`getSchemeIsActive: unknown action: ${scheme.name}:${action}`); - } - votingMachineParamsPropertyName = propName; - } else { - /** - * if scheme is SchemeRegistrar, then it is active if any of its actions are active - */ - if (scheme.name === "SchemeRegistrar") { - return getSchemeIsActive(scheme, GetSchemeIsActiveActions.Register) || getSchemeIsActive(scheme, GetSchemeIsActiveActions.Remove); - } else { - votingMachineParamsPropertyName = "voteParams"; - } - } - - const schemeParams = (scheme as any)[`${schemeName}Params`][votingMachineParamsPropertyName]; - if (!schemeParams) { - // eslint-disable-next-line no-console - console.warn(` getSchemeIsActive: scheme parameters not found at "voteParams": ${scheme.name}`); - return true; - } - if ((typeof(schemeParams.activationTime) === undefined) || (schemeParams.activationTime === null)) { - // eslint-disable-next-line no-console - console.warn(` getSchemeIsActive: voting machine appears not to be GenesisProtocol: ${scheme.name}`); - return true; - } else { - return moment(schemeParams.activationTime*1000).isSameOrBefore(moment()); - } -} - /** * @param num The number to round * @param precision The number of decimal places to preserve From 9d7afaebf4fb2ba5a8619bd224f2b9c69f3d3b07 Mon Sep 17 00:00:00 2001 From: mrrobot16 Date: Sun, 2 Feb 2020 22:06:35 -0500 Subject: [PATCH 20/38] migrating latest signal features commits --- src/genericSchemeRegistry/index.ts | 2 + .../schemes/Signals.json | 130 ++++++++++++++++++ 2 files changed, 132 insertions(+) create mode 100644 src/genericSchemeRegistry/schemes/Signals.json diff --git a/src/genericSchemeRegistry/index.ts b/src/genericSchemeRegistry/index.ts index e7b3e31ff..74dfd6a81 100644 --- a/src/genericSchemeRegistry/index.ts +++ b/src/genericSchemeRegistry/index.ts @@ -9,6 +9,7 @@ const gpInfo = require("./schemes/GenesisProtocol.json"); const ensRegistryInfo = require("./schemes/ENSRegistry.json"); const ensPublicResolverInfo = require("./schemes/ENSPublicResolver.json"); const registryLookupInfo = require("./schemes/RegistryLookup.json"); +const signals = require("./schemes/Signals.json") const KNOWNSCHEMES = [ dutchXInfo, @@ -16,6 +17,7 @@ const KNOWNSCHEMES = [ ensPublicResolverInfo, gpInfo, registryLookupInfo, + signals, ]; const SCHEMEADDRESSES: {[network: string]: { [address: string]: any}} = { diff --git a/src/genericSchemeRegistry/schemes/Signals.json b/src/genericSchemeRegistry/schemes/Signals.json new file mode 100644 index 000000000..7ae85aefa --- /dev/null +++ b/src/genericSchemeRegistry/schemes/Signals.json @@ -0,0 +1,130 @@ +{ + "name": "Signals Scheme", + "addresses": { + "main": [ + "0xe06d896da40b73cb02650220e480e20f38e7be18" + ], + "rinkeby": [ + "0xe06d896da40b73cb02650220e480e20f38e7be18" + ], + "private": [ + "0xe06d896da40b73cb02650220e480e20f38e7be18" + ] + }, + "actions": [ + { + "id": "createSignalType", + "label": "Create Signal Attribute", + "description": "Create a signal attribute", + "notes": "docs/link", + "fields": [ + { + "name": "approved", + "defaultValue": 1, + "label": "Update data of the selected signal type", + "labelTrue": "Name", + "labelFalse": "Description" + }, + { + "label": "Signal Data", + "name": "signalData", + "placeholder": "Data (Name, Description)" + } + ], + "abi": { + "constant": false, + "inputs": [ + { + "name": "approved", + "type": "bool" + }, + { + "name": "signalType", + "type": "string" + } + ], + "name": "updateSignalData", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + } + }, + { + "id": "updateSignalType", + "label": "Update Signal Attribute", + "description": "Update a signal attribute", + "notes": "docs/link", + "fields": [ + { + "name": "approved", + "defaultValue": 1, + "label": "Update data of the selected signal type", + "labelTrue": "Name", + "labelFalse": "Description" + }, + { + "label": "Signal Data", + "name": "signalData", + "placeholder": "Data (Name, Description)" + } + ], + "abi": { + "constant": false, + "inputs": [ + { + "name": "approved", + "type": "bool" + }, + { + "name": "signalType", + "type": "string" + } + ], + "name": "updateSignalData", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + } + }, + { + "id": "deleteSignalType", + "label": "Delete Signal Attribute", + "description": "Delete a signal attribute", + "notes": "docs/link", + "fields": [ + { + "name": "approved", + "defaultValue": 1, + "label": "Update data of the selected signal type", + "labelTrue": "Name", + "labelFalse": "Description" + }, + { + "label": "Signal Data", + "name": "signalData", + "placeholder": "Data (Name, Description)" + } + ], + "abi": { + "constant": false, + "inputs": [ + { + "name": "approved", + "type": "bool" + }, + { + "name": "signalType", + "type": "string" + } + ], + "name": "updateSignalData", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + } + } + ] +} \ No newline at end of file From 10c3f3c56c723ee2fda8c8e55da43cefc261cece Mon Sep 17 00:00:00 2001 From: mrrobot16 Date: Tue, 3 Mar 2020 23:19:31 -0500 Subject: [PATCH 21/38] Added DAO Header component in this branch --- src/assets/images/bg-test.jpeg | Bin 0 -> 13624 bytes src/components/Account/AccountImage.tsx | 5 +- src/components/Dao/DaoHeader.scss | 71 ++++++++++++++++++ src/components/Dao/DaoHeader.tsx | 95 ++++++++++++++++++++++++ src/components/Dao/DaoSchemesPage.scss | 10 +++ src/components/Dao/DaoSchemesPage.tsx | 4 +- 6 files changed, 182 insertions(+), 3 deletions(-) create mode 100644 src/assets/images/bg-test.jpeg create mode 100644 src/components/Dao/DaoHeader.scss create mode 100644 src/components/Dao/DaoHeader.tsx diff --git a/src/assets/images/bg-test.jpeg b/src/assets/images/bg-test.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..f8c2c6b7aceadec7a9382ed5d4381427c47e0b33 GIT binary patch literal 13624 zcmZ{~bx>SQ@GiV)kU)??aCZ;x2_9?-4vV|HLvYvN1lI+YUEJMWf-UYAG$>17LmqaZ6U3qU{s01#dk@UjXB1E8b6!N!3Ui009XB85Q*n3d$SAH?N-{yv{^I#-sj-BB5&H5{!yZlT2u@UP(UFd{dK-~BgMB@pyFr{_V<}3=f@`?3~ z`I%@5>SB~^IUR5$S1u}CP?|Dz!9-+@B3s`Um}i|&e~v!pk4EGSTA0%}kg&JHw%c_#f7&vVbM%i-$Q@GI6Wi)4A+MO`PD7T*Cpt#npvKj##PH^< z|7u3o2WLp@T9?vVEfh42&B#d9b5t@7ya1FHk&jL?v(#Gw^ZYGRx4to5m5Q?J?`oDC zmG*yK8i>*}BEx?p@0(kFHo_53|eba>l5>3zl&JxD6zT}7z0=GdwmbCmrtr^+lzluDIKwZ|mEB=Krcd$3BNCzVg*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YFHM-uEQ2UJnn`gK_;+udH%B zP)w{id$Jg1)P5yOvLN=p_c(gvTar;?N5|4&$${00C76Ap9b6;Bps3F;6}W zxUfs_{>o#^1A-tfo9V!e?$ zn|fKZ7|&T9rvEwB{O0qDVhNC)xBL&0w9rO<@Py-Qb=pN4Ry%{;fAh_ZUahn`lFoQ+ z)U8xGK{iu4!z1z-KV_#!DkjqAuNOn#Sy-Y$YSjh?%Y8yL1XzkWBO_B8!Abz4iZ&yNXzv>5-d0m{xB%wo0E{%59~xCah&>P z=__OLl==9+TcI)d+swfWAjP!1dc#O9rjx$@-OcxH@cmbfe)IK|f8xvm-9G+G_fO3A z0i%y?wJ!ja%rVvn>ZHR7wI{pRra;KZ5vDQh&ftUcj&1@6Dt$r}^7it_cAdB?n-1v6 z`PVWg31)Fh&wrV4mM@dY+2o|9ltm5_Jb9rKWfRJOCqNtrWBB+t9{L|IH zvI;jpMl;%Blk{te_xB&|g>>`(eOri<7vnn;db7!N~ zuYkl%HrjBiKPV6F>{sw+Y7A8mZ1T;4RmYfvO*!3~0~r2+7urz@SSG!GKlA%k8R(>? zy(q9k!>)OA*c?mN-VONHETLxo8S_ z8t|EGtvEiEwSbo+2;_$ske$Mo6hjG^TshfOZw3xnJ?NDhxy$B04>7-QjUuv1I2io+ zFwmZ2QF+MX5m0mt68|Z8!R}HW@P@+w z{c8uvL`JzkMK3Y{TL-d{%>9YOHZ+Z-O_M z#&|U$M}It4X~19KnqW=fVneJ(9ADT%qick7bYn@&?dvp|XJK8gSWUJ@qU3;h(mpPK z@Eub<_ylr9if3)0GdB@p!3U~c1e?Amn8;#|62^0!YeVfHE1SeE%scwLERTy3OIP^X zimhSnH%G0u8VymnFE&g8Z8fs;Am { public render(): RenderOutput { - const { accountAddress, profile, width } = this.props; + const { accountAddress, profile, width, style } = this.props; let url; if (profile && profile.image && profile.image[0] && profile.image[0].contentUrl) { @@ -25,6 +26,6 @@ export default class AccountImage extends React.Component { }); } - return (); + return (); } } diff --git a/src/components/Dao/DaoHeader.scss b/src/components/Dao/DaoHeader.scss new file mode 100644 index 000000000..3f0844e8b --- /dev/null +++ b/src/components/Dao/DaoHeader.scss @@ -0,0 +1,71 @@ +.header-wrap { + background: white; + margin: 8rem 2.5% 40px 0; + padding: 25px; + position: relative; + border-radius: 20px 20px 0 0; +} + +.reputation-holders { + display: block; + position: absolute; + font-size: 10px; + font-weight: normal; + color: $gray-1; + white-space: nowrap; +} + +.dao-name { + font-size: 24px; + color: #689bd6; +} + +.dao-info { + margin-left: 15%; + top: 15px; + position: absolute; +} + +.dao-description { + font-family: $body-font; + color: $black; + font-weight: 500; + font-size: 13px; + width: 75%; +} + +.circular--square { + border-radius: 50%; + border-color: white; + border-style: solid +} + +.dao-img { + // margin-left: 15% + top: -40px; + position: absolute +} + +.holdings { + margin-left: 85%; + padding: 15px; + border: 1px solid #dbd7d7; + border-radius: 7px; + margin-bottom: 15px +} + +.holdings .holdings-ammount { + margin-top: 5px; + color: #565a5d; + font-size: 12px +} + +.holdings .holdings-ammount .holdings-name { + float: right; + margin-right: 25px +} + +.dao-header { + position: absolute; + top: 50px; +} \ No newline at end of file diff --git a/src/components/Dao/DaoHeader.tsx b/src/components/Dao/DaoHeader.tsx new file mode 100644 index 000000000..46ceb036e --- /dev/null +++ b/src/components/Dao/DaoHeader.tsx @@ -0,0 +1,95 @@ +import * as React from "react"; +import { IDAOState, Scheme } from "@daostack/client"; + +import withSubscription, { ISubscriptionProps } from "components/Shared/withSubscription"; +import AccountImage from "components/Account/AccountImage"; +import * as css from "./DaoHeader.scss"; + + + +interface IExternalProps { + daoState: IDAOState; +} + +type IProps = IExternalProps & ISubscriptionProps; + +class DaoHeaderComponent extends React.Component { + + render() { + const dummyData = { + daoImg: "/assets/images/generic-user-avatar.png", + reputationHolders: 134, + holdings: [ + { name: "GEN", amount: 0.24653 }, + { name: "ETH", amount: 16.01 }, + { name: "DAI", amount: 148.19 }, + ], + description: ` + ${this.props.daoState.name} is an independent, global community of people working together to build and promote Decentralized Autonomous Organizations (DAOs). + It’s the perfect place to get involved with DAOstack and get your feet wet in a real-life DAO. + `, + }; + + return ( +
+
+ +
+
+ + { this.props.daoState.name } + + + { dummyData.reputationHolders } Reputation Holders + +
+ +
+ Holdings + { + dummyData.holdings.map((holding, index) => { + return ( +
+ { holding.amount } +
+ { holding.name } +
+
+ ); + }) + } +
+ +

+ This is the { this.props.daoState.name } Header +
+ { dummyData.description } +
+

+
+ ); + } +} + +const DaoHeader = withSubscription({ + wrappedComponent: DaoHeaderComponent, + checkForUpdate: [], + createObservable: (props: IExternalProps) => { + const dao = props.daoState.dao; + return dao.schemes({}, { fetchAllData: true, subscribe: true }); + }, +}); + +const styles = { + circularSquare: { + borderRadius: "50%", + borderColor: "white", + borderStyle: "solid", + } +} + +export default DaoHeader; \ No newline at end of file diff --git a/src/components/Dao/DaoSchemesPage.scss b/src/components/Dao/DaoSchemesPage.scss index 37d11b23f..21e29bc4d 100644 --- a/src/components/Dao/DaoSchemesPage.scss +++ b/src/components/Dao/DaoSchemesPage.scss @@ -41,6 +41,16 @@ padding-top: 30px; } +.daoHeaderBackground { + // @TODO Image is repeating, check this later when using real image + // background-image: url(/assets/images/bg-test.jpeg); + width: 115%; + position: absolute; + display: flex; + height: 30%; + top:0; + right: 0; +} @media only screen and (max-width: 425px) { .wrapper h1 { diff --git a/src/components/Dao/DaoSchemesPage.tsx b/src/components/Dao/DaoSchemesPage.tsx index 874668db7..9f2ba0c0b 100644 --- a/src/components/Dao/DaoSchemesPage.tsx +++ b/src/components/Dao/DaoSchemesPage.tsx @@ -13,6 +13,7 @@ import { CSSTransition, TransitionGroup } from "react-transition-group"; import * as css from "./DaoSchemesPage.scss"; import ProposalSchemeCard from "./ProposalSchemeCard"; import SimpleSchemeCard from "./SimpleSchemeCard"; +import DAOHeader from "./DaoHeader"; const Fade = ({ children, ...props }: any) => ( { return (
+
{dao.name} - +

All Plugins

From 49ec1784185f4cf019a7f8df0dc9eff39dcd75e5 Mon Sep 17 00:00:00 2001 From: mrrobot16 Date: Thu, 5 Mar 2020 18:58:51 -0500 Subject: [PATCH 22/38] Getting signal data and displaying it in the UI --- src/assets/images/bg-test.jpeg | Bin 13624 -> 0 bytes src/components/Dao/DaoHeader.tsx | 36 +++++++++++++-------- src/components/Dao/DaoSchemesPage.tsx | 45 ++++++++++++++++++++++---- 3 files changed, 61 insertions(+), 20 deletions(-) delete mode 100644 src/assets/images/bg-test.jpeg diff --git a/src/assets/images/bg-test.jpeg b/src/assets/images/bg-test.jpeg deleted file mode 100644 index f8c2c6b7aceadec7a9382ed5d4381427c47e0b33..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 13624 zcmZ{~bx>SQ@GiV)kU)??aCZ;x2_9?-4vV|HLvYvN1lI+YUEJMWf-UYAG$>17LmqaZ6U3qU{s01#dk@UjXB1E8b6!N!3Ui009XB85Q*n3d$SAH?N-{yv{^I#-sj-BB5&H5{!yZlT2u@UP(UFd{dK-~BgMB@pyFr{_V<}3=f@`?3~ z`I%@5>SB~^IUR5$S1u}CP?|Dz!9-+@B3s`Um}i|&e~v!pk4EGSTA0%}kg&JHw%c_#f7&vVbM%i-$Q@GI6Wi)4A+MO`PD7T*Cpt#npvKj##PH^< z|7u3o2WLp@T9?vVEfh42&B#d9b5t@7ya1FHk&jL?v(#Gw^ZYGRx4to5m5Q?J?`oDC zmG*yK8i>*}BEx?p@0(kFHo_53|eba>l5>3zl&JxD6zT}7z0=GdwmbCmrtr^+lzluDIKwZ|mEB=Krcd$3BNCzVg*g;=KL zEnvWbMV9h2)(xHROjA821XfT=-KtJexucl&hc$?FSFu!t;6q57HAA(4*ImsAJ7dPE zp8fLEH7_UqWr==yhu*8p`*?$DJnYioSreK%S~iuS{Yv`b#HDszlVLI|u_JlixV7er z)%5iaL~-b}xy`zMc^8J>X$^~%NwhneXchC>;!=bZ`B{wch>Gf9sJ9&o|Pqm&`h;a?6yQ3fl~Z>L)u z88~U}ryBJb>0>;6NFXy!TR`r__2mK!X}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iZ&yNXzv>5-d0m{xB%wo0E{%59~xCah&>P z=__OLl==9+TcI)d+swfWAjP!1dc#O9rjx$@-OcxH@cmbfe)IK|f8xvm-9G+G_fO3A z0i%y?wJ!ja%rVvn>ZHR7wI{pRra;KZ5vDQh&ftUcj&1@6Dt$r}^7it_cAdB?n-1v6 z`PVWg31)Fh&wrV4mM@dY+2o|9ltm5_Jb9rKWfRJOCqNtrWBB+t9{L|IH zvI;jpMl;%Blk{te_xB&|g>>`(eOri<7vnn;db7!N~ zuYkl%HrjBiKPV6F>{sw+Y7A8mZ1T;4RmYfvO*!3~0~r2+7urz@SSG!GKlA%k8R(>? zy(q9k!>)OA*c?mN-VONHETLxo8S_ z8t|EGtvEiEwSbo+2;_$ske$Mo6hjG^TshfOZw3xnJ?NDhxy$B04>7-QjUuv1I2io+ zFwmZ2QF+MX5m0mt68|Z8!R}HW@P@+w z{c8uvL`JzkMK3Y{TL-d{%>9YOHZ+Z-O_M z#&|U$M}It4X~19KnqW=fVneJ(9ADT%qick7bYn@&?dvp|XJK8gSWUJ@qU3;h(mpPK z@Eub<_ylr9if3)0GdB@p!3U~c1e?Amn8;#|62^0!YeVfHE1SeE%scwLERTy3OIP^X zimhSnH%G0u8VymnFE&g8Z8fs;Am; - -class DaoHeaderComponent extends React.Component { +type IProps = IExternalProps & ISubscriptionProps<[Scheme[], Signal | any]>; +class DaoHeaderComponent extends React.Component { render() { - const dummyData = { + const { daoState, signal } = this.props; + const { name, memberCount, address } = daoState; + const parsedSignal = JSON.parse(signal.data); + console.log('parsedSignal', parsedSignal); + const data = { daoImg: "/assets/images/generic-user-avatar.png", - reputationHolders: 134, + reputationHolders: memberCount, holdings: [ { name: "GEN", amount: 0.24653 }, { name: "ETH", amount: 16.01 }, { name: "DAI", amount: 148.19 }, ], description: ` - ${this.props.daoState.name} is an independent, global community of people working together to build and promote Decentralized Autonomous Organizations (DAOs). + ${name} is an independent, global community of people working together to build and promote Decentralized Autonomous Organizations (DAOs). It’s the perfect place to get involved with DAOstack and get your feet wet in a real-life DAO. `, }; @@ -33,25 +40,26 @@ class DaoHeaderComponent extends React.Component { return (
+ {/* Logo will go here instead of AccountImage this is just a placeholder */}
- { this.props.daoState.name } + { signal.name ? signal.name : name } - { dummyData.reputationHolders } Reputation Holders + { data.reputationHolders } Reputation Holders
Holdings { - dummyData.holdings.map((holding, index) => { + data.holdings.map((holding, index) => { return (
{ holding.amount } @@ -65,9 +73,9 @@ class DaoHeaderComponent extends React.Component {

- This is the { this.props.daoState.name } Header + This is the { name } Header
- { dummyData.description } + { data.description }

@@ -90,6 +98,6 @@ const styles = { borderColor: "white", borderStyle: "solid", } -} +}; export default DaoHeader; \ No newline at end of file diff --git a/src/components/Dao/DaoSchemesPage.tsx b/src/components/Dao/DaoSchemesPage.tsx index 9f2ba0c0b..d09e57967 100644 --- a/src/components/Dao/DaoSchemesPage.tsx +++ b/src/components/Dao/DaoSchemesPage.tsx @@ -14,6 +14,9 @@ import * as css from "./DaoSchemesPage.scss"; import ProposalSchemeCard from "./ProposalSchemeCard"; import SimpleSchemeCard from "./SimpleSchemeCard"; import DAOHeader from "./DaoHeader"; +import gql from "graphql-tag"; +import { getArc } from "arc"; +import { combineLatest } from "rxjs"; const Fade = ({ children, ...props }: any) => ( ( ); +const DAOHeaderBackground = (props: any) => ( +
+); + type IExternalProps = { daoState: IDAOState; } & RouteComponentProps; -type IProps = IExternalProps & ISubscriptionProps; +interface Signal { + id: string; + data: any | string; +}; + +type IProps = IExternalProps & ISubscriptionProps<[Scheme[], Signal[] | any]>; class DaoSchemesPage extends React.Component { @@ -49,7 +64,11 @@ class DaoSchemesPage extends React.Component { public render() { const { data } = this.props; const dao = this.props.daoState; - const allSchemes = data; + const [allSchemes, signalsData] = data; + const { signals } = signalsData.data; + const signal = signals.length > 0 ? signals[0] : null; + const daoHeaderBackground = signal ? JSON.parse(signal.data).Header : null; + const backgroundImage = daoHeaderBackground ? daoHeaderBackground : null; const contributionReward = allSchemes.filter((scheme: Scheme) => scheme.staticState.name === "ContributionReward"); const knownSchemes = allSchemes.filter((scheme: Scheme) => scheme.staticState.name !== "ContributionReward" && KNOWN_SCHEME_NAMES.indexOf(scheme.staticState.name) >= 0); @@ -79,9 +98,9 @@ class DaoSchemesPage extends React.Component { return (
-
- {dao.name} - + { backgroundImage && } + {dao.name} + { signal && }

All Plugins

@@ -106,7 +125,21 @@ export default withSubscription({ errorComponent: (props) => {props.error.message}, checkForUpdate: [], createObservable: (props: IExternalProps) => { + const arc = getArc(); const dao = props.daoState.dao; - return dao.schemes({}, { fetchAllData: true, subscribe: true }); + const schemes = dao.schemes({}, { fetchAllData: true, subscribe: true }); + // const DAOAddress = props.daoState.address; + // Currently only one dao has signal data + const DAOAddress = "0x771d0279e094b547f0b42d72dd6bfcce278d9a20"; + const signalQuery = gql` + { + signals(where: { id: "${DAOAddress}" } ) { + id + data + } + } + `; + const signalSchemeData = arc.getObservable(signalQuery); + return combineLatest(schemes, signalSchemeData); }, }); From a3c0ba71cb1e58702174383a72c01a2a952ef61c Mon Sep 17 00:00:00 2001 From: Shubhendu Shekhar Date: Tue, 10 Mar 2020 16:52:21 +0100 Subject: [PATCH 23/38] add action to save ipfs data --- src/actions/arcActions.ts | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/actions/arcActions.ts b/src/actions/arcActions.ts index 390b05b69..6e02d5966 100644 --- a/src/actions/arcActions.ts +++ b/src/actions/arcActions.ts @@ -1,4 +1,5 @@ -import { Address, DAO, IProposalCreateOptions, IProposalOutcome, ITransactionState, ITransactionUpdate, ReputationFromTokenScheme, Scheme } from "@daostack/client"; +import { Address, DAO, IProposalCreateOptions, IProposalOutcome, ITransactionState, + ITransactionUpdate, ReputationFromTokenScheme, Scheme } from "@daostack/client"; import { IAsyncAction } from "actions/async"; import { getArc } from "arc"; import { toWei } from "lib/util"; @@ -38,11 +39,28 @@ export const operationNotifierObserver = (dispatch: Redux.Dispatch, tx ]; }; +export function saveSignalDescription(signalDescription: any): ThunkAction { + return async (_getState: () => IRootState) => { + const arc = getArc(); + let ipfsDataToSave: object = {}; + if (signalDescription.key && signalDescription.value !== undefined) { + if (!arc.ipfsProvider) { + throw Error("No ipfsProvider set on Arc instance - cannot save data on IPFS"); + } + ipfsDataToSave = { + key: signalDescription.key, + value: signalDescription.value, + }; + } + return await arc.ipfs.addAndPinString(Buffer.from(JSON.stringify(ipfsDataToSave))); + }; +} + export function createProposal(proposalOptions: IProposalCreateOptions): ThunkAction { return async (dispatch: Redux.Dispatch, _getState: () => IRootState) => { try { const arc = getArc(); - + const dao = new DAO(proposalOptions.dao, arc); const observer = operationNotifierObserver(dispatch, "Create proposal"); From 77cf7df35d63062058aece0ca764c24ae0cb43d5 Mon Sep 17 00:00:00 2001 From: Shubhendu Shekhar Date: Tue, 10 Mar 2020 16:52:39 +0100 Subject: [PATCH 24/38] update signal scheme url --- src/settings.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/settings.ts b/src/settings.ts index 2c458b736..42d0f72be 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -126,8 +126,8 @@ export const settings = { web3ConnectProviderOptions: {}, }, rinkeby: { - graphqlHttpProvider: process.env.ARC_GRAPHQLHTTPPROVIDER || "https://api.thegraph.com/subgraphs-daostack/name/daostack/v38_3_rinkeby", - graphqlWsProvider: process.env.ARC_GRAPHQLWSPROVIDER || "wss://api.thegraph.com/subgraphs-daostack/name/daostack/v38_3_rinkeby", + graphqlHttpProvider: process.env.ARC_GRAPHQLHTTPPROVIDER || "https://api.thegraph.com/subgraphs/name/shekhar-shubhendu/signal-scheme-one", + graphqlWsProvider: process.env.ARC_GRAPHQLWSPROVIDER || "wss://api.thegraph.com/subgraphs/name/shekhar-shubhendu/signal-scheme-one", graphqlSubscribeToQueries: false, web3Provider: process.env.ARC_WEB3PROVIDER || "wss://rinkeby.infura.io/ws/v3/e0cdf3bfda9b468fa908aa6ab03d5ba2", web3ProviderRead: process.env.ARC_WEB3PROVIDERREAD || "wss://rinkeby.infura.io/ws/v3/e0cdf3bfda9b468fa908aa6ab03d5ba2", From 26617c970fc7ad3eb29275ce0890699113ded312 Mon Sep 17 00:00:00 2001 From: Shubhendu Shekhar Date: Tue, 10 Mar 2020 16:53:01 +0100 Subject: [PATCH 25/38] update Signals.json --- .../schemes/Signals.json | 74 +++++++++---------- 1 file changed, 33 insertions(+), 41 deletions(-) diff --git a/src/genericSchemeRegistry/schemes/Signals.json b/src/genericSchemeRegistry/schemes/Signals.json index 7ae85aefa..86ba86b07 100644 --- a/src/genericSchemeRegistry/schemes/Signals.json +++ b/src/genericSchemeRegistry/schemes/Signals.json @@ -13,37 +13,38 @@ }, "actions": [ { - "id": "createSignalType", + "id": "createSignalData", "label": "Create Signal Attribute", "description": "Create a signal attribute", "notes": "docs/link", "fields": [ { - "name": "approved", - "defaultValue": 1, - "label": "Update data of the selected signal type", - "labelTrue": "Name", - "labelFalse": "Description" + "name": "key", + "label": "Attribute to add", + "placeholder": "Attribute type to add e.g. Header, Icon" }, { - "label": "Signal Data", - "name": "signalData", - "placeholder": "Data (Name, Description)" + "name": "value", + "label": "Attribute value", + "placeholder": "Attribute value", + "defaultValue": "" } ], "abi": { "constant": false, "inputs": [ { - "name": "approved", - "type": "bool" + "internalType": "string", + "name": "_descriptionHash", + "type": "string" }, { - "name": "signalType", + "internalType": "string", + "name": "_descriptionHash", "type": "string" } ], - "name": "updateSignalData", + "name": "signal", "outputs": [], "payable": false, "stateMutability": "nonpayable", @@ -57,31 +58,32 @@ "notes": "docs/link", "fields": [ { - "name": "approved", - "defaultValue": 1, - "label": "Update data of the selected signal type", - "labelTrue": "Name", - "labelFalse": "Description" + "name": "key", + "label": "Attribute to update", + "placeholder": "Attribute type to add e.g. Header, Icon" }, { - "label": "Signal Data", - "name": "signalData", - "placeholder": "Data (Name, Description)" + "name": "value", + "label": "Attribute value", + "placeholder": "Attribute value", + "defaultValue": "" } ], "abi": { "constant": false, "inputs": [ { - "name": "approved", - "type": "bool" + "internalType": "string", + "name": "_descriptionHash", + "type": "string" }, { - "name": "signalType", + "internalType": "string", + "name": "_descriptionHash", "type": "string" } ], - "name": "updateSignalData", + "name": "signal", "outputs": [], "payable": false, "stateMutability": "nonpayable", @@ -95,31 +97,21 @@ "notes": "docs/link", "fields": [ { - "name": "approved", - "defaultValue": 1, - "label": "Update data of the selected signal type", - "labelTrue": "Name", - "labelFalse": "Description" - }, - { - "label": "Signal Data", - "name": "signalData", - "placeholder": "Data (Name, Description)" + "name": "key", + "label": "Attribute to delete", + "placeholder": "Attribute type to add e.g. Header, Icon" } ], "abi": { "constant": false, "inputs": [ { - "name": "approved", - "type": "bool" - }, - { - "name": "signalType", + "internalType": "string", + "name": "_descriptionHash", "type": "string" } ], - "name": "updateSignalData", + "name": "signal", "outputs": [], "payable": false, "stateMutability": "nonpayable", From 23a99a71cc0f4723e0b220380b2ba9d157a6f30a Mon Sep 17 00:00:00 2001 From: Shubhendu Shekhar Date: Tue, 10 Mar 2020 16:53:47 +0100 Subject: [PATCH 26/38] update logic to save/update/delete signals data --- .../CreateKnownGenericSchemeProposal.tsx | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/src/components/Proposal/Create/SchemeForms/CreateKnownGenericSchemeProposal.tsx b/src/components/Proposal/Create/SchemeForms/CreateKnownGenericSchemeProposal.tsx index f551a41c4..73b8d799e 100644 --- a/src/components/Proposal/Create/SchemeForms/CreateKnownGenericSchemeProposal.tsx +++ b/src/components/Proposal/Create/SchemeForms/CreateKnownGenericSchemeProposal.tsx @@ -37,11 +37,13 @@ const mapStateToProps = (state: IRootState, ownProps: IStateProps) => { interface IDispatchProps { createProposal: typeof arcActions.createProposal; + saveSignalData: typeof arcActions.saveSignalDescription; showNotification: typeof showNotification; } const mapDispatchToProps = { createProposal: arcActions.createProposal, + saveSignalData: arcActions.saveSignalDescription, showNotification, }; @@ -82,26 +84,36 @@ class CreateKnownSchemeProposal extends React.Component { private handleSubmit = async (values: IFormValues, { setSubmitting }: any ): Promise => { if (!await enableWalletProvider({ showNotification: this.props.showNotification })) { return; } - const currentAction = this.state.currentAction; - const callValues = []; for (const field of currentAction.getFields()) { const callValue = field.callValue(values[field.name]); values[field.name] = callValue; callValues.push(callValue); } - let callData = ""; try { - callData = this.props.genericSchemeInfo.encodeABI(currentAction, callValues); + + if(values.key) { + const ipfsValue = { + key: values.key, + value: "", + }; + if(currentAction.id !== "deleteSignalType") { + ipfsValue.value = values.value; + currentAction.abi.inputs.pop(); + } + const ipfsData = await this.props.saveSignalData(ipfsValue); + callData = this.props.genericSchemeInfo.encodeABI(currentAction, [ipfsData]); + } else { + callData = this.props.genericSchemeInfo.encodeABI(currentAction, callValues); + } } catch (err) { showNotification(NotificationStatus.Failure, err.message); setSubmitting(false); return; } setSubmitting(false); - const proposalValues = { ...values, callData, From 1c955f329288251271bc86cf24713c61926bea41 Mon Sep 17 00:00:00 2001 From: Shubhendu Shekhar Date: Tue, 10 Mar 2020 16:54:19 +0100 Subject: [PATCH 27/38] linting and small fixes. remove hardcoded address --- src/components/Dao/DaoHeader.tsx | 4 ++-- src/components/Dao/DaoSchemesPage.tsx | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/Dao/DaoHeader.tsx b/src/components/Dao/DaoHeader.tsx index 529ee8ac1..3ef766bae 100644 --- a/src/components/Dao/DaoHeader.tsx +++ b/src/components/Dao/DaoHeader.tsx @@ -97,7 +97,7 @@ const styles = { borderRadius: "50%", borderColor: "white", borderStyle: "solid", - } + }, }; -export default DaoHeader; \ No newline at end of file +export default DaoHeader; diff --git a/src/components/Dao/DaoSchemesPage.tsx b/src/components/Dao/DaoSchemesPage.tsx index d09e57967..fd6adbcca 100644 --- a/src/components/Dao/DaoSchemesPage.tsx +++ b/src/components/Dao/DaoSchemesPage.tsx @@ -98,9 +98,9 @@ class DaoSchemesPage extends React.Component { return (
- { backgroundImage && } - {dao.name} - { signal && } + { backgroundImage && } + {dao.name} + { signal && }

All Plugins

@@ -130,7 +130,7 @@ export default withSubscription({ const schemes = dao.schemes({}, { fetchAllData: true, subscribe: true }); // const DAOAddress = props.daoState.address; // Currently only one dao has signal data - const DAOAddress = "0x771d0279e094b547f0b42d72dd6bfcce278d9a20"; + const DAOAddress = dao.id; const signalQuery = gql` { signals(where: { id: "${DAOAddress}" } ) { From 524986955690327470a5389ba0d18aa20a22ec0b Mon Sep 17 00:00:00 2001 From: Shubhendu Shekhar Date: Wed, 11 Mar 2020 12:35:42 +0100 Subject: [PATCH 28/38] fix css --- src/components/Dao/DaoHeader.scss | 20 ++++++++++---------- src/components/Dao/DaoHeader.tsx | 15 +++------------ 2 files changed, 13 insertions(+), 22 deletions(-) diff --git a/src/components/Dao/DaoHeader.scss b/src/components/Dao/DaoHeader.scss index 3f0844e8b..9356ad4c5 100644 --- a/src/components/Dao/DaoHeader.scss +++ b/src/components/Dao/DaoHeader.scss @@ -1,4 +1,4 @@ -.header-wrap { +.headerWrap { background: white; margin: 8rem 2.5% 40px 0; padding: 25px; @@ -6,7 +6,7 @@ border-radius: 20px 20px 0 0; } -.reputation-holders { +.reputationHolders { display: block; position: absolute; font-size: 10px; @@ -15,18 +15,18 @@ white-space: nowrap; } -.dao-name { +.daoName { font-size: 24px; color: #689bd6; } -.dao-info { +.daoInfo { margin-left: 15%; top: 15px; position: absolute; } -.dao-description { +.daoDescription { font-family: $body-font; color: $black; font-weight: 500; @@ -34,13 +34,13 @@ width: 75%; } -.circular--square { +.circularSquare { border-radius: 50%; border-color: white; border-style: solid } -.dao-img { +.daoImg { // margin-left: 15% top: -40px; position: absolute @@ -54,18 +54,18 @@ margin-bottom: 15px } -.holdings .holdings-ammount { +.holdings .holdingsAmount { margin-top: 5px; color: #565a5d; font-size: 12px } -.holdings .holdings-ammount .holdings-name { +.holdings .holdingsAmount .holdingsName { float: right; margin-right: 25px } -.dao-header { +.daoHeader { position: absolute; top: 50px; } \ No newline at end of file diff --git a/src/components/Dao/DaoHeader.tsx b/src/components/Dao/DaoHeader.tsx index 3ef766bae..87a47fbf8 100644 --- a/src/components/Dao/DaoHeader.tsx +++ b/src/components/Dao/DaoHeader.tsx @@ -5,6 +5,7 @@ import withSubscription, { ISubscriptionProps } from "components/Shared/withSubs import AccountImage from "components/Account/AccountImage"; import * as css from "./DaoHeader.scss"; + interface Signal { id: string; data: any | string; @@ -21,8 +22,6 @@ class DaoHeaderComponent extends React.Component { render() { const { daoState, signal } = this.props; const { name, memberCount, address } = daoState; - const parsedSignal = JSON.parse(signal.data); - console.log('parsedSignal', parsedSignal); const data = { daoImg: "/assets/images/generic-user-avatar.png", reputationHolders: memberCount, @@ -44,7 +43,7 @@ class DaoHeaderComponent extends React.Component {
@@ -61,7 +60,7 @@ class DaoHeaderComponent extends React.Component { { data.holdings.map((holding, index) => { return ( -
+
{ holding.amount }
{ holding.name } @@ -92,12 +91,4 @@ const DaoHeader = withSubscription({ }, }); -const styles = { - circularSquare: { - borderRadius: "50%", - borderColor: "white", - borderStyle: "solid", - }, -}; - export default DaoHeader; From 6e9a3e955a331acd5ed32d9cdb033f2b39e86236 Mon Sep 17 00:00:00 2001 From: mrrobot16 Date: Tue, 17 Mar 2020 12:49:17 -0400 Subject: [PATCH 29/38] eslint fixes --- src/components/Account/AccountImage.tsx | 2 +- src/components/Dao/DaoHeader.tsx | 6 +++--- src/components/Dao/DaoSchemesPage.tsx | 12 ++++++------ src/genericSchemeRegistry/index.ts | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/components/Account/AccountImage.tsx b/src/components/Account/AccountImage.tsx index d4374727d..216fb7e04 100644 --- a/src/components/Account/AccountImage.tsx +++ b/src/components/Account/AccountImage.tsx @@ -26,6 +26,6 @@ export default class AccountImage extends React.Component { }); } - return (); + return (); } } diff --git a/src/components/Dao/DaoHeader.tsx b/src/components/Dao/DaoHeader.tsx index 5b58c4b00..ef164b58f 100644 --- a/src/components/Dao/DaoHeader.tsx +++ b/src/components/Dao/DaoHeader.tsx @@ -13,17 +13,17 @@ const styles = { }, }; -interface Signal { +interface ISignal { id: string; data: any | string; } interface IExternalProps { daoState: IDAOState; - signal?: Signal | any; + signal?: ISignal | any; } -type IProps = IExternalProps & ISubscriptionProps<[Scheme[], Signal | any]>; +type IProps = IExternalProps & ISubscriptionProps<[Scheme[], ISignal | any]>; class DaoHeaderComponent extends React.Component { render() { diff --git a/src/components/Dao/DaoSchemesPage.tsx b/src/components/Dao/DaoSchemesPage.tsx index fd6adbcca..04dcd45eb 100644 --- a/src/components/Dao/DaoSchemesPage.tsx +++ b/src/components/Dao/DaoSchemesPage.tsx @@ -10,13 +10,13 @@ import { BreadcrumbsItem } from "react-breadcrumbs-dynamic"; import { RouteComponentProps } from "react-router-dom"; import * as Sticky from "react-stickynode"; import { CSSTransition, TransitionGroup } from "react-transition-group"; +import gql from "graphql-tag"; +import { getArc } from "arc"; +import { combineLatest } from "rxjs"; import * as css from "./DaoSchemesPage.scss"; import ProposalSchemeCard from "./ProposalSchemeCard"; import SimpleSchemeCard from "./SimpleSchemeCard"; import DAOHeader from "./DaoHeader"; -import gql from "graphql-tag"; -import { getArc } from "arc"; -import { combineLatest } from "rxjs"; const Fade = ({ children, ...props }: any) => ( ; -interface Signal { +interface ISignal { id: string; data: any | string; -}; +} -type IProps = IExternalProps & ISubscriptionProps<[Scheme[], Signal[] | any]>; +type IProps = IExternalProps & ISubscriptionProps<[Scheme[], ISignal[] | any]>; class DaoSchemesPage extends React.Component { diff --git a/src/genericSchemeRegistry/index.ts b/src/genericSchemeRegistry/index.ts index 097eb15ba..0f42a5b2c 100644 --- a/src/genericSchemeRegistry/index.ts +++ b/src/genericSchemeRegistry/index.ts @@ -11,7 +11,7 @@ const ensRegistrarInfo = require("./schemes/EnsRegistrar.json"); const ensRegistryInfo = require("./schemes/ENSRegistry.json"); const ensPublicResolverInfo = require("./schemes/ENSPublicResolver.json"); const registryLookupInfo = require("./schemes/RegistryLookup.json"); -const signals = require("./schemes/Signals.json") +const signals = require("./schemes/Signals.json"); const KNOWNSCHEMES = [ dutchXInfo, From 8b511b7035e678d42338148554910f0030deceff Mon Sep 17 00:00:00 2001 From: mrrobot16 Date: Sun, 12 Apr 2020 19:14:46 -0400 Subject: [PATCH 30/38] Added responsive to this branch --- src/components/Dao/DaoHeader.scss | 40 ++++++++++++++++++++++----- src/components/Dao/DaoHeader.tsx | 27 ++++++++++-------- src/components/Dao/DaoSchemesPage.tsx | 6 ++-- 3 files changed, 52 insertions(+), 21 deletions(-) diff --git a/src/components/Dao/DaoHeader.scss b/src/components/Dao/DaoHeader.scss index 9356ad4c5..2b3c4ad17 100644 --- a/src/components/Dao/DaoHeader.scss +++ b/src/components/Dao/DaoHeader.scss @@ -41,17 +41,26 @@ } .daoImg { - // margin-left: 15% top: -40px; position: absolute } +.daoHeadingGroup { + margin-top: 10%; + .header { + margin-bottom: unset; + } + p { + margin-top: unset; + } +} + .holdings { - margin-left: 85%; padding: 15px; border: 1px solid #dbd7d7; border-radius: 7px; - margin-bottom: 15px + // width: 20%; + float: right; } .holdings .holdingsAmount { @@ -62,10 +71,27 @@ .holdings .holdingsAmount .holdingsName { float: right; - margin-right: 25px + margin-right: 25px; } -.daoHeader { - position: absolute; - top: 50px; +@media only screen and (max-width: 550px) { + .daoInfo { + margin-left: 30% !important; + } + + .daoDescription { + + } + + .holdings { + position: absolute; + position: relative; + width: unset; + left: 15px; + } + + .daoHeadingGroup { + margin-top: 20%; + } + } \ No newline at end of file diff --git a/src/components/Dao/DaoHeader.tsx b/src/components/Dao/DaoHeader.tsx index ef164b58f..78c0ad109 100644 --- a/src/components/Dao/DaoHeader.tsx +++ b/src/components/Dao/DaoHeader.tsx @@ -28,6 +28,7 @@ type IProps = IExternalProps & ISubscriptionProps<[Scheme[], ISignal | any]>; class DaoHeaderComponent extends React.Component { render() { const { daoState, signal } = this.props; + console.log(this.props) const { name, memberCount, address } = daoState; const data = { daoImg: "/assets/images/generic-user-avatar.png", @@ -39,7 +40,7 @@ class DaoHeaderComponent extends React.Component { ], description: ` ${name} is an independent, global community of people working together to build and promote Decentralized Autonomous Organizations (DAOs). - It’s the perfect place to get involved with DAOstack and get your feet wet in a real-life DAO. + It’s the perfect place to get involved with DAOstack. `, }; @@ -63,27 +64,31 @@ class DaoHeaderComponent extends React.Component {
- Holdings + Holdings { data.holdings.map((holding, index) => { return (
- { holding.amount } -
+ + { holding.amount } + + { holding.name } -
+
); }) }
- -

- This is the { name } Header -
- { data.description } + +
+
+ This is the { name } Header
-

+

+ { data.description } +

+
); } diff --git a/src/components/Dao/DaoSchemesPage.tsx b/src/components/Dao/DaoSchemesPage.tsx index 04dcd45eb..7b2d9f756 100644 --- a/src/components/Dao/DaoSchemesPage.tsx +++ b/src/components/Dao/DaoSchemesPage.tsx @@ -67,9 +67,9 @@ class DaoSchemesPage extends React.Component { const [allSchemes, signalsData] = data; const { signals } = signalsData.data; const signal = signals.length > 0 ? signals[0] : null; - const daoHeaderBackground = signal ? JSON.parse(signal.data).Header : null; - const backgroundImage = daoHeaderBackground ? daoHeaderBackground : null; - + // const daoHeaderBackground = signal ? JSON.parse(signal.data).Header : null; + // const backgroundImage = daoHeaderBackground ? daoHeaderBackground : null; + const backgroundImage = 'https://w.wallhaven.cc/full/13/wallhaven-13mk9v.jpg' const contributionReward = allSchemes.filter((scheme: Scheme) => scheme.staticState.name === "ContributionReward"); const knownSchemes = allSchemes.filter((scheme: Scheme) => scheme.staticState.name !== "ContributionReward" && KNOWN_SCHEME_NAMES.indexOf(scheme.staticState.name) >= 0); const unknownSchemes = allSchemes.filter((scheme: Scheme) => KNOWN_SCHEME_NAMES.indexOf(scheme.staticState.name) === -1 ); From 6f618ac457b4b89d9e2266adc482bbd178aa5978 Mon Sep 17 00:00:00 2001 From: mrrobot16 Date: Wed, 29 Apr 2020 16:03:04 -0400 Subject: [PATCH 31/38] Latest responsive code --- src/components/Dao/DaoHeader.scss | 84 +++++++++++++++++++++----- src/components/Dao/DaoHeader.tsx | 2 +- src/components/Dao/DaoSchemesPage.scss | 1 + src/components/Dao/DaoSchemesPage.tsx | 2 + 4 files changed, 74 insertions(+), 15 deletions(-) diff --git a/src/components/Dao/DaoHeader.scss b/src/components/Dao/DaoHeader.scss index 2b3c4ad17..3c09b2017 100644 --- a/src/components/Dao/DaoHeader.scss +++ b/src/components/Dao/DaoHeader.scss @@ -1,9 +1,10 @@ .headerWrap { background: white; - margin: 8rem 2.5% 40px 0; + margin: 8rem 2.5% 0 0; padding: 25px; position: relative; border-radius: 20px 20px 0 0; + z-index: 9999999999; } .reputationHolders { @@ -41,26 +42,39 @@ } .daoImg { - top: -40px; - position: absolute + top: -40px !important; + left: 5px !important; + position: absolute; } .daoHeadingGroup { - margin-top: 10%; .header { - margin-bottom: unset; + margin: unset; } p { margin-top: unset; } } +.daoImg { + top: -40px !important; + left: 5px !important; + position: absolute; +} +.headerWrap { + padding-top: 10vh; +} + +.daoInfo { + margin-left: 10% !important; +} .holdings { padding: 15px; border: 1px solid #dbd7d7; border-radius: 7px; - // width: 20%; float: right; + position: relative; + top: -50px; } .holdings .holdingsAmount { @@ -71,17 +85,17 @@ .holdings .holdingsAmount .holdingsName { float: right; - margin-right: 25px; + margin-left: 25px; } +.holdingsNumber { + margin-right: 10px; +} + @media only screen and (max-width: 550px) { .daoInfo { margin-left: 30% !important; } - - .daoDescription { - - } .holdings { position: absolute; @@ -90,8 +104,50 @@ left: 15px; } - .daoHeadingGroup { - margin-top: 20%; + + .daoImg { + top: -40px !important; + left: 5px !important; + position: absolute; + } + + .headerWrap { + padding-top: 10vh; + } + + .daoInfo { + margin-left: 8% !important; + margin-top: 31% !important; } -} \ No newline at end of file +} +@media only screen and (max-width: 1050px) { + .headerWrap { + padding-top: 10vh; + } + + .daoInfo { + margin-left: 30% !important; + } + + .holdings { + top: -20px; + } +} +@media only screen and (max-width: 650px) { + .daoImg { + top: -75px; + left: 75px; + position: absolute; + } + + .daoInfo { + margin-left: 35% !important; + margin-top: 0% !important; + } + + .holdings { + top: -30px; + } +} + diff --git a/src/components/Dao/DaoHeader.tsx b/src/components/Dao/DaoHeader.tsx index 78c0ad109..c40aceb15 100644 --- a/src/components/Dao/DaoHeader.tsx +++ b/src/components/Dao/DaoHeader.tsx @@ -69,7 +69,7 @@ class DaoHeaderComponent extends React.Component { data.holdings.map((holding, index) => { return (
- + { holding.amount } diff --git a/src/components/Dao/DaoSchemesPage.scss b/src/components/Dao/DaoSchemesPage.scss index 21e29bc4d..2e5bdd5b8 100644 --- a/src/components/Dao/DaoSchemesPage.scss +++ b/src/components/Dao/DaoSchemesPage.scss @@ -50,6 +50,7 @@ height: 30%; top:0; right: 0; + z-index: 9999999; } @media only screen and (max-width: 425px) { diff --git a/src/components/Dao/DaoSchemesPage.tsx b/src/components/Dao/DaoSchemesPage.tsx index 7b2d9f756..b6d20bbe0 100644 --- a/src/components/Dao/DaoSchemesPage.tsx +++ b/src/components/Dao/DaoSchemesPage.tsx @@ -67,6 +67,8 @@ class DaoSchemesPage extends React.Component { const [allSchemes, signalsData] = data; const { signals } = signalsData.data; const signal = signals.length > 0 ? signals[0] : null; + // TODO: + // Once backend issues our fix we will uncomment lines 71, 72. // const daoHeaderBackground = signal ? JSON.parse(signal.data).Header : null; // const backgroundImage = daoHeaderBackground ? daoHeaderBackground : null; const backgroundImage = 'https://w.wallhaven.cc/full/13/wallhaven-13mk9v.jpg' From f13ca00b088156f9a7ffbb5e9152e6514bd83ad0 Mon Sep 17 00:00:00 2001 From: mrrobot16 Date: Sun, 3 May 2020 16:10:45 -0400 Subject: [PATCH 32/38] Added dynamic holdings --- src/components/Dao/DaoHeader.scss | 5 ++ src/components/Dao/DaoHeader.tsx | 113 +++++++++++++++++++++++------- 2 files changed, 93 insertions(+), 25 deletions(-) diff --git a/src/components/Dao/DaoHeader.scss b/src/components/Dao/DaoHeader.scss index 3c09b2017..92bea43fa 100644 --- a/src/components/Dao/DaoHeader.scss +++ b/src/components/Dao/DaoHeader.scss @@ -92,6 +92,11 @@ margin-right: 10px; } +.holdingsList { + list-style: none; + padding-inline-start: 0px; +} + @media only screen and (max-width: 550px) { .daoInfo { margin-left: 30% !important; diff --git a/src/components/Dao/DaoHeader.tsx b/src/components/Dao/DaoHeader.tsx index c40aceb15..023b8011e 100644 --- a/src/components/Dao/DaoHeader.tsx +++ b/src/components/Dao/DaoHeader.tsx @@ -1,8 +1,13 @@ import * as React from "react"; -import { IDAOState, Scheme } from "@daostack/client"; +import { IDAOState, Scheme, Token } from "@daostack/client"; +import { getArc } from "arc"; +import { first } from "rxjs/operators"; +import { formatTokens, supportedTokens, fromWei, baseTokenName, ethErrorHandler, genName } from "lib/util"; import withSubscription, { ISubscriptionProps } from "components/Shared/withSubscription"; import AccountImage from "components/Account/AccountImage"; + +import BN = require("bn.js"); import * as css from "./DaoHeader.scss"; const styles = { @@ -19,31 +24,35 @@ interface ISignal { } interface IExternalProps { - daoState: IDAOState; + daoState: IDAOState | any; signal?: ISignal | any; } -type IProps = IExternalProps & ISubscriptionProps<[Scheme[], ISignal | any]>; +type IProps = IExternalProps & ISubscriptionProps<[Scheme[], ISignal, IDAOState | any]>; class DaoHeaderComponent extends React.Component { + render() { const { daoState, signal } = this.props; - console.log(this.props) - const { name, memberCount, address } = daoState; + const { name, memberCount, address, reputationTotalSupply } = daoState; const data = { daoImg: "/assets/images/generic-user-avatar.png", reputationHolders: memberCount, - holdings: [ - { name: "GEN", amount: 0.24653 }, - { name: "ETH", amount: 16.01 }, - { name: "DAI", amount: 148.19 }, - ], description: ` ${name} is an independent, global community of people working together to build and promote Decentralized Autonomous Organizations (DAOs). It’s the perfect place to get involved with DAOstack. `, }; - + + const SupportedTokens = (): any => { + const tokensSupported = (tokenAddress: any) => { + return ; + }; + return Object.keys(supportedTokens()).map(tokensSupported); + }; + + const REP = fromWei(reputationTotalSupply).toLocaleString(undefined, { minimumFractionDigits: 0, maximumFractionDigits: 2 }); + return (
@@ -65,20 +74,13 @@ class DaoHeaderComponent extends React.Component {
Holdings - { - data.holdings.map((holding, index) => { - return ( -
- - { holding.amount } - - - { holding.name } - -
- ); - }) - } +
    +
  • + { REP } REP +
  • + + +
@@ -93,6 +95,67 @@ class DaoHeaderComponent extends React.Component { ); } } +/***** DAO ETH Balance *****/ +interface IEthProps extends ISubscriptionProps { + dao: IDAOState; +} + +const ETHBalance = (props: IEthProps) => { + const { data } = props; + return
  • {formatTokens(data)} {baseTokenName()}
  • ; +}; + +const SubscribedEthBalance = withSubscription({ + wrappedComponent: ETHBalance, + loadingComponent:
  • ... {baseTokenName()}
  • , + errorComponent: null, + checkForUpdate: (oldProps: IEthProps, newProps: IEthProps) => { + return oldProps.dao.address !== newProps.dao.address; + }, + createObservable: (props: IEthProps) => { + const arc = getArc(); + return arc.dao(props.dao.address).ethBalance().pipe(ethErrorHandler()); + }, +}); + +/***** Token Balance *****/ +interface ITokenProps extends ISubscriptionProps { + dao: IDAOState; + tokenAddress: string; +} + +const TokenBalance = (props: ITokenProps) => { + const { data, error, isLoading, tokenAddress } = props; + + const tokenData = supportedTokens()[tokenAddress]; + if (isLoading || error || ((data === null || isNaN(data) || data.isZero()) && tokenData.symbol !== genName())) { + return null; + } + + return ( +
  • + {formatTokens(data, tokenData["symbol"], tokenData["decimals"])} +
  • + ); +}; + +const SubscribedTokenBalance = withSubscription({ + wrappedComponent: TokenBalance, + checkForUpdate: (oldProps: ITokenProps, newProps: ITokenProps) => { + return oldProps.dao.address !== newProps.dao.address || oldProps.tokenAddress !== newProps.tokenAddress; + }, + createObservable: async (props: ITokenProps) => { + // General cache priming for the DAO we do here + // prime the cache: get all members fo this DAO - + const daoState = props.dao; + + await daoState.dao.members({ first: 1000, skip: 0 }).pipe(first()).toPromise(); + + const arc = getArc(); + const token = new Token(props.tokenAddress, arc); + return token.balanceOf(daoState.address).pipe(ethErrorHandler()); + }, +}); const DaoHeader = withSubscription({ wrappedComponent: DaoHeaderComponent, From a65f320be806af6b00e79cd364af527591150bff Mon Sep 17 00:00:00 2001 From: mrrobot16 Date: Sat, 16 May 2020 14:27:08 -0400 Subject: [PATCH 33/38] deleted unneeded css code --- src/components/Dao/DaoHeader.scss | 68 +++------------------------ src/components/Dao/DaoSchemesPage.tsx | 2 +- 2 files changed, 7 insertions(+), 63 deletions(-) diff --git a/src/components/Dao/DaoHeader.scss b/src/components/Dao/DaoHeader.scss index 92bea43fa..9c60afd5c 100644 --- a/src/components/Dao/DaoHeader.scss +++ b/src/components/Dao/DaoHeader.scss @@ -2,6 +2,7 @@ background: white; margin: 8rem 2.5% 0 0; padding: 25px; + padding-top: 94px; position: relative; border-radius: 20px 20px 0 0; z-index: 9999999999; @@ -22,7 +23,7 @@ } .daoInfo { - margin-left: 15%; + margin-left: 100px; top: 15px; position: absolute; } @@ -55,26 +56,15 @@ margin-top: unset; } } -.daoImg { - top: -40px !important; - left: 5px !important; - position: absolute; -} -.headerWrap { - padding-top: 10vh; -} -.daoInfo { - margin-left: 10% !important; -} .holdings { padding: 15px; border: 1px solid #dbd7d7; border-radius: 7px; float: right; position: relative; - top: -50px; + top: -75px; } .holdings .holdingsAmount { @@ -97,62 +87,16 @@ padding-inline-start: 0px; } -@media only screen and (max-width: 550px) { - .daoInfo { - margin-left: 30% !important; - } - - .holdings { - position: absolute; - position: relative; - width: unset; - left: 15px; - } - - - .daoImg { - top: -40px !important; - left: 5px !important; - position: absolute; - } - - .headerWrap { - padding-top: 10vh; - } - - .daoInfo { - margin-left: 8% !important; - margin-top: 31% !important; - } - -} -@media only screen and (max-width: 1050px) { - .headerWrap { - padding-top: 10vh; - } - - .daoInfo { - margin-left: 30% !important; - } - - .holdings { - top: -20px; - } -} @media only screen and (max-width: 650px) { .daoImg { top: -75px; left: 75px; position: absolute; } +} - .daoInfo { - margin-left: 35% !important; - margin-top: 0% !important; - } - +@media only screen and (max-width: 768px) { .holdings { - top: -30px; + top: unset; } } - diff --git a/src/components/Dao/DaoSchemesPage.tsx b/src/components/Dao/DaoSchemesPage.tsx index b6d20bbe0..e9c20a2fe 100644 --- a/src/components/Dao/DaoSchemesPage.tsx +++ b/src/components/Dao/DaoSchemesPage.tsx @@ -36,7 +36,7 @@ const Fade = ({ children, ...props }: any) => ( const DAOHeaderBackground = (props: any) => (
    ); From 33bb93320acb2331eb70fa4c9cb81e21ff6e2d4f Mon Sep 17 00:00:00 2001 From: mrrobot16 Date: Sun, 17 May 2020 16:35:51 -0400 Subject: [PATCH 34/38] Background image fix -back in history --- src/components/Dao/DaoSchemesPage.scss | 7 +++---- src/components/Dao/DaoSchemesPage.tsx | 11 ++++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/components/Dao/DaoSchemesPage.scss b/src/components/Dao/DaoSchemesPage.scss index 2e5bdd5b8..fa9ac1716 100644 --- a/src/components/Dao/DaoSchemesPage.scss +++ b/src/components/Dao/DaoSchemesPage.scss @@ -42,15 +42,14 @@ } .daoHeaderBackground { - // @TODO Image is repeating, check this later when using real image - // background-image: url(/assets/images/bg-test.jpeg); - width: 115%; - position: absolute; display: flex; height: 30%; top:0; right: 0; z-index: 9999999; + position: fixed; + height: 30%; + width: 100vw; } @media only screen and (max-width: 425px) { diff --git a/src/components/Dao/DaoSchemesPage.tsx b/src/components/Dao/DaoSchemesPage.tsx index e9c20a2fe..e00d0e067 100644 --- a/src/components/Dao/DaoSchemesPage.tsx +++ b/src/components/Dao/DaoSchemesPage.tsx @@ -33,11 +33,12 @@ const Fade = ({ children, ...props }: any) => ( ); -const DAOHeaderBackground = (props: any) => ( -
    ( +
    + src={props.backgroundImage} + alt="daoHeaderBackground" + /> ); type IExternalProps = { @@ -100,7 +101,7 @@ class DaoSchemesPage extends React.Component { return (
    - { backgroundImage && } + { (signal && backgroundImage) && } {dao.name} { signal && } From 0f73aafea7ad460beb9205a3c8e948f1a485fb8d Mon Sep 17 00:00:00 2001 From: mrrobot16 Date: Sun, 17 May 2020 16:35:51 -0400 Subject: [PATCH 35/38] Background image fix -back in history --- src/components/Dao/DaoSchemesPage.scss | 7 +++---- src/components/Dao/DaoSchemesPage.tsx | 11 ++++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/components/Dao/DaoSchemesPage.scss b/src/components/Dao/DaoSchemesPage.scss index 2e5bdd5b8..fa9ac1716 100644 --- a/src/components/Dao/DaoSchemesPage.scss +++ b/src/components/Dao/DaoSchemesPage.scss @@ -42,15 +42,14 @@ } .daoHeaderBackground { - // @TODO Image is repeating, check this later when using real image - // background-image: url(/assets/images/bg-test.jpeg); - width: 115%; - position: absolute; display: flex; height: 30%; top:0; right: 0; z-index: 9999999; + position: fixed; + height: 30%; + width: 100vw; } @media only screen and (max-width: 425px) { diff --git a/src/components/Dao/DaoSchemesPage.tsx b/src/components/Dao/DaoSchemesPage.tsx index e9c20a2fe..e00d0e067 100644 --- a/src/components/Dao/DaoSchemesPage.tsx +++ b/src/components/Dao/DaoSchemesPage.tsx @@ -33,11 +33,12 @@ const Fade = ({ children, ...props }: any) => ( ); -const DAOHeaderBackground = (props: any) => ( -
    ( +
    + src={props.backgroundImage} + alt="daoHeaderBackground" + /> ); type IExternalProps = { @@ -100,7 +101,7 @@ class DaoSchemesPage extends React.Component { return (
    - { backgroundImage && } + { (signal && backgroundImage) && } {dao.name} { signal && } From 67278576cad866ed7faa4af3a100c6730c367cfc Mon Sep 17 00:00:00 2001 From: mrrobot16 Date: Tue, 19 May 2020 11:52:12 -0400 Subject: [PATCH 36/38] Revert "Background image fix -back in history" This reverts commit 0f73aafea7ad460beb9205a3c8e948f1a485fb8d. --- src/components/Dao/DaoSchemesPage.scss | 7 ++++--- src/components/Dao/DaoSchemesPage.tsx | 11 +++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/components/Dao/DaoSchemesPage.scss b/src/components/Dao/DaoSchemesPage.scss index fa9ac1716..2e5bdd5b8 100644 --- a/src/components/Dao/DaoSchemesPage.scss +++ b/src/components/Dao/DaoSchemesPage.scss @@ -42,14 +42,15 @@ } .daoHeaderBackground { + // @TODO Image is repeating, check this later when using real image + // background-image: url(/assets/images/bg-test.jpeg); + width: 115%; + position: absolute; display: flex; height: 30%; top:0; right: 0; z-index: 9999999; - position: fixed; - height: 30%; - width: 100vw; } @media only screen and (max-width: 425px) { diff --git a/src/components/Dao/DaoSchemesPage.tsx b/src/components/Dao/DaoSchemesPage.tsx index e00d0e067..e9c20a2fe 100644 --- a/src/components/Dao/DaoSchemesPage.tsx +++ b/src/components/Dao/DaoSchemesPage.tsx @@ -33,12 +33,11 @@ const Fade = ({ children, ...props }: any) => ( ); -const DAOHeaderBackground = (props: { backgroundImage: string }) => ( - ( +
    + style={{ backgroundImage: `url(${props.backgroundImage})`, backgroundRepeat: "no-repeat" }} + >
    ); type IExternalProps = { @@ -101,7 +100,7 @@ class DaoSchemesPage extends React.Component { return (
    - { (signal && backgroundImage) && } + { backgroundImage && } {dao.name} { signal && } From 8763f66cada6aaa4f507ebc40cbf2f5382c25a53 Mon Sep 17 00:00:00 2001 From: mrrobot16 Date: Tue, 19 May 2020 13:27:45 -0400 Subject: [PATCH 37/38] eslint fixes --- src/components/Dao/DaoSchemesPage.scss | 4 +- src/components/Dao/DaoSchemesPage.tsx | 18 ++-- src/settings.ts | 110 +++++++++++++++++++------ 3 files changed, 97 insertions(+), 35 deletions(-) diff --git a/src/components/Dao/DaoSchemesPage.scss b/src/components/Dao/DaoSchemesPage.scss index 2e5bdd5b8..439e00b13 100644 --- a/src/components/Dao/DaoSchemesPage.scss +++ b/src/components/Dao/DaoSchemesPage.scss @@ -44,8 +44,8 @@ .daoHeaderBackground { // @TODO Image is repeating, check this later when using real image // background-image: url(/assets/images/bg-test.jpeg); - width: 115%; - position: absolute; + width: 100vw; + position: fixed; display: flex; height: 30%; top:0; diff --git a/src/components/Dao/DaoSchemesPage.tsx b/src/components/Dao/DaoSchemesPage.tsx index e9c20a2fe..c03338afa 100644 --- a/src/components/Dao/DaoSchemesPage.tsx +++ b/src/components/Dao/DaoSchemesPage.tsx @@ -33,11 +33,12 @@ const Fade = ({ children, ...props }: any) => ( ); -const DAOHeaderBackground = (props: any) => ( -
    ( +
    + src={props.backgroundImage} + alt="daoHeaderBackground" + /> ); type IExternalProps = { @@ -67,11 +68,10 @@ class DaoSchemesPage extends React.Component { const [allSchemes, signalsData] = data; const { signals } = signalsData.data; const signal = signals.length > 0 ? signals[0] : null; + const daoHeaderBackground = signal ? JSON.parse(signal.data).Header : null; // TODO: - // Once backend issues our fix we will uncomment lines 71, 72. - // const daoHeaderBackground = signal ? JSON.parse(signal.data).Header : null; - // const backgroundImage = daoHeaderBackground ? daoHeaderBackground : null; - const backgroundImage = 'https://w.wallhaven.cc/full/13/wallhaven-13mk9v.jpg' + // Once backend issues are fix we will remove hardcoded background + const backgroundImage = daoHeaderBackground ? daoHeaderBackground : "https://i.picsum.photos/id/1006/1081/350.jpg"; const contributionReward = allSchemes.filter((scheme: Scheme) => scheme.staticState.name === "ContributionReward"); const knownSchemes = allSchemes.filter((scheme: Scheme) => scheme.staticState.name !== "ContributionReward" && KNOWN_SCHEME_NAMES.indexOf(scheme.staticState.name) >= 0); const unknownSchemes = allSchemes.filter((scheme: Scheme) => KNOWN_SCHEME_NAMES.indexOf(scheme.staticState.name) === -1 ); @@ -100,8 +100,8 @@ class DaoSchemesPage extends React.Component { return (
    - { backgroundImage && } {dao.name} + { signal && backgroundImage && } { signal && }

    All Plugins

    diff --git a/src/settings.ts b/src/settings.ts index 42d0f72be..143acf044 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -1,12 +1,15 @@ // disables some UI elements for a less resource-intensive page load export const ETHDENVER_OPTIMIZATION = true; // if this is true, we do get the contractInfos from a locally stored file in ./data instead of from the subgraph -export const USE_CONTRACTINFOS_CACHE = false; +export const USE_CONTRACTINFOS_CACHE = false; import BurnerConnectProvider from "@burner-wallet/burner-connect-provider"; import WalletConnectProvider from "@walletconnect/web3-provider"; +const Torus = require("@toruslabs/torus-embed"); + const Portis = require("@portis/web3"); const Fortmatic = require("fortmatic"); +const SubgraphEndpoints = require("./subgraph_endpoints.json"); function isMobileBrowser(): boolean { // if (!window) { @@ -15,7 +18,7 @@ function isMobileBrowser(): boolean { let check = false; // from here: https://detectmobilebrowsers.com/ // eslint-disable-next-line no-useless-escape - (function(a){if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4))) check = true; })(navigator.userAgent||navigator.vendor||(window as any).opera); + (function(a){if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0, 4))) check = true; })(navigator.userAgent||navigator.vendor||(window as any).opera); return check; } @@ -28,10 +31,14 @@ function getWeb3ConnectProviderOptions(network: string) { case "rinkeby": return { network: "rinkeby", + torus: { + package: Torus, + options: { network: "rinkeby" }, + }, walletconnect: { package: isMobileBrowser() ? null : WalletConnectProvider, options: { - infuraId: "e0cdf3bfda9b468fa908aa6ab03d5ba2", + infuraId: process.env.INFURA_ID, }, }, burnerconnect: { @@ -61,27 +68,72 @@ function getWeb3ConnectProviderOptions(network: string) { }, }, }; - case "xdai": + case "kovan": return { - network: "xdai", + network: "kovan", + torus: { + package: Torus, + options: { network: "kovan" }, + }, + walletconnect: { + package: isMobileBrowser() ? null : WalletConnectProvider, + options: { + infuraId: process.env.INFURA_ID, + }, + }, burnerconnect: { package: BurnerConnectProvider, options: { - defaultNetwork: "100", + defaultNetwork: "42", defaultWallets: [ - { origin: "https://buffidao.com/", name: "BuffiDAO" }, - { origin: "https://judge.buffidao.com/", name: "Judges BuffiDAO Wallet" }, + { origin: "https://denver-demo.burnerfactory.com/", name: "Denver Demo Wallet" }, ], }, }, + portis: { + package: Portis, + options: { + id: "aae9cff5-6e61-4b68-82dc-31a5a46c4a86", + }, + }, + fortmatic: { + package: Fortmatic, + options: { + key: "pk_test_659B5B486EF199E4", + }, + }, + squarelink: { + options: { + id: null as any, + }, + }, + }; + case "xdai": + return { + network: "xdai", + torus: { + package: Torus, + options: { + networkParams: { + host: "https://xdai.poanetwork.dev", + chainId: 100, + networkName: "xdai", + network: "xdai", + }, + }, + }, }; case "mainnet": return { network: "mainnet", + torus: { + package: Torus, + options: { network: "mainnet" }, + }, walletconnect: { package: isMobileBrowser() ? null : WalletConnectProvider, options: { - infuraId: "e0cdf3bfda9b468fa908aa6ab03d5ba2", + infuraId: process.env.INFURA_ID, }, }, burnerconnect: { @@ -116,8 +168,8 @@ function getWeb3ConnectProviderOptions(network: string) { export const settings = { ganache: { - graphqlHttpProvider: "http://127.0.0.1:8000/subgraphs/name/daostack", - graphqlWsProvider: "ws://127.0.0.1:8001/subgraphs/name/daostack", + graphqlHttpProvider: SubgraphEndpoints.http_ganache, + graphqlWsProvider: SubgraphEndpoints.ws_ganache, graphqlSubscribeToQueries: false, web3Provider: "ws://127.0.0.1:8545", web3ProviderRead: "ws://127.0.0.1:8545", @@ -126,36 +178,46 @@ export const settings = { web3ConnectProviderOptions: {}, }, rinkeby: { - graphqlHttpProvider: process.env.ARC_GRAPHQLHTTPPROVIDER || "https://api.thegraph.com/subgraphs/name/shekhar-shubhendu/signal-scheme-one", - graphqlWsProvider: process.env.ARC_GRAPHQLWSPROVIDER || "wss://api.thegraph.com/subgraphs/name/shekhar-shubhendu/signal-scheme-one", + graphqlHttpProvider: process.env.ARC_GRAPHQLHTTPPROVIDER || SubgraphEndpoints.http_rinkeby, + graphqlWsProvider: process.env.ARC_GRAPHQLWSPROVIDER || SubgraphEndpoints.ws_rinkeby, + // graphqlHttpProvider: process.env.ARC_GRAPHQLHTTPPROVIDER || SubgraphEndpoints.http_signal, + // graphqlWsProvider: process.env.ARC_GRAPHQLWSPROVIDER || SubgraphEndpoints.ws_signal, graphqlSubscribeToQueries: false, - web3Provider: process.env.ARC_WEB3PROVIDER || "wss://rinkeby.infura.io/ws/v3/e0cdf3bfda9b468fa908aa6ab03d5ba2", - web3ProviderRead: process.env.ARC_WEB3PROVIDERREAD || "wss://rinkeby.infura.io/ws/v3/e0cdf3bfda9b468fa908aa6ab03d5ba2", + web3Provider: process.env.ARC_WEB3PROVIDER || `wss://rinkeby.infura.io/ws/v3/${process.env.INFURA_ID}`, + web3ProviderRead: process.env.ARC_WEB3PROVIDERREAD || `wss://rinkeby.infura.io/ws/v3/${process.env.INFURA_ID}`, ipfsProvider: process.env.ARC_IPFSPROVIDER || "https://api.thegraph.com:443/ipfs-daostack/api/v0", txSenderServiceUrl: "https://tx-sender-service.herokuapp.com/send-tx", web3ConnectProviderOptions: getWeb3ConnectProviderOptions("rinkeby"), }, + kovan: { + graphqlHttpProvider: process.env.ARC_GRAPHQLHTTPPROVIDER || SubgraphEndpoints.http_kovan, + graphqlWsProvider: process.env.ARC_GRAPHQLWSPROVIDER || SubgraphEndpoints.ws_kovan, + graphqlSubscribeToQueries: false, + web3Provider: process.env.ARC_WEB3PROVIDER || `wss://kovan.infura.io/ws/v3/${process.env.INFURA_ID}`, + web3ProviderRead: process.env.ARC_WEB3PROVIDERREAD || `wss://kovan.infura.io/ws/v3/${process.env.INFURA_ID}`, + ipfsProvider: process.env.ARC_IPFSPROVIDER || "https://api.thegraph.com:443/ipfs-daostack/api/v0", + txSenderServiceUrl: "https://tx-sender-service.herokuapp.com/send-tx", + web3ConnectProviderOptions: getWeb3ConnectProviderOptions("kovan"), + }, xdai: { - graphqlHttpProvider: process.env.ARC_GRAPHQLHTTPPROVIDER || "https://api.thegraph.com/subgraphs-daostack/name/daostack/v38_3_xdai", - graphqlWsProvider: process.env.ARC_GRAPHQLWSPROVIDER || "wss://api.thegraph.com/subgraphs-daostack/name/daostack/v38_3_xdai", + graphqlHttpProvider: process.env.ARC_GRAPHQLHTTPPROVIDER || SubgraphEndpoints.http_xdai, + graphqlWsProvider: process.env.ARC_GRAPHQLWSPROVIDER || SubgraphEndpoints.ws_xdai, graphqlSubscribeToQueries: false, - web3Provider: process.env.ARC_WEB3PROVIDER || "https://poa.api.nodesmith.io/v1/dai/jsonrpc?apiKey=128059b9320a462699aef283a7ae2546", + web3Provider: process.env.ARC_WEB3PROVIDER || "wss://poa.api.nodesmith.io/v1/dai/jsonrpc?apiKey=128059b9320a462699aef283a7ae2546", web3ProviderRead: process.env.ARC_WEB3PROVIDERREAD || "wss://poa.api.nodesmith.io/v1/dai/jsonrpc/ws?apiKey=128059b9320a462699aef283a7ae2546", ipfsProvider: process.env.ARC_IPFSPROVIDER || "https://api.thegraph.com:443/ipfs-daostack/api/v0", txSenderServiceUrl: "", web3ConnectProviderOptions: getWeb3ConnectProviderOptions("xdai"), }, main: { - graphqlHttpProvider: process.env.ARC_GRAPHQLHTTPPROVIDER || "https://api.thegraph.com/subgraphs-daostack/name/daostack/v38_3", - graphqlWsProvider: process.env.ARC_GRAPHQLWSPROVIDER || "wss://api.thegraph.com/subgraphs-daostack/name/daostack/v38_3", + graphqlHttpProvider: process.env.ARC_GRAPHQLHTTPPROVIDER || SubgraphEndpoints.http_main, + graphqlWsProvider: process.env.ARC_GRAPHQLWSPROVIDER || SubgraphEndpoints.ws_main, graphqlSubscribeToQueries: false, - web3Provider: process.env.ARC_WEB3PROVIDER || "wss://mainnet.infura.io/ws/v3/e0cdf3bfda9b468fa908aa6ab03d5ba2", - web3ProviderRead: process.env.ARC_WEB3PROVIDERREAD || "wss://mainnet.infura.io/ws/v3/e0cdf3bfda9b468fa908aa6ab03d5ba2", + web3Provider: process.env.ARC_WEB3PROVIDER || `wss://mainnet.infura.io/ws/v3/${process.env.INFURA_ID}`, + web3ProviderRead: process.env.ARC_WEB3PROVIDERREAD || `wss://mainnet.infura.io/ws/v3/${process.env.INFURA_ID}`, ipfsProvider: process.env.ARC_IPFSPROVIDER || "https://api.thegraph.com:443/ipfs-daostack/api/v0", // txSenderServiceUrl: "https://tx-sender-service-mainnet.herokuapp.com/send-tx", txSenderServiceUrl: "", web3ConnectProviderOptions: getWeb3ConnectProviderOptions("mainnet"), }, }; - - From 88645d8bcd1cd7bc73b318e044ad9b58db3e1cf7 Mon Sep 17 00:00:00 2001 From: mrrobot16 Date: Tue, 26 May 2020 15:42:21 -0400 Subject: [PATCH 38/38] Added subgraph endpoints json --- src/subgraph_endpoints.json | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/subgraph_endpoints.json diff --git a/src/subgraph_endpoints.json b/src/subgraph_endpoints.json new file mode 100644 index 000000000..a101c8326 --- /dev/null +++ b/src/subgraph_endpoints.json @@ -0,0 +1,14 @@ +{ + "http_main": "https://api.thegraph.com/subgraphs-daostack/name/daostack/v39_4", + "ws_main": "wss://api.thegraph.com/subgraphs-daostack/name/daostack/v39_4", + "http_rinkeby": "https://api.thegraph.com/subgraphs-daostack/name/daostack/v39_4_rinkeby", + "ws_rinkeby": "wss://api.thegraph.com/subgraphs-daostack/name/daostack/v39_4_rinkeby", + "http_signal": "https://api.thegraph.com/subgraphs/name/apeunit/daostack-alchemy-signalscheme", + "ws_signal": "wss://api.thegraph.com/subgraphs/name/apeunit/daostack-alchemy-signalscheme", + "http_kovan": "https://api.thegraph.com/subgraphs-daostack/name/daostack/v39_4_kovan", + "ws_kovan": "wss://api.thegraph.com/subgraphs-daostack/name/daostack/v39_4_kovan", + "http_xdai": "https://api.thegraph.com/subgraphs-daostack/name/daostack/v39_4_xdai", + "ws_xdai": "wss://api.thegraph.com/subgraphs-daostack/name/daostack/v39_4_xdai", + "http_ganache": "http://127.0.0.1:8000/subgraphs/name/daostack", + "ws_ganache": "ws://127.0.0.1:8001/subgraphs/name/daostack" +} \ No newline at end of file