Skip to content

Commit

Permalink
Release 2 (#2159)
Browse files Browse the repository at this point in the history
* Updated arc.js, test env and subgraph (#2072)

* Updated arc.js, test env and subgraph

* join and quit --> join to match new arc.js

* updated doc to Join instead of JoinAndQuit

* refactor and fix issues relating 3box operations (#2018)

* upgrade provider packages

* update package-lock

* remove webpack from dependencies

* package-lock

* lint

* refactor, fix bugs

* better console info on errors

* clean up account profile loguc

* remove unused webReducer stuff

* merge conflict errors

* added some i18next

* upgrade provider packages

* remove webpack from dependencies

* package-lock

* refactor, fix bugs

* better console info on errors

* clean up account profile loguc

* merge conflict errors

* added some i18next

* package-lock

* 3box fix for identity-wallet

* fix bug in SAVE_THREEBOX

* revert to 3box 1.20.3

* fix error in follow

* remove Try Edit button

* clean up canEdit logic

* remove console.log statements

* fix merge conflict

* fix compile error

* Update translation.json

* update package-lock

* Support DAOs sort by total holdings (#2085)

* fething daos balances

* Support for DAOs total holdings ; sorting by total holdings

* Update translation.json

Missing comma after resolving conflicts.

* Minor adjustments due to changes in DAOs balances serivce that now returns balances only for registered DAOs (#2089)

* Updated chrome driver for tests (#2093)

* updated chrome driver for tests

* updated version also for seleniumArgs

* automatic update to the latest chrome driver

* updated webdriverio

* updated selenium

* Update .travis.yml

Removing auto version fetch as I'm not sure if it's working properly right now.
Will check it next time.

* updated dependencies (#2096)

* updated arc.js 54 (#2109)

* release dev-2 to master-2 (#2079)

* Updated arc.js, test env and subgraph (#2072)

* Updated arc.js, test env and subgraph

* join and quit --> join to match new arc.js

* updated doc to Join instead of JoinAndQuit

* Plugin manager create proposal modal has a left border and padding like the other modals (#2071)

* fix UI where votes screwed up (#2070)

* Better UI for DAO history page (#2069)

* Update documentation (#2062)

* updated documentation regarding i18next

* updated with global variables for styling

* example added

* better example

* refactor and fix issues relating 3box operations (#2018)

* upgrade provider packages

* update package-lock

* remove webpack from dependencies

* package-lock

* lint

* refactor, fix bugs

* better console info on errors

* clean up account profile loguc

* remove unused webReducer stuff

* merge conflict errors

* added some i18next

* upgrade provider packages

* remove webpack from dependencies

* package-lock

* refactor, fix bugs

* better console info on errors

* clean up account profile loguc

* merge conflict errors

* added some i18next

* package-lock

* 3box fix for identity-wallet

* fix bug in SAVE_THREEBOX

* revert to 3box 1.20.3

* fix error in follow

* remove Try Edit button

* clean up canEdit logic

* remove console.log statements

* fix merge conflict

* fix compile error

* Update translation.json

* update package-lock

* fix issue when a proposal card is not always clickable (#2077)

* revert subgraph endpoint domain (#2078)

Co-authored-by: roienatan <34843014+roienatan@users.noreply.github.com>
Co-authored-by: Doug Kent <dkent600@users.noreply.github.com>

* Updated daocreator version (#2114)

* updated daocreator version

* updated package lock

* updated arc.js version to 55 (#2130)

* Token Trade Implementation (#2055)

* [WIP] Token Trade Plugin

* CreateProposal and ProposalSummary created for TokenTrade (untested)

* Token trade fixes for BN.js amoun types

* [WIP] Create token trade proposal

* updating images

* TokenTrade proposal summary fixed

* Eliminated console.logs

* Updated arc.js, test env and subgraph (#2072)

* Updated arc.js, test env and subgraph

* join and quit --> join to match new arc.js

* updated doc to Join instead of JoinAndQuit

* Form service - i18next

* [WIP] styling details

* Plugin manager create proposal modal has a left border and padding like the other modals (#2071)

* fix UI where votes screwed up (#2070)

* Better UI for DAO history page (#2069)

* Update documentation (#2062)

* updated documentation regarding i18next

* updated with global variables for styling

* example added

* better example

* refactor and fix issues relating 3box operations (#2018)

* upgrade provider packages

* update package-lock

* remove webpack from dependencies

* package-lock

* lint

* refactor, fix bugs

* better console info on errors

* clean up account profile loguc

* remove unused webReducer stuff

* merge conflict errors

* added some i18next

* upgrade provider packages

* remove webpack from dependencies

* package-lock

* refactor, fix bugs

* better console info on errors

* clean up account profile loguc

* merge conflict errors

* added some i18next

* package-lock

* 3box fix for identity-wallet

* fix bug in SAVE_THREEBOX

* revert to 3box 1.20.3

* fix error in follow

* remove Try Edit button

* clean up canEdit logic

* remove console.log statements

* fix merge conflict

* fix compile error

* Update translation.json

* update package-lock

* fix issue when a proposal card is not always clickable (#2077)

* revert subgraph endpoint domain (#2078)

* Support DAOs sort by total holdings (#2085)

* fething daos balances

* Support for DAOs total holdings ; sorting by total holdings

* Update translation.json

Missing comma after resolving conflicts.

* Styling for Token Trade Proposal Summary and Changed JoinAndQuit naming

* Merge fixes

* Added package.lock

* Minor adjustments due to changes in DAOs balances serivce that now returns balances only for registered DAOs (#2089)

* bumping arc.js version

* Updated chrome driver for tests (#2093)

* updated chrome driver for tests

* updated version also for seleniumArgs

* automatic update to the latest chrome driver

* updated webdriverio

* updated selenium

* Update .travis.yml

Removing auto version fetch as I'm not sure if it's working properly right now.
Will check it next time.

* dev-2 merged

* lint error fix

* fix lint

* removed unused import

* added token trade to required plugin permissions object

Co-authored-by: cbrzn <cesarbrazon10@gmail.com>
Co-authored-by: roienatan <34843014+roienatan@users.noreply.github.com>
Co-authored-by: Doug Kent <dkent600@users.noreply.github.com>

* fix wrong plugin name (#2136)

* Update travis.yml to run test coverage (#2132)

* update travis.yml to run test coverage

* added coverall and configurations

* added more coverage configurations

* updated configurations

* modify travis.yml

* update travis node js version

* Update .travis.yml

* Update package.json

Co-authored-by: orenyodfat <orenyodfat@users.noreply.github.com>

* fix no side bar modal scrolling (#2141)

* Update arc.js 56 ; use polling (#2140)

* update arc.js 56

* use polling

* polling in redemptions page

* change all subscribe to polling

* fix proposals counters

* fix staking data not automatically updated

* fix redemption test

* run all tests

* fix failure in proposal summery

* missing redeem button in proposal summary

* remove unnecessary comments

* added global variable to graph poll interval ; updated interval to 30 seconds

* Support Join and FundingRequest creation in PluginManager (#2144)

* added support for join and fr on plugin manager ; need to update arc.js to proceed

* fix error of property pluginName does not exist on type never

* Robust UI to the Enable Predictions button to look good on both Windows and Mac (#2149)

* Added fieldset to Add params and Remove params to distinguish between them (#2157)

Co-authored-by: roienatan <34843014+roienatan@users.noreply.github.com>
Co-authored-by: Doug Kent <dkent600@users.noreply.github.com>
Co-authored-by: Nestor Amesty <nestor09amesty@gmail.com>
Co-authored-by: cbrzn <cesarbrazon10@gmail.com>
  • Loading branch information
5 people committed Oct 4, 2020
1 parent f62356e commit faf22e6
Show file tree
Hide file tree
Showing 43 changed files with 848 additions and 249 deletions.
82 changes: 44 additions & 38 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: node_js
node_js: 12.16.2
node_js: 12.18.3
addons:
apt:
update: true
Expand All @@ -14,49 +14,55 @@ before_install:
addons:
chrome: stable

script:
- docker -v
- docker-compose -v
# fail on error
# - set -e
- echo 'docker-compose build' && echo -en 'travis_fold:start:script.1\\r'
- docker-compose build
jobs:
include:
- stage: tests
name: "Unit tests"
script:
- docker -v
- docker-compose -v
# fail on error
# - set -e
- echo 'docker-compose build' && echo -en 'travis_fold:start:script.1\\r'
- docker-compose build

- echo -en 'travis_fold:end:script.1\\r'
- echo 'docker-compose up -d' && echo -en 'travis_fold:start:script.2\\r'
- docker-compose up -d
- echo -en 'travis_fold:end:script.2\\r'
- echo -en 'travis_fold:end:script.1\\r'
- echo 'docker-compose up -d' && echo -en 'travis_fold:start:script.2\\r'
- docker-compose up -d
- echo -en 'travis_fold:end:script.2\\r'

# wait for alchemy (the slowest latest process to respond
- bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' 127.0.0.1:3000)" != "200" ]]; do sleep 5; done'
# prin the status of the services
- npm run service-status
# wait for alchemy (the slowest latest process to respond
- bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' 127.0.0.1:3000)" != "200" ]]; do sleep 5; done'
# prin the status of the services
- npm run service-status

# show the daos that are indexed
- ./scripts/checkDaos.sh
- echo -en 'travis_fold:end:script.4\\r'
# show the daos that are indexed
- ./scripts/checkDaos.sh
- echo -en 'travis_fold:end:script.4\\r'

# check lint
- npm run lint
# unit tests
- npm run test:unit -- --forceExit
# unit tests
- npm run test:unit -- --forceExit
# run coverage report
- docker-compose logs alchemy || true
# run integration tests
- npm run test:integration:headless
- npm run report-coverage
# get some diagnostic info fo debugging travis
- echo 'Debug info:' && echo -en 'travis_fold:start:script.3\\r'
- npm run service-status
- docker-compose logs alchemy || true
- echo -en 'travis_fold:end:script.3\\r'

- docker-compose logs alchemy || true
# run integration tests
- npm run test:integration:headless
- ./scripts/checkDaos.sh

# get some diagnostic info fo debugging travis
- echo 'Debug info:' && echo -en 'travis_fold:start:script.3\\r'
- npm run service-status
- docker-compose logs alchemy || true
- echo -en 'travis_fold:end:script.3\\r'

- ./scripts/checkDaos.sh

# see if the app builds correctly
- echo 'npm run build-travis' && echo -en 'travis_fold:start:script.4\\r'
- npm run build-travis
- echo -en 'travis_fold:end:script.4\\r'
# see if the app builds correctly
- echo 'npm run build-travis' && echo -en 'travis_fold:start:script.4\\r'
- npm run build-travis
- echo -en 'travis_fold:end:script.4\\r'

- stage: tests
name: "ts/es lint"
script: npm run lint

deploy:
provider: pages
Expand Down
60 changes: 28 additions & 32 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 19 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,22 @@
"json",
"node"
],
"coveragePathIgnorePatterns": [
"/node_modules/",
"/test/"
],
"coverageThreshold": {
"global": {
"branches": 8,
"functions": 8,
"lines": 8,
"statements": 8
}
},
"collectCoverage": true,
"collectCoverageFrom": [
"src/**/*.{js,ts}"
],
"moduleNameMapper": {
"\\.(scss|css|less|svg|png|jpg)$": "identity-obj-proxy",
"^arc": "<rootDir>/src/arc",
Expand Down Expand Up @@ -71,6 +87,7 @@
"start-staging": "npm run start-staging-rinkeby",
"start-xdai": "cross-env NODE_ENV=production SHOW_ALL_DAOS=true NETWORK=xdai node --max_old_space_size=4096 ./node_modules/webpack-dev-server/bin/webpack-dev-server.js --config webpack.dev.config.js",
"storybook": "start-storybook",
"report-coverage": "cat ./coverage/lcov.info | coveralls",
"test": "wdio ./test/integration/wdio.conf.js",
"test:integration": "wdio ./test/integration/wdio.conf.js --inspect",
"test:integration:headless": "wdio ./test/integration/wdio-headless.conf.js",
Expand All @@ -79,7 +96,7 @@
"dependencies": {
"3box": "^1.20.3",
"@burner-wallet/burner-connect-provider": "^0.1.1",
"@daostack/arc.js": "2.0.0-experimental.55",
"@daostack/arc.js": "2.0.0-experimental.56",
"@dorgtech/daocreator-ui-experimental": "1.1.13",
"@portis/web3": "^2.0.0-beta.56",
"@sentry/browser": "^5.0.8",
Expand Down Expand Up @@ -195,6 +212,7 @@
"babel-loader": "^8.0.6",
"chai": "^4.2.0",
"copy-webpack-plugin": "^5.1.1",
"coveralls": "^3.1.0",
"cross-env": "^5.1.3",
"dotenv": "^8.2.0",
"eslint": "^7.3.1",
Expand Down
6 changes: 5 additions & 1 deletion src/actions/arcActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ import {
ReputationFromTokenPlugin,
Proposal,
FundingRequestProposal,
JoinProposal,
IProposalState,
TokenTradeProposal,
JoinProposal,
} from "@daostack/arc.js";
import { IAsyncAction } from "actions/async";
import { getArc } from "arc";
Expand Down Expand Up @@ -91,6 +92,9 @@ async function tryRedeemProposal(proposalId: string, accountAddress: string, obs
case "Join":
await (proposal as JoinProposal).redeem().subscribe(...observer);
break;
case "TokenTrade":
await (proposal as TokenTradeProposal).redeem().subscribe(...observer);
break;
default:
break;
}
Expand Down
4 changes: 3 additions & 1 deletion src/assets/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,7 @@
"Reputation Minted": "Reputation Minted:",
"Minimum DAO bounty": "Minimum DAO bounty:",
"Amount": "Amount:",
"Amount Redeemed": "Amount Redeemed:"
"Amount Redeemed": "Amount Redeemed:",
"Add Params": "Add Params",
"Remove Params": "Remove Params"
}
3 changes: 2 additions & 1 deletion src/components/Account/AccountBalances.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import * as css from "layouts/App.scss";
import * as React from "react";
import { combineLatest, of } from "rxjs";
import { getArc } from "arc";
import { GRAPH_POLL_INTERVAL } from "../../settings";

interface IExternalProps {
daoState?: IDAOState;
Expand Down Expand Up @@ -76,7 +77,7 @@ export default withSubscription({
})) : undefined;

return combineLatest(
member ? member.state( { subscribe: true }).pipe(ethErrorHandler()) : of(null),
member ? member.state( { polling: true, pollInterval: GRAPH_POLL_INTERVAL }).pipe(ethErrorHandler()) : of(null),
ethBalance(accountAddress).pipe(ethErrorHandler()),
arc.GENToken().balanceOf(accountAddress).pipe(ethErrorHandler())
);
Expand Down
3 changes: 2 additions & 1 deletion src/components/Account/AccountProfilePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { IProfileState } from "reducers/profilesReducer";
import { combineLatest, of } from "rxjs";
import Loading from "components/Shared/Loading";
import * as css from "./Account.scss";
import { GRAPH_POLL_INTERVAL } from "../../settings";

type IExternalProps = RouteComponentProps<any>;

Expand Down Expand Up @@ -355,7 +356,7 @@ const SubscribedAccountProfilePage = withSubscription({

return combineLatest(
// subscribe if only to to get DAO reputation supply updates
daoAvatarAddress ? dao.state({subscribe: true}) : of(null),
daoAvatarAddress ? dao.state({ polling: true, pollInterval: GRAPH_POLL_INTERVAL }) : of(null),
of(memberState),
ethBalance(accountAddress)
.pipe(ethErrorHandler()),
Expand Down
3 changes: 2 additions & 1 deletion src/components/Dao/DaoContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import DaoMembersPage from "./DaoMembersPage";
import * as css from "./Dao.scss";
import DaoLandingPage from "components/Dao/DaoLandingPage";
import i18next from "i18next";
import { GRAPH_POLL_INTERVAL } from "../../settings";

type IExternalProps = RouteComponentProps<any>;

Expand Down Expand Up @@ -151,7 +152,7 @@ const SubscribedDaoContainer = withSubscription({
const daoAddress = props.match.params.daoAvatarAddress;
const dao = arc.dao(daoAddress);
const observable = combineLatest(
dao.state({ subscribe: true, fetchAllData: true }), // DAO state
dao.state({ polling: true, pollInterval: GRAPH_POLL_INTERVAL, fetchAllData: true }), // DAO state
dao.members()
);
return observable;
Expand Down
2 changes: 1 addition & 1 deletion src/components/Dao/DaoHistoryPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ export default withSubscription({
${Stake.fragments.StakeFields}
${Plugin.baseFragment}
`;
await arc.getObservable(prefetchQuery, { subscribe: true }).pipe(first()).toPromise();
await arc.getObservable(prefetchQuery, { polling: true }).pipe(first()).toPromise();
return combineLatest(
dao.proposals({
where: {
Expand Down
3 changes: 2 additions & 1 deletion src/components/Dao/DaoPluginsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import * as css from "./DaoPluginsPage.scss";
import ProposalPluginCard from "./ProposalPluginCard";
import SimplePluginCard from "./SimplePluginCard";
import i18next from "i18next";
import { GRAPH_POLL_INTERVAL } from "../../settings";

const Fade = ({ children, ...props }: any) => (
<CSSTransition
Expand Down Expand Up @@ -152,7 +153,7 @@ const SubscribedDaoPluginsPage = withSubscription({
const dao = new DAO(arc, props.daoState);

return combineLatest(
dao.plugins({ where: { isRegistered: true } }, { fetchAllData: true, subscribe: true }),
dao.plugins({ where: { isRegistered: true } }, { fetchAllData: true, polling: true, pollInterval: GRAPH_POLL_INTERVAL }),
// Find the SchemeFactory plugin if this dao has one
Plugin.search(arc, { where: { dao: dao.id, name: "SchemeFactory" } }).pipe(mergeMap((plugin: Array<AnyPlugin>): Observable<IPluginState> => plugin[0] ? plugin[0].state() : of(null)))
);
Expand Down
4 changes: 3 additions & 1 deletion src/components/Dao/ProposalPluginCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import * as React from "react";
import { Link } from "react-router-dom";
import TrainingTooltip from "components/Shared/TrainingTooltip";
import * as css from "./PluginCard.scss";
import { GRAPH_POLL_INTERVAL } from "../../settings";

interface IExternalProps {
daoState: IDAOState;
Expand Down Expand Up @@ -100,7 +101,8 @@ export default withSubscription({
},
}, {
fetchAllData: true,
subscribe: true, // subscribe to updates of the proposals. We can replace this once https://github.com/daostack/subgraph/issues/326 is done
polling: true, // subscribe to updates of the proposals.
pollInterval: GRAPH_POLL_INTERVAL,
}); // the list of boosted proposals
},
});
Expand Down
7 changes: 4 additions & 3 deletions src/components/Daos/DaosPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import i18next from "i18next";
import classNames from "classnames";
import axios from "axios";
import { getNetworkName } from "lib/util";
import { GRAPH_POLL_INTERVAL } from "../../settings";

type SubscriptionData = [DAO[], DAO[], DAO[]];

Expand Down Expand Up @@ -328,13 +329,13 @@ const createSubscriptionObservable = (props: IStateProps, data: SubscriptionData
memberDAOsquery,
(arc: Arc, r: any) => new DAO(arc, createDaoStateFromQuery(r.dao)),
undefined,
{ subscribe: true }
{ polling: true, pollInterval: GRAPH_POLL_INTERVAL }
) : of([]);
// eslint-disable-next-line @typescript-eslint/naming-convention
const followDAOs = followingDAOs.length ? arc.daos({ where: { id_in: followingDAOs }, orderBy: "name", orderDirection: "asc" }, { fetchAllData: true, subscribe: true }) : of([]);
const followDAOs = followingDAOs.length ? arc.daos({ where: { id_in: followingDAOs }, orderBy: "name", orderDirection: "asc" }, { fetchAllData: true, polling: true, pollInterval: GRAPH_POLL_INTERVAL }) : of([]);

return combineLatest(
arc.daos({ orderBy: "name", orderDirection: "asc", first: PAGE_SIZE, skip: data ? data[0].length : 0 }, { fetchAllData: true, subscribe: true }),
arc.daos({ orderBy: "name", orderDirection: "asc", first: PAGE_SIZE, skip: data ? data[0].length : 0 }, { fetchAllData: true, polling: true, pollInterval: GRAPH_POLL_INTERVAL }),
followDAOs,
memberOfDAOs
);
Expand Down
Loading

0 comments on commit faf22e6

Please sign in to comment.