Skip to content

Commit 8494ade

Browse files
committed
Merge remote-tracking branch 'giteaofficial/main'
* giteaofficial/main: Fix the link for .git-blame-ignore-revs bypass (go-gitea#31432) Bump htmx to 2.0.0 (go-gitea#31413) Fix the wrong line number in the diff view page when expanded twice. (go-gitea#31431) Fix labels and projects menu overflow on issue page (go-gitea#31435) [Fix] Account Linking UpdateMigrationsByType (go-gitea#31428)
2 parents 4bc2d33 + ed5ded3 commit 8494ade

File tree

13 files changed

+28
-23
lines changed

13 files changed

+28
-23
lines changed

.eslintrc.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ overrides:
3333
- files: ["web_src/**/*"]
3434
globals:
3535
__webpack_public_path__: true
36+
htmx: true
3637
process: false # https://github.com/webpack/webpack/issues/15833
3738
- files: ["web_src/**/*", "docs/**/*"]
3839
env:

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"esbuild-loader": "4.2.0",
2929
"escape-goat": "4.0.0",
3030
"fast-glob": "3.3.2",
31-
"htmx.org": "1.9.12",
31+
"htmx.org": "2.0.0",
3232
"idiomorph": "0.3.0",
3333
"jquery": "3.7.1",
3434
"katex": "0.16.10",

services/externalaccount/user.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ package externalaccount
55

66
import (
77
"context"
8+
"strconv"
89
"strings"
910

1011
"code.gitea.io/gitea/models/auth"
@@ -82,6 +83,11 @@ func UpdateExternalUser(ctx context.Context, user *user_model.User, gothUser got
8283

8384
// UpdateMigrationsByType updates all migrated repositories' posterid from gitServiceType to replace originalAuthorID to posterID
8485
func UpdateMigrationsByType(ctx context.Context, tp structs.GitServiceType, externalUserID string, userID int64) error {
86+
// Skip update if externalUserID is not a valid numeric ID or exceeds int64
87+
if _, err := strconv.ParseInt(externalUserID, 10, 64); err != nil {
88+
return nil
89+
}
90+
8591
if err := issues_model.UpdateIssuesMigrationsByType(ctx, tp, externalUserID, userID); err != nil {
8692
return err
8793
}

templates/repo/blame.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{{$revsFileLink := URLJoin .RepoLink "src" .BranchNameSubURL "/.git-blame-ignore-revs"}}
33
{{if .UsesIgnoreRevs}}
44
<div class="ui info message">
5-
<p>{{ctx.Locale.Tr "repo.blame.ignore_revs" $revsFileLink (print $revsFileLink "?bypass-blame-ignore=true")}}</p>
5+
<p>{{ctx.Locale.Tr "repo.blame.ignore_revs" $revsFileLink "?bypass-blame-ignore=true"}}</p>
66
</div>
77
{{else}}
88
<div class="ui error message">

templates/repo/diff/blob_excerpt.tmpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,17 @@
5353
<td colspan="2" class="lines-num">
5454
<div class="code-expander-buttons" data-expand-direction="{{$expandDirection}}">
5555
{{if or (eq $expandDirection 3) (eq $expandDirection 5)}}
56-
<button class="code-expander-button" hx-target="closest tr" hx-get="{{$.RepoLink}}/blob_excerpt/{{PathEscape $.AfterCommitID}}?data-query={{$line.GetBlobExcerptQuery}}&style=unified&direction=down&wiki={{$.PageIsWiki}}&anchor={{$.Anchor}}">
56+
<button class="code-expander-button" hx-target="closest tr" hx-get="{{$.RepoLink}}/blob_excerpt/{{PathEscape $.AfterCommitID}}?{{$line.GetBlobExcerptQuery}}&style=unified&direction=down&wiki={{$.PageIsWiki}}&anchor={{$.Anchor}}">
5757
{{svg "octicon-fold-down"}}
5858
</button>
5959
{{end}}
6060
{{if or (eq $expandDirection 3) (eq $expandDirection 4)}}
61-
<button class="code-expander-button" hx-target="closest tr" hx-get="{{$.RepoLink}}/blob_excerpt/{{PathEscape $.AfterCommitID}}?data-query={{$line.GetBlobExcerptQuery}}&style=unified&direction=up&wiki={{$.PageIsWiki}}&anchor={{$.Anchor}}">
61+
<button class="code-expander-button" hx-target="closest tr" hx-get="{{$.RepoLink}}/blob_excerpt/{{PathEscape $.AfterCommitID}}?{{$line.GetBlobExcerptQuery}}&style=unified&direction=up&wiki={{$.PageIsWiki}}&anchor={{$.Anchor}}">
6262
{{svg "octicon-fold-up"}}
6363
</button>
6464
{{end}}
6565
{{if eq $expandDirection 2}}
66-
<button class="code-expander-button" hx-target="closest tr" hx-get="{{$.RepoLink}}/blob_excerpt/{{PathEscape $.AfterCommitID}}?data-query={{$line.GetBlobExcerptQuery}}&style=unified&direction=&wiki={{$.PageIsWiki}}&anchor={{$.Anchor}}">
66+
<button class="code-expander-button" hx-target="closest tr" hx-get="{{$.RepoLink}}/blob_excerpt/{{PathEscape $.AfterCommitID}}?{{$line.GetBlobExcerptQuery}}&style=unified&direction=&wiki={{$.PageIsWiki}}&anchor={{$.Anchor}}">
6767
{{svg "octicon-fold"}}
6868
</button>
6969
{{end}}

web_src/css/repo.css

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@
7979
white-space: nowrap;
8080
}
8181

82+
.repository .issue-content-right .filter.menu {
83+
max-height: 500px;
84+
overflow-x: auto;
85+
}
86+
8287
.repository .filter.menu.labels .label-filter .menu .info {
8388
display: inline-block;
8489
padding: 0.5rem 0;
@@ -562,11 +567,6 @@ td .commit-summary {
562567
font-size: 14px;
563568
}
564569

565-
.repository.new.issue .comment.form .issue-content-right .filter.menu {
566-
max-height: 500px;
567-
overflow-x: auto;
568-
}
569-
570570
.repository.view.issue .instruct-toggle {
571571
display: inline-block;
572572
}

web_src/js/features/common-global.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import {showTemporaryTooltip} from '../modules/tippy.js';
1111
import {confirmModal} from './comp/ConfirmModal.js';
1212
import {showErrorToast} from '../modules/toast.js';
1313
import {request, POST, GET} from '../modules/fetch.js';
14-
import '../htmx.js';
1514

1615
const {appUrl, appSubUrl, csrfToken, i18n} = window.config;
1716

web_src/js/globals.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import jquery from 'jquery';
2+
import htmx from 'htmx.org/dist/htmx.esm.js';
3+
4+
window.$ = window.jQuery = jquery;
5+
window.htmx = htmx;

web_src/js/htmx.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import * as htmx from 'htmx.org';
21
import {showErrorToast} from './modules/toast.js';
32

43
// https://github.com/bigskysoftware/idiomorph#htmx

web_src/js/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// bootstrap module must be the first one to be imported, it handles webpack lazy-loading and global errors
22
import './bootstrap.js';
3+
import './htmx.js';
34

45
import {initRepoActivityTopAuthorsChart} from './components/RepoActivityTopAuthors.vue';
56
import {initScopedAccessTokenCategories} from './components/ScopedAccessTokenSelector.vue';

web_src/js/jquery.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

webpack.config.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export default {
7676
mode: isProduction ? 'production' : 'development',
7777
entry: {
7878
index: [
79-
fileURLToPath(new URL('web_src/js/jquery.js', import.meta.url)),
79+
fileURLToPath(new URL('web_src/js/globals.js', import.meta.url)),
8080
fileURLToPath(new URL('web_src/fomantic/build/semantic.js', import.meta.url)),
8181
fileURLToPath(new URL('web_src/js/index.js', import.meta.url)),
8282
fileURLToPath(new URL('node_modules/easymde/dist/easymde.min.css', import.meta.url)),
@@ -195,9 +195,6 @@ export default {
195195
],
196196
},
197197
plugins: [
198-
new webpack.ProvidePlugin({ // for htmx extensions
199-
htmx: 'htmx.org',
200-
}),
201198
new DefinePlugin({
202199
__VUE_OPTIONS_API__: true, // at the moment, many Vue components still use the Vue Options API
203200
__VUE_PROD_DEVTOOLS__: false, // do not enable devtools support in production

0 commit comments

Comments
 (0)