-
-
Notifications
You must be signed in to change notification settings - Fork 771
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
Integration Branch for ENS, Duniter, Facebook, PersonhoodPassport on Trust Bonus Page #8569
Conversation
- add more validations - *same gitcoin user and duniter user uid - *social link "gitcoin.co" checker - *certificates check - *user is member check
… integration-ens
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.
left some comments and few questions
app/app/urls.py
Outdated
dashboard.views.request_verify_facebook, | ||
name='request_verify_facebook' | ||
), | ||
url(r'^api/v0.1/profile/verify_user_google', dashboard.views.verify_user_google, name='verify_user_google'), |
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.
this on already exist 2 lines down
showValidation: { | ||
type: Boolean, | ||
required: false, | ||
'default': false |
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.
not sure I believe this should be default
without quotes
this.verifyDuniter(); | ||
}, | ||
getUserHandle() { | ||
this.githubHandle = trustHandle; |
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.
I don't see where trustHandle
is defined, is this code working? I suppose is a global variable defined out of vue context, if that the case, ok but if not then this will be undefined.
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.
showValidation: { | ||
type: Boolean, | ||
required: false, | ||
'default': false |
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.
I believe is without quotes I never saw it with quotes, but probably doesn't affect the code.
jQuery.fn.shake = function(interval, distance, times) { | ||
interval = typeof interval == 'undefined' ? 100 : interval; | ||
distance = typeof distance == 'undefined' ? 10 : distance; | ||
times = typeof times == 'undefined' ? 3 : times; | ||
var jTarget = $(this); | ||
|
||
jTarget.css('position', 'relative'); | ||
for (var iter = 0; iter < (times + 1); iter++) { | ||
jTarget.animate({ top: ((iter % 2 == 0 ? distance : distance * -1))}, interval); | ||
} | ||
return jTarget.animate({ top: 0}, interval); | ||
}; | ||
|
||
$(document).on('click', '#gen_passport', function(e) { | ||
e.preventDefault(); | ||
if (document.web3network != 'rinkeby') { | ||
_alert('Please connect your web3 wallet to rinkeby + unlock it', 'error', 1000); | ||
return; | ||
} | ||
const accounts = web3.eth.getAccounts(); | ||
|
||
$.when(accounts).then((result) => { | ||
const ethAddress = result[0]; | ||
let params = { | ||
'network': document.web3network, | ||
'coinbase': ethAddress | ||
}; | ||
|
||
$.get('/passport/', params, function(response) { | ||
let status = response['status']; | ||
|
||
if (status == 'error') { | ||
_alert(response['msg'], 'error', 5000); | ||
return; | ||
} | ||
|
||
let contract_address = response.contract_address; | ||
let contract_abi = response.contract_abi; | ||
let nonce = response.nonce; | ||
let hash = response.hash; | ||
let tokenURI = response.tokenURI; | ||
var passport = new web3.eth.Contract(contract_abi, contract_address); | ||
|
||
var callback = function(err, txid) { | ||
if (err) { | ||
_alert(err, 'error', 5000); | ||
return; | ||
} | ||
let url = 'https://rinkeby.etherscan.io/tx/' + txid; | ||
var html = ` | ||
<strong>Woo hoo!</strong> - Your passport is being generated. View the transaction <a href='` + url + `' target=_blank>here</a>. | ||
<br><br> | ||
<strong>Whats next?</strong> | ||
<br> | ||
1. Please add the token contract address (` + contract_address + `) as a token to your wallet provider. | ||
<br> | ||
2. Use the Trust you've built up on Gitcoin across the dWeb! Learn more at <a target=_blank href=https://proofofpersonhood.com>proofofpersonhood.com</a> | ||
|
||
`; | ||
|
||
$('.modal-body .subbody').html(html); | ||
$('.modal-dialog').shake(); | ||
}; | ||
|
||
passport.methods.createPassport(tokenURI, hash, nonce).send({from: ethAddress}, callback); | ||
}); | ||
|
||
}); | ||
}); |
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.
why not vue here? It's ok for now I think but we are creating tech debt for the near future.
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.
i wrestled with vue for a bit + just couldnt get it working. couldnt get the variables to scope correctly. happy to pair on rewriting it.
$(document).on('click', '#gen_passport', function(e) { | ||
e.preventDefault(); | ||
if (document.web3network != 'rinkeby') { | ||
_alert('Please connect your web3 wallet to rinkeby + unlock it', 'error', 1000); |
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 rinkeby?
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.
yes, this is behind an is_staff
flag + not in mainnet yet
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.
I've left a couple of comments for @developerfred to get the tests to pass...
One thing to note for when we deploy this: we will need to make sure that we have libsodium installed everywhere that this code will run.
delimiters: [ '[[', ']]' ], | ||
data: function() { | ||
return { | ||
showValidation: false, |
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're providing showValidation
as a prop and defining a default value there - we don't need this ln 👍
@owocki if you can get the comments addressed -> we can get it out this week else we'll have to push this back |
@developerfred can you pls resolve the duniter comments? i can resolve the ones related to PoPP |
@owocki + @developerfred Could we get these fixed up by next week ? |
@developerfred if you cant get duniter fixed ( #7844 (comment) ) in the next day or two , i'm going to cut that code out + push the rest of this to deploy. |
I ended up not being able to work on that, I had external impediments. But I am focused on solving this feature. |
@owocki You can send facebook and ens, because it's ready. Because the Duniter is holding these deploys. there I am working on the feature attached. |
@developerfred could i get an ETA on when you'd be able to get this ready ? Ideally, I'd want to avoid doing that cause you'd have to rework your changes |
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.
All LGTM!! 🚀
Hi @thelostone-mc , I just see the Facebook integration has been merged; but I get Invalid App ID error on it. |
Description
Integration Branch for ENS, Duniter, Facebook on Trust Bonus Page under the "coming soon" area
Refers/Fixes
#7928
#7844
#7970
#8478
Testing