Skip to content

Commit ea2981b

Browse files
authored
Merge branch 'main' into fix-htmlurl
2 parents 0aad62f + affdd40 commit ea2981b

File tree

15 files changed

+116
-101
lines changed

15 files changed

+116
-101
lines changed

models/issues/issue_xref.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -277,26 +277,26 @@ func CommentTypeIsRef(t CommentType) bool {
277277
return t == CommentTypeCommentRef || t == CommentTypePullRef || t == CommentTypeIssueRef
278278
}
279279

280-
// RefCommentHTMLURL returns the HTML URL for the comment that created this reference
281-
func (c *Comment) RefCommentHTMLURL() string {
280+
// RefCommentLink returns the relative URL for the comment that created this reference
281+
func (c *Comment) RefCommentLink() string {
282282
// Edge case for when the reference is inside the title or the description of the referring issue
283283
if c.RefCommentID == 0 {
284-
return c.RefIssueHTMLURL()
284+
return c.RefIssueLink()
285285
}
286286
if err := c.LoadRefComment(); err != nil { // Silently dropping errors :unamused:
287287
log.Error("LoadRefComment(%d): %v", c.RefCommentID, err)
288288
return ""
289289
}
290-
return c.RefComment.HTMLURL()
290+
return c.RefComment.Link()
291291
}
292292

293-
// RefIssueHTMLURL returns the HTML URL of the issue where this reference was created
294-
func (c *Comment) RefIssueHTMLURL() string {
293+
// RefIssueLink returns the relative URL of the issue where this reference was created
294+
func (c *Comment) RefIssueLink() string {
295295
if err := c.LoadRefIssue(); err != nil { // Silently dropping errors :unamused:
296296
log.Error("LoadRefIssue(%d): %v", c.RefCommentID, err)
297297
return ""
298298
}
299-
return c.RefIssue.HTMLURL()
299+
return c.RefIssue.Link()
300300
}
301301

302302
// RefIssueTitle returns the title of the issue where this reference was created

modules/templates/helper.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ func NewFuncMap() []template.FuncMap {
7272
return setting.StaticURLPrefix + "/assets"
7373
},
7474
"AppUrl": func() string {
75+
// The usage of AppUrl should be avoided as much as possible,
76+
// because the AppURL(ROOT_URL) may not match user's visiting site and the ROOT_URL in app.ini may be incorrect.
77+
// And it's difficult for Gitea to guess absolute URL correctly with zero configuration,
78+
// because Gitea doesn't know whether the scheme is HTTP or HTTPS unless the reverse proxy could tell Gitea.
7579
return setting.AppURL
7680
},
7781
"AppVer": func() string {

services/pull/update.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ func IsUserAllowedToUpdate(ctx context.Context, pull *issues_model.PullRequest,
106106
BaseBranch: pull.HeadBranch,
107107
}
108108

109-
pb, err := git_model.GetFirstMatchProtectedBranchRule(ctx, pull.BaseRepoID, pull.BaseBranch)
109+
pb, err := git_model.GetFirstMatchProtectedBranchRule(ctx, pr.BaseRepoID, pr.BaseBranch)
110110
if err != nil {
111111
return false, false, err
112112
}

templates/projects/view.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@
238238
{{end}}
239239
<div class="right floated">
240240
{{range .Assignees}}
241-
<a class="tooltip" target="_blank" href="{{.HTMLURL}}" data-content="{{$.locale.Tr "repo.projects.board.assigned_to"}} {{.Name}}">{{avatar . 28 "mini mr-3"}}</a>
241+
<a class="tooltip" target="_blank" href="{{.HomeLink}}" data-content="{{$.locale.Tr "repo.projects.board.assigned_to"}} {{.Name}}">{{avatar . 28 "mini mr-3"}}</a>
242242
{{end}}
243243
</div>
244244
</div>

templates/repo/actions/runs_list.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
</div>
77
<div class="issue-item-main f1 fc df">
88
<div class="issue-item-top-row">
9-
<a class="index ml-0 mr-2" href="{{if .HTMLURL}}{{.HTMLURL}}{{else}}{{$.Link}}/{{.Index}}{{end}}">
9+
<a class="index ml-0 mr-2" href="{{if .Link}}{{.Link}}{{else}}{{$.Link}}/{{.Index}}{{end}}">
1010
{{.Title}}
1111
</a>
1212
<span class="ui label">

templates/repo/issue/list.tmpl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,13 @@
7777
<!-- Project -->
7878
<div class="ui{{if not (or .OpenProjects .ClosedProjects)}} disabled{{end}} dropdown jump item">
7979
<span class="text">
80-
{{.locale.Tr "repo.issues.filter_projects"}}
80+
{{.locale.Tr "repo.issues.filter_project"}}
8181
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
8282
</span>
8383
<div class="menu">
8484
<div class="ui icon search input">
8585
<i class="icon df ac jc">{{svg "octicon-search" 16}}</i>
86-
<input type="text" placeholder="{{.locale.Tr "repo.issues.filter_projects"}}">
86+
<input type="text" placeholder="{{.locale.Tr "repo.issues.filter_project"}}">
8787
</div>
8888
<a class="item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_project_all"}}</a>
8989
<a class="item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&project=-1&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_project_none"}}</a>
@@ -276,7 +276,6 @@
276276
{{.Title}}
277277
</div>
278278
{{end}}
279-
</div>
280279
{{end}}
281280
</div>
282281
</div>

