Skip to content

Commit

Permalink
Merge branch 'main' into lintsvg
Browse files Browse the repository at this point in the history
  • Loading branch information
GiteaBot authored Mar 26, 2024
2 parents cac1eb9 + 274bc00 commit 98075de
Show file tree
Hide file tree
Showing 15 changed files with 258 additions and 269 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ rules:
"@stylistic/js/semi-spacing": [2, {before: false, after: true}]
"@stylistic/js/semi-style": [2, last]
"@stylistic/js/space-before-blocks": [2, always]
"@stylistic/js/space-before-function-paren": [0]
"@stylistic/js/space-before-function-paren": [2, {anonymous: ignore, named: never, asyncArrow: always}]
"@stylistic/js/space-in-parens": [2, never]
"@stylistic/js/space-infix-ops": [2]
"@stylistic/js/space-unary-ops": [2]
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/relative-time-element": "4.3.1",
"@github/text-expander-element": "2.6.1",
"@mcaptcha/vanilla-glue": "0.1.0-alpha-3",
"@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
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
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
42 changes: 20 additions & 22 deletions web_src/js/features/repo-code.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,40 +28,38 @@ function selectRange($linesEls, $selectionEndEl, $selectionStartEls) {
$linesEls.closest('tr').removeClass('active');

// add hashchange to permalink
const $refInNewIssue = $('a.ref-in-new-issue');
const $copyPermalink = $('a.copy-line-permalink');
const $viewGitBlame = $('a.view_git_blame');
const refInNewIssue = document.querySelector('a.ref-in-new-issue');
const copyPermalink = document.querySelector('a.copy-line-permalink');
const viewGitBlame = document.querySelector('a.view_git_blame');

const updateIssueHref = function (anchor) {
if (!$refInNewIssue.length) {
return;
}
const urlIssueNew = $refInNewIssue.attr('data-url-issue-new');
const urlParamBodyLink = $refInNewIssue.attr('data-url-param-body-link');
if (!refInNewIssue) return;
const urlIssueNew = refInNewIssue.getAttribute('data-url-issue-new');
const urlParamBodyLink = refInNewIssue.getAttribute('data-url-param-body-link');
const issueContent = `${toAbsoluteUrl(urlParamBodyLink)}#${anchor}`; // the default content for issue body
$refInNewIssue.attr('href', `${urlIssueNew}?body=${encodeURIComponent(issueContent)}`);
refInNewIssue.setAttribute('href', `${urlIssueNew}?body=${encodeURIComponent(issueContent)}`);
};

const updateViewGitBlameFragment = function (anchor) {
if (!$viewGitBlame.length) return;
let href = $viewGitBlame.attr('href');
if (!viewGitBlame) return;
let href = viewGitBlame.getAttribute('href');
href = `${href.replace(/#L\d+$|#L\d+-L\d+$/, '')}`;
if (anchor.length !== 0) {
href = `${href}#${anchor}`;
}
$viewGitBlame.attr('href', href);
viewGitBlame.setAttribute('href', href);
};

const updateCopyPermalinkUrl = function(anchor) {
if (!$copyPermalink.length) return;
let link = $copyPermalink.attr('data-url');
const updateCopyPermalinkUrl = function (anchor) {
if (!copyPermalink) return;
let link = copyPermalink.getAttribute('data-url');
link = `${link.replace(/#L\d+$|#L\d+-L\d+$/, '')}#${anchor}`;
$copyPermalink.attr('data-url', link);
copyPermalink.setAttribute('data-url', link);
};

if ($selectionStartEls) {
let a = parseInt($selectionEndEl.attr('rel').slice(1));
let b = parseInt($selectionStartEls.attr('rel').slice(1));
let a = parseInt($selectionEndEl[0].getAttribute('rel').slice(1));
let b = parseInt($selectionStartEls[0].getAttribute('rel').slice(1));
let c;
if (a !== b) {
if (a > b) {
Expand All @@ -85,11 +83,11 @@ function selectRange($linesEls, $selectionEndEl, $selectionStartEls) {
}
}
$selectionEndEl.closest('tr').addClass('active');
changeHash(`#${$selectionEndEl.attr('rel')}`);
changeHash(`#${$selectionEndEl[0].getAttribute('rel')}`);

updateIssueHref($selectionEndEl.attr('rel'));
updateViewGitBlameFragment($selectionEndEl.attr('rel'));
updateCopyPermalinkUrl($selectionEndEl.attr('rel'));
updateIssueHref($selectionEndEl[0].getAttribute('rel'));
updateViewGitBlameFragment($selectionEndEl[0].getAttribute('rel'));
updateCopyPermalinkUrl($selectionEndEl[0].getAttribute('rel'));
}

function showLineButton() {
Expand Down
2 changes: 1 addition & 1 deletion web_src/js/svg.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ export const SvgIcon = {

// make the <SvgIcon class="foo" class-name="bar"> classes work together
const classes = [];
for (const cls of svgOuter.classList.values()) {
for (const cls of svgOuter.classList) {
classes.push(cls);
}
// TODO: drop the `className/class-name` prop in the future, only use "class" prop
Expand Down
1 change: 0 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ export default {
loader: 'postcss-loader',
options: {
postcssOptions: {
map: false, // https://github.com/postcss/postcss/issues/1914
plugins: [
tailwindcssNesting(postcssNesting({edition: '2024-02'})),
tailwindcss(tailwindConfig),
Expand Down

0 comments on commit 98075de

Please sign in to comment.