8000 Add reviewers selection to new pull request fixes #26289 by CalK16 · Pull Request #32403 · go-gitea/gitea · GitHub
[go: up one dir, main page]

Skip to content

Add reviewers selection to new pull request fixes #26289 #32403

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 30 commits into from
Nov 9, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
d37f246
Add reviewers selection to new pull request form
splitt3r Aug 19, 2023
5929b87
Add translatanle clear reviewers label
splitt3r Aug 19, 2023
452828a
Add missing continue statement
splitt3r Aug 19, 2023
906514e
Check pr creator permissions
splitt3r Sep 1, 2023
45b8a96
Remove unintended change
splitt3r Sep 1, 2023
3e0dcea
Check if Pull + run linter
splitt3r Sep 9, 2023
978c465
Fix invisible class name
sebastian-sauer Oct 20, 2023
c92202e
Add request review to API
sebastian-sauer Oct 20, 2023
df3f363
Fix call to locale in tmpl
sebastian-sauer Nov 15, 2023
e4858b2
Improve markup
sebastian-sauer Nov 15, 2023
f604ab1
Fix teamreviewer ids
sebastian-sauer Nov 15, 2023
60d9d96
update template to merge main
CalK16 Oct 31, 2024
f7c0ea4
move logics to proper file
CalK16 Nov 2, 2024
c34dd4a
postpone the review request notification
CalK16 Nov 2, 2024
f7f0b7a
Merge branch 'main' into main
CalK16 Nov 2, 2024
0304324
fix linting issues
CalK16 Nov 2, 2024
800232b
more updates on templates
CalK16 Nov 3, 2024
d8d66b5
simplify a condition statement
CalK16 Nov 3, 2024
25ebf69
fix an internal error
CalK16 Nov 3, 2024
418a13c
Merge branch 'main' into CalK16-pr-reviewer
wxiaoguang Nov 3, 2024
941f7fd
fix conflicts
wxiaoguang Nov 3, 2024
a2a06f1
Merge branch 'main' into CalK16-pr-reviewer
wxiaoguang Nov 8, 2024
8de6e40
make code easier to maintain
wxiaoguang Nov 8, 2024
6fb9583
fix duplicate code
wxiaoguang Nov 8, 2024
e4e2de3
refactor reviewer list
wxiaoguang Nov 8, 2024
637e4fb
fix lint
wxiaoguang Nov 8, 2024
4c9169a
Merge branch 'main' into CalK16-pr-reviewer
wxiaoguang Nov 8, 2024
9ccb69c
fix lint
wxiaoguang Nov 8, 2024
1759ea4
fine tune
wxiaoguang Nov 8, 2024
be102f5
fine tune and add comments
wxiaoguang Nov 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fine tune and add comments
  • Loading branch information
wxiaoguang committed Nov 9, 2024
commit be102f58841e751acffc2dae3a00c82615cdb5e6
3 changes: 3 additions & 0 deletions routers/web/repo/compare.go
Original file line number Diff line number Diff line change
Expand Up @@ -789,6 +789,9 @@ func CompareDiff(ctx *context.Context) {
if !nothingToCompare {
// Setup information for new form.
RetrieveRepoMetas(ctx, ctx.Repo.Repository, true)
if ctx.Written() {
return
}
RetrieveRepoReviewers(ctx, ctx.Repo.Repository, nil, true)
if ctx.Written() {
return
Expand Down
4 changes: 2 additions & 2 deletions routers/web/repo/issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ func renderMilestones(ctx *context.Context) {
ctx.Data["ClosedMilestones"] = closedMilestones
}

// RetrieveRepoMilestonesAndAssignees find all the milestones, assignees, and reviewers of a repository
// RetrieveRepoMilestonesAndAssignees find all the milestones and assignees of a repository
func RetrieveRepoMilestonesAndAssignees(ctx *context.Context, repo *repo_model.Repository) {
var err error
ctx.Data["OpenMilestones"], err = db.Find[issues_model.Milestone](ctx, issues_model.FindMilestoneOptions{
Expand Down Expand Up @@ -676,7 +676,7 @@ type issueSidebarReviewersData struct {
CurrentPullReviewers []*repoReviewerSelection
}

// RetrieveRepoReviewers find all reviewers of a repository
// RetrieveRepoReviewers find all reviewers of a repository. If issue is nil, it means the doer is creating a new PR.
func RetrieveRepoReviewers(ctx *context.Context, repo *repo_model.Repository, issue *issues_model.Issue, canChooseReviewer bool) {
data := &issueSidebarReviewersData{}
data.RepoLink = ctx.Repo.RepoLink
Expand Down
8 changes: 4 additions & 4 deletions templates/repo/issue/sidebar/reviewer_list.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
</div>
</div>

<div class="ui list flex-items-block">
<div class="ui relaxed list flex-items-block tw-my-4">
<span class="item empty-list {{if or $data.OriginalReviews $data.CurrentPullReviewers}}tw-hidden{{end}}">
{{ctx.Locale.Tr "repo.issues.new.no_reviewers"}}
</span>
Expand Down Expand Up @@ -81,7 +81,7 @@
</div>
</div>
{{end}}
{{range .OriginalReviews}}
{{range $data.OriginalReviews}}
<div class="item">
<div class="flex-text-inline tw-flex-1">
{{$originalURLHostname := $data.Repository.GetOriginalURLHostname}}
Expand Down Expand Up @@ -112,8 +112,8 @@
{{ctx.RootData.CsrfTokenHtml}}
<input type="hidden" class="reviewer-id" name="review_id">
<div class="field">
<label for="message">{{ctx.Locale.Tr "action.review_dismissed_reason"}}</label>
<input id="message" name="message">
<label for="issue-sidebar-dismiss-review-message">{{ctx.Locale.Tr "action.review_dismissed_reason"}}</label>
<input id="issue-sidebar-dismiss-review-message" name="message">
</div>
<div class="text right actions">
<button class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button>
Expand Down
1 change: 1 addition & 0 deletions web_src/css/repo.css
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
.issue-sidebar-combo .ui.dropdown .item:not(.checked) svg.octicon-check {
visibility: hidden;
}
/* ideally, we should move these styles to ".ui.dropdown .menu.flex-items-menu > .item ...", could be done later */
.issue-sidebar-combo .ui.dropdown .menu > .item > img,
.issue-sidebar-combo .ui.dropdown .menu > .item > svg {
margin: 0;
Expand Down
4 changes: 2 additions & 2 deletions web_src/js/features/repo-issue-sidebar-combolist.ts
8673
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ export function initIssueSidebarComboList(container: HTMLElement) {
async onHide() {
const changedValues = collectCheckedValues(elDropdown);
if (updateUrl) {
await updateToBackend(changedValues);
await updateToBackend(changedValues); // send requests to backend and reload the page
} else {
syncList(changedValues);
syncList(changedValues); // only update the list in the sidebar
}
},
});
Expand Down
Loading
0