templates/repo/issue/view_content/comments.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,12 +151,12 @@
151151
{{if eq .RefAction 3}}<del>{{end}}
152152
<span class="text grey muted-links">
153153
{{template "shared/user/authorlink" .Poster}}
154-
{{$.locale.Tr $refTr (.EventTag|Escape) $createdStr (.RefCommentHTMLURL|Escape) $refFrom | Safe}}
154+
{{$.locale.Tr $refTr (.EventTag|Escape) $createdStr (.RefCommentLink|Escape) $refFrom | Safe}}
155155
</span>
156156
{{if eq .RefAction 3}}</del>{{end}}
157157

158158
<div class="detail">
159-
<span class="text grey muted-links"><a href="{{.RefIssueHTMLURL}}"><b>{{.RefIssueTitle}}</b> {{.RefIssueIdent}}</a></span>
159+
<span class="text grey muted-links"><a href="{{.RefIssueLink}}"><b>{{.RefIssueTitle}}</b> {{.RefIssueIdent}}</a></span>
160160
</div>
161161
</div>
162162
{{else if eq .Type 4}}

templates/repo/issue/view_content/pull.tmpl

Lines changed: 69 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -303,79 +303,78 @@
303303
{{$hasPendingPullRequestMergeTip = $.locale.Tr "repo.pulls.auto_merge_has_pending_schedule" .PendingPullRequestMerge.Doer.Name $createdPRMergeStr}}
304304
{{end}}
305305
<div class="ui divider"></div>
306-
<script>
307-
(() => {
308-
const defaultMergeTitle = {{.DefaultMergeMessage}};
309-
const defaultSquashMergeTitle = {{.DefaultSquashMergeMessage}};
310-
const defaultMergeMessage = {{if .DefaultMergeBody}}{{.DefaultMergeBody}}{{else}}'Reviewed-on: ' + {{$.Issue.HTMLURL}} + '\n' + {{$approvers}}{{end}};
311-
const defaultSquashMergeMessage = {{if .DefaultSquashMergeBody}}{{.DefaultSquashMergeBody}}{{else}}'Reviewed-on: ' + {{$.Issue.HTMLURL}} + '\n' + {{$approvers}}{{end}};
312-
const mergeForm = {
313-
'baseLink': {{.Link}},
314-
'textCancel': {{$.locale.Tr "cancel"}},
315-
'textDeleteBranch': {{$.locale.Tr "repo.branch.delete" .HeadTarget}},
316-
'textAutoMergeButtonWhenSucceed': {{$.locale.Tr "repo.pulls.auto_merge_button_when_succeed"}},
317-
'textAutoMergeWhenSucceed': {{$.locale.Tr "repo.pulls.auto_merge_when_succeed"}},
318-
'textAutoMergeCancelSchedule': {{$.locale.Tr "repo.pulls.auto_merge_cancel_schedule"}},
319-
'textClearMergeMessage': {{$.locale.Tr "repo.pulls.clear_merge_message"}},
320-
'textClearMergeMessageHint': {{$.locale.Tr "repo.pulls.clear_merge_message_hint"}},
306+
<script type="module">
307+
const issueUrl = window.location.origin + {{$.Issue.Link}};
308+
const defaultMergeTitle = {{.DefaultMergeMessage}};
309+
const defaultSquashMergeTitle = {{.DefaultSquashMergeMessage}};
310+
const defaultMergeMessage = {{if .DefaultMergeBody}}{{.DefaultMergeBody}}{{else}}`Reviewed-on: ${issueUrl}\n` + {{$approvers}}{{end}};
311+
const defaultSquashMergeMessage = {{if .DefaultSquashMergeBody}}{{.DefaultSquashMergeBody}}{{else}}`Reviewed-on: ${issueUrl}\n` + {{$approvers}}{{end}};
312+
const mergeForm = {
313+
'baseLink': {{.Link}},
314+
'textCancel': {{$.locale.Tr "cancel"}},
315+
'textDeleteBranch': {{$.locale.Tr "repo.branch.delete" .HeadTarget}},
316+
'textAutoMergeButtonWhenSucceed': {{$.locale.Tr "repo.pulls.auto_merge_button_when_succeed"}},
317+
'textAutoMergeWhenSucceed': {{$.locale.Tr "repo.pulls.auto_merge_when_succeed"}},
318+
'textAutoMergeCancelSchedule': {{$.locale.Tr "repo.pulls.auto_merge_cancel_schedule"}},
319+
'textClearMergeMessage': {{$.locale.Tr "repo.pulls.clear_merge_message"}},
320+
'textClearMergeMessageHint': {{$.locale.Tr "repo.pulls.clear_merge_message_hint"}},
321321

322-
'canMergeNow': {{$canMergeNow}},
323-
'allOverridableChecksOk': {{not $notAllOverridableChecksOk}},
324-
'emptyCommit': {{.Issue.PullRequest.IsEmpty}},
325-
'pullHeadCommitID': {{.PullHeadCommitID}},
326-
'isPullBranchDeletable': {{.IsPullBranchDeletable}},
327-
'defaultMergeStyle': {{.MergeStyle}},
328-
'defaultDeleteBranchAfterMerge': {{$prUnit.PullRequestsConfig.DefaultDeleteBranchAfterMerge}},
329-
'mergeMessageFieldPlaceHolder': {{$.locale.Tr "repo.editor.commit_message_desc"}},
330-
'defaultMergeMessage': defaultMergeMessage,
322+
'canMergeNow': {{$canMergeNow}},
323+
'allOverridableChecksOk': {{not $notAllOverridableChecksOk}},
324+
'emptyCommit': {{.Issue.PullRequest.IsEmpty}},
325+
'pullHeadCommitID': {{.PullHeadCommitID}},
326+
'isPullBranchDeletable': {{.IsPullBranchDeletable}},
327+
'defaultMergeStyle': {{.MergeStyle}},
328+
'defaultDeleteBranchAfterMerge': {{$prUnit.PullRequestsConfig.DefaultDeleteBranchAfterMerge}},
329+
'mergeMessageFieldPlaceHolder': {{$.locale.Tr "repo.editor.commit_message_desc"}},
330+
'defaultMergeMessage': defaultMergeMessage,
331331

332-
'hasPendingPullRequestMerge': {{.HasPendingPullRequestMerge}},
333-
'hasPendingPullRequestMergeTip': {{$hasPendingPullRequestMergeTip}},
334-
};
332+
'hasPendingPullRequestMerge': {{.HasPendingPullRequestMerge}},
333+
'hasPendingPullRequestMergeTip': {{$hasPendingPullRequestMergeTip}},
334+
};
335335

336-
const generalHideAutoMerge = mergeForm.canMergeNow && mergeForm.allOverridableChecksOk; // if this PR can be merged now, then hide the auto merge
337-
mergeForm['mergeStyles'] = [
338-
{
339-
'name': 'merge',
340-
'allowed': {{$prUnit.PullRequestsConfig.AllowMerge}},
341-
'textDoMerge': {{$.locale.Tr "repo.pulls.merge_pull_request"}},
342-
'mergeTitleFieldText': defaultMergeTitle,
343-
'mergeMessageFieldText': defaultMergeMessage,
344-
'hideAutoMerge': generalHideAutoMerge,
345-
},
346-
{
347-
'name': 'rebase',
348-
'allowed': {{$prUnit.PullRequestsConfig.AllowRebase}},
349-
'textDoMerge': {{$.locale.Tr "repo.pulls.rebase_merge_pull_request"}},
350-
'hideMergeMessageTexts': true,
351-
'hideAutoMerge': generalHideAutoMerge,
352-
},
353-
{
354-
'name': 'rebase-merge',
355-
'allowed': {{$prUnit.PullRequestsConfig.AllowRebaseMerge}},
356-
'textDoMerge': {{$.locale.Tr "repo.pulls.rebase_merge_commit_pull_request"}},
357-
'mergeTitleFieldText': defaultMergeTitle,
358-
'mergeMessageFieldText': defaultMergeMessage,
359-
'hideAutoMerge': generalHideAutoMerge,
360-
},
361-
{
362-
'name': 'squash',
363-
'allowed': {{$prUnit.PullRequestsConfig.AllowSquash}},
364-
'textDoMerge': {{$.locale.Tr "repo.pulls.squash_merge_pull_request"}},
365-
'mergeTitleFieldText': defaultSquashMergeTitle,
366-
'mergeMessageFieldText': {{.GetCommitMessages}} + defaultSquashMergeMessage,
367-
'hideAutoMerge': generalHideAutoMerge,
368-
},
369-
{
370-
'name': 'manually-merged',
371-
'allowed': {{and $prUnit.PullRequestsConfig.AllowManualMerge $.IsRepoAdmin}},
372-
'textDoMerge': {{$.locale.Tr "repo.pulls.merge_manually"}},
373-
'hideMergeMessageTexts': true,
374-
'hideAutoMerge': true,
375-
}
376-
];
377-
window.config.pageData.pullRequestMergeForm = mergeForm;
378-
})();
336+
const generalHideAutoMerge = mergeForm.canMergeNow && mergeForm.allOverridableChecksOk; // if this PR can be merged now, then hide the auto merge
337+
mergeForm['mergeStyles'] = [
338+
{
339+
'name': 'merge',
340+
'allowed': {{$prUnit.PullRequestsConfig.AllowMerge}},
341+
'textDoMerge': {{$.locale.Tr "repo.pulls.merge_pull_request"}},
342+
'mergeTitleFieldText': defaultMergeTitle,
343+
'mergeMessageFieldText': defaultMergeMessage,
344+
'hideAutoMerge': generalHideAutoMerge,
345+
},
346+
{
347+
'name': 'rebase',
348+
'allowed': {{$prUnit.PullRequestsConfig.AllowRebase}},
349+
'textDoMerge': {{$.locale.Tr "repo.pulls.rebase_merge_pull_request"}},
350+
'hideMergeMessageTexts': true,
351+
'hideAutoMerge': generalHideAutoMerge,
352+
},
353+
{
354+
'name': 'rebase-merge',
355+
'allowed': {{$prUnit.PullRequestsConfig.AllowRebaseMerge}},
356+
'textDoMerge': {{$.locale.Tr "repo.pulls.rebase_merge_commit_pull_request"}},
357+
'mergeTitleFieldText': defaultMergeTitle,
358+
'mergeMessageFieldText': defaultMergeMessage,
359+
'hideAutoMerge': generalHideAutoMerge,
360+
},
361+
{
362+
'name': 'squash',
363+
'allowed': {{$prUnit.PullRequestsConfig.AllowSquash}},
364+
'textDoMerge': {{$.locale.Tr "repo.pulls.squash_merge_pull_request"}},
365+
'mergeTitleFieldText': defaultSquashMergeTitle,
366+
'mergeMessageFieldText': {{.GetCommitMessages}} + defaultSquashMergeMessage,
367+
'hideAutoMerge': generalHideAutoMerge,
368+
},
369+
{
370+
'name': 'manually-merged',
371+
'allowed': {{and $prUnit.PullRequestsConfig.AllowManualMerge $.IsRepoAdmin}},
372+
'textDoMerge': {{$.locale.Tr "repo.pulls.merge_manually"}},
373+
'hideMergeMessageTexts': true,
374+
'hideAutoMerge': true,
375+
}
376+
];
377+
window.config.pageData.pullRequestMergeForm = mergeForm;
379378
</script>
380379

