Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into coloris
Browse files Browse the repository at this point in the history
* origin/main:
  Remove jQuery `.attr` from the Fomantic modal cancel buttons (go-gitea#30113)
  Remove jQuery `.attr` from the code comments (go-gitea#30112)
  Remove jQuery calls that have no effect on `showElem` and `hideElem` (go-gitea#30110)
  Remove jQuery `.attr` from the common issue page functions (go-gitea#30083)
  Restore aligned grid column CSS (go-gitea#30106)
  Fix possible data race on tests (go-gitea#30093)
  Add svg linter and fix incorrect svgs (go-gitea#30086)
  Fix duplicate migrated milestones (go-gitea#30102)
  Update JS any PY dependencies, remove workarounds (go-gitea#30085)
  Fix gitea doctor will remove repo-avatar files when execute command `storage-archives` (go-gitea#30094)
  Fix alignment in actions right view (go-gitea#29979)
  Remove repetitive words (go-gitea#30091)
  Fix table header text-align (go-gitea#30084)
  Fix panic for `fixBrokenRepoUnits16961` (go-gitea#30068)
  • Loading branch information
silverwind committed Mar 26, 2024
2 parents 22f7b91 + f47e00d commit c36d353
Show file tree
Hide file tree
Showing 27 changed files with 470 additions and 407 deletions.
1 change: 1 addition & 0 deletions .github/workflows/files-changed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ jobs:
- "Makefile"
templates:
- "tools/lint-templates-*.js"
- "templates/**/*.tmpl"
- "pyproject.toml"
- "poetry.lock"
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/pull-compliance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,12 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- uses: actions/setup-node@v4
with:
node-version: 20
- run: pip install poetry
- run: make deps-py
- run: make deps-frontend
- run: make lint-templates

lint-yaml:
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,8 @@ lint-actions:
$(GO) run $(ACTIONLINT_PACKAGE)

.PHONY: lint-templates
lint-templates: .venv
lint-templates: .venv node_modules
@node tools/lint-templates-svg.js
@poetry run djlint $(shell find templates -type f -iname '*.tmpl')

.PHONY: lint-yaml
Expand Down
417 changes: 202 additions & 215 deletions package-lock.json

Large diffs are not rendered by default.

28 changes: 14 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
"@github/text-expander-element": "2.6.1",
"@mcaptcha/vanilla-glue": "0.1.0-alpha-3",
"@melloware/coloris": "0.23.0",
"@primer/octicons": "19.8.0",
"@primer/octicons": "19.9.0",
"add-asset-webpack-plugin": "2.0.1",
"ansi_up": "6.0.2",
"asciinema-player": "3.7.0",
"asciinema-player": "3.7.1",
"chart.js": "4.4.2",
"chartjs-adapter-dayjs-4": "1.0.4",
"chartjs-plugin-zoom": "2.0.1",
Expand All @@ -31,15 +31,15 @@
"htmx.org": "1.9.11",
"idiomorph": "0.3.0",
"jquery": "3.7.1",
"katex": "0.16.9",
"katex": "0.16.10",
"license-checker-webpack-plugin": "0.2.1",
"mermaid": "10.9.0",
"mini-css-extract-plugin": "2.8.1",
"minimatch": "9.0.3",
"monaco-editor": "0.47.0",
"monaco-editor-webpack-plugin": "7.1.0",
"pdfobject": "2.3.0",
"postcss": "8.4.35",
"postcss": "8.4.38",
"postcss-loader": "8.1.1",
"postcss-nesting": "12.1.0",
"pretty-ms": "9.0.0",
Expand All @@ -58,7 +58,7 @@
"vue-chartjs": "5.3.0",
"vue-loader": "17.4.2",
"vue3-calendar-heatmap": "2.0.5",
"webpack": "5.90.3",
"webpack": "5.91.0",
"webpack-cli": "5.1.4",
"wrap-ansi": "9.0.0"
},
Expand All @@ -76,24 +76,24 @@
"eslint-plugin-jquery": "1.5.1",
"eslint-plugin-no-jquery": "2.7.0",
"eslint-plugin-no-use-extend-native": "0.5.0",
"eslint-plugin-regexp": "2.3.0",
"eslint-plugin-regexp": "2.4.0",
"eslint-plugin-sonarjs": "0.24.0",
"eslint-plugin-unicorn": "51.0.1",
"eslint-plugin-vitest": "0.3.26",
"eslint-plugin-vitest-globals": "1.4.0",
"eslint-plugin-vue": "9.23.0",
"eslint-plugin-vue-scoped-css": "2.7.2",
"eslint-plugin-vitest": "0.4.0",
"eslint-plugin-vitest-globals": "1.5.0",
"eslint-plugin-vue": "9.24.0",
"eslint-plugin-vue-scoped-css": "2.8.0",
"eslint-plugin-wc": "2.0.4",
"happy-dom": "14.2.0",
"happy-dom": "14.3.7",
"markdownlint-cli": "0.39.0",
"postcss-html": "1.6.0",
"stylelint": "16.2.1",
"stylelint": "16.3.0",
"stylelint-declaration-block-no-ignored-properties": "2.8.0",
"stylelint-declaration-strict-value": "1.10.4",
"svgo": "3.2.0",
"updates": "15.3.1",
"updates": "16.0.0",
"vite-string-plugin": "1.1.5",
"vitest": "1.3.1"
"vitest": "1.4.0"
},
"browserslist": [
"defaults"
Expand Down
9 changes: 3 additions & 6 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion routers/api/v1/repo/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ func GetRawFileOrLFS(ctx *context.APIContext) {
return
}

// OK, now the blob is known to have at most 1024 bytes we can simply read this in in one go (This saves reading it twice)
// OK, now the blob is known to have at most 1024 bytes we can simply read this in one go (This saves reading it twice)
dataRc, err := blob.DataAsync()
if err != nil {
ctx.ServerError("DataAsync", err)
Expand Down
2 changes: 1 addition & 1 deletion routers/web/repo/issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -1601,7 +1601,7 @@ func ViewIssue(ctx *context.Context) {
}
marked[issue.PosterID] = issue.ShowRole

// Render comments and and fetch participants.
// Render comments and fetch participants.
participants[0] = issue.Poster

if err := issue.Comments.LoadAttachmentsByIssue(ctx); err != nil {
Expand Down
6 changes: 6 additions & 0 deletions services/doctor/fix16961.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,12 @@ func fixBrokenRepoUnit16961(repoUnit *repo_model.RepoUnit, bs []byte) (fixed boo
return false, nil
}

var cfg any
err = json.UnmarshalHandleDoubleEncode(bs, &cfg)
if err == nil {
return false, nil
}

switch repoUnit.Type {
case unit.TypeCode, unit.TypeReleases, unit.TypeWiki, unit.TypeProjects:
cfg := &repo_model.UnitConfig{}
Expand Down
2 changes: 1 addition & 1 deletion services/doctor/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ func checkStorage(opts *checkStorageOptions) func(ctx context.Context, logger lo
if opts.RepoArchives || opts.All {
if err := commonCheckStorage(ctx, logger, autofix,
&commonStorageCheckOptions{
storer: storage.RepoAvatars,
storer: storage.RepoArchives,
isOrphaned: func(path string, obj storage.Object, stat fs.FileInfo) (bool, error) {
exists, err := repo.ExistsRepoArchiverWithStoragePath(ctx, path)
if err == nil || errors.Is(err, util.ErrInvalidArgument) {
Expand Down
3 changes: 1 addition & 2 deletions services/migrations/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,14 +250,13 @@ func migrateRepository(ctx context.Context, doer *user_model.User, downloader ba
}
log.Warn("migrating milestones is not supported, ignored")
}

msBatchSize := uploader.MaxBatchInsertSize("milestone")
for len(milestones) > 0 {
if len(milestones) < msBatchSize {
msBatchSize = len(milestones)
}

if err := uploader.CreateMilestones(milestones...); err != nil {
if err := uploader.CreateMilestones(milestones[:msBatchSize]...); err != nil {
return err
}
milestones = milestones[msBatchSize:]
Expand Down
1 change: 0 additions & 1 deletion services/webhook/deliver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ func TestWebhookDeliverAuthorizationHeader(t *testing.T) {
err := hook.SetHeaderAuthorization("Bearer s3cr3t-t0ken")
assert.NoError(t, err)
assert.NoError(t, webhook_model.CreateWebhook(db.DefaultContext, hook))
db.GetEngine(db.DefaultContext).NoAutoTime().DB().Logger.ShowSQL(true)

hookTask := &webhook_model.HookTask{
HookID: hook.ID,
Expand Down
4 changes: 2 additions & 2 deletions templates/devtest/flex-list.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</div>
<div class="flex-item-trailing">
<button class="ui tiny red button">
{{svg "octicon-warning" 14}} CJK文本测试
{{svg "octicon-alert" 14}} CJK文本测试
</button>
<button class="ui tiny primary button">
{{svg "octicon-info" 14}} Button
Expand Down Expand Up @@ -54,7 +54,7 @@
</div>
<div class="flex-item-trailing">
<button class="ui tiny red button">
{{svg "octicon-warning" 12}} CJK文本测试 <!-- single CJK text test, it shouldn't be horizontal -->
{{svg "octicon-alert" 12}} CJK文本测试 <!-- single CJK text test, it shouldn't be horizontal -->
</button>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion templates/repo/diff/comment_form.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
{{end}}

<div class="field footer tw-mx-2">
<span class="markup-info">{{svg "octicon-markup"}} {{ctx.Locale.Tr "repo.diff.comment.markdown_info"}}</span>
<span class="markup-info">{{svg "octicon-markdown"}} {{ctx.Locale.Tr "repo.diff.comment.markdown_info"}}</span>
<div class="tw-text-right">
{{if $.reply}}
<button class="ui submit primary tiny button btn-reply" type="submit">{{ctx.Locale.Tr "repo.diff.comment.reply"}}</button>
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func TestMain(m *testing.M) {

// TestE2e should be the only test e2e necessary. It will collect all "*.test.e2e.js" files in this directory and build a test for each.
func TestE2e(t *testing.T) {
// Find the paths of all e2e test files in test test directory.
// Find the paths of all e2e test files in test directory.
searchGlob := filepath.Join(filepath.Dir(setting.AppPath), "tests", "e2e", "*.test.e2e.js")
paths, err := filepath.Glob(searchGlob)
if err != nil {
Expand Down
26 changes: 26 additions & 0 deletions tools/lint-templates-svg.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env node
import {readdirSync, readFileSync} from 'node:fs';
import {parse, relative} from 'node:path';
import {fileURLToPath} from 'node:url';
import {exit} from 'node:process';
import fastGlob from 'fast-glob';

const knownSvgs = new Set();
for (const file of readdirSync(new URL('../public/assets/img/svg', import.meta.url))) {
knownSvgs.add(parse(file).name);
}

const rootPath = fileURLToPath(new URL('..', import.meta.url));
let hadErrors = false;

for (const file of fastGlob.sync(fileURLToPath(new URL('../templates/**/*.tmpl', import.meta.url)))) {
const content = readFileSync(file, 'utf8');
for (const [_, name] of content.matchAll(/svg ["'`]([^"'`]+)["'`]/g)) {
if (!knownSvgs.has(name)) {
console.info(`SVG "${name}" not found, used in ${relative(rootPath, file)}`);
hadErrors = true;
}
}
}

exit(hadErrors ? 1 : 0);
18 changes: 18 additions & 0 deletions web_src/css/modules/grid.css
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,15 @@
align-self: center !important;
}

.ui[class*="left aligned"].grid > .column,
.ui[class*="left aligned"].grid > .row > .column,
.ui.grid > [class*="left aligned"].row > .column,
.ui.grid > [class*="left aligned"].column.column,
.ui.grid > .row > [class*="left aligned"].column.column {
text-align: left;
align-self: inherit;
}

.ui[class*="center aligned"].grid > .column,
.ui[class*="center aligned"].grid > .row > .column,
.ui.grid > [class*="center aligned"].row > .column,
Expand All @@ -418,6 +427,15 @@
justify-content: center;
}

.ui[class*="right aligned"].grid > .column,
.ui[class*="right aligned"].grid > .row > .column,
.ui.grid > [class*="right aligned"].row > .column,
.ui.grid > [class*="right aligned"].column.column,
.ui.grid > .row > [class*="right aligned"].column.column {
text-align: right;
align-self: inherit;
}

.ui[class*="equal width"].grid > .column:not(.row),
.ui[class*="equal width"].grid > .row > .column,
.ui.grid > [class*="equal width"].row > .column {
Expand Down
4 changes: 4 additions & 0 deletions web_src/css/modules/table.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@
}
.ui.table > thead,
.ui.table > tbody {
text-align: inherit;
vertical-align: inherit;
}

.ui.table > thead > tr > th {
background: var(--color-box-header);
text-align: inherit;
color: var(--color-text);
padding: 6px 5px;
vertical-align: inherit;
Expand All @@ -52,6 +54,7 @@
.ui.table > tfoot > tr > td {
border-top: 1px solid var(--color-secondary);
background: var(--color-box-body);
text-align: inherit;
color: var(--color-text);
padding: 0.78571429em;
vertical-align: inherit;
Expand All @@ -78,6 +81,7 @@
.ui.table > tbody > tr > td {
border-top: 1px solid var(--color-secondary-alpha-50);
padding: 6px 5px;
text-align: inherit;
}
.ui.table > tr:first-child > td,
.ui.table > tbody > tr:first-child > td {
Expand Down
5 changes: 2 additions & 3 deletions web_src/js/components/RepoActionView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,8 @@ export function initRepositoryActionView() {
flex-direction: column;
border: 1px solid var(--color-console-border);
border-radius: var(--border-radius);
background: var(--color-console-bg);
align-self: flex-start;
}
/* begin fomantic button overrides */
Expand Down Expand Up @@ -687,10 +689,8 @@ export function initRepositoryActionView() {
justify-content: space-between;
align-items: center;
padding: 0 12px;
background-color: var(--color-console-bg);
position: sticky;
top: 0;
border-radius: var(--border-radius);
height: 60px;
z-index: 1;
}
Expand All @@ -711,7 +711,6 @@ export function initRepositoryActionView() {
}
.job-step-container {
background-color: var(--color-console-bg);
max-height: 100%;
border-radius: 0 0 var(--border-radius) var(--border-radius);
border-top: 1px solid var(--color-console-border);
Expand Down
Loading

0 comments on commit c36d353

Please sign in to comment.