core: category: allow using '+'

This commit is contained in:
undefined committed 2021-06-28 16:17:03 +08:00
1 parent fcb06284e4
commit dd21f74ad2
9 files changed
+26 -26

No files matched your search

+6 -6
View File
@@ -31,27 +31,27 @@
"@shelf/jest-mongodb": "^1.2.5",
"@types/cross-spawn": "^6.0.2",
"@types/jest": "^26.0.23",
"@types/node": "^15.12.4",
"@types/node": "^15.12.5",
"@types/semver": "^7.3.6",
"@typescript-eslint/eslint-plugin": "^4.26.1",
"@typescript-eslint/parser": "^4.26.1",
"@typescript-eslint/eslint-plugin": "^4.28.0",
"@typescript-eslint/parser": "^4.28.0",
"cac": "^6.7.3",
"cross-env": "^7.0.3",
"cross-spawn": "^7.0.3",
"eslint": "^7.28.0",
"eslint": "^7.29.0",
"eslint-config-airbnb-typescript": "^12.3.1",
"eslint-import-resolver-typescript": "^2.4.0",
"eslint-plugin-import": "^2.23.4",
"fs-extra": "^10.0.0",
"globby": "^11.0.4",
"jest": "^27.0.4",
"jest": "^27.0.5",
"latest-version": "^5.1.0",
"mongodb": "^3.6.9",
"nmls": "^3.0.1",
"ora": "^5.4.1",
"semver": "^7.3.5",
"ts-jest": "^27.0.3",
"typedoc": "^0.20.37",
"typedoc": "^0.21.2",
"typescript": "4.2.4"
}
}
+1 -1
View File
@@ -12,7 +12,7 @@
},
"devDependencies": {
"@types/js-yaml": "^4.0.1",
"@types/node": "^15.12.4"
"@types/node": "^15.12.5"
},
"peerDependencies": {
"hydrooj": "*"
+1 -1
View File
@@ -15,7 +15,7 @@
"mongodb": "^3.6.9",
"p-queue": "^6.6.2",
"shell-quote": "^1.7.2",
"ws": "^7.4.6"
"ws": "^7.5.0"
},
"preferUnplugged": true,
"license": "AGPL-3.0-or-later",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "hydrooj",
"version": "2.28.57",
"version": "2.28.58",
"bin": "bin/hydrooj.js",
"main": "dist/loader.js",
"typings": "dist/loader.d.ts",
+3 -3
View File
@@ -28,7 +28,7 @@ import {
Route, Handler, Types, param, post, route, query,
} from '../service/server';
export const parseCategory = (value: string) => flatten(value.replace(/,/g, ',').split('+').map((e) => e.split(','))).map((e) => e.trim());
export const parseCategory = (value: string) => flatten(value.replace(/,/g, ',').split(',')).map((e) => e.trim());
export const parsePid = (value: string) => (isSafeInteger(value) ? +value : value);
export class ProblemHandler extends Handler {
@@ -70,7 +70,7 @@ export class ProblemMainHandler extends ProblemHandler {
for (const tag of category) query.$and.push({ tag });
}
if (q) category.push(q);
if (category.length) this.extraTitleContent = category.join('+');
if (category.length) this.extraTitleContent = category.join(',');
if (q) {
if (search) {
const result = await search(domainId, q);
@@ -99,7 +99,7 @@ export class ProblemMainHandler extends ProblemHandler {
);
}
this.response.body = {
page, pcount, ppcount, pdocs, psdict, category: category.join('+'),
page, pcount, ppcount, pdocs, psdict, category: category.join(','),
};
}
+1 -1
View File
@@ -7,7 +7,7 @@
"license": "AGPL-3.0-or-later",
"preferUnplugged": true,
"dependencies": {
"ws": "^7.4.6"
"ws": "^7.5.0"
},
"devDependencies": {
"@types/ws": "^7.4.5"
+11 -11
View File
@@ -9,7 +9,7 @@
"devDependencies": {
"@babel/cli": "^7.14.5",
"@babel/core": "^7.14.6",
"@babel/eslint-parser": "7.14.5",
"@babel/eslint-parser": "7.14.7",
"@babel/plugin-proposal-class-properties": "^7.14.5",
"@babel/plugin-proposal-export-namespace-from": "^7.14.5",
"@babel/plugin-proposal-function-sent": "^7.14.5",
@@ -19,13 +19,13 @@
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/plugin-syntax-import-meta": "^7.10.4",
"@babel/plugin-transform-runtime": "^7.14.5",
"@babel/preset-env": "^7.14.5",
"@babel/preset-env": "^7.14.7",
"@babel/preset-react": "^7.14.5",
"@babel/register": "^7.14.5",
"@babel/runtime-corejs3": "^7.14.6",
"@blueprintjs/core": "^3.45.0",
"@blueprintjs/icons": "^3.26.1",
"@blueprintjs/select": "^3.16.4",
"@babel/runtime-corejs3": "^7.14.7",
"@blueprintjs/core": "^3.46.0",
"@blueprintjs/icons": "^3.27.0",
"@blueprintjs/select": "^3.16.5",
"@hydrooj/utils": "workspace:*",
"@types/json-schema": "^7.0.7",
"@types/katex": "^0.11.0",
@@ -44,7 +44,7 @@
"diff-dom": "^4.2.2",
"echarts": "^5.1.2",
"emojify.js": "^1.1.0",
"eslint": "^7.28.0",
"eslint": "^7.29.0",
"eslint-config-airbnb": "^18.2.1",
"eslint-import-resolver-webpack": "^0.13.1",
"eslint-plugin-babel": "^5.3.1",
@@ -66,19 +66,19 @@
"jquery-scroll-lock": "^3.1.3",
"jquery.easing": "^1.4.1",
"jquery.transit": "^0.9.12",
"mini-css-extract-plugin": "^1.6.0",
"mini-css-extract-plugin": "^1.6.1",
"moment": "^2.29.1",
"monaco-editor": "^0.24.0",
"monaco-editor": "^0.25.2",
"monaco-editor-webpack-plugin": "^3.1.0",
"nanoid": "^3.1.23",
"normalize.css": "^8.0.1",
"nprogress": "^0.2.0",
"optimize-css-assets-webpack-plugin": "^5.0.6",
"optimize-css-assets-webpack-plugin": "^5.0.8",
"pickadate": "^3.6.4",
"plugin-error": "^1.0.1",
"postcss-loader": "^3.0.0",
"prism-themes": "^1.7.0",
"prismjs": "^1.23.0",
"prismjs": "^1.24.0",
"prop-types": "^15.7.2",
"react": "^17.0.2",
"react-dom": "^17.0.2",
+1 -1
View File
@@ -16,7 +16,7 @@
},
"devDependencies": {
"@types/fs-extra": "^9.0.11",
"@types/node": "^15.12.4",
"@types/node": "^15.12.5",
"moment-timezone": "^0.5.33"
}
}
+1 -1
View File
@@ -14,7 +14,7 @@
"superagent-proxy": "^2.1.0"
},
"devDependencies": {
"@types/jsdom": "^16.2.11",
"@types/jsdom": "^16.2.12",
"@types/superagent-proxy": "^2.0.0"
}
}