Skip to content
This repository has been archived by the owner on Dec 31, 2024. It is now read-only.

Commit

Permalink
Merge branch 'develop' into H_2471_improve_tables
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/components/layout/MainMenu/ManageMenu.jsx
#	src/components/views/MyDonations.jsx
#	src/components/views/myDelegations/MyDelegations.jsx
#	src/styles/_dashboard.scss
  • Loading branch information
RamRamez committed Sep 9, 2021
2 parents 7f574ac + 46e1bda commit 7ed3e07
Show file tree
Hide file tree
Showing 96 changed files with 2,953 additions and 6,268 deletions.
29 changes: 17 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,24 +63,29 @@ If your operative system is any distribution of linux you can use an All-in-One
5. That is it, you are now ready to run the giveth-dapp! Head to the [Run DApp](#run) section for further instructions.
#### Windows
1. Install Microsoft Visual Studio 2017 (double-check the version) from this [link](https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=Community&rel=15). Giveth-Dapp needs the node-gyp module and node-gyp needs VS C++ 2017 Build Tools to be installed.
2. After downloading, install the packages marked from this [image](./VSstudio.png).
3. After installing the above, you should install NodeJS version 10 [LTS](https://nodejs.org/dist/latest-v10.x/) (it is better to be v10.24.1 LTS).
4. Download and run the node-v10.24.1-x64.msi installer and then continue through the installation as normal. Be sure to have the "Enable in PATH" option enabled before installing.
5. Open the command line in administrator mode by right-clicking on the cmd.exe application and selecting "Run as administrator"
6. In the administrator command prompt, change to the directory where you want to store this repository.
1. Install the latest version of Python from this [Link](https://www.python.org/downloads/). (make sure python is added to $PATH)
2. Install Microsoft Visual Studio 2017 (double-check the version) from this [link](https://download.visualstudio.microsoft.com/download/pr/3e542575-929e-4297-b6c6-bef34d0ee648/639c868e1219c651793aff537a1d3b77/vs_buildtools.exe). Giveth-Dapp needs the node-gyp module and node-gyp needs VS C++ 2017 Build Tools to be installed.
3. After downloading, install the packages marked from this [image](https://cdn.discordapp.com/attachments/849682448102457374/850480734291623946/unknown.png).
4. Then run command below in command prompt
```
cd C:\some\directory\for\repositories
npm config set msvs_version 2017
```
7. Double-check the node version with CMD command:
5. After installing the above, you should install NodeJS version 10 [LTS](https://nodejs.org/dist/latest-v10.x/) (it is better to be v10.24.1 LTS).
6. Download and run the node-v10.24.1-x64.msi installer and then continue through the installation as normal. Be sure to have the "Enable in PATH" option enabled before installing.
7. Open the command line in administrator mode by right-clicking on the cmd.exe application and selecting "Run as administrator"
8. In the administrator command prompt, change to the directory where you want to store this repository.
```
node -v
cd C:\some\directory\for\repositories
```
8. After that, install the latest version of Yarn. Be careful not to install packages with NPM. If you have already tried "npm install", you should first delete "node modules" folder.
9. Double-check the node version with CMD command:
```
yarn install
node -v
```
9. That is it, you are now ready to run the giveth-dapp! Head to the [Run dapp](#run-dapp) section for further instructions.
10. After that, install the latest version of Yarn. Be careful not to install packages with NPM. If you have already tried "npm install", you should first delete "node modules" folder.
```
yarn install
```
11. That is it, you are now ready to run the giveth-dapp! Head to the [Run dapp](#run-dapp) section for further instructions.
### Run
1. The Giveth dapp will need to connect to a [feathers-giveth](https://github.com/Giveth/feathers-giveth) server. Follow the feathers-giveth readme instructions to install and run server before proceeding further. Alternatively, you could change the configuration to connect to the `develop` environment, see the [Configuration](#configuration) section.
Expand Down
13 changes: 6 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
{
"name": "giveth-dapp",
"version": "1.1.1",
"version": "1.1.2",
"private": true,
"dependencies": {
"@ant-design/icons": "^4.5.0",
"@feathersjs/authentication-client": "^4.5.11",
"@feathersjs/feathers": "^4.5.11",
"@feathersjs/rest-client": "^4.5.11",
"@giveth/bridge-contract": "^1.0.6",
"@giveth/liquidpledging-contract": "^2.0.0-beta.6",
"@giveth/lpp-campaign": "^2.0.0-beta.1",
"@giveth/lpp-capped-milestone": "^1.1.2",
"@giveth/lpp-milestones": "^2.0.0-beta.4",
"@sentry/react": "^6.8.0",
"@sentry/tracing": "^6.8.0",
"antd": "^4.12.2",
Expand All @@ -18,16 +23,11 @@
"feathers-reactive": "^0.8.2",
"feathers-socketio": "^2.0.1",
"file-saver": "^2.0.5",
"giveth-bridge": "1.0.4",
"giveth-liquidpledging": "1.0.1",
"history": "^4.9.0",
"jwt-decode": "^3.1.2",
"localforage": "^1.7.3",
"lodash.debounce": "4.0.8",
"lottie-react": "^2.1.0",
"lpp-campaign": "1.0.0",
"lpp-capped-milestone": "1.0.2",
"lpp-milestones": "^1.0.0-beta.1",
"moment": "^2.24.0",
"node-fetch": "^2.6.1",
"node-sass-chokidar": "^1.5.0",
Expand All @@ -46,7 +46,6 @@
"react-router-dom": "^5.2.0",
"react-scripts": "4.0.3",
"react-share": "^2.4.0",
"react-toastify": "2.1.7",
"react-tooltip": "^3.11.1",
"socket.io-client": "2.4.0",
"uuid": "^8.3.2",
Expand Down
1 change: 1 addition & 0 deletions public/img/giveth-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,11 @@

<!-- Google Font -->
<link rel="preconnect" href="https://fonts.gstatic.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Quicksand:wght@200;300;400;500;700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Red+Hat+Text:wght@400;500;700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Lato&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Red+Hat+Display&display=swap" rel="stylesheet">

<!-- WebRTC Support -->
<script src="https://cdn.webrtc-experiment.com/MultiStreamsMixer.js"></script>
Expand Down
3 changes: 3 additions & 0 deletions src/assets/GIV-icon-Text-fill.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/assets/GIV-icon-Text.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/fonts/texgyreadventor-bold.woff
Binary file not shown.
Binary file added src/assets/fonts/texgyreadventor-regular.woff
Binary file not shown.
8 changes: 8 additions & 0 deletions src/assets/logo-purple.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/assets/wallet.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
104 changes: 56 additions & 48 deletions src/components/AcceptRejectProposedTraceButtons.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React, { Fragment, useContext, useRef } from 'react';
import PropTypes from 'prop-types';
import { notification } from 'antd';

import TraceService from 'services/TraceService';
import Trace from 'models/Trace';
import ErrorPopup from 'components/ErrorPopup';
import { authenticateUser, checkBalance } from 'lib/middleware';
import ConversationModal from 'components/ConversationModal';
import { Context as Web3Context } from '../contextProviders/Web3Provider';
Expand All @@ -12,6 +12,9 @@ import BridgedTrace from '../models/BridgedTrace';
import LPPCappedTrace from '../models/LPPCappedTrace';
import LPTrace from '../models/LPTrace';
import { sendAnalyticsTracking } from '../lib/SegmentAnalytics';
import { txNotification } from '../lib/helpers';
import Campaign from '../models/Campaign';
import ErrorHandler from '../lib/ErrorHandler';

const AcceptRejectProposedTraceButtons = ({ trace }) => {
const conversationModal = useRef();
Expand Down Expand Up @@ -40,8 +43,31 @@ const AcceptRejectProposedTraceButtons = ({ trace }) => {
TraceService.rejectProposedTrace({
trace,
message: proof.message,
onSuccess: () => React.toast.info(<p>The proposed Trace has been rejected.</p>),
onError: e => ErrorPopup('Something went wrong with rejecting the proposed Trace', e),
onSuccess: () => {
notification.info({
message: '',
description: 'The proposed Trace has been rejected.',
});
sendAnalyticsTracking('Trace Rejected', {
category: 'Trace',
action: 'rejected proposed Trace',
traceId: trace._id,
title: trace.title,
ownerId: trace.ownerAddress,
traceType: trace.formType,
traceRecipientAddress: trace.recipientAddress,
parentCampaignId: trace.campaign._id,
slug: trace.slug,
ownerAddress: trace.ownerAddress,
traceOwnerName: trace.owner.name,
traceOwnerAddress: trace.ownerAddress,
parentCampaignTitle: trace.campaign.title,
parentCampaignAddress: trace.campaign.ownerAddress,
reviewerAddress: trace.reviewerAddress,
userAddress: currentUser.address,
});
},
onError: e => ErrorHandler(e, 'Something went wrong with rejecting the proposed Trace'),
});
});
});
Expand Down Expand Up @@ -71,7 +97,6 @@ const AcceptRejectProposedTraceButtons = ({ trace }) => {
sendAnalyticsTracking('Trace Accepted', {
category: 'Trace',
action: 'accepted proposed Trace',
trace,
traceId: trace._id,
title: trace.title,
slug: trace.slug,
Expand All @@ -87,66 +112,49 @@ const AcceptRejectProposedTraceButtons = ({ trace }) => {
userAddress: currentUser.address,
txUrl,
});

React.toast.info(
<p>
Accepting this Trace is pending...
<br />
<a href={txUrl} target="_blank" rel="noopener noreferrer">
View transaction
</a>
</p>,
);
},
onConfirmation: txUrl => {
React.toast.success(
<p>
The Trace has been accepted!
<br />
<a href={txUrl} target="_blank" rel="noopener noreferrer">
View transaction
</a>
</p>,
);
txNotification('Accepting this Trace is pending...', txUrl, true);
},
onConfirmation: txUrl => txNotification('The Trace has been accepted!', txUrl),
onError: (err, txUrl) => {
if (err === 'patch-error') {
ErrorPopup('Something went wrong with accepting this proposed Trace', err);
} else {
ErrorPopup(
'Something went wrong with the transaction.',
`${txUrl} => ${JSON.stringify(err, null, 2)}`,
ErrorHandler(err, 'Something went wrong with accepting this proposed Trace');
} else if (txUrl) {
const message = (
<Fragment>
<p>Something went wrong with the transaction.</p>
<a href={txUrl} target="_blank" rel="noopener noreferrer">
<p>View Transaction</p>
</a>
<p>{JSON.stringify(err, null, 2)}</p>
</Fragment>
);
}
ErrorHandler(err, message);
} else ErrorHandler(err);
},
web3,
});
}),
)
.catch(err => {
if (err === 'noBalance') {
ErrorPopup('There is no balance left on the account.', err);
} else if (err !== undefined) {
ErrorPopup('Something went wrong.', err);
}
});
.catch(err => ErrorHandler(err, 'Something went wrong on getting user balance.'));
});
};

return (
<Fragment>
{trace.canUserAcceptRejectProposal(currentUser) && (
<span>
<button
type="button"
className="btn btn-success btn-sm m-1"
onClick={() =>
isForeignNetwork ? acceptProposedTrace() : displayForeignNetRequiredWarning()
}
>
<i className="fa fa-check-square-o" />
&nbsp;Accept
</button>
{trace.campaign.status !== Campaign.ARCHIVED && (
<button
type="button"
className="btn btn-success btn-sm m-1"
onClick={() =>
isForeignNetwork ? acceptProposedTrace() : displayForeignNetRequiredWarning()
}
>
<i className="fa fa-check-square-o" />
&nbsp;Accept
</button>
)}
<button
type="button"
className="btn btn-danger btn-sm m-1"
Expand Down
Loading

0 comments on commit 7ed3e07

Please sign in to comment.