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) {