Skip to content

Commit a2225b2

Browse files
committed
Merge remote-tracking branch 'giteaofficial/main'
* giteaofficial/main: Fix issue label delete incorrect labels webhook payload (go-gitea#34575) fixed incorrect page navigation with up and down arrow on last item of dashboard repos (go-gitea#34570) Remove unnecessary duplicate code (go-gitea#34552) Make pull request and issue history more compact (go-gitea#34588)
2 parents ae6b8ee + 79cc369 commit a2225b2

File tree

5 files changed

+16
-26
lines changed

5 files changed

+16
-26
lines changed

models/issues/issue_label.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ func DeleteIssueLabel(ctx context.Context, issue *Issue, label *Label, doer *use
206206
}
207207

208208
issue.Labels = nil
209+
issue.isLabelsLoaded = false
209210
return issue.LoadLabels(ctx)
210211
}
211212

routers/web/user/notification.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -287,16 +287,8 @@ func NotificationSubscriptions(ctx *context.Context) {
287287
ctx.Data["CommitLastStatus"] = lastStatus
288288
ctx.Data["CommitStatuses"] = commitStatuses
289289
ctx.Data["Issues"] = issues
290-
291290
ctx.Data["IssueRefEndNames"], ctx.Data["IssueRefURLs"] = issue_service.GetRefEndNamesAndURLs(issues, "")
292291

293-
commitStatus, err := pull_service.GetIssuesLastCommitStatus(ctx, issues)
294-
if err != nil {
295-
ctx.ServerError("GetIssuesLastCommitStatus", err)
296-
return
297-
}
298-
ctx.Data["CommitStatus"] = commitStatus
299-
300292
approvalCounts, err := issues.GetApprovalCounts(ctx)
301293
if err != nil {
302294
ctx.ServerError("ApprovalCounts", err)

services/pull/pull.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -945,12 +945,6 @@ func GetSquashMergeCommitMessages(ctx context.Context, pr *issues_model.PullRequ
945945
return stringBuilder.String()
946946
}
947947

948-
// GetIssuesLastCommitStatus returns a map of issue ID to the most recent commit's latest status
949-
func GetIssuesLastCommitStatus(ctx context.Context, issues issues_model.IssueList) (map[int64]*git_model.CommitStatus, error) {
950-
_, lastStatus, err := GetIssuesAllCommitStatus(ctx, issues)
951-
return lastStatus, err
952-
}
953-
954948
// GetIssuesAllCommitStatus returns a map of issue ID to a list of all statuses for the most recent commit as well as a map of issue ID to only the commit's latest status
955949
func GetIssuesAllCommitStatus(ctx context.Context, issues issues_model.IssueList) (map[int64][]*git_model.CommitStatus, map[int64]*git_model.CommitStatus, error) {
956950
if err := issues.LoadPullRequests(ctx); err != nil {

web_src/css/repo.css

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ td .commit-summary {
523523

524524
.repository.view.issue .comment-list .timeline-item,
525525
.repository.view.issue .comment-list .timeline-item-group {
526-
padding: 16px 0;
526+
padding: 8px 0;
527527
}
528528

529529
.repository.view.issue .comment-list .timeline-item-group .timeline-item {
@@ -577,6 +577,11 @@ td .commit-summary {
577577
justify-content: center;
578578
}
579579

580+
.repository.view.issue .comment-list .timeline-item.commits-list .badge {
581+
margin-right: 0;
582+
height: 28px;
583+
}
584+
580585
.repository.view.issue .comment-list .timeline-item .badge .svg {
581586
width: 22px;
582587
height: 22px;
@@ -601,10 +606,6 @@ td .commit-summary {
601606
padding-top: 0;
602607
}
603608

604-
.repository.view.issue .comment-list .timeline-item.commits-list .ui.avatar {
605-
margin-right: 0.25em;
606-
}
607-
608609
.repository.view.issue .comment-list .timeline-item.event > .commit-status-link {
609610
float: right;
610611
margin-right: 8px;

web_src/js/components/DashboardRepoList.vue

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,9 @@ export default defineComponent({
219219
this.searchRepos();
220220
},
221221
222-
changePage(page: number) {
222+
async changePage(page: number) {
223+
if (this.isLoading) return;
224+
223225
this.page = page;
224226
if (this.page > this.finalPage) {
225227
this.page = this.finalPage;
@@ -229,7 +231,7 @@ export default defineComponent({
229231
}
230232
this.repos = [];
231233
this.counts[`${this.reposFilter}:${this.archivedFilter}:${this.privateFilter}`] = 0;
232-
this.searchRepos();
234+
await this.searchRepos();
233235
},
234236
235237
async searchRepos() {
@@ -299,7 +301,7 @@ export default defineComponent({
299301
return commitStatus[status].color;
300302
},
301303
302-
reposFilterKeyControl(e: KeyboardEvent) {
304+
async reposFilterKeyControl(e: KeyboardEvent) {
303305
switch (e.key) {
304306
case 'Enter':
305307
document.querySelector<HTMLAnchorElement>('.repo-owner-name-list li.active a')?.click();
@@ -308,7 +310,7 @@ export default defineComponent({
308310
if (this.activeIndex > 0) {
309311
this.activeIndex--;
310312
} else if (this.page > 1) {
311-
this.changePage(this.page - 1);
313+
await this.changePage(this.page - 1);
312314
this.activeIndex = this.searchLimit - 1;
313315
}
314316
break;
@@ -317,17 +319,17 @@ export default defineComponent({
317319
this.activeIndex++;
318320
} else if (this.page < this.finalPage) {
319321
this.activeIndex = 0;
320-
this.changePage(this.page + 1);
322+
await this.changePage(this.page + 1);
321323
}
322324
break;
323325
case 'ArrowRight':
324326
if (this.page < this.finalPage) {
325-
this.changePage(this.page + 1);
327+
await this.changePage(this.page + 1);
326328
}
327329
break;
328330
case 'ArrowLeft':
329331
if (this.page > 1) {
330-
this.changePage(this.page - 1);
332+
await this.changePage(this.page - 1);
331333
}
332334
break;
333335
}

0 commit comments

Comments
 (0)