diff --git a/docs/content/doc/advanced/config-cheat-sheet.en-us.md b/docs/content/doc/advanced/config-cheat-sheet.en-us.md index 36e9919bc709..462556c9b6cb 100644 --- a/docs/content/doc/advanced/config-cheat-sheet.en-us.md +++ b/docs/content/doc/advanced/config-cheat-sheet.en-us.md @@ -1336,7 +1336,7 @@ PROXY_HOSTS = *.github.com ## Actions (`actions`) - `ENABLED`: **false**: Enable/Disable actions capabilities -- `DEFAULT_ACTIONS_URL`: **https://gitea.com**: Default address to get action plugins, e.g. the default value means downloading from "https://gitea.com/actions/checkout" for "uses: actions/checkout@v3" +- `DEFAULT_ACTIONS_URL`: **https://gitea.com**: Default address to get action plugins, e.g. the default value means downloading from "" for "uses: actions/checkout@v3" `DEFAULT_ACTIONS_URL` indicates where should we find the relative path action plugin. i.e. when use an action in a workflow file like diff --git a/docs/content/doc/developers/guidelines-refactoring.en-us.md b/docs/content/doc/developers/guidelines-refactoring.en-us.md index 2d607720dcb8..29025f25f752 100644 --- a/docs/content/doc/developers/guidelines-refactoring.en-us.md +++ b/docs/content/doc/developers/guidelines-refactoring.en-us.md @@ -6,11 +6,11 @@ weight: 20 toc: false draft: false menu: -sidebar: -parent: "developers" -name: "Guidelines for Refactoring" -weight: 20 -identifier: "guidelines-refactoring" + sidebar: + parent: "developers" + name: "Guidelines for Refactoring" + weight: 20 + identifier: "guidelines-refactoring" --- # Guidelines for Refactoring diff --git a/go.mod b/go.mod index f003d444b403..c97c52a07722 100644 --- a/go.mod +++ b/go.mod @@ -117,7 +117,7 @@ require ( mvdan.cc/xurls/v2 v2.4.0 strk.kbt.io/projects/go/libravatar v0.0.0-20191008002943-06d1c002b251 xorm.io/builder v0.3.12 - xorm.io/xorm v1.3.3-0.20221209153726-f1bfc5ce9830 + xorm.io/xorm v1.3.3-0.20230219231735-056cecc97e9e ) require ( diff --git a/go.sum b/go.sum index 7eb420b02b03..e365ba757d85 100644 --- a/go.sum +++ b/go.sum @@ -2075,5 +2075,5 @@ strk.kbt.io/projects/go/libravatar v0.0.0-20191008002943-06d1c002b251/go.mod h1: xorm.io/builder v0.3.11-0.20220531020008-1bd24a7dc978/go.mod h1:aUW0S9eb9VCaPohFCH3j7czOx1PMW3i1HrSzbLYGBSE= xorm.io/builder v0.3.12 h1:ASZYX7fQmy+o8UJdhlLHSW57JDOkM8DNhcAF5d0LiJM= xorm.io/builder v0.3.12/go.mod h1:aUW0S9eb9VCaPohFCH3j7czOx1PMW3i1HrSzbLYGBSE= -xorm.io/xorm v1.3.3-0.20221209153726-f1bfc5ce9830 h1:ohaHCvT7ocSDkTEa2/2z0BXfINYlHm/Z7IzN7MeXQlM= -xorm.io/xorm v1.3.3-0.20221209153726-f1bfc5ce9830/go.mod h1:9NbjqdnjX6eyjRRhh01GHm64r6N9shTb/8Ak3YRt8Nw= +xorm.io/xorm v1.3.3-0.20230219231735-056cecc97e9e h1:d5PY6mwuQK5/7T6VKfFswaKMzLmGTHkJ/ZS7+cUIAjk= +xorm.io/xorm v1.3.3-0.20230219231735-056cecc97e9e/go.mod h1:9NbjqdnjX6eyjRRhh01GHm64r6N9shTb/8Ak3YRt8Nw= diff --git a/models/db/context.go b/models/db/context.go index 4b3f7f0ee701..670f6272aa9a 100644 --- a/models/db/context.go +++ b/models/db/context.go @@ -209,7 +209,7 @@ func DecrByIDs(ctx context.Context, ids []int64, decrCol string, bean interface{ return err } -// DeleteBeans deletes all given beans, beans should contain delete conditions. +// DeleteBeans deletes all given beans, beans must contain delete conditions. func DeleteBeans(ctx context.Context, beans ...interface{}) (err error) { e := GetEngine(ctx) for i := range beans { @@ -220,6 +220,17 @@ func DeleteBeans(ctx context.Context, beans ...interface{}) (err error) { return nil } +// TruncateBeans deletes all given beans, beans may contain delete conditions. +func TruncateBeans(ctx context.Context, beans ...interface{}) (err error) { + e := GetEngine(ctx) + for i := range beans { + if _, err = e.Truncate(beans[i]); err != nil { + return err + } + } + return nil +} + // CountByBean counts the number of database records according non-empty fields of the bean as conditions. func CountByBean(ctx context.Context, bean interface{}) (int64, error) { return GetEngine(ctx).Count(bean) diff --git a/models/db/engine.go b/models/db/engine.go index 3d05fa8b6385..5020101d490a 100755 --- a/models/db/engine.go +++ b/models/db/engine.go @@ -38,6 +38,7 @@ type Engine interface { Count(...interface{}) (int64, error) Decr(column string, arg ...interface{}) *xorm.Session Delete(...interface{}) (int64, error) + Truncate(...interface{}) (int64, error) Exec(...interface{}) (sql.Result, error) Find(interface{}, ...interface{}) error Get(beans ...interface{}) (bool, error) diff --git a/routers/web/repo/patch.go b/routers/web/repo/patch.go index 12b26f38e901..0ffec0c4ea46 100644 --- a/routers/web/repo/patch.go +++ b/routers/web/repo/patch.go @@ -25,6 +25,8 @@ const ( func NewDiffPatch(ctx *context.Context) { canCommit := renderCommitRights(ctx) + ctx.Data["PageIsPatch"] = true + ctx.Data["TreePath"] = "" ctx.Data["commit_summary"] = "" @@ -51,6 +53,7 @@ func NewDiffPatchPost(ctx *context.Context) { if form.CommitChoice == frmCommitChoiceNewBranch { branchName = form.NewBranchName } + ctx.Data["PageIsPatch"] = true ctx.Data["TreePath"] = "" ctx.Data["BranchLink"] = ctx.Repo.RepoLink + "/src/" + ctx.Repo.BranchNameSubURL() ctx.Data["FileContent"] = form.Content diff --git a/services/convert/mirror.go b/services/convert/mirror.go index 1dcfc9b64dcf..f7a8e17fd0c9 100644 --- a/services/convert/mirror.go +++ b/services/convert/mirror.go @@ -24,6 +24,7 @@ func ToPushMirror(pm *repo_model.PushMirror) (*api.PushMirror, error) { LastUpdateUnix: pm.LastUpdateUnix.FormatLong(), LastError: pm.LastError, Interval: pm.Interval.String(), + SyncOnCommit: pm.SyncOnCommit, }, nil } diff --git a/templates/repo/editor/commit_form.tmpl b/templates/repo/editor/commit_form.tmpl index 7fac7f13bc24..c6c48c5a838c 100644 --- a/templates/repo/editor/commit_form.tmpl +++ b/templates/repo/editor/commit_form.tmpl @@ -9,7 +9,7 @@ {{.locale.Tr "repo.editor.commit_changes"}} {{- end}}
- +
diff --git a/templates/repo/issue/view_content/add_reaction.tmpl b/templates/repo/issue/view_content/add_reaction.tmpl index 9bd9022d28ab..bfa8a7e12234 100644 --- a/templates/repo/issue/view_content/add_reaction.tmpl +++ b/templates/repo/issue/view_content/add_reaction.tmpl @@ -7,7 +7,7 @@
{{.ctx.locale.Tr "repo.pick_reaction"}}
{{range $value := AllowedReactions}} -
{{ReactionToEmoji $value}}
+ {{ReactionToEmoji $value}} {{end}}
diff --git a/templates/repo/issue/view_content/context_menu.tmpl b/templates/repo/issue/view_content/context_menu.tmpl index b0d185a19b2a..771fb7ff940e 100644 --- a/templates/repo/issue/view_content/context_menu.tmpl +++ b/templates/repo/issue/view_content/context_menu.tmpl @@ -10,17 +10,17 @@ {{else}} {{$referenceUrl = Printf "%s/files#%s" .ctx.Issue.Link .item.HashTag}} {{end}} -
{{.ctx.locale.Tr "repo.issues.context.copy_link"}}
-
{{.ctx.locale.Tr "repo.issues.context.quote_reply"}}
+ {{.ctx.locale.Tr "repo.issues.context.copy_link"}} + {{.ctx.locale.Tr "repo.issues.context.quote_reply"}} {{if not .ctx.UnitIssuesGlobalDisabled}} -
{{.ctx.locale.Tr "repo.issues.context.reference_issue"}}
+ {{.ctx.locale.Tr "repo.issues.context.reference_issue"}} {{end}} {{if or .ctx.Permission.IsAdmin .IsCommentPoster .ctx.HasIssuesOrPullsWritePermission}}
-
{{.ctx.locale.Tr "repo.issues.context.edit"}}
+ {{.ctx.locale.Tr "repo.issues.context.edit"}} {{if .delete}} - - + + {{end}} {{end}} diff --git a/templates/repo/issue/view_content/sidebar.tmpl b/templates/repo/issue/view_content/sidebar.tmpl index b797ca300294..f92cf274e7b3 100644 --- a/templates/repo/issue/view_content/sidebar.tmpl +++ b/templates/repo/issue/view_content/sidebar.tmpl @@ -121,7 +121,7 @@ {{end}} -
{{.locale.Tr "repo.issues.new.clear_labels"}}
+ {{.locale.Tr "repo.issues.new.clear_labels"}} {{if or .Labels .OrgLabels}} {{$previousExclusiveScope := "_no_scope"}} {{range .Labels}} diff --git a/templates/repo/view_list.tmpl b/templates/repo/view_list.tmpl index 6fcf60daef13..9540c872c2c5 100644 --- a/templates/repo/view_list.tmpl +++ b/templates/repo/view_list.tmpl @@ -8,14 +8,14 @@ {{if .LatestCommitUser}} {{avatar $.Context .LatestCommitUser 24}} {{if .LatestCommitUser.FullName}} - {{.LatestCommitUser.FullName}} + {{.LatestCommitUser.FullName}} {{else}} - {{if .LatestCommit.Author}}{{.LatestCommit.Author.Name}}{{else}}{{.LatestCommitUser.Name}}{{end}} + {{if .LatestCommit.Author}}{{.LatestCommit.Author.Name}}{{else}}{{.LatestCommitUser.Name}}{{end}} {{end}} {{else}} {{if .LatestCommit.Author}} {{avatarByEmail $.Context .LatestCommit.Author.Email .LatestCommit.Author.Name 24}} - {{.LatestCommit.Author.Name}} + {{.LatestCommit.Author.Name}} {{end}} {{end}} diff --git a/tests/integration/api_packages_composer_test.go b/tests/integration/api_packages_composer_test.go index 87647cc47535..ac125905619b 100644 --- a/tests/integration/api_packages_composer_test.go +++ b/tests/integration/api_packages_composer_test.go @@ -25,6 +25,7 @@ import ( func TestPackageComposer(t *testing.T) { defer tests.PrepareTestEnv(t)() + user := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2}) vendorName := "gitea" diff --git a/tests/integration/api_packages_conan_test.go b/tests/integration/api_packages_conan_test.go index 5ced388b4858..209aeecd16d1 100644 --- a/tests/integration/api_packages_conan_test.go +++ b/tests/integration/api_packages_conan_test.go @@ -205,6 +205,7 @@ func uploadConanPackageV2(t *testing.T, baseURL, token, name, version, user, cha func TestPackageConan(t *testing.T) { defer tests.PrepareTestEnv(t)() + user := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2}) name := "ConanPackage" diff --git a/tests/integration/api_packages_container_test.go b/tests/integration/api_packages_container_test.go index bbab820ecbbc..d925fd16470a 100644 --- a/tests/integration/api_packages_container_test.go +++ b/tests/integration/api_packages_container_test.go @@ -640,7 +640,7 @@ func TestPackageContainer(t *testing.T) { checkCatalog := func(owner string) func(t *testing.T) { return func(t *testing.T) { - defer tests.PrepareTestEnv(t)() + defer tests.PrintCurrentTest(t)() req := NewRequest(t, "GET", fmt.Sprintf("%sv2/_catalog", setting.AppURL)) addTokenAuthHeader(req, userToken) diff --git a/tests/integration/api_packages_generic_test.go b/tests/integration/api_packages_generic_test.go index 875b9ed96ee8..765d11fd8331 100644 --- a/tests/integration/api_packages_generic_test.go +++ b/tests/integration/api_packages_generic_test.go @@ -21,6 +21,7 @@ import ( func TestPackageGeneric(t *testing.T) { defer tests.PrepareTestEnv(t)() + user := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2}) packageName := "te-st_pac.kage" diff --git a/tests/integration/api_packages_helm_test.go b/tests/integration/api_packages_helm_test.go index 4a7d56343183..4f61452071b6 100644 --- a/tests/integration/api_packages_helm_test.go +++ b/tests/integration/api_packages_helm_test.go @@ -26,6 +26,7 @@ import ( func TestPackageHelm(t *testing.T) { defer tests.PrepareTestEnv(t)() + user := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2}) packageName := "test-chart" diff --git a/tests/integration/api_packages_maven_test.go b/tests/integration/api_packages_maven_test.go index 5c0dbfc99cce..81112f305a62 100644 --- a/tests/integration/api_packages_maven_test.go +++ b/tests/integration/api_packages_maven_test.go @@ -22,6 +22,7 @@ import ( func TestPackageMaven(t *testing.T) { defer tests.PrepareTestEnv(t)() + user := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2}) groupID := "com.gitea" diff --git a/tests/integration/api_packages_npm_test.go b/tests/integration/api_packages_npm_test.go index 39d1c91e87d2..6c4503f7e3b4 100644 --- a/tests/integration/api_packages_npm_test.go +++ b/tests/integration/api_packages_npm_test.go @@ -24,6 +24,7 @@ import ( func TestPackageNpm(t *testing.T) { defer tests.PrepareTestEnv(t)() + user := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2}) token := fmt.Sprintf("Bearer %s", getTokenForLoggedInUser(t, loginUser(t, user.Name))) diff --git a/tests/integration/api_packages_pub_test.go b/tests/integration/api_packages_pub_test.go index 325401fe7586..24975ab6210a 100644 --- a/tests/integration/api_packages_pub_test.go +++ b/tests/integration/api_packages_pub_test.go @@ -27,6 +27,7 @@ import ( func TestPackagePub(t *testing.T) { defer tests.PrepareTestEnv(t)() + user := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2}) token := "Bearer " + getUserToken(t, user.Name) diff --git a/tests/integration/api_packages_pypi_test.go b/tests/integration/api_packages_pypi_test.go index 71197f92a8d8..c7c466e73083 100644 --- a/tests/integration/api_packages_pypi_test.go +++ b/tests/integration/api_packages_pypi_test.go @@ -25,6 +25,7 @@ import ( func TestPackagePyPI(t *testing.T) { defer tests.PrepareTestEnv(t)() + user := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2}) packageName := "test-package" diff --git a/tests/integration/api_packages_rubygems_test.go b/tests/integration/api_packages_rubygems_test.go index c85ff9aaf59d..2099357cbb77 100644 --- a/tests/integration/api_packages_rubygems_test.go +++ b/tests/integration/api_packages_rubygems_test.go @@ -23,6 +23,7 @@ import ( func TestPackageRubyGems(t *testing.T) { defer tests.PrepareTestEnv(t)() + user := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2}) packageName := "gitea" diff --git a/tests/integration/api_packages_test.go b/tests/integration/api_packages_test.go index 4a16cec015b8..4228003e2db3 100644 --- a/tests/integration/api_packages_test.go +++ b/tests/integration/api_packages_test.go @@ -19,6 +19,7 @@ import ( user_model "code.gitea.io/gitea/models/user" "code.gitea.io/gitea/modules/setting" api "code.gitea.io/gitea/modules/structs" + "code.gitea.io/gitea/modules/util" packages_service "code.gitea.io/gitea/services/packages" packages_cleanup_service "code.gitea.io/gitea/services/packages/cleanup" "code.gitea.io/gitea/tests" @@ -235,16 +236,35 @@ func TestPackageQuota(t *testing.T) { func TestPackageCleanup(t *testing.T) { defer tests.PrepareTestEnv(t)() + user := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2}) + duration, _ := time.ParseDuration("-1h") t.Run("Common", func(t *testing.T) { defer tests.PrintCurrentTest(t)() + // Upload and delete a generic package and upload a container blob + data, _ := util.CryptoRandomBytes(5) + url := fmt.Sprintf("/api/packages/%s/generic/cleanup-test/1.1.1/file.bin", user.Name) + req := NewRequestWithBody(t, "PUT", url, bytes.NewReader(data)) + AddBasicAuthHeader(req, user.Name) + MakeRequest(t, req, http.StatusCreated) + + req = NewRequest(t, "DELETE", url) + AddBasicAuthHeader(req, user.Name) + MakeRequest(t, req, http.StatusNoContent) + + data, _ = util.CryptoRandomBytes(5) + url = fmt.Sprintf("/v2/%s/cleanup-test/blobs/uploads?digest=sha256:%x", user.Name, sha256.Sum256(data)) + req = NewRequestWithBody(t, "POST", url, bytes.NewReader(data)) + AddBasicAuthHeader(req, user.Name) + MakeRequest(t, req, http.StatusCreated) + pbs, err := packages_model.FindExpiredUnreferencedBlobs(db.DefaultContext, duration) assert.NoError(t, err) assert.NotEmpty(t, pbs) - _, err = packages_model.GetInternalVersionByNameAndVersion(db.DefaultContext, 2, packages_model.TypeContainer, "test", container_model.UploadVersion) + _, err = packages_model.GetInternalVersionByNameAndVersion(db.DefaultContext, user.ID, packages_model.TypeContainer, "cleanup-test", container_model.UploadVersion) assert.NoError(t, err) err = packages_cleanup_service.Cleanup(db.DefaultContext, duration) @@ -254,15 +274,13 @@ func TestPackageCleanup(t *testing.T) { assert.NoError(t, err) assert.Empty(t, pbs) - _, err = packages_model.GetInternalVersionByNameAndVersion(db.DefaultContext, 2, packages_model.TypeContainer, "test", container_model.UploadVersion) + _, err = packages_model.GetInternalVersionByNameAndVersion(db.DefaultContext, user.ID, packages_model.TypeContainer, "cleanup-test", container_model.UploadVersion) assert.ErrorIs(t, err, packages_model.ErrPackageNotExist) }) t.Run("CleanupRules", func(t *testing.T) { defer tests.PrintCurrentTest(t)() - user := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2}) - type version struct { Version string ShouldExist bool diff --git a/tests/test_utils.go b/tests/test_utils.go index 9e9f97a5f5d1..5cc31b814ed4 100644 --- a/tests/test_utils.go +++ b/tests/test_utils.go @@ -13,6 +13,8 @@ import ( "runtime" "testing" + "code.gitea.io/gitea/models/db" + packages_model "code.gitea.io/gitea/models/packages" "code.gitea.io/gitea/models/unittest" "code.gitea.io/gitea/modules/base" "code.gitea.io/gitea/modules/git" @@ -204,6 +206,18 @@ func PrepareTestEnv(t testing.TB, skip ...int) func() { return err })) + // clear all package data + assert.NoError(t, db.TruncateBeans(db.DefaultContext, + &packages_model.Package{}, + &packages_model.PackageVersion{}, + &packages_model.PackageFile{}, + &packages_model.PackageBlob{}, + &packages_model.PackageProperty{}, + &packages_model.PackageBlobUpload{}, + &packages_model.PackageCleanupRule{}, + )) + assert.NoError(t, storage.Clean(storage.Packages)) + return deferFn } diff --git a/web_src/js/features/aria.js b/web_src/js/features/aria.js index a5ac84e4464c..373d667c5f73 100644 --- a/web_src/js/features/aria.js +++ b/web_src/js/features/aria.js @@ -81,7 +81,8 @@ function attachOneDropdownAria($dropdown) { $dropdown.on('keydown', (e) => { // here it must use keydown event before dropdown's keyup handler, otherwise there is no Enter event in our keyup handler if (e.key === 'Enter') { - const $item = $dropdown.dropdown('get item', $dropdown.dropdown('get value')); + let $item = $dropdown.dropdown('get item', $dropdown.dropdown('get value')); + if (!$item) $item = $menu.find('> .item.selected'); // when dropdown filters items by input, there is no "value", so query the "selected" item // if the selected item is clickable, then trigger the click event. in the future there could be a special CSS class for it. if ($item && $item.is('a')) $item[0].click(); } diff --git a/web_src/js/features/repo-legacy.js b/web_src/js/features/repo-legacy.js index 8178ed6547f0..a9229c0d1e6f 100644 --- a/web_src/js/features/repo-legacy.js +++ b/web_src/js/features/repo-legacy.js @@ -29,6 +29,26 @@ import {hideElem, showElem} from '../utils/dom.js'; const {csrfToken} = window.config; +// if there are draft comments (more than 20 chars), confirm before reloading, to avoid losing comments +function reloadConfirmDraftComment() { + const commentTextareas = [ + document.querySelector('.edit-content-zone:not(.gt-hidden) textarea'), + document.querySelector('.edit_area'), + ]; + for (const textarea of commentTextareas) { + // Most users won't feel too sad if they lose a comment with 10 or 20 chars, they can re-type these in seconds. + // But if they have typed more (like 50) chars and the comment is lost, they will be very unhappy. + if (textarea && textarea.value.trim().length > 20) { + textarea.parentElement.scrollIntoView(); + if (!window.confirm('Page will be reloaded, but there are draft comments. Continuing to reload will discard the comments. Continue?')) { + return; + } + break; + } + } + window.location.reload(); +} + export function initRepoCommentForm() { const $commentForm = $('.comment.form'); if ($commentForm.length === 0) { @@ -86,12 +106,15 @@ export function initRepoCommentForm() { let hasUpdateAction = $listMenu.data('action') === 'update'; const items = {}; - $(`.${selector}`).dropdown('setting', 'onHide', () => { - hasUpdateAction = $listMenu.data('action') === 'update'; // Update the var - if (hasUpdateAction) { - // TODO: Add batch functionality and make this 1 network request. - (async function() { - for (const [elementId, item] of Object.entries(items)) { + $(`.${selector}`).dropdown({ + 'action': 'nothing', // do not hide the menu if user presses Enter + fullTextSearch: 'exact', + async onHide() { + hasUpdateAction = $listMenu.data('action') === 'update'; // Update the var + if (hasUpdateAction) { + // TODO: Add batch functionality and make this 1 network request. + const itemEntries = Object.entries(items); + for (const [elementId, item] of itemEntries) { await updateIssuesMeta( item['update-url'], item.action, @@ -99,9 +122,11 @@ export function initRepoCommentForm() { elementId, ); } - window.location.reload(); - })(); - } + if (itemEntries.length) { + reloadConfirmDraftComment(); + } + } + }, }); $listMenu.find('.item:not(.no-select)').on('click', function (e) { @@ -196,7 +221,7 @@ export function initRepoCommentForm() { 'clear', $listMenu.data('issue-id'), '', - ).then(() => window.location.reload()); + ).then(reloadConfirmDraftComment); } $(this).parent().find('.item').each(function () { @@ -239,7 +264,7 @@ export function initRepoCommentForm() { '', $menu.data('issue-id'), $(this).data('id'), - ).then(() => window.location.reload()); + ).then(reloadConfirmDraftComment); } let icon = ''; @@ -272,7 +297,7 @@ export function initRepoCommentForm() { '', $menu.data('issue-id'), $(this).data('id'), - ).then(() => window.location.reload()); + ).then(reloadConfirmDraftComment); } $list.find('.selected').html(''); diff --git a/web_src/less/_repository.less b/web_src/less/_repository.less index 627a5f6c2f6d..83e8e1f338e1 100644 --- a/web_src/less/_repository.less +++ b/web_src/less/_repository.less @@ -237,6 +237,8 @@ } #repo-files-table { + table-layout: fixed; + thead { th { padding-top: 8px; @@ -2885,7 +2887,8 @@ tbody.commit-list { vertical-align: baseline; } -.message-wrapper { +.message-wrapper, +.author-wrapper { overflow: hidden; text-overflow: ellipsis; max-width: calc(100% - 50px); @@ -2893,6 +2896,10 @@ tbody.commit-list { vertical-align: middle; } +.author-wrapper { + max-width: 180px; +} + // in the commit list, messages can wrap so we can use inline .commit-list .message-wrapper { display: inline; @@ -2912,6 +2919,10 @@ tbody.commit-list { display: block; max-width: calc(100vw - 70px); } + + .author-wrapper { + max-width: 80px; + } } @media @mediaMd { @@ -2920,7 +2931,7 @@ tbody.commit-list { } th .message-wrapper { - max-width: 280px; + max-width: 120px; } } @@ -2930,7 +2941,7 @@ tbody.commit-list { } th .message-wrapper { - max-width: 490px; + max-width: 350px; } } @@ -2940,7 +2951,7 @@ tbody.commit-list { } th .message-wrapper { - max-width: 680px; + max-width: 525px; } } diff --git a/web_src/less/markup/content.less b/web_src/less/markup/content.less index 2a9ca3db5a57..725a3d9886f5 100644 --- a/web_src/less/markup/content.less +++ b/web_src/less/markup/content.less @@ -415,6 +415,7 @@ padding: .2em .4em; margin: 0; font-size: 85%; + white-space: break-spaces; background-color: var(--color-markup-code-block); border-radius: 4px; }