From 542379d055ef6724c1919699964ec4f379785635 Mon Sep 17 00:00:00 2001 From: Aditya Anand Date: Tue, 9 Apr 2019 18:16:52 +0530 Subject: [PATCH] feat: notify funder to extend expiration date before taking action Fixes: https://github.com/gitcoinco/web/issues/4110 --- app/assets/v2/js/pages/bounty_details.js | 31 ++++++++++++++---------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/app/assets/v2/js/pages/bounty_details.js b/app/assets/v2/js/pages/bounty_details.js index 50fc027969a..1fda02a3c44 100644 --- a/app/assets/v2/js/pages/bounty_details.js +++ b/app/assets/v2/js/pages/bounty_details.js @@ -123,33 +123,38 @@ var callbacks = { '">' ]; }, 'status': function(key, val, result) { - var ui_status = val; + let ui_status = val; - if (ui_status == 'open') { + if (ui_status === 'open') { ui_status = '' + gettext('OPEN ISSUE') + ''; - let soft = result['can_submit_after_expiration_date']; + let can_submit = result['can_submit_after_expiration_date']; - if (soft && is_bounty_expired(result)) { - ui_status += '

' + + if (!isBountyOwner && can_submit && is_bounty_expired(result)) { + ui_status += '

' + gettext('This issue is past its expiration date, but it is still active.') + '
' + gettext('Check with the submitter to see if they still want to see it fulfilled.') + '

'; } - } - if (ui_status == 'started') { + } else if (ui_status === 'started') { ui_status = '' + gettext('work started') + ''; - } - if (ui_status == 'submitted') { + } else if (ui_status === 'submitted') { ui_status = '' + gettext('work submitted') + ''; - } - if (ui_status == 'done') { + } else if (ui_status === 'done') { ui_status = '' + gettext('done') + ''; - } - if (ui_status == 'cancelled') { + } else if (ui_status === 'cancelled') { ui_status = '' + gettext('cancelled') + ''; } + + if (isBountyOwner && is_bounty_expired(result) && + ui_status !== 'done' && ui_status !== 'cancelled') { + + ui_status += '

' + + 'This issue has expired. Click here to extend expiration ' + + 'before taking any bounty actions.

'; + } + return [ 'status', ui_status ]; }, 'issue_description': function(key, val, result) {