Commit 612b8147 authored by Jonathan Porta's avatar Jonathan Porta
Browse files

Remove old proposal_system code

parent 7072741b
......@@ -24,26 +24,36 @@ module.exports = {
'/market',
'/~witnesses',
'/submit.html',
'/steem_proposal_system',
'/proposals',
].forEach(path => testHttpGet('localhost', 8080, path, browser));
},
};
const testHttpGet = (host, port, path, browser) => {
http
.request({
host,
port,
path,
method: 'GET'
}, function(res) {
browser.assert.equal(res.statusCode, 200, `Response for ${path} is 200`);
})
.setTimeout(30000, function() {
browser.assert.equal(true, false, `request for ${path} took more than 30 seconds`);
})
.on('error', function (err) {
browser.assert.equal(true, false, err);
})
.end();
http.request(
{
host,
port,
path,
method: 'GET',
},
(res) => {
browser.assert.equal(
res.statusCode,
200,
`Response for ${path} is 200`
);
}
)
.setTimeout(30000, () => {
browser.assert.equal(
true,
false,
`request for ${path} took more than 30 seconds`
);
})
.on('error', (err) => {
browser.assert.equal(true, false, err);
})
.end();
};
......@@ -58,23 +58,17 @@ export default function resolveRoute(path) {
if (path === '/~witnesses') {
return { page: 'Witnesses' };
}
if (path === '/steem_proposal_system') {
return { page: 'SteemProposalSystem' };
}
if (path === '/proposals') {
console.log('/proposals');
return { page: 'Proposals' };
}
match =
path.match(routeRegex.UserProfile1) ||
path.match(routeRegex.UserProfile2);
if (match) {
console.log('MATCH');
if (GDPRUserList.includes(match[1].substring(1))) {
return { page: 'NotFound' };
}
return { page: 'UserProfile', params: match.slice(1) };
}
console.log('NO MATCH');
return { page: 'NotFound' };
}
......@@ -33,7 +33,6 @@ describe('resolveRoute', () => {
['/recover_account_step_2', { page: 'RecoverAccountStep2' }],
['/market', { page: 'Market' }],
['/~witnesses', { page: 'Witnesses' }],
['/steem_proposal_system', { page: 'SteemProposalSystem' }],
['/proposals', { page: 'Proposals' }],
['/@gdpr/nice345', { page: 'NotFound' }],
['/taggy/@gdpr/nice345', { page: 'NotFound' }],
......
......@@ -44,8 +44,6 @@ export default {
cb(null, [require('app/components/pages/RecoverAccountStep2')]);
} else if (route.page === 'Witnesses') {
cb(null, [require('app/components/pages/Witnesses')]);
} else if (route.page === 'SteemProposalSystem') {
cb(null, [require('app/components/pages/SteemProposalSystem')]);
} else if (route.page === 'Proposals') {
cb(null, [require('app/components/pages/Proposals')]);
} else if (route.page === 'UserProfile') {
......
......@@ -52,4 +52,3 @@
@import './pages/Witnesses';
@import './pages/About';
@import './pages/WalletIndex';
@import './pages/SteemProposalSystem';
......@@ -60,10 +60,10 @@ class Header extends React.Component {
/*Set the document.title on each header render.*/
const route = resolveRoute(pathname);
let home_account = false;
const home_account = false;
let page_title = route.page;
let topic = '';
const topic = '';
let page_name = null;
if (route.page === 'WalletIndex') {
} else if (route.page == 'Privacy') {
......@@ -81,10 +81,10 @@ class Header extends React.Component {
route.page == 'RecoverAccountStep2'
) {
page_title = tt('header_jsx.stolen_account_recovery');
} else if (route.page === 'SteemProposalSystem') {
page_title = tt('header_jsx.steem_proposal_system');
} else if (route.page === 'Proposals') {
page_title = tt('header_jsx.steem_proposals');
} else if (route.page === 'UserProfile') {
let user_name = route.params[0].slice(1);
const user_name = route.params[0].slice(1);
const name = account_meta
? normalizeProfile(account_meta.toJS()).name
: null;
......@@ -263,6 +263,9 @@ const mapDispatchToProps = dispatch => ({
},
});
const connectedHeader = connect(mapStateToProps, mapDispatchToProps)(Header);
const connectedHeader = connect(
mapStateToProps,
mapDispatchToProps
)(Header);
export default connectedHeader;
......@@ -73,9 +73,9 @@ const SidePanel = ({ alignment, visible, hideSidePanel, username }) => {
link: `/~witnesses`,
},
{
value: 'steem_proposal_system',
label: tt('navigation.steem_proposal_system'),
link: `/steem_proposal_system`,
value: 'proposals',
label: tt('navigation.steem_proposals'),
link: `/proposals`,
},
],
exchanges: [
......@@ -83,9 +83,7 @@ const SidePanel = ({ alignment, visible, hideSidePanel, username }) => {
value: 'blocktrades',
label: 'Blocktrades',
link: username
? `https://blocktrades.us/?input_coin_type=eth&output_coin_type=steem&receive_address=${
username
}`
? `https://blocktrades.us/?input_coin_type=eth&output_coin_type=steem&receive_address=${username}`
: `https://blocktrades.us/?input_coin_type=eth&output_coin_type=steem`,
},
{
......@@ -181,23 +179,23 @@ const SidePanel = ({ alignment, visible, hideSidePanel, username }) => {
<CloseButton onClick={hideSidePanel} />
<ul className={`vertical menu ${loggedIn}`}>
{makeInternalLink(
sidePanelLinks['extras'][0],
sidePanelLinks.extras[0],
0,
sidePanelLinks['extras']
sidePanelLinks.extras
)}
{makeExternalLink(
sidePanelLinks['extras'][1],
sidePanelLinks.extras[1],
1,
sidePanelLinks['extras']
sidePanelLinks.extras
)}
{makeInternalLink(
sidePanelLinks['extras'][2],
sidePanelLinks.extras[2],
2,
sidePanelLinks['extras']
sidePanelLinks.extras
)}
</ul>
<ul className="vertical menu">
{sidePanelLinks['internal'].map(makeInternalLink)}
{sidePanelLinks.internal.map(makeInternalLink)}
</ul>
<ul className="vertical menu">
<li>
......@@ -205,16 +203,16 @@ const SidePanel = ({ alignment, visible, hideSidePanel, username }) => {
{tt('navigation.third_party_exchanges')}
</a>
</li>
{sidePanelLinks['exchanges'].map(makeExternalLink)}
{sidePanelLinks.exchanges.map(makeExternalLink)}
</ul>
<ul className="vertical menu">
{sidePanelLinks['external'].map(makeExternalLink)}
{sidePanelLinks.external.map(makeExternalLink)}
</ul>
<ul className="vertical menu">
{sidePanelLinks['organizational'].map(makeExternalLink)}
{sidePanelLinks.organizational.map(makeExternalLink)}
</ul>
<ul className="vertical menu">
{sidePanelLinks['legal'].map(makeInternalLink)}
{sidePanelLinks.legal.map(makeInternalLink)}
</ul>
</div>
</div>
......
......@@ -340,7 +340,7 @@ module.exports = {
type: 'remove_proposal',
operation: { proposal_owner, proposal_ids },
confirm: tt(
'steem_proposal_system_jsx.confirm_remove_proposal_description'
'steem_proposals.confirm_remove_proposal_description'
),
successCallback,
errorCallback,
......
This diff is collapsed.
.SteemProposalSystem {
table {
tr:nth-child(4n),
tr:nth-child(4n-1) {
// background-color: #f4f4f4;
@include themify($themes) {
background-color: themed('backgroundColorOpaque');
color: themed('textColorPrimary');
}
}
tr:nth-child(4n -2),
tr:nth-child(4n-3) {
@include themify($themes) {
background-color: themed('tableRowEvenBackgroundColor');
}
}
td.permlink-column {
display: flex;
justify-content: space-around;
align-items: center;
a {
display: flex;
align-items: center;
justify-content: center;
}
.Voting__button-up {
padding-right: 0 !important;
}
}
td.subject-column,
td.subject-table-header {
display: none;
}
tr.proposal-subject-row {
td {
text-align: center;
}
}
tbody {
td.id-column,
td.daily_pay-column,
td.total_votes-column {
text-align: right;
}
}
.proposals-filter-header {
.proposals-filter-wrapper {
display: flex;
justify-content: space-between;
align-items: center;
.dropdowns {
li {
span {
padding: 0.4rem;
font-weight: bold;
text-align: left;
padding-left: 16px;
&:hover {
cursor: pointer;
color: $color-teal;
}
}
}
}
.pagination {
display: flex;
align-items: center;
margin-bottom: 0;
}
}
}
.proposal-remove {
span {
color: red;
font-size: 1.25em;
}
}
@media only screen and (min-width: 768px) {
td.start_date-column,
td.end_date-column {
width: 22ch;
}
td.total_votes-column {
width: 13ch;
}
td.daily_pay-column {
width: 18ch;
}
}
@media only screen and (max-width: 768px) {
thead tr:nth-child(2) {
display: none;
}
tr {
margin-bottom: 10px;
display: block;
}
tr.proposals-filter-header {
margin-bottom: 2px;
}
tr.proposal-subject-row {
display: none;
}
tr:nth-child(4n),
tr:nth-child(4n-1) {
background-color: transparent;
}
td.subject-column {
display: block;
}
td.permlink-column {
display: flex;
justify-content: flex-end;
align-items: center;
a {
width: 30px;
height: 30px;
}
}
td {
display: block;
text-align: right;
}
td::before {
content: attr(data-label);
float: left;
font-weight: bold;
}
}
}
}
......@@ -272,7 +272,7 @@
"smt_whitepaper": "SMT Whitepaper",
"whitepaper": "Steem Whitepaper",
"jobs": "Jobs at Steemit",
"steem_proposal_system": "Steem Proposal System"
"steem_proposals": "Steem Proposals"
},
"reply_editor": {
"shorten_title": "Shorten title",
......@@ -665,7 +665,7 @@
"author_rewards_by": "Author rewards by %(username)s",
"replies_to": "Replies to %(username)s",
"comments_by": "Comments by %(username)s",
"steem_proposal_system": "Steem Proposal System"
"steem_proposals": "Steem Proposals"
},
"loginform_jsx": {
"you_need_a_private_password_or_key":
......@@ -882,8 +882,8 @@
"sbd_symbol": "SBD",
"sbd_description": "Seeks price stability with USD"
},
"steem_proposal_system_jsx": {
"top_sps": "Steem Proposal System",
"steem_proposals": {
"top_sps": "Steem Proposals",
"votes_update_info": "* Only updated once per hour",
"table": {
"id": "Id",
......
......@@ -40,7 +40,7 @@ export const userWatches = [
function* getLatestFeedPrice() {
try {
const history = yield call([api, api.getFeedHistoryAsync]);
const feed = history['price_history'];
const feed = history.price_history;
const last = fromJS(feed[feed.length - 1]);
yield put(userActions.setLatestFeedPrice(last));
} catch (error) {
......@@ -53,7 +53,7 @@ const highSecurityPages = [
/\/market/,
/\/@.+\/(transfers|permissions|password)/,
/\/~witnesses/,
/\/steem_proposal_system/,
/\/proposals/,
];
function* loadSavingsWithdraw() {
......@@ -210,7 +210,7 @@ function* usernamePasswordLogin({
login_owner_pubkey,
},
});
let authority = yield select(state =>
const authority = yield select(state =>
state.user.getIn(['authority', username])
);
......@@ -487,8 +487,16 @@ function* uploadImage({
const stateUser = yield select(state => state.user);
const username = stateUser.getIn(['current', 'username']);
const hasPosting = stateUser.getIn(['current', 'private_keys', 'posting_private']);
const hasActive = stateUser.getIn(['current', 'private_keys', 'active_private']);
const hasPosting = stateUser.getIn([
'current',
'private_keys',
'posting_private',
]);
const hasActive = stateUser.getIn([
'current',
'private_keys',
'active_private',
]);
if (!username) {
progress({ error: 'Please login first.' });
......@@ -539,7 +547,10 @@ function* uploadImage({
formData.append('filebase64', dataBs64);
}
const sig = Signature.signBufferSha256(bufSha, (hasPosting ? hasPosting : hasActive));
const sig = Signature.signBufferSha256(
bufSha,
hasPosting ? hasPosting : hasActive
);
const postUrl = `${$STM_Config.upload_image}/${username}/${sig.toHex()}`;
const xhr = new XMLHttpRequest();
......@@ -561,7 +572,7 @@ function* uploadImage({
};
xhr.upload.onprogress = function(event) {
if (event.lengthComputable) {
const percent = Math.round(event.loaded / event.total * 100);
const percent = Math.round((event.loaded / event.total) * 100);
progress({ message: `Uploading ${percent}%` });
// console.log('Upload', percent)
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment