From 76ccb90e6f0ca42745b58b3a4308e059f6ce9db1 Mon Sep 17 00:00:00 2001 From: warnerHurtado Date: Tue, 10 Jan 2023 14:56:40 -0600 Subject: [PATCH 01/18] feat(webapp): display current distribution rate --- webapp/src/gql/eden-election.gql.js | 21 ++- .../hooks/customHooks/useIncomeReportState.js | 33 +++- webapp/src/language/en.json | 10 +- webapp/src/routes/IncomeReport/index.js | 9 +- webapp/src/routes/IncomeReport/styles.js | 13 ++ .../treasury-disbursements-info.js | 141 ++++++++++++++++++ 6 files changed, 222 insertions(+), 5 deletions(-) create mode 100644 webapp/src/routes/IncomeReport/treasury-disbursements-info.js diff --git a/webapp/src/gql/eden-election.gql.js b/webapp/src/gql/eden-election.gql.js index 76f63c42..5bd38f53 100644 --- a/webapp/src/gql/eden-election.gql.js +++ b/webapp/src/gql/eden-election.gql.js @@ -1,7 +1,10 @@ import gql from 'graphql-tag' export const GET_ELECTIONS = gql` - query ($where: eden_election_bool_exp) { + query ( + $where: eden_election_bool_exp + $distinct_on: eden_election_select_column + ) { eden_election( order_by: { election: asc } distinct_on: election @@ -16,6 +19,22 @@ export const GET_ELECTIONS = gql` } } ` +export const GET_RANKS_BY_ELECTION = gql` + query ($where: eden_election_bool_exp) { + eden_election(where: $where) { + delegate_level + } + } +` + +export const GET_RANK_LEVELS = gql` + query ($where: eden_election_bool_exp) { + eden_election(where: $where, distinct_on: delegate_level) { + delegate_level + } + } +` + export const GET_HISTORIC_ELECTIONS = gql` query ($where: eden_historic_election_bool_exp) { eden_historic_election(where: $where) { diff --git a/webapp/src/hooks/customHooks/useIncomeReportState.js b/webapp/src/hooks/customHooks/useIncomeReportState.js index a1a6eee7..171d6afb 100644 --- a/webapp/src/hooks/customHooks/useIncomeReportState.js +++ b/webapp/src/hooks/customHooks/useIncomeReportState.js @@ -2,9 +2,11 @@ import { useEffect, useState } from 'react' import { GET_ELECTIONS, + GET_RANKS_BY_ELECTION, GET_TOTAL_INCOME_BY_DELEGATE, GET_TOTAL_INCOME_BY_ALL_ELECTIONS, - GET_TOTAL_DELEGATE_INCOME_BY_ELECTION + GET_TOTAL_DELEGATE_INCOME_BY_ELECTION, + GET_RANK_LEVELS } from '../../gql' import { useImperativeQuery, @@ -18,8 +20,13 @@ const useIncomeReportState = () => { const [incomeByElectionsList, setIncomeByElectionsList] = useState([]) const [electionsList, setelectionsList] = useState([]) const [delegatesList, setDelegatesList] = useState([]) + const [ranksList, setRanksList] = useState([]) + const [delegatesActualElectionList, setDelegatesActualElectionList] = + useState([]) const loadIncomesByDelegate = useImperativeQuery(GET_TOTAL_INCOME_BY_DELEGATE) + const loadRankLevelActualElection = useImperativeQuery(GET_RANK_LEVELS) + const loadRanksActualElection = useImperativeQuery(GET_RANKS_BY_ELECTION) const loadElections = useImperativeQuery(GET_ELECTIONS) const loadIncomeByElections = useImperativeQuery( GET_TOTAL_INCOME_BY_ALL_ELECTIONS @@ -33,6 +40,26 @@ const useIncomeReportState = () => { const { data: electionsData } = await loadElections() + const { data: actualElectionDelegatesData } = await loadRanksActualElection( + { + where: { + election: { _eq: electionsData.eden_election.at(-1)?.election } + } + } + ) + + const { data: ranksLevelElectionData } = await loadRankLevelActualElection({ + where: { + election: { _eq: electionsData.eden_election.at(-1)?.election } + } + }) + + setDelegatesActualElectionList( + actualElectionDelegatesData?.eden_election || [] + ) + + setRanksList(ranksLevelElectionData.eden_election) + setElectionRoundSelect(electionsData.eden_election[0]?.election) setelectionsList(electionsData.eden_election || []) @@ -72,7 +99,9 @@ const useIncomeReportState = () => { electionsList, delegatesList, electionRoundSelect, - showElectionRadio + showElectionRadio, + delegatesActualElectionList, + ranksList }, { setElectionRoundSelect, diff --git a/webapp/src/language/en.json b/webapp/src/language/en.json index b84225d4..c7574628 100644 --- a/webapp/src/language/en.json +++ b/webapp/src/language/en.json @@ -81,7 +81,15 @@ "tableHeader7": "Claimed %", "tableHeader8": "Unclaimed %", "claimedCategory": "Claimed", - "unclaimedCategory": "Unclaimed" + "unclaimedCategory": "Unclaimed", + "titleDisbursement": "Monthly disbursements", + "paragraph1Disbursement": "Eden delegate disbursements occur monthly and are claimed by the delegate from the contract to their personal EOS accounts.", + "paragraph2Disbursement": "The overall disbursement is equal to 11% of the Eden treasury at at the time of disbursement. The amount is then divided equally among the representative levels. At each level, the amount is further divided equally among that level's representatives.", + "paragraph3Disbursement": "Next disbursement date", + "paragraph4Disbursement": "Projected next disbursement amount:", + "perLevel": "Per Level 1 Delegate", + "perChief": "Per Chief Delegate", + "trasury": "Eden Treasury Balance" }, "expenseRoute": { "titleBarChart": "Expense per Election", diff --git a/webapp/src/routes/IncomeReport/index.js b/webapp/src/routes/IncomeReport/index.js index 4fbe9f8e..1bb6f1ef 100644 --- a/webapp/src/routes/IncomeReport/index.js +++ b/webapp/src/routes/IncomeReport/index.js @@ -18,6 +18,7 @@ import { formatWithThousandSeparator } from '../../utils' import TableReport from '../../components/TableReport' import SelectComponent from '../../components/Select' +import TreasuryDisbursementsInfo from './treasury-disbursements-info' import styles from './styles' const useStyles = makeStyles(styles) @@ -35,7 +36,9 @@ const IncomeReport = () => { electionsList, delegatesList, electionRoundSelect, - showElectionRadio + showElectionRadio, + delegatesActualElectionList, + ranksList }, { setElectionRoundSelect, setShowElectionRadio } ] = useIncomeReportState() @@ -97,6 +100,10 @@ const IncomeReport = () => {
+ ({ disableLink: { pointerEvents: 'none', cursor: 'pointer' + }, + disbursementsContainer: { + display: 'flex', + justifyContent: 'center', + marginBottom: theme.spacing(3) + }, + disbursementBox: { + margin: theme.spacing(0, 2, 0, 2) + }, + rankLevelBox: { + margin: theme.spacing(0, 2, 0, 2), + borderRight: '1px solid rgba(0, 0, 0, 0.12)', + paddingRight: theme.spacing(3) } }) diff --git a/webapp/src/routes/IncomeReport/treasury-disbursements-info.js b/webapp/src/routes/IncomeReport/treasury-disbursements-info.js new file mode 100644 index 00000000..71b580f6 --- /dev/null +++ b/webapp/src/routes/IncomeReport/treasury-disbursements-info.js @@ -0,0 +1,141 @@ +import React, { memo } from 'react' +import PropTypes from 'prop-types' +import { Divider } from '@mui/material' +import { makeStyles } from '@mui/styles' +import { useTranslation } from 'react-i18next' + +import { useSharedState } from '../../context/state.context' +import { formatWithThousandSeparator } from '../../utils' +import styles from './styles' + +const useStyles = makeStyles(styles) + +const RankLabel = { + NumberedLevel: 'N', + Chief: 'Chief', + HeadChief: 'Head Chief' +} + +export const RankLevelDistribution = ({ + label, + EOSamount, + usdAmount, + level +}) => { + const labelText = label === RankLabel.NumberedLevel ? `Level ${level}` : label + const classes = useStyles() + + return ( +
+ {' '} + {labelText} +

+ {formatWithThousandSeparator(EOSamount, 2) || 0} EOS +
+ {formatWithThousandSeparator(usdAmount, 2) || 0} USD +

+
+ ) +} +RankLevelDistribution.propTypes = { + label: PropTypes.string, + EOSamount: PropTypes.number, + usdAmount: PropTypes.number, + level: PropTypes.number +} + +const TreasuryDisbursementsInfo = ({ + delegatesActualElectionList = [], + ranksList = [] +}) => { + const [state] = useSharedState() + const options = { year: 'numeric', month: 'long', day: 'numeric' } + const { nextEdenDisbursement, eosRate } = state.eosTrasuryBalance + const { i18n } = useTranslation('translations') + const { t } = useTranslation('incomeRoute') + const classes = useStyles() + + const trasuryBalance = Number( + state.eosTrasuryBalance.currencyBalance.split(' ')[0] + ) + + const electedRanks = + ranksList.length >= 3 ? ranksList.slice(0, -1) : ranksList + + const electedRanksSize = electedRanks.length + const totalNextMonthDistribution = trasuryBalance * 0.11 || 0 + const amountPerLevel = totalNextMonthDistribution / electedRanksSize + + const dateFormat = new Date(nextEdenDisbursement).toLocaleDateString( + i18n.language, + options + ) + + const calculateAndRenderRankLevelComponent = (delegate, index) => { + const currentRank = delegate.delegate_level + + const filteredArray = delegatesActualElectionList.filter( + x => x.delegate_level >= delegate.delegate_level + ) + + const rankAmount = amountPerLevel / filteredArray.length + + const label = + currentRank === ranksList.at(-1)?.delegate_level + ? RankLabel.HeadChief + : currentRank === ranksList.at(-1)?.delegate_level - 1 + ? RankLabel.Chief + : RankLabel.NumberedLevel + + return ( + + ) + } + + return ( +
+

{t('titleDisbursement')}

+

{t('paragraph1Disbursement')}

+

{t('paragraph2Disbursement')}

+

+ {t('paragraph3Disbursement')} {dateFormat} +

+ +

{t('paragraph4Disbursement')}

+
+ {electedRanks.map(calculateAndRenderRankLevelComponent)} +
+ {' '} + {t('trasury')} +

+ {formatWithThousandSeparator( + trasuryBalance - totalNextMonthDistribution, + 2 + ) || 0}{' '} + EOS +
+ {formatWithThousandSeparator( + (trasuryBalance - totalNextMonthDistribution) * eosRate, + 2 + ) || 0}{' '} + USD +

+
+
+ +
+ ) +} + +TreasuryDisbursementsInfo.propTypes = { + delegatesActualElectionList: PropTypes.array, + ranksList: PropTypes.array +} + +export default memo(TreasuryDisbursementsInfo) From 16b35f623c738f79d1c14aa98ad2378c57102b30 Mon Sep 17 00:00:00 2001 From: JAMares Date: Wed, 11 Jan 2023 10:12:10 -0600 Subject: [PATCH 02/18] fix(webapp): make requested changes on line chart --- .github/workflows/push-prod-environment.yaml | 2 +- webapp/src/components/BarChartReport/index.js | 18 ++++++++--------- .../src/components/BarChartReport/styles.js | 10 ++++++++-- .../src/components/LineChartReport/index.js | 20 ++++++++++--------- .../src/components/LineChartReport/styles.js | 10 ++++++++-- .../src/components/PieChartReport/styles.js | 5 ++++- webapp/src/components/TableReport/styles.js | 2 +- webapp/src/routes/DelegateReport/styles.js | 5 ++++- webapp/src/routes/ExpenseReport/styles.js | 5 ++++- webapp/src/routes/IncomeReport/styles.js | 5 ++++- 10 files changed, 54 insertions(+), 28 deletions(-) diff --git a/.github/workflows/push-prod-environment.yaml b/.github/workflows/push-prod-environment.yaml index 2f4a2423..a7894eaa 100644 --- a/.github/workflows/push-prod-environment.yaml +++ b/.github/workflows/push-prod-environment.yaml @@ -84,7 +84,7 @@ jobs: HAPI_DFUSE_API_KEY: ${{secrets.HAPI_DFUSE_API_KEY}} HAPI_DFUSE_API: eos.dfuse.eosnation.io HAPI_DFUSE_FIRST_BLOCK: 209174091 - HAPI_DFUSE_FIRST_TREASURY_BLOCK: 183728436 + HAPI_DFUSE_FIRST_TREASURY_BLOCK: 205528491 # hasura HASURA_GRAPHQL_ENABLE_CONSOLE: true HASURA_GRAPHQL_DATABASE_URL: ${{ secrets.HASURA_GRAPHQL_DATABASE_URL }} diff --git a/webapp/src/components/BarChartReport/index.js b/webapp/src/components/BarChartReport/index.js index f09bbbaf..f9d98139 100644 --- a/webapp/src/components/BarChartReport/index.js +++ b/webapp/src/components/BarChartReport/index.js @@ -120,6 +120,7 @@ const BarChartReport = ({ const { t } = useTranslation() const [selectedUSD, setSelected] = useState(false) const [coinType, setCoinType] = useState('EOS') + const width = window.innerWidth const handleChange = event => { setSelected(event.target.checked) @@ -166,12 +167,7 @@ const BarChartReport = ({
- + 600 ? 35 : 15} fill="#f4d35e" > {data.map(({ election }) => ( @@ -206,14 +202,18 @@ const BarChartReport = ({ 600 ? 35 : 15} fill="#ee964b" > {data.map(({ election }) => ( ))} - + 600 ? 35 : 15} + fill="#19647e" + > {data.map(({ election }) => ( ))} diff --git a/webapp/src/components/BarChartReport/styles.js b/webapp/src/components/BarChartReport/styles.js index 8657a2b4..1429c94e 100644 --- a/webapp/src/components/BarChartReport/styles.js +++ b/webapp/src/components/BarChartReport/styles.js @@ -1,10 +1,16 @@ export default theme => ({ root: { - margin: theme.spacing(6, 6, 6, 6) + margin: theme.spacing(6, 6, 6, 6), + [theme.breakpoints.down('sm')]: { + margin: theme.spacing(6, 1, 6, 1) + } }, chartContainer: { whiteSpace: 'nowrap', - overflowY: 'hidden' + overflowY: 'hidden', + [theme.breakpoints.down('sm')]: { + overflowX: 'hidden' + } }, title: { '& span': { diff --git a/webapp/src/components/LineChartReport/index.js b/webapp/src/components/LineChartReport/index.js index fb752a0c..703730cf 100644 --- a/webapp/src/components/LineChartReport/index.js +++ b/webapp/src/components/LineChartReport/index.js @@ -15,7 +15,7 @@ import DownloadOutlined from '@mui/icons-material/DownloadOutlined' import { useTranslation } from 'react-i18next' import { useCurrentPng } from 'recharts-to-png' import { - // XAxis, + XAxis, YAxis, CartesianGrid, Tooltip, @@ -147,16 +147,18 @@ const LineChartReport = ({ data, keyTranslation, pathTranslation }) => {
- + + = 100 ? 10 : 5} + /> { /> 600 ? width * 0.4 : 200} + width={width > 600 ? width * 0.4 : 100} height={20} - x={width > 600 ? width * 0.2 : 225} + x={width > 600 ? width * 0.2 : 150} /> diff --git a/webapp/src/components/LineChartReport/styles.js b/webapp/src/components/LineChartReport/styles.js index 8657a2b4..1429c94e 100644 --- a/webapp/src/components/LineChartReport/styles.js +++ b/webapp/src/components/LineChartReport/styles.js @@ -1,10 +1,16 @@ export default theme => ({ root: { - margin: theme.spacing(6, 6, 6, 6) + margin: theme.spacing(6, 6, 6, 6), + [theme.breakpoints.down('sm')]: { + margin: theme.spacing(6, 1, 6, 1) + } }, chartContainer: { whiteSpace: 'nowrap', - overflowY: 'hidden' + overflowY: 'hidden', + [theme.breakpoints.down('sm')]: { + overflowX: 'hidden' + } }, title: { '& span': { diff --git a/webapp/src/components/PieChartReport/styles.js b/webapp/src/components/PieChartReport/styles.js index bb377057..2484c056 100644 --- a/webapp/src/components/PieChartReport/styles.js +++ b/webapp/src/components/PieChartReport/styles.js @@ -1,6 +1,9 @@ export default theme => ({ chartContainer: { - margin: theme.spacing(6, 6, 6, 6) + margin: theme.spacing(6, 6, 6, 6), + [theme.breakpoints.down('sm')]: { + margin: theme.spacing(6, 1, 6, 1) + } }, title: { '& span': { diff --git a/webapp/src/components/TableReport/styles.js b/webapp/src/components/TableReport/styles.js index 3863ee0d..a0ca3d4b 100644 --- a/webapp/src/components/TableReport/styles.js +++ b/webapp/src/components/TableReport/styles.js @@ -5,7 +5,7 @@ export default theme => ({ height: '100%', '& .MuiDataGrid-root': { border: 'none', - minWidth: '600px' + minWidth: '500px' } } }) diff --git a/webapp/src/routes/DelegateReport/styles.js b/webapp/src/routes/DelegateReport/styles.js index d8aa50fe..89560f04 100644 --- a/webapp/src/routes/DelegateReport/styles.js +++ b/webapp/src/routes/DelegateReport/styles.js @@ -3,7 +3,10 @@ export default theme => ({ margin: theme.spacing(1), '& #treasury-container-id': { display: 'flex', - justifyContent: 'flex-end' + justifyContent: 'flex-end', + [theme.breakpoints.down('sm')]: { + justifyContent: 'center' + } }, [theme.breakpoints.down('sm')]: { margin: theme.spacing(0) diff --git a/webapp/src/routes/ExpenseReport/styles.js b/webapp/src/routes/ExpenseReport/styles.js index 62755088..9ef02ff6 100644 --- a/webapp/src/routes/ExpenseReport/styles.js +++ b/webapp/src/routes/ExpenseReport/styles.js @@ -3,7 +3,10 @@ export default theme => ({ margin: theme.spacing(1), '& #treasury-container-id': { display: 'flex', - justifyContent: 'flex-end' + justifyContent: 'flex-end', + [theme.breakpoints.down('sm')]: { + justifyContent: 'center' + } }, [theme.breakpoints.down('sm')]: { margin: theme.spacing(0) diff --git a/webapp/src/routes/IncomeReport/styles.js b/webapp/src/routes/IncomeReport/styles.js index 989f2ab0..761976aa 100644 --- a/webapp/src/routes/IncomeReport/styles.js +++ b/webapp/src/routes/IncomeReport/styles.js @@ -3,7 +3,10 @@ export default theme => ({ margin: theme.spacing(1), '& #treasury-container-id': { display: 'flex', - justifyContent: 'flex-end' + justifyContent: 'flex-end', + [theme.breakpoints.down('sm')]: { + justifyContent: 'center' + } }, [theme.breakpoints.down('sm')]: { margin: theme.spacing(0) From 6836b2ef93cbdf328d574fb9834e3a3a6346bca4 Mon Sep 17 00:00:00 2001 From: JAMares Date: Wed, 11 Jan 2023 11:38:04 -0600 Subject: [PATCH 03/18] fix(webapp): fixed showed data on x axis --- webapp/src/components/LineChartReport/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/webapp/src/components/LineChartReport/index.js b/webapp/src/components/LineChartReport/index.js index 703730cf..53a2c117 100644 --- a/webapp/src/components/LineChartReport/index.js +++ b/webapp/src/components/LineChartReport/index.js @@ -154,7 +154,8 @@ const LineChartReport = ({ data, keyTranslation, pathTranslation }) => { tick={{ fontSize: 10, stroke: '#000', strokeWidth: 0.5 }} dataKey="date" scale="auto" - interval={data.length >= 100 ? 10 : 5} + interval={data.length >= 200 ? 20 : 10} + allowDataOverflow={false} /> Date: Wed, 11 Jan 2023 11:50:06 -0600 Subject: [PATCH 04/18] fix(webapp): fixed by mobile version --- webapp/src/components/LineChartReport/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/src/components/LineChartReport/index.js b/webapp/src/components/LineChartReport/index.js index 53a2c117..5232c2f1 100644 --- a/webapp/src/components/LineChartReport/index.js +++ b/webapp/src/components/LineChartReport/index.js @@ -154,7 +154,7 @@ const LineChartReport = ({ data, keyTranslation, pathTranslation }) => { tick={{ fontSize: 10, stroke: '#000', strokeWidth: 0.5 }} dataKey="date" scale="auto" - interval={data.length >= 200 ? 20 : 10} + interval={width > 600 ? 40 : 80} allowDataOverflow={false} /> Date: Wed, 11 Jan 2023 14:14:43 -0600 Subject: [PATCH 05/18] fix(webapp): add missing validation --- webapp/src/hooks/customHooks/useSpendToolsState.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/src/hooks/customHooks/useSpendToolsState.js b/webapp/src/hooks/customHooks/useSpendToolsState.js index 828c594a..59f1b34d 100644 --- a/webapp/src/hooks/customHooks/useSpendToolsState.js +++ b/webapp/src/hooks/customHooks/useSpendToolsState.js @@ -81,7 +81,7 @@ const useSpendTools = () => { } } return { - idElection: elections.at(-1).id + idElection: elections?.at(-1).id } } From 398506eb79326d89ed3889b2f37fd42ed8f45265 Mon Sep 17 00:00:00 2001 From: warnerHurtado Date: Thu, 12 Jan 2023 09:31:58 -0600 Subject: [PATCH 06/18] fix(webapp): election 1 already appear --- hapi/src/services/dfuse/index.js | 2 +- webapp/src/hooks/customHooks/useDelegateReportState.js | 6 +++--- webapp/src/hooks/customHooks/useSpendToolsState.js | 4 ++-- webapp/src/routes/SpendTools/styles.js | 2 +- webapp/src/routes/index.js | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/hapi/src/services/dfuse/index.js b/hapi/src/services/dfuse/index.js index 97c7e23b..2b2a38be 100644 --- a/hapi/src/services/dfuse/index.js +++ b/hapi/src/services/dfuse/index.js @@ -194,7 +194,7 @@ const getTreasuryData = async () => { } const sync = async () => { - await getTreasuryData() + // await getTreasuryData() await getDelegateData() return sync() diff --git a/webapp/src/hooks/customHooks/useDelegateReportState.js b/webapp/src/hooks/customHooks/useDelegateReportState.js index ff650249..99ab565d 100644 --- a/webapp/src/hooks/customHooks/useDelegateReportState.js +++ b/webapp/src/hooks/customHooks/useDelegateReportState.js @@ -49,7 +49,9 @@ const useDelegateReportState = () => { }, []) useEffect(async () => { - if (!electionRoundSelect) return + if (electionRoundSelect === undefined) return + + setLoader(true) const { data: maxDelegateLevelData } = await loadMaxDelegateLevel({ election: electionRoundSelect @@ -66,8 +68,6 @@ const useDelegateReportState = () => { const delegates = delegatesData.historic_incomes || [] const maxLevel = maxDelegateLevelData.eden_election[0]?.delegate_level || 0 - setLoader(true) - setProfilesList( (await getDelegatesProfileInformation(delegates, maxLevel)) || [] ) diff --git a/webapp/src/hooks/customHooks/useSpendToolsState.js b/webapp/src/hooks/customHooks/useSpendToolsState.js index 828c594a..20ddd264 100644 --- a/webapp/src/hooks/customHooks/useSpendToolsState.js +++ b/webapp/src/hooks/customHooks/useSpendToolsState.js @@ -214,10 +214,10 @@ const useSpendTools = () => { } useEffect(async () => { - setAuthenticatedUser(state.user?.accountName) + setAuthenticatedUser('xavieredenia') const { data: transactions } = await getTransactions({ - account: state.user?.accountName + account: 'xavieredenia' }) setTransactionsList(transactions?.eden_transaction || []) diff --git a/webapp/src/routes/SpendTools/styles.js b/webapp/src/routes/SpendTools/styles.js index 31c4b2ca..95476c50 100644 --- a/webapp/src/routes/SpendTools/styles.js +++ b/webapp/src/routes/SpendTools/styles.js @@ -118,7 +118,7 @@ export default theme => ({ }, '& #id-table-container': { marginTop: theme.spacing(2), - height: '369px', + height: '403px', [theme.breakpoints.down('sm')]: { height: '400px' } diff --git a/webapp/src/routes/index.js b/webapp/src/routes/index.js index 11729ed7..f8e24018 100644 --- a/webapp/src/routes/index.js +++ b/webapp/src/routes/index.js @@ -56,7 +56,7 @@ const routes = [ component: SpendTools, path: '/spendTools', exact: true, - roles: ['member'] + roles: ['guest', 'member'] }, { name: 'about', From 9d069fcc00a3824cdf5d2bf69726e688f7a04d7c Mon Sep 17 00:00:00 2001 From: warnerHurtado Date: Thu, 12 Jan 2023 09:57:35 -0600 Subject: [PATCH 07/18] fix(webapp): change text traslation --- webapp/src/language/en.json | 8 ++++-- webapp/src/language/es.json | 7 ++++- .../treasury-disbursements-info.js | 28 +++++++------------ 3 files changed, 21 insertions(+), 22 deletions(-) diff --git a/webapp/src/language/en.json b/webapp/src/language/en.json index c7574628..9b6f5357 100644 --- a/webapp/src/language/en.json +++ b/webapp/src/language/en.json @@ -87,9 +87,11 @@ "paragraph2Disbursement": "The overall disbursement is equal to 11% of the Eden treasury at at the time of disbursement. The amount is then divided equally among the representative levels. At each level, the amount is further divided equally among that level's representatives.", "paragraph3Disbursement": "Next disbursement date", "paragraph4Disbursement": "Projected next disbursement amount:", - "perLevel": "Per Level 1 Delegate", - "perChief": "Per Chief Delegate", - "trasury": "Eden Treasury Balance" + "perLevel": "Per Level", + "perChief": "Per Chief", + "perHeadChief": "Per Head Chief", + "trasury": "Projected Treasury Balance", + "delegate": "Delegate" }, "expenseRoute": { "titleBarChart": "Expense per Election", diff --git a/webapp/src/language/es.json b/webapp/src/language/es.json index 02830faf..08841354 100644 --- a/webapp/src/language/es.json +++ b/webapp/src/language/es.json @@ -81,7 +81,12 @@ "tableHeader7": "% Reclamado", "tableHeader8": "% No reclamado", "claimedCategory": "Reclamado", - "unclaimedCategory": "No reclamado" + "unclaimedCategory": "No reclamado", + "perLevel": "Por Level", + "perChief": "Por Chief", + "perHeadChief": "Por Head Chief", + "trasury": "Balance de tesorería proyectado", + "delegate": "Delegate" }, "expenseRoute": { "titleBarChart": "Gasto por Elección", diff --git a/webapp/src/routes/IncomeReport/treasury-disbursements-info.js b/webapp/src/routes/IncomeReport/treasury-disbursements-info.js index 71b580f6..1b39fc82 100644 --- a/webapp/src/routes/IncomeReport/treasury-disbursements-info.js +++ b/webapp/src/routes/IncomeReport/treasury-disbursements-info.js @@ -11,24 +11,18 @@ import styles from './styles' const useStyles = makeStyles(styles) const RankLabel = { - NumberedLevel: 'N', - Chief: 'Chief', - HeadChief: 'Head Chief' + NumberedLevel: 'perLevel', + Chief: 'perChief', + HeadChief: 'perHeadChief' } -export const RankLevelDistribution = ({ - label, - EOSamount, - usdAmount, - level -}) => { - const labelText = label === RankLabel.NumberedLevel ? `Level ${level}` : label +export const RankLevelDistribution = ({ label, EOSamount, usdAmount }) => { const classes = useStyles() return (
{' '} - {labelText} + {label}

{formatWithThousandSeparator(EOSamount, 2) || 0} EOS
@@ -40,8 +34,7 @@ export const RankLevelDistribution = ({ RankLevelDistribution.propTypes = { label: PropTypes.string, EOSamount: PropTypes.number, - usdAmount: PropTypes.number, - level: PropTypes.number + usdAmount: PropTypes.number } const TreasuryDisbursementsInfo = ({ @@ -82,15 +75,14 @@ const TreasuryDisbursementsInfo = ({ const label = currentRank === ranksList.at(-1)?.delegate_level - ? RankLabel.HeadChief + ? `${t(RankLabel.HeadChief)} ${t('delegate')}` : currentRank === ranksList.at(-1)?.delegate_level - 1 - ? RankLabel.Chief - : RankLabel.NumberedLevel + ? `${t(RankLabel.Chief)} ${t('delegate')}` + : `${t(RankLabel.NumberedLevel)} ${currentRank} ${t('delegate')}` return ( {t('paragraph4Disbursement')}

{electedRanks.map(calculateAndRenderRankLevelComponent)} -
+
{' '} {t('trasury')}

From b7d528d8c8392ee007702efa212577c894659c4d Mon Sep 17 00:00:00 2001 From: warnerHurtado Date: Thu, 12 Jan 2023 10:36:23 -0600 Subject: [PATCH 08/18] fix(webapp): negative results in chart --- hapi/src/services/dfuse/index.js | 2 +- webapp/src/hooks/customHooks/useSpendToolsState.js | 4 ++-- webapp/src/routes/index.js | 2 +- webapp/src/utils/new-format-objects.js | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/hapi/src/services/dfuse/index.js b/hapi/src/services/dfuse/index.js index 2b2a38be..97c7e23b 100644 --- a/hapi/src/services/dfuse/index.js +++ b/hapi/src/services/dfuse/index.js @@ -194,7 +194,7 @@ const getTreasuryData = async () => { } const sync = async () => { - // await getTreasuryData() + await getTreasuryData() await getDelegateData() return sync() diff --git a/webapp/src/hooks/customHooks/useSpendToolsState.js b/webapp/src/hooks/customHooks/useSpendToolsState.js index 20ddd264..828c594a 100644 --- a/webapp/src/hooks/customHooks/useSpendToolsState.js +++ b/webapp/src/hooks/customHooks/useSpendToolsState.js @@ -214,10 +214,10 @@ const useSpendTools = () => { } useEffect(async () => { - setAuthenticatedUser('xavieredenia') + setAuthenticatedUser(state.user?.accountName) const { data: transactions } = await getTransactions({ - account: 'xavieredenia' + account: state.user?.accountName }) setTransactionsList(transactions?.eden_transaction || []) diff --git a/webapp/src/routes/index.js b/webapp/src/routes/index.js index f8e24018..11729ed7 100644 --- a/webapp/src/routes/index.js +++ b/webapp/src/routes/index.js @@ -56,7 +56,7 @@ const routes = [ component: SpendTools, path: '/spendTools', exact: true, - roles: ['guest', 'member'] + roles: ['member'] }, { name: 'about', diff --git a/webapp/src/utils/new-format-objects.js b/webapp/src/utils/new-format-objects.js index a09ec1dc..9920c643 100644 --- a/webapp/src/utils/new-format-objects.js +++ b/webapp/src/utils/new-format-objects.js @@ -162,8 +162,8 @@ export const newDataFormatByTypeDelegate = (incomeList, expenseList) => { 'Categorized', expenseList[0]?.eos_categorized || 0, expenseList[0]?.usd_categorized || 0, - resultUncategorizedEOS || 0, - resultUncategorizedUSD || 0 + resultUncategorizedEOS >= 0 ? resultUncategorizedEOS : 0 || 0, + resultUncategorizedUSD >= 0 ? resultUncategorizedUSD : 0 || 0 ) ) From 43a9827631a1c2ed41ee63d498ecdb9fe5c50822 Mon Sep 17 00:00:00 2001 From: warnerHurtado Date: Thu, 12 Jan 2023 11:24:57 -0600 Subject: [PATCH 09/18] fix(webapp): NaN values in table --- webapp/src/components/TableReport/index.js | 5 +++-- webapp/src/components/TableReport/styles.js | 2 +- webapp/src/hooks/customHooks/useExpenseReportState.js | 2 ++ webapp/src/routes/ExpenseReport/styles.js | 3 +-- webapp/src/routes/IncomeReport/styles.js | 3 +-- webapp/src/routes/SpendTools/styles.js | 6 +----- webapp/src/utils/new-format-objects.js | 10 +++++----- 7 files changed, 14 insertions(+), 17 deletions(-) diff --git a/webapp/src/components/TableReport/index.js b/webapp/src/components/TableReport/index.js index 7c42c677..4fb0f951 100644 --- a/webapp/src/components/TableReport/index.js +++ b/webapp/src/components/TableReport/index.js @@ -26,19 +26,20 @@ const CustomToolbar = () => { const TableReport = ({ columns, dataPercent }) => { const classes = useStyles() const { t } = useTranslation('generalForm') - const [pagePaginationSize, setPagePaginationSize] = useState(5) + const [pagePaginationSize, setPagePaginationSize] = useState(10) const theme = createTheme(t('date') === 'Date' ? enUS : esES) return (

setPagePaginationSize(newPageSize)} - rowsPerPageOptions={[5, 10, 20]} + rowsPerPageOptions={[10, 25, 50]} pagination components={{ Toolbar: CustomToolbar }} getRowId={row => diff --git a/webapp/src/components/TableReport/styles.js b/webapp/src/components/TableReport/styles.js index 3863ee0d..b6c2b99f 100644 --- a/webapp/src/components/TableReport/styles.js +++ b/webapp/src/components/TableReport/styles.js @@ -2,7 +2,7 @@ export default theme => ({ tableContainer: { whiteSpace: 'nowrap', overflowY: 'hidden', - height: '100%', + height: 'auto', '& .MuiDataGrid-root': { border: 'none', minWidth: '600px' diff --git a/webapp/src/hooks/customHooks/useExpenseReportState.js b/webapp/src/hooks/customHooks/useExpenseReportState.js index bab1d8e2..b38e19f6 100644 --- a/webapp/src/hooks/customHooks/useExpenseReportState.js +++ b/webapp/src/hooks/customHooks/useExpenseReportState.js @@ -98,6 +98,8 @@ const useExpenseReportState = () => { } }, [showElectionRadio, electionRoundSelect]) + console.log(delegatesList) + return [ { expenseByElectionsList, diff --git a/webapp/src/routes/ExpenseReport/styles.js b/webapp/src/routes/ExpenseReport/styles.js index 62755088..8475d9e6 100644 --- a/webapp/src/routes/ExpenseReport/styles.js +++ b/webapp/src/routes/ExpenseReport/styles.js @@ -59,8 +59,7 @@ export default theme => ({ color: theme.palette.secondary.main }, '& #id-table-container': { - marginTop: theme.spacing(2), - height: 368 + marginTop: theme.spacing(2) } }, links: { diff --git a/webapp/src/routes/IncomeReport/styles.js b/webapp/src/routes/IncomeReport/styles.js index 989f2ab0..87fa3739 100644 --- a/webapp/src/routes/IncomeReport/styles.js +++ b/webapp/src/routes/IncomeReport/styles.js @@ -45,8 +45,7 @@ export default theme => ({ color: theme.palette.secondary.main }, '& #id-table-container': { - marginTop: theme.spacing(2), - height: 368 + marginTop: theme.spacing(2) } }, links: { diff --git a/webapp/src/routes/SpendTools/styles.js b/webapp/src/routes/SpendTools/styles.js index 95476c50..75b3abbd 100644 --- a/webapp/src/routes/SpendTools/styles.js +++ b/webapp/src/routes/SpendTools/styles.js @@ -117,11 +117,7 @@ export default theme => ({ display: 'none' }, '& #id-table-container': { - marginTop: theme.spacing(2), - height: '403px', - [theme.breakpoints.down('sm')]: { - height: '400px' - } + marginTop: theme.spacing(2) } }, buttonContainer: { diff --git a/webapp/src/utils/new-format-objects.js b/webapp/src/utils/new-format-objects.js index 9920c643..26a5ecac 100644 --- a/webapp/src/utils/new-format-objects.js +++ b/webapp/src/utils/new-format-objects.js @@ -19,10 +19,10 @@ export const newDataFormatByDelegatesIncome = transactionsList => EOS_UNCLAIMED: Number(data.eos_unclaimed), USD_UNCLAIMED: Number(data.usd_unclaimed), EOS_CLAIMED_PERCENT: Number( - (data.eos_claimed / (data.eos_claimed + data.eos_unclaimed)) * 100 + (data.eos_claimed / (data.eos_claimed + data.eos_unclaimed || 1)) * 100 ), EOS_UNCLAIMED_PERCENT: Number( - (data.eos_unclaimed / (data.eos_claimed + data.eos_unclaimed)) * 100 + (data.eos_unclaimed / (data.eos_claimed + data.eos_unclaimed || 1)) * 100 ), color: generateColor() })) @@ -96,12 +96,12 @@ export const newDataFormatByElectionAndDelegateExpense = transactionsList => ), USD_UNCATEGORIZED: Number(data.usd_uncategorized), EOS_CATEGORIZED_PERCENT: Number( - (data.eos_categorized / (data.eos_claimed + data.eos_unclaimed)) * 100 + (data.eos_categorized / (data.eos_claimed + data.eos_unclaimed || 1)) * + 100 ), EOS_UNCATEGORIZED_PERCENT: Number( ((data.eos_claimed + data.eos_unclaimed - data.eos_categorized) / - (data.eos_claimed + data.eos_unclaimed)) * - 100 + (data.eos_claimed + data.eos_unclaimed) || 1) * 100 ), color: generateColor() })) From b6d8f3036ab5b4920bad7ceab73c2358dbd124d3 Mon Sep 17 00:00:00 2001 From: warnerHurtado Date: Thu, 12 Jan 2023 11:27:25 -0600 Subject: [PATCH 10/18] fix(webapp): delete console.log --- webapp/src/hooks/customHooks/useExpenseReportState.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/webapp/src/hooks/customHooks/useExpenseReportState.js b/webapp/src/hooks/customHooks/useExpenseReportState.js index b38e19f6..bab1d8e2 100644 --- a/webapp/src/hooks/customHooks/useExpenseReportState.js +++ b/webapp/src/hooks/customHooks/useExpenseReportState.js @@ -98,8 +98,6 @@ const useExpenseReportState = () => { } }, [showElectionRadio, electionRoundSelect]) - console.log(delegatesList) - return [ { expenseByElectionsList, From ac884e474f11251641a86442601c3ef6bf22489b Mon Sep 17 00:00:00 2001 From: JAMares Date: Thu, 12 Jan 2023 12:00:33 -0600 Subject: [PATCH 11/18] feat(webapp): add prefill memo to description --- webapp/src/routes/SpendTools/index.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/webapp/src/routes/SpendTools/index.js b/webapp/src/routes/SpendTools/index.js index d843ec49..81db5ce5 100644 --- a/webapp/src/routes/SpendTools/index.js +++ b/webapp/src/routes/SpendTools/index.js @@ -1,4 +1,4 @@ -import React, { memo } from 'react' +import React, { memo, useEffect } from 'react' import { makeStyles } from '@mui/styles' import Select from '@mui/material/Select' import Button from '@mui/material/Button' @@ -24,6 +24,7 @@ import { Divider } from '@mui/material' const useStyles = makeStyles(styles) const rowsCenter = { flex: 1, align: 'center', headerAlign: 'center' } +let firstConcat = true const SpendTools = () => { const classes = useStyles() @@ -57,7 +58,17 @@ const SpendTools = () => { ] = useSpendTools() const { to, amount, category, description } = formValues - const { newCategory, newDescription } = formValuesModal + let { newCategory, newDescription } = formValuesModal + + useEffect(() => { + if (!openModal) firstConcat = true + formValuesModal.newDescription = '' + }, [openModal]) + + if (firstConcat && modalData?.description) { + newDescription = newDescription.concat(modalData?.description) + firstConcat = false + } const handleEosTransfer = async e => { e.preventDefault() From 2bbeb8426d100550cf224b779ffc3d335c928300 Mon Sep 17 00:00:00 2001 From: warnerHurtado Date: Thu, 12 Jan 2023 14:48:58 -0600 Subject: [PATCH 12/18] feat(contract): add new digest param --- .../edenexplorer/include/edenexplorer.hpp | 5 +++-- contract/edenexplorer/src/edenexplorer.cpp | 4 +++- contract/edenexplorer/tests/tests.cpp | 19 ++++++++++++++++++- hapi/src/services/dfuse/index.js | 2 +- .../hooks/customHooks/useSpendToolsState.js | 4 ++-- webapp/src/routes/index.js | 2 +- 6 files changed, 28 insertions(+), 8 deletions(-) diff --git a/contract/edenexplorer/include/edenexplorer.hpp b/contract/edenexplorer/include/edenexplorer.hpp index f65ed474..de7f5939 100644 --- a/contract/edenexplorer/include/edenexplorer.hpp +++ b/contract/edenexplorer/include/edenexplorer.hpp @@ -23,7 +23,8 @@ namespace eden { void categorize( eosio::name account, std::string &new_memo, - std::string &tx_id ); + std::string &tx_id, + std::string &digest ); bool parse_memo( std::string &memo ); @@ -35,6 +36,6 @@ namespace eden { EOSIO_ACTIONS( edenexplorer_contract, "edenexplorer"_n, - action( categorize, account, new_memo, tx_id ) ) + action( categorize, account, new_memo, tx_id, digest ) ) } // namespace eden diff --git a/contract/edenexplorer/src/edenexplorer.cpp b/contract/edenexplorer/src/edenexplorer.cpp index a40ab241..dad78778 100644 --- a/contract/edenexplorer/src/edenexplorer.cpp +++ b/contract/edenexplorer/src/edenexplorer.cpp @@ -7,7 +7,8 @@ namespace eden { void edenexplorer_contract::categorize( eosio::name account, std::string &new_memo, - std::string &tx_id ) { + std::string &tx_id, + std::string &digest ) { require_auth( account ); eosio::action{ { get_self(), "active"_n }, @@ -20,6 +21,7 @@ namespace eden { "Incorrect format or category, use: 'eden_expense: " "/'" ); eosio::check( tx_id.length() == 64, "Incorrect length transaction id" ); + eosio::check( digest.length() == 64, "Incorrect length digest id" ); } bool edenexplorer_contract::exist_category( std::string &category_name ) { diff --git a/contract/edenexplorer/tests/tests.cpp b/contract/edenexplorer/tests/tests.cpp index ec1c5c0d..24ff1752 100644 --- a/contract/edenexplorer/tests/tests.cpp +++ b/contract/edenexplorer/tests/tests.cpp @@ -7,6 +7,7 @@ TEST_CASE( "Require to be an eden member" ) { tester t; expect( t.edenexplorer.trace< eden::actions::categorize >( "alice"_n, + "testing", "testing", "testing" ), "missing authority of alice" ); @@ -16,6 +17,7 @@ TEST_CASE( "Requiere the right memo format" ) { tester t; expect( t.edenexplorer.trace< eden::actions::categorize >( "edenexplorer"_n, + "testing", "testing", "testing" ), "assertion failure with message: Incorrect format or category, use: " @@ -28,6 +30,7 @@ TEST_CASE( "Requiere a right category" ) { expect( t.edenexplorer.trace< eden::actions::categorize >( "edenexplorer"_n, "eden_expense: testing/expense for pay EOSIO developers", + "testing", "testing" ), "assertion failure with message: Incorrect format or category, use: " "'eden_expense: /'" ); @@ -39,15 +42,29 @@ TEST_CASE( "Requiere the right length for tx_id" ) { expect( t.bob.trace< eden::actions::categorize >( "bob"_n, "eden_expense: development/expense for pay EOSIO developers", + "testing", "testing" ), "assertion failure with message: Incorrect length transaction id" ); } +TEST_CASE( "Requiere the right length for digest" ) { + tester t; + + expect( + t.bob.trace< eden::actions::categorize >( + "bob"_n, + "eden_expense: development/expense for pay EOSIO developers", + "96dda25da00b945e5b696a8a4b01453c97973c78dc766a885b73e28bd42f6cc5", + "testing" ), + "assertion failure with message: Incorrect length digest id" ); +} + TEST_CASE( "Succes action" ) { tester t; expect( t.bob.trace< eden::actions::categorize >( "bob"_n, "eden_expense: infrastructure/expense for pay EOSIO developers", - "96dda25da00b945e5b696a8a4b01453c97973c78dc766a885b73e28bd42f6cc5" ) ); + "96dda25da00b945e5b696a8a4b01453c97973c78dc766a885b73e28bd42f6cc5", + "f3f57eaf6efe030d6af4c77818daec081e505fde4c2b15cfdad950f636400b8b" ) ); } diff --git a/hapi/src/services/dfuse/index.js b/hapi/src/services/dfuse/index.js index 97c7e23b..2b2a38be 100644 --- a/hapi/src/services/dfuse/index.js +++ b/hapi/src/services/dfuse/index.js @@ -194,7 +194,7 @@ const getTreasuryData = async () => { } const sync = async () => { - await getTreasuryData() + // await getTreasuryData() await getDelegateData() return sync() diff --git a/webapp/src/hooks/customHooks/useSpendToolsState.js b/webapp/src/hooks/customHooks/useSpendToolsState.js index 59f1b34d..30026326 100644 --- a/webapp/src/hooks/customHooks/useSpendToolsState.js +++ b/webapp/src/hooks/customHooks/useSpendToolsState.js @@ -214,10 +214,10 @@ const useSpendTools = () => { } useEffect(async () => { - setAuthenticatedUser(state.user?.accountName) + setAuthenticatedUser('xavieredenia') const { data: transactions } = await getTransactions({ - account: state.user?.accountName + account: 'xavieredenia' }) setTransactionsList(transactions?.eden_transaction || []) diff --git a/webapp/src/routes/index.js b/webapp/src/routes/index.js index 11729ed7..f8e24018 100644 --- a/webapp/src/routes/index.js +++ b/webapp/src/routes/index.js @@ -56,7 +56,7 @@ const routes = [ component: SpendTools, path: '/spendTools', exact: true, - roles: ['member'] + roles: ['guest', 'member'] }, { name: 'about', From 3c320383db8c155bc6e206db15a3cf0fa4eb8092 Mon Sep 17 00:00:00 2001 From: warnerHurtado Date: Fri, 13 Jan 2023 11:35:58 -0600 Subject: [PATCH 13/18] fix(webapp): update recategorize expend tool for the new feature --- hapi/src/gql/eden-transaction.gql.js | 1 + hapi/src/services/dfuse/index.js | 3 +- .../edenexplorer-categorize.updater.js | 7 +- .../updaters/eosiotoken-transfer.updater.js | 28 +++- .../genesiseden-fundtransfer.updater.js | 13 +- hapi/src/utils/dfuse.util.js | 3 + .../tables/public_eden_transaction.yaml | 18 +-- .../down.sql | 4 + .../up.sql | 2 + .../down.sql | 3 + .../up.sql | 1 + webapp/src/gql/eden-expense.gql.js | 2 +- .../hooks/customHooks/useSpendToolsState.js | 13 +- webapp/src/language/en.json | 2 +- webapp/src/language/es.json | 2 +- webapp/src/routes/SpendTools/index.js | 103 +++------------ .../SpendTools/spendTool-table-report.js | 121 ++++++++++++++++++ webapp/src/routes/SpendTools/styles.js | 4 +- webapp/src/routes/index.js | 2 +- 19 files changed, 204 insertions(+), 128 deletions(-) create mode 100644 hasura/migrations/default/1673556739883_alter_table_public_eden_transaction_add_column_digest/down.sql create mode 100644 hasura/migrations/default/1673556739883_alter_table_public_eden_transaction_add_column_digest/up.sql create mode 100644 hasura/migrations/default/1673565665020_alter_table_public_eden_transaction_drop_column_memo/down.sql create mode 100644 hasura/migrations/default/1673565665020_alter_table_public_eden_transaction_drop_column_memo/up.sql create mode 100644 webapp/src/routes/SpendTools/spendTool-table-report.js diff --git a/hapi/src/gql/eden-transaction.gql.js b/hapi/src/gql/eden-transaction.gql.js index ae332c83..f628e360 100644 --- a/hapi/src/gql/eden-transaction.gql.js +++ b/hapi/src/gql/eden-transaction.gql.js @@ -28,6 +28,7 @@ const get = async (where, getMany = false) => { txid type updated_at + digest } } ` diff --git a/hapi/src/services/dfuse/index.js b/hapi/src/services/dfuse/index.js index 2b2a38be..b195c55b 100644 --- a/hapi/src/services/dfuse/index.js +++ b/hapi/src/services/dfuse/index.js @@ -64,10 +64,9 @@ const runUpdaters = async actions => { await updater.apply({ transaction_id: id, - json: matchingAction.json, timestamp, - ation: matchingAction.name, election: edenElectionId, + action: matchingAction, updater }) } diff --git a/hapi/src/services/dfuse/updaters/edenexplorer-categorize.updater.js b/hapi/src/services/dfuse/updaters/edenexplorer-categorize.updater.js index c94b3f09..158dc954 100644 --- a/hapi/src/services/dfuse/updaters/edenexplorer-categorize.updater.js +++ b/hapi/src/services/dfuse/updaters/edenexplorer-categorize.updater.js @@ -5,7 +5,7 @@ module.exports = { type: 'edenexplorer:categorize', apply: async action => { try { - const { new_memo, tx_id, account } = action.json + const { new_memo, tx_id, account, digest = undefined } = action.json const [, memo] = new_memo?.split(':') || '' if (!memo) return @@ -13,8 +13,7 @@ module.exports = { const { category, description } = updaterUtil.memoSplit(memo) const transactionToEditQuery = { txid: { _eq: tx_id }, - type: { _eq: 'expense' }, - eden_election: { eden_delegate: { account: { _eq: account } } } + ...(digest && { digest: { _eq: digest } }) } const transactionToEdit = await edenTransactionGql.get( @@ -34,7 +33,7 @@ module.exports = { const updateQuery = { where: { id: { _eq: transactionToEdit.id }, - type: { _eq: 'expense' } + ...(digest && { digest: { _eq: digest } }) }, _set: { category, description, id_election } } diff --git a/hapi/src/services/dfuse/updaters/eosiotoken-transfer.updater.js b/hapi/src/services/dfuse/updaters/eosiotoken-transfer.updater.js index deba8006..4f7ef04d 100644 --- a/hapi/src/services/dfuse/updaters/eosiotoken-transfer.updater.js +++ b/hapi/src/services/dfuse/updaters/eosiotoken-transfer.updater.js @@ -10,19 +10,31 @@ let LASTEST_RATE_DATA_CONSULTED = null module.exports = { type: `eosio.token:transfer`, apply: async action => { - const { quantity, memo, to, from } = action.json + const { quantity, memo, to, from } = action.action.json const amount = Number(quantity.split(' ')[0] || 0) const registeredTransaction = await edenTransactionGql.get({ txid: { _eq: action.transaction_id }, - amount: { _eq: amount }, - memo: { _eq: memo }, - recipient: { _eq: to }, - type: { _eq: 'expense' } + digest: { _eq: action.action.receipt.digest } }) if (registeredTransaction) return + const registeredTxWithoutDigest = await edenTransactionGql.get({ + txid: { _eq: action.transaction_id }, + digest: { _eq: action.transaction_id } + }) + + if (registeredTxWithoutDigest) { + await edenTransactionGql.update({ + where: { + id: { _eq: existTx.id } + }, + _set: { digest: action.action.receipt.digest } + }) + return + } + let { category, description } = updaterUtil.memoSplit( memo.split(':')[1] || '' ) @@ -72,12 +84,14 @@ module.exports = { type: 'expense', eos_exchange: LASTEST_RATE_DATA_CONSULTED, usd_total: amount * LASTEST_RATE_DATA_CONSULTED, - memo: memo + digest: action.action.receipt.digest } await edenTransactionGql.save(transactionData) } catch (error) { - console.error(`transfer sync error ${action.action}: ${error.message}`) + console.error( + `transfer sync error ${action.action.name}: ${error.message}` + ) } } } diff --git a/hapi/src/services/dfuse/updaters/genesiseden-fundtransfer.updater.js b/hapi/src/services/dfuse/updaters/genesiseden-fundtransfer.updater.js index cae2c31e..f931da98 100644 --- a/hapi/src/services/dfuse/updaters/genesiseden-fundtransfer.updater.js +++ b/hapi/src/services/dfuse/updaters/genesiseden-fundtransfer.updater.js @@ -11,7 +11,12 @@ module.exports = { type: `${edenConfig.edenContract}:fundtransfer`, apply: async action => { try { - const { amount: quantity, from, distribution_time, rank } = action.json + const { + amount: quantity, + from, + distribution_time, + rank + } = action.action.json const amount = Number(quantity.split(' ')[0]) const existTx = await edenTransactionGql.get({ @@ -72,13 +77,13 @@ module.exports = { const newAmount = existUnclaimedTx.amount - amount if (newAmount <= 0) { - await deleteTx({ + await edenTransactionGql.deleteTx({ where: { id: { _eq: existUnclaimedTx.id } } }) } else { - await update({ + await edenTransactionGql.update({ where: { id: { _eq: existUnclaimedTx.id } }, @@ -95,7 +100,7 @@ module.exports = { } } catch (error) { console.error( - `fundtransfer sync error ${action.action}: ${error.message}` + `fundtransfer sync error ${action.action.action.name}: ${error.message}` ) } } diff --git a/hapi/src/utils/dfuse.util.js b/hapi/src/utils/dfuse.util.js index 01998e92..199f5d51 100644 --- a/hapi/src/utils/dfuse.util.js +++ b/hapi/src/utils/dfuse.util.js @@ -18,6 +18,9 @@ const getfundTransferQuery = ({ query, lowBlockNum }) => { } id matchingActions { + receipt { + digest + } account name json diff --git a/hasura/metadata/databases/default/tables/public_eden_transaction.yaml b/hasura/metadata/databases/default/tables/public_eden_transaction.yaml index ff1b46f0..96008497 100644 --- a/hasura/metadata/databases/default/tables/public_eden_transaction.yaml +++ b/hasura/metadata/databases/default/tables/public_eden_transaction.yaml @@ -10,20 +10,20 @@ insert_permissions: permission: check: {} columns: + - amount - category + - created_at + - date - description - - memo + - digest + - eos_exchange + - id + - id_election - recipient - txid - type - - amount - - eos_exchange - - usd_total - - created_at - - date - updated_at - - id - - id_election + - usd_total select_permissions: - role: guest permission: @@ -33,10 +33,10 @@ select_permissions: - created_at - date - description + - digest - eos_exchange - id - id_election - - memo - recipient - txid - type diff --git a/hasura/migrations/default/1673556739883_alter_table_public_eden_transaction_add_column_digest/down.sql b/hasura/migrations/default/1673556739883_alter_table_public_eden_transaction_add_column_digest/down.sql new file mode 100644 index 00000000..aecb7948 --- /dev/null +++ b/hasura/migrations/default/1673556739883_alter_table_public_eden_transaction_add_column_digest/down.sql @@ -0,0 +1,4 @@ +-- Could not auto-generate a down migration. +-- Please write an appropriate down migration for the SQL below: +-- alter table "public"."eden_transaction" add column "digest" varchar +-- null; diff --git a/hasura/migrations/default/1673556739883_alter_table_public_eden_transaction_add_column_digest/up.sql b/hasura/migrations/default/1673556739883_alter_table_public_eden_transaction_add_column_digest/up.sql new file mode 100644 index 00000000..e097c93a --- /dev/null +++ b/hasura/migrations/default/1673556739883_alter_table_public_eden_transaction_add_column_digest/up.sql @@ -0,0 +1,2 @@ +alter table "public"."eden_transaction" add column "digest" varchar + null; diff --git a/hasura/migrations/default/1673565665020_alter_table_public_eden_transaction_drop_column_memo/down.sql b/hasura/migrations/default/1673565665020_alter_table_public_eden_transaction_drop_column_memo/down.sql new file mode 100644 index 00000000..27581a82 --- /dev/null +++ b/hasura/migrations/default/1673565665020_alter_table_public_eden_transaction_drop_column_memo/down.sql @@ -0,0 +1,3 @@ +comment on column "public"."eden_transaction"."memo" is E'Eden Transaction Accounting Standard'; +alter table "public"."eden_transaction" alter column "memo" drop not null; +alter table "public"."eden_transaction" add column "memo" varchar; diff --git a/hasura/migrations/default/1673565665020_alter_table_public_eden_transaction_drop_column_memo/up.sql b/hasura/migrations/default/1673565665020_alter_table_public_eden_transaction_drop_column_memo/up.sql new file mode 100644 index 00000000..0fa0eeb4 --- /dev/null +++ b/hasura/migrations/default/1673565665020_alter_table_public_eden_transaction_drop_column_memo/up.sql @@ -0,0 +1 @@ +alter table "public"."eden_transaction" drop column "memo" cascade; diff --git a/webapp/src/gql/eden-expense.gql.js b/webapp/src/gql/eden-expense.gql.js index 3c0763df..529e10a7 100644 --- a/webapp/src/gql/eden-expense.gql.js +++ b/webapp/src/gql/eden-expense.gql.js @@ -81,10 +81,10 @@ export const GET_EXPENSES_BY_ACCOUNT = gql` recipient txid category - memo eden_election { election } + digest } } ` diff --git a/webapp/src/hooks/customHooks/useSpendToolsState.js b/webapp/src/hooks/customHooks/useSpendToolsState.js index 30026326..3cfb8a01 100644 --- a/webapp/src/hooks/customHooks/useSpendToolsState.js +++ b/webapp/src/hooks/customHooks/useSpendToolsState.js @@ -130,10 +130,7 @@ const useSpendTools = () => { variables: { where: { txid: { _eq: modalData?.txid }, - amount: { _eq: modalData?.amount }, - recipient: { _eq: modalData?.recipient }, - memo: { _eq: modalData?.memo }, - type: { _eq: 'expense' } + digest: { _eq: modalData?.digest } }, _set: { category: formValuesModal.newCategory, @@ -168,11 +165,11 @@ const useSpendTools = () => { description: formValues.description, eos_exchange: eosRate, id_election: idElection, - memo: `eden_expense:${formValues.category}/${formValues.description}`, recipient: formValues.to, txid: transactionResult?.transactionId, type: 'expense', - usd_total: amount * eosRate + usd_total: amount * eosRate, + digest: transactionResult?.transactionId } await saveTransaction({ @@ -214,10 +211,10 @@ const useSpendTools = () => { } useEffect(async () => { - setAuthenticatedUser('xavieredenia') + setAuthenticatedUser(state.user?.accountName) const { data: transactions } = await getTransactions({ - account: 'xavieredenia' + account: state.user?.accountName }) setTransactionsList(transactions?.eden_transaction || []) diff --git a/webapp/src/language/en.json b/webapp/src/language/en.json index 7ea029df..f964ee35 100644 --- a/webapp/src/language/en.json +++ b/webapp/src/language/en.json @@ -123,7 +123,7 @@ "headerTable3": "AMOUNT", "headerTable4": "SENT TO", "headerTable5": "MEMO", - "headerTable6": "CATEGORIZED", + "headerTable6": "CATEGORY", "headerTable7": "APPEND", "modalTitle": "Append Memo", "modalAbout": "Here you can add or change the category and description of previous transactions. First, select the reason for your expense in the selection, then enter your description or reason.", diff --git a/webapp/src/language/es.json b/webapp/src/language/es.json index 6554b158..822996d5 100644 --- a/webapp/src/language/es.json +++ b/webapp/src/language/es.json @@ -123,7 +123,7 @@ "headerTable3": "MONTO", "headerTable4": "ENVIADO A", "headerTable5": "MEMO", - "headerTable6": "CATEGORIZADO", + "headerTable6": "CATEGORIA", "headerTable7": "CATEGORIZAR", "modalTitle": "Adjuntar Memo", "modalAbout": "Aquí puede agregar o cambiar la categoría y descripción de transacciones anteriores. Primero, seleccione el motivo de su gasto en la selección, luego ingrese su descripción o motivo.", diff --git a/webapp/src/routes/SpendTools/index.js b/webapp/src/routes/SpendTools/index.js index d843ec49..007723d8 100644 --- a/webapp/src/routes/SpendTools/index.js +++ b/webapp/src/routes/SpendTools/index.js @@ -16,15 +16,12 @@ import useSpendTools from '../../hooks/customHooks/useSpendToolsState' import { CATEGORIES } from '../../constants/income.constants' import { useSharedState } from '../../context/state.context' import SnackbarComponent from '../../components/Snackbar' -import TableReport from '../../components/TableReport' import styles from './styles' -import { Divider } from '@mui/material' +import SpendToolTableRerport from './spendTool-table-report' const useStyles = makeStyles(styles) -const rowsCenter = { flex: 1, align: 'center', headerAlign: 'center' } - const SpendTools = () => { const classes = useStyles() const [state] = useSharedState() @@ -33,7 +30,6 @@ const SpendTools = () => { const [ { delegateBalance, - transactionsList, formValues, errors, errorsModal, @@ -42,7 +38,8 @@ const SpendTools = () => { errorMessage, modalData, openSnackbar, - loadingSignTransaction + loadingSignTransaction, + transactionsList }, { handleInputChange, @@ -52,7 +49,8 @@ const SpendTools = () => { handleCloseModal, handleOpenModal, executeAction, - setOpenSnackbar + setOpenSnackbar, + setErrorMessage } ] = useSpendTools() @@ -71,6 +69,12 @@ const SpendTools = () => { tx_id: modalData?.txid } + if (modalData?.digest === modalData?.txid) { + setErrorMessage( + 'You must wait because the transaction continues without digest' + ) + } + await executeAction(dataAction, 'edenexplorer', 'categorize') } else { if (Object.keys(validateForm(formValues)).length > 0) return @@ -93,80 +97,6 @@ const SpendTools = () => { : (Number(amount.split(' ')[0]) * eosRate).toFixed(4) } @ $${eosRate.toFixed(2)}/EOS` - const columns = [ - { - field: 'id', - hide: true - }, - { - field: 'txid', - headerName: t('headerTable1'), - cellClassName: classes.links, - renderCell: param => ( - - - {param.value.slice(0, 8)} - - - ), - ...rowsCenter - }, - { - field: 'date', - headerName: t('headerTable2'), - renderCell: param => ( - <>{new Date(param.value.split('T')[0]).toLocaleDateString()} - ), - ...rowsCenter - }, - { - field: 'amount', - headerName: t('headerTable3'), - type: 'number', - renderCell: param => <>{formatWithThousandSeparator(param.value, 4)}, - ...rowsCenter - }, - { - field: 'recipient', - headerName: t('headerTable4'), - ...rowsCenter - }, - { - field: 'description', - headerName: t('headerTable5'), - renderCell: param => ( - <>{param.value.length === 0 ? 'Without memo' : param.value} - ), - ...rowsCenter - }, - { - field: 'category', - headerName: t('headerTable6'), - renderCell: param => ( - <>{param.value === 'uncategorized' ? 'No' : 'Yes'} - ), - ...rowsCenter - }, - { - field: 'action', - headerName: t('headerTable7'), - sortable: false, - renderCell: params => { - const onClick = () => { - handleOpenModal(params) - } - return ( - - - - - - ) - }, - ...rowsCenter - } - ] - return (
{ {!openModal && errorMessage}
-
- -
{t('titleTable')}
-
- -
-
+
) } diff --git a/webapp/src/routes/SpendTools/spendTool-table-report.js b/webapp/src/routes/SpendTools/spendTool-table-report.js new file mode 100644 index 00000000..8398de89 --- /dev/null +++ b/webapp/src/routes/SpendTools/spendTool-table-report.js @@ -0,0 +1,121 @@ +import React, { memo } from 'react' +import { Divider, IconButton, Tooltip } from '@mui/material' +import { makeStyles } from '@mui/styles' +import { useTranslation } from 'react-i18next' +import PropTypes from 'prop-types' + +import styles from './styles' +import TableReport from '../../components/TableReport' +import { formatWithThousandSeparator } from '../../utils' + +const useStyles = makeStyles(styles) +const rowsCenter = { flex: 1, align: 'center', headerAlign: 'center' } + +export const SpendToolTableRerport = ({ + handleOpenModal, + transactionsList +}) => { + const classes = useStyles() + const { t } = useTranslation('spendToolsRoute') + + const columns = [ + { + field: 'id', + hide: true + }, + { + field: 'txid', + headerName: t('headerTable1'), + cellClassName: classes.links, + renderCell: param => ( + + + {param.value.slice(0, 8)} + + + ), + ...rowsCenter + }, + { + field: 'date', + headerName: t('headerTable2'), + type: 'date', + renderCell: param => ( + <>{new Date(param.value.split('T')[0]).toLocaleDateString()} + ), + ...rowsCenter + }, + { + field: 'amount', + headerName: t('headerTable3'), + type: 'number', + renderCell: param => <>{formatWithThousandSeparator(param.value, 4)}, + ...rowsCenter + }, + { + field: 'recipient', + headerName: t('headerTable4'), + renderCell: param => ( + +
{param.value}
+
+ ), + ...rowsCenter + }, + { + field: 'description', + headerName: t('headerTable5'), + renderCell: param => ( + +
{param.value.length === 0 ? 'Without memo' : param.value}
+
+ ), + ...rowsCenter + }, + { + field: 'category', + headerName: t('headerTable6'), + renderCell: param => ( + +
{param.value}
+
+ ), + ...rowsCenter + }, + { + field: 'action', + headerName: t('headerTable7'), + sortable: false, + renderCell: params => { + const onClick = () => { + handleOpenModal(params) + } + return ( + + + + + + ) + }, + ...rowsCenter + } + ] + + return ( +
+ +
{t('titleTable')}
+
+ {' '} +
+
+ ) +} + +SpendToolTableRerport.propTypes = { + handleOpenModal: PropTypes.func, + transactionsList: PropTypes.array +} + +export default memo(SpendToolTableRerport) diff --git a/webapp/src/routes/SpendTools/styles.js b/webapp/src/routes/SpendTools/styles.js index 31c4b2ca..c409247a 100644 --- a/webapp/src/routes/SpendTools/styles.js +++ b/webapp/src/routes/SpendTools/styles.js @@ -108,6 +108,7 @@ export default theme => ({ } }, tableContainer: { + minWidth: '920px', marginTop: theme.spacing(2), '& .MuiDataGrid-columnHeaderTitle': { fontWeight: 'bold', @@ -151,7 +152,7 @@ export default theme => ({ marginTop: '2px' }, '& a:hover': { - color: theme.palette.secondary.main + color: theme.palette.primary.main } }, labelButtonTransfer: { @@ -194,7 +195,6 @@ export default theme => ({ marginTop: '32px' }, titleTable: { - marginLeft: '5%', marginTop: theme.spacing(3), fontSize: '18px', fontWeight: '500', diff --git a/webapp/src/routes/index.js b/webapp/src/routes/index.js index f8e24018..11729ed7 100644 --- a/webapp/src/routes/index.js +++ b/webapp/src/routes/index.js @@ -56,7 +56,7 @@ const routes = [ component: SpendTools, path: '/spendTools', exact: true, - roles: ['guest', 'member'] + roles: ['member'] }, { name: 'about', From 23b6846304f76598ea2c93cb63b9b2430e6e1bf3 Mon Sep 17 00:00:00 2001 From: warnerHurtado Date: Fri, 13 Jan 2023 11:41:59 -0600 Subject: [PATCH 14/18] fix(hapi) uncomment functions --- hapi/src/services/dfuse/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hapi/src/services/dfuse/index.js b/hapi/src/services/dfuse/index.js index b195c55b..4a5bf5d4 100644 --- a/hapi/src/services/dfuse/index.js +++ b/hapi/src/services/dfuse/index.js @@ -193,7 +193,7 @@ const getTreasuryData = async () => { } const sync = async () => { - // await getTreasuryData() + await getTreasuryData() await getDelegateData() return sync() From 4efb826c35d75c205758897d54526b7b39f03983 Mon Sep 17 00:00:00 2001 From: JAMares Date: Fri, 13 Jan 2023 14:26:39 -0600 Subject: [PATCH 15/18] fix(webapp): add missing variable --- webapp/src/routes/SpendTools/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/webapp/src/routes/SpendTools/index.js b/webapp/src/routes/SpendTools/index.js index 18737bc7..12a12de8 100644 --- a/webapp/src/routes/SpendTools/index.js +++ b/webapp/src/routes/SpendTools/index.js @@ -21,6 +21,7 @@ import styles from './styles' import SpendToolTableRerport from './spendTool-table-report' const useStyles = makeStyles(styles) +let firstConcat = true const SpendTools = () => { const classes = useStyles() From c1fdca8df042fcefcf22ee91e2392070b6fb73dd Mon Sep 17 00:00:00 2001 From: warnerHurtado Date: Fri, 13 Jan 2023 15:58:22 -0600 Subject: [PATCH 16/18] fix(webapp): fix recategorize error --- .../dfuse/updaters/eosiotoken-transfer.updater.js | 2 +- webapp/src/hooks/customHooks/useSpendToolsState.js | 3 ++- webapp/src/routes/SpendTools/index.js | 12 ++++++++---- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/hapi/src/services/dfuse/updaters/eosiotoken-transfer.updater.js b/hapi/src/services/dfuse/updaters/eosiotoken-transfer.updater.js index 4f7ef04d..e1da035e 100644 --- a/hapi/src/services/dfuse/updaters/eosiotoken-transfer.updater.js +++ b/hapi/src/services/dfuse/updaters/eosiotoken-transfer.updater.js @@ -28,7 +28,7 @@ module.exports = { if (registeredTxWithoutDigest) { await edenTransactionGql.update({ where: { - id: { _eq: existTx.id } + id: { _eq: registeredTxWithoutDigest.id } }, _set: { digest: action.action.receipt.digest } }) diff --git a/webapp/src/hooks/customHooks/useSpendToolsState.js b/webapp/src/hooks/customHooks/useSpendToolsState.js index 3cfb8a01..0c55d78a 100644 --- a/webapp/src/hooks/customHooks/useSpendToolsState.js +++ b/webapp/src/hooks/customHooks/useSpendToolsState.js @@ -244,7 +244,8 @@ const useSpendTools = () => { handleCloseModal, handleOpenModal, executeAction, - setOpenSnackbar + setOpenSnackbar, + setErrorMessage } ] } diff --git a/webapp/src/routes/SpendTools/index.js b/webapp/src/routes/SpendTools/index.js index 12a12de8..be80bcc5 100644 --- a/webapp/src/routes/SpendTools/index.js +++ b/webapp/src/routes/SpendTools/index.js @@ -59,9 +59,12 @@ const SpendTools = () => { let { newCategory, newDescription } = formValuesModal useEffect(() => { - if (!openModal) firstConcat = true - formValuesModal.newDescription = '' - }, [openModal]) + if (newCategory) { + handleInputChangeModal({ + target: { name: 'newDescription', value: modalData?.description } + }) + } + }, [newCategory]) if (firstConcat && modalData?.description) { newDescription = newDescription.concat(modalData?.description) @@ -77,7 +80,8 @@ const SpendTools = () => { const dataAction = { account: state.user?.accountName, new_memo: `eden_expense:${newCategory}/${newDescription}`, - tx_id: modalData?.txid + tx_id: modalData?.txid, + digest: modalData?.digest } if (modalData?.digest === modalData?.txid) { From 7002b77de122650b351a32af5fb4d656df493599 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francis=20G=C3=B3mez?= Date: Mon, 16 Jan 2023 11:13:18 -0500 Subject: [PATCH 17/18] Delete postgres Database for begin again --- .github/workflows/push-dev-environment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/push-dev-environment.yaml b/.github/workflows/push-dev-environment.yaml index 9cbdf473..efb02f59 100644 --- a/.github/workflows/push-dev-environment.yaml +++ b/.github/workflows/push-dev-environment.yaml @@ -61,7 +61,7 @@ jobs: IMAGE_NAME_HAPI: eden-spending-hapi-dev IMAGE_NAME_HASURA: eden-spending-hasura-dev IMAGE_NAME_WALLET: eden-spending-wallet-dev - # Postgres-0 + # Postgres POSTGRES_USER: ${{ secrets.POSTGRES_USER }} POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }} POSTGRES_DB: ${{ secrets.POSTGRES_DB }} From db177e73b9b236a86692cfe0c5582711e7c15676 Mon Sep 17 00:00:00 2001 From: warnerHurtado Date: Mon, 16 Jan 2023 10:40:56 -0600 Subject: [PATCH 18/18] feat(webapp): traslate next distribution text --- webapp/src/language/es.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/webapp/src/language/es.json b/webapp/src/language/es.json index 68fd6a91..359dad4f 100644 --- a/webapp/src/language/es.json +++ b/webapp/src/language/es.json @@ -83,6 +83,12 @@ "tableHeader8": "% No reclamado", "claimedCategory": "Reclamado", "unclaimedCategory": "No reclamado", + "titleDisbursement": "Distribución mensual", + "paragraph1Disbursement": "Los desembolsos del delegado Eden se producen mensualmente y son reclamados por el delegado del contrato a sus cuentas personales del EOS.", + "paragraph2Disbursement": "El desembolso global equivale al 11% de la tesorería de Edén en el momento del desembolso. El importe se divide a partes iguales entre los niveles representativos. En cada nivel, la cantidad se divide a partes iguales entre los representantes de ese nivel.", + "paragraph3Disbursement": "Fecha de la siguiente distribución:", + "paragraph4Disbursement": "Monto proyectado para la siguiente distribución:", + "perLevel": "Por Level", "perChief": "Por Chief", "perHeadChief": "Por Head Chief",