381380
<div id="pull-request-merge-form"></div>

templates/repo/issue/view_content/pull_merge_instruction.tmpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<div class="ui secondary segment">
66
{{if eq $.Issue.PullRequest.Flow 0}}
77
<div>git checkout -b {{if ne $.Issue.PullRequest.HeadRepo.ID $.Issue.PullRequest.BaseRepo.ID}}{{$.Issue.PullRequest.HeadRepo.OwnerName}}-{{end}}{{$.Issue.PullRequest.HeadBranch}} {{$.Issue.PullRequest.BaseBranch}}</div>
8+
{{/* the only legacy HTMLURL used in template, which doesn't affect users too much and is very diffcult to fix, it should be fixed together with other AppUrl usages*/}}
89
<div>git pull {{if ne $.Issue.PullRequest.HeadRepo.ID $.Issue.PullRequest.BaseRepo.ID}}{{$.Issue.PullRequest.HeadRepo.HTMLURL}}{{else}}origin{{end}} {{$.Issue.PullRequest.HeadBranch}}</div>
910
{{else}}
1011
<div>git fetch origin {{$.Issue.PullRequest.GetGitRefName}}:{{$.Issue.PullRequest.HeadBranch}}</div>

templates/repo/issue/view_title.tmpl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@
22
<div class="issue-title" id="issue-title-wrapper">
33
{{if and (or .HasIssuesOrPullsWritePermission .IsIssuePoster) (not .Repository.IsArchived)}}
44
<div class="edit-button">
5-
<div id="edit-title" class="ui basic secondary not-in-edit button">{{.locale.Tr "repo.issues.edit"}}</div>
5+
<button id="edit-title" class="ui basic button secondary not-in-edit">{{.locale.Tr "repo.issues.edit"}}</button>
66
</div>
77
{{end}}
88
<h1>
99
<span id="issue-title">{{RenderIssueTitle $.Context .Issue.Title $.RepoLink $.Repository.ComposeMetas | RenderCodeBlock}}</span>
1010
<span class="index">#{{.Issue.Index}}</span>
11-
<div id="edit-title-input" class="ui input" style="display: none">
11+
<div id="edit-title-input" class="ui input ml-4" style="display: none">
1212
<input value="{{.Issue.Title}}" maxlength="255" autocomplete="off">
1313
</div>
1414
</h1>
1515
{{if and (or .HasIssuesOrPullsWritePermission .IsIssuePoster) (not .Repository.IsArchived)}}
1616
<div class="edit-buttons">
17-
<div id="cancel-edit-title" class="ui basic secondary in-edit button" style="display: none">{{.locale.Tr "repo.issues.cancel"}}</div>
18-
<div id="save-edit-title" class="ui primary in-edit button" style="display: none" data-update-url="{{$.RepoLink}}/issues/{{.Issue.Index}}/title" {{if .Issue.IsPull}}data-target-update-url="{{$.RepoLink}}/pull/{{.Issue.Index}}/target_branch"{{end}}>{{.locale.Tr "repo.issues.save"}}</div>
17+
<button id="cancel-edit-title" class="ui basic button secondary in-edit" style="display: none">{{.locale.Tr "repo.issues.cancel"}}</button>
18+
<button id="save-edit-title" class="ui primary button in-edit" style="display: none" data-update-url="{{$.RepoLink}}/issues/{{.Issue.Index}}/title" {{if .Issue.IsPull}}data-target-update-url="{{$.RepoLink}}/pull/{{.Issue.Index}}/target_branch"{{end}}>{{.locale.Tr "repo.issues.save"}}</button>
1919
</div>
2020
{{end}}
2121
</div>

