Merge remote-tracking branch 'upstream/main'

This commit is contained in:
Anthony Wang 2022-07-20 14:45:19 -05:00
commit 6e100301cf
Signed by: a
GPG key ID: BC96B00AEC5F2D76
30 changed files with 3498 additions and 3139 deletions

View file

@ -447,9 +447,11 @@ rules:
unicorn/prefer-date-now: [2]
unicorn/prefer-default-parameters: [0]
unicorn/prefer-event-key: [2]
unicorn/prefer-event-target: [2]
unicorn/prefer-export-from: [2]
unicorn/prefer-includes: [2]
unicorn/prefer-json-parse-buffer: [0]
unicorn/prefer-logical-operator-over-ternary: [2]
unicorn/prefer-math-trunc: [2]
unicorn/prefer-modern-dom-apis: [0]
unicorn/prefer-modern-math-apis: [2]

View file

@ -25,11 +25,11 @@ COMMA := ,
XGO_VERSION := go-1.18.x
AIR_PACKAGE ?= github.com/cosmtrek/air@v1.29.0
EDITORCONFIG_CHECKER_PACKAGE ?= github.com/editorconfig-checker/editorconfig-checker/cmd/editorconfig-checker@2.4.0
ERRCHECK_PACKAGE ?= github.com/kisielk/errcheck@v1.6.0
AIR_PACKAGE ?= github.com/cosmtrek/air@v1.40.4
EDITORCONFIG_CHECKER_PACKAGE ?= github.com/editorconfig-checker/editorconfig-checker/cmd/editorconfig-checker@2.5.0
ERRCHECK_PACKAGE ?= github.com/kisielk/errcheck@v1.6.1
GOFUMPT_PACKAGE ?= mvdan.cc/gofumpt@v0.3.1
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/golangci-lint@v1.46.0
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/golangci-lint@v1.47.1
GXZ_PAGAGE ?= github.com/ulikunitz/xz/cmd/gxz@v0.5.10
MISSPELL_PACKAGE ?= github.com/client9/misspell/cmd/misspell@v0.3.4
SWAGGER_PACKAGE ?= github.com/go-swagger/go-swagger/cmd/swagger@v0.29.0

View file

@ -632,9 +632,10 @@ func runListUsers(c *cli.Context) error {
}
}
} else {
fmt.Fprintf(w, "ID\tUsername\tEmail\tIsActive\tIsAdmin\n")
twofa := user_model.UserList(users).GetTwoFaStatus()
fmt.Fprintf(w, "ID\tUsername\tEmail\tIsActive\tIsAdmin\t2FA\n")
for _, u := range users {
fmt.Fprintf(w, "%d\t%s\t%s\t%t\t%t\n", u.ID, u.Name, u.Email, u.IsActive, u.IsAdmin)
fmt.Fprintf(w, "%d\t%s\t%s\t%t\t%t\t%t\n", u.ID, u.Name, u.Email, u.IsActive, u.IsAdmin, twofa[u.ID])
}
}

View file

