Skip to content

Commit 2bad9d3

Browse files
committed
core&ui: fix contest_edit file upload
1 parent 3a5586c commit 2bad9d3

File tree

11 files changed

+39
-22
lines changed

11 files changed

+39
-22
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/lib/picker.js b/lib/picker.js
2+
index 88fef537f38b4cc45d10cec3774363e2c5a007c9..79a097cc0b2d5bcc1eaf108c16430b5950034fe6 100644
3+
--- a/lib/picker.js
4+
+++ b/lib/picker.js
5+
@@ -1079,7 +1079,7 @@ PickerConstructor._ = {
6+
if ( !item ) return ''
7+
8+
// If the item is an array, do a join
9+
- item = $.isArray( item ) ? item.join( '' ) : item
10+
+ item = Array.isArray( item ) ? item.join( '' ) : item
11+
12+
// Check for the class
13+
klass = klass ? ' class="' + klass + '"' : ''

framework/eslint-config/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
"main": "base.mjs",
66
"repository": "https://github.com/hydro-dev/Hydro",
77
"dependencies": {
8-
"@antfu/eslint-config": "^7.4.3",
8+
"@antfu/eslint-config": "^7.6.1",
99
"@eslint-react/eslint-plugin": "^2.13.0",
10-
"@typescript-eslint/eslint-plugin": "^8.56.0",
11-
"@typescript-eslint/parser": "^8.56.0",
10+
"@typescript-eslint/eslint-plugin": "^8.56.1",
11+
"@typescript-eslint/parser": "^8.56.1",
1212
"eslint-plugin-de-morgan": "^2.0.0",
1313
"eslint-plugin-github": "^6.0.0",
1414
"eslint-plugin-react-hooks": "^7.0.1",
15-
"eslint-plugin-react-refresh": "^0.5.0",
15+
"eslint-plugin-react-refresh": "^0.5.2",
1616
"eslint-plugin-simple-import-sort": "^12.1.1",
1717
"globals": "^17.3.0"
1818
},

framework/framework/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"@mongodb-js/saslprep": "^1.4.6",
1414
"emoji-regex": "^10.6.0",
1515
"fs-extra": "^11.3.3",
16-
"koa": "^3.1.1",
16+
"koa": "^3.1.2",
1717
"koa-body": "^7.0.1",
1818
"koa-compress": "5.1.1",
1919
"path-to-regexp": "^8.3.0",

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"cross-env": "^10.1.0",
4444
"cross-spawn": "^7.0.6",
4545
"esbuild": "0.25.2",
46-
"eslint": "^9.39.2",
46+
"eslint": "^9.39.3",
4747
"eslint-import-resolver-typescript": "^4.4.4",
4848
"eslint-import-resolver-webpack": "^0.13.10",
4949
"fs-extra": "^11.3.3",
@@ -53,10 +53,10 @@
5353
"mongodb-memory-server": "11.0.1",
5454
"nyc": "^17.1.0",
5555
"ora": "^9.3.0",
56-
"oxlint": "^1.48.0",
56+
"oxlint": "^1.50.0",
5757
"package-json": "^10.0.1",
5858
"semver": "^7.7.4",
59-
"simple-git": "^3.31.1",
59+
"simple-git": "^3.32.3",
6060
"supertest": "^7.2.2",
6161
"supports-hyperlinks": "^4.4.0",
6262
"typescript": "5.8.3",

packages/components/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"devDependencies": {
2121
"@types/diff": "^8.0.0",
2222
"@types/js-yaml": "^4.0.9",
23-
"@types/lodash": "^4.17.23",
23+
"@types/lodash": "^4.17.24",
2424
"sass": "^1.97.3"
2525
},
2626
"peerDependencies": {

packages/hydrooj/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@
6060
"@types/fs-extra": "^11.0.4",
6161
"@types/js-yaml": "^4.0.9",
6262
"@types/koa-static-cache": "^5.1.4",
63-
"@types/lodash": "^4.17.23",
63+
"@types/lodash": "^4.17.24",
6464
"@types/mime-types": "^3.0.1",
6565
"@types/mongodb-uri": "^0.9.4",
66-
"@types/nodemailer": "^7.0.10",
66+
"@types/nodemailer": "^7.0.11",
6767
"@types/notp": "^2.0.5",
6868
"@types/semver": "^7.7.1",
6969
"@types/superagent": "^8.1.9",

packages/hydrooj/src/handler/contest.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,9 @@ export class ContestCodeHandler extends Handler {
538538

539539
export class ContestManagementHandler extends ContestManagementBaseHandler {
540540
@param('tid', Types.ObjectId)
541-
async get(domainId: string, tid: ObjectId) {
541+
@param('d', Types.Range(['public', 'private']), true)
542+
@param('sidebar', Types.Boolean)
543+
async get(domainId: string, tid: ObjectId, d?: string, sidebar?: boolean) {
542544
this.response.body = {
543545
tdoc: this.tdoc,
544546
tsdoc: this.tsdoc,
@@ -549,11 +551,12 @@ export class ContestManagementHandler extends ContestManagementBaseHandler {
549551
urlForFile: (filename: string, type: string) => this.url('contest_file_download', { tid, filename, type }),
550552
};
551553
this.response.pjax = [
552-
['partials/files.html', { filetype: 'public' }],
553-
['partials/files.html', {
554+
...((!d || d === 'public') ? [['partials/files.html', { filetype: 'public', sidebar }] as const] : []),
555+
...((!d || d === 'private') ? [['partials/files.html', {
554556
files: this.response.body.privateFiles,
555557
filetype: 'private',
556-
}],
558+
sidebar,
559+
}] as const] : []),
557560
];
558561
this.response.template = 'contest_manage.html';
559562
}

packages/ui-default/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@
2323
"@mantine/core": "^8.3.15",
2424
"@mantine/hooks": "^8.3.15",
2525
"@mantine/notifications": "^8.3.15",
26-
"@sentry/browser": "^10.39.0",
26+
"@sentry/browser": "^10.40.0",
2727
"@sentry/webpack-plugin": "^4.9.1",
2828
"@simplewebauthn/browser": "13.2.2",
2929
"@svgr/webpack": "^8.1.0",
3030
"@types/html-to-text": "^9.0.4",
31-
"@types/jquery": "^3.5.33",
31+
"@types/jquery": "^3.5.34",
3232
"@types/jquery.transit": "^0.9.33",
3333
"@types/json-schema": "^7.0.15",
3434
"@types/katex": "^0.16.8",
@@ -80,7 +80,7 @@
8080
"normalize.css": "^8.0.1",
8181
"nprogress": "^0.2.0",
8282
"p-queue": "^9.1.0",
83-
"pickadate": "^3.6.4",
83+
"pickadate": "patch:pickadate@npm%3A3.6.4#~/.yarn/patches/pickadate-npm-3.6.4-5795acb19d.patch",
8484
"postcss-loader": "7.3.4",
8585
"postcss-preset-mantine": "^1.18.0",
8686
"prism-themes": "^1.9.0",
@@ -116,7 +116,7 @@
116116
"timeago.js": "^4.0.2",
117117
"ts-loader": "^9.5.4",
118118
"web-streams-polyfill": "^4.2.0",
119-
"webpack": "^5.105.2",
119+
"webpack": "^5.105.3",
120120
"webpack-bundle-analyzer": "^5.2.0",
121121
"webpack-dev-server": "^5.2.3",
122122
"webpack-manifest-plugin": "^6.0.1",
@@ -131,7 +131,7 @@
131131
"html-to-text": "^9.0.5",
132132
"js-yaml": "^4.1.1",
133133
"jsesc": "^3.1.0",
134-
"katex": "^0.16.28",
134+
"katex": "^0.16.33",
135135
"lodash": "^4.17.23",
136136
"markdown-it": "^14.1.1",
137137
"markdown-it-anchor": "^9.2.0",

packages/ui-default/pages/files.page.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,7 @@ const page = new NamedPage([
336336
'home_files', 'training_files', 'homework_files',
337337
], (pageName) => {
338338
if (pageName === 'problem_config' || pageName === 'problem_edit') endpoint = './files';
339+
if (pageName === 'contest_edit') endpoint = './management';
339340
$(document).on('click', '[name="file_rename"]', (ev) => handleClickRename(ev));
340341
$(document).on('click', '[name="file_remove"]', (ev) => handleClickRemove(ev));
341342
$(document).on('click', '[name="upload_file"]', (ev) => handleClickUpload(ev));

packages/ui-default/templates/contest_edit.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ <h2 class="section__title">{{ _('Contest Settings') }}</h2>
233233
<div class="section__header">
234234
<h1 class="section__title">{{ _('Files') }}</h1>
235235
<div class="section__tools">
236-
<button class="primary rounded button" name="upload_file">{{ _('Upload') }}</button>
236+
<button class="primary rounded button" name="upload_file" data-type="public" data-sidebar="true">{{ _('Upload') }}</button>
237237
</div>
238238
</div>
239239
{% set sidebar = true %}

0 commit comments

Comments
 (0)