web_src/js/features/admin/common.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
import $ from 'jquery';
2+
import {checkAppUrl} from '../common-global.js';
23

34
const {csrfToken} = window.config;
45

56
export function initAdminCommon() {
6-
if ($('.admin').length === 0) {
7+
if ($('.page-content.admin').length === 0) {
78
return;
89
}
910

11+
// check whether appUrl(ROOT_URL) is correct, if not, show an error message
12+
// only admin pages need this check because most templates are using relative URLs now
13+
checkAppUrl();
14+
1015
// New user
1116
if ($('.admin.new.user').length > 0 || $('.admin.edit.user').length > 0) {
1217
$('#login_type').on('change', function () {

web_src/js/features/common-global.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ export function initGlobalButtonClickOnEnter() {
6060
$(document).on('keypress', '.ui.button', (e) => {
6161
if (e.keyCode === 13 || e.keyCode === 32) { // enter key or space bar
6262
$(e.target).trigger('click');
63+
e.preventDefault();
6364
}
6465
});
6566
}
@@ -381,9 +382,6 @@ export function checkAppUrl() {
381382
if (curUrl.startsWith(appUrl) || `${curUrl}/` === appUrl) {
382383
return;
383384
}
384-
if (document.querySelector('.page-content.install')) {
385-
return; // no need to show the message on the installation page
386-
}
387-
showGlobalErrorMessage(`Your ROOT_URL in app.ini is ${appUrl} but you are visiting ${curUrl}
388-
You should set ROOT_URL correctly, otherwise the web may not work correctly.`);
385+
showGlobalErrorMessage(`Your ROOT_URL in app.ini is "${appUrl}", it's unlikely matching the site you are visiting.
386+
Mismatched ROOT_URL config causes wrong URL links for web UI/mail content/webhook notification.`);
389387
}

web_src/js/features/repo-issue.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,7 @@ export function initRepoIssueTitleEdit() {
605605
const targetBranch = $('#pull-target-branch').data('branch');
606606
const $branchTarget = $('#branch_target');
607607
if (targetBranch === $branchTarget.text()) {
608+
window.location.reload();
608609
return false;
609610
}
610611
$.post(update_url, {
@@ -617,19 +618,22 @@ export function initRepoIssueTitleEdit() {
617618
});
618619
};
619620

620-
const pullrequest_target_update_url = $(this).data('target-update-url');
621+
const pullrequest_target_update_url = $(this).attr('data-target-update-url');
621622
if ($editInput.val().length === 0 || $editInput.val() === $issueTitle.text()) {
622623
$editInput.val($issueTitle.text());
623624
pullrequest_targetbranch_change(pullrequest_target_update_url);
624625
} else {
625-
$.post($(this).data('update-url'), {
626+
$.post($(this).attr('data-update-url'), {
626627
_csrf: csrfToken,
627628
title: $editInput.val()
628629
}, (data) => {
629630
$editInput.val(data.title);
630631
$issueTitle.text(data.title);
631-
pullrequest_targetbranch_change(pullrequest_target_update_url);
632-
window.location.reload();
632+
if (pullrequest_target_update_url) {
633+
pullrequest_targetbranch_change(pullrequest_target_update_url); // it will reload the window
634+
} else {
635+
window.location.reload();
636+
}
633637
});
634638
}
635639
return false;

web_src/js/index.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ import {
4848
initCommitStatuses,
4949
} from './features/repo-commit.js';
5050
import {
51-
checkAppUrl,
5251
initFootLanguageMenu,
5352
initGlobalButtonClickOnEnter,
5453
initGlobalButtons,
@@ -199,5 +198,4 @@ $(document).ready(() => {
199198
initUserAuthWebAuthnRegister();
200199
initUserSettings();
201200
initViewedCheckboxListenerFor();
202-
checkAppUrl();
203201
});

web_src/less/_base.less

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2316,6 +2316,13 @@ a.ui.label:hover {
23162316
.ui.basic.secondary.buttons .button:active,
23172317
.ui.basic.secondary.button:active {
23182318
color: var(--color-secondary-dark-8) !important;
2319+
border-color: var(--color-secondary-dark-1) !important;
2320+
}
2321+
2322+
.ui.basic.secondary.button:focus,
2323+
.ui.basic.secondary.buttons .button:focus {
2324+
color: var(--color-secondary-dark-8) !important;
2325+
border-color: var(--color-secondary-dark-3) !important;
23192326
}
23202327

23212328
.ui.tertiary.button {

0 commit comments

Comments
 (0)