Add links to toggle WIP status (#14677)
* Add links to toggle PR WIP status * Allow PR author to toggle WIP status * refactors and restyling, remove links from translations Co-authored-by: Norwin <noerw@users.noreply.github.com> Co-authored-by: silverwind <me@silverwind.io>
This commit is contained in:
parent
6d6a65cf5c
commit
c9480c5f60
6 changed files with 59 additions and 25 deletions
|
@ -909,6 +909,17 @@ async function initRepository() {
|
|||
return false;
|
||||
});
|
||||
|
||||
// Toggle WIP
|
||||
$('.toggle-wip a, .toggle-wip button').on('click', async (e) => {
|
||||
e.preventDefault();
|
||||
const {title, wipPrefix, updateUrl} = e.currentTarget.closest('.toggle-wip').dataset;
|
||||
await $.post(updateUrl, {
|
||||
_csrf: csrf,
|
||||
title: title?.startsWith(wipPrefix) ? title.substr(wipPrefix.length).trim() : `${wipPrefix.trim()} ${title}`,
|
||||
});
|
||||
reload();
|
||||
});
|
||||
|
||||
// Issue Comments
|
||||
initIssueComments();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue