From 0b19ff40d0bea837aa01efdfb937376db19427ec Mon Sep 17 00:00:00 2001 From: Onuwa Nnachi Isaac Date: Sat, 23 Feb 2019 18:24:18 +0100 Subject: [PATCH 01/17] Add popover to details activity --- app/dashboard/templates/bounty/details.html | 24 ++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/app/dashboard/templates/bounty/details.html b/app/dashboard/templates/bounty/details.html index 231f1d6ad46..d1fe05dde7e 100644 --- a/app/dashboard/templates/bounty/details.html +++ b/app/dashboard/templates/bounty/details.html @@ -232,7 +232,7 @@
{% trans "Funder" %}
[[if activity_type != 'unknown_event']]
-
+
@@ -427,8 +427,26 @@
{% trans "Funder" %}
+ From 1da11384ec3c28b8ac2c2908995e04619ae3cb10 Mon Sep 17 00:00:00 2001 From: Onuwa Nnachi Isaac Date: Sat, 23 Feb 2019 18:51:19 +0100 Subject: [PATCH 02/17] Add contributor popover --- .../templates/shared/contributor-popover.html | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 app/dashboard/templates/shared/contributor-popover.html diff --git a/app/dashboard/templates/shared/contributor-popover.html b/app/dashboard/templates/shared/contributor-popover.html new file mode 100644 index 00000000000..ea9c197c490 --- /dev/null +++ b/app/dashboard/templates/shared/contributor-popover.html @@ -0,0 +1,60 @@ +{% comment %} + Copyright (C) 2018 Gitcoin Core + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +{% endcomment %} +{% load i18n %} +
+
+ iamonuwa + Specialty: css, javascript, react +
+ Logos here +
+
+ ~2.5 ETH earned +
+
+ #128 + Gitcoin Contributor +
+
+
+ 34 + Bounties Contributor +
+
+ 2 + Bounties In Progress +
+
+ 1 + Bounties Abandoned +
+
+ 2 + Bounties Removed +
+
+
+
+ + From 2b8de36519851ea156db41fa2984993c2bd3baad Mon Sep 17 00:00:00 2001 From: Onuwa Nnachi Isaac Date: Sun, 24 Feb 2019 12:48:06 +0100 Subject: [PATCH 03/17] Update styles --- app/assets/v2/css/base.css | 4 ++ app/assets/v2/css/bounty.css | 16 +++++++ .../templates/shared/contributor-popover.html | 44 +++++++++---------- 3 files changed, 42 insertions(+), 22 deletions(-) diff --git a/app/assets/v2/css/base.css b/app/assets/v2/css/base.css index bd2520c93c7..c5fd826d201 100644 --- a/app/assets/v2/css/base.css +++ b/app/assets/v2/css/base.css @@ -1634,6 +1634,10 @@ div.busyOverlay { max-width: 482px; } +.popover_card { + border-radius: 5px; + border: 1px solid #E5E5E5; +} /* Custom icons */ .g-icon { diff --git a/app/assets/v2/css/bounty.css b/app/assets/v2/css/bounty.css index e786b42c902..879267ce882 100644 --- a/app/assets/v2/css/bounty.css +++ b/app/assets/v2/css/bounty.css @@ -468,6 +468,22 @@ a.btn { margin-bottom: 2em; } +.earned { + color: #8E2ABE; +} + +.username, .contributor-position, .in-progress, .current_status { + color: #0D0764; +} + +.completed-bounties { + color: #05B66A; +} + +.abandoned-bounties, .removed-bounties { + color: #F5A623; +} + .code-snippet { background-color: #F2F6F9; padding: 1rem; diff --git a/app/dashboard/templates/shared/contributor-popover.html b/app/dashboard/templates/shared/contributor-popover.html index ea9c197c490..b8361066213 100644 --- a/app/dashboard/templates/shared/contributor-popover.html +++ b/app/dashboard/templates/shared/contributor-popover.html @@ -17,34 +17,34 @@ {% load i18n %}
- iamonuwa - Specialty: css, javascript, react + [[:name]] + Specialty: css, javascript, react
Logos here
- ~2.5 ETH earned + ~2.5 ETH earned
-
- #128 - Gitcoin Contributor +
+ #128 +

Gitcoin Contributor

-
- 34 - Bounties Contributor +
+ 34 +

Bounties Completed

-
- 2 - Bounties In Progress +
+ 2 +

Bounties In Progress

-
- 1 - Bounties Abandoned +
+ 1 +

Bounties Abandoned

-
- 2 - Bounties Removed +
+ 2 +

Bounties Removed

@@ -52,9 +52,9 @@ From 8f250803589fafdacd24d56ca296ff47d30f6987 Mon Sep 17 00:00:00 2001 From: Onuwa Nnachi Isaac Date: Tue, 5 Mar 2019 17:29:21 +0100 Subject: [PATCH 04/17] Update query --- app/app/urls.py | 1 + app/dashboard/templates/bounty/details.html | 20 ++++++++++++++----- .../templates/shared/contributor-popover.html | 2 +- app/dashboard/views.py | 20 +++++++++++++++++++ 4 files changed, 37 insertions(+), 6 deletions(-) diff --git a/app/app/urls.py b/app/app/urls.py index c2d33c8a6bd..044e8e35e81 100644 --- a/app/app/urls.py +++ b/app/app/urls.py @@ -90,6 +90,7 @@ # api views url(r'^api/v0.1/profile/(.*)?/keywords', dashboard.views.profile_keywords, name='profile_keywords'), + url(r'^api/v0.1/profile/(?P.*)', dashboard.views.profile_details, name='profile_details'), url( r'^api/v0.1/social_contribution_email', dashboard.views.social_contribution_email, diff --git a/app/dashboard/templates/bounty/details.html b/app/dashboard/templates/bounty/details.html index d1fe05dde7e..d53bef803e5 100644 --- a/app/dashboard/templates/bounty/details.html +++ b/app/dashboard/templates/bounty/details.html @@ -232,7 +232,7 @@
{% trans "Funder" %}
[[if activity_type != 'unknown_event']]
-
+
@@ -427,11 +427,10 @@
{% trans "Funder" %}
diff --git a/app/dashboard/templates/shared/contributor-popover.html b/app/dashboard/templates/shared/contributor-popover.html index b8361066213..8ca5f6362b1 100644 --- a/app/dashboard/templates/shared/contributor-popover.html +++ b/app/dashboard/templates/shared/contributor-popover.html @@ -20,7 +20,7 @@ [[:name]] Specialty: css, javascript, react
- Logos here + {{ json.status }}
~2.5 ETH earned diff --git a/app/dashboard/views.py b/app/dashboard/views.py index 4f96a49047e..1f71072ffff 100644 --- a/app/dashboard/views.py +++ b/app/dashboard/views.py @@ -1305,6 +1305,26 @@ def profile_keywords(request, handle): return JsonResponse(response) +def profile_details(request, handle): + """Display profile details. + + Args: + handle (str): The profile handle. + + """ + try: + profile = profile_helper(handle, True) + except (ProfileNotFoundException, ProfileHiddenException): + raise Http404 + + response = { + 'status': 200, + 'keywords': profile.keywords, + } + return JsonResponse(response) + + + @require_POST def profile_job_opportunity(request, handle): """ Save profile job opportunity. From f1e469fdba89a9adcc2e88ad9e1834be245529d2 Mon Sep 17 00:00:00 2001 From: Onuwa Nnachi Isaac Date: Wed, 6 Mar 2019 19:38:03 +0100 Subject: [PATCH 05/17] Bind fetched data to UI --- app/dashboard/models.py | 7 +++++- app/dashboard/templates/bounty/details.html | 9 +++++++ .../templates/shared/contributor-popover.html | 25 ++++++++++--------- app/dashboard/views.py | 19 ++++++++++++-- 4 files changed, 45 insertions(+), 15 deletions(-) diff --git a/app/dashboard/models.py b/app/dashboard/models.py index 2d60b4aafba..2898badaf65 100644 --- a/app/dashboard/models.py +++ b/app/dashboard/models.py @@ -2703,12 +2703,17 @@ def to_representation(self, instance): dict: The serialized Profile. """ + return { 'id': instance.id, 'handle': instance.handle, 'github_url': instance.github_url, 'avatar_url': instance.avatar_url, - 'url': instance.get_relative_url() + 'keywords': instance.keywords, + 'url': instance.get_relative_url(), + 'position': instance.get_contributor_leaderboard_index(), + 'organizations': instance.get_who_works_with(), + 'total_earned': instance.get_eth_sum() } diff --git a/app/dashboard/templates/bounty/details.html b/app/dashboard/templates/bounty/details.html index d53bef803e5..d36b0f73b38 100644 --- a/app/dashboard/templates/bounty/details.html +++ b/app/dashboard/templates/bounty/details.html @@ -452,6 +452,15 @@

}).then(function(response) { return response.json(); }).then(function(json) { + $('.earned').html('~' + json.profile.total_earned + ' ETH earned') + $('.contributor-position').html(json.profile.position) + $('.completed-bounties').html(json.statistics.work_completed) + $('.in-progress').html(json.statistics.work_in_progress) + $('.abandoned-bounties').html(json.statistics.work_abandoned) + $('.removed-bounties').html(json.statistics.work_removed) + $('.activity-title').html(json.recent_activity.activity_metadata.title) + $('.current_status').html(json.recent_activity.activity_type) + $('.time-ago').html(json.recent_activity.created) return json; }).catch(function(err) { console.log(err) diff --git a/app/dashboard/templates/shared/contributor-popover.html b/app/dashboard/templates/shared/contributor-popover.html index 8ca5f6362b1..d2e6c88fb4e 100644 --- a/app/dashboard/templates/shared/contributor-popover.html +++ b/app/dashboard/templates/shared/contributor-popover.html @@ -17,33 +17,33 @@ {% load i18n %}
- [[:name]] +

[[:name]]

Specialty: css, javascript, react
- {{ json.status }} +
- ~2.5 ETH earned +
- #128 +

Gitcoin Contributor

- 34 +

Bounties Completed

- 2 +

Bounties In Progress

- 1 +

Bounties Abandoned

- 2 +

Bounties Removed

@@ -52,9 +52,10 @@ diff --git a/app/dashboard/views.py b/app/dashboard/views.py index 1f71072ffff..33f868fa656 100644 --- a/app/dashboard/views.py +++ b/app/dashboard/views.py @@ -1295,12 +1295,27 @@ def profile_keywords(request, handle): """ try: profile = profile_helper(handle, True) + activity = Activity.objects.filter(profile=profile).order_by('-created_on').last() + count_work_completed = Activity.objects.filter(profile=profile, activity_type='work_done').count() + count_work_in_progress = Activity.objects.filter(profile=profile, activity_type='start_work').count() + count_work_abandoned = Activity.objects.filter(profile=profile, activity_type='stop_work').count() + count_work_removed = Activity.objects.filter(profile=profile, activity_type='bounty_removed_by_funder').count() except (ProfileNotFoundException, ProfileHiddenException): raise Http404 response = { - 'status': 200, - 'keywords': profile.keywords, + 'profile': ProfileSerializer(profile).data, + 'recent_activity': { + 'activity_metadata': activity.metadata, + 'activity_type': activity.activity_type, + 'created': activity.created, + }, + 'statistics': { + 'work_completed': count_work_completed, + 'work_in_progress': count_work_in_progress, + 'work_abandoned': count_work_abandoned, + 'work_removed': count_work_removed + } } return JsonResponse(response) From 0be002d2c328b4f78e60641902437617a3115ab7 Mon Sep 17 00:00:00 2001 From: Onuwa Nnachi Isaac Date: Thu, 7 Mar 2019 15:57:48 +0100 Subject: [PATCH 06/17] Update UI --- app/dashboard/templates/bounty/details.html | 9 +++--- .../templates/shared/contributor-popover.html | 30 +++++++++---------- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/app/dashboard/templates/bounty/details.html b/app/dashboard/templates/bounty/details.html index d36b0f73b38..2c0ee51b316 100644 --- a/app/dashboard/templates/bounty/details.html +++ b/app/dashboard/templates/bounty/details.html @@ -453,17 +453,18 @@

return response.json(); }).then(function(json) { $('.earned').html('~' + json.profile.total_earned + ' ETH earned') - $('.contributor-position').html(json.profile.position) + $('.contributor-position').html('#' + json.profile.position) $('.completed-bounties').html(json.statistics.work_completed) + $('.specialty').html('Specialty: ' + json.profile.keywords.slice(0, 3).toString()) $('.in-progress').html(json.statistics.work_in_progress) $('.abandoned-bounties').html(json.statistics.work_abandoned) $('.removed-bounties').html(json.statistics.work_removed) $('.activity-title').html(json.recent_activity.activity_metadata.title) $('.current_status').html(json.recent_activity.activity_type) - $('.time-ago').html(json.recent_activity.created) - return json; + $('.time-ago').html(moment(json.recent_activity.created, 'YYYYMMDD').fromNow()) }).catch(function(err) { - console.log(err) + $('body').popover('hide') + return _alert({ message: err }, 'error'); }) }) diff --git a/app/dashboard/templates/shared/contributor-popover.html b/app/dashboard/templates/shared/contributor-popover.html index d2e6c88fb4e..0f86c896abb 100644 --- a/app/dashboard/templates/shared/contributor-popover.html +++ b/app/dashboard/templates/shared/contributor-popover.html @@ -17,33 +17,33 @@ {% load i18n %}
-

[[:name]]

- Specialty: css, javascript, react +

[[:name]]

+
- +
-
- +
+

Gitcoin Contributor

-
- +
+

Bounties Completed

-
- +
+

Bounties In Progress

-
- +
+

Bounties Abandoned

-
- +
+

Bounties Removed

@@ -52,8 +52,8 @@

[[:name]]

` }) + function currentStatus(status) { + if (status === 'worker_applied') { + return 'Work Applied'; + } else if (status === 'start_work') { + return 'Work Started'; + } else if (status === 'stop_work') { + return 'Work Stopped'; + } else { + return status; + } + } + function convertToImage(images) { + var a = []; + $.each(images, function(image) { + var image_url = "/dynamic/avatar/"+image; + var link = "\"""; + a.push(link); + }) + return a; + } diff --git a/app/dashboard/templates/shared/contributor-popover.html b/app/dashboard/templates/shared/contributor-popover.html index 0f86c896abb..329f73003db 100644 --- a/app/dashboard/templates/shared/contributor-popover.html +++ b/app/dashboard/templates/shared/contributor-popover.html @@ -18,10 +18,8 @@

[[:name]]

- -
- -
+ +
diff --git a/app/dashboard/views.py b/app/dashboard/views.py index 52403525d49..e44b0d146ab 100644 --- a/app/dashboard/views.py +++ b/app/dashboard/views.py @@ -1318,7 +1318,7 @@ def profile_keywords(request, handle): 'work_removed': count_work_removed } } - return JsonResponse(response) + return JsonResponse(response, safe=False) def profile_details(request, handle): From d3646045f9b8e125cd11c2b4a04144a77880e274 Mon Sep 17 00:00:00 2001 From: Onuwa Nnachi Isaac Date: Mon, 1 Apr 2019 16:40:02 +0100 Subject: [PATCH 09/17] Update changes --- app/dashboard/models.py | 2 +- app/dashboard/templates/bounty/details.html | 14 +++++++------- app/dashboard/views.py | 1 - 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/app/dashboard/models.py b/app/dashboard/models.py index e91a09f27d4..2898badaf65 100644 --- a/app/dashboard/models.py +++ b/app/dashboard/models.py @@ -2445,7 +2445,7 @@ def get_eth_sum(self, sum_type='collected', network='mainnet', bounties=None): return eth_sum - def get_who_works_with(self, work_type='collected', network='rinkeby', bounties=None): + def get_who_works_with(self, work_type='collected', network='mainnet', bounties=None): """Get an array of profiles that this user works with. Args: diff --git a/app/dashboard/templates/bounty/details.html b/app/dashboard/templates/bounty/details.html index a5182942a51..409d6c45862 100644 --- a/app/dashboard/templates/bounty/details.html +++ b/app/dashboard/templates/bounty/details.html @@ -427,8 +427,8 @@
{% trans "Funder" %}
+ From c3b9b62158ecf2e55f0fb8d378662043afc912ce Mon Sep 17 00:00:00 2001 From: Onuwa Nnachi Isaac Date: Tue, 23 Apr 2019 04:31:25 +0100 Subject: [PATCH 13/17] Remove unnecessary function --- app/assets/v2/js/user_popover.js | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/app/assets/v2/js/user_popover.js b/app/assets/v2/js/user_popover.js index 1260ba6b62f..dbc1f5f66e6 100644 --- a/app/assets/v2/js/user_popover.js +++ b/app/assets/v2/js/user_popover.js @@ -10,9 +10,10 @@ const renderPopOverData = json => { Specialty: ${json.profile.keywords .slice(0, 3) .toString()} -
${convertToImage( - json.profile.organizations - )}
+ ${Object.keys(json.profile.organizations).map( + org => + `${org}` + )}
~ ${ json.profile.total_earned @@ -120,15 +121,4 @@ const currentStatus = status => { return 'Submitted Work'; } return status; - -}; -const convertToImage = images => { - let a = []; - - $.each(images, image => { - let link = `${image}`; - - a.push(link); - }); - return a; }; From a7d5b8bbe55cddb252a13beafa68b2df0ca06ba8 Mon Sep 17 00:00:00 2001 From: Onuwa Nnachi Isaac Date: Tue, 23 Apr 2019 04:36:45 +0100 Subject: [PATCH 14/17] Remove contributor-popover.html --- .../templates/shared/contributor-popover.html | 59 ------------------- 1 file changed, 59 deletions(-) delete mode 100644 app/dashboard/templates/shared/contributor-popover.html diff --git a/app/dashboard/templates/shared/contributor-popover.html b/app/dashboard/templates/shared/contributor-popover.html deleted file mode 100644 index dc8054fc6ce..00000000000 --- a/app/dashboard/templates/shared/contributor-popover.html +++ /dev/null @@ -1,59 +0,0 @@ -{% comment %} - Copyright (C) 2018 Gitcoin Core - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . -{% endcomment %} -{% load i18n %} -
-
-

- -
-
- -
-
- -

Gitcoin Contributor

-
-
-
- -

Bounties Completed

-
-
- -

Bounties In Progress

-
-
- -

Bounties Abandoned

-
-
- -

Bounties Removed

-
-
-
-
- - From 4d57e5f8d15417e7fbb8615082f6cb96a459a492 Mon Sep 17 00:00:00 2001 From: Onuwa Nnachi Isaac Date: Tue, 23 Apr 2019 04:51:57 +0100 Subject: [PATCH 15/17] Update changes --- app/assets/v2/js/user_popover.js | 39 ++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/app/assets/v2/js/user_popover.js b/app/assets/v2/js/user_popover.js index dbc1f5f66e6..786bb31e18d 100644 --- a/app/assets/v2/js/user_popover.js +++ b/app/assets/v2/js/user_popover.js @@ -108,17 +108,28 @@ const openContributorPopOver = (contributor, element) => { } }; -const currentStatus = status => { - if (status === 'worker_applied') { - return 'Work Applied'; - } else if (status === 'start_work') { - return 'Work Started'; - } else if (status === 'worker_approved') { - return 'Worker Approved'; - } else if (status === 'stop_work') { - return 'Stopped Work'; - } else if (status === 'work_submitted') { - return 'Submitted Work'; - } - return status; -}; +const currentStatus = (status) => { + const activity_names = { + new_bounty: gettext('New Bounty'), + start_work: gettext('Work Started'), + stop_work: gettext('Work Stopped'), + work_submitted: gettext('Work Submitted'), + work_done: gettext('Work Done'), + worker_approved: gettext('Worker Approved'), + worker_rejected: gettext('Worker Rejected'), + worker_applied: gettext('Worker Applied'), + increased_bounty: gettext('Increased Funding'), + killed_bounty: gettext('Canceled Bounty'), + new_crowdfund: gettext('New Crowdfund Contribution'), + new_tip: gettext('New Tip'), + receive_tip: gettext('Tip Received'), + bounty_abandonment_escalation_to_mods: gettext('Escalated for Abandonment of Bounty'), + bounty_abandonment_warning: gettext('Warned for Abandonment of Bounty'), + bounty_removed_slashed_by_staff: gettext('Dinged and Removed from Bounty by Staff'), + bounty_removed_by_staff: gettext('Removed from Bounty by Staff'), + bounty_removed_by_funder: gettext('Removed from Bounty by Funder'), + bounty_changed: gettext('Bounty Details Changed'), + extend_expiration: gettext('Extended Bounty Expiration') + }; + return activity_names[status] || 'Unknown activity '; + } From 7dc0fa87ad63c29c773f412d3319778b531615cf Mon Sep 17 00:00:00 2001 From: Onuwa Nnachi Isaac Date: Tue, 23 Apr 2019 09:36:46 +0100 Subject: [PATCH 16/17] Indent script --- app/assets/v2/js/user_popover.js | 123 ++++++++++++++++--------------- 1 file changed, 64 insertions(+), 59 deletions(-) diff --git a/app/assets/v2/js/user_popover.js b/app/assets/v2/js/user_popover.js index 786bb31e18d..34edf989d5a 100644 --- a/app/assets/v2/js/user_popover.js +++ b/app/assets/v2/js/user_popover.js @@ -5,49 +5,49 @@ const renderPopOverData = json => {

${ - json.profile.handle -}

+ json.profile.handle + } Specialty: ${json.profile.keywords - .slice(0, 3) - .toString()} + .slice(0, 3) + .toString()} ${Object.keys(json.profile.organizations).map( - org => - `${org}` - )} + org => + `${org}` + )}
~ ${ - json.profile.total_earned -} ETH earned + json.profile.total_earned + } ETH earned
#${ - json.profile.position -} + json.profile.position + }