@ -19,6 +19,7 @@ import (
"code.gitea.io/gitea/modules/base"
"code.gitea.io/gitea/modules/structs"
"code.gitea.io/gitea/modules/timeutil"
"code.gitea.io/gitea/modules/util"
"xorm.io/builder"
)
@ -474,6 +475,35 @@ func SubmitReview(doer *user_model.User, issue *Issue, reviewType ReviewType, co
return review, comm, committer.Commit()
}
// GetReviewOptions represent filter options for GetReviews
type GetReviewOptions struct {
IssueID int64
ReviewerID int64
Dismissed util.OptionalBool
}
// GetReviews return reviews based on GetReviewOptions
func GetReviews(ctx context.Context, opts *GetReviewOptions) ([]*Review, error) {
if opts == nil {
return nil, fmt.Errorf("opts are nil")
}
sess := db.GetEngine(ctx)
if opts.IssueID != 0 {
sess = sess.Where("issue_id=?", opts.IssueID)
}
if opts.ReviewerID != 0 {
sess = sess.Where("reviewer_id=?", opts.ReviewerID)
}
if !opts.Dismissed.IsNone() {
sess = sess.Where("dismissed=?", opts.Dismissed.IsTrue())
}
reviews := make([]*Review, 0, 4)
return reviews, sess.Find(&reviews)
}
// GetReviewersByIssueID gets the latest review of each reviewer for a pull request
func GetReviewersByIssueID(issueID int64) ([]*Review, error) {
reviews := make([]*Review, 0, 10)

View file

@ -97,6 +97,7 @@ type SubmitPullReviewOptions struct {
// DismissPullReviewOptions are options to dismiss a pull review
type DismissPullReviewOptions struct {
Message string `json:"message"`
Priors bool `json:"priors"`
}
// PullReviewRequestOptions are options to add or remove pull review requests

View file

@ -1300,6 +1300,7 @@ issues.previous=Vorherige
issues.next=Nächste
issues.open_title=Offen
issues.closed_title=Geschlossen
issues.draft_title=Entwurf
issues.num_comments=%d Kommentare
issues.commented_at=`hat <a href="#%s">%s</a> kommentiert`
issues.delete_comment_confirm=Bist du sicher dass du diesen Kommentar löschen möchtest?
@ -1606,6 +1607,8 @@ pulls.auto_merge_canceled_schedule=Der Automerge dieses Pull-Requests wurde abge
pulls.auto_merge_newly_scheduled_comment=`hat einen Automerge für diesen Pull-Request %[1]s geplant`
pulls.auto_merge_canceled_schedule_comment=`hat den Automerge für diesen Pull-Request %[1]s abgebrochen`
pulls.delete.title=Diesen Pull-Request löschen?
pulls.delete.text=Willst du diesen Pull-Request wirklich löschen? (Dies wird den Inhalt unwiderruflich löschen. Überlege, ob du ihn nicht lieber schließen willst, um ihn zu archivieren)
milestones.new=Neuer Meilenstein
milestones.closed=Geschlossen %s

View file

@ -861,7 +861,9 @@ default_branch=Προεπιλεγμένος Κλάδος
default_branch_helper=Ο προεπιλεγμένος κλάδος είναι ο βασικός κλάδος για pull requests και υποβολές κώδικα.
mirror_prune=Καθαρισμός
mirror_prune_desc=Αφαίρεση παρωχημένων αναφορών απομακρυσμένης-παρακολούθησης
mirror_interval=Διάστημα ανανέωσης ειδώλου (έγκυρες μονάδες ώρας είναι 'h', 'm', 's'). 0 για απενεργοποίηση του αυτόματου συγχρονισμού. (Ελάχιστο διάστημα: %s)
mirror_interval_invalid=Το χρονικό διάστημα του ειδώλου δεν είναι έγκυρο.
mirror_sync_on_commit=Συγχρονισμός κατά την ώθηση
mirror_address=Κλωνοποίηση Από Το URL
mirror_address_desc=Τοποθετήστε όλα τα απαιτούμενα διαπιστευτήρια στην ενότητα Εξουσιοδότηση.
mirror_address_url_invalid=Η διεύθυνση url που δώσατε δεν είναι έγκυρη. Πρέπει να μεταφράσετε όλα τα στοιχεία του url σωστά.
@ -930,6 +932,7 @@ form.name_pattern_not_allowed=Το μοτίβο '%s' δεν επιτρέπετα
need_auth=Εξουσιοδότηση
migrate_options=Επιλογές Μεταφοράς
migrate_service=Υπηρεσία Μεταφοράς
migrate_options_mirror_helper=Αυτό το αποθετήριο θα είναι είδωλο
migrate_options_lfs=Μεταφορά αρχείων LFS
migrate_options_lfs_endpoint.label=LFS Endpoint
migrate_options_lfs_endpoint.description=Η μεταφορά θα προσπαθήσει να χρησιμοποιήσει το Git remote για να <a target="_blank" rel="noopener noreferrer" href="%s">καθορίσει τον διακομιστή LFS</a>. Μπορείτε επίσης να καθορίσετε ένα δικό σας endpoint αν τα δεδομένα LFS του αποθετηρίου αποθηκεύονται κάπου αλλού.
@ -1300,6 +1303,7 @@ issues.previous=Προηγούμενο
issues.next=Επόμενο
issues.open_title=Ανοιχτό
issues.closed_title=Κλειστό
issues.draft_title=Προσχέδιο
issues.num_comments=%d σχόλια
issues.commented_at=`σχολίασε <a href="#%s">%s</a>`
issues.delete_comment_confirm=Θέλετε σίγουρα να διαγράψετε αυτό το σχόλιο;
@ -1528,6 +1532,8 @@ pulls.remove_prefix=Αφαίρεση <strong>%s</strong> προθέματος
pulls.data_broken=Αυτό το pull request είναι κατεστραμμένο λόγω των πληροφοριών του fork που λείπουν.
pulls.files_conflicted=Αυτό το pull request περιέχει αλλαγές που συγκρούονται με το κλάδο προορισμού.
pulls.is_checking=Ο έλεγχος συγκρούσεων κατά την συγχώνευση είναι σε εξέλιξη. Δοκιμάστε ξανά σε λίγα λεπτά.
pulls.is_ancestor=Αυτός ο κλάδος περιλαμβάνεται ήδη στον κλάδο προορισμού. Δεν υπάρχει τίποτα για συγχώνευση.
pulls.is_empty=Οι αλλαγές σε αυτόν τον κλάδο είναι ήδη στον κλάδο προορισμού. Θα είναι μια κενή υποβολή.
pulls.required_status_check_failed=Ορισμένοι απαιτούμενοι έλεγχοι δεν ήταν επιτυχείς.
pulls.required_status_check_missing=Λείπουν ορισμένοι απαιτούμενοι έλεγχοι.
pulls.required_status_check_administrator=Ως διαχειριστής, μπορείτε ακόμα να συγχωνεύσετε αυτό το pull request.
@ -2534,6 +2540,8 @@ users.delete_account=Διαγραφή Λογαριασμού Χρήστη
users.cannot_delete_self=Δεν μπορείτε να διαγράψετε τον εαυτό σας
users.still_own_repo=Αυτός ο χρήστης εξακολουθεί να κατέχει ένα ή περισσότερα αποθετήρια. Διαγράψτε ή μεταφέρετε αυτά τα αποθετήρια πρώτα.
users.still_has_org=Αυτός ο χρήστης είναι μέλος ενός οργανισμού. Αφαιρέστε πρώτα τον χρήστη από οποιονδήποτε οργανισμό.
users.purge=Εκκαθάριση Χρήστη
users.purge_help=Αναγκαστική διαγραφή χρήστη και των αποθετηρίων, οργανισμών και πακέτων που του ανήκουν. Όλα τα σχόλια επίσης θα διαγραφούν.
users.still_own_packages=Αυτός ο χρήστης εξακολουθεί να κατέχει ένα ή περισσότερα πακέτα. Διαγράψτε πρώτα αυτά τα πακέτα.
users.deletion_success=Ο λογαριασμός χρήστη έχει διαγραφεί.
users.reset_2fa=Επαναφορά 2FA

View file

@ -1420,7 +1420,7 @@ issues.due_date_form_remove = "Remove"
issues.due_date_not_writer = "You need repository write access to update an issue's due date."
issues.due_date_not_set = "No due date set."
issues.due_date_added = "added the due date %s %s"
issues.due_date_modified = "modified the due date to %s from %s %s"
issues.due_date_modified = "modified the due date from %[2]s to %[1]s %[3]s"
issues.due_date_remove = "removed the due date %s %s"
issues.due_date_overdue = "Overdue"
issues.due_date_invalid = "The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'."

View file

@ -1532,6 +1532,8 @@ pulls.remove_prefix=先頭の <strong>%s</strong> を除去
pulls.data_broken=このプルリクエストは、フォークの情報が見つからないため壊れています。
pulls.files_conflicted=このプルリクエストは、ターゲットブランチと競合する変更を含んでいます。
pulls.is_checking=マージのコンフリクトを確認中です。 少し待ってからもう一度実行してください。
pulls.is_ancestor=このブランチは既にターゲットブランチに含まれています。マージするものはありません。
pulls.is_empty=このブランチの変更は既にターゲットブランチにあります。これは空のコミットになります。
pulls.required_status_check_failed=いくつかの必要なステータスチェックが成功していません。
pulls.required_status_check_missing=必要なステータスチェックが見つかりません。
pulls.required_status_check_administrator=管理者であるため、このプルリクエストをマージすることは可能です。
@ -2538,6 +2540,8 @@ users.delete_account=ユーザーアカウントを削除
users.cannot_delete_self=自分自身を削除することはできません
users.still_own_repo=このユーザーはまだ1つ以上のリポジトリを所有しています。 先にそれらのリポジトリを削除するか移転してください。
users.still_has_org=このユーザーは組織のメンバーになっています。 先に組織からこのユーザーを削除してください。
users.purge=ユーザーを抹消
users.purge_help=強制的にユーザーとそのユーザーが所有していたリポジトリ、組織、パッケージを削除します。コメントもすべて削除します。
users.still_own_packages=このユーザーはまだ1つ以上のパッケージを所有しています。最初にそれらのパッケージを削除してください。
users.deletion_success=ユーザーアカウントを削除しました。
users.reset_2fa=2要素認証をリセット

6326
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -8,7 +8,7 @@
},
"dependencies": {
"@claviska/jquery-minicolors": "2.3.6",
"@primer/octicons": "17.2.0",
"@primer/octicons": "17.3.0",
"add-asset-webpack-plugin": "2.0.1",
"css-loader": "6.7.1",
"dropzone": "6.0.0-beta.2",
@ -19,16 +19,17 @@
"font-awesome": "4.7.0",
"jquery": "3.6.0",
"jquery.are-you-sure": "1.9.0",
"less": "4.1.2",
"less": "4.1.3",
"less-loader": "11.0.0",
"license-checker-webpack-plugin": "0.2.1",
"mermaid": "9.1.2",
"mini-css-extract-plugin": "2.6.0",
"mermaid": "9.1.3",
"mini-css-extract-plugin": "2.6.1",
"monaco-editor": "0.33.0",
"monaco-editor-webpack-plugin": "7.0.1",
"pretty-ms": "7.0.1",
"pretty-ms": "8.0.0",
"sortablejs": "1.15.0",
"swagger-ui-dist": "4.11.1",
"swagger-ui-dist": "4.13.0",
"tippy.js": "6.3.7",
"tributejs": "5.1.3",
"uint8-to-base64": "0.2.0",
"vue": "2.6.14",
@ -36,28 +37,28 @@
"vue-calendar-heatmap": "0.8.4",
"vue-loader": "15.9.8",
"vue-template-compiler": "2.6.14",
"webpack": "5.72.1",
"webpack-cli": "4.9.2",
"webpack": "5.73.0",
"webpack-cli": "4.10.0",
"workbox-routing": "6.5.3",
"workbox-strategies": "6.5.3",
"worker-loader": "3.0.8",
"wrap-ansi": "8.0.1"
},
"devDependencies": {
"@happy-dom/jest-environment": "4.0.1",
"@happy-dom/jest-environment": "6.0.4",
"@stoplight/spectral-cli": "6.4.1",
"eslint": "8.15.0",
"eslint": "8.20.0",
"eslint-plugin-import": "2.26.0",
"eslint-plugin-jquery": "1.5.1",
"eslint-plugin-unicorn": "42.0.0",
"eslint-plugin-vue": "9.0.1",
"jest": "28.1.0",
"jest-extended": "2.0.0",
"eslint-plugin-unicorn": "43.0.2",
"eslint-plugin-vue": "9.2.0",
"jest": "28.1.3",
"jest-extended": "3.0.1",
"postcss-less": "6.0.0",
"stylelint": "14.8.2",
"stylelint-config-standard": "25.0.0",
"stylelint": "14.9.1",
"stylelint-config-standard": "26.0.0",
"svgo": "2.8.0",
"updates": "13.0.5"
"updates": "13.1.2"
},
"browserslist": [
"defaults",

View file

@ -0,0 +1 @@
<svg viewBox="0 0 16 16" class="svg octicon-copilot-error" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.86 1.77c.05.053.097.107.14.164.043-.057.09-.111.14-.164.681-.731 1.737-.9 2.943-.765 1.23.136 2.145.527 2.724 1.26.566.716.693 1.614.693 2.485 0 .572-.053 1.147-.254 1.655l.168.838.066.033A2.75 2.75 0 0 1 16 9.736V11c0 .24-.086.438-.156.567a1.755 1.755 0 0 1-.075.125L13 9.688V7.824l-.023-.115c-.49.21-1.075.291-1.727.291-.22 0-.43-.012-.633-.036L6.824 5.22c.082-.233.143-.503.182-.813.117-.936-.038-1.396-.242-1.614-.193-.207-.637-.414-1.681-.298-.707.079-1.144.243-1.424.434l-1.251-.905c.58-.579 1.422-.899 2.51-1.02 1.205-.133 2.26.035 2.943.766zm1.376 1.023c.193-.207.637-.414 1.681-.298 1.02.114 1.48.404 1.713.7.247.313.37.79.37 1.555 0 .792-.129 1.17-.308 1.37-.162.181-.52.38-1.442.38-.854 0-1.339-.236-1.638-.54-.315-.323-.527-.827-.618-1.553-.117-.936.038-1.396.242-1.614zM.865 2.759A.75.75 0 0 0 .31 4.107l1.193.864c.013.498.076.992.251 1.434l-.167.838-.067.033A2.75 2.75 0 0 0 0 9.736V11c0 .24.086.438.156.567.075.137.169.261.259.366.18.21.404.413.605.58a10.368 10.368 0 0 0 .792.597l.015.01.006.004.028.018.098.065a12.06 12.06 0 0 0 1.654.859C4.704 14.527 6.244 15 8 15c1.756 0 3.296-.472 4.387-.935.395-.167.734-.335 1.008-.482l1.415 1.024a.75.75 0 0 0 1.063-1.025.753.753 0 0 1-.188-.1L.865 2.76zM4.75 8c.297 0 .579-.022.844-.066l6.427 4.654c-.07.032-.144.064-.22.097-.972.412-2.307.815-3.801.815-1.494 0-2.83-.403-3.8-.815a10.594 10.594 0 0 1-1.2-.6v-4.26l.023-.116c.49.21 1.075.291 1.727.291z"/></svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View file

@ -0,0 +1 @@
<svg viewBox="0 0 16 16" class="svg octicon-copilot-warning" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.86 1.77c.05.053.097.107.14.164.043-.057.09-.111.14-.164.681-.731 1.737-.9 2.943-.765 1.23.136 2.145.527 2.724 1.26.566.716.693 1.614.693 2.485 0 .463-.035.929-.155 1.359a5.967 5.967 0 0 0-1.398-.616c.034-.195.053-.439.053-.743 0-.766-.123-1.242-.37-1.555-.233-.296-.693-.586-1.713-.7-1.044-.116-1.488.091-1.681.298-.204.218-.359.678-.242 1.614.06.479.172.86.332 1.158a6.014 6.014 0 0 0-2.92 2.144C5.926 7.904 5.372 8 4.75 8c-.652 0-1.237-.082-1.727-.291L3 7.824v4.261c.02.013.043.025.065.038a10.84 10.84 0 0 0 2.495 1.035c.21.629.522 1.21.916 1.726a11.91 11.91 0 0 1-2.863-.819 12.06 12.06 0 0 1-1.296-.641 8.815 8.815 0 0 1-.456-.281l-.028-.02-.006-.003-.015-.01a7.077 7.077 0 0 1-.235-.166c-.15-.108-.352-.26-.557-.43a5.19 5.19 0 0 1-.605-.58 2.167 2.167 0 0 1-.259-.367A1.19 1.19 0 0 1 0 11V9.736a2.75 2.75 0 0 1 1.52-2.46l.067-.033.167-.838C1.553 5.897 1.5 5.322 1.5 4.75c0-.87.127-1.77.693-2.485.579-.733 1.494-1.124 2.724-1.26 1.206-.134 2.262.034 2.944.765zM6.765 2.793c-.193-.207-.637-.414-1.681-.298-1.02.114-1.48.404-1.713.7-.247.313-.37.79-.37 1.555 0 .792.129 1.17.308 1.37.162.181.52.38 1.442.38.854 0 1.339-.236 1.638-.54.315-.323.527-.827.618-1.553.117-.936-.038-1.396-.242-1.614z"/><path fill-rule="evenodd" d="M8.498 14.81a4.5 4.5 0 1 0 5.504-7.121 4.5 4.5 0 0 0-5.504 7.122zM10.5 8.75a.75.75 0 0 1 1.5 0V11a.75.75 0 0 1-1.5 0V8.75zm.75 5.75a1 1 0 1 0 0-2 1 1 0 0 0 0 2z"/></svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View file

@ -0,0 +1 @@
<svg viewBox="0 0 16 16" class="svg octicon-copilot" width="16" height="16" aria-hidden="true"><path d="M6.25 9a.75.75 0 0 1 .75.75v1.5a.75.75 0 0 1-1.5 0v-1.5A.75.75 0 0 1 6.25 9zm4.25.75a.75.75 0 0 0-1.5 0v1.5a.75.75 0 0 0 1.5 0v-1.5z"/><path fill-rule="evenodd" d="M7.86 1.77c.05.053.097.107.14.164.043-.057.09-.111.14-.164.681-.731 1.737-.9 2.943-.765 1.23.136 2.145.527 2.724 1.26.566.716.693 1.614.693 2.485 0 .572-.053 1.147-.254 1.655l.168.838.066.033A2.75 2.75 0 0 1 16 9.736V11c0 .24-.086.438-.156.567a2.173 2.173 0 0 1-.259.366c-.18.21-.404.413-.605.58a10.373 10.373 0 0 1-.792.597l-.015.01-.006.004-.028.018a8.832 8.832 0 0 1-.456.281c-.307.177-.749.41-1.296.642C11.296 14.528 9.756 15 8 15c-1.756 0-3.296-.472-4.387-.935a12.06 12.06 0 0 1-1.296-.641 8.815 8.815 0 0 1-.456-.281l-.028-.02-.006-.003-.015-.01a7.077 7.077 0 0 1-.235-.166c-.15-.108-.352-.26-.557-.43a5.19 5.19 0 0 1-.605-.58 2.167 2.167 0 0 1-.259-.367A1.19 1.19 0 0 1 0 11V9.736a2.75 2.75 0 0 1 1.52-2.46l.067-.033.167-.838C1.553 5.897 1.5 5.322 1.5 4.75c0-.87.127-1.77.693-2.485.579-.733 1.494-1.124 2.724-1.26 1.206-.134 2.262.034 2.944.765zM3.024 7.709 3 7.824v4.261c.02.013.043.025.065.038.264.152.65.356 1.134.562.972.412 2.307.815 3.801.815 1.494 0 2.83-.403 3.8-.815a10.6 10.6 0 0 0 1.2-.6v-4.26l-.023-.116c-.49.21-1.075.291-1.727.291-1.146 0-2.06-.328-2.71-.991A3.223 3.223 0 0 1 8 6.266c-.144.269-.321.52-.54.743C6.81 7.672 5.896 8 4.75 8c-.652 0-1.237-.082-1.727-.291zm3.741-4.916c-.193-.207-.637-.414-1.681-.298-1.02.114-1.48.404-1.713.7-.247.313-.37.79-.37 1.555 0 .792.129 1.17.308 1.37.162.181.52.38 1.442.38.854 0 1.339-.236 1.638-.54.315-.323.527-.827.618-1.553.117-.936-.038-1.396-.242-1.614zm2.472 0c.193-.207.637-.414 1.681-.298 1.02.114 1.48.404 1.713.7.247.313.37.79.37 1.555 0 .792-.129 1.17-.308 1.37-.162.181-.52.38-1.442.38-.854 0-1.339-.236-1.638-.54-.315-.323-.527-.827-.618-1.553-.117-.936.038-1.396.242-1.614z"/></svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

View file

@ -823,7 +823,7 @@ func DismissPullReview(ctx *context.APIContext) {
// "422":
// "$ref": "#/responses/validationError"
opts := web.GetForm(ctx).(*api.DismissPullReviewOptions)
dismissReview(ctx, opts.Message, true)
dismissReview(ctx, opts.Message, true, opts.Priors)
}
// UnDismissPullReview cancel to dismiss a review for a pull request
@ -863,10 +863,10 @@ func UnDismissPullReview(ctx *context.APIContext) {
// "$ref": "#/responses/forbidden"
// "422":
// "$ref": "#/responses/validationError"
dismissReview(ctx, "", false)
dismissReview(ctx, "", false, false)
}
func dismissReview(ctx *context.APIContext, msg string, isDismiss bool) {
func dismissReview(ctx *context.APIContext, msg string, isDismiss, dismissPriors bool) {
if !ctx.Repo.IsAdmin() {
ctx.Error(http.StatusForbidden, "", "Must be repo admin")
return
@ -886,7 +886,7 @@ func dismissReview(ctx *context.APIContext, msg string, isDismiss bool) {
return
}
_, err := pull_service.DismissReview(ctx, review.ID, ctx.Repo.Repository.ID, msg, ctx.Doer, isDismiss)
_, err := pull_service.DismissReview(ctx, review.ID, ctx.Repo.Repository.ID, msg, ctx.Doer, isDismiss, dismissPriors)
if err != nil {
ctx.Error(http.StatusInternalServerError, "pull_service.DismissReview", err)
return

View file

@ -45,6 +45,7 @@ func Members(ctx *context.Context) {
}
opts.PublicOnly = !isMember && !ctx.Doer.IsAdmin
}
ctx.Data["PublicOnly"] = opts.PublicOnly
total, err := organization.CountOrgMembers(opts)
if err != nil {

View file

@ -242,7 +242,7 @@ func SubmitReview(ctx *context.Context) {
// DismissReview dismissing stale review by repo admin
func DismissReview(ctx *context.Context) {
form := web.GetForm(ctx).(*forms.DismissReviewForm)
comm, err := pull_service.DismissReview(ctx, form.ReviewID, ctx.Repo.Repository.ID, form.Message, ctx.Doer, true)
comm, err := pull_service.DismissReview(ctx, form.ReviewID, ctx.Repo.Repository.ID, form.Message, ctx.Doer, true, true)
if err != nil {
ctx.ServerError("pull_service.DismissReview", err)
return

View file

@ -20,6 +20,7 @@ import (
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/notification"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/util"
)
// CreateCodeComment creates a comment on the code line
@ -271,7 +272,7 @@ func SubmitReview(ctx context.Context, doer *user_model.User, gitRepo *git.Repos
}
// DismissReview dismissing stale review by repo admin
func DismissReview(ctx context.Context, reviewID, repoID int64, message string, doer *user_model.User, isDismiss bool) (comment *issues_model.Comment, err error) {
func DismissReview(ctx context.Context, reviewID, repoID int64, message string, doer *user_model.User, isDismiss, dismissPriors bool) (comment *issues_model.Comment, err error) {
review, err := issues_model.GetReviewByID(ctx, reviewID)
if err != nil {
return
@ -295,6 +296,22 @@ func DismissReview(ctx context.Context, reviewID, repoID int64, message string,
return
}
if dismissPriors {
reviews, err := issues_model.GetReviews(ctx, &issues_model.GetReviewOptions{
IssueID: review.IssueID,
ReviewerID: review.ReviewerID,
Dismissed: util.OptionalBoolFalse,
})
if err != nil {
return nil, err
}
for _, oldReview := range reviews {
if err = issues_model.DismissReview(oldReview, true); err != nil {
return nil, err
}
}
}
if !isDismiss {
return nil, nil
}

View file

@ -29,28 +29,30 @@
{{end}}
</div>
</div>
<div class="ui three wide column center">
<div class="meta">
{{$.locale.Tr "org.members.member_role"}}
{{if not .PublicOnly}}
<div class="ui three wide column center">
<div class="meta">
{{$.locale.Tr "org.members.member_role"}}
</div>
<div class="meta">
<strong>{{if index $.MembersIsUserOrgOwner .ID}}{{svg "octicon-shield-lock"}} {{$.locale.Tr "org.members.owner"}}{{else}}{{$.locale.Tr "org.members.member"}}{{end}}</strong>
</div>
</div>
<div class="meta">
<strong>{{if index $.MembersIsUserOrgOwner .ID}}{{svg "octicon-shield-lock"}} {{$.locale.Tr "org.members.owner"}}{{else}}{{$.locale.Tr "org.members.member"}}{{end}}</strong>
<div class="ui two wide column center">
<div class="meta">
{{$.locale.Tr "admin.users.2fa"}}
</div>
<div class="meta">
<strong>
{{if index $.MembersTwoFaStatus .ID}}
<span class="text green">{{svg "octicon-check"}}</span>
{{else}}
{{svg "octicon-x"}}
{{end}}
</strong>
</div>
</div>
</div>
<div class="ui two wide column center">
<div class="meta">
{{$.locale.Tr "admin.users.2fa"}}
</div>
<div class="meta">
<strong>
{{if index $.MembersTwoFaStatus .ID}}
<span class="text green">{{svg "octicon-check"}}</span>
{{else}}
{{svg "octicon-x"}}
{{end}}
</strong>
</div>
</div>
{{end}}
<div class="ui three wide column">
<div class="text right">
{{if eq $.SignedUser.ID .ID}}

View file

@ -340,7 +340,8 @@
</a>
<span class="text grey">
<a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
{{$.locale.Tr "repo.issues.due_date_modified" (.Content | ParseDeadline) $createdStr | Safe}}
{{$parsedDeadline := .Content | ParseDeadline}}
{{$.locale.Tr "repo.issues.due_date_modified" (index $parsedDeadline 0) (index $parsedDeadline 1) $createdStr | Safe}}
</span>
</div>
{{else if eq .Type 18}}

View file

@ -15074,6 +15074,10 @@
"message": {
"type": "string",
"x-go-name": "Message"
},
"priors": {
"type": "boolean",
"x-go-name": "Priors"
}
},
"x-go-package": "code.gitea.io/gitea/modules/structs"

View file

@ -2,6 +2,7 @@ import $ from 'jquery';
import Vue from 'vue';
import ContextPopup from '../components/ContextPopup.vue';
import {parseIssueHref} from '../utils.js';
import {createTippy} from '../modules/tippy.js';
export default function initContextPopups() {
const refIssues = $('.ref-issue');
@ -16,7 +17,6 @@ export default function initContextPopups() {
if (!owner) return;
const el = document.createElement('div');
el.className = 'ui custom popup hidden';
el.innerHTML = '<div></div>';
this.parentNode.insertBefore(el, this.nextSibling);
@ -33,17 +33,12 @@ export default function initContextPopups() {
el.textContent = 'ContextPopup failed to load';
}
$(this).popup({
variation: 'wide',
delay: {
show: 250
},
createTippy(this, {
content: el,
interactive: true,
onShow: () => {
view.$emit('load-context-popup', {owner, repo, index}, () => {
$(this).popup('reposition');
});
},
popup: $(el),
view.$emit('load-context-popup', {owner, repo, index});
}
});
});
}

View file

@ -0,0 +1,12 @@
import tippy from 'tippy.js';
export function createTippy(target, opts) {
return tippy(target, {
appendTo: document.body,
placement: 'top-start',
animation: false,
allowHTML: true,
arrow: `<svg width="16" height="7"><path d="m0 7 8-7 8 7Z" class="tippy-svg-arrow-outer"/><path d="m0 8 8-7 8 7Z" class="tippy-svg-arrow-inner"/></svg>`,
...opts,
});
}

View file

@ -326,7 +326,7 @@ a.commit-statuses-trigger {
.ui.action.input:not([class*="left action"]) > .ui.dropdown.selection {
min-width: 10em;
&:not(:focus):not(:hover) {
&:not(:focus,:hover) {
border-right-color: transparent;
}
}
@ -1205,7 +1205,7 @@ a.ui.card:hover,
&.pagination.menu {
@media @mediaSm {
.item:not(.active):not(.navigation),
.item:not(.active,.navigation),
.item.navigation span.navigation_label {
display: none;
}

View file

@ -494,7 +494,10 @@
object-fit: contain;
}
/* also see misc.css for one more related rule */
img[src$='.svg' i] {
max-height: 600px !important;
max-width: 600px !important;
}
}
.plain-text {

View file

@ -9,6 +9,7 @@
@import "./features/imagediff.less";
@import "./features/codeeditor.less";
@import "./features/projects.less";
@import "./modules/tippy.less";
@import "./markup/content.less";
@import "./markup/codecopy.less";
@import "./code/linebutton.less";

View file

@ -1,5 +0,0 @@
/* can not have this selector in less because of https://github.com/less/less.js/issues/3027 */
.view-raw img[src$='.svg' i] {
max-height: 600px !important;
max-width: 600px !important;
}

View file

@ -0,0 +1,84 @@
/* styles are based on node_modules/tippy.js/dist/tippy.css */
.tippy-box[data-animation="fade"][data-state="hidden"] {
opacity: 0;
}
[data-tippy-root] {
max-width: calc(100vw - 10px);
}
.tippy-box {
position: relative;
background-color: var(--color-body);
color: var(--color-secondary-dark-6);
border: 1px solid var(--color-secondary);
border-radius: var(--border-radius);
font-size: 1rem;
transition-property: transform, visibility, opacity;
}
.tippy-content {
position: relative;
padding: 1rem;
z-index: 1;
}
.tippy-box[data-placement^="top"] > .tippy-svg-arrow {
bottom: 0;
}
.tippy-box[data-placement^="top"] > .tippy-svg-arrow::after,
.tippy-box[data-placement^="top"] > .tippy-svg-arrow > svg {
top: 16px;
transform: rotate(180deg);
}
.tippy-box[data-placement^="bottom"] > .tippy-svg-arrow {
top: 0;
}
.tippy-box[data-placement^="bottom"] > .tippy-svg-arrow > svg {
bottom: 16px;
}
.tippy-box[data-placement^="left"] > .tippy-svg-arrow {
right: 0;
}
.tippy-box[data-placement^="left"] > .tippy-svg-arrow::after,
.tippy-box[data-placement^="left"] > .tippy-svg-arrow > svg {
transform: rotate(90deg);
top: calc(50% - 3px);
left: 11px;
}
.tippy-box[data-placement^="right"] > .tippy-svg-arrow {
left: 0;
}
.tippy-box[data-placement^="right"] > .tippy-svg-arrow::after,
.tippy-box[data-placement^="right"] > .tippy-svg-arrow > svg {
transform: rotate(-90deg);
top: calc(50% - 3px);
right: 11px;
}
.tippy-svg-arrow {
width: 16px;
height: 16px;
text-align: initial;
}
.tippy-svg-arrow,
.tippy-svg-arrow > svg {
position: absolute;
}
.tippy-svg-arrow-outer {
fill: var(--color-secondary);
}
.tippy-svg-arrow-inner {
fill: var(--color-body);
}

View file

@ -185,7 +185,7 @@ a.ui.basic.green.label:hover {
color: #fff !important;
}
.ui.divider:not(.vertical):not(.horizontal) {
.ui.divider:not(.vertical,.horizontal) {
border-bottom-color: var(--color-secondary);
border-top-color: transparent;
}

View file

@ -50,7 +50,6 @@ export default {
fileURLToPath(new URL('web_src/js/index.js', import.meta.url)),
fileURLToPath(new URL('node_modules/easymde/dist/easymde.min.css', import.meta.url)),
fileURLToPath(new URL('web_src/fomantic/build/semantic.css', import.meta.url)),
fileURLToPath(new URL('web_src/less/misc.css', import.meta.url)),
fileURLToPath(new URL('web_src/less/index.less', import.meta.url)),
],
swagger: [