Skip to content
This repository has been archived by the owner on May 12, 2020. It is now read-only.

Commit

Permalink
Show ratify contents in UI;Fix tab bug for chains w/o REX;Change tabn…
Browse files Browse the repository at this point in the history
…ame to REX
  • Loading branch information
barchef committed Jun 11, 2019
1 parent 3b366e4 commit e266474
Show file tree
Hide file tree
Showing 8 changed files with 172 additions and 106 deletions.
44 changes: 22 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,39 +118,39 @@ Signed by [eosmiami on keybase](https://keybase.io/eosmiami)
Hash: SHA512
shasum -b -a 512 linux-Sqrl-1.0.6-amd64.deb
7c019aa8f3a62e0f533a5d1c2c2c272dba2b84bc4696b2c43590b7cc60853072f4a3314adee133035cbdd9763b4f0cf9e0bb65f8efcb5222b83ef3d0268f0a5f *linux-Sqrl-1.0.6-amd64.deb
91ad98f0216d93b7746c8e7d5e19b3ef1f7c622ee4a80bf2f27efc415d5436874c7a979323bdd9b54045d04bf1699c5c9f1379fbc77cdbcae464bb23618ca8fa *linux-Sqrl-1.0.6-amd64.deb
shasum -b -a 512 linux-Sqrl-1.0.6-amd64.snap
1e7c6875b66c2f3b855781705102500932ae6d60ca3d43169dce31117e0058970968855346aec6e583f18e715365e2a6fee340d21f807788d5888f6845045336 *linux-Sqrl-1.0.6-amd64.snap
17e8dbe57c0562c429df5ec32c33a73d26bf32f8c6b43b364cb4f8c2fbbec3413de08e6cd8991911a9a55107b914b1804a954d7c938b2f8f970dc76c36bfcf53 *linux-Sqrl-1.0.6-amd64.snap
shasum -b -a 512 linux-Sqrl-1.0.6-arm64.deb
9baf5acfe7be92ebab6f60f50b83804be25a89bad37030ea8066f19e9d9869824a07c1b66df17075bbe0079b5b5455f5b52f4dd17d25d0288a5acfde4687c0b5 *linux-Sqrl-1.0.6-arm64.deb
97dfb7eb0a00876cf5ffa37310ec6d8b21aba64d92dcfda67f087145b69656fe715a07979aac09712e2c8a5810da94fe17846200903819dcf7b4597c399c40c8 *linux-Sqrl-1.0.6-arm64.deb
shasum -b -a 512 linux-Sqrl-1.0.6-armv7l.deb
ac793e93a8ff1e80e1889ec9a4a8b1428be1ffaeec0a21cd37c8b655ee736a13f50b63de832d2e329a9f81a6c123304b119487f09d8104b4f7c887357d1cd730 *linux-Sqrl-1.0.6-armv7l.deb
2eed65198f1f4c758ee52634580af4cddf3ec569f7b2ef2e622ad5683c84015a37ae5f47d3e3f32febfd45fb207d84ca2f83f93cb28a867bc27aedd9587776e3 *linux-Sqrl-1.0.6-armv7l.deb
shasum -b -a 512 linux-Sqrl-1.0.6-i386.deb
a4f7e9cae4a868541d50dae16979389d87b33c4b144d64afaff4c19c0814c6bf2746acde26a71cdc6e42076ffa48d08a44e50353160ea68a5100548ea1790eb2 *linux-Sqrl-1.0.6-i386.deb
28fc6fc8757aaa7a18da7e712baf7180ab1d5636ecf4812925a9569e4e9744282ad4e32bc60969d17e1f107fbde55264d3ce5c400b1084a0323544f02f0282c8 *linux-Sqrl-1.0.6-i386.deb
shasum -b -a 512 linux-Sqrl-1.0.6-x86_64.AppImage
707aac3b4e36c603020fd05cc73364b5386427856cd92dc10f2f012d02931283efea5d13c7db61085de4925ac5633c0715b6024da62cd82ee48fa3ca68becc51 *linux-Sqrl-1.0.6-x86_64.AppImage
a9d12cb39dcd35ca2aeb7e6f03ea99f1005c601210b799de86da9365926e15325de34351634e333ae6dd7a58f74126817991b695bad1d2ec4b6ca2e542928241 *linux-Sqrl-1.0.6-x86_64.AppImage
shasum -b -a 512 mac-Sqrl-1.0.6.dmg
c741c75fd6b6040164db845630750b46ad6918bd79ee8801f4251b534144890a0a3dda4d0dc9ed5d752e9a1d21e04d1442a8a38f3a9d4aabbb349a31528270a7 *mac-Sqrl-1.0.6.dmg
008f7a5519fa07fe665ddf166457f43c3101162586aa83d8648fd0c3274ba1b45ec4b675290e8b0cc815a6fa1ea17bc2ce2db67ce41809418e6bd520d390251d *mac-Sqrl-1.0.6.dmg
shasum -b -a 512 mac-Sqrl-1.0.6.zip
a7b073776fae020c39f48c63fcd2eac64f83815b8f239555d70f069802c16711ea2bcd1ca55bc8cf3992dab82cdbe25835ea137781ed594d131922ff2c0c4fb0 *mac-Sqrl-1.0.6.zip
d53880399aa0ede54da54b42e80bbbe11f9b6a95a0bdd80dfaf4fdba3c67f393d131e4734bff53a14aae03f600422d017f1d19b9a7b88cd7309a47e198096850 *mac-Sqrl-1.0.6.zip
shasum -b -a 512 win-Sqrl-1.0.6.exe
8b7e8a2b6ffc7a0ad4056a3f4b974edab89d1e5a26d1ad4a4fc286172843af892527e9c6da802699f37b0566076a8961dff1d320455bea1d3c6e8bc6aaf5ccbd *win-Sqrl-1.0.6.exe
34eb26ab5d4fdc887baf48fc363b086d4c96bf5dedcc5ca87f4764d3249ad9899e6bb6e46c9a8af77e040912393107eab5259bbd58aebe8af399a0b2505377ce *win-Sqrl-1.0.6.exe
-----BEGIN PGP SIGNATURE-----
Version: Keybase OpenPGP v2.1.0
Comment: https://keybase.io/crypto
wsFcBAABCgAGBQJc/tq6AAoJEDT4ke1a0TzTqK8QAJDkXt8OOjKYR0fKZ1lH7Btj
i33T1B5NLqUodAapwJNYjl6K2QhAjkFhjbS1iqtBdxDemUqdJTKpA45xSoeiYbxW
vveo+m1p/W61MFdtYEVXLfId/gyhRpp/ysmc+vSQ+y5pGsm4k/fq1frE8A4l9FU3
RdWXMy+l83iPbMa/64uGaB0+MOKY5qy0c1fgsrB1QaGCQsup1SoGfArPF7r2HcHJ
Q/7d+1bpv51cUhVN/tXDVmKijikexvQED9qj+86t91XfnXjSPQ6LV1206QhmYuIj
pszO/GJrPil6DYgZOspcJ2ij/ATN86DDgVeQpGQjAWjsOibrHbvn5kMCAEk1Rq4a
zngpXZEZDsdqzQGS/H1UT8QPdHi9oGGJ6Smh1NMf7jBEC1d/WdgOHWsTn6nYrNGX
z7zjvgJNicuv/PBtCm/ZDWoJMCPuqqAPWK3duWR08aZ9GSY5sjacwE4tV7WymCCi
5Hcr34aCMVDBb+razhKvTOKJPCsnBzS1szDYMH41bo4Kf+/AuqzcvxOIh75x7deW
EiloobfbT9AVh7Wg4/Ve0e/94aEj5wPYLwNWdf16KzT6tkYAO1vawvFSQDYImfvm
ivo1//gkbhEbKAllaRM4G4Jq2B6RANscj84k30CXUsy2jCsR6PrOSlBHas5qYI6Y
21582+z0vUgvIXztOP7b
=wKNy
wsFcBAABCgAGBQJc/8rHAAoJEDT4ke1a0TzT8uAP/RdBPAQp3jy23tP/pQtCTIA0
CCptw1r93I2kAUzMJF4hbvHr4rJAVfg0uDiOdMVJc77UpQ+dA6VurIpfKuSmjvfM
T01rqsXmU7HGErh3QtYRkbAjC0z23hlxa4TK7t8SR1pWZZCwpiaAjrtKgoaU0Wk4
Fncsr+gaK5cEdpO8uZUycMTwbfhZ480bOYRZZ2k9wY/y/aSYlMksVVODYkhzWYSD
j2Y+bL6htKYh+bOhhwRhW2TMsUEeY5gjq3DeSJhcNfqacnFDXSBMdePxBwFSN9iA
SDTI+CzOb+axJ5j6lbHyotKhSgZlHQ2daeVb0ZKcW1o460P2lAgFJlM8SUTK1ili
D2Jl+9o6mo4S0c2VKahGs1K915gCCIbf7LiHY4ZWDC6NXqqpCPCp8sF+YLMPlEqG
GI0ZpKxa6V9hItzMjDHmVXSwggy4IxiRirV15W94eLmwWGDrGwzcFZN8cWds1bR6
s60WmCm9AwEg16R+fPcMGqicnxscFnvjXbO3MrPnLSNz9N+Zf9IhPsdzqqZvoKH1
mJIIbNZzSuNZBasdqKgMb4rJVkfqBo5bYz8pibNL/yJHxttJtfSEGCVhJ2QAX4kt
9xpB5vCoKHTKB9PYZA9CbrnhYRVe7rljffN/IEDA+zhAkQApXX3Gma+p8Zrfxa++
kevYSEvXikI6Kwn3by2o
=r8Lb
-----END PGP SIGNATURE-----
```
14 changes: 6 additions & 8 deletions app/shared/actions/rex.js
Original file line number Diff line number Diff line change
Expand Up @@ -926,14 +926,12 @@ export function getRexPool() {
};
});

if (data && data.length > 0){
return dispatch({
type: types.SYSTEM_REX_GETREXPOOL_SUCCESS,
payload: {
rexpool:data[0]
}
});
}
return dispatch({
type: types.SYSTEM_REX_GETREXPOOL_SUCCESS,
payload: {
rexpool:data[0]
}
});
}).catch((err) => dispatch({
type: types.SYSTEM_REX_GETREXPOOL_FAILURE,
payload: { err },
Expand Down
4 changes: 3 additions & 1 deletion app/shared/actions/validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { getCurrencyBalance } from './accounts';
import * as types from './types';
import * as chain from './chain';
import eos from './helpers/eos';
import * as rex from './rex';

const ecc = require('eosjs-ecc');

Expand Down Expand Up @@ -95,7 +96,8 @@ export function validateNode(node) {
type: types.VALIDATE_NODE_SUCCESS
});
// Refresh our connection properties with new chain info
return dispatch(chain.getInfo());
dispatch(chain.getInfo());
return dispatch(rex.getRexPool());
}
return dispatch({ type: types.VALIDATE_NODE_FAILURE });
}).catch((err) => dispatch({
Expand Down
160 changes: 101 additions & 59 deletions app/shared/components/Producers/Governance/Ratify/Ratify.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,19 @@ import { find } from 'lodash';
import Moment from 'react-moment';
const { shell } = require('electron');
import { Button, Header, Message, Segment, Table } from 'semantic-ui-react';
import {Chart} from 'react-google-charts';
import { Chart } from 'react-google-charts';
import ReactMarkdown from 'react-markdown';

import GovernanceProposalsRatifyVote from './Ratify/Vote';
import GlobalTransactionModal from '../../../Global/Transaction/Modal';

const scope = 'eosio.amend';

class GovernanceProposalsRatify extends Component<Props> {
state= {
currentClauseMarkdown: null,
proposedClauseMarkdown: null
};
approve = (ballot_id) => {
const { actions, settings } = this.props;
const voter = settings.account;
Expand Down Expand Up @@ -65,6 +70,40 @@ class GovernanceProposalsRatify extends Component<Props> {
shell.openExternal(link);
}
}
componentDidMount(){
const {
proposal
} = this.props;
const {
document_clauses,
submission_new_clause_nums,
submission_new_ipfs_urls
} = proposal;

if (submission_new_clause_nums && submission_new_clause_nums.length > 0) {
const currentClauseURL = document_clauses[submission_new_clause_nums[0]-1];
if (currentClauseURL) {
fetch(currentClauseURL)
.then(response=>{
return response.text();
}).then(data =>{
this.setState({
currentClauseMarkdown: data
})
});
}
const proposedClauseURL = submission_new_ipfs_urls[0];
if (proposedClauseURL) {
fetch(proposedClauseURL).then(response=>{
return response.text();
}).then(data =>{
this.setState({
proposedClauseMarkdown: data
})
});
}
}
}
render() {
const {
accounts,
Expand Down Expand Up @@ -104,6 +143,11 @@ class GovernanceProposalsRatify extends Component<Props> {
submission_title
} = proposal;

const {
currentClauseMarkdown,
proposedClauseMarkdown
} = this.state;

console.log(proposal);

let ballot = ballots.filter((b) => b.reference_id === prop_id && b.table_id === 0)[0];
Expand All @@ -128,7 +172,9 @@ class GovernanceProposalsRatify extends Component<Props> {
const noVotes = parseFloat(proposal.no_count.split(' ')[0]);
const absVotes = parseFloat(proposal.abstain_count.split(' ')[0]);

let clauseIndex = -1;
const clauseNotFound = 'Matching clause not found in ' + document_title;
const newClauseNotFound = 'New clause details not found for ' + submission_title;

return (
<React.Fragment>
<Header
Expand Down Expand Up @@ -303,64 +349,60 @@ class GovernanceProposalsRatify extends Component<Props> {
/> : ''}

<React.Fragment>
{
(submission_new_ipfs_urls && submission_new_ipfs_urls.length > 0) ?
<p>For more information on this ratification request, see below:
</p>
: ''
}
<Table style={{ marginTop: 20 }}>
<Table.Header>
{([].concat(submission_new_clause_nums)
.map((clauseNum) => {
clauseNum--;
return (
<div>
<React.Fragment>
<Header
color="black"
size="medium"
>
<strong>Clause #:</strong> {clauseNum+1} in {document_title}
</Header>
</React.Fragment>
<Table style={{ marginTop: 20 }}>
<Table.Header>
<Table.Row>
<Table.HeaderCell>
Current Clause
</Table.HeaderCell>
</Table.Row>
</Table.Header>
<Table.Body>
<Table.Row>
<Table.Cell style={{
whiteSpace: "normal",
wordWrap: "break-all"
}}>
{(currentClauseMarkdown) ? <ReactMarkdown source={currentClauseMarkdown} /> : clauseNotFound }
</Table.Cell>
</Table.Row>
</Table.Body>
</Table>
<Table style={{ marginTop: 20, marginBottom: 20 }}>
<Table.Header>
<Table.Row>
<Table.HeaderCell>
Proposed Clause
</Table.HeaderCell>
</Table.Row>
</Table.Header>
<Table.Body>
<Table.Row>
<Table.HeaderCell>
Current Clause
</Table.HeaderCell>
<Table.HeaderCell>
New Clause #'s
</Table.HeaderCell>
<Table.HeaderCell>
IPFS Link
</Table.HeaderCell>
</Table.Row>
</Table.Header>
<Table.Body>
{([].concat(submission_new_clause_nums)
.map((clauseNum) => {
clauseIndex++;
return (
<React.Fragment key={clauseNum}>
<Table.Row>
<Table.Cell collapsing>
{document_clauses[clauseIndex]}
</Table.Cell>
<Table.Cell style={{
whiteSpace: "normal",
wordWrap: "break-word"
}}>
{clauseNum}
</Table.Cell>
<Table.Cell style={{
whiteSpace: "normal",
wordWrap: "break-word"
}}>
{(submission_new_ipfs_urls[clauseIndex]) ?
<p>
<small>
<a
onClick={() => this.openLink(submission_new_ipfs_urls[clauseIndex])}
role="link"
style={{ cursor: 'pointer', fontSize:'10pt' }}
tabIndex={0}
> {submission_new_ipfs_urls[clauseIndex].replace('/ipfs/','')} fsjdklfjsldf</a>
</small>
</p> : ''}
</Table.Cell>
</Table.Row>
</React.Fragment>
);
}))}
</Table.Body>
</Table>
<Table.Cell style={{
whiteSpace: "normal",
wordWrap: "break-all"
}}>
{(proposedClauseMarkdown) ? <ReactMarkdown source={proposedClauseMarkdown} /> : newClauseNotFound }
</Table.Cell>
</Table.Row>
</Table.Body>
</Table>
</div>
)
}))}
</React.Fragment>

{
Expand Down
3 changes: 1 addition & 2 deletions app/shared/components/TabMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ class TabMenu extends Component<Props> {
wallet,
t
} = this.props;

return (
<Menu
attached
Expand Down Expand Up @@ -61,7 +60,7 @@ class TabMenu extends Component<Props> {
<Menu.Item
name="exchange"
icon="exchange"
content={t('exchange')}
content='REX'
active={activeItem === 'exchange'}
onClick={handleItemClick}
/>
Expand Down
5 changes: 5 additions & 0 deletions app/shared/reducers/rex.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ export default function rex(state = initialState, action) {
rexpool: action.payload.rexpool
});
}
case types.SYSTEM_REX_GETREXPOOL_FAILURE: {
return Object.assign({}, state, {
rexpool: null
});
}
case types.SYSTEM_REX_GETREXBAL_SUCCESS: {
return Object.assign({}, state, {
rexbal: action.payload.rexbal
Expand Down
Loading

0 comments on commit e266474

Please sign in to comment.