Skip to content
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

Fixing advanced payout - Default to Bountied Amount for Payment, etc. #2365

Closed
wants to merge 4 commits into from
Closed

Conversation

Anish-Agnihotri
Copy link
Contributor

@Anish-Agnihotri Anish-Agnihotri commented Oct 5, 2018

Description

This PR resolves #2294 by introducing:

  1. Alerts upon advanced payment > 100%.
  2. Automatic table altering upon X click.
  3. Other misc. payout preview cleaning (removing mentions of bounty stake, etc.).

See it in action!

Checklist
  • Remove Return Bounty Stake Checkbox
  • Default all payments to pay from the Initial Funded Bounty Amount
  • Add an alert (bg color #E66700, #FFF for copy) when user exceeds 100% or Bountied value in ETH.
  • Add wallet information and overage amount to the alert.
  • Display the overage amount on the payout preview in #E66700
  • Remove refunded Eth
  • Remove mention of bounty stake
  • If multiple users have been added to the pay list, and a user is removed, the payout preview should reflect the removal.
  • This issue is tested
Affected core subsystem(s)

UI is the only core system affected, since all changes are aesthetic.

Testing

Tested across two environments across two platforms (W10, Mojave). Feel free to test yourself as well.

Refers/Fixes

Fixes #2294.

@@ -68,8 +68,11 @@ $(document).ready(function($) {

$(document).on('click', '.remove', function(event) {
event.preventDefault();
var position = ($(this).parents('tr').index()+2).toString();

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)
Infix operators must be spaced. (space-infix-ops)

@@ -68,8 +68,11 @@ $(document).ready(function($) {

$(document).on('click', '.remove', function(event) {
event.preventDefault();
var position = ($(this).parents('tr').index()+2).toString();
$("#transaction_registry tr:nth-child(" + position + ")").remove();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strings must use singlequote. (quotes)

@@ -212,11 +224,26 @@ $(document).ready(function($) {
var denomination = $('#token_name').text();
var original_amount = $('#original_amount').val();
var net = round(original_amount - tc, 2);
var over = round(((original_amount) - (get_total_cost()))*-1, 4);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Infix operators must be spaced. (space-infix-ops)

if (over > 0) {
$('.overageAlert').css('display', 'inline-block');
$('.overagePreview').css('display', 'inline-block');
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Closing curly brace does not appear on the same line as the subsequent block. (brace-style)

Copy link
Contributor

@mbeacom mbeacom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please run make fix-eslint on this to resolve stickler comments?

@mbeacom mbeacom added frontend This needs frontend expertise. bounties community member labels Oct 5, 2018
@mbeacom
Copy link
Contributor

mbeacom commented Oct 5, 2018

Additionally, can you resolve the merge conflict?

@Anish-Agnihotri
Copy link
Contributor Author

Anish-Agnihotri commented Oct 5, 2018

@mbeacom

Edit: All issues have been resolved. Thanks!

@@ -68,8 +68,12 @@ $(document).ready(function($) {

$(document).on('click', '.remove', function(event) {
event.preventDefault();
var position = ($(this).parents('tr').index()+2).toString();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Infix operators must be spaced. (space-infix-ops)

@@ -212,11 +225,25 @@ $(document).ready(function($) {
var denomination = $('#token_name').text();
var original_amount = $('#original_amount').val();
var net = round(original_amount - tc, 2);
var over = round((original_amount - get_total_cost())*-1, 4);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Infix operators must be spaced. (space-infix-ops)

@codecov
Copy link

codecov bot commented Oct 5, 2018

Codecov Report

Merging #2365 into master will decrease coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2365      +/-   ##
==========================================
- Coverage   29.48%   29.47%   -0.02%     
==========================================
  Files         146      146              
  Lines       11771    11777       +6     
  Branches     1597     1599       +2     
==========================================
  Hits         3471     3471              
- Misses       8182     8188       +6     
  Partials      118      118
Impacted Files Coverage Δ
app/retail/views.py 30% <0%> (-0.69%) ⬇️
app/dashboard/gas_views.py 23.15% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f2ebc34...c388e52. Read the comment docs.

float: left;
padding-right: 10px;
}
.overageAlert> div:last-child {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

> - cosmetic whitespace missing 😄

@pinkiebell
Copy link
Contributor

LGTM; Just that one cosmetic one-liner to fix 😄

Recommended by @pixiebell. Thanks for the review!
@Anish-Agnihotri
Copy link
Contributor Author

Anish-Agnihotri commented Oct 7, 2018

LGTM; Just that one cosmetic one-liner to fix 😄

Thanks for the review! Just pushed out the fix in the new commit :).

Edit: Apologies for misspelling your Github username in the commit log.

Edit 2: Codecov errors are not related to these commits. Branch is safe to merge.

@@ -166,7 +170,16 @@ $(document).ready(function($) {
_alert('You do not have any transactions to payout. Please add payees to the form.', 'error');
return;
}
var usernames = $('.username');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

encourage moving to let / const as opposed to var ?
cause we've got the ES6 support coming in this week

var usernames = $('.username');

for (var i = 0; i < usernames.length; i++) {
var username = usernames[i].textContent.trim();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -120,6 +153,15 @@ <h5>{% trans 'Payout Preview' %}</h5>
</a>
</div>
</div>

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the extra line ?

@thelostone-mc
Copy link
Member

thelostone-mc commented Oct 7, 2018

Hmm I see changes in the codebase aka ( autcomplete and tooltip PR ) repeating here. Any idea why that's happening ? 🤔 here, here and a few other places.

Could you double check to make sure only your changes are preset in the PR ?

@Anish-Agnihotri
Copy link
Contributor Author

@thelostone-mc I had to add those since there seemed to be a merge error otherwise. I can rebase from default, restructure, and push out another commit tonight.

And, sure, I'll change variable declaration to follow ES6 standards as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bounties frontend This needs frontend expertise.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Advanced Payout - Default to Bountied Amount for Payment, Add Guidance on Overage
5 participants