diff --git a/app/assets/v2/js/user_popover.js b/app/assets/v2/js/user_popover.js index 4d8417ab287..103c046dfe2 100644 --- a/app/assets/v2/js/user_popover.js +++ b/app/assets/v2/js/user_popover.js @@ -1,39 +1,40 @@ let popoverData = []; -const renderPopOverData = profile => { - let contributed_to = Object.keys(profile.contributed_to).map((_organization, index) => { +const renderPopOverData = data => { + console.log(data) + let contributed_to = data.contributed_to.map((_organization, index) => { if (index < 3) { return `${_organization}`; } - return `+${Object.keys(profile.contributed_to).length - 3}`; + return `+${data.contributed_to.length - 3}`; }).join(' '); return `
- -

${profile.handle}

+ +

${data.handle}

${contributed_to.length ? 'Contributes to: ' + contributed_to : ''}
-

${profile.stats.position}

+

${data.stats.position}

contributor

-

${profile.stats.success_rate}

+

${data.stats.success_rate}

success rate

-

${profile.stats.earnings ? Number(profile.stats.earnings).toFixed(4) : 0} ETH

-

collected from ${profile.stats.completed_bounties} bounties

+

${data.stats.earnings ? Number(data.stats.earnings).toFixed(4) : 0} ETH

+

collected from ${data.stats.completed_bounties} bounties

-

Bounties completed related to ${profile.keywords.slice(0, 3).toString()}

- ${profile.related_bounties ? +

Bounties completed related to ${data.keywords.slice(0, 3).toString()}

+ ${data.related_bounties ? '' : '

None

' @@ -44,7 +45,8 @@ const renderPopOverData = profile => { }; function openContributorPopOver(contributor, element) { - const contributorURL = `/api/v0.1/profile/${contributor}`; + const keywords = document.result.keywords; + const contributorURL = `/api/v0.1/profile/${contributor}?keywords=${keywords}`; if (popoverData.filter(index => index[contributor]).length === 0) { fetch(contributorURL, { method: 'GET' }) @@ -85,4 +87,4 @@ function openContributorPopOver(contributor, element) { }); $(element).popover('show'); } -} \ No newline at end of file +} diff --git a/app/dashboard/templates/bounty/details.html b/app/dashboard/templates/bounty/details.html index 297ffead966..882b2d8b4ab 100644 --- a/app/dashboard/templates/bounty/details.html +++ b/app/dashboard/templates/bounty/details.html @@ -488,6 +488,9 @@

{{ noscript.keywords }}

$("body").on("mouseover", "[data-username]", function(e) { openContributorPopOver($(this).data("username"), $(this)); }); + $("body").on("mouseout", "[data-username]", function(e) { + $(this).popover('dispose'); + });