Compare commits

..

1 Commits

3 changed files with 16 additions and 20 deletions

View File

@ -1,7 +1,7 @@
{ {
"include": [ "include": [
"${configDir}/*",
"${configDir}/.*", "${configDir}/.*",
"${configDir}/*",
"${configDir}/tests/e2e/**/*", "${configDir}/tests/e2e/**/*",
"${configDir}/tests/e2e/**/.*", "${configDir}/tests/e2e/**/.*",
"${configDir}/tools/**/*", "${configDir}/tools/**/*",
@ -17,31 +17,27 @@
"allowImportingTsExtensions": true, "allowImportingTsExtensions": true,
"allowJs": true, "allowJs": true,
"allowSyntheticDefaultImports": true, "allowSyntheticDefaultImports": true,
"allowUnreachableCode": false,
"allowUnusedLabels": false,
"alwaysStrict": true, "alwaysStrict": true,
"erasableSyntaxOnly": true, "erasableSyntaxOnly": true,
"esModuleInterop": true, "esModuleInterop": true,
"exactOptionalPropertyTypes": false,
"isolatedModules": true, "isolatedModules": true,
"libReplacement": false, "libReplacement": false,
"noEmit": true, "noEmit": true,
"noFallthroughCasesInSwitch": true,
"noImplicitAny": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noPropertyAccessFromIndexSignature": false,
"noUnusedLocals": true,
"noUnusedParameters": true,
"resolveJsonModule": true, "resolveJsonModule": true,
"skipLibCheck": true, "skipLibCheck": true,
"sourceMap": true, "verbatimModuleSyntax": true,
"stripInternal": true,
"strict": false, "strict": false,
"strictBindCallApply": true, "strictBindCallApply": true,
"strictBuiltinIteratorReturn": true, "strictBuiltinIteratorReturn": true,
"strictFunctionTypes": true, "strictFunctionTypes": true,
"stripInternal": true, "noImplicitAny": true,
"verbatimModuleSyntax": true, "noImplicitThis": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noPropertyAccessFromIndexSignature": false,
"exactOptionalPropertyTypes": false,
"sourceMap": true,
"types": [ "types": [
"vitest/globals", "vitest/globals",
"./web_src/js/globals.d.ts", "./web_src/js/globals.d.ts",

View File

@ -10,7 +10,7 @@ export function initTableSort() {
} }
function tableSort(normSort: string, revSort: string, isDefault: string) { function tableSort(normSort: string, revSort: string, isDefault: string) {
if (!normSort) return; if (!normSort) return false;
if (!revSort) revSort = ''; if (!revSort) revSort = '';
const url = new URL(window.location.href); const url = new URL(window.location.href);

View File

@ -43,7 +43,7 @@ type ToastOpts = {
type ToastifyElement = HTMLElement & {_giteaToastifyInstance?: Toast}; type ToastifyElement = HTMLElement & {_giteaToastifyInstance?: Toast};
/** See https://github.com/apvarun/toastify-js#api for options */ /** See https://github.com/apvarun/toastify-js#api for options */
function showToast(message: string, level: Intent, {gravity, position, duration, useHtmlBody, preventDuplicates = true, ...other}: ToastOpts = {}): Toast | null { function showToast(message: string, level: Intent, {gravity, position, duration, useHtmlBody, preventDuplicates = true, ...other}: ToastOpts = {}): Toast {
const body = useHtmlBody ? message : htmlEscape(message); const body = useHtmlBody ? message : htmlEscape(message);
const parent = document.querySelector('.ui.dimmer.active') ?? document.body; const parent = document.querySelector('.ui.dimmer.active') ?? document.body;
const duplicateKey = preventDuplicates ? (preventDuplicates === true ? `${level}-${body}` : preventDuplicates) : ''; const duplicateKey = preventDuplicates ? (preventDuplicates === true ? `${level}-${body}` : preventDuplicates) : '';
@ -56,7 +56,7 @@ function showToast(message: string, level: Intent, {gravity, position, duration,
showElem(toastDupNumEl); showElem(toastDupNumEl);
toastDupNumEl.textContent = String(Number(toastDupNumEl.textContent) + 1); toastDupNumEl.textContent = String(Number(toastDupNumEl.textContent) + 1);
animateOnce(toastDupNumEl, 'pulse-1p5-200'); animateOnce(toastDupNumEl, 'pulse-1p5-200');
return null; return;
} }
} }
@ -83,15 +83,15 @@ function showToast(message: string, level: Intent, {gravity, position, duration,
return toast; return toast;
} }
export function showInfoToast(message: string, opts?: ToastOpts): Toast | null { export function showInfoToast(message: string, opts?: ToastOpts): Toast {
return showToast(message, 'info', opts); return showToast(message, 'info', opts);
} }
export function showWarningToast(message: string, opts?: ToastOpts): Toast | null { export function showWarningToast(message: string, opts?: ToastOpts): Toast {
return showToast(message, 'warning', opts); return showToast(message, 'warning', opts);
} }
export function showErrorToast(message: string, opts?: ToastOpts): Toast | null { export function showErrorToast(message: string, opts?: ToastOpts): Toast {
return showToast(message, 'error', opts); return showToast(message, 'error', opts);
} }