From 7f065b41638d06cb580e48944e10baa33e467b68 Mon Sep 17 00:00:00 2001 From: Daniel Ternyak Date: Mon, 1 Feb 2021 19:32:12 -0600 Subject: [PATCH] setup 'FUNDING BY ZOMG' --- .github/workflows/node.js.yml | 32 +++ .github/workflows/python-app.yml | 32 +++ admin/src/components/ProposalDetail/index.tsx | 208 +++++++++--------- admin/src/store.ts | 24 ++ admin/src/types.ts | 1 + backend/grant/admin/views.py | 20 +- backend/grant/proposal/models.py | 56 +++-- backend/migrations/versions/91b16dc2fd74_.py | 28 +++ frontend/client/api/constants.ts | 4 +- .../components/Profile/ProfileProposal.tsx | 27 ++- .../Proposal/CampaignBlock/index.tsx | 10 +- .../Proposals/ProposalCard/index.tsx | 7 +- frontend/client/static/images/zomg-logo.png | Bin 0 -> 57722 bytes frontend/client/static/images/zomg-logo.svg | 64 ++++++ frontend/types/proposal.ts | 1 + 15 files changed, 372 insertions(+), 142 deletions(-) create mode 100644 .github/workflows/node.js.yml create mode 100644 .github/workflows/python-app.yml create mode 100644 backend/migrations/versions/91b16dc2fd74_.py create mode 100644 frontend/client/static/images/zomg-logo.png create mode 100644 frontend/client/static/images/zomg-logo.svg diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml new file mode 100644 index 00000000..64f82163 --- /dev/null +++ b/.github/workflows/node.js.yml @@ -0,0 +1,32 @@ +# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions + +name: Node.js CI + +on: + push: + branches: + - develop + - master + pull_request: + branches: + - develop + - master + +jobs: + build: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [12.x] + # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ + + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - run: cd frontend && yarn && && yarn run lint && yarn run tsc diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml new file mode 100644 index 00000000..99f9547a --- /dev/null +++ b/.github/workflows/python-app.yml @@ -0,0 +1,32 @@ +# This workflow will install Python dependencies, run tests and lint with a single version of Python +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + +name: Python application + +on: + push: + branches: + - develop + - master + pull_request: + branches: + - develop + - master + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up Python 3.7 + uses: actions/setup-python@v2 + with: + python-version: 3.7 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + cd backend && pip install -r requirements/dev.txt + - name: Test with flask test + run: | + cd backend && cp .env.example .env && flask test diff --git a/admin/src/components/ProposalDetail/index.tsx b/admin/src/components/ProposalDetail/index.tsx index 80065bf9..389adbfe 100644 --- a/admin/src/components/ProposalDetail/index.tsx +++ b/admin/src/components/ProposalDetail/index.tsx @@ -2,27 +2,11 @@ import React from 'react'; import BN from 'bn.js'; import { view } from 'react-easy-state'; import { RouteComponentProps, withRouter } from 'react-router'; -import { - Alert, - Button, - Card, - Col, - Collapse, - Input, - message, - Popconfirm, - Row, - Tag, -} from 'antd'; +import { Alert, Button, Card, Col, Collapse, Input, message, Popconfirm, Row, Switch, Tag } from 'antd'; import TextArea from 'antd/lib/input/TextArea'; import store from 'src/store'; import { formatDateSeconds, formatDurationSeconds } from 'util/time'; -import { - MILESTONE_STAGE, - PROPOSAL_ARBITER_STATUS, - PROPOSAL_STAGE, - PROPOSAL_STATUS, -} from 'src/types'; +import { MILESTONE_STAGE, PROPOSAL_ARBITER_STATUS, PROPOSAL_STAGE, PROPOSAL_STATUS } from 'src/types'; import { Link } from 'react-router-dom'; import Back from 'components/Back'; import Markdown from 'components/Markdown'; @@ -30,6 +14,7 @@ import ArbiterControl from 'components/ArbiterControl'; import { fromZat, toZat } from 'src/util/units'; import FeedbackModal from '../FeedbackModal'; import { formatUsd } from 'util/formatters'; + import './index.less'; type Props = RouteComponentProps; @@ -58,6 +43,8 @@ class ProposalDetailNaked extends React.Component { return 'loading proposal...'; } + console.log(p.fundedByZomg); + const needsArbiter = PROPOSAL_ARBITER_STATUS.MISSING === p.arbiter.status && p.status === PROPOSAL_STATUS.LIVE && @@ -94,9 +81,9 @@ class ProposalDetailNaked extends React.Component {

) } - placement="left" - cancelText="cancel" - okText="confirm" + placement='left' + cancelText='cancel' + okText='confirm' visible={this.state.showCancelAndRefundPopover} okButtonProps={{ loading: store.proposalDetailCanceling, @@ -105,8 +92,8 @@ class ProposalDetailNaked extends React.Component { onConfirm={this.handleConfirmCancel} >