Gitcoin Contributor

${ - json.statistics.work_completed -} + json.statistics.work_completed + }

Bounties Completed

${ - json.statistics.work_in_progress -} + json.statistics.work_in_progress + }

Bounties In Progress

${ - json.statistics.work_abandoned -} + json.statistics.work_abandoned + }

Bounties Abandoned

${ - json.statistics.work_removed -} + json.statistics.work_removed + }

Bounties Removed

@@ -58,17 +58,17 @@ const renderPopOverData = json => {
Latest Activity ${currentStatus( - json.recent_activity.activity_type - )} + json.recent_activity.activity_type + )} ${moment( - json.recent_activity.created, - 'YYYYMMDD' - ).fromNow()} + json.recent_activity.created, + "YYYYMMDD" + ).fromNow()}

${ - json.recent_activity.activity_metadata.title -}

+ json.recent_activity.activity_metadata.title + }

`; }; @@ -76,27 +76,27 @@ const openContributorPopOver = (contributor, element) => { let contributorURL = `/api/v0.1/profile/${contributor}`; if (popoverData.filter(index => index[contributor]).length === 0) { - fetch(contributorURL, { method: 'GET' }) + fetch(contributorURL, { method: "GET" }) .then(response => response.json()) .then(response => { element.popover({ - placement: 'auto', - trigger: 'hover', + placement: "auto", + trigger: "hover", template: '', content: renderPopOverData(response), html: true }); - $(element).popover('show'); + $(element).popover("show"); popoverData.push({ [contributor]: response }); }) .catch(err => { - return _alert({ message: err }, 'error'); + return _alert({ message: err }, "error"); }); } else { element.popover({ - placement: 'auto', - trigger: 'hover', + placement: "auto", + trigger: "hover", template: '', content: renderPopOverData( @@ -104,32 +104,37 @@ const openContributorPopOver = (contributor, element) => { ), html: true }); - $(element).popover('show'); + $(element).popover("show"); } }; -const currentStatus = (status) => { - const activity_names = { - new_bounty: gettext('New Bounty'), - start_work: gettext('Work Started'), - stop_work: gettext('Work Stopped'), - work_submitted: gettext('Work Submitted'), - work_done: gettext('Work Done'), - worker_approved: gettext('Worker Approved'), - worker_rejected: gettext('Worker Rejected'), - worker_applied: gettext('Worker Applied'), - increased_bounty: gettext('Increased Funding'), - killed_bounty: gettext('Canceled Bounty'), - new_crowdfund: gettext('New Crowdfund Contribution'), - new_tip: gettext('New Tip'), - receive_tip: gettext('Tip Received'), - bounty_abandonment_escalation_to_mods: gettext('Escalated for Abandonment of Bounty'), - bounty_abandonment_warning: gettext('Warned for Abandonment of Bounty'), - bounty_removed_slashed_by_staff: gettext('Dinged and Removed from Bounty by Staff'), - bounty_removed_by_staff: gettext('Removed from Bounty by Staff'), - bounty_removed_by_funder: gettext('Removed from Bounty by Funder'), - bounty_changed: gettext('Bounty Details Changed'), - extend_expiration: gettext('Extended Bounty Expiration') - }; - return activity_names[status] || 'Unknown activity '; - } +const currentStatus = status => { + const activity_names = { + new_bounty: gettext("New Bounty"), + start_work: gettext("Work Started"), + stop_work: gettext("Work Stopped"), + work_submitted: gettext("Work Submitted"), + work_done: gettext("Work Done"), + worker_approved: gettext("Worker Approved"), + worker_rejected: gettext("Worker Rejected"), + worker_applied: gettext("Worker Applied"), + increased_bounty: gettext("Increased Funding"), + killed_bounty: gettext("Canceled Bounty"), + new_crowdfund: gettext("New Crowdfund Contribution"), + new_tip: gettext("New Tip"), + receive_tip: gettext("Tip Received"), + bounty_abandonment_escalation_to_mods: gettext( + "Escalated for Abandonment of Bounty" + ), + bounty_abandonment_warning: gettext("Warned for Abandonment of Bounty"), + bounty_removed_slashed_by_staff: gettext( + "Dinged and Removed from Bounty by Staff" + ), + bounty_removed_by_staff: gettext("Removed from Bounty by Staff"), + bounty_removed_by_funder: gettext("Removed from Bounty by Funder"), + bounty_changed: gettext("Bounty Details Changed"), + extend_expiration: gettext("Extended Bounty Expiration") + }; + + return activity_names[status] || "Unknown activity "; +}; From 0095d4c2a4ca108929ba330da62fa27df201e087 Mon Sep 17 00:00:00 2001 From: Onuwa Nnachi Isaac Date: Tue, 23 Apr 2019 14:36:56 +0100 Subject: [PATCH 17/17] Fix lint indentation --- app/assets/v2/js/user_popover.js | 110 +++++++++++++++---------------- 1 file changed, 55 insertions(+), 55 deletions(-) diff --git a/app/assets/v2/js/user_popover.js b/app/assets/v2/js/user_popover.js index 34edf989d5a..5ce9d054cd1 100644 --- a/app/assets/v2/js/user_popover.js +++ b/app/assets/v2/js/user_popover.js @@ -5,49 +5,49 @@ const renderPopOverData = json => {

${ - json.profile.handle - }

+ json.profile.handle +} Specialty: ${json.profile.keywords - .slice(0, 3) - .toString()} + .slice(0, 3) + .toString()} ${Object.keys(json.profile.organizations).map( - org => - `${org}` - )} + org => + `${org}` + )}
~ ${ - json.profile.total_earned - } ETH earned + json.profile.total_earned +} ETH earned
#${ - json.profile.position - } + json.profile.position +}

Gitcoin Contributor

${ - json.statistics.work_completed - } + json.statistics.work_completed +}

Bounties Completed

${ - json.statistics.work_in_progress - } + json.statistics.work_in_progress +}

Bounties In Progress

${ - json.statistics.work_abandoned - } + json.statistics.work_abandoned +}

Bounties Abandoned

${ - json.statistics.work_removed - } + json.statistics.work_removed +}

Bounties Removed

@@ -58,17 +58,17 @@ const renderPopOverData = json => {
Latest Activity ${currentStatus( - json.recent_activity.activity_type - )} + json.recent_activity.activity_type + )} ${moment( - json.recent_activity.created, - "YYYYMMDD" - ).fromNow()} + json.recent_activity.created, + 'YYYYMMDD' + ).fromNow()}

${ - json.recent_activity.activity_metadata.title - }

+ json.recent_activity.activity_metadata.title +}

`; }; @@ -76,27 +76,27 @@ const openContributorPopOver = (contributor, element) => { let contributorURL = `/api/v0.1/profile/${contributor}`; if (popoverData.filter(index => index[contributor]).length === 0) { - fetch(contributorURL, { method: "GET" }) + fetch(contributorURL, { method: 'GET' }) .then(response => response.json()) .then(response => { element.popover({ - placement: "auto", - trigger: "hover", + placement: 'auto', + trigger: 'hover', template: '', content: renderPopOverData(response), html: true }); - $(element).popover("show"); + $(element).popover('show'); popoverData.push({ [contributor]: response }); }) .catch(err => { - return _alert({ message: err }, "error"); + return _alert({ message: err }, 'error'); }); } else { element.popover({ - placement: "auto", - trigger: "hover", + placement: 'auto', + trigger: 'hover', template: '', content: renderPopOverData( @@ -104,37 +104,37 @@ const openContributorPopOver = (contributor, element) => { ), html: true }); - $(element).popover("show"); + $(element).popover('show'); } }; const currentStatus = status => { const activity_names = { - new_bounty: gettext("New Bounty"), - start_work: gettext("Work Started"), - stop_work: gettext("Work Stopped"), - work_submitted: gettext("Work Submitted"), - work_done: gettext("Work Done"), - worker_approved: gettext("Worker Approved"), - worker_rejected: gettext("Worker Rejected"), - worker_applied: gettext("Worker Applied"), - increased_bounty: gettext("Increased Funding"), - killed_bounty: gettext("Canceled Bounty"), - new_crowdfund: gettext("New Crowdfund Contribution"), - new_tip: gettext("New Tip"), - receive_tip: gettext("Tip Received"), + new_bounty: gettext('New Bounty'), + start_work: gettext('Work Started'), + stop_work: gettext('Work Stopped'), + work_submitted: gettext('Work Submitted'), + work_done: gettext('Work Done'), + worker_approved: gettext('Worker Approved'), + worker_rejected: gettext('Worker Rejected'), + worker_applied: gettext('Worker Applied'), + increased_bounty: gettext('Increased Funding'), + killed_bounty: gettext('Canceled Bounty'), + new_crowdfund: gettext('New Crowdfund Contribution'), + new_tip: gettext('New Tip'), + receive_tip: gettext('Tip Received'), bounty_abandonment_escalation_to_mods: gettext( - "Escalated for Abandonment of Bounty" + 'Escalated for Abandonment of Bounty' ), - bounty_abandonment_warning: gettext("Warned for Abandonment of Bounty"), + bounty_abandonment_warning: gettext('Warned for Abandonment of Bounty'), bounty_removed_slashed_by_staff: gettext( - "Dinged and Removed from Bounty by Staff" + 'Dinged and Removed from Bounty by Staff' ), - bounty_removed_by_staff: gettext("Removed from Bounty by Staff"), - bounty_removed_by_funder: gettext("Removed from Bounty by Funder"), - bounty_changed: gettext("Bounty Details Changed"), - extend_expiration: gettext("Extended Bounty Expiration") + bounty_removed_by_staff: gettext('Removed from Bounty by Staff'), + bounty_removed_by_funder: gettext('Removed from Bounty by Funder'), + bounty_changed: gettext('Bounty Details Changed'), + extend_expiration: gettext('Extended Bounty Expiration') }; - return activity_names[status] || "Unknown activity "; + return activity_names[status] || 'Unknown activity '; };