From b66afeb00a1d35d3fa17d2bf0ddafffa5d038afb Mon Sep 17 00:00:00 2001 From: Jimmy Praet Date: Sat, 13 Feb 2021 23:25:35 +0100 Subject: [PATCH 01/14] Add links to toggle PR WIP status --- options/locale/locale_en-US.ini | 4 +++- routers/repo/pull.go | 2 ++ templates/repo/issue/view_content/pull.tmpl | 7 +++++-- templates/repo/issue/view_content/sidebar.tmpl | 3 +++ web_src/js/index.js | 14 ++++++++++++++ 5 files changed, 27 insertions(+), 3 deletions(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 767696cfb901c..ca6c063414555 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -1266,7 +1266,9 @@ pulls.merged_as = The pull request has been merged as Start the title with %s to prevent the pull request from being merged accidentally.` -pulls.cannot_merge_work_in_progress = This pull request is marked as a work in progress. Remove the %s prefix from the title when it's ready +pulls.cannot_merge_work_in_progress = This pull request is marked as a work in progress. +pulls.remove_wip_prefix = `Remove the %s prefix from the title when it's ready` +pulls.add_wip_prefix = `Still in progress? Add %s prefix` pulls.data_broken = This pull request is broken due to missing fork information. pulls.files_conflicted = This pull request has changes conflicting with the target branch. pulls.is_checking = "Merge conflict checking is in progress. Try again in few moments." diff --git a/routers/repo/pull.go b/routers/repo/pull.go index d3dd9e4fb5442..468142e8fb409 100644 --- a/routers/repo/pull.go +++ b/routers/repo/pull.go @@ -516,6 +516,8 @@ func PrepareViewPullInfo(ctx *context.Context, issue *models.Issue) *git.Compare return nil } + ctx.Data["PullRequestWorkInProgressPrefixes"] = setting.Repository.PullRequest.WorkInProgressPrefixes + if pull.IsWorkInProgress() { ctx.Data["IsPullWorkInProgress"] = true ctx.Data["WorkInProgressPrefix"] = pull.GetWorkInProgressPrefix() diff --git a/templates/repo/issue/view_content/pull.tmpl b/templates/repo/issue/view_content/pull.tmpl index 9e883c0a9352d..739c2cd3df507 100644 --- a/templates/repo/issue/view_content/pull.tmpl +++ b/templates/repo/issue/view_content/pull.tmpl @@ -167,9 +167,12 @@ {{$.i18n.Tr "repo.pulls.data_broken"}} {{else if .IsPullWorkInProgress}} -
+
{{svg "octicon-x"}} - {{$.i18n.Tr "repo.pulls.cannot_merge_work_in_progress" (.WorkInProgressPrefix|Escape) | Str2html}} + {{$.i18n.Tr "repo.pulls.cannot_merge_work_in_progress" }} + {{if .HasIssuesOrPullsWritePermission}} + {{$.i18n.Tr "repo.pulls.remove_wip_prefix" (.WorkInProgressPrefix|Escape) | Safe}} + {{end}}
{{else if .Issue.PullRequest.IsChecking}}
diff --git a/templates/repo/issue/view_content/sidebar.tmpl b/templates/repo/issue/view_content/sidebar.tmpl index 3a21a9271b2a2..aefc6ae5d8ae1 100644 --- a/templates/repo/issue/view_content/sidebar.tmpl +++ b/templates/repo/issue/view_content/sidebar.tmpl @@ -91,6 +91,9 @@ {{end}}
+ {{if and (not .IsPullWorkInProgress) .HasIssuesOrPullsWritePermission}} +
{{.i18n.Tr "repo.pulls.add_wip_prefix" (index .PullRequestWorkInProgressPrefixes 0| Escape) | Safe}}
+ {{end}}
{{end}} diff --git a/web_src/js/index.js b/web_src/js/index.js index 0d60c21ccacc1..eca6c75ccaba4 100644 --- a/web_src/js/index.js +++ b/web_src/js/index.js @@ -906,6 +906,20 @@ async function initRepository() { return false; }); + // Toggle WIP + $('.toggle-wip a').on('click', (e) => { + e.preventDefault(); + const $toggle = $(e.target).closest('div'); + const title = $toggle.data('title'); + const prefix = $toggle.data('wip-prefix'); + const newTitle = title.startsWith(prefix) ? title.substr(prefix.length).trim() : `${prefix.trim()} ${title}`; + $.post($toggle.data('update-url'), { + _csrf: csrf, + title: newTitle + }).done(reload); + return false; + }); + // Issue Comments initIssueComments(); From caf2854fb0ec2944e639c7525b0e30111b9194b7 Mon Sep 17 00:00:00 2001 From: Jimmy Praet Date: Sat, 13 Feb 2021 23:27:05 +0100 Subject: [PATCH 02/14] extract remove_wip_prefix translation message --- options/locale/locale_bg-BG.ini | 3 ++- options/locale/locale_cs-CZ.ini | 3 ++- options/locale/locale_de-DE.ini | 3 ++- options/locale/locale_es-ES.ini | 3 ++- options/locale/locale_fr-FR.ini | 3 ++- options/locale/locale_it-IT.ini | 3 ++- options/locale/locale_ja-JP.ini | 3 ++- options/locale/locale_lv-LV.ini | 3 ++- options/locale/locale_nl-NL.ini | 3 ++- options/locale/locale_pl-PL.ini | 3 ++- options/locale/locale_pt-BR.ini | 3 ++- options/locale/locale_pt-PT.ini | 3 ++- options/locale/locale_ru-RU.ini | 3 ++- options/locale/locale_sv-SE.ini | 3 ++- options/locale/locale_tr-TR.ini | 3 ++- options/locale/locale_uk-UA.ini | 3 ++- options/locale/locale_zh-CN.ini | 3 ++- options/locale/locale_zh-TW.ini | 3 ++- 18 files changed, 36 insertions(+), 18 deletions(-) diff --git a/options/locale/locale_bg-BG.ini b/options/locale/locale_bg-BG.ini index cf39d391286be..7ef86c81b948e 100644 --- a/options/locale/locale_bg-BG.ini +++ b/options/locale/locale_bg-BG.ini @@ -767,7 +767,8 @@ pulls.merged_as=Тази заявка за сливане е била обеди pulls.is_closed=Тази заявка за сливане е затворена. pulls.has_merged=Тази заявка за сливане е обединена. pulls.title_wip_desc=`Започнете заглавието с %s, за да предотвратите случайно обединяване на заявката за сливане.` -pulls.cannot_merge_work_in_progress=Тази завка за сливане е отбелязане като работа в прогрес. Премахнете %s представката от заглавието, когато е готова +pulls.cannot_merge_work_in_progress=Тази завка за сливане е отбелязане като работа в прогрес. +pulls.remove_wip_prefix=`Премахнете %s представката от заглавието, когато е готова` pulls.can_auto_merge_desc=Може да се извърши обединяване на тази заявка за сливане. pulls.num_conflicting_files_1=%d конфликтен файл pulls.num_conflicting_files_n=%d конфликтни файлове diff --git a/options/locale/locale_cs-CZ.ini b/options/locale/locale_cs-CZ.ini index db444f8e20f29..e2f06472a74bf 100644 --- a/options/locale/locale_cs-CZ.ini +++ b/options/locale/locale_cs-CZ.ini @@ -1260,7 +1260,8 @@ pulls.merged_as=Požadavek na natažení byl sloučen jako Začněte název s %s a zamezíte tak nechtěnému sloučení požadavku na natažení.` -pulls.cannot_merge_work_in_progress=Požadavek na natažení je označen jako ve vývoji. Odstraňte %s prefix z titulku, až bude hotový +pulls.cannot_merge_work_in_progress=Požadavek na natažení je označen jako ve vývoji. +pulls.remove_wip_prefix=`Odstraňte %s prefix z titulku, až bude hotový` pulls.data_broken=Tento požadavek na natažení je rozbitý kvůli chybějícím informacím o rozštěpení. pulls.files_conflicted=Tento požadavek na natažení obsahuje změny, které kolidují s cílovou větví. pulls.is_checking=Právě probíhá kontrola konfliktů při sloučení. Zkuste to za chvíli. diff --git a/options/locale/locale_de-DE.ini b/options/locale/locale_de-DE.ini index ee9e9dc678b3e..e2f730a6b17f1 100644 --- a/options/locale/locale_de-DE.ini +++ b/options/locale/locale_de-DE.ini @@ -1255,7 +1255,8 @@ pulls.merged_as=Der Pull Request wurde als Beginne den Titel mit %s um zu verhindern, dass der Pull Request versehentlich gemergt wird.` -pulls.cannot_merge_work_in_progress=Dieser Pull Request wurde als Work In Progress markiert. Entferne den %s-Präfix vom Titel, wenn dieser fertig ist. +pulls.cannot_merge_work_in_progress=Dieser Pull Request wurde als Work In Progress markiert. +pulls.remove_wip_prefix=`Entferne den %s-Präfix vom Titel, wenn dieser fertig ist.` pulls.data_broken=Dieser Pull-Requests ist kaputt, da Fork-Informationen gelöscht wurden. pulls.files_conflicted=Dieser Pull-Request hat Änderungen, die im Widerspruch zum Ziel-Branch stehen. pulls.is_checking=Die Konfliktprüfung läuft noch. Bitte aktualisiere die Seite in wenigen Augenblicken. diff --git a/options/locale/locale_es-ES.ini b/options/locale/locale_es-ES.ini index 95fe653e74c64..c43f0f04f07be 100644 --- a/options/locale/locale_es-ES.ini +++ b/options/locale/locale_es-ES.ini @@ -1241,7 +1241,8 @@ pulls.merged_as=El Pull Request se ha fusionado como Comience el título con %s para prevenir que el pull request se fusione accidentalmente.` -pulls.cannot_merge_work_in_progress=Este pull request está marcado como un trabajo en progreso. Elimine el prefijo %s del título cuando esté listo +pulls.cannot_merge_work_in_progress=Este pull request está marcado como un trabajo en progreso. +pulls.remove_wip_prefix=`Elimine el prefijo %s del título cuando esté listo` pulls.data_broken=Este pull request está rota debido a que falta información del fork. pulls.files_conflicted=Este pull request tiene cambios en conflicto con la rama de destino. pulls.is_checking=La comprobación de conflicto de fusión está en progreso. Inténtalo de nuevo en unos momentos. diff --git a/options/locale/locale_fr-FR.ini b/options/locale/locale_fr-FR.ini index 25e72f6914857..d34b99d127cd3 100644 --- a/options/locale/locale_fr-FR.ini +++ b/options/locale/locale_fr-FR.ini @@ -1088,7 +1088,8 @@ pulls.merged_as=La demande de tirage a été fusionnée en Préfixer le titre par %s pour empêcher cette demande d'ajout d'être fusionnée par erreur.` -pulls.cannot_merge_work_in_progress=Cette demande d'ajout est marquée comme en cours de chantier. Retirer le préfixe %s du titre quand elle sera prête +pulls.cannot_merge_work_in_progress=Cette demande d'ajout est marquée comme en cours de chantier. +pulls.remove_wip_prefix=`Retirer le préfixe %s du titre quand elle sera prête` pulls.data_broken=Cette demande de fusion est impossible par manque d'informations de bifurcation. pulls.files_conflicted=Cette demande d'ajout contient des modifications en conflit avec la branche ciblée. pulls.is_checking=Vérification des conflits de fusion en cours. Réessayez dans quelques instants. diff --git a/options/locale/locale_it-IT.ini b/options/locale/locale_it-IT.ini index d654172ce49bf..70860a7ebfe9a 100644 --- a/options/locale/locale_it-IT.ini +++ b/options/locale/locale_it-IT.ini @@ -1194,7 +1194,8 @@ pulls.merged_as=La pull request è stata unita come Inizia il titolo con %s per evitare che la pull request venga unita accidentalmente.` -pulls.cannot_merge_work_in_progress=Questa pull request è contrassegnata come un lavoro in corso. Rimuovi il prefisso %s dal titolo quando è pronta +pulls.cannot_merge_work_in_progress=Questa pull request è contrassegnata come un lavoro in corso. +pulls.remove_wip_prefix=`Rimuovi il prefisso %s dal titolo quando è pronta` pulls.data_broken=Questa pull request è rovinata a causa di informazioni mancanti del fork. pulls.files_conflicted=Questa pull request ha modifiche in conflitto con il branch di destinazione. pulls.is_checking=Verifica dei conflitti di merge in corso. Riprova tra qualche istante. diff --git a/options/locale/locale_ja-JP.ini b/options/locale/locale_ja-JP.ini index f33c563b8eda7..7e5c009a1f00d 100644 --- a/options/locale/locale_ja-JP.ini +++ b/options/locale/locale_ja-JP.ini @@ -1260,7 +1260,8 @@ pulls.merged_as=プルリクエストは タイトルの頭に %s を付けます。` -pulls.cannot_merge_work_in_progress=このプルリクエストはWork in Progressとマークされています。 マージできる状態になったら、タイトルから %s を消してください。 +pulls.cannot_merge_work_in_progress=このプルリクエストはWork in Progressとマークされています。 +pulls.remove_wip_prefix=`マージできる状態になったら、タイトルから %s を消してください。` pulls.data_broken=このプルリクエストは、フォークの情報が見つからないため壊れています。 pulls.files_conflicted=このプルリクエストは、ターゲットブランチと競合する変更を含んでいます。 pulls.is_checking=マージのコンフリクトを確認中です。 少し待ってからもう一度実行してください。 diff --git a/options/locale/locale_lv-LV.ini b/options/locale/locale_lv-LV.ini index 8db1862aece4c..4f6dae9347be2 100644 --- a/options/locale/locale_lv-LV.ini +++ b/options/locale/locale_lv-LV.ini @@ -1207,7 +1207,8 @@ pulls.merged_as=Izmaiņu pieprasījums tika sapludināts ar revīziju Sāciet virsrakstu ar %s, lai ierobežotu, ka izmaiņu pieprasījums netīšām tiktu sapludināts.` -pulls.cannot_merge_work_in_progress=Šis izmaiņu pieprasījums ir atzīmēts, ka pie tā vēl notiek izstrāde. Noņemiet %s no virsraksta sākuma, kad tas ir pabeigts. +pulls.cannot_merge_work_in_progress=Šis izmaiņu pieprasījums ir atzīmēts, ka pie tā vēl notiek izstrāde. +pulls.remove_wip_prefix=`Noņemiet %s no virsraksta sākuma, kad tas ir pabeigts.` pulls.data_broken=Izmaiņu pieprasījums ir bojāts, jo dzēsta informācija no atdalītā repozitorija. pulls.files_conflicted=Šīs izmaiņu pieprasījuma izmaiņas konfliktē ar mērķa atzaru. pulls.is_checking=Notiek konfliktu pārbaude, mirkli uzgaidiet un atjaunojiet lapu. diff --git a/options/locale/locale_nl-NL.ini b/options/locale/locale_nl-NL.ini index 3e52ca2de0fe0..a02e71ba2e75c 100644 --- a/options/locale/locale_nl-NL.ini +++ b/options/locale/locale_nl-NL.ini @@ -1214,7 +1214,8 @@ pulls.merged_as=De pull request is samengevoegd als Start de titel met %s om te voorkomen dat deze pull-aanvraag per ongeluk wordt samengevoegd.` -pulls.cannot_merge_work_in_progress=Deze pull-aanvraag is als "work in progress" gemarkeerd. Verwijder de %s-prefix van de titel zodra hij klaar is +pulls.cannot_merge_work_in_progress=Deze pull-aanvraag is als "work in progress" gemarkeerd. +pulls.remove_wip_prefix=`Verwijder de %s-prefix van de titel zodra hij klaar is` pulls.data_broken=Deze pull-aanvraag is ongeldig wegens missende fork-informatie. pulls.files_conflicted=Dit pull request heeft wijzigingen die strijdig zijn met de doel branch. pulls.is_checking=Controle op samenvoegingsconflicten is nog bezig. Probeer later nog een keer. diff --git a/options/locale/locale_pl-PL.ini b/options/locale/locale_pl-PL.ini index f96650e38aec9..3eaaf5515a401 100644 --- a/options/locale/locale_pl-PL.ini +++ b/options/locale/locale_pl-PL.ini @@ -1151,7 +1151,8 @@ pulls.merged_as=Pull Request został scalony jako Poprzedź tytuł przy pomocy %s, aby zapobiec przypadkowemu scaleniu tego Pull Requesta.` -pulls.cannot_merge_work_in_progress=Ten Pull Request został oznaczony jako praca w toku. Usuń prefiks %s z tytułu, kiedy będzie już gotowy. +pulls.cannot_merge_work_in_progress=Ten Pull Request został oznaczony jako praca w toku. +pulls.remove_wip_prefix=`Usuń prefiks %s z tytułu, kiedy będzie już gotowy.` pulls.data_broken=Ten Pull Request jest uszkodzony ze względu na brakujące informacje o forku. pulls.files_conflicted=Ten Pull Request zawiera zmiany konfliktujące z docelową gałęzią. pulls.is_checking=Sprawdzanie konfliktów ze scalaniem w toku. Spróbuj ponownie za chwilę. diff --git a/options/locale/locale_pt-BR.ini b/options/locale/locale_pt-BR.ini index f3ed538f3ace1..36f3dbd1ee838 100644 --- a/options/locale/locale_pt-BR.ini +++ b/options/locale/locale_pt-BR.ini @@ -1063,7 +1063,8 @@ pulls.merged_as=O pull request teve merge aplicado como Inicie o título com o prefixo %s para prevenir o merge do pull request até que o mesmo esteja pronto.` -pulls.cannot_merge_work_in_progress=Este pull request está marcado como um trabalho em andamento. Remova o prefixo %s do título quando estiver pronto +pulls.cannot_merge_work_in_progress=Este pull request está marcado como um trabalho em andamento. +pulls.remove_wip_prefix=`Remova o prefixo %s do título quando estiver pronto` pulls.data_broken=Este pull request está quebrado devido a falta de informação do fork. pulls.files_conflicted=Este pull request tem alterações conflitantes com o branch de destino. pulls.is_checking=Verificação de conflitos do merge está em andamento. Tente novamente em alguns momentos. diff --git a/options/locale/locale_pt-PT.ini b/options/locale/locale_pt-PT.ini index 3ace90e4a0f4e..286043b6f93ab 100644 --- a/options/locale/locale_pt-PT.ini +++ b/options/locale/locale_pt-PT.ini @@ -1229,7 +1229,8 @@ pulls.merged_as=A integração constante no pedido foi executada como Inicie o título com %s para evitar que o pedido de integração seja executado acidentalmente.` -pulls.cannot_merge_work_in_progress=Este pedido de integração está marcado como um trabalho em andamento. Remova o prefixo %s do título quando estiver pronto +pulls.cannot_merge_work_in_progress=Este pedido de integração está marcado como um trabalho em andamento. +pulls.remove_wip_prefix=`Remova o prefixo %s do título quando estiver pronto` pulls.data_broken=Este pedido de integração está danificado devido à falta de informação da derivação. pulls.files_conflicted=Este pedido de integração contém alterações que entram em conflito com o ramo de destino. pulls.is_checking=Está em andamento uma verificação de conflitos na integração. Tente novamente daqui a alguns momentos. diff --git a/options/locale/locale_ru-RU.ini b/options/locale/locale_ru-RU.ini index a14a2fa1a91e1..4cc76c507d2d5 100644 --- a/options/locale/locale_ru-RU.ini +++ b/options/locale/locale_ru-RU.ini @@ -1194,7 +1194,8 @@ pulls.merged_as=Pull Request был объединен как Добавьте %s в начало заголовка для защиты от случайного досрочного принятия Pull Request'а.` -pulls.cannot_merge_work_in_progress=Данный Pull Request помечен как находящийся ещё в разработке. Удалите %s из названия после завершения работы над ним +pulls.cannot_merge_work_in_progress=Данный Pull Request помечен как находящийся ещё в разработке. +pulls.remove_wip_prefix=`Удалите %s из названия после завершения работы над ним` pulls.data_broken=Содержимое этого запроса было нарушено вследствие удаления информации форка. pulls.files_conflicted=Этот Pull Request имеет изменения, конфликтующие с целевой веткой. pulls.is_checking=Продолжается проверка конфликтов, пожалуйста обновите страницу несколько позже. diff --git a/options/locale/locale_sv-SE.ini b/options/locale/locale_sv-SE.ini index 12df6146407a7..cf8ddd3ea098f 100644 --- a/options/locale/locale_sv-SE.ini +++ b/options/locale/locale_sv-SE.ini @@ -1170,7 +1170,8 @@ pulls.merged_as=Pull-förfrågan har sammanfogats som Börja titeln med %s för att förhindra att pull-förfrågan sammanfogas av misstag` -pulls.cannot_merge_work_in_progress=Denna pull-förfrågan är markerad som ett pågående arbete. Ta bort prefixet %s från titeln när den är klar +pulls.cannot_merge_work_in_progress=Denna pull-förfrågan är markerad som ett pågående arbete. +pulls.remove_wip_prefix=`Ta bort prefixet %s från titeln när den är klar` pulls.data_broken=Pull-requesten är trasig pågrund av oexisterande information on forken. pulls.files_conflicted=Den här pull-förfrågan ha ändringar som är i konflikt med mål-branchen. pulls.is_checking=Merge-konfliktkontroll pågår. Försök igen senare. diff --git a/options/locale/locale_tr-TR.ini b/options/locale/locale_tr-TR.ini index ff8ff2299e963..18ee788b4ac85 100644 --- a/options/locale/locale_tr-TR.ini +++ b/options/locale/locale_tr-TR.ini @@ -1260,7 +1260,8 @@ pulls.merged_as=Değişiklik isteği başlığı %s ile başlatın` -pulls.cannot_merge_work_in_progress=Bu değişiklik isteği devam eden bir çalışma olarak işaretlendi. Hazır olduğunda %s ön ekini başlıktan kaldırın +pulls.cannot_merge_work_in_progress=Bu değişiklik isteği devam eden bir çalışma olarak işaretlendi. +pulls.remove_wip_prefix=`Hazır olduğunda %s ön ekini başlıktan kaldırın` pulls.data_broken=Bu değişiklik isteği, çatallama bilgilerinin eksik olması nedeniyle bozuldu. pulls.files_conflicted=Bu değişiklik isteğinde, hedef dalla çakışan değişiklikler var. pulls.is_checking=Birleştirme çakışması denetimi devam ediyor. Birkaç dakika sonra tekrar deneyin. diff --git a/options/locale/locale_uk-UA.ini b/options/locale/locale_uk-UA.ini index 07f6f737e8d16..aa6fecfbee4a2 100644 --- a/options/locale/locale_uk-UA.ini +++ b/options/locale/locale_uk-UA.ini @@ -1157,7 +1157,8 @@ pulls.merged_as=Запит на злиття був влитиий як Почніть заголовок з %s щоб запобігти випадковому злиттю запитів.` -pulls.cannot_merge_work_in_progress=Цей пулл-реквест вже в стадії виконання. Видаліть префікс %s з заголовку після того як роботи будуть завершені +pulls.cannot_merge_work_in_progress=Цей пулл-реквест вже в стадії виконання. +pulls.remove_wip_prefix=`Видаліть префікс %s з заголовку після того як роботи будуть завершені` pulls.data_broken=Зміст цього запиту було порушено внаслідок видалення інформації Форком. Цей запит тягнеться через відсутність інформації про вилучення. pulls.files_conflicted=Цей запит має зміни, що конфліктують з цільовою гілкою. pulls.is_checking=Триває перевірка конфліктів, будь ласка обновіть сторінку дещо пізніше. diff --git a/options/locale/locale_zh-CN.ini b/options/locale/locale_zh-CN.ini index 7f5457d09cbd0..f7f29c84049ec 100644 --- a/options/locale/locale_zh-CN.ini +++ b/options/locale/locale_zh-CN.ini @@ -1231,7 +1231,8 @@ pulls.merged_as=该合并请求已作为 标题以 %s 开头以免合并请求意外合并。` -pulls.cannot_merge_work_in_progress=这个合并请求被标记为尚未完成的工作。完成后请从标题中移除%s前缀。 +pulls.cannot_merge_work_in_progress=这个合并请求被标记为尚未完成的工作。 +pulls.remove_wip_prefix=`完成后请从标题中移除%s前缀。` pulls.data_broken=此合并请求因为派生仓库信息缺失而中断。 pulls.files_conflicted=此合并请求有变更与目标分支冲突。 pulls.is_checking=正在进行合并冲突检测,请稍后再试。 diff --git a/options/locale/locale_zh-TW.ini b/options/locale/locale_zh-TW.ini index a0b298a2756fb..eab99eadd6673 100644 --- a/options/locale/locale_zh-TW.ini +++ b/options/locale/locale_zh-TW.ini @@ -1264,7 +1264,8 @@ pulls.merged_as=此合併請求已被合併為 標題用 %s 開頭以避免意外地合併此合併請求。` -pulls.cannot_merge_work_in_progress=此合併請求被標記為仍在作業中。準備好要合併時請移除 %s 前綴。 +pulls.cannot_merge_work_in_progress=此合併請求被標記為仍在作業中。 +pulls.remove_wip_prefix=`準備好要合併時請移除 %s 前綴。` pulls.data_broken=此合併請求已損毀,因為遺失 Fork 資訊。 pulls.files_conflicted=此合併請求有變更和目標分支衝突。 pulls.is_checking=正在進行合併衝突檢查,請稍後再試。 From 8de91cd0c3054a506923659b137d28bb63836f24 Mon Sep 17 00:00:00 2001 From: Jimmy Praet Date: Sun, 14 Feb 2021 11:55:25 +0100 Subject: [PATCH 03/14] Revert "extract remove_wip_prefix translation message" This reverts commit caf2854fb0ec2944e639c7525b0e30111b9194b7. --- options/locale/locale_bg-BG.ini | 3 +-- options/locale/locale_cs-CZ.ini | 3 +-- options/locale/locale_de-DE.ini | 3 +-- options/locale/locale_es-ES.ini | 3 +-- options/locale/locale_fr-FR.ini | 3 +-- options/locale/locale_it-IT.ini | 3 +-- options/locale/locale_ja-JP.ini | 3 +-- options/locale/locale_lv-LV.ini | 3 +-- options/locale/locale_nl-NL.ini | 3 +-- options/locale/locale_pl-PL.ini | 3 +-- options/locale/locale_pt-BR.ini | 3 +-- options/locale/locale_pt-PT.ini | 3 +-- options/locale/locale_ru-RU.ini | 3 +-- options/locale/locale_sv-SE.ini | 3 +-- options/locale/locale_tr-TR.ini | 3 +-- options/locale/locale_uk-UA.ini | 3 +-- options/locale/locale_zh-CN.ini | 3 +-- options/locale/locale_zh-TW.ini | 3 +-- 18 files changed, 18 insertions(+), 36 deletions(-) diff --git a/options/locale/locale_bg-BG.ini b/options/locale/locale_bg-BG.ini index 7ef86c81b948e..cf39d391286be 100644 --- a/options/locale/locale_bg-BG.ini +++ b/options/locale/locale_bg-BG.ini @@ -767,8 +767,7 @@ pulls.merged_as=Тази заявка за сливане е била обеди pulls.is_closed=Тази заявка за сливане е затворена. pulls.has_merged=Тази заявка за сливане е обединена. pulls.title_wip_desc=`Започнете заглавието с %s, за да предотвратите случайно обединяване на заявката за сливане.` -pulls.cannot_merge_work_in_progress=Тази завка за сливане е отбелязане като работа в прогрес. -pulls.remove_wip_prefix=`Премахнете %s представката от заглавието, когато е готова` +pulls.cannot_merge_work_in_progress=Тази завка за сливане е отбелязане като работа в прогрес. Премахнете %s представката от заглавието, когато е готова pulls.can_auto_merge_desc=Може да се извърши обединяване на тази заявка за сливане. pulls.num_conflicting_files_1=%d конфликтен файл pulls.num_conflicting_files_n=%d конфликтни файлове diff --git a/options/locale/locale_cs-CZ.ini b/options/locale/locale_cs-CZ.ini index e2f06472a74bf..db444f8e20f29 100644 --- a/options/locale/locale_cs-CZ.ini +++ b/options/locale/locale_cs-CZ.ini @@ -1260,8 +1260,7 @@ pulls.merged_as=Požadavek na natažení byl sloučen jako Začněte název s %s a zamezíte tak nechtěnému sloučení požadavku na natažení.` -pulls.cannot_merge_work_in_progress=Požadavek na natažení je označen jako ve vývoji. -pulls.remove_wip_prefix=`Odstraňte %s prefix z titulku, až bude hotový` +pulls.cannot_merge_work_in_progress=Požadavek na natažení je označen jako ve vývoji. Odstraňte %s prefix z titulku, až bude hotový pulls.data_broken=Tento požadavek na natažení je rozbitý kvůli chybějícím informacím o rozštěpení. pulls.files_conflicted=Tento požadavek na natažení obsahuje změny, které kolidují s cílovou větví. pulls.is_checking=Právě probíhá kontrola konfliktů při sloučení. Zkuste to za chvíli. diff --git a/options/locale/locale_de-DE.ini b/options/locale/locale_de-DE.ini index e2f730a6b17f1..ee9e9dc678b3e 100644 --- a/options/locale/locale_de-DE.ini +++ b/options/locale/locale_de-DE.ini @@ -1255,8 +1255,7 @@ pulls.merged_as=Der Pull Request wurde als Beginne den Titel mit %s um zu verhindern, dass der Pull Request versehentlich gemergt wird.` -pulls.cannot_merge_work_in_progress=Dieser Pull Request wurde als Work In Progress markiert. -pulls.remove_wip_prefix=`Entferne den %s-Präfix vom Titel, wenn dieser fertig ist.` +pulls.cannot_merge_work_in_progress=Dieser Pull Request wurde als Work In Progress markiert. Entferne den %s-Präfix vom Titel, wenn dieser fertig ist. pulls.data_broken=Dieser Pull-Requests ist kaputt, da Fork-Informationen gelöscht wurden. pulls.files_conflicted=Dieser Pull-Request hat Änderungen, die im Widerspruch zum Ziel-Branch stehen. pulls.is_checking=Die Konfliktprüfung läuft noch. Bitte aktualisiere die Seite in wenigen Augenblicken. diff --git a/options/locale/locale_es-ES.ini b/options/locale/locale_es-ES.ini index c43f0f04f07be..95fe653e74c64 100644 --- a/options/locale/locale_es-ES.ini +++ b/options/locale/locale_es-ES.ini @@ -1241,8 +1241,7 @@ pulls.merged_as=El Pull Request se ha fusionado como Comience el título con %s para prevenir que el pull request se fusione accidentalmente.` -pulls.cannot_merge_work_in_progress=Este pull request está marcado como un trabajo en progreso. -pulls.remove_wip_prefix=`Elimine el prefijo %s del título cuando esté listo` +pulls.cannot_merge_work_in_progress=Este pull request está marcado como un trabajo en progreso. Elimine el prefijo %s del título cuando esté listo pulls.data_broken=Este pull request está rota debido a que falta información del fork. pulls.files_conflicted=Este pull request tiene cambios en conflicto con la rama de destino. pulls.is_checking=La comprobación de conflicto de fusión está en progreso. Inténtalo de nuevo en unos momentos. diff --git a/options/locale/locale_fr-FR.ini b/options/locale/locale_fr-FR.ini index d34b99d127cd3..25e72f6914857 100644 --- a/options/locale/locale_fr-FR.ini +++ b/options/locale/locale_fr-FR.ini @@ -1088,8 +1088,7 @@ pulls.merged_as=La demande de tirage a été fusionnée en Préfixer le titre par %s pour empêcher cette demande d'ajout d'être fusionnée par erreur.` -pulls.cannot_merge_work_in_progress=Cette demande d'ajout est marquée comme en cours de chantier. -pulls.remove_wip_prefix=`Retirer le préfixe %s du titre quand elle sera prête` +pulls.cannot_merge_work_in_progress=Cette demande d'ajout est marquée comme en cours de chantier. Retirer le préfixe %s du titre quand elle sera prête pulls.data_broken=Cette demande de fusion est impossible par manque d'informations de bifurcation. pulls.files_conflicted=Cette demande d'ajout contient des modifications en conflit avec la branche ciblée. pulls.is_checking=Vérification des conflits de fusion en cours. Réessayez dans quelques instants. diff --git a/options/locale/locale_it-IT.ini b/options/locale/locale_it-IT.ini index 70860a7ebfe9a..d654172ce49bf 100644 --- a/options/locale/locale_it-IT.ini +++ b/options/locale/locale_it-IT.ini @@ -1194,8 +1194,7 @@ pulls.merged_as=La pull request è stata unita come Inizia il titolo con %s per evitare che la pull request venga unita accidentalmente.` -pulls.cannot_merge_work_in_progress=Questa pull request è contrassegnata come un lavoro in corso. -pulls.remove_wip_prefix=`Rimuovi il prefisso %s dal titolo quando è pronta` +pulls.cannot_merge_work_in_progress=Questa pull request è contrassegnata come un lavoro in corso. Rimuovi il prefisso %s dal titolo quando è pronta pulls.data_broken=Questa pull request è rovinata a causa di informazioni mancanti del fork. pulls.files_conflicted=Questa pull request ha modifiche in conflitto con il branch di destinazione. pulls.is_checking=Verifica dei conflitti di merge in corso. Riprova tra qualche istante. diff --git a/options/locale/locale_ja-JP.ini b/options/locale/locale_ja-JP.ini index 7e5c009a1f00d..f33c563b8eda7 100644 --- a/options/locale/locale_ja-JP.ini +++ b/options/locale/locale_ja-JP.ini @@ -1260,8 +1260,7 @@ pulls.merged_as=プルリクエストは タイトルの頭に %s を付けます。` -pulls.cannot_merge_work_in_progress=このプルリクエストはWork in Progressとマークされています。 -pulls.remove_wip_prefix=`マージできる状態になったら、タイトルから %s を消してください。` +pulls.cannot_merge_work_in_progress=このプルリクエストはWork in Progressとマークされています。 マージできる状態になったら、タイトルから %s を消してください。 pulls.data_broken=このプルリクエストは、フォークの情報が見つからないため壊れています。 pulls.files_conflicted=このプルリクエストは、ターゲットブランチと競合する変更を含んでいます。 pulls.is_checking=マージのコンフリクトを確認中です。 少し待ってからもう一度実行してください。 diff --git a/options/locale/locale_lv-LV.ini b/options/locale/locale_lv-LV.ini index 4f6dae9347be2..8db1862aece4c 100644 --- a/options/locale/locale_lv-LV.ini +++ b/options/locale/locale_lv-LV.ini @@ -1207,8 +1207,7 @@ pulls.merged_as=Izmaiņu pieprasījums tika sapludināts ar revīziju Sāciet virsrakstu ar %s, lai ierobežotu, ka izmaiņu pieprasījums netīšām tiktu sapludināts.` -pulls.cannot_merge_work_in_progress=Šis izmaiņu pieprasījums ir atzīmēts, ka pie tā vēl notiek izstrāde. -pulls.remove_wip_prefix=`Noņemiet %s no virsraksta sākuma, kad tas ir pabeigts.` +pulls.cannot_merge_work_in_progress=Šis izmaiņu pieprasījums ir atzīmēts, ka pie tā vēl notiek izstrāde. Noņemiet %s no virsraksta sākuma, kad tas ir pabeigts. pulls.data_broken=Izmaiņu pieprasījums ir bojāts, jo dzēsta informācija no atdalītā repozitorija. pulls.files_conflicted=Šīs izmaiņu pieprasījuma izmaiņas konfliktē ar mērķa atzaru. pulls.is_checking=Notiek konfliktu pārbaude, mirkli uzgaidiet un atjaunojiet lapu. diff --git a/options/locale/locale_nl-NL.ini b/options/locale/locale_nl-NL.ini index a02e71ba2e75c..3e52ca2de0fe0 100644 --- a/options/locale/locale_nl-NL.ini +++ b/options/locale/locale_nl-NL.ini @@ -1214,8 +1214,7 @@ pulls.merged_as=De pull request is samengevoegd als Start de titel met %s om te voorkomen dat deze pull-aanvraag per ongeluk wordt samengevoegd.` -pulls.cannot_merge_work_in_progress=Deze pull-aanvraag is als "work in progress" gemarkeerd. -pulls.remove_wip_prefix=`Verwijder de %s-prefix van de titel zodra hij klaar is` +pulls.cannot_merge_work_in_progress=Deze pull-aanvraag is als "work in progress" gemarkeerd. Verwijder de %s-prefix van de titel zodra hij klaar is pulls.data_broken=Deze pull-aanvraag is ongeldig wegens missende fork-informatie. pulls.files_conflicted=Dit pull request heeft wijzigingen die strijdig zijn met de doel branch. pulls.is_checking=Controle op samenvoegingsconflicten is nog bezig. Probeer later nog een keer. diff --git a/options/locale/locale_pl-PL.ini b/options/locale/locale_pl-PL.ini index 3eaaf5515a401..f96650e38aec9 100644 --- a/options/locale/locale_pl-PL.ini +++ b/options/locale/locale_pl-PL.ini @@ -1151,8 +1151,7 @@ pulls.merged_as=Pull Request został scalony jako Poprzedź tytuł przy pomocy %s, aby zapobiec przypadkowemu scaleniu tego Pull Requesta.` -pulls.cannot_merge_work_in_progress=Ten Pull Request został oznaczony jako praca w toku. -pulls.remove_wip_prefix=`Usuń prefiks %s z tytułu, kiedy będzie już gotowy.` +pulls.cannot_merge_work_in_progress=Ten Pull Request został oznaczony jako praca w toku. Usuń prefiks %s z tytułu, kiedy będzie już gotowy. pulls.data_broken=Ten Pull Request jest uszkodzony ze względu na brakujące informacje o forku. pulls.files_conflicted=Ten Pull Request zawiera zmiany konfliktujące z docelową gałęzią. pulls.is_checking=Sprawdzanie konfliktów ze scalaniem w toku. Spróbuj ponownie za chwilę. diff --git a/options/locale/locale_pt-BR.ini b/options/locale/locale_pt-BR.ini index 36f3dbd1ee838..f3ed538f3ace1 100644 --- a/options/locale/locale_pt-BR.ini +++ b/options/locale/locale_pt-BR.ini @@ -1063,8 +1063,7 @@ pulls.merged_as=O pull request teve merge aplicado como Inicie o título com o prefixo %s para prevenir o merge do pull request até que o mesmo esteja pronto.` -pulls.cannot_merge_work_in_progress=Este pull request está marcado como um trabalho em andamento. -pulls.remove_wip_prefix=`Remova o prefixo %s do título quando estiver pronto` +pulls.cannot_merge_work_in_progress=Este pull request está marcado como um trabalho em andamento. Remova o prefixo %s do título quando estiver pronto pulls.data_broken=Este pull request está quebrado devido a falta de informação do fork. pulls.files_conflicted=Este pull request tem alterações conflitantes com o branch de destino. pulls.is_checking=Verificação de conflitos do merge está em andamento. Tente novamente em alguns momentos. diff --git a/options/locale/locale_pt-PT.ini b/options/locale/locale_pt-PT.ini index 286043b6f93ab..3ace90e4a0f4e 100644 --- a/options/locale/locale_pt-PT.ini +++ b/options/locale/locale_pt-PT.ini @@ -1229,8 +1229,7 @@ pulls.merged_as=A integração constante no pedido foi executada como Inicie o título com %s para evitar que o pedido de integração seja executado acidentalmente.` -pulls.cannot_merge_work_in_progress=Este pedido de integração está marcado como um trabalho em andamento. -pulls.remove_wip_prefix=`Remova o prefixo %s do título quando estiver pronto` +pulls.cannot_merge_work_in_progress=Este pedido de integração está marcado como um trabalho em andamento. Remova o prefixo %s do título quando estiver pronto pulls.data_broken=Este pedido de integração está danificado devido à falta de informação da derivação. pulls.files_conflicted=Este pedido de integração contém alterações que entram em conflito com o ramo de destino. pulls.is_checking=Está em andamento uma verificação de conflitos na integração. Tente novamente daqui a alguns momentos. diff --git a/options/locale/locale_ru-RU.ini b/options/locale/locale_ru-RU.ini index 4cc76c507d2d5..a14a2fa1a91e1 100644 --- a/options/locale/locale_ru-RU.ini +++ b/options/locale/locale_ru-RU.ini @@ -1194,8 +1194,7 @@ pulls.merged_as=Pull Request был объединен как Добавьте %s в начало заголовка для защиты от случайного досрочного принятия Pull Request'а.` -pulls.cannot_merge_work_in_progress=Данный Pull Request помечен как находящийся ещё в разработке. -pulls.remove_wip_prefix=`Удалите %s из названия после завершения работы над ним` +pulls.cannot_merge_work_in_progress=Данный Pull Request помечен как находящийся ещё в разработке. Удалите %s из названия после завершения работы над ним pulls.data_broken=Содержимое этого запроса было нарушено вследствие удаления информации форка. pulls.files_conflicted=Этот Pull Request имеет изменения, конфликтующие с целевой веткой. pulls.is_checking=Продолжается проверка конфликтов, пожалуйста обновите страницу несколько позже. diff --git a/options/locale/locale_sv-SE.ini b/options/locale/locale_sv-SE.ini index cf8ddd3ea098f..12df6146407a7 100644 --- a/options/locale/locale_sv-SE.ini +++ b/options/locale/locale_sv-SE.ini @@ -1170,8 +1170,7 @@ pulls.merged_as=Pull-förfrågan har sammanfogats som Börja titeln med %s för att förhindra att pull-förfrågan sammanfogas av misstag` -pulls.cannot_merge_work_in_progress=Denna pull-förfrågan är markerad som ett pågående arbete. -pulls.remove_wip_prefix=`Ta bort prefixet %s från titeln när den är klar` +pulls.cannot_merge_work_in_progress=Denna pull-förfrågan är markerad som ett pågående arbete. Ta bort prefixet %s från titeln när den är klar pulls.data_broken=Pull-requesten är trasig pågrund av oexisterande information on forken. pulls.files_conflicted=Den här pull-förfrågan ha ändringar som är i konflikt med mål-branchen. pulls.is_checking=Merge-konfliktkontroll pågår. Försök igen senare. diff --git a/options/locale/locale_tr-TR.ini b/options/locale/locale_tr-TR.ini index 18ee788b4ac85..ff8ff2299e963 100644 --- a/options/locale/locale_tr-TR.ini +++ b/options/locale/locale_tr-TR.ini @@ -1260,8 +1260,7 @@ pulls.merged_as=Değişiklik isteği başlığı %s ile başlatın` -pulls.cannot_merge_work_in_progress=Bu değişiklik isteği devam eden bir çalışma olarak işaretlendi. -pulls.remove_wip_prefix=`Hazır olduğunda %s ön ekini başlıktan kaldırın` +pulls.cannot_merge_work_in_progress=Bu değişiklik isteği devam eden bir çalışma olarak işaretlendi. Hazır olduğunda %s ön ekini başlıktan kaldırın pulls.data_broken=Bu değişiklik isteği, çatallama bilgilerinin eksik olması nedeniyle bozuldu. pulls.files_conflicted=Bu değişiklik isteğinde, hedef dalla çakışan değişiklikler var. pulls.is_checking=Birleştirme çakışması denetimi devam ediyor. Birkaç dakika sonra tekrar deneyin. diff --git a/options/locale/locale_uk-UA.ini b/options/locale/locale_uk-UA.ini index aa6fecfbee4a2..07f6f737e8d16 100644 --- a/options/locale/locale_uk-UA.ini +++ b/options/locale/locale_uk-UA.ini @@ -1157,8 +1157,7 @@ pulls.merged_as=Запит на злиття був влитиий як Почніть заголовок з %s щоб запобігти випадковому злиттю запитів.` -pulls.cannot_merge_work_in_progress=Цей пулл-реквест вже в стадії виконання. -pulls.remove_wip_prefix=`Видаліть префікс %s з заголовку після того як роботи будуть завершені` +pulls.cannot_merge_work_in_progress=Цей пулл-реквест вже в стадії виконання. Видаліть префікс %s з заголовку після того як роботи будуть завершені pulls.data_broken=Зміст цього запиту було порушено внаслідок видалення інформації Форком. Цей запит тягнеться через відсутність інформації про вилучення. pulls.files_conflicted=Цей запит має зміни, що конфліктують з цільовою гілкою. pulls.is_checking=Триває перевірка конфліктів, будь ласка обновіть сторінку дещо пізніше. diff --git a/options/locale/locale_zh-CN.ini b/options/locale/locale_zh-CN.ini index f7f29c84049ec..7f5457d09cbd0 100644 --- a/options/locale/locale_zh-CN.ini +++ b/options/locale/locale_zh-CN.ini @@ -1231,8 +1231,7 @@ pulls.merged_as=该合并请求已作为 标题以 %s 开头以免合并请求意外合并。` -pulls.cannot_merge_work_in_progress=这个合并请求被标记为尚未完成的工作。 -pulls.remove_wip_prefix=`完成后请从标题中移除%s前缀。` +pulls.cannot_merge_work_in_progress=这个合并请求被标记为尚未完成的工作。完成后请从标题中移除%s前缀。 pulls.data_broken=此合并请求因为派生仓库信息缺失而中断。 pulls.files_conflicted=此合并请求有变更与目标分支冲突。 pulls.is_checking=正在进行合并冲突检测,请稍后再试。 diff --git a/options/locale/locale_zh-TW.ini b/options/locale/locale_zh-TW.ini index eab99eadd6673..a0b298a2756fb 100644 --- a/options/locale/locale_zh-TW.ini +++ b/options/locale/locale_zh-TW.ini @@ -1264,8 +1264,7 @@ pulls.merged_as=此合併請求已被合併為 標題用 %s 開頭以避免意外地合併此合併請求。` -pulls.cannot_merge_work_in_progress=此合併請求被標記為仍在作業中。 -pulls.remove_wip_prefix=`準備好要合併時請移除 %s 前綴。` +pulls.cannot_merge_work_in_progress=此合併請求被標記為仍在作業中。準備好要合併時請移除 %s 前綴。 pulls.data_broken=此合併請求已損毀,因為遺失 Fork 資訊。 pulls.files_conflicted=此合併請求有變更和目標分支衝突。 pulls.is_checking=正在進行合併衝突檢查,請稍後再試。 From 1750f115c0212e5333329cf99eca1e0b4c838575 Mon Sep 17 00:00:00 2001 From: Jimmy Praet Date: Sun, 14 Feb 2021 12:19:11 +0100 Subject: [PATCH 04/14] Pass WIP prefix to cannot_merge_work_in_progress message For compatibility with the other languages, this param can be removed once they have all been updated --- templates/repo/issue/view_content/pull.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/repo/issue/view_content/pull.tmpl b/templates/repo/issue/view_content/pull.tmpl index 739c2cd3df507..2b1a94f2ffcb3 100644 --- a/templates/repo/issue/view_content/pull.tmpl +++ b/templates/repo/issue/view_content/pull.tmpl @@ -169,7 +169,7 @@ {{else if .IsPullWorkInProgress}}
{{svg "octicon-x"}} - {{$.i18n.Tr "repo.pulls.cannot_merge_work_in_progress" }} + {{$.i18n.Tr "repo.pulls.cannot_merge_work_in_progress" (.WorkInProgressPrefix|Escape) | Safe}} {{if .HasIssuesOrPullsWritePermission}} {{$.i18n.Tr "repo.pulls.remove_wip_prefix" (.WorkInProgressPrefix|Escape) | Safe}} {{end}} From 92c19a63136c8bb1d12375a485d883e0cccd1bba Mon Sep 17 00:00:00 2001 From: Jimmy Praet Date: Mon, 15 Feb 2021 20:50:28 +0100 Subject: [PATCH 05/14] Fix for failing integration test (merged or closed PR's) --- templates/repo/issue/view_content/sidebar.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/repo/issue/view_content/sidebar.tmpl b/templates/repo/issue/view_content/sidebar.tmpl index aefc6ae5d8ae1..16b181bbc1e20 100644 --- a/templates/repo/issue/view_content/sidebar.tmpl +++ b/templates/repo/issue/view_content/sidebar.tmpl @@ -91,7 +91,7 @@ {{end}}
- {{if and (not .IsPullWorkInProgress) .HasIssuesOrPullsWritePermission}} + {{if and .HasIssuesOrPullsWritePermission (not .HasMerged) (not .Issue.IsClosed) (not .IsPullWorkInProgress)}}
{{.i18n.Tr "repo.pulls.add_wip_prefix" (index .PullRequestWorkInProgressPrefixes 0| Escape) | Safe}}
{{end}}
From 92af13b43ba0c3a58f24c343efba70a67cc0546e Mon Sep 17 00:00:00 2001 From: Jimmy Praet Date: Mon, 15 Feb 2021 20:55:32 +0100 Subject: [PATCH 06/14] Revert "Pass WIP prefix to cannot_merge_work_in_progress message" This reverts commit 1750f115c0212e5333329cf99eca1e0b4c838575, because it results in a superfluous "%!(EXTRA string=WIP:)" --- templates/repo/issue/view_content/pull.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/repo/issue/view_content/pull.tmpl b/templates/repo/issue/view_content/pull.tmpl index 2b1a94f2ffcb3..739c2cd3df507 100644 --- a/templates/repo/issue/view_content/pull.tmpl +++ b/templates/repo/issue/view_content/pull.tmpl @@ -169,7 +169,7 @@ {{else if .IsPullWorkInProgress}}
{{svg "octicon-x"}} - {{$.i18n.Tr "repo.pulls.cannot_merge_work_in_progress" (.WorkInProgressPrefix|Escape) | Safe}} + {{$.i18n.Tr "repo.pulls.cannot_merge_work_in_progress" }} {{if .HasIssuesOrPullsWritePermission}} {{$.i18n.Tr "repo.pulls.remove_wip_prefix" (.WorkInProgressPrefix|Escape) | Safe}} {{end}} From ab6c65a1b9c1b8c1fdc8754f30033d558d0ac0f8 Mon Sep 17 00:00:00 2001 From: Jimmy Praet Date: Mon, 15 Feb 2021 22:14:20 +0100 Subject: [PATCH 07/14] Fix integration test --- integrations/pull_merge_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/integrations/pull_merge_test.go b/integrations/pull_merge_test.go index 79f62c32c10f8..532be41884c74 100644 --- a/integrations/pull_merge_test.go +++ b/integrations/pull_merge_test.go @@ -198,9 +198,9 @@ func TestCantMergeWorkInProgress(t *testing.T) { assert.NotEmpty(t, text, "Can't find WIP text") // remove from lang - expected := i18n.Tr("en", "repo.pulls.cannot_merge_work_in_progress", "[wip]") replacer := strings.NewReplacer("", "", "", "") - assert.Equal(t, replacer.Replace(expected), text, "Unable to find WIP text") + assert.Contains(t, text, i18n.Tr("en", "repo.pulls.cannot_merge_work_in_progress"), "Unable to find WIP text") + assert.Contains(t, text, replacer.Replace(i18n.Tr("en", "repo.pulls.remove_wip_prefix", "[wip]")), "Unable to find WIP text") }) } From 66f17778ea06d124b65ba30d6d8387eeba386a6f Mon Sep 17 00:00:00 2001 From: Jimmy Praet Date: Mon, 15 Feb 2021 23:04:18 +0100 Subject: [PATCH 08/14] Fix integration test --- integrations/pull_merge_test.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/integrations/pull_merge_test.go b/integrations/pull_merge_test.go index 532be41884c74..b4a3397a45f56 100644 --- a/integrations/pull_merge_test.go +++ b/integrations/pull_merge_test.go @@ -197,10 +197,8 @@ func TestCantMergeWorkInProgress(t *testing.T) { text := strings.TrimSpace(htmlDoc.doc.Find(".merge-section > .item").Last().Text()) assert.NotEmpty(t, text, "Can't find WIP text") - // remove from lang - replacer := strings.NewReplacer("", "", "", "") assert.Contains(t, text, i18n.Tr("en", "repo.pulls.cannot_merge_work_in_progress"), "Unable to find WIP text") - assert.Contains(t, text, replacer.Replace(i18n.Tr("en", "repo.pulls.remove_wip_prefix", "[wip]")), "Unable to find WIP text") + assert.Contains(t, text, "[wip]", "Unable to find WIP text") }) } From b151b827115da0512e24b077a038272d6075fc93 Mon Sep 17 00:00:00 2001 From: Jimmy Praet Date: Fri, 26 Mar 2021 22:02:22 +0100 Subject: [PATCH 09/14] fix merge with master --- templates/repo/issue/view_content/sidebar.tmpl | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/templates/repo/issue/view_content/sidebar.tmpl b/templates/repo/issue/view_content/sidebar.tmpl index 7b2e6bd30499f..c52a1c7aeb8ce 100644 --- a/templates/repo/issue/view_content/sidebar.tmpl +++ b/templates/repo/issue/view_content/sidebar.tmpl @@ -91,11 +91,10 @@ {{end}}
- - {{if and .HasIssuesOrPullsWritePermission (not .HasMerged) (not .Issue.IsClosed) (not .IsPullWorkInProgress)}} -
{{.i18n.Tr "repo.pulls.add_wip_prefix" (index .PullRequestWorkInProgressPrefixes 0| Escape) | Safe}}
- {{end}} -
+ {{if and .HasIssuesOrPullsWritePermission (not .HasMerged) (not .Issue.IsClosed) (not .IsPullWorkInProgress)}} +
{{.i18n.Tr "repo.pulls.add_wip_prefix" (index .PullRequestWorkInProgressPrefixes 0| Escape) | Safe}}
+ {{end}} +
{{end}} - {{if and .HasIssuesOrPullsWritePermission (not .HasMerged) (not .Issue.IsClosed) (not .IsPullWorkInProgress)}} + {{if and (or .HasIssuesOrPullsWritePermission .IsIssuePoster) (not .HasMerged) (not .Issue.IsClosed) (not .IsPullWorkInProgress)}}
{{.i18n.Tr "repo.pulls.add_wip_prefix" (index .PullRequestWorkInProgressPrefixes 0| Escape) | Safe}}
{{end}}
From d9c4ef72e3b17536929fd5ffc9988012a51cbbfc Mon Sep 17 00:00:00 2001 From: Jimmy Praet Date: Sat, 15 May 2021 14:19:23 +0200 Subject: [PATCH 11/14] Allow PR author to toggle WIP status --- templates/repo/issue/view_content/pull.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/repo/issue/view_content/pull.tmpl b/templates/repo/issue/view_content/pull.tmpl index 85acf5eaddb00..b3700adbbf40d 100644 --- a/templates/repo/issue/view_content/pull.tmpl +++ b/templates/repo/issue/view_content/pull.tmpl @@ -175,7 +175,7 @@
{{svg "octicon-x"}} {{$.i18n.Tr "repo.pulls.cannot_merge_work_in_progress" }} - {{if .HasIssuesOrPullsWritePermission}} + {{if or .HasIssuesOrPullsWritePermission .IsIssuePoster}} {{$.i18n.Tr "repo.pulls.remove_wip_prefix" (.WorkInProgressPrefix|Escape) | Safe}} {{end}}
From 75d7b0bdcad603ebab260d18cf785b8ce8b3c694 Mon Sep 17 00:00:00 2001 From: silverwind Date: Sat, 22 May 2021 19:02:13 +0200 Subject: [PATCH 12/14] refactors and restyling, remove links from translations --- options/locale/locale_en-US.ini | 5 +- templates/repo/issue/view_content/pull.tmpl | 58 +++++++++++-------- .../repo/issue/view_content/sidebar.tmpl | 6 +- web_src/js/index.js | 15 ++--- 4 files changed, 48 insertions(+), 36 deletions(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 180d45acf7f23..3c5ad86881292 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -1317,8 +1317,9 @@ pulls.is_closed = The pull request has been closed. pulls.has_merged = The pull request has been merged. pulls.title_wip_desc = `Start the title with %s to prevent the pull request from being merged accidentally.` pulls.cannot_merge_work_in_progress = This pull request is marked as a work in progress. -pulls.remove_wip_prefix = `Remove the %s prefix from the title when it's ready` -pulls.add_wip_prefix = `Still in progress? Add %s prefix` +pulls.still_in_progress = Still in progress? +pulls.add_prefix = `Add %s prefix` +pulls.remove_prefix = Remove the %s prefix pulls.data_broken = This pull request is broken due to missing fork information. pulls.files_conflicted = This pull request has changes conflicting with the target branch. pulls.is_checking = "Merge conflict checking is in progress. Try again in few moments." diff --git a/templates/repo/issue/view_content/pull.tmpl b/templates/repo/issue/view_content/pull.tmpl index b3700adbbf40d..a51317f06c2b4 100644 --- a/templates/repo/issue/view_content/pull.tmpl +++ b/templates/repo/issue/view_content/pull.tmpl @@ -13,7 +13,7 @@ {{avatar .User}} {{end}} - + {{if .User}} {{.User.GetDisplayName}} {{else if .Team}} @@ -34,12 +34,12 @@
{{if .Review.Stale}} - + {{end}} {{if (and $.Permission.IsAdmin (or (eq .Review.Type 1) (eq .Review.Type 3)) (not $.Issue.IsClosed))}} - + {{svg "octicon-x" 16}} {{else if .IsPullWorkInProgress}} -
- {{svg "octicon-x"}} - {{$.i18n.Tr "repo.pulls.cannot_merge_work_in_progress" }} - {{if or .HasIssuesOrPullsWritePermission .IsIssuePoster}} - {{$.i18n.Tr "repo.pulls.remove_wip_prefix" (.WorkInProgressPrefix|Escape) | Safe}} - {{end}} +
+
+ {{svg "octicon-x"}} + {{$.i18n.Tr "repo.pulls.cannot_merge_work_in_progress" }} +
+
+ {{if or .HasIssuesOrPullsWritePermission .IsIssuePoster}} + + {{end}} +
{{else if .Issue.PullRequest.IsChecking}}
@@ -185,7 +191,7 @@ {{$.i18n.Tr "repo.pulls.is_checking"}}
{{else if .Issue.PullRequest.IsEmpty}} -
+
{{svg "octicon-alert" 16}} {{$.i18n.Tr "repo.pulls.is_empty"}}
@@ -446,14 +452,14 @@ {{svg "octicon-x"}} {{$.i18n.Tr "repo.pulls.no_merge_desc"}}
-
+
{{svg "octicon-info"}} {{$.i18n.Tr "repo.pulls.no_merge_helper"}}
{{end}} {{else}}
-
+
{{svg "octicon-info"}} {{$.i18n.Tr "repo.pulls.no_merge_access"}}
@@ -506,7 +512,7 @@ {{svg "octicon-x"}} {{$.i18n.Tr "repo.pulls.cannot_auto_merge_desc"}}
-
+
{{svg "octicon-info"}} {{$.i18n.Tr "repo.pulls.cannot_auto_merge_helper"}}
@@ -514,17 +520,21 @@ {{end}} {{if and (gt .Issue.PullRequest.CommitsBehind 0) (not .Issue.IsClosed) (not .Issue.PullRequest.IsChecking) (not .IsPullFilesConflicted) (not .IsPullRequestBroken) (not $canAutoMerge)}} -
- {{svg "octicon-alert"}} - {{$.i18n.Tr "repo.pulls.outdated_with_base_branch"}} - {{if .UpdateAllowed}} -
- {{.CsrfTokenHtml}} - -
- {{end}} +
+
+ {{svg "octicon-alert"}} + {{$.i18n.Tr "repo.pulls.outdated_with_base_branch"}} +
+
+ {{if .UpdateAllowed}} +
+ {{.CsrfTokenHtml}} + +
+ {{end}} +
{{end}} diff --git a/templates/repo/issue/view_content/sidebar.tmpl b/templates/repo/issue/view_content/sidebar.tmpl index d33c8a70004f2..22e9f34e5dfce 100644 --- a/templates/repo/issue/view_content/sidebar.tmpl +++ b/templates/repo/issue/view_content/sidebar.tmpl @@ -92,7 +92,11 @@
{{if and (or .HasIssuesOrPullsWritePermission .IsIssuePoster) (not .HasMerged) (not .Issue.IsClosed) (not .IsPullWorkInProgress)}} -
{{.i18n.Tr "repo.pulls.add_wip_prefix" (index .PullRequestWorkInProgressPrefixes 0| Escape) | Safe}}
+ {{end}}
{{end}} diff --git a/web_src/js/index.js b/web_src/js/index.js index a481f1d8d4148..422b87c83e676 100644 --- a/web_src/js/index.js +++ b/web_src/js/index.js @@ -909,17 +909,14 @@ async function initRepository() { }); // Toggle WIP - $('.toggle-wip a').on('click', (e) => { + $('.toggle-wip a, .toggle-wip button').on('click', async (e) => { e.preventDefault(); - const $toggle = $(e.target).closest('div'); - const title = $toggle.data('title'); - const prefix = $toggle.data('wip-prefix'); - const newTitle = title.startsWith(prefix) ? title.substr(prefix.length).trim() : `${prefix.trim()} ${title}`; - $.post($toggle.data('update-url'), { + const {title, wipPrefix, updateUrl} = e.currentTarget.closest('.toggle-wip').dataset; + await $.post(updateUrl, { _csrf: csrf, - title: newTitle - }).done(reload); - return false; + title: title?.startsWith(wipPrefix) ? title.substr(wipPrefix.length).trim() : `${wipPrefix.trim()} ${title}`, + }); + reload(); }); // Issue Comments From 80824a02a935e7dbbbb8aa161a3b16e6d581e6ad Mon Sep 17 00:00:00 2001 From: silverwind Date: Sat, 22 May 2021 19:42:16 +0200 Subject: [PATCH 13/14] Update options/locale/locale_en-US.ini --- options/locale/locale_en-US.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 3c5ad86881292..47b11203b2871 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -1318,7 +1318,7 @@ pulls.has_merged = The pull request has been merged. pulls.title_wip_desc = `Start the title with %s to prevent the pull request from being merged accidentally.` pulls.cannot_merge_work_in_progress = This pull request is marked as a work in progress. pulls.still_in_progress = Still in progress? -pulls.add_prefix = `Add %s prefix` +pulls.add_prefix = Add %s prefix pulls.remove_prefix = Remove the %s prefix pulls.data_broken = This pull request is broken due to missing fork information. pulls.files_conflicted = This pull request has changes conflicting with the target branch. From 2d25928f7faa4efa28c9de7570771b53683cd993 Mon Sep 17 00:00:00 2001 From: silverwind Date: Sat, 22 May 2021 19:42:53 +0200 Subject: [PATCH 14/14] Update options/locale/locale_en-US.ini --- options/locale/locale_en-US.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 47b11203b2871..b41aa6a7913c6 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -1319,7 +1319,7 @@ pulls.title_wip_desc = `Start the title with %s pulls.cannot_merge_work_in_progress = This pull request is marked as a work in progress. pulls.still_in_progress = Still in progress? pulls.add_prefix = Add %s prefix -pulls.remove_prefix = Remove the %s prefix +pulls.remove_prefix = Remove %s prefix pulls.data_broken = This pull request is broken due to missing fork information. pulls.files_conflicted = This pull request has changes conflicting with the target branch. pulls.is_checking = "Merge conflict checking is in progress. Try again in few moments."