Skip to content

Commit

Permalink
Merge branch 'main' into reattempt-a11y-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
zeripath authored Aug 5, 2021
2 parents 41dae97 + fd39e6d commit 801c4ce
Show file tree
Hide file tree
Showing 33 changed files with 53 additions and 106 deletions.
14 changes: 7 additions & 7 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ trigger:
steps:
- name: deps-frontend
pull: always
image: node:14
image: node:16
commands:
- make node_modules

- name: lint-frontend
image: node:14
image: node:16
commands:
- make lint-frontend
depends_on: [deps-frontend]
Expand Down Expand Up @@ -58,7 +58,7 @@ steps:
TAGS: bindata gogit sqlite sqlite_unlock_notify

- name: checks-frontend
image: node:14
image: node:16
commands:
- make checks-frontend
depends_on: [deps-frontend]
Expand All @@ -71,13 +71,13 @@ steps:
depends_on: [lint-backend]

- name: test-frontend
image: node:14
image: node:16
commands:
- make test-frontend
depends_on: [lint-frontend]

- name: build-frontend
image: node:14
image: node:16
commands:
- make frontend
depends_on: [test-frontend]
Expand Down Expand Up @@ -514,7 +514,7 @@ steps:
pull: always
image: techknowlogick/xgo:go-1.16.x
commands:
- curl -sL https://deb.nodesource.com/setup_14.x | bash - && apt-get install -y nodejs
- curl -sL https://deb.nodesource.com/setup_16.x | bash - && apt-get install -y nodejs
- export PATH=$PATH:$GOPATH/bin
- make release
environment:
Expand Down Expand Up @@ -610,7 +610,7 @@ steps:
pull: always
image: techknowlogick/xgo:go-1.16.x
commands:
- curl -sL https://deb.nodesource.com/setup_14.x | bash - && apt-get install -y nodejs
- curl -sL https://deb.nodesource.com/setup_16.x | bash - && apt-get install -y nodejs
- export PATH=$PATH:$GOPATH/bin
- make release
environment:
Expand Down
10 changes: 6 additions & 4 deletions modules/context/access_log.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package context

import (
"bytes"
"context"
"html/template"
"net/http"
"time"
Expand All @@ -22,18 +23,19 @@ type routerLoggerOptions struct {
Ctx map[string]interface{}
}

var signedUserNameStringPointerKey interface{} = "signedUserNameStringPointerKey"

// AccessLogger returns a middleware to log access logger
func AccessLogger() func(http.Handler) http.Handler {
logger := log.GetLogger("access")
logTemplate, _ := template.New("log").Parse(setting.AccessLogTemplate)
return func(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
start := time.Now()
next.ServeHTTP(w, req)
identity := "-"
if val := SignedUserName(req); val != "" {
identity = val
}
r := req.WithContext(context.WithValue(req.Context(), signedUserNameStringPointerKey, &identity))

next.ServeHTTP(w, r)
rw := w.(ResponseWriter)

buf := bytes.NewBuffer([]byte{})
Expand Down
11 changes: 11 additions & 0 deletions modules/context/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,17 @@ func APIContexter() func(http.Handler) http.Handler {
ctx.Data["CsrfToken"] = html.EscapeString(ctx.csrf.GetToken())

next.ServeHTTP(ctx.Resp, ctx.Req)

// Handle adding signedUserName to the context for the AccessLogger
usernameInterface := ctx.Data["SignedUserName"]
identityPtrInterface := ctx.Req.Context().Value(signedUserNameStringPointerKey)
if usernameInterface != nil && identityPtrInterface != nil {
username := usernameInterface.(string)
identityPtr := identityPtrInterface.(*string)
if identityPtr != nil && username != "" {
*identityPtr = username
}
}
})
}
}
Expand Down
11 changes: 11 additions & 0 deletions modules/context/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -770,6 +770,17 @@ func Contexter() func(next http.Handler) http.Handler {
}

next.ServeHTTP(ctx.Resp, ctx.Req)

// Handle adding signedUserName to the context for the AccessLogger
usernameInterface := ctx.Data["SignedUserName"]
identityPtrInterface := ctx.Req.Context().Value(signedUserNameStringPointerKey)
if usernameInterface != nil && identityPtrInterface != nil {
username := usernameInterface.(string)
identityPtr := identityPtrInterface.(*string)
if identityPtr != nil && username != "" {
*identityPtr = username
}
}
})
}
}
5 changes: 2 additions & 3 deletions modules/csv/csv.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ package csv

import (
"bytes"
"encoding/csv"
stdcsv "encoding/csv"
"errors"
"io"
Expand Down Expand Up @@ -97,9 +96,9 @@ func scoreDelimiter(lines []string, delim rune) float64 {

// FormatError converts csv errors into readable messages.
func FormatError(err error, locale translation.Locale) (string, error) {
var perr *csv.ParseError
var perr *stdcsv.ParseError
if errors.As(err, &perr) {
if perr.Err == csv.ErrFieldCount {
if perr.Err == stdcsv.ErrFieldCount {
return locale.Tr("repo.error.csv.invalid_field_count", perr.Line), nil
}
return locale.Tr("repo.error.csv.unexpected", perr.Line, perr.Column), nil
Expand Down
1 change: 0 additions & 1 deletion options/locale/locale_bg-BG.ini
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,6 @@ pulls.num_conflicting_files_n=%d конфликтни файлове
pulls.no_merge_desc=Тази заявка за сливане не може да бъде обединена, защото всички опции за обединяване на хранилището са изключени.
pulls.no_merge_helper=Включете опции за сливане в настройките на хранилището или обединете заявката за сливане ръчно.
pulls.no_merge_wip=Тази заявка за сливане не може да бъде обединена, защото е отбелязана като работа в прогрес.
pulls.merge_pull_request=Обедини заявка за сливане
; </summary><code>%[2]s<br>%[3]s</code></details>
pulls.status_checks_success=Всички проверявания бяха успешни
pulls.update_branch=Осъвременяване на клона
Expand Down
4 changes: 0 additions & 4 deletions options/locale/locale_cs-CZ.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1358,10 +1358,6 @@ pulls.no_merge_helper=Povolte možnosti sloučení v nastavení repozitáře neb
pulls.no_merge_wip=Požadavek na natažení nemůže být sloučen protože je označen jako nedokončený.
pulls.no_merge_not_ready=Tento požadavek na natažení není připraven na sloučení, zkontrolujte stav posouzení a kontrolu stavu.
pulls.no_merge_access=Nemáte oprávnění sloučit tento požadavek na natažení.
pulls.merge_pull_request=Sloučit požadavek na natažení
pulls.rebase_merge_pull_request=Rebase a sloučit
pulls.rebase_merge_commit_pull_request=Rebase a sloučit (--no-ff)
pulls.squash_merge_pull_request=Squash a sloučit
pulls.merge_manually=Sloučeno ručně
pulls.merge_commit_id=ID slučovací revize
pulls.require_signed_wont_sign=Větev vyžaduje podepsané revize, ale toto sloučení nebude podepsáno
Expand Down
4 changes: 0 additions & 4 deletions options/locale/locale_de-DE.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1436,10 +1436,6 @@ pulls.no_merge_helper=Aktiviere Mergeoptionen in den Repositoryeinstellungen ode
pulls.no_merge_wip=Dieser Pull Request kann nicht gemergt werden, da er als Work In Progress gekennzeichnet ist.
pulls.no_merge_not_ready=Dieser Pull-Request kann nicht gemergt werden, überprüfe den Reviewstatus und die Statusprüfungen.
pulls.no_merge_access=Du bist nicht berechtigt, diesen Pull-Request zu Mergen.
pulls.merge_pull_request=Pull-Request mergen
pulls.rebase_merge_pull_request=Rebase und Mergen
pulls.rebase_merge_commit_pull_request=Rebasen und Mergen (--no-ff)
pulls.squash_merge_pull_request=Zusammenfassen und Mergen
pulls.merge_manually=Manuell mergen
pulls.merge_commit_id=Der Mergecommit ID
pulls.require_signed_wont_sign=Der Branch erfordert einen signierten Commit, aber dieser Merge wird nicht signiert
Expand Down
4 changes: 0 additions & 4 deletions options/locale/locale_es-ES.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1436,10 +1436,6 @@ pulls.no_merge_helper=Habilite las opciones de combinación en la configuración
pulls.no_merge_wip=Este pull request no se puede combinar porque está marcada como un trabajo en progreso.
pulls.no_merge_not_ready=Este pull request no está listo para ser fusionado, compruebe el estado de revisión y las comprobaciones de estado.
pulls.no_merge_access=No está autorizado para fusionar de este pull request.
pulls.merge_pull_request=Fusionar Pull Request
pulls.rebase_merge_pull_request=Hacer Rebase y Fusionar
pulls.rebase_merge_commit_pull_request=Hacer Rebase y Fusionar (--no-ff)
pulls.squash_merge_pull_request=Hacer Squash y Fusionar
pulls.merge_manually=Fusionado manualmente
pulls.merge_commit_id=La identificación del commit fusionado
pulls.require_signed_wont_sign=Esta rama requiere commits firmados pero esta fusión no será firmada
Expand Down
4 changes: 0 additions & 4 deletions options/locale/locale_fa-IR.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1162,10 +1162,6 @@ pulls.no_merge_helper=گزینه های ادغام را در تنظیمات مخ
pulls.no_merge_wip=این تقاضای واکشی قابل ادغام نیست لذا اکنون به این مخزن درحال پردازش علامت گذاری شده است.
pulls.no_merge_not_ready=این درخواست واکشی آماده ادغام نیست، وضعیت بازبینی را چک کنید.
pulls.no_merge_access=شما مجاز به ادغام این درخواست واکشی نیستید.
pulls.merge_pull_request=ادغام تقاضای واکشی
pulls.rebase_merge_pull_request=بازگردانی و ادغام
pulls.rebase_merge_commit_pull_request=بازگردانی و ادغام (--no-ff)
pulls.squash_merge_pull_request=له کردن و ادغام
pulls.require_signed_wont_sign=انشعاب نیازمند تغییرات امضا شده است اما این ادغام امضا نخواهد شد
pulls.invalid_merge_option=شما نمی‌توانید از این گزینه برای تقاضای واکشی استفاده کنید.
; </summary><code>%[2]s<br>%[3]s</code></details>
Expand Down
1 change: 0 additions & 1 deletion options/locale/locale_fi-FI.ini
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,6 @@ pulls.merged=Yhdistetty
pulls.has_merged=Vetopyyntö on yhdistetty.
pulls.can_auto_merge_desc=Tämä pull-pyyntö voidaan yhdistää automaattisesti.

pulls.merge_pull_request=Yhdistä Pull-pyyntö
; </summary><code>%[2]s<br>%[3]s</code></details>


Expand Down
4 changes: 0 additions & 4 deletions options/locale/locale_fr-FR.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1384,10 +1384,6 @@ pulls.no_merge_helper=Activez des options de fusion dans les paramètres du dép
pulls.no_merge_wip=Cette demande d'ajout ne peut pas être fusionnée car elle est marquée comme en cours de chantier.
pulls.no_merge_not_ready=Cette demande d'ajout n'est pas prête à être fusionnée, vérifiez l'état de la revue et les vérifications.
pulls.no_merge_access=Vous n'êtes pas autorisé-e a fusionnée cette demande d'ajout.
pulls.merge_pull_request=Fusionner la demande d'ajout
pulls.rebase_merge_pull_request=Rebase et fusionner
pulls.rebase_merge_commit_pull_request=Rebase et Fusion (--no-ff)
pulls.squash_merge_pull_request=Squash et fusionner
pulls.merge_manually=Fusionné manuellement
pulls.merge_commit_id=L'ID de la révision de fusion
pulls.require_signed_wont_sign=La branche nécessite des révisions signées mais cette fusion ne sera pas signée
Expand Down
3 changes: 0 additions & 3 deletions options/locale/locale_hu-HU.ini
Original file line number Diff line number Diff line change
Expand Up @@ -998,9 +998,6 @@ pulls.cant_reopen_deleted_branch=Ez a pull request nem nyitható meg újra, mive
pulls.merged=Egyesítve
pulls.can_auto_merge_desc=Ez az egyesítési kérés automatikusan végrehajtható.

pulls.merge_pull_request=Egyesítési kérés végrehajtása
pulls.rebase_merge_pull_request=Rebase és egyesítés
pulls.squash_merge_pull_request=Squash és egyesítés
; </summary><code>%[2]s<br>%[3]s</code></details>
pulls.status_checking=Néhány ellenőrzés függőben van
pulls.status_checks_success=Minden ellenőrzés sikeres volt
Expand Down
3 changes: 0 additions & 3 deletions options/locale/locale_id-ID.ini
Original file line number Diff line number Diff line change
Expand Up @@ -861,9 +861,6 @@ pulls.reopen_to_merge=Tolong buka kembali permintaan tarik ini untuk melaksanaka
pulls.merged=Menggabungkan
pulls.can_auto_merge_desc=Permintaan tarik ini dapat digabung secara otomatis.

pulls.merge_pull_request=Gabungkan Permintaan Tarik
pulls.rebase_merge_pull_request=Membuat Ulang Dasar dan Menggabungkan
pulls.squash_merge_pull_request=Tindih dan Gabungkan
; </summary><code>%[2]s<br>%[3]s</code></details>


Expand Down
4 changes: 0 additions & 4 deletions options/locale/locale_it-IT.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1272,10 +1272,6 @@ pulls.no_merge_helper=Attiva le opzioni di merge nelle impostazioni del reposito
pulls.no_merge_wip=Questa pull request non può essere unita perché è contrassegnata come un lavoro in corso.
pulls.no_merge_not_ready=Questa pull request non è pronta per il merge, controlla lo stato della revisione e i controlli di stato.
pulls.no_merge_access=Non sei autorizzato ad effettuare il merge su questa pull request.
pulls.merge_pull_request=Unisci Pull Request
pulls.rebase_merge_pull_request=Fai rebase e unisci
pulls.rebase_merge_commit_pull_request=Rebase e Merge (--no-ff)
pulls.squash_merge_pull_request=Fai squash e unisci
pulls.require_signed_wont_sign=Il branch richiede commit firmati ma questo merge non verrà firmato
pulls.invalid_merge_option=Non puoi utilizzare questa opzione di merge per questa pull request.
pulls.merge_conflict_summary=Messaggio d'errore
Expand Down
4 changes: 0 additions & 4 deletions options/locale/locale_ja-JP.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1437,10 +1437,6 @@ pulls.no_merge_helper=リポジトリ設定でマージを有効にするか、
pulls.no_merge_wip=このプルリクエストはWork In Progressとマークされているため、マージすることはできません。
pulls.no_merge_not_ready=このプルリクエストはマージする準備ができていません。 レビュー状況とステータスチェックを確認してください。
pulls.no_merge_access=このプルリクエストをマージする権限がありません。
pulls.merge_pull_request=プルリクエストをマージ
pulls.rebase_merge_pull_request=リベースしてマージ
pulls.rebase_merge_commit_pull_request=リベースしてマージ(--no-ff)
pulls.squash_merge_pull_request=スカッシュしてマージ
pulls.merge_manually=手動マージ済みにする
pulls.merge_commit_id=マージコミットID
pulls.require_signed_wont_sign=ブランチでは署名されたコミットが必須ですが、このマージでは署名がされません
Expand Down
4 changes: 0 additions & 4 deletions options/locale/locale_ko-KR.ini
Original file line number Diff line number Diff line change
Expand Up @@ -887,10 +887,6 @@ pulls.can_auto_merge_desc=이 풀리퀘스트는 자동적으로 머지될 수
pulls.cannot_auto_merge_helper=충돌을 해결하려면 수동으로 머지하십시오.

pulls.no_merge_desc=모든 저장소 머지 옵션이 비활성화 되어있기 때문에 이 풀 리퀘스트를 머지할 수 없습니다.
pulls.merge_pull_request=풀리퀘스트 머지
pulls.rebase_merge_pull_request=리베이스와 머지
pulls.rebase_merge_commit_pull_request=리베이스와 머지 (--no-ff)
pulls.squash_merge_pull_request=스쿼시하고 머지
pulls.invalid_merge_option=이 풀 리퀘스트에서 설정한 머지 옵션을 사용하실 수 없습니다.
; </summary><code>%[2]s<br>%[3]s</code></details>

Expand Down
4 changes: 0 additions & 4 deletions options/locale/locale_lv-LV.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1436,10 +1436,6 @@ pulls.no_merge_helper=Lai sapludinātu šo izmaiņu pieprasījumu, iespējojiet
pulls.no_merge_wip=Šo izmaiņu pieprasījumu nav iespējams sapludināt, jo tas ir atzīmēts, ka darbs pie tā vēl nav pabeigts.
pulls.no_merge_not_ready=Izmaiņu pieprasījumu nav iespējams sapludināt, pārbaudiet recenziju statusu un statusa pārbaudes.
pulls.no_merge_access=Jums nav tiesību sapludināt šo izmaiņu pieprasījumu.
pulls.merge_pull_request=Izmaiņu pieprasījuma sapludināšana
pulls.rebase_merge_pull_request=Pārbāzēt un sapludināt
pulls.rebase_merge_commit_pull_request=Pārbāzēt un sapludināt (--no-ff)
pulls.squash_merge_pull_request=Saspiest un sapludināt
pulls.merge_manually=Manuāli sapludināts
pulls.merge_commit_id=Sapludināšanas revīzijas ID
pulls.require_signed_wont_sign=Atzarā var iesūtīt tikai parakstītas revīzijas, bet sapludināšanas revīzijas netiks parakstīta
Expand Down
4 changes: 0 additions & 4 deletions options/locale/locale_nl-NL.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1263,10 +1263,6 @@ pulls.no_merge_helper=Schakel samenvoegingsopties in in de repositoryinstellinge
pulls.no_merge_wip=Deze pull-aanvraag kan niet worden samengevoegd omdat hij als "work in progress" is gemarkeerd.
pulls.no_merge_not_ready=Deze pull-aanvraag is niet klaar om samen te voegen, controleer de status en status controles.
pulls.no_merge_access=Je bent niet gemachtigd om deze pull-aanvraag samen te voegen.
pulls.merge_pull_request=Samenvoegen van pull verzoek
pulls.rebase_merge_pull_request=Rebase en Merge
pulls.rebase_merge_commit_pull_request=Rebase en voeg samen (--no-ff)
pulls.squash_merge_pull_request=Squash en Merge
pulls.require_signed_wont_sign=De branch heeft ondertekende commits nodig, maar deze merge zal niet worden ondertekend
pulls.invalid_merge_option=Je kan de samenvoegingsoptie niet gebruiken voor deze pull-aanvraag.
pulls.merge_conflict=Samenvoegen mislukt: Er was een conflict tijdens het samenvoegen. Hint: Probeer een andere strategie
Expand Down
4 changes: 0 additions & 4 deletions options/locale/locale_pl-PL.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1184,10 +1184,6 @@ pulls.no_merge_helper=Włącz opcje scalania w ustawieniach repozytorium, lub sc
pulls.no_merge_wip=Ten pull request nie może być automatycznie scalony, ponieważ jest oznaczony jako praca w toku.
pulls.no_merge_not_ready=Ten Pull Request nie jest gotowy do scalenia, sprawdź status recenzji i kontrolki stanu.
pulls.no_merge_access=Nie masz uprawnień, aby scalić ten Pull Request.
pulls.merge_pull_request=Scal Pull Request
pulls.rebase_merge_pull_request=Zmień bazę i scal
pulls.rebase_merge_commit_pull_request=Zmień bazę i scal (--no-ff)
pulls.squash_merge_pull_request=Zmiażdż i scal
pulls.require_signed_wont_sign=Ta gałąź wymaga podpisanych commitów, ale to scalenie nie będzie podpisane
pulls.invalid_merge_option=Nie możesz użyć tej opcji scalania dla tego pull request'a.
; </summary><code>%[2]s<br>%[3]s</code></details>
Expand Down
4 changes: 0 additions & 4 deletions options/locale/locale_pt-BR.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1260,10 +1260,6 @@ pulls.no_merge_helper=Habilite as opções de merge nas configurações do repos
pulls.no_merge_wip=O merge deste pull request não pode ser aplicado porque está marcado como um trabalho em andamento.
pulls.no_merge_not_ready=Este pull request não está pronto para ser realizado o merge, verifique o status da revisão e as verificações de status.
pulls.no_merge_access=Você não está autorizado para realizar o merge deste pull request.
pulls.merge_pull_request=Aplicar merge do pull request
pulls.rebase_merge_pull_request=Aplicar Rebase e Merge
pulls.rebase_merge_commit_pull_request=Aplicar Rebase e Merge (--no-ff)
pulls.squash_merge_pull_request=Aplicar Squash e Merge
pulls.require_signed_wont_sign=O branch requer commits assinados, mas este merge não será assinado
pulls.invalid_merge_option=Você não pode usar esta opção de merge neste pull request.
; </summary><code>%[2]s<br>%[3]s</code></details>
Expand Down
8 changes: 4 additions & 4 deletions options/locale/locale_pt-PT.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1437,10 +1437,10 @@ pulls.no_merge_helper=Habilite as opções de integração nas configurações d
pulls.no_merge_wip=A integração constante neste pedido não pode ser executada porque está marcada como sendo trabalho em andamento.
pulls.no_merge_not_ready=A integração constante neste pedido não pode ser executada. Verifique o estado da revisão e as verificações de estado.
pulls.no_merge_access=Não tem autorização para executar a integração constante neste pedido.
pulls.merge_pull_request=Executar a integração
pulls.rebase_merge_pull_request=Mudar a base e integrar
pulls.rebase_merge_commit_pull_request=Mudar a base e integrar (--no-ff)
pulls.squash_merge_pull_request=Comprimir e integrar
pulls.merge_pull_request=Criar um cometimento de integração
pulls.rebase_merge_pull_request=Mudar a base e avançar rapidamente
pulls.rebase_merge_commit_pull_request=Mudar a base e criar um cometimento de integração
pulls.squash_merge_pull_request=Criar cometimento de compressão
pulls.merge_manually=Integrado manualmente
pulls.merge_commit_id=O ID de cometimento da integração
pulls.require_signed_wont_sign=O ramo requer que os cometimentos sejam assinados mas esta integração não vai ser assinada
Expand Down
4 changes: 0 additions & 4 deletions options/locale/locale_ru-RU.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1434,10 +1434,6 @@ pulls.no_merge_helper=Включите опции слияния в настро
pulls.no_merge_wip=Данный Pull Request не может быть принят, поскольку он помечен как находящийся в разработке.
pulls.no_merge_not_ready=Этот запрос не готов к слиянию, обратите внимания на ревью и проверки.
pulls.no_merge_access=У вас нет права для слияния данного запроса.
pulls.merge_pull_request=Принять Pull Request
pulls.rebase_merge_pull_request=Выполнить rebase и принять PR
pulls.rebase_merge_commit_pull_request=Выполнить rebase и принять PR (--no-ff)
pulls.squash_merge_pull_request=Объединить и принять PR
pulls.merge_manually=Слито вручную
pulls.merge_commit_id=ID коммита слияния
pulls.require_signed_wont_sign=Данная ветка ожидает подписанные коммиты, однако слияние не будет подписано
Expand Down
Loading

0 comments on commit 801c4ce

Please sign in to comment.