From 17b3a38577d6e1d50ba5565ca3b1f2f57a04bf32 Mon Sep 17 00:00:00 2001 From: Sumit Date: Thu, 20 Jun 2024 18:54:53 +0530 Subject: [PATCH 1/5] [Fix] Account Linking UpdateMigrationsByType (#31428) Fix https://github.com/go-gitea/gitea/issues/31427 --- services/externalaccount/user.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/services/externalaccount/user.go b/services/externalaccount/user.go index e2de41da188e5..3cfd8c81f9fc7 100644 --- a/services/externalaccount/user.go +++ b/services/externalaccount/user.go @@ -5,6 +5,7 @@ package externalaccount import ( "context" + "strconv" "strings" "code.gitea.io/gitea/models/auth" @@ -82,6 +83,11 @@ func UpdateExternalUser(ctx context.Context, user *user_model.User, gothUser got // UpdateMigrationsByType updates all migrated repositories' posterid from gitServiceType to replace originalAuthorID to posterID func UpdateMigrationsByType(ctx context.Context, tp structs.GitServiceType, externalUserID string, userID int64) error { + // Skip update if externalUserID is not a valid numeric ID or exceeds int64 + if _, err := strconv.ParseInt(externalUserID, 10, 64); err != nil { + return nil + } + if err := issues_model.UpdateIssuesMigrationsByType(ctx, tp, externalUserID, userID); err != nil { return err } From 5afafe22a34183c9c053a7ceac2c9dc05d9943e2 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Thu, 20 Jun 2024 18:54:19 +0200 Subject: [PATCH 2/5] Fix labels and projects menu overflow on issue page (#31435) It was correct only on the new issue page. Resolves #31415 --- web_src/css/repo.css | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/web_src/css/repo.css b/web_src/css/repo.css index 571c60700ee34..28b84d3af421c 100644 --- a/web_src/css/repo.css +++ b/web_src/css/repo.css @@ -79,6 +79,11 @@ white-space: nowrap; } +.repository .issue-content-right .filter.menu { + max-height: 500px; + overflow-x: auto; +} + .repository .filter.menu.labels .label-filter .menu .info { display: inline-block; padding: 0.5rem 0; @@ -562,11 +567,6 @@ td .commit-summary { font-size: 14px; } -.repository.new.issue .comment.form .issue-content-right .filter.menu { - max-height: 500px; - overflow-x: auto; -} - .repository.view.issue .instruct-toggle { display: inline-block; } From c60ef946b1c5ed3347224cda5d3e17592cd16e5e Mon Sep 17 00:00:00 2001 From: charles <30816317+charles7668@users.noreply.github.com> Date: Fri, 21 Jun 2024 01:43:42 +0800 Subject: [PATCH 3/5] Fix the wrong line number in the diff view page when expanded twice. (#31431) close #31149, regression of #29385 (incorrect `data-query=`) --- templates/repo/diff/blob_excerpt.tmpl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/repo/diff/blob_excerpt.tmpl b/templates/repo/diff/blob_excerpt.tmpl index 2874ac6a55c61..cc2237029bd68 100644 --- a/templates/repo/diff/blob_excerpt.tmpl +++ b/templates/repo/diff/blob_excerpt.tmpl @@ -53,17 +53,17 @@
{{if or (eq $expandDirection 3) (eq $expandDirection 5)}} - {{end}} {{if or (eq $expandDirection 3) (eq $expandDirection 4)}} - {{end}} {{if eq $expandDirection 2}} - {{end}} From a5a9885f72c0c5be35ff7137cc2e2a60d8d11557 Mon Sep 17 00:00:00 2001 From: Yarden Shoham Date: Thu, 20 Jun 2024 23:04:09 +0300 Subject: [PATCH 4/5] Bump htmx to 2.0.0 (#31413) Tested Subscribe, Follow, Star, Watch, and System Status. --------- Signed-off-by: Yarden Shoham Co-authored-by: wxiaoguang Co-authored-by: silverwind --- .eslintrc.yaml | 1 + package-lock.json | 8 ++++---- package.json | 2 +- web_src/js/features/common-global.js | 1 - web_src/js/globals.js | 5 +++++ web_src/js/htmx.js | 1 - web_src/js/index.js | 1 + web_src/js/jquery.js | 3 --- webpack.config.js | 5 +---- 9 files changed, 13 insertions(+), 14 deletions(-) create mode 100644 web_src/js/globals.js delete mode 100644 web_src/js/jquery.js diff --git a/.eslintrc.yaml b/.eslintrc.yaml index bf0390dc3f680..4e3da6cab440e 100644 --- a/.eslintrc.yaml +++ b/.eslintrc.yaml @@ -33,6 +33,7 @@ overrides: - files: ["web_src/**/*"] globals: __webpack_public_path__: true + htmx: true process: false # https://github.com/webpack/webpack/issues/15833 - files: ["web_src/**/*", "docs/**/*"] env: diff --git a/package-lock.json b/package-lock.json index 60d970dcfcd72..2f7a200ed2746 100644 --- a/package-lock.json +++ b/package-lock.json @@ -29,7 +29,7 @@ "esbuild-loader": "4.2.0", "escape-goat": "4.0.0", "fast-glob": "3.3.2", - "htmx.org": "1.9.12", + "htmx.org": "2.0.0", "idiomorph": "0.3.0", "jquery": "3.7.1", "katex": "0.16.10", @@ -6891,9 +6891,9 @@ } }, "node_modules/htmx.org": { - "version": "1.9.12", - "resolved": "https://registry.npmjs.org/htmx.org/-/htmx.org-1.9.12.tgz", - "integrity": "sha512-VZAohXyF7xPGS52IM8d1T1283y+X4D+Owf3qY1NZ9RuBypyu9l8cGsxUMAG5fEAb/DhT7rDoJ9Hpu5/HxFD3cw==" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/htmx.org/-/htmx.org-2.0.0.tgz", + "integrity": "sha512-N0r1VjrqeCpig0mTi2/sooDZBeQlp1RBohnWQ/ufqc7ICaI0yjs04fNGhawm6+/HWhJFlcXn8MqOjWI9QGG2lQ==" }, "node_modules/human-signals": { "version": "5.0.0", diff --git a/package.json b/package.json index fa2145f1faa1e..2efebb8df8f15 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "esbuild-loader": "4.2.0", "escape-goat": "4.0.0", "fast-glob": "3.3.2", - "htmx.org": "1.9.12", + "htmx.org": "2.0.0", "idiomorph": "0.3.0", "jquery": "3.7.1", "katex": "0.16.10", diff --git a/web_src/js/features/common-global.js b/web_src/js/features/common-global.js index 1ab2a556993fd..34992c1f5bfda 100644 --- a/web_src/js/features/common-global.js +++ b/web_src/js/features/common-global.js @@ -11,7 +11,6 @@ import {showTemporaryTooltip} from '../modules/tippy.js'; import {confirmModal} from './comp/ConfirmModal.js'; import {showErrorToast} from '../modules/toast.js'; import {request, POST, GET} from '../modules/fetch.js'; -import '../htmx.js'; const {appUrl, appSubUrl, csrfToken, i18n} = window.config; diff --git a/web_src/js/globals.js b/web_src/js/globals.js new file mode 100644 index 0000000000000..24974da90e247 --- /dev/null +++ b/web_src/js/globals.js @@ -0,0 +1,5 @@ +import jquery from 'jquery'; +import htmx from 'htmx.org/dist/htmx.esm.js'; + +window.$ = window.jQuery = jquery; +window.htmx = htmx; diff --git a/web_src/js/htmx.js b/web_src/js/htmx.js index 5ca30183082d7..6169d2f82f291 100644 --- a/web_src/js/htmx.js +++ b/web_src/js/htmx.js @@ -1,4 +1,3 @@ -import * as htmx from 'htmx.org'; import {showErrorToast} from './modules/toast.js'; // https://github.com/bigskysoftware/idiomorph#htmx diff --git a/web_src/js/index.js b/web_src/js/index.js index 12cd0ee15a2ad..99352727dd09e 100644 --- a/web_src/js/index.js +++ b/web_src/js/index.js @@ -1,5 +1,6 @@ // bootstrap module must be the first one to be imported, it handles webpack lazy-loading and global errors import './bootstrap.js'; +import './htmx.js'; import {initRepoActivityTopAuthorsChart} from './components/RepoActivityTopAuthors.vue'; import {initScopedAccessTokenCategories} from './components/ScopedAccessTokenSelector.vue'; diff --git a/web_src/js/jquery.js b/web_src/js/jquery.js deleted file mode 100644 index 6b2199896c056..0000000000000 --- a/web_src/js/jquery.js +++ /dev/null @@ -1,3 +0,0 @@ -import $ from 'jquery'; - -window.$ = window.jQuery = $; // eslint-disable-line no-jquery/variable-pattern diff --git a/webpack.config.js b/webpack.config.js index fdf80a5313f82..80703c7448940 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -76,7 +76,7 @@ export default { mode: isProduction ? 'production' : 'development', entry: { index: [ - fileURLToPath(new URL('web_src/js/jquery.js', import.meta.url)), + fileURLToPath(new URL('web_src/js/globals.js', import.meta.url)), fileURLToPath(new URL('web_src/fomantic/build/semantic.js', import.meta.url)), fileURLToPath(new URL('web_src/js/index.js', import.meta.url)), fileURLToPath(new URL('node_modules/easymde/dist/easymde.min.css', import.meta.url)), @@ -195,9 +195,6 @@ export default { ], }, plugins: [ - new webpack.ProvidePlugin({ // for htmx extensions - htmx: 'htmx.org', - }), new DefinePlugin({ __VUE_OPTIONS_API__: true, // at the moment, many Vue components still use the Vue Options API __VUE_PROD_DEVTOOLS__: false, // do not enable devtools support in production From ed5ded3ff86fc7c3eccfe28e59b30728e6bf9fbc Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Fri, 21 Jun 2024 07:28:34 +0800 Subject: [PATCH 5/5] Fix the link for .git-blame-ignore-revs bypass (#31432) A quick fix for #31429 --- templates/repo/blame.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/repo/blame.tmpl b/templates/repo/blame.tmpl index 3e7cd92066264..62d1bbf2ba7c4 100644 --- a/templates/repo/blame.tmpl +++ b/templates/repo/blame.tmpl @@ -2,7 +2,7 @@ {{$revsFileLink := URLJoin .RepoLink "src" .BranchNameSubURL "/.git-blame-ignore-revs"}} {{if .UsesIgnoreRevs}}
-

{{ctx.Locale.Tr "repo.blame.ignore_revs" $revsFileLink (print $revsFileLink "?bypass-blame-ignore=true")}}

+

{{ctx.Locale.Tr "repo.blame.ignore_revs" $revsFileLink "?bypass-blame-ignore=true"}}

{{else}}