-
-
Notifications
You must be signed in to change notification settings - Fork 775
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make It Clear Issue Has Been Crowdfunded V2 #2173
Conversation
app/assets/v2/js/shared.js
Outdated
|
||
result['p'] = ((result['experience_level'] ? result['experience_level'] : 'Unknown Experience Level') + ' • '); | ||
if (tokens.length) { | ||
var obj = {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected blank line after variable declarations. (newline-after-var)
app/assets/v2/js/shared.js
Outdated
|
||
if (result['status'] === 'done') | ||
while (tokens.length) { | ||
var tokenName = tokens.shift(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected blank line after variable declarations. (newline-after-var)
app/assets/v2/js/shared.js
Outdated
var opened_when = timeDifference(new Date(), new Date(result['web3_created']), true); | ||
var openedWhen = timeDifference(dateNow, new Date(result['web3_created']), true); | ||
var timeLeft = timeDifference(dateNow, dateExpires); | ||
var expiredExpires = new Date() < dateExpires ? 'Expires' : 'Expired'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Multiple spaces found before ''Expires''. (no-multi-spaces)
app/assets/v2/js/shared.js
Outdated
|
||
result['p'] += ('Opened ' + opened_when + ' ago, Expires in ' + timeLeft); | ||
result['p'] += ('Opened ' + openedWhen + ' ago, ' + expiredExpires + ' ' + timeLeft); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Multiple spaces found before '+'. (no-multi-spaces)
app/assets/v2/js/shared.js
Outdated
|
||
if (renderForExplorer) { | ||
if (typeof web3 != 'undefined' && web3.eth.coinbase == result['bounty_ owner_address']) { | ||
result['my_bounty'] = '<a class="btn font-smaller-2 btn-sm btn-outli ne-dark" role="button" href="#">mine</span></a>'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected indentation of 8 spaces but found 10. (indent)
app/assets/v2/js/shared.js
Outdated
if (renderForExplorer) { | ||
if (typeof web3 != 'undefined' && web3.eth.coinbase == result['bounty_ owner_address']) { | ||
result['my_bounty'] = '<a class="btn font-smaller-2 btn-sm btn-outli ne-dark" role="button" href="#">mine</span></a>'; | ||
} else if (result['fulfiller_address'] !== '0x000000000000000000000000 0000000000000000') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected indentation of 6 spaces but found 8. (indent)
app/assets/v2/js/shared.js
Outdated
if (typeof web3 != 'undefined' && web3.eth.coinbase == result['bounty_ owner_address']) { | ||
result['my_bounty'] = '<a class="btn font-smaller-2 btn-sm btn-outli ne-dark" role="button" href="#">mine</span></a>'; | ||
} else if (result['fulfiller_address'] !== '0x000000000000000000000000 0000000000000000') { | ||
result['my_bounty'] = '<a class="btn font-smaller-2 btn-sm btn-outli ne-dark" role="button" href="#">' + result['status'] + '</span></a>'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected indentation of 8 spaces but found 10. (indent)
app/assets/v2/js/shared.js
Outdated
result['my_bounty'] = '<a class="btn font-smaller-2 btn-sm btn-outli ne-dark" role="button" href="#">mine</span></a>'; | ||
} else if (result['fulfiller_address'] !== '0x000000000000000000000000 0000000000000000') { | ||
result['my_bounty'] = '<a class="btn font-smaller-2 btn-sm btn-outli ne-dark" role="button" href="#">' + result['status'] + '</span></a>'; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected indentation of 6 spaces but found 8. (indent)
Codecov Report
@@ Coverage Diff @@
## master #2173 +/- ##
==========================================
- Coverage 27.75% 27.72% -0.03%
==========================================
Files 142 142
Lines 11506 11519 +13
Branches 1562 1563 +1
==========================================
+ Hits 3193 3194 +1
- Misses 8201 8213 +12
Partials 112 112
Continue to review full report at Codecov.
|
@@ -955,63 +955,107 @@ var usdToAmount = function(event) { | |||
}); | |||
}; | |||
|
|||
function renderBountyRowsFromResults(results) { | |||
function renderBountyRowsFromResults(results, renderForExplorer) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
app/assets/v2/images/coin.svg
Outdated
</g> | ||
</g> | ||
</g> | ||
</svg> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pinkiebell can we run svgo
against this file ?
@thelostone-mc svgo-ing Done 👍 |
Side note: I labelled this pr as wip because of one open question:
|
@pinkiebell could we display the token with no usd conversion in the tool tip but not average in the final USD value? |
let leftHtml = ''; | ||
let rightHtml = ''; | ||
|
||
leftHtml += |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'+=' should be placed at the beginning of the line. (operator-linebreak)
leftHtml += | ||
'<p class="m-0"> ' + bountyTokenAmount + ' ' + bountyTokenName + '</p>'; | ||
|
||
rightHtml += |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'+=' should be placed at the beginning of the line. (operator-linebreak)
const tokenName = tokens.shift(); | ||
const obj = val[tokenName]; | ||
const ratio = obj['ratio']; | ||
const amount = obj['amount'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon. (semi)
const timePeg = timeDifference(dateNow, new Date(obj['timestamp']), false, 60 * 60); | ||
const tooltip = '$' + normalizeAmount(usd, decimals) + ' ' + tokenName + ' in crowdfunding'; | ||
|
||
leftHtml += |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'+=' should be placed at the beginning of the line. (operator-linebreak)
|
||
leftHtml += | ||
'<p class="m-0">+ ' + funding + ' ' + tokenName + '</p>'; | ||
rightHtml += |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'+=' should be placed at the beginning of the line. (operator-linebreak)
The only thing what's left is the caret(arrow) with the right color(same as link color). |
@pinkiebell could you rebase it once ? we'll put this up on staging and test it out there today |
@thelostone-mc Done.
|
app/assets/v2/js/shared.js
Outdated
|
||
ele.className = 'tag token'; | ||
span.innerHTML = amount + ' ' + tokenName + | ||
(isCrowdfunded ? '<i class="fas fa-users ml-1"></i>' : '' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be no spaces inside this paren. (space-in-parens)
@thelostone-mc |
@pinkiebell I will be reviewing it in some time and get back to you. :) |
@pinkiebell I am seeing this in every non-crowfunded bounty details page. Can you please check? |
app/dashboard/models.py
Outdated
return "" | ||
tokens = afs.keys() | ||
|
||
if len(tokens) == 0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to check len()
here. Simply if not tokens:
app/dashboard/models.py
Outdated
return_dict['usd_value'] += tip.value_in_usdt if tip.value_in_usdt else 0 | ||
return return_dict | ||
token = tip.tokenName | ||
obj = ret.get(token, None) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you default to {}
:
obj = ret.get(token, {})
if not obj:
obj['amount'] = 0.0
@SaptakS |
@pinkiebell The icon beside |
|
||
tooltip_info.push(template); | ||
} | ||
const decimals = 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are showing 3 decimal places in almost all places. Any reason why we are showing only 2 for crowdfunded amount?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SaptakS Aesthetics? 😄 Fixed!
LGTM apart from above comments. |
@mbeacom |
@mbeacon @SaptakS @PixelantDesign |
@pinkiebell one final rebase and then we can throw it on staging |
Also revamped the additional_funding_summary bounty-property
@thelostone-mc |
@pinkiebell Looking good to me...One thing I see... It should not be possible to have 791 cents. And here |
@PixelantDesign |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚢
Fixes #2164