From 5c638bc0bbc58bff0fdfd8ed3322a9060c4eab4c Mon Sep 17 00:00:00 2001 From: Leszek Date: Wed, 22 Oct 2025 15:06:27 +0200 Subject: [PATCH 1/5] bump biome to 2.2.7 and run migration --- biome.jsonc | 57 +++++++++--------- package-lock.json | 143 +++++++++++++++++++++++----------------------- package.json | 2 +- 3 files changed, 99 insertions(+), 103 deletions(-) diff --git a/biome.jsonc b/biome.jsonc index 77b79ae026..d7e7a5f833 100644 --- a/biome.jsonc +++ b/biome.jsonc @@ -1,21 +1,20 @@ { - "$schema": "https://biomejs.dev/schemas/1.9.4/schema.json", + "$schema": "https://biomejs.dev/schemas/2.2.7/schema.json", "files": { - "ignore": [ - "node_modules/**", - "jsapp/compiled/**", - "*.css", - // Ignore generated OpenAPI schema. - "static/openapi/*", - // Ignore minified committed JS files. - "*.min.js", - "*-min.js", - "bootstrap*.js", - "jquery*.js", - "kobo/apps/openrosa/apps/logger/fixtures/*", - "kpi/static/js/swagger/swagger-ui-bundle.js", - "kpi/static/js/swagger/swagger-ui-standalone-preset.js", - "msw-mocks/*" + "includes": [ + "**", + "!**/node_modules", + "!**/jsapp/compiled", + "!**/*.css", + "!**/static/openapi/**/*", + "!**/*.min.js", + "!**/*-min.js", + "!**/bootstrap*.js", + "!**/jquery*.js", + "!**/kobo/apps/openrosa/apps/logger/fixtures/**/*", + "!**/kpi/static/js/swagger/swagger-ui-bundle.js", + "!**/kpi/static/js/swagger/swagger-ui-standalone-preset.js", + "!**/msw-mocks/**/*" ] }, "vcs": { @@ -26,7 +25,7 @@ "formatter": { "enabled": true, // Default. "formatWithErrors": false, // Default. - "ignore": [], // Default. + "includes": ["**"], // Default. "attributePosition": "auto", // Default. "indentStyle": "space", // Default is tab, we use space due imho the real standard. "indentWidth": 2, // Default. @@ -47,9 +46,7 @@ "quoteStyle": "single" // Default is double, we use single for a cleaner look. } }, - "organizeImports": { - "enabled": true - }, + "assist": { "actions": { "source": { "organizeImports": "on" } } }, "linter": { "enabled": true, "rules": { @@ -63,7 +60,8 @@ "noUnsafeOptionalChaining": "off", // Recommended rule. TODO: review 2 cases and enable. "noUnusedImports": "error", // Enable all safely fixable rules. "useExhaustiveDependencies": "off", // Recommended rule. TODO: review 101 cases and enable. - "useJsxKeyInIterable": "off" // Recommended rule. TODO: review 17 cases and enable. + "useJsxKeyInIterable": "off", // Recommended rule. TODO: review 17 cases and enable. + "useValidTypeof": "off" // Recommended rule. TODO: review 3 cases and enable. }, "suspicious": { "noArrayIndexKey": "off", // Recommended rule. TODO: review 40 cases and enable. @@ -78,10 +76,11 @@ "noRedeclare": "off", // Recommended rule. TODO: review 1 case and enable. "noShadowRestrictedNames": "off", // Recommended rule. TODO: review 2 cases and enable. "useIsArray": "off", // Recommended rule. TODO: review 3 cases and enable. - "useValidTypeof": "off" // Recommended rule. TODO: review 3 cases and enable. + "noVar": "off" }, "security": { - "noDangerouslySetInnerHtml": "off" // Recommended rule. TODO: review 11 cases and enable. + "noDangerouslySetInnerHtml": "off", // Recommended rule. TODO: review 11 cases and enable. + "noBlankTarget": "off" }, "complexity": { "noBannedTypes": "off", // Recommended rule. TODO: review 144 cases and enable. @@ -93,14 +92,16 @@ "noUselessTernary": "off", // Recommended rule. TODO: review 4 cases and enable. "noUselessUndefinedInitialization": "error", // Enable all safely fixable rules. "useLiteralKeys": "off", // Recommended rule. TODO: review 28 cases and enable. - "useOptionalChain": "off" // Recommended rule. TODO: review 36 cases and enable. + "useOptionalChain": "off", // Recommended rule. TODO: review 36 cases and enable. + "noArguments": "off", + "noCommaOperator": "off", + "useWhile": "error" // Enable all safely fixable rules. }, "performance": { "noAccumulatingSpread": "off", // Recommended rule. TODO: review 7 cases and enable. "noDelete": "off" // Recommended rule. TODO: review 17 cases and enable. }, "a11y": { - "noBlankTarget": "off", // Not a problem for modern browsers; see 2021 update, see https://mathiasbynens.github.io/rel-noopener/#recommendations. "noLabelWithoutControl": "off", // Recommended rule. TODO: review 63 cases and enable. "noNoninteractiveTabindex": "off", // Recommended rule. TODO: review 1 cases and enable. "noPositiveTabindex": "off", // Recommended rule. TODO: review 1 cases and enable. @@ -117,8 +118,6 @@ "useValidAnchor": "off" // Recommended rule. TODO: review 4 cases and enable. }, "style": { - "noArguments": "off", // Recommended rule. TODO: review 6 cases and enable. - "noCommaOperator": "off", // Recommended rule. TODO: review 7 cases and enable. "noImplicitBoolean": "off", // Enable all safely fixable rules, except this for a cleaner look. "noInferrableTypes": "error", // Enable all safely fixable rules. "noNegationElse": "error", // Enable all safely fixable rules. @@ -126,7 +125,6 @@ "noParameterAssign": "off", // Recommended rule. TODO: review 31 cases and enable. "noUnusedTemplateLiteral": "off", // Recommended rule. TODO: review 5 cases and enable. "noUselessElse": "off", // Recommended rule. TODO: review 167 cases and enable. - "noVar": "off", // Recommended rule. TODO: review 234 cases and enable. "noYodaExpression": "error", // Enable all safely fixable rules. "useAsConstAssertion": "error", // Enable all safely fixable rules. "useCollapsedElseIf": "error", // Enable all safely fixable rules. @@ -137,8 +135,7 @@ "useNodejsImportProtocol": "off", // Recommended rule. TODO: review 3 cases and enable. "useSelfClosingElements": "error", // Enable all safely fixable rules. "useSingleVarDeclarator": "off", // Recommended rule. TODO: review 35 cases and enable. - "useTemplate": "off", // Recommended rule. TODO: review 103 cases and enable. - "useWhile": "error" // Enable all safely fixable rules. + "useTemplate": "off" // Recommended rule. TODO: review 103 cases and enable. } } } diff --git a/package-lock.json b/package-lock.json index fd350df5e2..afb901f898 100644 --- a/package-lock.json +++ b/package-lock.json @@ -87,7 +87,7 @@ }, "devDependencies": { "@babel/preset-env": "^7.22.5", - "@biomejs/biome": "^1.9.4", + "@biomejs/biome": "^2.2.7", "@eslint/compat": "^1.2.4", "@eslint/eslintrc": "^3.3.1", "@eslint/js": "^9.17.0", @@ -2104,11 +2104,10 @@ "license": "MIT" }, "node_modules/@biomejs/biome": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-1.9.4.tgz", - "integrity": "sha512-1rkd7G70+o9KkTn5KLmDYXihGoTaIGO9PIIN2ZB7UJxFrWw04CZHPYiMRjYsaDvVV7hP1dYNRLxSANLaBFGpog==", + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-2.2.7.tgz", + "integrity": "sha512-1a8j0UP1vXVUf3UzMZEJ/zS2VgAG6wU6Cuh/I764sUGI+MCnJs/9WaojHYBDCxCMLTgU60/WqnYof85emXmSBA==", "dev": true, - "hasInstallScript": true, "license": "MIT OR Apache-2.0", "bin": { "biome": "bin/biome" @@ -2121,20 +2120,20 @@ "url": "https://opencollective.com/biome" }, "optionalDependencies": { - "@biomejs/cli-darwin-arm64": "1.9.4", - "@biomejs/cli-darwin-x64": "1.9.4", - "@biomejs/cli-linux-arm64": "1.9.4", - "@biomejs/cli-linux-arm64-musl": "1.9.4", - "@biomejs/cli-linux-x64": "1.9.4", - "@biomejs/cli-linux-x64-musl": "1.9.4", - "@biomejs/cli-win32-arm64": "1.9.4", - "@biomejs/cli-win32-x64": "1.9.4" + "@biomejs/cli-darwin-arm64": "2.2.7", + "@biomejs/cli-darwin-x64": "2.2.7", + "@biomejs/cli-linux-arm64": "2.2.7", + "@biomejs/cli-linux-arm64-musl": "2.2.7", + "@biomejs/cli-linux-x64": "2.2.7", + "@biomejs/cli-linux-x64-musl": "2.2.7", + "@biomejs/cli-win32-arm64": "2.2.7", + "@biomejs/cli-win32-x64": "2.2.7" } }, "node_modules/@biomejs/cli-darwin-arm64": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-1.9.4.tgz", - "integrity": "sha512-bFBsPWrNvkdKrNCYeAp+xo2HecOGPAy9WyNyB/jKnnedgzl4W4Hb9ZMzYNbf8dMCGmUdSavlYHiR01QaYR58cw==", + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-2.2.7.tgz", + "integrity": "sha512-xBUUsebnO2/Qj1v7eZmKUy2ZcFkZ4/jLUkxN02Qup1RPoRaiW9AKXHrqS3L7iX6PzofHY2xuZ+Pb9kAcpoe0qA==", "cpu": [ "arm64" ], @@ -2149,9 +2148,9 @@ } }, "node_modules/@biomejs/cli-darwin-x64": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-1.9.4.tgz", - "integrity": "sha512-ngYBh/+bEedqkSevPVhLP4QfVPCpb+4BBe2p7Xs32dBgs7rh9nY2AIYUL6BgLw1JVXV8GlpKmb/hNiuIxfPfZg==", + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-2.2.7.tgz", + "integrity": "sha512-vsY4NhmxqgfLJufr9XUnC+yGUPJiXAc1mz6FcjaAmuIuLwfghN4uQO7hnW2AneGyoi2mNe9Jbvf6Qtq4AjzrFg==", "cpu": [ "x64" ], @@ -2166,9 +2165,9 @@ } }, "node_modules/@biomejs/cli-linux-arm64": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-1.9.4.tgz", - "integrity": "sha512-fJIW0+LYujdjUgJJuwesP4EjIBl/N/TcOX3IvIHJQNsAqvV2CHIogsmA94BPG6jZATS4Hi+xv4SkBBQSt1N4/g==", + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-2.2.7.tgz", + "integrity": "sha512-nUdco104rjV9dULi1VssQ5R/kX2jE/Z2sDjyqS+siV9sTQda0DwmEUixFNRCWvZJRRiZUWhgiDFJ4n7RowO8Mg==", "cpu": [ "arm64" ], @@ -2183,9 +2182,9 @@ } }, "node_modules/@biomejs/cli-linux-arm64-musl": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-1.9.4.tgz", - "integrity": "sha512-v665Ct9WCRjGa8+kTr0CzApU0+XXtRgwmzIf1SeKSGAv+2scAlW6JR5PMFo6FzqqZ64Po79cKODKf3/AAmECqA==", + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.2.7.tgz", + "integrity": "sha512-FrTwvKO/7t5HbVTvhlMOTOVQLAcR7r4O4iFQhEpZXUtBfosHqrX/JJlX7daPawoe14MDcCu9CDg0zLVpTuDvuQ==", "cpu": [ "arm64" ], @@ -2200,9 +2199,9 @@ } }, "node_modules/@biomejs/cli-linux-x64": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-1.9.4.tgz", - "integrity": "sha512-lRCJv/Vi3Vlwmbd6K+oQ0KhLHMAysN8lXoCI7XeHlxaajk06u7G+UsFSO01NAs5iYuWKmVZjmiOzJ0OJmGsMwg==", + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-2.2.7.tgz", + "integrity": "sha512-tPTcGAIEOOZrj2tQ7fdraWlaxNKApBw6l4In8wQQV1IyxnAexqi0hykHzKEX8hKKctf5gxGBfNCzyIvqpj4CFQ==", "cpu": [ "x64" ], @@ -2217,9 +2216,9 @@ } }, "node_modules/@biomejs/cli-linux-x64-musl": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-1.9.4.tgz", - "integrity": "sha512-gEhi/jSBhZ2m6wjV530Yy8+fNqG8PAinM3oV7CyO+6c3CEh16Eizm21uHVsyVBEB6RIM8JHIl6AGYCv6Q6Q9Tg==", + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-2.2.7.tgz", + "integrity": "sha512-MnsysF5s/iLC5wnYvuMseOy+m8Pd4bWG1uwlVyy2AUbfjAVUgtbYbboc5wMXljFrDY7e6rLjLTR4S2xqDpGlQg==", "cpu": [ "x64" ], @@ -2234,9 +2233,9 @@ } }, "node_modules/@biomejs/cli-win32-arm64": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-1.9.4.tgz", - "integrity": "sha512-tlbhLk+WXZmgwoIKwHIHEBZUwxml7bRJgk0X2sPyNR3S93cdRq6XulAZRQJ17FYGGzWne0fgrXBKpl7l4M87Hg==", + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-2.2.7.tgz", + "integrity": "sha512-h5D1jhwA2b7cFXerYiJfXHSzzAMFFoEDL5Mc2BgiaEw0iaSgSso/3Nc6FbOR55aTQISql+IpB4PS7JoV26Gdbw==", "cpu": [ "arm64" ], @@ -2251,9 +2250,9 @@ } }, "node_modules/@biomejs/cli-win32-x64": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-1.9.4.tgz", - "integrity": "sha512-8Y5wMhVIPaWe6jw2H+KlEm4wP/f7EW3810ZLmDlrEEy5KvBsb9ECEfu/kMWD484ijfQ8+nIi0giMgu9g1UAuuA==", + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-2.2.7.tgz", + "integrity": "sha512-URqAJi0kONyBKG4V9NVafHLDtm6IHmF4qPYi/b6x7MD6jxpWeJiTCO6R5+xDlWckX2T/OGv6Yq3nkz6s0M8Ykw==", "cpu": [ "x64" ], @@ -31820,74 +31819,74 @@ "dev": true }, "@biomejs/biome": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-1.9.4.tgz", - "integrity": "sha512-1rkd7G70+o9KkTn5KLmDYXihGoTaIGO9PIIN2ZB7UJxFrWw04CZHPYiMRjYsaDvVV7hP1dYNRLxSANLaBFGpog==", + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-2.2.7.tgz", + "integrity": "sha512-1a8j0UP1vXVUf3UzMZEJ/zS2VgAG6wU6Cuh/I764sUGI+MCnJs/9WaojHYBDCxCMLTgU60/WqnYof85emXmSBA==", "dev": true, "requires": { - "@biomejs/cli-darwin-arm64": "1.9.4", - "@biomejs/cli-darwin-x64": "1.9.4", - "@biomejs/cli-linux-arm64": "1.9.4", - "@biomejs/cli-linux-arm64-musl": "1.9.4", - "@biomejs/cli-linux-x64": "1.9.4", - "@biomejs/cli-linux-x64-musl": "1.9.4", - "@biomejs/cli-win32-arm64": "1.9.4", - "@biomejs/cli-win32-x64": "1.9.4" + "@biomejs/cli-darwin-arm64": "2.2.7", + "@biomejs/cli-darwin-x64": "2.2.7", + "@biomejs/cli-linux-arm64": "2.2.7", + "@biomejs/cli-linux-arm64-musl": "2.2.7", + "@biomejs/cli-linux-x64": "2.2.7", + "@biomejs/cli-linux-x64-musl": "2.2.7", + "@biomejs/cli-win32-arm64": "2.2.7", + "@biomejs/cli-win32-x64": "2.2.7" } }, "@biomejs/cli-darwin-arm64": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-1.9.4.tgz", - "integrity": "sha512-bFBsPWrNvkdKrNCYeAp+xo2HecOGPAy9WyNyB/jKnnedgzl4W4Hb9ZMzYNbf8dMCGmUdSavlYHiR01QaYR58cw==", + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-2.2.7.tgz", + "integrity": "sha512-xBUUsebnO2/Qj1v7eZmKUy2ZcFkZ4/jLUkxN02Qup1RPoRaiW9AKXHrqS3L7iX6PzofHY2xuZ+Pb9kAcpoe0qA==", "dev": true, "optional": true }, "@biomejs/cli-darwin-x64": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-1.9.4.tgz", - "integrity": "sha512-ngYBh/+bEedqkSevPVhLP4QfVPCpb+4BBe2p7Xs32dBgs7rh9nY2AIYUL6BgLw1JVXV8GlpKmb/hNiuIxfPfZg==", + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-2.2.7.tgz", + "integrity": "sha512-vsY4NhmxqgfLJufr9XUnC+yGUPJiXAc1mz6FcjaAmuIuLwfghN4uQO7hnW2AneGyoi2mNe9Jbvf6Qtq4AjzrFg==", "dev": true, "optional": true }, "@biomejs/cli-linux-arm64": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-1.9.4.tgz", - "integrity": "sha512-fJIW0+LYujdjUgJJuwesP4EjIBl/N/TcOX3IvIHJQNsAqvV2CHIogsmA94BPG6jZATS4Hi+xv4SkBBQSt1N4/g==", + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-2.2.7.tgz", + "integrity": "sha512-nUdco104rjV9dULi1VssQ5R/kX2jE/Z2sDjyqS+siV9sTQda0DwmEUixFNRCWvZJRRiZUWhgiDFJ4n7RowO8Mg==", "dev": true, "optional": true }, "@biomejs/cli-linux-arm64-musl": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-1.9.4.tgz", - "integrity": "sha512-v665Ct9WCRjGa8+kTr0CzApU0+XXtRgwmzIf1SeKSGAv+2scAlW6JR5PMFo6FzqqZ64Po79cKODKf3/AAmECqA==", + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.2.7.tgz", + "integrity": "sha512-FrTwvKO/7t5HbVTvhlMOTOVQLAcR7r4O4iFQhEpZXUtBfosHqrX/JJlX7daPawoe14MDcCu9CDg0zLVpTuDvuQ==", "dev": true, "optional": true }, "@biomejs/cli-linux-x64": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-1.9.4.tgz", - "integrity": "sha512-lRCJv/Vi3Vlwmbd6K+oQ0KhLHMAysN8lXoCI7XeHlxaajk06u7G+UsFSO01NAs5iYuWKmVZjmiOzJ0OJmGsMwg==", + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-2.2.7.tgz", + "integrity": "sha512-tPTcGAIEOOZrj2tQ7fdraWlaxNKApBw6l4In8wQQV1IyxnAexqi0hykHzKEX8hKKctf5gxGBfNCzyIvqpj4CFQ==", "dev": true, "optional": true }, "@biomejs/cli-linux-x64-musl": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-1.9.4.tgz", - "integrity": "sha512-gEhi/jSBhZ2m6wjV530Yy8+fNqG8PAinM3oV7CyO+6c3CEh16Eizm21uHVsyVBEB6RIM8JHIl6AGYCv6Q6Q9Tg==", + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-2.2.7.tgz", + "integrity": "sha512-MnsysF5s/iLC5wnYvuMseOy+m8Pd4bWG1uwlVyy2AUbfjAVUgtbYbboc5wMXljFrDY7e6rLjLTR4S2xqDpGlQg==", "dev": true, "optional": true }, "@biomejs/cli-win32-arm64": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-1.9.4.tgz", - "integrity": "sha512-tlbhLk+WXZmgwoIKwHIHEBZUwxml7bRJgk0X2sPyNR3S93cdRq6XulAZRQJ17FYGGzWne0fgrXBKpl7l4M87Hg==", + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-2.2.7.tgz", + "integrity": "sha512-h5D1jhwA2b7cFXerYiJfXHSzzAMFFoEDL5Mc2BgiaEw0iaSgSso/3Nc6FbOR55aTQISql+IpB4PS7JoV26Gdbw==", "dev": true, "optional": true }, "@biomejs/cli-win32-x64": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-1.9.4.tgz", - "integrity": "sha512-8Y5wMhVIPaWe6jw2H+KlEm4wP/f7EW3810ZLmDlrEEy5KvBsb9ECEfu/kMWD484ijfQ8+nIi0giMgu9g1UAuuA==", + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-2.2.7.tgz", + "integrity": "sha512-URqAJi0kONyBKG4V9NVafHLDtm6IHmF4qPYi/b6x7MD6jxpWeJiTCO6R5+xDlWckX2T/OGv6Yq3nkz6s0M8Ykw==", "dev": true, "optional": true }, diff --git a/package.json b/package.json index 4088e49829..ffe79676c0 100644 --- a/package.json +++ b/package.json @@ -83,7 +83,7 @@ }, "devDependencies": { "@babel/preset-env": "^7.22.5", - "@biomejs/biome": "^1.9.4", + "@biomejs/biome": "^2.2.7", "@eslint/compat": "^1.2.4", "@eslint/eslintrc": "^3.3.1", "@eslint/js": "^9.17.0", From 761cf560d903451ec5d4b6da4ae27ed5918b893a Mon Sep 17 00:00:00 2001 From: Leszek Date: Wed, 22 Oct 2025 15:26:06 +0200 Subject: [PATCH 2/5] run biome fix --- .storybook/preview.tsx | 2 +- .../UniversalTableCore.stories.tsx | 2 +- .../js/UniversalTable/UniversalTableCore.tsx | 7 ++-- jsapp/js/UniversalTable/index.tsx | 5 +-- jsapp/js/account/DeleteAccountBanner.tsx | 2 +- .../account/accountFieldsEditor.component.tsx | 3 +- jsapp/js/account/accountSettingsRoute.tsx | 2 +- jsapp/js/account/accountSidebar.tsx | 3 +- .../js/account/addOns/addOnList.component.tsx | 12 ++---- .../account/changePasswordRoute.component.tsx | 5 +-- jsapp/js/account/organization/InviteModal.tsx | 3 +- .../organization/InviteeActionsDropdown.tsx | 11 +---- .../organization/MemberActionsDropdown.tsx | 3 +- .../js/account/organization/MembersRoute.tsx | 9 ++-- .../OrganizationSettingsRoute.tsx | 4 +- .../organization/invites/OrgInviteModal.tsx | 3 +- .../organization/membersInviteQuery.ts | 2 +- jsapp/js/account/organization/membersQuery.ts | 2 +- .../account/plans/billingButton.component.tsx | 3 +- .../plans/confirmChangeModal.component.tsx | 3 +- jsapp/js/account/plans/plan.component.tsx | 41 ++++++++----------- .../account/plans/planContainer.component.tsx | 3 +- .../accessLogsSection.component.tsx | 5 +-- .../apiToken/apiTokenSection.component.tsx | 3 +- .../security/email/emailSection.component.tsx | 5 +-- .../security/mfa/mfaSection.component.tsx | 3 +- .../password/updatePasswordForm.component.tsx | 3 +- .../security/sso/ssoSection.component.tsx | 3 +- jsapp/js/account/stripe.utils.ts | 3 +- jsapp/js/account/usage/assetUsage.api.ts | 4 +- jsapp/js/account/usage/usage.component.tsx | 3 +- jsapp/js/account/usage/usageContainer.tsx | 3 +- .../account/usage/usageProjectBreakdown.tsx | 5 +-- jsapp/js/account/useProducts.hook.ts | 3 +- jsapp/js/actions/submissions.ts | 2 +- jsapp/js/alertify.ts | 2 +- jsapp/js/api/models/inviteResponse.ts | 2 +- jsapp/js/api/orval.operationName.js | 2 +- jsapp/js/api/react-query/form-content.ts | 3 +- .../js/api/react-query/library-collections.ts | 3 +- jsapp/js/api/react-query/logging.ts | 3 +- .../js/api/react-query/manage-permissions.ts | 3 +- .../manage-projects-and-library-content.ts | 3 +- jsapp/js/api/react-query/other.ts | 3 +- .../api/react-query/server-logs-superusers.ts | 3 +- .../react-query/survey-data-rest-services.ts | 3 +- jsapp/js/api/react-query/survey-data.ts | 7 ++-- .../user-team-organization-usage.ts | 7 ++-- jsapp/js/app.jsx | 3 +- jsapp/js/assetQuickActions.tsx | 3 +- jsapp/js/assetUtils.ts | 2 +- .../deletedAttachment.component.tsx | 2 +- jsapp/js/bem.ts | 3 +- .../RESTServices/RESTServiceLogs.tsx | 5 +-- .../RESTServices/RESTServicesForm.tsx | 5 +-- .../RESTServices/RESTServicesList.tsx | 3 +- .../activity/FormActivity.stories.tsx | 2 +- jsapp/js/components/activity/FormActivity.tsx | 7 ++-- .../components/activity/activityLogs.query.ts | 2 +- .../activity/activityMessage.component.tsx | 2 +- .../assetsTable/assetActionButtons.tsx | 9 ++-- .../js/components/assetsTable/assetsTable.tsx | 2 +- jsapp/js/components/bigModal/bigModal.js | 5 +-- jsapp/js/components/bigModal/mfaModals.tsx | 3 +- jsapp/js/components/common/ActionIcon.tsx | 5 +-- jsapp/js/components/common/ButtonNew.tsx | 2 +- jsapp/js/components/common/alert.tsx | 3 +- .../js/components/common/ariaText.stories.tsx | 3 +- jsapp/js/components/common/avatar.stories.tsx | 2 +- jsapp/js/components/common/avatar.tsx | 3 +- jsapp/js/components/common/badge.stories.tsx | 2 +- jsapp/js/components/common/badge.tsx | 5 +-- jsapp/js/components/common/button.tsx | 3 +- .../common/centeredMessage.component.tsx | 2 +- .../components/common/diffValue.component.tsx | 3 +- .../components/common/diffValue.stories.tsx | 3 +- .../common/dropdownmenu.stories.tsx | 3 +- jsapp/js/components/common/icon.stories.tsx | 2 +- jsapp/js/components/common/inlineMessage.tsx | 3 +- jsapp/js/components/common/koboSelect.tsx | 5 +-- .../common/loadingSpinner.stories.tsx | 2 +- jsapp/js/components/common/loadingSpinner.tsx | 3 +- jsapp/js/components/common/modal.tsx | 3 +- jsapp/js/components/common/radio.stories.tsx | 2 +- jsapp/js/components/common/tabs.tsx | 3 +- .../js/components/common/textBox.stories.tsx | 2 +- jsapp/js/components/common/textBox.tsx | 3 +- .../dataAttachments/connectProjects.js | 3 +- jsapp/js/components/drawer.js | 3 +- .../formGallery/formGallery.component.tsx | 3 +- .../js/components/formLanding/formLanding.js | 6 +-- jsapp/js/components/formSubScreens.js | 2 +- .../formSummary/formSummaryProjectInfo.tsx | 2 +- .../header/mainHeader.component.tsx | 7 ++-- jsapp/js/components/header/searchBox.tsx | 3 +- .../components/languages/languageSelector.tsx | 5 +-- .../languages/languagesListStore.ts | 2 +- .../components/languages/languagesUtils.tsx | 2 +- .../components/languages/regionSelector.tsx | 4 +- .../library/assetContentSummary.tsx | 3 +- jsapp/js/components/library/assetRoute.tsx | 3 +- .../js/components/library/myLibraryRoute.tsx | 7 ++-- .../library/publicCollectionsRoute.tsx | 2 +- .../library/publicCollectionsStore.ts | 2 +- .../components/locking/lockingUtils.mocks.ts | 2 +- jsapp/js/components/locking/lockingUtils.ts | 4 +- jsapp/js/components/map/MapSettings.tsx | 13 +++--- jsapp/js/components/map/index.tsx | 23 +++++------ .../js/components/modalForms/assetTagsForm.js | 3 +- .../modalForms/bulkEditSubmissionsForm.js | 5 +-- .../components/modalForms/libraryAssetForm.js | 3 +- .../modalForms/libraryNewItemForm.js | 3 +- .../modalForms/libraryUploadForm.js | 3 +- .../components/modalForms/projectSettings.js | 6 +-- .../modalForms/translationSettings.js | 3 +- .../components/modalForms/translationTable.js | 3 +- jsapp/js/components/modals/koboModal.tsx | 3 +- .../components/newFeatureDialog.component.tsx | 3 +- .../components/passwordStrength.component.tsx | 3 +- .../copyTeamPermissions.component.tsx | 7 ++-- .../permissions/sharingForm.component.tsx | 4 +- ...rojectOwnershipTransferModalWithBanner.tsx | 6 +-- .../transferProjects.component.tsx | 2 +- .../transferProjectsInvite.component.tsx | 5 +-- .../userAssetPermsEditor.component.tsx | 11 +++-- .../permissions/userAssetPermsEditor.tests.ts | 2 +- .../permissions/userAssetPermsEditor.utils.ts | 12 +++--- .../userPermissionRow.component.tsx | 3 +- .../analysis/analysisHeader.component.tsx | 5 +-- .../analysis/analysisTab.component.tsx | 3 +- .../analysisQuestionEditor.component.tsx | 5 +-- .../list/analysisQuestionRow.component.tsx | 3 +- .../responseForms/commonHeader.component.tsx | 5 +-- .../selectOneResponseForm.component.tsx | 5 +-- .../tagsResponseForm.component.tsx | 3 +- jsapp/js/components/processing/routes.tsx | 2 +- .../processing/routes.utils.tests.ts | 2 +- .../js/components/processing/routes.utils.ts | 2 +- .../sidebar/sidebarDisplaySettings.tsx | 7 ++-- .../sidebar/sidebarSubmissionMedia.tsx | 3 +- .../processing/singleProcessingContent.tsx | 3 +- .../processing/singleProcessingHeader.tsx | 7 ++-- .../processing/singleProcessingStore.ts | 6 +-- .../transcript/stepBegin.component.tsx | 3 +- .../transcript/stepConfig.component.tsx | 3 +- .../transcript/stepConfigAuto.component.tsx | 3 +- .../transcript/stepEditor.component.tsx | 3 +- .../translations/stepBegin.component.tsx | 3 +- .../translations/stepConfig.component.tsx | 3 +- .../translations/stepConfigAuto.component.tsx | 3 +- .../translations/stepEditor.component.tsx | 3 +- .../processing/transxDate.component.tsx | 3 +- .../components/processing/transxSelector.tsx | 7 ++-- .../projectDownloads/ProjectDownloads.tsx | 2 +- .../ProjectExportsCreator.tsx | 3 +- .../projectDownloads/ProjectExportsList.tsx | 5 +-- .../projectDownloads/exportsStore.ts | 2 +- .../reports/customReportEditor.component.tsx | 3 +- .../reports/reportColorsEditor.component.tsx | 2 +- .../reports/reportContents.component.tsx | 2 +- .../reports/reportStyleSettings.component.tsx | 7 ++-- ...tStyleSettingsSingleQuestion.component.tsx | 7 ++-- .../reports/reportTable.component.tsx | 5 +-- .../reports/reportTypeEditor.component.tsx | 4 +- .../reports/reportViewItem.component.tsx | 8 ++-- jsapp/js/components/reports/reports.tsx | 5 +-- .../reports/reportsModalTabs.component.tsx | 3 +- .../submissions/SubmissionBackgroundAudio.tsx | 3 +- .../submissions/columnsHideDropdown.tsx | 2 +- .../submissions/columnsHideForm.tsx | 3 +- jsapp/js/components/submissions/mediaCell.tsx | 2 +- .../submissions/submissionDataList.tsx | 3 +- .../submissions/submissionDataTable.tsx | 9 ++-- .../submissions/submissionModal.tsx | 7 ++-- .../submissions/submissionUtils.tests.ts | 11 ++--- .../submissions/submissionUtils.tsx | 7 ++-- jsapp/js/components/submissions/table.tsx | 15 ++++--- .../submissions/tableBulkOptions.tsx | 11 +++-- .../submissions/tableColumnSortDropdown.tsx | 3 +- .../components/submissions/tableConstants.ts | 4 +- jsapp/js/components/submissions/tableStore.ts | 2 +- jsapp/js/components/submissions/tableUtils.ts | 2 +- .../submissions/validationStatusDropdown.tsx | 10 ++--- jsapp/js/components/support/helpBubble.tsx | 3 +- jsapp/js/dataInterface.ts | 15 ++----- jsapp/js/editorMixins/cascadeMixin.js | 3 +- jsapp/js/editorMixins/editableForm.js | 3 +- jsapp/js/endpoints/assetHistory.mocks.ts | 2 +- .../js/endpoints/assetHistoryActions.mocks.ts | 2 +- jsapp/js/endpoints/assets.mocks.ts | 2 +- jsapp/js/endpoints/environment.mocks.ts | 2 +- jsapp/js/endpoints/languages.mocks.ts | 2 +- jsapp/js/endpoints/me.mocks.ts | 2 +- jsapp/js/endpoints/organization.mocks.ts | 2 +- jsapp/js/enketoHandler.tsx | 2 +- jsapp/js/formbuild/renderInBackbone.js | 3 +- jsapp/js/hooks/useWhen.hook.ts | 3 +- jsapp/js/libs/reactBemComponents.tsx | 7 ++-- jsapp/js/main.js | 3 +- jsapp/js/mixins.tsx | 7 ++-- jsapp/js/project/projectTopTabs.component.tsx | 3 +- .../submissionsCountGraph.component.tsx | 4 +- jsapp/js/projects/customViewStore.ts | 4 +- jsapp/js/projects/myOrgProjectsRoute.tsx | 5 +-- .../projectViews/projectsFieldsSelector.tsx | 4 +- .../projects/projectViews/projectsFilter.tsx | 3 +- .../js/projects/projectViews/viewSwitcher.tsx | 3 +- .../projects/projectsTable/columnResizer.tsx | 7 +--- .../projects/projectsTable/projectsTable.tsx | 3 +- .../projectsTable/projectsTableHeader.tsx | 5 +-- .../projectsTable/projectsTableRow.tsx | 5 +-- .../sortableProjectColumnHeader.tsx | 3 +- jsapp/js/projects/universalProjectsRoute.tsx | 12 +++--- jsapp/js/router/accessDenied.tsx | 3 +- jsapp/js/router/allRoutes.js | 3 +- jsapp/js/router/basicLayout.component.tsx | 3 +- jsapp/js/router/legacy.tsx | 2 +- jsapp/js/router/router.tsx | 2 +- jsapp/js/stores/session.ts | 2 +- jsapp/js/stores/useSession.tsx | 3 +- jsapp/js/utils.ts | 2 +- package.json | 4 +- 222 files changed, 385 insertions(+), 545 deletions(-) diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index 12c576930b..05c77d1eb9 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -5,8 +5,8 @@ import { MantineProvider, useMantineColorScheme } from '@mantine/core' import type { Preview } from '@storybook/react' import * as mswAddon from 'msw-storybook-addon' import { useEffect } from 'react' -import { DARK_MODE_EVENT_NAME } from 'storybook-dark-mode' import { addons } from 'storybook/preview-api' +import { DARK_MODE_EVENT_NAME } from 'storybook-dark-mode' import environmentMock from '#/endpoints/environment.mocks' import meMock from '#/endpoints/me.mocks' import { themeKobo } from '../jsapp/js/theme' diff --git a/jsapp/js/UniversalTable/UniversalTableCore.stories.tsx b/jsapp/js/UniversalTable/UniversalTableCore.stories.tsx index 107279eb2f..b73b8998b6 100644 --- a/jsapp/js/UniversalTable/UniversalTableCore.stories.tsx +++ b/jsapp/js/UniversalTable/UniversalTableCore.stories.tsx @@ -1,9 +1,9 @@ import type { Meta, StoryObj } from '@storybook/react-webpack5' import UniversalTable, { type UniversalTableColumn } from './UniversalTableCore' import { - type UniversalTableExampleDataItem, createUniversalTableExampleDataColumns, mockData, + type UniversalTableExampleDataItem, } from './UniversalTableCore.mocks' interface CustomArgs { diff --git a/jsapp/js/UniversalTable/UniversalTableCore.tsx b/jsapp/js/UniversalTable/UniversalTableCore.tsx index 24d4749d0f..3c88b11cfe 100644 --- a/jsapp/js/UniversalTable/UniversalTableCore.tsx +++ b/jsapp/js/UniversalTable/UniversalTableCore.tsx @@ -1,16 +1,15 @@ -import { type CSSProperties, type default as React, useCallback, useEffect, useRef, useState } from 'react' - import { type CellContext, type Column, type ColumnPinningPosition, - type PaginationState, - type TableOptions, flexRender, getCoreRowModel, + type PaginationState, + type TableOptions, useReactTable, } from '@tanstack/react-table' import cx from 'classnames' +import { type CSSProperties, type default as React, useCallback, useEffect, useRef, useState } from 'react' import Button from '#/components/common/button' import KoboSelect from '#/components/common/koboSelect' import LoadingSpinner from '#/components/common/loadingSpinner' diff --git a/jsapp/js/UniversalTable/index.tsx b/jsapp/js/UniversalTable/index.tsx index f526ad3c63..908fa8fc7a 100644 --- a/jsapp/js/UniversalTable/index.tsx +++ b/jsapp/js/UniversalTable/index.tsx @@ -1,8 +1,7 @@ -import React, { useMemo } from 'react' - import type { UseQueryResult } from '@tanstack/react-query' -import UniversalTableCore from './UniversalTableCore' +import React, { useMemo } from 'react' import type { UniversalTableColumn } from './UniversalTableCore' +import UniversalTableCore from './UniversalTableCore' export type { UniversalTableColumn } from './UniversalTableCore' diff --git a/jsapp/js/account/DeleteAccountBanner.tsx b/jsapp/js/account/DeleteAccountBanner.tsx index 48c2fb2e0b..f73cb67f39 100644 --- a/jsapp/js/account/DeleteAccountBanner.tsx +++ b/jsapp/js/account/DeleteAccountBanner.tsx @@ -3,8 +3,8 @@ import { useDisclosure } from '@mantine/hooks' import { useEffect, useState } from 'react' import { useNavigate } from 'react-router-dom' import { fetchGet } from '#/api' -import { endpoints } from '#/api.endpoints' import { useOrganizationAssumed } from '#/api/useOrganizationAssumed' +import { endpoints } from '#/api.endpoints' import Button from '#/components/common/ButtonNew' import type { AssetResponse, PaginatedResponse } from '#/dataInterface' import { PROJECTS_ROUTES } from '#/router/routerConstants' diff --git a/jsapp/js/account/accountFieldsEditor.component.tsx b/jsapp/js/account/accountFieldsEditor.component.tsx index 8e6fbe253b..822d0942ce 100644 --- a/jsapp/js/account/accountFieldsEditor.component.tsx +++ b/jsapp/js/account/accountFieldsEditor.component.tsx @@ -1,6 +1,5 @@ -import React from 'react' - import cx from 'classnames' +import React from 'react' import Select from '#/components/common/Select' import { addRequiredToLabel } from '#/textUtils' import { recordValues } from '#/utils' diff --git a/jsapp/js/account/accountSettingsRoute.tsx b/jsapp/js/account/accountSettingsRoute.tsx index 85e93a802e..d8132c3248 100644 --- a/jsapp/js/account/accountSettingsRoute.tsx +++ b/jsapp/js/account/accountSettingsRoute.tsx @@ -13,10 +13,10 @@ import envStore from '#/envStore' import { notify, recordKeys } from '#/utils' import { dataInterface } from '../dataInterface' import { useSession } from '../stores/useSession' -import DeleteAccountBanner from './DeleteAccountBanner' import type { AccountFieldsErrors, AccountFieldsValues } from './account.constants' import { getInitialAccountFieldsValues, getProfilePatchData } from './account.utils' import AccountFieldsEditor from './accountFieldsEditor.component' +import DeleteAccountBanner from './DeleteAccountBanner' bem.AccountSettings = makeBem(null, 'account-settings', 'form') bem.AccountSettings__left = makeBem(bem.AccountSettings, 'left') diff --git a/jsapp/js/account/accountSidebar.tsx b/jsapp/js/account/accountSidebar.tsx index becc139975..103d021e6b 100644 --- a/jsapp/js/account/accountSidebar.tsx +++ b/jsapp/js/account/accountSidebar.tsx @@ -1,7 +1,6 @@ -import React, { useState } from 'react' - import cx from 'classnames' import { observer } from 'mobx-react-lite' +import React, { useState } from 'react' import { NavLink } from 'react-router-dom' import { ACCOUNT_ROUTES } from '#/account/routes.constants' import subscriptionStore from '#/account/subscriptionStore' diff --git a/jsapp/js/account/addOns/addOnList.component.tsx b/jsapp/js/account/addOns/addOnList.component.tsx index 7f771ce888..d63246cbc9 100644 --- a/jsapp/js/account/addOns/addOnList.component.tsx +++ b/jsapp/js/account/addOns/addOnList.component.tsx @@ -49,14 +49,10 @@ const AddOnList = (props: { setAddOnProducts(addonProducts) }, [props.products]) - useWhen( - () => subscriptionStore.isInitialised, - () => { - setSubscribedAddOns(subscriptionStore.addOnsResponse) - setSubscribedPlans(subscriptionStore.planResponse) - }, - [], - ) + useWhen(() => subscriptionStore.isInitialised, () => { + setSubscribedAddOns(subscriptionStore.addOnsResponse) + setSubscribedPlans(subscriptionStore.planResponse) + }, []) if (!addOnProducts.length) { return null diff --git a/jsapp/js/account/changePasswordRoute.component.tsx b/jsapp/js/account/changePasswordRoute.component.tsx index c43a5c1cfa..4e7dd549b5 100644 --- a/jsapp/js/account/changePasswordRoute.component.tsx +++ b/jsapp/js/account/changePasswordRoute.component.tsx @@ -1,14 +1,13 @@ import './accountSettings.scss' -import React from 'react' - import { observer } from 'mobx-react' +import React from 'react' import DocumentTitle from 'react-document-title' import bem, { makeBem } from '#/bem' import Avatar from '#/components/common/avatar' import Button from '#/components/common/button' -import { withRouter } from '#/router/legacy' import type { WithRouterProps } from '#/router/legacy' +import { withRouter } from '#/router/legacy' import sessionStore from '#/stores/session' import styles from './changePasswordRoute.module.scss' import UpdatePasswordForm from './security/password/updatePasswordForm.component' diff --git a/jsapp/js/account/organization/InviteModal.tsx b/jsapp/js/account/organization/InviteModal.tsx index 4b9865ac38..c2ec555f74 100644 --- a/jsapp/js/account/organization/InviteModal.tsx +++ b/jsapp/js/account/organization/InviteModal.tsx @@ -1,8 +1,7 @@ -import { useState } from 'react' - import type { ModalProps } from '@mantine/core' import { Group, Loader, Modal, Stack, Text, TextInput } from '@mantine/core' import { useField } from '@mantine/form' +import { useState } from 'react' import { getSimpleMMOLabel } from '#/account/organization/organization.utils' import subscriptionStore from '#/account/subscriptionStore' import { MemberRoleEnum } from '#/api/models/memberRoleEnum' diff --git a/jsapp/js/account/organization/InviteeActionsDropdown.tsx b/jsapp/js/account/organization/InviteeActionsDropdown.tsx index ab950bfdd2..466f638474 100644 --- a/jsapp/js/account/organization/InviteeActionsDropdown.tsx +++ b/jsapp/js/account/organization/InviteeActionsDropdown.tsx @@ -1,7 +1,6 @@ -import type { ReactNode } from 'react' - import { Group, LoadingOverlay, Menu, Modal, Stack, Text } from '@mantine/core' import { useDisclosure } from '@mantine/hooks' +import type { ReactNode } from 'react' import ButtonNew from '#/components/common/ButtonNew' import { notify } from '#/utils' import type { MemberInvite } from './membersInviteQuery' @@ -10,13 +9,7 @@ import { MemberInviteStatus, usePatchMemberInvite, useRemoveMemberInvite } from /** * A dropdown with all actions that can be taken towards an organization invitee. */ -export default function InviteeActionsDropdown({ - target, - invite, -}: { - target: ReactNode - invite: MemberInvite -}) { +export default function InviteeActionsDropdown({ target, invite }: { target: ReactNode; invite: MemberInvite }) { const [opened, { open, close }] = useDisclosure() const patchInviteMutation = usePatchMemberInvite(invite.url) diff --git a/jsapp/js/account/organization/MemberActionsDropdown.tsx b/jsapp/js/account/organization/MemberActionsDropdown.tsx index 3de36eb414..31323a5dd2 100644 --- a/jsapp/js/account/organization/MemberActionsDropdown.tsx +++ b/jsapp/js/account/organization/MemberActionsDropdown.tsx @@ -1,6 +1,5 @@ -import { type ReactNode, useState } from 'react' - import { Menu } from '@mantine/core' +import { type ReactNode, useState } from 'react' import subscriptionStore from '#/account/subscriptionStore' import { MemberRoleEnum } from '#/api/models/memberRoleEnum' import envStore from '#/envStore' diff --git a/jsapp/js/account/organization/MembersRoute.tsx b/jsapp/js/account/organization/MembersRoute.tsx index 05376eaeeb..ad3f90e223 100644 --- a/jsapp/js/account/organization/MembersRoute.tsx +++ b/jsapp/js/account/organization/MembersRoute.tsx @@ -1,25 +1,24 @@ -import React, { useState } from 'react' - import { Box, Divider, Group, Stack, Text, Title } from '@mantine/core' import { useDisclosure } from '@mantine/hooks' import { keepPreviousData, useQuery } from '@tanstack/react-query' -import UniversalTable, { DEFAULT_PAGE_SIZE, type UniversalTableColumn } from '#/UniversalTable' +import React, { useState } from 'react' import InviteModal from '#/account/organization/InviteModal' import { getSimpleMMOLabel } from '#/account/organization/organization.utils' import subscriptionStore from '#/account/subscriptionStore' import { MemberRoleEnum } from '#/api/models/memberRoleEnum' import { useOrganizationAssumed } from '#/api/useOrganizationAssumed' import ActionIcon from '#/components/common/ActionIcon' -import ButtonNew from '#/components/common/ButtonNew' import Avatar from '#/components/common/avatar' +import ButtonNew from '#/components/common/ButtonNew' import Badge from '#/components/common/badge' import envStore from '#/envStore' import { QueryKeys } from '#/query/queryKeys' +import UniversalTable, { DEFAULT_PAGE_SIZE, type UniversalTableColumn } from '#/UniversalTable' import { formatDate } from '#/utils' import InviteeActionsDropdown from './InviteeActionsDropdown' import MemberActionsDropdown from './MemberActionsDropdown' import MemberRoleSelector from './MemberRoleSelector' -import { type OrganizationMember, type OrganizationMemberListItem, getOrganizationMembers } from './membersQuery' +import { getOrganizationMembers, type OrganizationMember, type OrganizationMemberListItem } from './membersQuery' import styles from './membersRoute.module.scss' export default function MembersRoute() { diff --git a/jsapp/js/account/organization/OrganizationSettingsRoute.tsx b/jsapp/js/account/organization/OrganizationSettingsRoute.tsx index 22cdb1f36f..b07e375684 100644 --- a/jsapp/js/account/organization/OrganizationSettingsRoute.tsx +++ b/jsapp/js/account/organization/OrganizationSettingsRoute.tsx @@ -1,7 +1,4 @@ import { useEffect, useState } from 'react' - -import { useOrganizationAssumed } from '#/api/useOrganizationAssumed' - import styles from '#/account/organization/organizationSettingsRoute.module.scss' import subscriptionStore from '#/account/subscriptionStore' import { MemberRoleEnum } from '#/api/models/memberRoleEnum' @@ -10,6 +7,7 @@ import { getOrganizationsRetrieveQueryKey, useOrganizationsPartialUpdate, } from '#/api/react-query/user-team-organization-usage' +import { useOrganizationAssumed } from '#/api/useOrganizationAssumed' import Button from '#/components/common/button' import InlineMessage from '#/components/common/inlineMessage' import KoboSelect from '#/components/common/koboSelect' diff --git a/jsapp/js/account/organization/invites/OrgInviteModal.tsx b/jsapp/js/account/organization/invites/OrgInviteModal.tsx index 754f47df2c..992e65aa3d 100644 --- a/jsapp/js/account/organization/invites/OrgInviteModal.tsx +++ b/jsapp/js/account/organization/invites/OrgInviteModal.tsx @@ -1,6 +1,5 @@ -import React, { useState } from 'react' - import { Button, FocusTrap, Group, Modal, Stack, Text } from '@mantine/core' +import React, { useState } from 'react' import { MemberInviteStatus, useOrgMemberInviteQuery, diff --git a/jsapp/js/account/organization/membersInviteQuery.ts b/jsapp/js/account/organization/membersInviteQuery.ts index 8c03363727..4802c23c06 100644 --- a/jsapp/js/account/organization/membersInviteQuery.ts +++ b/jsapp/js/account/organization/membersInviteQuery.ts @@ -1,8 +1,8 @@ import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query' import { type FetchDataOptions, fetchDeleteUrl, fetchGet, fetchPatchUrl, fetchPost } from '#/api' -import { endpoints } from '#/api.endpoints' import type { MemberRoleEnum } from '#/api/models/memberRoleEnum' import { useOrganizationAssumed } from '#/api/useOrganizationAssumed' +import { endpoints } from '#/api.endpoints' import type { Json } from '#/components/common/common.interfaces' import type { FailResponse } from '#/dataInterface' import { QueryKeys } from '#/query/queryKeys' diff --git a/jsapp/js/account/organization/membersQuery.ts b/jsapp/js/account/organization/membersQuery.ts index 1b480bb0c4..72f1850305 100644 --- a/jsapp/js/account/organization/membersQuery.ts +++ b/jsapp/js/account/organization/membersQuery.ts @@ -1,9 +1,9 @@ import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query' import { fetchDelete, fetchGet, fetchPatch } from '#/api' -import { endpoints } from '#/api.endpoints' import type { MemberRoleEnum } from '#/api/models/memberRoleEnum' import { getOrganizationsRetrieveQueryKey } from '#/api/react-query/user-team-organization-usage' import { useOrganizationAssumed } from '#/api/useOrganizationAssumed' +import { endpoints } from '#/api.endpoints' import type { Json } from '#/components/common/common.interfaces' import type { Nullable } from '#/constants' import type { PaginatedResponse } from '#/dataInterface' diff --git a/jsapp/js/account/plans/billingButton.component.tsx b/jsapp/js/account/plans/billingButton.component.tsx index 3d22d7a790..e88490a5d7 100644 --- a/jsapp/js/account/plans/billingButton.component.tsx +++ b/jsapp/js/account/plans/billingButton.component.tsx @@ -1,6 +1,5 @@ -import React from 'react' - import cx from 'classnames' +import React from 'react' import type { ButtonProps, ButtonType } from '#/components/common/button' import Button from '#/components/common/button' import styles from './billingButton.module.scss' diff --git a/jsapp/js/account/plans/confirmChangeModal.component.tsx b/jsapp/js/account/plans/confirmChangeModal.component.tsx index 5f55a7536a..900fbefbbc 100644 --- a/jsapp/js/account/plans/confirmChangeModal.component.tsx +++ b/jsapp/js/account/plans/confirmChangeModal.component.tsx @@ -1,6 +1,5 @@ -import React, { useCallback, useEffect, useMemo, useState } from 'react' - import cx from 'classnames' // `cx()` is just an alias for `classNames()` - see https://github.com/JedWatson/classnames +import React, { useCallback, useEffect, useMemo, useState } from 'react' import BillingButton from '#/account/plans/billingButton.component' import { useDisplayPrice } from '#/account/plans/useDisplayPrice.hook' import { changeSubscription } from '#/account/stripe.api' diff --git a/jsapp/js/account/plans/plan.component.tsx b/jsapp/js/account/plans/plan.component.tsx index 65d12a5b1e..6e7ef5411c 100644 --- a/jsapp/js/account/plans/plan.component.tsx +++ b/jsapp/js/account/plans/plan.component.tsx @@ -1,7 +1,6 @@ -import React, { useCallback, useContext, useEffect, useMemo, useReducer, useRef, useState } from 'react' - import classnames from 'classnames' import { when } from 'mobx' +import React, { useCallback, useContext, useEffect, useMemo, useReducer, useRef, useState } from 'react' import { useNavigate, useSearchParams } from 'react-router-dom' import AddOnList from '#/account/addOns/addOnList.component' import type { ConfirmChangeProps } from '#/account/plans/confirmChangeModal.component' @@ -172,30 +171,26 @@ export default function Plan(props: PlanProps) { } }, [state.subscribedProduct]) - useWhen( - () => envStore.isReady, - () => { - // If Stripe isn't active, just redirect to the account page - if (!envStore.data.stripe_public_key) { - navigate(ACCOUNT_ROUTES.ACCOUNT_SETTINGS) - return - } + useWhen(() => envStore.isReady, () => { + // If Stripe isn't active, just redirect to the account page + if (!envStore.data.stripe_public_key) { + navigate(ACCOUNT_ROUTES.ACCOUNT_SETTINGS) + return + } - if (!subscriptionStore.isInitialised) { - subscriptionStore.fetchSubscriptionInfo() - } + if (!subscriptionStore.isInitialised) { + subscriptionStore.fetchSubscriptionInfo() + } - when(() => subscriptionStore.isInitialised).then(() => { - dispatch({ - type: 'initialSub', - prodData: subscriptionStore.planResponse, - }) - setActiveSubscriptions(subscriptionStore.activeSubscriptions) - setIsBusy(false) + when(() => subscriptionStore.isInitialised).then(() => { + dispatch({ + type: 'initialSub', + prodData: subscriptionStore.planResponse, }) - }, - [searchParams, shouldRevalidate], - ) + setActiveSubscriptions(subscriptionStore.activeSubscriptions) + setIsBusy(false) + }) + }, [searchParams, shouldRevalidate]) // Re-fetch data from API and re-enable buttons if displaying from back/forward cache useEffect(() => { diff --git a/jsapp/js/account/plans/planContainer.component.tsx b/jsapp/js/account/plans/planContainer.component.tsx index 5896a5e421..1a55728182 100644 --- a/jsapp/js/account/plans/planContainer.component.tsx +++ b/jsapp/js/account/plans/planContainer.component.tsx @@ -1,6 +1,5 @@ -import React, { useCallback, useMemo } from 'react' - import classnames from 'classnames' +import React, { useCallback, useMemo } from 'react' import type { FreeTierOverride, PlanState } from '#/account/plans/plan.component' import styles from '#/account/plans/plan.module.scss' import { PlanButton } from '#/account/plans/planButton.component' diff --git a/jsapp/js/account/security/accessLogs/accessLogsSection.component.tsx b/jsapp/js/account/security/accessLogs/accessLogsSection.component.tsx index a2e9dc5d96..043f76b6ec 100644 --- a/jsapp/js/account/security/accessLogs/accessLogsSection.component.tsx +++ b/jsapp/js/account/security/accessLogs/accessLogsSection.component.tsx @@ -1,7 +1,5 @@ -import React, { useState } from 'react' - import { keepPreviousData } from '@tanstack/react-query' -import UniversalTable, { DEFAULT_PAGE_SIZE } from '#/UniversalTable' +import React, { useState } from 'react' import securityStyles from '#/account/security/securityRoute.module.scss' import type { AccessLogResponse } from '#/api/models/accessLogResponse' import type { ErrorDetail } from '#/api/models/errorDetail' @@ -14,6 +12,7 @@ import Button from '#/components/common/button' import ExportToEmailButton from '#/components/exportToEmailButton/exportToEmailButton.component' import type { FailResponse } from '#/dataInterface' import sessionStore from '#/stores/session' +import UniversalTable, { DEFAULT_PAGE_SIZE } from '#/UniversalTable' import { formatTime } from '#/utils' export default function AccessLogsSection() { diff --git a/jsapp/js/account/security/apiToken/apiTokenSection.component.tsx b/jsapp/js/account/security/apiToken/apiTokenSection.component.tsx index df88995f12..bab2d82794 100644 --- a/jsapp/js/account/security/apiToken/apiTokenSection.component.tsx +++ b/jsapp/js/account/security/apiToken/apiTokenSection.component.tsx @@ -1,6 +1,5 @@ -import React, { useState, useEffect } from 'react' - import cx from 'classnames' +import React, { useEffect, useState } from 'react' import securityStyles from '#/account/security/securityRoute.module.scss' import Button from '#/components/common/button' import TextBox from '#/components/common/textBox' diff --git a/jsapp/js/account/security/email/emailSection.component.tsx b/jsapp/js/account/security/email/emailSection.component.tsx index 229080814d..e3180b61ac 100644 --- a/jsapp/js/account/security/email/emailSection.component.tsx +++ b/jsapp/js/account/security/email/emailSection.component.tsx @@ -1,7 +1,6 @@ -import React, { useEffect, useState } from 'react' - import { Group, Text } from '@mantine/core' import cx from 'classnames' +import React, { useEffect, useState } from 'react' import securityStyles from '#/account/security/securityRoute.module.scss' import { MemberRoleEnum } from '#/api/models/memberRoleEnum' import { useOrganizationAssumed } from '#/api/useOrganizationAssumed' @@ -11,8 +10,8 @@ import TextBox from '#/components/common/textBox' import type { FailResponse } from '#/dataInterface' import sessionStore from '#/stores/session' import { formatTime, notify } from '#/utils' -import { deleteUnverifiedUserEmails, getUserEmails, setUserEmail } from './emailSection.api' import type { EmailResponse } from './emailSection.api' +import { deleteUnverifiedUserEmails, getUserEmails, setUserEmail } from './emailSection.api' import styles from './emailSection.module.scss' interface EmailState { diff --git a/jsapp/js/account/security/mfa/mfaSection.component.tsx b/jsapp/js/account/security/mfa/mfaSection.component.tsx index b259a3e514..acb59f5fad 100644 --- a/jsapp/js/account/security/mfa/mfaSection.component.tsx +++ b/jsapp/js/account/security/mfa/mfaSection.component.tsx @@ -1,6 +1,5 @@ -import React from 'react' - import cx from 'classnames' +import React from 'react' import securityStyles from '#/account/security/securityRoute.module.scss' import type { MfaActivatedResponse, MfaUserMethodsResponse } from '#/actions/mfaActions' import mfaActions from '#/actions/mfaActions' diff --git a/jsapp/js/account/security/password/updatePasswordForm.component.tsx b/jsapp/js/account/security/password/updatePasswordForm.component.tsx index d23c766008..dc0cd693d0 100644 --- a/jsapp/js/account/security/password/updatePasswordForm.component.tsx +++ b/jsapp/js/account/security/password/updatePasswordForm.component.tsx @@ -1,7 +1,6 @@ -import React, { useState, useEffect } from 'react' - import classnames from 'classnames' import { when } from 'mobx' +import React, { useEffect, useState } from 'react' import { fetchPatch } from '#/api' import { endpoints } from '#/api.endpoints' import Button from '#/components/common/button' diff --git a/jsapp/js/account/security/sso/ssoSection.component.tsx b/jsapp/js/account/security/sso/ssoSection.component.tsx index 32d7597448..a60f1cf260 100644 --- a/jsapp/js/account/security/sso/ssoSection.component.tsx +++ b/jsapp/js/account/security/sso/ssoSection.component.tsx @@ -1,7 +1,6 @@ -import React, { useCallback } from 'react' - import cx from 'classnames' import { observer } from 'mobx-react-lite' +import React, { useCallback } from 'react' import securityStyles from '#/account/security/securityRoute.module.scss' import Button from '#/components/common/button' import envStore, { type SocialApp } from '#/envStore' diff --git a/jsapp/js/account/stripe.utils.ts b/jsapp/js/account/stripe.utils.ts index b788475fcd..e7ce7cb1c3 100644 --- a/jsapp/js/account/stripe.utils.ts +++ b/jsapp/js/account/stripe.utils.ts @@ -1,7 +1,6 @@ -import { useCallback } from 'react' - import { when } from 'mobx' import prettyBytes from 'pretty-bytes' +import { useCallback } from 'react' import { type BaseProduct, type ChangePlan, diff --git a/jsapp/js/account/usage/assetUsage.api.ts b/jsapp/js/account/usage/assetUsage.api.ts index b72607ebc9..04f5b0e0ba 100644 --- a/jsapp/js/account/usage/assetUsage.api.ts +++ b/jsapp/js/account/usage/assetUsage.api.ts @@ -1,7 +1,7 @@ import { fetchGet } from '#/api' -import { PROJECT_FIELDS } from '#/projects/projectViews/constants' -import type { ProjectFieldName } from '#/projects/projectViews/constants' import type { ProjectsTableOrder } from '#/projects/projectsTable/projectsTable' +import type { ProjectFieldName } from '#/projects/projectViews/constants' +import { PROJECT_FIELDS } from '#/projects/projectViews/constants' export interface AssetUsage { count: string diff --git a/jsapp/js/account/usage/usage.component.tsx b/jsapp/js/account/usage/usage.component.tsx index 9dde5fae1b..e6b431f746 100644 --- a/jsapp/js/account/usage/usage.component.tsx +++ b/jsapp/js/account/usage/usage.component.tsx @@ -1,8 +1,7 @@ -import React, { useContext, useEffect, useMemo, useState } from 'react' - import { LoadingOverlay } from '@mantine/core' import cx from 'classnames' import { when } from 'mobx' +import React, { useContext, useEffect, useMemo, useState } from 'react' import { useLocation } from 'react-router-dom' import { getAccountLimits } from '#/account/stripe.api' import type { AccountLimitDetail, LimitAmount } from '#/account/stripe.types' diff --git a/jsapp/js/account/usage/usageContainer.tsx b/jsapp/js/account/usage/usageContainer.tsx index 2cc783c9a7..ac5de085fc 100644 --- a/jsapp/js/account/usage/usageContainer.tsx +++ b/jsapp/js/account/usage/usageContainer.tsx @@ -1,6 +1,5 @@ -import React, { useMemo, useState } from 'react' - import cx from 'classnames' +import React, { useMemo, useState } from 'react' import type { LimitAmount, OneTimeAddOn, RecurringInterval } from '#/account/stripe.types' import { Limits, USAGE_TYPE } from '#/account/stripe.types' import subscriptionStore from '#/account/subscriptionStore' diff --git a/jsapp/js/account/usage/usageProjectBreakdown.tsx b/jsapp/js/account/usage/usageProjectBreakdown.tsx index 119b06706f..17f011ee1c 100644 --- a/jsapp/js/account/usage/usageProjectBreakdown.tsx +++ b/jsapp/js/account/usage/usageProjectBreakdown.tsx @@ -1,6 +1,5 @@ -import React, { useEffect, useState } from 'react' - import prettyBytes from 'pretty-bytes' +import React, { useEffect, useState } from 'react' import { Link } from 'react-router-dom' import type { AssetUsage, AssetWithUsage } from '#/account/usage/assetUsage.api' import { getOrgAssetUsage } from '#/account/usage/assetUsage.api' @@ -10,9 +9,9 @@ import Button from '#/components/common/button' import Icon from '#/components/common/icon' import LoadingSpinner from '#/components/common/loadingSpinner' import { USAGE_ASSETS_PER_PAGE } from '#/constants' -import type { ProjectFieldDefinition } from '#/projects/projectViews/constants' import type { ProjectsTableOrder } from '#/projects/projectsTable/projectsTable' import SortableProjectColumnHeader from '#/projects/projectsTable/sortableProjectColumnHeader' +import type { ProjectFieldDefinition } from '#/projects/projectViews/constants' import { ROUTES } from '#/router/routerConstants' import { convertSecondsToMinutes } from '#/utils' import styles from './usageProjectBreakdown.module.scss' diff --git a/jsapp/js/account/useProducts.hook.ts b/jsapp/js/account/useProducts.hook.ts index 2428ce7f5a..957196d7e8 100644 --- a/jsapp/js/account/useProducts.hook.ts +++ b/jsapp/js/account/useProducts.hook.ts @@ -1,6 +1,5 @@ -import { createContext } from 'react' - import { when } from 'mobx' +import { createContext } from 'react' import { getProducts } from '#/account/stripe.api' import type { Product } from '#/account/stripe.types' import envStore from '#/envStore' diff --git a/jsapp/js/actions/submissions.ts b/jsapp/js/actions/submissions.ts index 4edf91d130..765c5097f1 100644 --- a/jsapp/js/actions/submissions.ts +++ b/jsapp/js/actions/submissions.ts @@ -4,7 +4,6 @@ import Reflux from 'reflux' import { ROOT_URL } from '#/constants' -import { dataInterface } from '#/dataInterface' import type { BulkSubmissionsRequest, FailResponse, @@ -12,6 +11,7 @@ import type { PaginatedResponse, SubmissionResponse, } from '#/dataInterface' +import { dataInterface } from '#/dataInterface' import { addDefaultUuidPrefix, matchUuid, notify } from '#/utils' const submissionsActions = Reflux.createActions({ diff --git a/jsapp/js/alertify.ts b/jsapp/js/alertify.ts index ded4d66eb4..0f17ad9b32 100644 --- a/jsapp/js/alertify.ts +++ b/jsapp/js/alertify.ts @@ -1,7 +1,7 @@ // This is a collection of DRY wrappers for alertifyjs. -import type { ReactElement } from 'react' import alertify from 'alertifyjs' +import type { ReactElement } from 'react' import ReactDOMServer from 'react-dom/server' import { KeyNames } from '#/constants' import type { IconName } from '#/k-icons' diff --git a/jsapp/js/api/models/inviteResponse.ts b/jsapp/js/api/models/inviteResponse.ts index 2e4b763dc5..bf7122df2e 100644 --- a/jsapp/js/api/models/inviteResponse.ts +++ b/jsapp/js/api/models/inviteResponse.ts @@ -1,4 +1,3 @@ -import type { InviteStatusChoicesEnum } from './inviteStatusChoicesEnum' /** * Generated by orval v7.10.0 🍺 * Do not edit manually. @@ -11,6 +10,7 @@ The endpoints are grouped by area of intended use. Each category contains relate * OpenAPI spec version: 2.0.0 (api_v2) */ import type { InviteeRoleEnum } from './inviteeRoleEnum' +import type { InviteStatusChoicesEnum } from './inviteStatusChoicesEnum' export interface InviteResponse { invitee_role: InviteeRoleEnum diff --git a/jsapp/js/api/orval.operationName.js b/jsapp/js/api/orval.operationName.js index c4206977bb..4fe176aa37 100644 --- a/jsapp/js/api/orval.operationName.js +++ b/jsapp/js/api/orval.operationName.js @@ -54,7 +54,7 @@ const sanitize = (value, options) => { let newValue = value if (special !== true) { - newValue = newValue.replace(/[!"`'#%&,:;<>=@{}~\$\(\)\*\+\/\\\?\[\]\^\|]/g, '') + newValue = newValue.replace(/[!"`'#%&,:;<>=@{}~$()*+/\\?[\]^|]/g, '') } if (whitespace !== true) { diff --git a/jsapp/js/api/react-query/form-content.ts b/jsapp/js/api/react-query/form-content.ts index 3fdcda034f..8648d03703 100644 --- a/jsapp/js/api/react-query/form-content.ts +++ b/jsapp/js/api/react-query/form-content.ts @@ -9,7 +9,7 @@ The endpoints are grouped by area of intended use. Each category contains relate **General note**: All projects (whether deployed or draft), as well as all library content (questions, blocks, templates, and collections) in the user-facing application are represented in the API as "assets". * OpenAPI spec version: 2.0.0 (api_v2) */ -import { useMutation, useQuery } from '@tanstack/react-query' + import type { MutationFunction, QueryFunction, @@ -18,6 +18,7 @@ import type { UseQueryOptions, UseQueryResult, } from '@tanstack/react-query' +import { useMutation, useQuery } from '@tanstack/react-query' import type { AssetSnapshotCreateRequest } from '../models/assetSnapshotCreateRequest' diff --git a/jsapp/js/api/react-query/library-collections.ts b/jsapp/js/api/react-query/library-collections.ts index 4fe65d0299..519ef31eca 100644 --- a/jsapp/js/api/react-query/library-collections.ts +++ b/jsapp/js/api/react-query/library-collections.ts @@ -9,7 +9,7 @@ The endpoints are grouped by area of intended use. Each category contains relate **General note**: All projects (whether deployed or draft), as well as all library content (questions, blocks, templates, and collections) in the user-facing application are represented in the API as "assets". * OpenAPI spec version: 2.0.0 (api_v2) */ -import { useMutation, useQuery } from '@tanstack/react-query' + import type { MutationFunction, QueryFunction, @@ -18,6 +18,7 @@ import type { UseQueryOptions, UseQueryResult, } from '@tanstack/react-query' +import { useMutation, useQuery } from '@tanstack/react-query' import type { AssetSubscriptionRequest } from '../models/assetSubscriptionRequest' diff --git a/jsapp/js/api/react-query/logging.ts b/jsapp/js/api/react-query/logging.ts index ae701bc80b..9a488fce19 100644 --- a/jsapp/js/api/react-query/logging.ts +++ b/jsapp/js/api/react-query/logging.ts @@ -9,7 +9,7 @@ The endpoints are grouped by area of intended use. Each category contains relate **General note**: All projects (whether deployed or draft), as well as all library content (questions, blocks, templates, and collections) in the user-facing application are represented in the API as "assets". * OpenAPI spec version: 2.0.0 (api_v2) */ -import { useMutation, useQuery } from '@tanstack/react-query' + import type { MutationFunction, QueryFunction, @@ -18,6 +18,7 @@ import type { UseQueryOptions, UseQueryResult, } from '@tanstack/react-query' +import { useMutation, useQuery } from '@tanstack/react-query' import type { AccessLogsMeListParams } from '../models/accessLogsMeListParams' diff --git a/jsapp/js/api/react-query/manage-permissions.ts b/jsapp/js/api/react-query/manage-permissions.ts index 3e82a76189..45952c965d 100644 --- a/jsapp/js/api/react-query/manage-permissions.ts +++ b/jsapp/js/api/react-query/manage-permissions.ts @@ -9,7 +9,7 @@ The endpoints are grouped by area of intended use. Each category contains relate **General note**: All projects (whether deployed or draft), as well as all library content (questions, blocks, templates, and collections) in the user-facing application are represented in the API as "assets". * OpenAPI spec version: 2.0.0 (api_v2) */ -import { useMutation, useQuery } from '@tanstack/react-query' + import type { MutationFunction, QueryFunction, @@ -18,6 +18,7 @@ import type { UseQueryOptions, UseQueryResult, } from '@tanstack/react-query' +import { useMutation, useQuery } from '@tanstack/react-query' import type { ErrorDetail } from '../models/errorDetail' diff --git a/jsapp/js/api/react-query/manage-projects-and-library-content.ts b/jsapp/js/api/react-query/manage-projects-and-library-content.ts index 6ab6db19e5..9fb4cfecc5 100644 --- a/jsapp/js/api/react-query/manage-projects-and-library-content.ts +++ b/jsapp/js/api/react-query/manage-projects-and-library-content.ts @@ -9,7 +9,7 @@ The endpoints are grouped by area of intended use. Each category contains relate **General note**: All projects (whether deployed or draft), as well as all library content (questions, blocks, templates, and collections) in the user-facing application are represented in the API as "assets". * OpenAPI spec version: 2.0.0 (api_v2) */ -import { useMutation, useQuery } from '@tanstack/react-query' + import type { MutationFunction, QueryFunction, @@ -18,6 +18,7 @@ import type { UseQueryOptions, UseQueryResult, } from '@tanstack/react-query' +import { useMutation, useQuery } from '@tanstack/react-query' import type { Asset } from '../models/asset' diff --git a/jsapp/js/api/react-query/other.ts b/jsapp/js/api/react-query/other.ts index ad79449a4c..4176433d4e 100644 --- a/jsapp/js/api/react-query/other.ts +++ b/jsapp/js/api/react-query/other.ts @@ -9,7 +9,7 @@ The endpoints are grouped by area of intended use. Each category contains relate **General note**: All projects (whether deployed or draft), as well as all library content (questions, blocks, templates, and collections) in the user-facing application are represented in the API as "assets". * OpenAPI spec version: 2.0.0 (api_v2) */ -import { useMutation, useQuery } from '@tanstack/react-query' + import type { MutationFunction, QueryFunction, @@ -18,6 +18,7 @@ import type { UseQueryOptions, UseQueryResult, } from '@tanstack/react-query' +import { useMutation, useQuery } from '@tanstack/react-query' import type { ChangePlan } from '../models/changePlan' diff --git a/jsapp/js/api/react-query/server-logs-superusers.ts b/jsapp/js/api/react-query/server-logs-superusers.ts index 28b16964b9..e85859be7d 100644 --- a/jsapp/js/api/react-query/server-logs-superusers.ts +++ b/jsapp/js/api/react-query/server-logs-superusers.ts @@ -9,7 +9,7 @@ The endpoints are grouped by area of intended use. Each category contains relate **General note**: All projects (whether deployed or draft), as well as all library content (questions, blocks, templates, and collections) in the user-facing application are represented in the API as "assets". * OpenAPI spec version: 2.0.0 (api_v2) */ -import { useMutation, useQuery } from '@tanstack/react-query' + import type { MutationFunction, QueryFunction, @@ -18,6 +18,7 @@ import type { UseQueryOptions, UseQueryResult, } from '@tanstack/react-query' +import { useMutation, useQuery } from '@tanstack/react-query' import type { AccessLogsListParams } from '../models/accessLogsListParams' diff --git a/jsapp/js/api/react-query/survey-data-rest-services.ts b/jsapp/js/api/react-query/survey-data-rest-services.ts index 81568e5223..ebc13c4005 100644 --- a/jsapp/js/api/react-query/survey-data-rest-services.ts +++ b/jsapp/js/api/react-query/survey-data-rest-services.ts @@ -9,7 +9,7 @@ The endpoints are grouped by area of intended use. Each category contains relate **General note**: All projects (whether deployed or draft), as well as all library content (questions, blocks, templates, and collections) in the user-facing application are represented in the API as "assets". * OpenAPI spec version: 2.0.0 (api_v2) */ -import { useMutation, useQuery } from '@tanstack/react-query' + import type { MutationFunction, QueryFunction, @@ -18,6 +18,7 @@ import type { UseQueryOptions, UseQueryResult, } from '@tanstack/react-query' +import { useMutation, useQuery } from '@tanstack/react-query' import type { AssetsHooksListParams } from '../models/assetsHooksListParams' diff --git a/jsapp/js/api/react-query/survey-data.ts b/jsapp/js/api/react-query/survey-data.ts index e3b443ea76..bfaaaaebdc 100644 --- a/jsapp/js/api/react-query/survey-data.ts +++ b/jsapp/js/api/react-query/survey-data.ts @@ -9,7 +9,7 @@ The endpoints are grouped by area of intended use. Each category contains relate **General note**: All projects (whether deployed or draft), as well as all library content (questions, blocks, templates, and collections) in the user-facing application are represented in the API as "assets". * OpenAPI spec version: 2.0.0 (api_v2) */ -import { useMutation, useQuery } from '@tanstack/react-query' + import type { MutationFunction, QueryFunction, @@ -18,6 +18,7 @@ import type { UseQueryOptions, UseQueryResult, } from '@tanstack/react-query' +import { useMutation, useQuery } from '@tanstack/react-query' import type { AssetsDataAttachmentsListParams } from '../models/assetsDataAttachmentsListParams' @@ -84,10 +85,8 @@ import type { PairedData } from '../models/pairedData' import type { PairedDataResponse } from '../models/pairedDataResponse' import type { PatchedDataBulkUpdate } from '../models/patchedDataBulkUpdate' - -import type { PatchedDataValidationStatusUpdatePayload } from '../models/patchedDataValidationStatusUpdatePayload' - import type { PatchedDataValidationStatusesUpdatePayload } from '../models/patchedDataValidationStatusesUpdatePayload' +import type { PatchedDataValidationStatusUpdatePayload } from '../models/patchedDataValidationStatusUpdatePayload' import type { PatchedExportSettingUpdatePayload } from '../models/patchedExportSettingUpdatePayload' diff --git a/jsapp/js/api/react-query/user-team-organization-usage.ts b/jsapp/js/api/react-query/user-team-organization-usage.ts index 9fd9a5538e..2e1a6cef99 100644 --- a/jsapp/js/api/react-query/user-team-organization-usage.ts +++ b/jsapp/js/api/react-query/user-team-organization-usage.ts @@ -9,7 +9,7 @@ The endpoints are grouped by area of intended use. Each category contains relate **General note**: All projects (whether deployed or draft), as well as all library content (questions, blocks, templates, and collections) in the user-facing application are represented in the API as "assets". * OpenAPI spec version: 2.0.0 (api_v2) */ -import { useMutation, useQuery } from '@tanstack/react-query' + import type { MutationFunction, QueryFunction, @@ -18,6 +18,7 @@ import type { UseQueryOptions, UseQueryResult, } from '@tanstack/react-query' +import { useMutation, useQuery } from '@tanstack/react-query' import type { AssetUsageListParams } from '../models/assetUsageListParams' @@ -38,10 +39,8 @@ import type { InviteResponse } from '../models/inviteResponse' import type { MeEmailsListParams } from '../models/meEmailsListParams' import type { MeListResponse } from '../models/meListResponse' - -import type { MeSocialAccountsListParams } from '../models/meSocialAccountsListParams' - import type { MemberListResponse } from '../models/memberListResponse' +import type { MeSocialAccountsListParams } from '../models/meSocialAccountsListParams' import type { OrganizationResponse } from '../models/organizationResponse' diff --git a/jsapp/js/app.jsx b/jsapp/js/app.jsx index 411cf31198..78424e47cb 100644 --- a/jsapp/js/app.jsx +++ b/jsapp/js/app.jsx @@ -4,10 +4,9 @@ import '#/bemComponents' // importing it so it exists import '#/surveyCompanionStore' // importing it so it exists -import React from 'react' - import { MantineProvider } from '@mantine/core' import { QueryClientProvider } from '@tanstack/react-query' +import React from 'react' import DocumentTitle from 'react-document-title' import reactMixin from 'react-mixin' import { Outlet } from 'react-router-dom' diff --git a/jsapp/js/assetQuickActions.tsx b/jsapp/js/assetQuickActions.tsx index dc13b5f3bf..ff4d057a91 100644 --- a/jsapp/js/assetQuickActions.tsx +++ b/jsapp/js/assetQuickActions.tsx @@ -7,10 +7,9 @@ * quarter of 2024 AKA The Far Future With Flying Cars :fingers_crossed:). */ -import React from 'react' - import alertify from 'alertifyjs' import escape from 'lodash.escape' +import React from 'react' import toast from 'react-hot-toast' import { PERMISSIONS_CODENAMES } from '#/components/permissions/permConstants' import pageState from '#/pageState.store' diff --git a/jsapp/js/assetUtils.ts b/jsapp/js/assetUtils.ts index 4d234a4559..7fb1139040 100644 --- a/jsapp/js/assetUtils.ts +++ b/jsapp/js/assetUtils.ts @@ -11,7 +11,6 @@ import permConfig from '#/components/permissions/permConfig' import { PERMISSIONS_CODENAMES } from '#/components/permissions/permConstants' import { QUAL_NOTE_TYPE } from '#/components/processing/analysis/constants' import type { AnyRowTypeName, AssetTypeName } from '#/constants' -import { QuestionTypeName } from '#/constants' import { ACCESS_TYPES, ASSET_TYPES, @@ -19,6 +18,7 @@ import { GROUP_TYPES_END, META_QUESTION_TYPES, QUESTION_TYPES, + QuestionTypeName, RANK_LEVEL_TYPE, ROOT_URL, SCORE_ROW_TYPE, diff --git a/jsapp/js/attachments/deletedAttachment.component.tsx b/jsapp/js/attachments/deletedAttachment.component.tsx index 0b99442574..45e158dc04 100644 --- a/jsapp/js/attachments/deletedAttachment.component.tsx +++ b/jsapp/js/attachments/deletedAttachment.component.tsx @@ -1,5 +1,5 @@ -import { Center } from '@mantine/core' import type { CenterProps, ElementProps } from '@mantine/core' +import { Center } from '@mantine/core' interface DeletedAttachment extends CenterProps, ElementProps<'div', keyof CenterProps> {} diff --git a/jsapp/js/bem.ts b/jsapp/js/bem.ts index 46b0a3a362..bdf647cd31 100644 --- a/jsapp/js/bem.ts +++ b/jsapp/js/bem.ts @@ -1,6 +1,5 @@ -import React from 'react' - import classnames from 'classnames' +import React from 'react' import { recordEntries } from './utils' /** diff --git a/jsapp/js/components/RESTServices/RESTServiceLogs.tsx b/jsapp/js/components/RESTServices/RESTServiceLogs.tsx index 1f23090963..4649533d7f 100644 --- a/jsapp/js/components/RESTServices/RESTServiceLogs.tsx +++ b/jsapp/js/components/RESTServices/RESTServiceLogs.tsx @@ -1,13 +1,11 @@ -import React from 'react' - import alertify from 'alertifyjs' +import React from 'react' import { actions } from '#/actions' import assetStore from '#/assetStore' import bem from '#/bem' import Button from '#/components/common/button' import LoadingSpinner from '#/components/common/loadingSpinner' import { HOOK_LOG_STATUSES, MODAL_TYPES } from '#/constants' -import { dataInterface } from '#/dataInterface' import type { ExternalServiceHookResponse, ExternalServiceLogResponse, @@ -15,6 +13,7 @@ import type { PaginatedResponse, RetryExternalServiceLogsResponse, } from '#/dataInterface' +import { dataInterface } from '#/dataInterface' import pageState from '#/pageState.store' import { getRouteAssetUid } from '#/router/routerUtils' import { formatTime, notify } from '#/utils' diff --git a/jsapp/js/components/RESTServices/RESTServicesForm.tsx b/jsapp/js/components/RESTServices/RESTServicesForm.tsx index 6c567dc1ca..971a570c87 100644 --- a/jsapp/js/components/RESTServices/RESTServicesForm.tsx +++ b/jsapp/js/components/RESTServices/RESTServicesForm.tsx @@ -1,6 +1,5 @@ -import React from 'react' - import clonedeep from 'lodash.clonedeep' +import React from 'react' import { actions } from '#/actions' import bem from '#/bem' import Button from '#/components/common/button' @@ -11,7 +10,7 @@ import Radio from '#/components/common/radio' import TextBox from '#/components/common/textBox' import WrappedSelect from '#/components/common/wrappedSelect' import { KEY_CODES } from '#/constants' -import { type ExternalServiceHookResponse, type FailResponse, dataInterface } from '#/dataInterface' +import { dataInterface, type ExternalServiceHookResponse, type FailResponse } from '#/dataInterface' import envStore from '#/envStore' import pageState from '#/pageState.store' import { notify } from '#/utils' diff --git a/jsapp/js/components/RESTServices/RESTServicesList.tsx b/jsapp/js/components/RESTServices/RESTServicesList.tsx index 090f5de30e..bb636585df 100644 --- a/jsapp/js/components/RESTServices/RESTServicesList.tsx +++ b/jsapp/js/components/RESTServices/RESTServicesList.tsx @@ -1,6 +1,5 @@ -import React from 'react' - import alertify from 'alertifyjs' +import React from 'react' import bem from '#/bem' import Button from '#/components/common/button' import LoadingSpinner from '#/components/common/loadingSpinner' diff --git a/jsapp/js/components/activity/FormActivity.stories.tsx b/jsapp/js/components/activity/FormActivity.stories.tsx index fcf07e4f67..928b65714b 100644 --- a/jsapp/js/components/activity/FormActivity.stories.tsx +++ b/jsapp/js/components/activity/FormActivity.stories.tsx @@ -1,6 +1,6 @@ import type { Meta, StoryObj } from '@storybook/react-webpack5' -import { reactRouterParameters, withRouter } from 'storybook-addon-remix-react-router' import { expect, userEvent, waitFor, within } from 'storybook/test' +import { reactRouterParameters, withRouter } from 'storybook-addon-remix-react-router' import assetHistoryMock, { mockAssetUid } from '#/endpoints/assetHistory.mocks' import assetHistoryActionsMock from '#/endpoints/assetHistoryActions.mocks' import { queryClientDecorator } from '#/query/queryClient.mocks' diff --git a/jsapp/js/components/activity/FormActivity.tsx b/jsapp/js/components/activity/FormActivity.tsx index 28eeb48ded..69088a3b0f 100644 --- a/jsapp/js/components/activity/FormActivity.tsx +++ b/jsapp/js/components/activity/FormActivity.tsx @@ -1,22 +1,21 @@ import '../../../scss/components/_kobo.form-view.scss' -import { useState } from 'react' - import { keepPreviousData, useQuery } from '@tanstack/react-query' import cx from 'classnames' +import { useState } from 'react' import { useParams } from 'react-router-dom' -import UniversalTable, { DEFAULT_PAGE_SIZE, type UniversalTableColumn } from '#/UniversalTable' import { QueryKeys } from '#/query/queryKeys' +import UniversalTable, { DEFAULT_PAGE_SIZE, type UniversalTableColumn } from '#/UniversalTable' import { formatTime } from '#/utils' import type { KoboSelectOption } from '../common/koboSelect' import KoboSelect from '../common/koboSelect' import ExportToEmailButton from '../exportToEmailButton/exportToEmailButton.component' import KoboModal from '../modals/koboModal' import KoboModalHeader from '../modals/koboModalHeader' -import styles from './FormActivity.module.scss' import type { ActivityLogsItem } from './activity.constants' import { getActivityLogs, useActivityLogsFilterOptionsQuery, useExportActivityLogs } from './activityLogs.query' import { ActivityMessage } from './activityMessage.component' +import styles from './FormActivity.module.scss' /** * A component used at Project > Settings > Activity route. Displays a table diff --git a/jsapp/js/components/activity/activityLogs.query.ts b/jsapp/js/components/activity/activityLogs.query.ts index 4b75649276..6fea1fff13 100644 --- a/jsapp/js/components/activity/activityLogs.query.ts +++ b/jsapp/js/components/activity/activityLogs.query.ts @@ -3,8 +3,8 @@ import { fetchGet, fetchPost } from '#/api' import { endpoints } from '#/api.endpoints' import type { FailResponse, LabelValuePair, PaginatedResponse } from '#/dataInterface' import { QueryKeys } from '#/query/queryKeys' -import { AUDIT_ACTION_TYPES, HIDDEN_AUDIT_ACTIONS } from './activity.constants' import type { ActivityLogsItem, AssetHistoryActionsResponse } from './activity.constants' +import { AUDIT_ACTION_TYPES, HIDDEN_AUDIT_ACTIONS } from './activity.constants' /** * Fetches the activity logs from the server. diff --git a/jsapp/js/components/activity/activityMessage.component.tsx b/jsapp/js/components/activity/activityMessage.component.tsx index f3dcb09275..fe27607edd 100644 --- a/jsapp/js/components/activity/activityMessage.component.tsx +++ b/jsapp/js/components/activity/activityMessage.component.tsx @@ -1,6 +1,6 @@ import { getTextContentOnly } from '#/utils' import Avatar from '../common/avatar' -import { AUDIT_ACTION_TYPES, type ActivityLogsItem, FALLBACK_MESSAGE } from './activity.constants' +import { type ActivityLogsItem, AUDIT_ACTION_TYPES, FALLBACK_MESSAGE } from './activity.constants' import styles from './activityMessage.module.scss' /** diff --git a/jsapp/js/components/assetsTable/assetActionButtons.tsx b/jsapp/js/components/assetsTable/assetActionButtons.tsx index 554d4f20ec..c3e6b2a8a5 100644 --- a/jsapp/js/components/assetsTable/assetActionButtons.tsx +++ b/jsapp/js/components/assetsTable/assetActionButtons.tsx @@ -7,9 +7,8 @@ */ import './assetActionButtons.scss' -import React from 'react' - import debounce from 'lodash.debounce' +import React from 'react' import autoBind from 'react-autobind' import { Link } from 'react-router-dom' import { actions } from '#/actions' @@ -28,18 +27,18 @@ import { } from '#/assetQuickActions' import assetUtils from '#/assetUtils' import bem from '#/bem' -import Button from '#/components/common/button' import type { ButtonType } from '#/components/common/button' -import managedCollectionsStore from '#/components/library/managedCollectionsStore' +import Button from '#/components/common/button' import type { ManagedCollectionsStoreData } from '#/components/library/managedCollectionsStore' +import managedCollectionsStore from '#/components/library/managedCollectionsStore' import { userCan } from '#/components/permissions/utils' import { ACCESS_TYPES, ASSET_TYPES } from '#/constants' import type { AssetDownloads, AssetResponse } from '#/dataInterface' import type { IconName } from '#/k-icons' import mixins from '#/mixins' import PopoverMenu from '#/popoverMenu' -import { withRouter } from '#/router/legacy' import type { WithRouterProps } from '#/router/legacy' +import { withRouter } from '#/router/legacy' import { ROUTES } from '#/router/routerConstants' import { getRouteAssetUid, isAnyFormRoute, isAnyLibraryItemRoute } from '#/router/routerUtils' diff --git a/jsapp/js/components/assetsTable/assetsTable.tsx b/jsapp/js/components/assetsTable/assetsTable.tsx index fef22fb551..badeea88fb 100644 --- a/jsapp/js/components/assetsTable/assetsTable.tsx +++ b/jsapp/js/components/assetsTable/assetsTable.tsx @@ -10,8 +10,8 @@ import type { AssetResponse, MetadataResponse } from '#/dataInterface' import PopoverMenu from '#/popoverMenu' import type { OrderDirection } from '#/projects/projectViews/constants' import { getScrollbarWidth, hasVerticalScrollbar } from '#/utils' -import { ASSETS_TABLE_COLUMNS, ASSETS_TABLE_CONTEXTS, ORDER_DIRECTIONS } from './assetsTableConstants' import type { AssetsTableColumn, AssetsTableContextName } from './assetsTableConstants' +import { ASSETS_TABLE_COLUMNS, ASSETS_TABLE_CONTEXTS, ORDER_DIRECTIONS } from './assetsTableConstants' import AssetsTableRow from './assetsTableRow' bem.AssetsTable = makeBem(null, 'assets-table') diff --git a/jsapp/js/components/bigModal/bigModal.js b/jsapp/js/components/bigModal/bigModal.js index b95c87c336..98932d10cd 100644 --- a/jsapp/js/components/bigModal/bigModal.js +++ b/jsapp/js/components/bigModal/bigModal.js @@ -1,11 +1,9 @@ -import React from 'react' - import alertify from 'alertifyjs' +import React from 'react' import autoBind from 'react-autobind' import reactMixin from 'react-mixin' import Reflux from 'reflux' import { actions } from '#/actions' -import RESTServicesForm from '#/components/RESTServices/RESTServicesForm' import LoadingSpinner from '#/components/common/loadingSpinner' import Modal from '#/components/common/modal' import DataAttachmentColumnsForm from '#/components/dataAttachments/dataAttachmentColumnsForm' @@ -19,6 +17,7 @@ import ProjectSettings from '#/components/modalForms/projectSettings' import TranslationSettings from '#/components/modalForms/translationSettings' import TranslationTable from '#/components/modalForms/translationTable' import SharingForm from '#/components/permissions/sharingForm.component' +import RESTServicesForm from '#/components/RESTServices/RESTServicesForm' import SubmissionModal from '#/components/submissions/submissionModal' import TableMediaPreview from '#/components/submissions/tableMediaPreview' import TableSettings from '#/components/submissions/tableSettings' diff --git a/jsapp/js/components/bigModal/mfaModals.tsx b/jsapp/js/components/bigModal/mfaModals.tsx index 745ed2ab28..8bd9156c60 100644 --- a/jsapp/js/components/bigModal/mfaModals.tsx +++ b/jsapp/js/components/bigModal/mfaModals.tsx @@ -1,9 +1,8 @@ import './mfaModals.scss' -import React from 'react' - import { observer } from 'mobx-react' import QRCode from 'qrcode.react' +import React from 'react' import type { MfaActivatedResponse, MfaBackupCodesResponse } from '#/actions/mfaActions' import mfaActions from '#/actions/mfaActions' import bem, { makeBem } from '#/bem' diff --git a/jsapp/js/components/common/ActionIcon.tsx b/jsapp/js/components/common/ActionIcon.tsx index 52df2c594c..4ab22bd4d2 100644 --- a/jsapp/js/components/common/ActionIcon.tsx +++ b/jsapp/js/components/common/ActionIcon.tsx @@ -1,6 +1,5 @@ -import { ActionIcon as ActionIconMantine, Tooltip, createPolymorphicComponent } from '@mantine/core' -import type { ActionIconProps as ActionIconPropsMantine } from '@mantine/core/lib/components' -import type { TooltipProps } from '@mantine/core/lib/components' +import { ActionIcon as ActionIconMantine, createPolymorphicComponent, Tooltip } from '@mantine/core' +import type { ActionIconProps as ActionIconPropsMantine, TooltipProps } from '@mantine/core/lib/components' import { forwardRef } from 'react' import type { IconName } from '#/k-icons' import Icon, { type IconSize } from './icon' diff --git a/jsapp/js/components/common/ButtonNew.tsx b/jsapp/js/components/common/ButtonNew.tsx index b52cf26880..8c626b8959 100644 --- a/jsapp/js/components/common/ButtonNew.tsx +++ b/jsapp/js/components/common/ButtonNew.tsx @@ -1,4 +1,4 @@ -import { Button as ButtonMantine, Tooltip, createPolymorphicComponent } from '@mantine/core' +import { Button as ButtonMantine, createPolymorphicComponent, Tooltip } from '@mantine/core' import type { ButtonProps as ButtonPropsMantine, TooltipProps } from '@mantine/core/lib/components' import { forwardRef } from 'react' import type { IconName } from '#/k-icons' diff --git a/jsapp/js/components/common/alert.tsx b/jsapp/js/components/common/alert.tsx index 149839031f..e14235f5ce 100644 --- a/jsapp/js/components/common/alert.tsx +++ b/jsapp/js/components/common/alert.tsx @@ -1,7 +1,6 @@ -import { forwardRef } from 'react' - import { Alert as AlertMantine } from '@mantine/core' import type { AlertProps as AlertPropsMantine } from '@mantine/core/lib/components' +import { forwardRef } from 'react' import type { IconName } from '#/k-icons' import Icon from './icon' diff --git a/jsapp/js/components/common/ariaText.stories.tsx b/jsapp/js/components/common/ariaText.stories.tsx index abf129e3d5..b0d38770ac 100644 --- a/jsapp/js/components/common/ariaText.stories.tsx +++ b/jsapp/js/components/common/ariaText.stories.tsx @@ -1,6 +1,5 @@ -import React from 'react' - import type { StoryObj } from '@storybook/react-webpack5' +import React from 'react' import AriaText from '#/components/common/ariaText' export default { diff --git a/jsapp/js/components/common/avatar.stories.tsx b/jsapp/js/components/common/avatar.stories.tsx index d876253f19..f2b9af327f 100644 --- a/jsapp/js/components/common/avatar.stories.tsx +++ b/jsapp/js/components/common/avatar.stories.tsx @@ -1,6 +1,6 @@ import type { Meta, StoryObj } from '@storybook/react-webpack5' -import Avatar from './avatar' import type { AvatarSize } from './avatar' +import Avatar from './avatar' const avatarSizes: AvatarSize[] = ['s', 'm'] diff --git a/jsapp/js/components/common/avatar.tsx b/jsapp/js/components/common/avatar.tsx index 82ba5f27e3..0544236983 100644 --- a/jsapp/js/components/common/avatar.tsx +++ b/jsapp/js/components/common/avatar.tsx @@ -1,6 +1,5 @@ -import React from 'react' - import cx from 'classnames' +import React from 'react' import styles from './avatar.module.scss' export type AvatarSize = 's' | 'm' diff --git a/jsapp/js/components/common/badge.stories.tsx b/jsapp/js/components/common/badge.stories.tsx index 3491beb573..d7958d73c7 100644 --- a/jsapp/js/components/common/badge.stories.tsx +++ b/jsapp/js/components/common/badge.stories.tsx @@ -1,8 +1,8 @@ import type { Meta, StoryObj } from '@storybook/react-webpack5' import { IconNames } from '#/k-icons' import { recordKeys } from '#/utils' -import Badge from './badge' import type { BadgeColor, BadgeSize } from './badge' +import Badge from './badge' const badgeColors: BadgeColor[] = ['light-storm', 'light-amber', 'light-blue', 'light-red', 'light-teal', 'light-green'] const badgeSizes: BadgeSize[] = ['s', 'm', 'l'] diff --git a/jsapp/js/components/common/badge.tsx b/jsapp/js/components/common/badge.tsx index 5be30d1bb2..10cd08d07d 100644 --- a/jsapp/js/components/common/badge.tsx +++ b/jsapp/js/components/common/badge.tsx @@ -1,10 +1,9 @@ -import React from 'react' - import cx from 'classnames' +import React from 'react' import type { IconName } from '#/k-icons' import styles from './badge.module.scss' -import Icon from './icon' import type { IconSize } from './icon' +import Icon from './icon' export type BadgeColor = | 'light-storm' diff --git a/jsapp/js/components/common/button.tsx b/jsapp/js/components/common/button.tsx index 980df84df8..98f5b90874 100644 --- a/jsapp/js/components/common/button.tsx +++ b/jsapp/js/components/common/button.tsx @@ -1,8 +1,7 @@ import './button.scss' -import React from 'react' - import cx from 'classnames' +import React from 'react' import type { IconSize } from '#/components/common/icon' import Icon from '#/components/common/icon' import { useId } from '#/hooks/useId.hook' diff --git a/jsapp/js/components/common/centeredMessage.component.tsx b/jsapp/js/components/common/centeredMessage.component.tsx index fc9d382556..817800e37b 100644 --- a/jsapp/js/components/common/centeredMessage.component.tsx +++ b/jsapp/js/components/common/centeredMessage.component.tsx @@ -1,5 +1,5 @@ -import React from 'react' import type { ReactElement } from 'react' +import React from 'react' import styles from './centeredMessage.module.scss' diff --git a/jsapp/js/components/common/diffValue.component.tsx b/jsapp/js/components/common/diffValue.component.tsx index 4121fab289..c90cd82e56 100644 --- a/jsapp/js/components/common/diffValue.component.tsx +++ b/jsapp/js/components/common/diffValue.component.tsx @@ -1,6 +1,5 @@ -import React from 'react' - import cx from 'classnames' +import React from 'react' import styles from './diffValue.module.scss' interface DiffValueProps { diff --git a/jsapp/js/components/common/diffValue.stories.tsx b/jsapp/js/components/common/diffValue.stories.tsx index c754b46350..4a10f33106 100644 --- a/jsapp/js/components/common/diffValue.stories.tsx +++ b/jsapp/js/components/common/diffValue.stories.tsx @@ -1,6 +1,5 @@ -import React from 'react' - import type { StoryObj } from '@storybook/react-webpack5' +import React from 'react' import DiffValue from '#/components/common/diffValue.component' export default { diff --git a/jsapp/js/components/common/dropdownmenu.stories.tsx b/jsapp/js/components/common/dropdownmenu.stories.tsx index 696c69d1b3..1633accda1 100644 --- a/jsapp/js/components/common/dropdownmenu.stories.tsx +++ b/jsapp/js/components/common/dropdownmenu.stories.tsx @@ -1,6 +1,5 @@ -import React from 'react' - import { Menu } from '@mantine/core' +import React from 'react' import Button from './ButtonNew' export default { diff --git a/jsapp/js/components/common/icon.stories.tsx b/jsapp/js/components/common/icon.stories.tsx index de6a95706c..e2632039c2 100644 --- a/jsapp/js/components/common/icon.stories.tsx +++ b/jsapp/js/components/common/icon.stories.tsx @@ -1,8 +1,8 @@ import type { Meta, StoryObj } from '@storybook/react-webpack5' import { IconNames } from '#/k-icons' import { recordKeys } from '#/utils' -import Icon from './icon' import type { IconColor } from './icon' +import Icon from './icon' const iconColors: Array = [undefined, 'mid-red', 'storm', 'teal', 'amber', 'blue'] diff --git a/jsapp/js/components/common/inlineMessage.tsx b/jsapp/js/components/common/inlineMessage.tsx index 9a567d85e3..a97fd32cbf 100644 --- a/jsapp/js/components/common/inlineMessage.tsx +++ b/jsapp/js/components/common/inlineMessage.tsx @@ -1,8 +1,7 @@ import './inlineMessage.scss' -import React from 'react' - import cx from 'classnames' +import React from 'react' import Icon from '#/components/common/icon' import type { IconName } from '#/k-icons' diff --git a/jsapp/js/components/common/koboSelect.tsx b/jsapp/js/components/common/koboSelect.tsx index 6e95e758c4..7321fdb7cf 100644 --- a/jsapp/js/components/common/koboSelect.tsx +++ b/jsapp/js/components/common/koboSelect.tsx @@ -1,16 +1,15 @@ import './koboSelect.scss' -import React from 'react' - import Fuse from 'fuse.js' import $ from 'jquery' +import React from 'react' import bem, { makeBem } from '#/bem' import type { ButtonSize } from '#/components/common/button' import { ButtonToIconMap } from '#/components/common/button' import type { IconSize } from '#/components/common/icon' import Icon from '#/components/common/icon' -import KoboDropdown from '#/components/common/koboDropdown' import type { KoboDropdownPlacement } from '#/components/common/koboDropdown' +import KoboDropdown from '#/components/common/koboDropdown' import koboDropdownActions from '#/components/common/koboDropdownActions' import { FUSE_OPTIONS } from '#/constants' import type { IconName } from '#/k-icons' diff --git a/jsapp/js/components/common/loadingSpinner.stories.tsx b/jsapp/js/components/common/loadingSpinner.stories.tsx index 62a2fb07ce..8cd689511a 100644 --- a/jsapp/js/components/common/loadingSpinner.stories.tsx +++ b/jsapp/js/components/common/loadingSpinner.stories.tsx @@ -1,6 +1,6 @@ import type { Meta, StoryObj } from '@storybook/react-webpack5' -import LoadingSpinner from './loadingSpinner' import type { LoadingSpinnerType } from './loadingSpinner' +import LoadingSpinner from './loadingSpinner' const spinnerTypes: LoadingSpinnerType[] = ['regular', 'big'] diff --git a/jsapp/js/components/common/loadingSpinner.tsx b/jsapp/js/components/common/loadingSpinner.tsx index 5eaf9d830a..cb1a6ea825 100644 --- a/jsapp/js/components/common/loadingSpinner.tsx +++ b/jsapp/js/components/common/loadingSpinner.tsx @@ -1,6 +1,5 @@ -import React from 'react' - import cx from 'classnames' +import React from 'react' import Icon from '#/components/common/icon' import styles from './loadingSpinner.module.scss' diff --git a/jsapp/js/components/common/modal.tsx b/jsapp/js/components/common/modal.tsx index ccff72c3e2..8bc8f43a20 100644 --- a/jsapp/js/components/common/modal.tsx +++ b/jsapp/js/components/common/modal.tsx @@ -1,8 +1,7 @@ import './modal.scss' -import React from 'react' - import classNames from 'classnames' +import React from 'react' import bem from '#/bem' import Button from '#/components/common/button' import { KEY_CODES } from '#/constants' diff --git a/jsapp/js/components/common/radio.stories.tsx b/jsapp/js/components/common/radio.stories.tsx index 5cef7a23e0..90a4118ed9 100644 --- a/jsapp/js/components/common/radio.stories.tsx +++ b/jsapp/js/components/common/radio.stories.tsx @@ -1,7 +1,7 @@ import type { Meta, StoryObj } from '@storybook/react-webpack5' import { useState } from 'react' -import Radio from './radio' import type { RadioOption } from './radio' +import Radio from './radio' const defaultOptions: RadioOption[] = [ { diff --git a/jsapp/js/components/common/tabs.tsx b/jsapp/js/components/common/tabs.tsx index 4f510cef18..f797601ba3 100644 --- a/jsapp/js/components/common/tabs.tsx +++ b/jsapp/js/components/common/tabs.tsx @@ -1,6 +1,5 @@ -import React, { useState } from 'react' - import cx from 'classnames' +import React, { useState } from 'react' import styles from './tabs.module.scss' interface Tab { diff --git a/jsapp/js/components/common/textBox.stories.tsx b/jsapp/js/components/common/textBox.stories.tsx index 0a4e66ce6a..1b1604c2d7 100644 --- a/jsapp/js/components/common/textBox.stories.tsx +++ b/jsapp/js/components/common/textBox.stories.tsx @@ -1,8 +1,8 @@ import type { Meta, StoryObj } from '@storybook/react-webpack5' import { IconNames } from '#/k-icons' import { recordKeys } from '#/utils' -import TextBox from './textBox' import type { TextBoxSize, TextBoxType } from './textBox' +import TextBox from './textBox' const textBoxTypes: TextBoxType[] = ['email', 'number', 'password', 'text-multiline', 'text', 'url'] const textBoxSizes: TextBoxSize[] = ['s', 'm', 'l'] diff --git a/jsapp/js/components/common/textBox.tsx b/jsapp/js/components/common/textBox.tsx index fa08e2854b..0fd85df30e 100644 --- a/jsapp/js/components/common/textBox.tsx +++ b/jsapp/js/components/common/textBox.tsx @@ -1,6 +1,5 @@ -import React, { useEffect } from 'react' - import classnames from 'classnames' +import React, { useEffect } from 'react' import TextareaAutosize from 'react-textarea-autosize' import type { ButtonSize } from '#/components/common/button' import { ButtonToIconMap } from '#/components/common/button' diff --git a/jsapp/js/components/dataAttachments/connectProjects.js b/jsapp/js/components/dataAttachments/connectProjects.js index 27d05f5622..8d7db44928 100644 --- a/jsapp/js/components/dataAttachments/connectProjects.js +++ b/jsapp/js/components/dataAttachments/connectProjects.js @@ -1,8 +1,7 @@ import './connect-projects.scss' -import React from 'react' - import alertify from 'alertifyjs' +import React from 'react' import autoBind from 'react-autobind' import Select from 'react-select' import { actions } from '#/actions' diff --git a/jsapp/js/components/drawer.js b/jsapp/js/components/drawer.js index 5f5e96916f..370f4404b0 100644 --- a/jsapp/js/components/drawer.js +++ b/jsapp/js/components/drawer.js @@ -1,7 +1,6 @@ -import React, { lazy, Suspense } from 'react' - import { Button } from '@mantine/core' import { observer } from 'mobx-react' +import React, { lazy, Suspense } from 'react' import autoBind from 'react-autobind' import reactMixin from 'react-mixin' import { NavLink } from 'react-router-dom' diff --git a/jsapp/js/components/formGallery/formGallery.component.tsx b/jsapp/js/components/formGallery/formGallery.component.tsx index 9913bfd6d1..50e441af7d 100644 --- a/jsapp/js/components/formGallery/formGallery.component.tsx +++ b/jsapp/js/components/formGallery/formGallery.component.tsx @@ -1,8 +1,7 @@ import './formGallery.component.scss' -import React, { useEffect, useMemo, useReducer } from 'react' - import { Center } from '@mantine/core' +import React, { useEffect, useMemo, useReducer } from 'react' import ReactSelect from 'react-select' import { getFlatQuestionsList } from '#/assetUtils' import DeletedAttachment from '#/attachments/deletedAttachment.component' diff --git a/jsapp/js/components/formLanding/formLanding.js b/jsapp/js/components/formLanding/formLanding.js index 54785f5805..6e2a3ffc9e 100644 --- a/jsapp/js/components/formLanding/formLanding.js +++ b/jsapp/js/components/formLanding/formLanding.js @@ -1,6 +1,5 @@ -import React from 'react' - import { Stack } from '@mantine/core' +import React from 'react' import autoBind from 'react-autobind' import CopyToClipboard from 'react-copy-to-clipboard' import DocumentTitle from 'react-document-title' @@ -18,8 +17,7 @@ import NewFeatureDialog from '#/components/newFeatureDialog.component' import permConfig from '#/components/permissions/permConfig' import { PERMISSIONS_CODENAMES } from '#/components/permissions/permConstants' import { userCan, userCanRemoveSharedProject } from '#/components/permissions/utils' -import { COLLECTION_METHODS, MODAL_TYPES } from '#/constants' -import { HELP_ARTICLE_ANON_SUBMISSIONS_URL } from '#/constants' +import { COLLECTION_METHODS, HELP_ARTICLE_ANON_SUBMISSIONS_URL, MODAL_TYPES } from '#/constants' import { dataInterface } from '#/dataInterface' import envStore from '#/envStore' import mixins from '#/mixins' diff --git a/jsapp/js/components/formSubScreens.js b/jsapp/js/components/formSubScreens.js index fb8b2631a3..e0915eb980 100644 --- a/jsapp/js/components/formSubScreens.js +++ b/jsapp/js/components/formSubScreens.js @@ -11,11 +11,11 @@ import { ROUTES } from '#/router/routerConstants' import { actions } from '../actions' import { PROJECT_SETTINGS_CONTEXTS } from '../constants' import mixins from '../mixins' -import RESTServices from './RESTServices' import FormMap from './map' import FormMedia from './modalForms/formMedia' import ProjectSettings from './modalForms/projectSettings' import SharingForm from './permissions/sharingForm.component' +import RESTServices from './RESTServices' import LimitNotifications from './usageLimits/limitNotifications.component' const ConnectProjects = React.lazy( diff --git a/jsapp/js/components/formSummary/formSummaryProjectInfo.tsx b/jsapp/js/components/formSummary/formSummaryProjectInfo.tsx index 28cb3dd7d2..e77add913b 100644 --- a/jsapp/js/components/formSummary/formSummaryProjectInfo.tsx +++ b/jsapp/js/components/formSummary/formSummaryProjectInfo.tsx @@ -1,4 +1,4 @@ -import React, { useState, useEffect } from 'react' +import React, { useEffect, useState } from 'react' import { handleApiFail } from '#/api' import { getCountryDisplayString, getSectorDisplayString } from '#/assetUtils' diff --git a/jsapp/js/components/header/mainHeader.component.tsx b/jsapp/js/components/header/mainHeader.component.tsx index 65a988805d..66f3cf1eda 100644 --- a/jsapp/js/components/header/mainHeader.component.tsx +++ b/jsapp/js/components/header/mainHeader.component.tsx @@ -1,6 +1,5 @@ -import React from 'react' - import { observer } from 'mobx-react' +import React from 'react' import assetStore from '#/assetStore' import { getAssetIcon } from '#/assetUtils' import bem from '#/bem' @@ -14,9 +13,9 @@ import { userCan } from '#/components/permissions/utils' import type { AssetResponse } from '#/dataInterface' import type { IconName } from '#/k-icons' import pageState from '#/pageState.store' -import { RequireOrg } from '#/router/RequireOrg' -import { router, withRouter } from '#/router/legacy' import type { WithRouterProps } from '#/router/legacy' +import { router, withRouter } from '#/router/legacy' +import { RequireOrg } from '#/router/RequireOrg' import { getLoginUrl, isAnyFormRoute, diff --git a/jsapp/js/components/header/searchBox.tsx b/jsapp/js/components/header/searchBox.tsx index d87c2aaf8d..7f5d5c0b06 100644 --- a/jsapp/js/components/header/searchBox.tsx +++ b/jsapp/js/components/header/searchBox.tsx @@ -1,8 +1,7 @@ -import React from 'react' - import debounce from 'lodash.debounce' import { autorun } from 'mobx' import { observer } from 'mobx-react' +import React from 'react' import bem from '#/bem' import { KEY_CODES } from '#/constants' import searchBoxStore from './searchBoxStore' diff --git a/jsapp/js/components/languages/languageSelector.tsx b/jsapp/js/components/languages/languageSelector.tsx index 2c67577f90..1882fd2c72 100644 --- a/jsapp/js/components/languages/languageSelector.tsx +++ b/jsapp/js/components/languages/languageSelector.tsx @@ -1,10 +1,9 @@ import './languageSelector.scss' -import React from 'react' - import debounce from 'lodash.debounce' import { observer } from 'mobx-react' import type { RefObject } from 'react' +import React from 'react' import InfiniteScroll from 'react-infinite-scroller' import bem, { makeBem } from '#/bem' @@ -13,8 +12,8 @@ import Icon from '#/components/common/icon' import LoadingSpinner from '#/components/common/loadingSpinner' import envStore from '#/envStore' import LanguagesListStore from './languagesListStore' -import languagesStore from './languagesStore' import type { DetailedLanguage, LanguageCode, ListLanguage } from './languagesStore' +import languagesStore from './languagesStore' import { LanguageDisplayLabel } from './languagesUtils' bem.LanguageSelector = makeBem(null, 'language-selector', 'section') diff --git a/jsapp/js/components/languages/languagesListStore.ts b/jsapp/js/components/languages/languagesListStore.ts index f1cddd5570..e876ee5655 100644 --- a/jsapp/js/components/languages/languagesListStore.ts +++ b/jsapp/js/components/languages/languagesListStore.ts @@ -3,8 +3,8 @@ import { handleApiFail } from '#/api' import { endpoints } from '#/api.endpoints' import { ROOT_URL } from '#/constants' import type { FailResponse, PaginatedResponse } from '#/dataInterface' -import languagesStore from './languagesStore' import type { ListLanguage } from './languagesStore' +import languagesStore from './languagesStore' /** * NOTE: this requires to be initialized with `new` keyword! This is because diff --git a/jsapp/js/components/languages/languagesUtils.tsx b/jsapp/js/components/languages/languagesUtils.tsx index 455c7dc681..e696db7f54 100644 --- a/jsapp/js/components/languages/languagesUtils.tsx +++ b/jsapp/js/components/languages/languagesUtils.tsx @@ -1,8 +1,8 @@ import React from 'react' import { recordKeys } from '#/utils' -import languagesStore from './languagesStore' import type { LanguageCode } from './languagesStore' +import languagesStore from './languagesStore' interface LanguageDisplayLabelProps { code: LanguageCode diff --git a/jsapp/js/components/languages/regionSelector.tsx b/jsapp/js/components/languages/regionSelector.tsx index 01cde125e2..e1f5c4bf0a 100644 --- a/jsapp/js/components/languages/regionSelector.tsx +++ b/jsapp/js/components/languages/regionSelector.tsx @@ -5,10 +5,10 @@ import React from 'react' import bem, { makeBem } from '#/bem' import Button from '#/components/common/button' import Icon from '#/components/common/icon' -import KoboSelect from '#/components/common/koboSelect' import type { KoboSelectOption } from '#/components/common/koboSelect' -import languagesStore from './languagesStore' +import KoboSelect from '#/components/common/koboSelect' import type { DetailedLanguage, LanguageCode, TransxServiceCode } from './languagesStore' +import languagesStore from './languagesStore' bem.RegionSelector = makeBem(null, 'region-selector', 'section') bem.RegionSelector__loading = makeBem(bem.RegionSelector, 'loading') diff --git a/jsapp/js/components/library/assetContentSummary.tsx b/jsapp/js/components/library/assetContentSummary.tsx index 53699be2fc..c974a22696 100644 --- a/jsapp/js/components/library/assetContentSummary.tsx +++ b/jsapp/js/components/library/assetContentSummary.tsx @@ -1,7 +1,6 @@ import React from 'react' - -import { getFlatQuestionsList, renderQuestionTypeIcon } from '#/assetUtils' import type { FlatQuestion } from '#/assetUtils' +import { getFlatQuestionsList, renderQuestionTypeIcon } from '#/assetUtils' import bem from '#/bem' import Button from '#/components/common/button' import { ANY_ROW_TYPE_NAMES } from '#/constants' diff --git a/jsapp/js/components/library/assetRoute.tsx b/jsapp/js/components/library/assetRoute.tsx index 99c8cb539a..79d13feab3 100644 --- a/jsapp/js/components/library/assetRoute.tsx +++ b/jsapp/js/components/library/assetRoute.tsx @@ -1,6 +1,5 @@ -import React from 'react' - import clonedeep from 'lodash.clonedeep' +import React from 'react' import DocumentTitle from 'react-document-title' import { actions } from '#/actions' import assetUtils from '#/assetUtils' diff --git a/jsapp/js/components/library/myLibraryRoute.tsx b/jsapp/js/components/library/myLibraryRoute.tsx index 0cba4cd6ef..cbd1b2dd3a 100644 --- a/jsapp/js/components/library/myLibraryRoute.tsx +++ b/jsapp/js/components/library/myLibraryRoute.tsx @@ -1,10 +1,9 @@ -import React from 'react' - import type { DragEvent } from 'react' +import React from 'react' import DocumentTitle from 'react-document-title' -import Dropzone from 'react-dropzone' import type { FileWithPreview } from 'react-dropzone' +import Dropzone from 'react-dropzone' import bem from '#/bem' import AssetsTable from '#/components/assetsTable/assetsTable' import { AssetsTableContextName } from '#/components/assetsTable/assetsTableConstants' @@ -14,8 +13,8 @@ import mixins from '#/mixins' import pageState from '#/pageState.store' import type { OrderDirection } from '#/projects/projectViews/constants' import { validFileTypes } from '#/utils' -import myLibraryStore from './myLibraryStore' import type { MyLibraryStoreData } from './myLibraryStore' +import myLibraryStore from './myLibraryStore' export default class MyLibraryRoute extends React.Component<{}, MyLibraryStoreData> { private unlisteners: Function[] = [] diff --git a/jsapp/js/components/library/publicCollectionsRoute.tsx b/jsapp/js/components/library/publicCollectionsRoute.tsx index 55fa38b7b0..39dc9e8d17 100644 --- a/jsapp/js/components/library/publicCollectionsRoute.tsx +++ b/jsapp/js/components/library/publicCollectionsRoute.tsx @@ -6,8 +6,8 @@ import AssetsTable from '#/components/assetsTable/assetsTable' import { AssetsTableContextName } from '#/components/assetsTable/assetsTableConstants' import { ROOT_BREADCRUMBS } from '#/components/library/libraryConstants' import type { OrderDirection } from '#/projects/projectViews/constants' -import publicCollectionsStore from './publicCollectionsStore' import type { PublicCollectionsStoreData } from './publicCollectionsStore' +import publicCollectionsStore from './publicCollectionsStore' export default class PublicCollectionsRoute extends React.Component<{}, PublicCollectionsStoreData> { private unlisteners: Function[] = [] diff --git a/jsapp/js/components/library/publicCollectionsStore.ts b/jsapp/js/components/library/publicCollectionsStore.ts index 0b04299e6a..da5641b0c0 100644 --- a/jsapp/js/components/library/publicCollectionsStore.ts +++ b/jsapp/js/components/library/publicCollectionsStore.ts @@ -3,8 +3,8 @@ import { reaction } from 'mobx' import Reflux from 'reflux' import { actions } from '#/actions' import assetUtils from '#/assetUtils' -import { ASSETS_TABLE_COLUMNS, ORDER_DIRECTIONS } from '#/components/assetsTable/assetsTableConstants' import type { AssetsTableColumn } from '#/components/assetsTable/assetsTableConstants' +import { ASSETS_TABLE_COLUMNS, ORDER_DIRECTIONS } from '#/components/assetsTable/assetsTableConstants' import searchBoxStore from '#/components/header/searchBoxStore' import { ACCESS_TYPES, ASSET_TYPES } from '#/constants' import type { diff --git a/jsapp/js/components/locking/lockingUtils.mocks.ts b/jsapp/js/components/locking/lockingUtils.mocks.ts index dfdc67529b..5a6cfcb95b 100644 --- a/jsapp/js/components/locking/lockingUtils.mocks.ts +++ b/jsapp/js/components/locking/lockingUtils.mocks.ts @@ -8,7 +8,7 @@ import { QuestionTypeName, } from '#/constants' import type { AssetResponse } from '#/dataInterface' -import { LOCKING_PROFILE_PROP_NAME, LOCK_ALL_PROP_NAME, LockingRestrictionName } from './lockingConstants' +import { LOCK_ALL_PROP_NAME, LOCKING_PROFILE_PROP_NAME, LockingRestrictionName } from './lockingConstants' /** * This is a minimal response from asset endpoin. The idea is to make it up diff --git a/jsapp/js/components/locking/lockingUtils.ts b/jsapp/js/components/locking/lockingUtils.ts index 2e38bd1e52..3c0c6ec747 100644 --- a/jsapp/js/components/locking/lockingUtils.ts +++ b/jsapp/js/components/locking/lockingUtils.ts @@ -6,10 +6,10 @@ import { FORM_RESTRICTIONS, GROUP_RESTRICTIONS, type IndexedAssetLockingProfileDefinition, - LOCKING_PROFILES_PROP_NAME, - LOCKING_PROFILE_PROP_NAME, LOCK_ALL_PROP_NAME, LOCK_ALL_RESTRICTION_NAMES, + LOCKING_PROFILE_PROP_NAME, + LOCKING_PROFILES_PROP_NAME, type LockingRestrictionDefinition, type LockingRestrictionName, QUESTION_RESTRICTIONS, diff --git a/jsapp/js/components/map/MapSettings.tsx b/jsapp/js/components/map/MapSettings.tsx index 1368f5cdcb..6b9d4583f9 100644 --- a/jsapp/js/components/map/MapSettings.tsx +++ b/jsapp/js/components/map/MapSettings.tsx @@ -3,20 +3,15 @@ import cx from 'classnames' // Libraries import React from 'react' import Dropzone, { type FileWithPreview } from 'react-dropzone' - +// Stores, hooks and utilities +import { actions } from '../../../js/actions' +import { getQuestionOrChoiceDisplayName, getRowName } from '../../../js/assetUtils' // Partial components import bem from '../../../js/bem' import Button from '../../../js/components/common/button' import Modal from '../../../js/components/common/modal' import MapColorPicker from '../../../js/components/map/MapColorPicker' - -// Stores, hooks and utilities -import { actions } from '../../../js/actions' -import { getQuestionOrChoiceDisplayName, getRowName } from '../../../js/assetUtils' import { userCan } from '../../../js/components/permissions/utils' -import { dataInterface } from '../../../js/dataInterface' -import { notify } from '../../../js/utils' - // Constants and types import { ASSET_FILE_TYPES, QUERY_LIMIT_DEFAULT } from '../../../js/constants' import type { @@ -28,6 +23,8 @@ import type { LabelValuePair, PaginatedResponse, } from '../../../js/dataInterface' +import { dataInterface } from '../../../js/dataInterface' +import { notify } from '../../../js/utils' enum MapSettingsTabNames { colors = 'colors', diff --git a/jsapp/js/components/map/index.tsx b/jsapp/js/components/map/index.tsx index d6ac8533a0..84f47dd7c8 100644 --- a/jsapp/js/components/map/index.tsx +++ b/jsapp/js/components/map/index.tsx @@ -13,22 +13,11 @@ import 'leaflet.heat' import 'leaflet.markercluster' import 'leaflet.markercluster/dist/MarkerCluster.css' import { check } from '@placemarkio/check-geojson' - +import { actions } from '../../../js/actions' +import { getSurveyFlatPaths } from '../../../js/assetUtils' import CenteredMessage from '../../../js/components/common/centeredMessage.component' import LoadingSpinner from '../../../js/components/common/loadingSpinner' import Modal from '../../../js/components/common/modal' -// Partial components -import PopoverMenu from '../../../js/popoverMenu' -import MapSettings from './MapSettings' - -import { actions } from '../../../js/actions' -import { getSurveyFlatPaths } from '../../../js/assetUtils' -// Stores, hooks and utilities -import { dataInterface } from '../../../js/dataInterface' -import pageState from '../../../js/pageState.store' -import { type WithRouterProps, withRouter } from '../../../js/router/legacy' -import { checkLatLng, notify, recordKeys } from '../../../js/utils' - // Constants and types import { ASSET_FILE_TYPES, MODAL_TYPES, QUERY_LIMIT_DEFAULT, QUESTION_TYPES } from '../../../js/constants' import type { @@ -41,6 +30,14 @@ import type { SurveyChoice, SurveyRow, } from '../../../js/dataInterface' +// Stores, hooks and utilities +import { dataInterface } from '../../../js/dataInterface' +import pageState from '../../../js/pageState.store' +// Partial components +import PopoverMenu from '../../../js/popoverMenu' +import { type WithRouterProps, withRouter } from '../../../js/router/legacy' +import { checkLatLng, notify, recordKeys } from '../../../js/utils' +import MapSettings from './MapSettings' // Styles import './map.scss' diff --git a/jsapp/js/components/modalForms/assetTagsForm.js b/jsapp/js/components/modalForms/assetTagsForm.js index 5f317a7b34..703258b5b1 100644 --- a/jsapp/js/components/modalForms/assetTagsForm.js +++ b/jsapp/js/components/modalForms/assetTagsForm.js @@ -1,6 +1,5 @@ -import React from 'react' - import { observer } from 'mobx-react' +import React from 'react' import autoBind from 'react-autobind' import { actions } from '#/actions' import bem from '#/bem' diff --git a/jsapp/js/components/modalForms/bulkEditSubmissionsForm.js b/jsapp/js/components/modalForms/bulkEditSubmissionsForm.js index 98d504a225..88f4f6b6d9 100644 --- a/jsapp/js/components/modalForms/bulkEditSubmissionsForm.js +++ b/jsapp/js/components/modalForms/bulkEditSubmissionsForm.js @@ -1,14 +1,13 @@ -import React from 'react' - import { Text } from '@mantine/core' import Fuse from 'fuse.js' import clonedeep from 'lodash.clonedeep' +import React from 'react' import autoBind from 'react-autobind' import { actions } from '#/actions' import { getFlatQuestionsList, getSurveyFlatPaths, renderQuestionTypeIcon } from '#/assetUtils' import bem from '#/bem' -import SimpleTable from '#/components/common/SimpleTable' import Button from '#/components/common/button' +import SimpleTable from '#/components/common/SimpleTable' import TextBox from '#/components/common/textBox' import { FUSE_OPTIONS, QuestionTypeName } from '#/constants' import envStore from '#/envStore' diff --git a/jsapp/js/components/modalForms/libraryAssetForm.js b/jsapp/js/components/modalForms/libraryAssetForm.js index ccd48a6851..dbcbdce77a 100644 --- a/jsapp/js/components/modalForms/libraryAssetForm.js +++ b/jsapp/js/components/modalForms/libraryAssetForm.js @@ -1,7 +1,6 @@ -import React from 'react' - import clonedeep from 'lodash.clonedeep' import { when } from 'mobx' +import React from 'react' import autoBind from 'react-autobind' import reactMixin from 'react-mixin' import Reflux from 'reflux' diff --git a/jsapp/js/components/modalForms/libraryNewItemForm.js b/jsapp/js/components/modalForms/libraryNewItemForm.js index 15810be206..676a264844 100644 --- a/jsapp/js/components/modalForms/libraryNewItemForm.js +++ b/jsapp/js/components/modalForms/libraryNewItemForm.js @@ -1,6 +1,5 @@ -import React from 'react' - import { when } from 'mobx' +import React from 'react' import autoBind from 'react-autobind' import reactMixin from 'react-mixin' import Reflux from 'reflux' diff --git a/jsapp/js/components/modalForms/libraryUploadForm.js b/jsapp/js/components/modalForms/libraryUploadForm.js index 9fc8bd388c..65e9e488df 100644 --- a/jsapp/js/components/modalForms/libraryUploadForm.js +++ b/jsapp/js/components/modalForms/libraryUploadForm.js @@ -1,6 +1,5 @@ -import React from 'react' - import { observer } from 'mobx-react' +import React from 'react' import autoBind from 'react-autobind' import Dropzone from 'react-dropzone' import reactMixin from 'react-mixin' diff --git a/jsapp/js/components/modalForms/projectSettings.js b/jsapp/js/components/modalForms/projectSettings.js index 5d41c3c7ed..e8928e859c 100644 --- a/jsapp/js/components/modalForms/projectSettings.js +++ b/jsapp/js/components/modalForms/projectSettings.js @@ -1,8 +1,7 @@ -import React from 'react' - import cx from 'classnames' import clonedeep from 'lodash.clonedeep' import { when } from 'mobx' +import React from 'react' import autoBind from 'react-autobind' import Dropzone from 'react-dropzone' import reactMixin from 'react-mixin' @@ -24,8 +23,7 @@ import { dataInterface } from '#/dataInterface' import envStore from '#/envStore' import mixins from '#/mixins' import pageState from '#/pageState.store' -import { router } from '#/router/legacy' -import { withRouter } from '#/router/legacy' +import { router, withRouter } from '#/router/legacy' import { ROUTES } from '#/router/routerConstants' import sessionStore from '#/stores/session' import { addRequiredToLabel } from '#/textUtils' diff --git a/jsapp/js/components/modalForms/translationSettings.js b/jsapp/js/components/modalForms/translationSettings.js index 2866634f29..f61602a90b 100644 --- a/jsapp/js/components/modalForms/translationSettings.js +++ b/jsapp/js/components/modalForms/translationSettings.js @@ -1,6 +1,5 @@ -import React from 'react' - import alertify from 'alertifyjs' +import React from 'react' import autoBind from 'react-autobind' import reactMixin from 'react-mixin' import Reflux from 'reflux' diff --git a/jsapp/js/components/modalForms/translationTable.js b/jsapp/js/components/modalForms/translationTable.js index 4bb044c456..39978a558a 100644 --- a/jsapp/js/components/modalForms/translationTable.js +++ b/jsapp/js/components/modalForms/translationTable.js @@ -1,6 +1,5 @@ -import React from 'react' - import alertify from 'alertifyjs' +import React from 'react' import ReactTable from 'react-table' import TextareaAutosize from 'react-textarea-autosize' import { actions } from '#/actions' diff --git a/jsapp/js/components/modals/koboModal.tsx b/jsapp/js/components/modals/koboModal.tsx index 2c09dc885d..97786f66ea 100644 --- a/jsapp/js/components/modals/koboModal.tsx +++ b/jsapp/js/components/modals/koboModal.tsx @@ -1,8 +1,7 @@ import './koboModal.scss' -import React from 'react' - import cx from 'classnames' +import React from 'react' import Modal from 'react-modal' import bem, { makeBem } from '#/bem' diff --git a/jsapp/js/components/newFeatureDialog.component.tsx b/jsapp/js/components/newFeatureDialog.component.tsx index 27edf2af23..920a782dba 100644 --- a/jsapp/js/components/newFeatureDialog.component.tsx +++ b/jsapp/js/components/newFeatureDialog.component.tsx @@ -1,6 +1,5 @@ -import React, { useState, useEffect } from 'react' - import cx from 'classnames' +import React, { useEffect, useState } from 'react' import Icon from '#/components/common/icon' import sessionStore from '#/stores/session' import { useSafeUsernameStorageKey } from '../hooks/useSafeUsernameStorageKey' diff --git a/jsapp/js/components/passwordStrength.component.tsx b/jsapp/js/components/passwordStrength.component.tsx index 6ef40d2964..aa49890493 100644 --- a/jsapp/js/components/passwordStrength.component.tsx +++ b/jsapp/js/components/passwordStrength.component.tsx @@ -1,6 +1,5 @@ -import React from 'react' - import classNames from 'classnames' +import React from 'react' import zxcvbn from 'zxcvbn' import styles from './passwordStrength.module.scss' diff --git a/jsapp/js/components/permissions/copyTeamPermissions.component.tsx b/jsapp/js/components/permissions/copyTeamPermissions.component.tsx index 783cbe7f74..c5b199ac40 100644 --- a/jsapp/js/components/permissions/copyTeamPermissions.component.tsx +++ b/jsapp/js/components/permissions/copyTeamPermissions.component.tsx @@ -1,13 +1,12 @@ -import React from 'react' - import alertify from 'alertifyjs' import classNames from 'classnames' -import assetStore from '#/assetStore' +import React from 'react' import type { AssetStoreData } from '#/assetStore' +import assetStore from '#/assetStore' import bem from '#/bem' import Button from '#/components/common/button' -import KoboSelect from '#/components/common/koboSelect' import type { KoboSelectOption } from '#/components/common/koboSelect' +import KoboSelect from '#/components/common/koboSelect' import { escapeHtml, notify } from '#/utils' import { actions } from '../../actions' import { stores } from '../../stores' diff --git a/jsapp/js/components/permissions/sharingForm.component.tsx b/jsapp/js/components/permissions/sharingForm.component.tsx index ded0af6543..1f075461c5 100644 --- a/jsapp/js/components/permissions/sharingForm.component.tsx +++ b/jsapp/js/components/permissions/sharingForm.component.tsx @@ -4,8 +4,8 @@ import React from 'react' import { ACCOUNT_ROUTES } from '#/account/routes.constants' import { actions } from '#/actions' -import assetStore from '#/assetStore' import type { AssetStoreData } from '#/assetStore' +import assetStore from '#/assetStore' import bem from '#/bem' import AssetName from '#/components/common/assetName' import Button from '#/components/common/button' @@ -27,8 +27,8 @@ import { replaceBracketsWithLink } from '#/textUtils' import { ANON_USERNAME, ANON_USERNAME_URL } from '#/users/utils' import { recordKeys, recordValues } from '#/utils' import CopyTeamPermissions from './copyTeamPermissions.component' -import { parseBackendData, parseUserWithPermsList } from './permParser' import type { UserWithPerms } from './permParser' +import { parseBackendData, parseUserWithPermsList } from './permParser' import PublicShareSettings from './publicShareSettings.component' import UserAssetPermsEditor from './userAssetPermsEditor.component' import UserPermissionRow from './userPermissionRow.component' diff --git a/jsapp/js/components/permissions/transferProjects/projectOwnershipTransferModalWithBanner.tsx b/jsapp/js/components/permissions/transferProjects/projectOwnershipTransferModalWithBanner.tsx index 9e70908450..74e3ce55b4 100644 --- a/jsapp/js/components/permissions/transferProjects/projectOwnershipTransferModalWithBanner.tsx +++ b/jsapp/js/components/permissions/transferProjects/projectOwnershipTransferModalWithBanner.tsx @@ -1,9 +1,9 @@ -import React, { useState, useEffect } from 'react' +import React, { useEffect, useState } from 'react' import { useSearchParams } from 'react-router-dom' -import ProjectTransferInviteBanner from './projectTransferInviteBanner' import type { TransferInviteState } from './projectTransferInviteBanner' -import { type TransferStatuses, isInviteForLoggedInUser } from './transferProjects.api' +import ProjectTransferInviteBanner from './projectTransferInviteBanner' +import { isInviteForLoggedInUser, type TransferStatuses } from './transferProjects.api' import TransferProjectsInvite from './transferProjectsInvite.component' /** diff --git a/jsapp/js/components/permissions/transferProjects/transferProjects.component.tsx b/jsapp/js/components/permissions/transferProjects/transferProjects.component.tsx index 336b05aa3f..5f6047714e 100644 --- a/jsapp/js/components/permissions/transferProjects/transferProjects.component.tsx +++ b/jsapp/js/components/permissions/transferProjects/transferProjects.component.tsx @@ -12,7 +12,7 @@ import { HELP_ARTICLE_ANON_SUBMISSIONS_URL } from '#/constants' import type { AssetResponse } from '#/dataInterface' import envStore from '#/envStore' import sessionStore from '#/stores/session' -import { TransferStatuses, cancelInvite, sendInvite } from './transferProjects.api' +import { cancelInvite, sendInvite, TransferStatuses } from './transferProjects.api' import styles from './transferProjects.module.scss' interface TransferProjectsProps { diff --git a/jsapp/js/components/permissions/transferProjects/transferProjectsInvite.component.tsx b/jsapp/js/components/permissions/transferProjects/transferProjectsInvite.component.tsx index b2cd7d7f6f..a2f82cee44 100644 --- a/jsapp/js/components/permissions/transferProjects/transferProjectsInvite.component.tsx +++ b/jsapp/js/components/permissions/transferProjects/transferProjectsInvite.component.tsx @@ -1,13 +1,12 @@ -import React, { useState, useEffect } from 'react' - import cx from 'classnames' +import React, { useEffect, useState } from 'react' import { useSearchParams } from 'react-router-dom' import Button from '#/components/common/button' import Icon from '#/components/common/icon' import KoboModal from '#/components/modals/koboModal' import KoboModalFooter from '#/components/modals/koboModalFooter' import KoboModalHeader from '#/components/modals/koboModalHeader' -import { TransferStatuses, acceptInvite, declineInvite, getAssetFromInviteUid } from './transferProjects.api' +import { acceptInvite, declineInvite, getAssetFromInviteUid, TransferStatuses } from './transferProjects.api' import styles from './transferProjectsInvite.module.scss' interface DisplayDetails { diff --git a/jsapp/js/components/permissions/userAssetPermsEditor.component.tsx b/jsapp/js/components/permissions/userAssetPermsEditor.component.tsx index 26f37253d7..b973263cd7 100644 --- a/jsapp/js/components/permissions/userAssetPermsEditor.component.tsx +++ b/jsapp/js/components/permissions/userAssetPermsEditor.component.tsx @@ -1,7 +1,6 @@ -import React from 'react' - import cx from 'classnames' import clonedeep from 'lodash.clonedeep' +import React from 'react' import { actions } from '#/actions' import assetStore from '#/assetStore' import { getSurveyFlatPaths } from '#/assetUtils' @@ -9,15 +8,14 @@ import bem from '#/bem' import AriaText from '#/components/common/ariaText' import Button from '#/components/common/button' import Checkbox from '#/components/common/checkbox' -import KoboSelect from '#/components/common/koboSelect' import type { KoboSelectOption } from '#/components/common/koboSelect' +import KoboSelect from '#/components/common/koboSelect' import TextBox from '#/components/common/textBox' import { KEY_CODES } from '#/constants' import type { AssetResponse, PermissionBase, PermissionResponse } from '#/dataInterface' import userExistence from '#/users/userExistence.store' import { ANON_USERNAME, buildUserUrl } from '#/users/utils' import { notify, recordEntries } from '#/utils' -import { CHECKBOX_DISABLED_SUFFIX, CHECKBOX_NAMES, CHECKBOX_PERM_PAIRS } from './permConstants' import type { CheckboxNameAll, CheckboxNamePartialByResponses, @@ -25,12 +23,13 @@ import type { PartialByUsersListName, PermissionCodename, } from './permConstants' -import { type PermsFormData, buildFormData, parseFormData } from './permParser' +import { CHECKBOX_DISABLED_SUFFIX, CHECKBOX_NAMES, CHECKBOX_PERM_PAIRS } from './permConstants' +import { buildFormData, type PermsFormData, parseFormData } from './permParser' import type { AssignablePermsMap } from './sharingForm.component' import styles from './userAssetPermsEditor.module.scss' import { - EMPTY_EDITOR_STATE, applyValidityRules, + EMPTY_EDITOR_STATE, getFormData, isAssignable, isPartialByResponsesValid, diff --git a/jsapp/js/components/permissions/userAssetPermsEditor.tests.ts b/jsapp/js/components/permissions/userAssetPermsEditor.tests.ts index 8b1fab0470..9cb7543f6f 100644 --- a/jsapp/js/components/permissions/userAssetPermsEditor.tests.ts +++ b/jsapp/js/components/permissions/userAssetPermsEditor.tests.ts @@ -3,8 +3,8 @@ import permConfig from './permConfig' import { endpoints } from './permParser.mocks' import type { AssignablePermsMap } from './sharingForm.component' import { - EMPTY_EDITOR_STATE, applyValidityRules, + EMPTY_EDITOR_STATE, getFormData, isPartialByResponsesValid, isPartialByUsersValid, diff --git a/jsapp/js/components/permissions/userAssetPermsEditor.utils.ts b/jsapp/js/components/permissions/userAssetPermsEditor.utils.ts index d3027cf075..faf17c7f18 100644 --- a/jsapp/js/components/permissions/userAssetPermsEditor.utils.ts +++ b/jsapp/js/components/permissions/userAssetPermsEditor.utils.ts @@ -1,6 +1,12 @@ import clonedeep from 'lodash.clonedeep' import { recordEntries } from '#/utils' import permConfig from './permConfig' +import type { + CheckboxNameAll, + CheckboxNamePartialByResponses, + CheckboxNamePartialByUsers, + PermissionCodename, +} from './permConstants' import { CHECKBOX_DISABLED_SUFFIX, CHECKBOX_NAMES, @@ -9,12 +15,6 @@ import { PARTIAL_BY_USERS_PERM_PAIRS, PARTIAL_IMPLIED_CHECKBOX_PAIRS, } from './permConstants' -import type { - CheckboxNameAll, - CheckboxNamePartialByResponses, - CheckboxNamePartialByUsers, - PermissionCodename, -} from './permConstants' import type { PermsFormDataPartialWithUsername } from './permParser' import type { AssignablePermsMap } from './sharingForm.component' import type { UserAssetPermsEditorState } from './userAssetPermsEditor.component' diff --git a/jsapp/js/components/permissions/userPermissionRow.component.tsx b/jsapp/js/components/permissions/userPermissionRow.component.tsx index 8b62f80011..3b9ffd135c 100644 --- a/jsapp/js/components/permissions/userPermissionRow.component.tsx +++ b/jsapp/js/components/permissions/userPermissionRow.component.tsx @@ -1,6 +1,5 @@ -import React from 'react' - import alertify from 'alertifyjs' +import React from 'react' import { actions } from '#/actions' import assetStore from '#/assetStore' import bem from '#/bem' diff --git a/jsapp/js/components/processing/analysis/analysisHeader.component.tsx b/jsapp/js/components/processing/analysis/analysisHeader.component.tsx index 871a268af5..f7e3944ec3 100644 --- a/jsapp/js/components/processing/analysis/analysisHeader.component.tsx +++ b/jsapp/js/components/processing/analysis/analysisHeader.component.tsx @@ -1,14 +1,13 @@ -import React, { useContext } from 'react' - import classNames from 'classnames' +import React, { useContext } from 'react' import Button from '#/components/common/button' import Icon from '#/components/common/icon' import KoboDropdown from '#/components/common/koboDropdown' import singleProcessingStore from '#/components/processing/singleProcessingStore' import styles from './analysisHeader.module.scss' import AnalysisQuestionsContext from './analysisQuestions.context' -import { ANALYSIS_QUESTION_TYPES } from './constants' import type { AnalysisQuestionTypeDefinition } from './constants' +import { ANALYSIS_QUESTION_TYPES } from './constants' import { hasManagePermissionsToCurrentAsset } from './utils' /** diff --git a/jsapp/js/components/processing/analysis/analysisTab.component.tsx b/jsapp/js/components/processing/analysis/analysisTab.component.tsx index 9abdd78d95..c8d9d06651 100644 --- a/jsapp/js/components/processing/analysis/analysisTab.component.tsx +++ b/jsapp/js/components/processing/analysis/analysisTab.component.tsx @@ -1,6 +1,5 @@ -import React, { useMemo, useReducer, useState, useEffect } from 'react' - import classNames from 'classnames' +import React, { useEffect, useMemo, useReducer, useState } from 'react' import { fetchGetUrl, handleApiFail } from '#/api' import { getAssetAdvancedFeatures, getAssetSubmissionProcessingUrl } from '#/assetUtils' import InlineMessage from '#/components/common/inlineMessage' diff --git a/jsapp/js/components/processing/analysis/editors/analysisQuestionEditor.component.tsx b/jsapp/js/components/processing/analysis/editors/analysisQuestionEditor.component.tsx index 6a38474228..1e82a4e897 100644 --- a/jsapp/js/components/processing/analysis/editors/analysisQuestionEditor.component.tsx +++ b/jsapp/js/components/processing/analysis/editors/analysisQuestionEditor.component.tsx @@ -1,14 +1,13 @@ -import React, { useState, useContext } from 'react' - import clonedeep from 'lodash.clonedeep' +import React, { useContext, useState } from 'react' import { handleApiFail } from '#/api' import Button from '#/components/common/button' import Icon from '#/components/common/icon' import TextBox from '#/components/common/textBox' import { findQuestion, - getQuestionTypeDefinition, getQuestionsFromSchema, + getQuestionTypeDefinition, updateSurveyQuestions, } from '#/components/processing/analysis/utils' import singleProcessingStore from '#/components/processing/singleProcessingStore' diff --git a/jsapp/js/components/processing/analysis/list/analysisQuestionRow.component.tsx b/jsapp/js/components/processing/analysis/list/analysisQuestionRow.component.tsx index bff4dd5b9b..2ca62584ce 100644 --- a/jsapp/js/components/processing/analysis/list/analysisQuestionRow.component.tsx +++ b/jsapp/js/components/processing/analysis/list/analysisQuestionRow.component.tsx @@ -1,7 +1,6 @@ -import React, { useCallback, useContext, useRef } from 'react' - import classnames from 'classnames' import type { Identifier, XYCoord } from 'dnd-core' +import React, { useCallback, useContext, useRef } from 'react' import { useDrag, useDrop } from 'react-dnd' import { handleApiFail } from '#/api' import assetStore from '#/assetStore' diff --git a/jsapp/js/components/processing/analysis/responseForms/commonHeader.component.tsx b/jsapp/js/components/processing/analysis/responseForms/commonHeader.component.tsx index 6af976dd54..685d06419f 100644 --- a/jsapp/js/components/processing/analysis/responseForms/commonHeader.component.tsx +++ b/jsapp/js/components/processing/analysis/responseForms/commonHeader.component.tsx @@ -1,6 +1,5 @@ -import React, { useState, useContext } from 'react' - import clonedeep from 'lodash.clonedeep' +import React, { useContext, useState } from 'react' import { handleApiFail } from '#/api' import Button from '#/components/common/button' import Icon from '#/components/common/icon' @@ -8,8 +7,8 @@ import KoboPrompt from '#/components/modals/koboPrompt' import AnalysisQuestionsContext from '#/components/processing/analysis/analysisQuestions.context' import { findQuestion, - getQuestionTypeDefinition, getQuestionsFromSchema, + getQuestionTypeDefinition, hasManagePermissionsToCurrentAsset, updateSurveyQuestions, } from '#/components/processing/analysis/utils' diff --git a/jsapp/js/components/processing/analysis/responseForms/selectOneResponseForm.component.tsx b/jsapp/js/components/processing/analysis/responseForms/selectOneResponseForm.component.tsx index a3b7cfa30c..0add5b59b7 100644 --- a/jsapp/js/components/processing/analysis/responseForms/selectOneResponseForm.component.tsx +++ b/jsapp/js/components/processing/analysis/responseForms/selectOneResponseForm.component.tsx @@ -1,8 +1,7 @@ -import React, { useContext, useState } from 'react' - import classNames from 'classnames' -import Radio from '#/components/common/radio' +import React, { useContext, useState } from 'react' import type { RadioOption } from '#/components/common/radio' +import Radio from '#/components/common/radio' import AnalysisQuestionsContext from '#/components/processing/analysis/analysisQuestions.context' import { findQuestion, diff --git a/jsapp/js/components/processing/analysis/responseForms/tagsResponseForm.component.tsx b/jsapp/js/components/processing/analysis/responseForms/tagsResponseForm.component.tsx index afe9f80bfb..10578c6f73 100644 --- a/jsapp/js/components/processing/analysis/responseForms/tagsResponseForm.component.tsx +++ b/jsapp/js/components/processing/analysis/responseForms/tagsResponseForm.component.tsx @@ -1,6 +1,5 @@ -import React, { useContext, useState } from 'react' - import { TagsInput } from '@mantine/core' +import React, { useContext, useState } from 'react' // We don't use `KoboTagsInput` here, because we don't want the tags splitting // feature it has built in. It's easier for us to use `TagsInput` directly. import AnalysisQuestionsContext from '#/components/processing/analysis/analysisQuestions.context' diff --git a/jsapp/js/components/processing/routes.tsx b/jsapp/js/components/processing/routes.tsx index b88ae7bcfc..0dc85d6ff1 100644 --- a/jsapp/js/components/processing/routes.tsx +++ b/jsapp/js/components/processing/routes.tsx @@ -1,6 +1,6 @@ import React from 'react' -import { Navigate, Route, generatePath, useParams } from 'react-router-dom' +import { generatePath, Navigate, Route, useParams } from 'react-router-dom' import { PERMISSIONS_CODENAMES } from '#/components/permissions/permConstants' import SingleProcessingRoute from '#/components/processing/singleProcessingRoute' import PermProtectedRoute from '#/router/permProtectedRoute' diff --git a/jsapp/js/components/processing/routes.utils.tests.ts b/jsapp/js/components/processing/routes.utils.tests.ts index 3f6549ddf3..b08743985d 100644 --- a/jsapp/js/components/processing/routes.utils.tests.ts +++ b/jsapp/js/components/processing/routes.utils.tests.ts @@ -1,5 +1,5 @@ import chai from 'chai' -import { ProcessingTab, getProcessingRouteParts, isAnyProcessingRoute } from './routes.utils' +import { getProcessingRouteParts, isAnyProcessingRoute, ProcessingTab } from './routes.utils' describe('processing routes.utils tests', () => { describe('getProcessingRouteParts', () => { diff --git a/jsapp/js/components/processing/routes.utils.ts b/jsapp/js/components/processing/routes.utils.ts index 7345ec1ce9..c6f0b1d394 100644 --- a/jsapp/js/components/processing/routes.utils.ts +++ b/jsapp/js/components/processing/routes.utils.ts @@ -3,7 +3,7 @@ import { generatePath, matchPath } from 'react-router-dom' import { router } from '#/router/legacy' -import { PROCESSING_ROUTES, PROCESSING_ROUTE_GENERIC, ROUTES } from '#/router/routerConstants' +import { PROCESSING_ROUTE_GENERIC, PROCESSING_ROUTES, ROUTES } from '#/router/routerConstants' import { getCurrentPath } from '#/router/routerUtils' import { recordValues } from '#/utils' diff --git a/jsapp/js/components/processing/sidebar/sidebarDisplaySettings.tsx b/jsapp/js/components/processing/sidebar/sidebarDisplaySettings.tsx index 617cc687c5..e28361d0be 100644 --- a/jsapp/js/components/processing/sidebar/sidebarDisplaySettings.tsx +++ b/jsapp/js/components/processing/sidebar/sidebarDisplaySettings.tsx @@ -1,10 +1,9 @@ -import React, { useState, useEffect } from 'react' - import cx from 'classnames' +import React, { useEffect, useState } from 'react' import Button from '#/components/common/button' import KoboSelect from '#/components/common/koboSelect' -import MultiCheckbox from '#/components/common/multiCheckbox' import type { MultiCheckboxItem } from '#/components/common/multiCheckbox' +import MultiCheckbox from '#/components/common/multiCheckbox' import ToggleSwitch from '#/components/common/toggleSwitch' import type { LanguageCode } from '#/components/languages/languagesStore' import { AsyncLanguageDisplayLabel } from '#/components/languages/languagesUtils' @@ -13,8 +12,8 @@ import KoboModalContent from '#/components/modals/koboModalContent' import KoboModalFooter from '#/components/modals/koboModalFooter' import KoboModalHeader from '#/components/modals/koboModalHeader' import { getActiveTab } from '#/components/processing/routes.utils' -import singleProcessingStore, { StaticDisplays } from '#/components/processing/singleProcessingStore' import type { DisplaysList } from '#/components/processing/singleProcessingStore' +import singleProcessingStore, { StaticDisplays } from '#/components/processing/singleProcessingStore' import styles from './sidebarDisplaySettings.module.scss' export default function SidebarDisplaySettings() { diff --git a/jsapp/js/components/processing/sidebar/sidebarSubmissionMedia.tsx b/jsapp/js/components/processing/sidebar/sidebarSubmissionMedia.tsx index 7571574bc8..e81ef346bd 100644 --- a/jsapp/js/components/processing/sidebar/sidebarSubmissionMedia.tsx +++ b/jsapp/js/components/processing/sidebar/sidebarSubmissionMedia.tsx @@ -1,6 +1,5 @@ -import React, { useState } from 'react' - import cx from 'classnames' +import React, { useState } from 'react' import AttachmentActionsDropdown from '#/attachments/AttachmentActionsDropdown' import DeletedAttachment from '#/attachments/deletedAttachment.component' import AudioPlayer from '#/components/common/audioPlayer' diff --git a/jsapp/js/components/processing/singleProcessingContent.tsx b/jsapp/js/components/processing/singleProcessingContent.tsx index fd9a83dc34..12b6675da8 100644 --- a/jsapp/js/components/processing/singleProcessingContent.tsx +++ b/jsapp/js/components/processing/singleProcessingContent.tsx @@ -1,6 +1,5 @@ -import React from 'react' - import classNames from 'classnames' +import React from 'react' import AnalysisTab from '#/components/processing/analysis/analysisTab.component' import { goToTabRoute, isProcessingRouteActive } from '#/components/processing/routes.utils' import singleProcessingStore from '#/components/processing/singleProcessingStore' diff --git a/jsapp/js/components/processing/singleProcessingHeader.tsx b/jsapp/js/components/processing/singleProcessingHeader.tsx index 25d846026e..dc1fc15ca9 100644 --- a/jsapp/js/components/processing/singleProcessingHeader.tsx +++ b/jsapp/js/components/processing/singleProcessingHeader.tsx @@ -1,17 +1,16 @@ -import React from 'react' - import classNames from 'classnames' +import React from 'react' import { actions } from '#/actions' import { findRowByXpath, getLanguageIndex, getRowName, getRowTypeIcon, getTranslatedRowLabel } from '#/assetUtils' import Button from '#/components/common/button' -import KoboSelect from '#/components/common/koboSelect' import type { KoboSelectOption } from '#/components/common/koboSelect' +import KoboSelect from '#/components/common/koboSelect' import { goToProcessing } from '#/components/processing/routes.utils' import singleProcessingStore from '#/components/processing/singleProcessingStore' import { QUESTION_TYPES } from '#/constants' import type { AssetResponse } from '#/dataInterface' -import { withRouter } from '#/router/legacy' import type { WithRouterProps } from '#/router/legacy' +import { withRouter } from '#/router/legacy' import { ROUTES } from '#/router/routerConstants' import { recordKeys } from '#/utils' import styles from './singleProcessingHeader.module.scss' diff --git a/jsapp/js/components/processing/singleProcessingStore.ts b/jsapp/js/components/processing/singleProcessingStore.ts index 9d9299252e..7f8d033c63 100644 --- a/jsapp/js/components/processing/singleProcessingStore.ts +++ b/jsapp/js/components/processing/singleProcessingStore.ts @@ -4,6 +4,7 @@ import Reflux from 'reflux' import { actions } from '#/actions' import { destroyConfirm } from '#/alertify' import assetStore from '#/assetStore' +import type { SurveyFlatPaths } from '#/assetUtils' import { findRowByXpath, getAssetAdvancedFeatures, @@ -15,17 +16,16 @@ import { getSurveyFlatPaths, isAssetProcessingActivated, } from '#/assetUtils' -import type { SurveyFlatPaths } from '#/assetUtils' import type { KoboSelectOption } from '#/components/common/koboSelect' import type { LanguageCode } from '#/components/languages/languagesStore' -import processingActions from '#/components/processing/processingActions' import type { ProcessingDataResponse } from '#/components/processing/processingActions' +import processingActions from '#/components/processing/processingActions' import { - ProcessingTab, getCurrentProcessingRouteParts, getProcessingRouteParts, isAnyProcessingRoute, isAnyProcessingRouteActive, + ProcessingTab, } from '#/components/processing/routes.utils' import { type AnyRowTypeName, QUESTION_TYPES, XML_VALUES_OPTION_VALUE } from '#/constants' import type { AssetResponse, FailResponse, GetProcessingSubmissionsResponse, SubmissionResponse } from '#/dataInterface' diff --git a/jsapp/js/components/processing/transcript/stepBegin.component.tsx b/jsapp/js/components/processing/transcript/stepBegin.component.tsx index 542343d645..5cf43f1e86 100644 --- a/jsapp/js/components/processing/transcript/stepBegin.component.tsx +++ b/jsapp/js/components/processing/transcript/stepBegin.component.tsx @@ -1,6 +1,5 @@ -import React from 'react' - import cx from 'classnames' +import React from 'react' import Button from '#/components/common/button' import bodyStyles from '#/components/processing/processingBody.module.scss' import singleProcessingStore from '#/components/processing/singleProcessingStore' diff --git a/jsapp/js/components/processing/transcript/stepConfig.component.tsx b/jsapp/js/components/processing/transcript/stepConfig.component.tsx index 2bbf83590a..e707316a36 100644 --- a/jsapp/js/components/processing/transcript/stepConfig.component.tsx +++ b/jsapp/js/components/processing/transcript/stepConfig.component.tsx @@ -1,7 +1,6 @@ -import React, { useMemo, useState } from 'react' - import cx from 'classnames' import clonedeep from 'lodash.clonedeep' +import React, { useMemo, useState } from 'react' import { UsageLimitTypes } from '#/account/stripe.types' import { useBillingPeriod } from '#/account/usage/useBillingPeriod' import { diff --git a/jsapp/js/components/processing/transcript/stepConfigAuto.component.tsx b/jsapp/js/components/processing/transcript/stepConfigAuto.component.tsx index 5fe99d1f08..35f635e943 100644 --- a/jsapp/js/components/processing/transcript/stepConfigAuto.component.tsx +++ b/jsapp/js/components/processing/transcript/stepConfigAuto.component.tsx @@ -1,7 +1,6 @@ -import React, { useState, useEffect } from 'react' - import cx from 'classnames' import clonedeep from 'lodash.clonedeep' +import React, { useEffect, useState } from 'react' import Button from '#/components/common/button' import LoadingSpinner from '#/components/common/loadingSpinner' import type { LanguageCode } from '#/components/languages/languagesStore' diff --git a/jsapp/js/components/processing/transcript/stepEditor.component.tsx b/jsapp/js/components/processing/transcript/stepEditor.component.tsx index 54084d4186..c54690e086 100644 --- a/jsapp/js/components/processing/transcript/stepEditor.component.tsx +++ b/jsapp/js/components/processing/transcript/stepEditor.component.tsx @@ -1,6 +1,5 @@ -import React from 'react' - import clonedeep from 'lodash.clonedeep' +import React from 'react' import Button from '#/components/common/button' import bodyStyles from '#/components/processing/processingBody.module.scss' import singleProcessingStore from '#/components/processing/singleProcessingStore' diff --git a/jsapp/js/components/processing/translations/stepBegin.component.tsx b/jsapp/js/components/processing/translations/stepBegin.component.tsx index f3a0d9f1a1..fc3a3ee272 100644 --- a/jsapp/js/components/processing/translations/stepBegin.component.tsx +++ b/jsapp/js/components/processing/translations/stepBegin.component.tsx @@ -1,6 +1,5 @@ -import React from 'react' - import cx from 'classnames' +import React from 'react' import Button from '#/components/common/button' import bodyStyles from '#/components/processing/processingBody.module.scss' import singleProcessingStore from '#/components/processing/singleProcessingStore' diff --git a/jsapp/js/components/processing/translations/stepConfig.component.tsx b/jsapp/js/components/processing/translations/stepConfig.component.tsx index 3ac57055a4..888fb60679 100644 --- a/jsapp/js/components/processing/translations/stepConfig.component.tsx +++ b/jsapp/js/components/processing/translations/stepConfig.component.tsx @@ -1,7 +1,6 @@ -import React, { useMemo, useState } from 'react' - import cx from 'classnames' import clonedeep from 'lodash.clonedeep' +import React, { useMemo, useState } from 'react' import { UsageLimitTypes } from '#/account/stripe.types' import { useBillingPeriod } from '#/account/usage/useBillingPeriod' import { diff --git a/jsapp/js/components/processing/translations/stepConfigAuto.component.tsx b/jsapp/js/components/processing/translations/stepConfigAuto.component.tsx index 6ec79e6acf..5f78c2e2a7 100644 --- a/jsapp/js/components/processing/translations/stepConfigAuto.component.tsx +++ b/jsapp/js/components/processing/translations/stepConfigAuto.component.tsx @@ -1,7 +1,6 @@ -import React from 'react' - import cx from 'classnames' import clonedeep from 'lodash.clonedeep' +import React from 'react' import Button from '#/components/common/button' import LoadingSpinner from '#/components/common/loadingSpinner' import type { LanguageCode } from '#/components/languages/languagesStore' diff --git a/jsapp/js/components/processing/translations/stepEditor.component.tsx b/jsapp/js/components/processing/translations/stepEditor.component.tsx index a7b10a350a..2101666bc2 100644 --- a/jsapp/js/components/processing/translations/stepEditor.component.tsx +++ b/jsapp/js/components/processing/translations/stepEditor.component.tsx @@ -1,6 +1,5 @@ -import React from 'react' - import clonedeep from 'lodash.clonedeep' +import React from 'react' import Button from '#/components/common/button' import type { LanguageCode } from '#/components/languages/languagesStore' import bodyStyles from '#/components/processing/processingBody.module.scss' diff --git a/jsapp/js/components/processing/transxDate.component.tsx b/jsapp/js/components/processing/transxDate.component.tsx index 6dafa63a17..80f46fd4c5 100644 --- a/jsapp/js/components/processing/transxDate.component.tsx +++ b/jsapp/js/components/processing/transxDate.component.tsx @@ -1,6 +1,5 @@ -import React from 'react' - import cx from 'classnames' +import React from 'react' import { formatTime, formatTimeDateShort } from '#/utils' import styles from './transxDate.module.scss' diff --git a/jsapp/js/components/processing/transxSelector.tsx b/jsapp/js/components/processing/transxSelector.tsx index 9f64219bd9..63be1b526c 100644 --- a/jsapp/js/components/processing/transxSelector.tsx +++ b/jsapp/js/components/processing/transxSelector.tsx @@ -1,11 +1,10 @@ -import React from 'react' - import isEqual from 'lodash.isequal' +import React from 'react' import type { ButtonSize } from '#/components/common/button' -import KoboSelect from '#/components/common/koboSelect' import type { KoboSelectOption, KoboSelectType } from '#/components/common/koboSelect' -import languagesStore from '#/components/languages/languagesStore' +import KoboSelect from '#/components/common/koboSelect' import type { LanguageCode } from '#/components/languages/languagesStore' +import languagesStore from '#/components/languages/languagesStore' import { getLanguageDisplayLabel } from '#/components/languages/languagesUtils' interface TransxSelectorProps { diff --git a/jsapp/js/components/projectDownloads/ProjectDownloads.tsx b/jsapp/js/components/projectDownloads/ProjectDownloads.tsx index 4482e68c13..2a3365897c 100644 --- a/jsapp/js/components/projectDownloads/ProjectDownloads.tsx +++ b/jsapp/js/components/projectDownloads/ProjectDownloads.tsx @@ -2,10 +2,10 @@ import React from 'react' import DocumentTitle from 'react-document-title' import bem from '#/bem' import AnonymousExports from '#/components/projectDownloads/AnonymousExports' +import exportsStore from '#/components/projectDownloads/exportsStore' import LegacyExports from '#/components/projectDownloads/LegacyExports' import ProjectExportsCreator from '#/components/projectDownloads/ProjectExportsCreator' import ProjectExportsList from '#/components/projectDownloads/ProjectExportsList' -import exportsStore from '#/components/projectDownloads/exportsStore' import type { AssetResponse } from '#/dataInterface' import sessionStore from '#/stores/session' import type { ExportTypeDefinition } from './exportsConstants' diff --git a/jsapp/js/components/projectDownloads/ProjectExportsCreator.tsx b/jsapp/js/components/projectDownloads/ProjectExportsCreator.tsx index 3cb63e04e4..d82b58e89b 100644 --- a/jsapp/js/components/projectDownloads/ProjectExportsCreator.tsx +++ b/jsapp/js/components/projectDownloads/ProjectExportsCreator.tsx @@ -1,7 +1,6 @@ -import React from 'react' - import alertify from 'alertifyjs' import cx from 'classnames' +import React from 'react' import Select from 'react-select' import { actions } from '#/actions' import { getFlatQuestionsList, getSurveyFlatPaths, injectSupplementalRowsIntoListOfRows } from '#/assetUtils' diff --git a/jsapp/js/components/projectDownloads/ProjectExportsList.tsx b/jsapp/js/components/projectDownloads/ProjectExportsList.tsx index 35f00933f3..647e8e351b 100644 --- a/jsapp/js/components/projectDownloads/ProjectExportsList.tsx +++ b/jsapp/js/components/projectDownloads/ProjectExportsList.tsx @@ -1,13 +1,12 @@ -import React from 'react' - import { Flex, Text } from '@mantine/core' import alertify from 'alertifyjs' +import React from 'react' import { actions } from '#/actions' import { getLanguageIndex } from '#/assetUtils' import bem from '#/bem' -import SimpleTable from '#/components/common/SimpleTable' import Button from '#/components/common/button' import LoadingSpinner from '#/components/common/loadingSpinner' +import SimpleTable from '#/components/common/SimpleTable' import { PERMISSIONS_CODENAMES } from '#/components/permissions/permConstants' import { userCan } from '#/components/permissions/utils' import ExportFetcher from '#/components/projectDownloads/exportFetcher' diff --git a/jsapp/js/components/projectDownloads/exportsStore.ts b/jsapp/js/components/projectDownloads/exportsStore.ts index 8737269de3..d347b85459 100644 --- a/jsapp/js/components/projectDownloads/exportsStore.ts +++ b/jsapp/js/components/projectDownloads/exportsStore.ts @@ -1,4 +1,4 @@ -import Reflux, { type StoreDefinition, type Store } from 'reflux' +import Reflux, { type Store, type StoreDefinition } from 'reflux' import { router } from '#/router/legacy' import { DEFAULT_EXPORT_SETTINGS, type ExportTypeDefinition } from './exportsConstants' diff --git a/jsapp/js/components/reports/customReportEditor.component.tsx b/jsapp/js/components/reports/customReportEditor.component.tsx index 270c8f1b7b..ab73c1d6d1 100644 --- a/jsapp/js/components/reports/customReportEditor.component.tsx +++ b/jsapp/js/components/reports/customReportEditor.component.tsx @@ -1,6 +1,5 @@ -import React from 'react' - import clonedeep from 'lodash.clonedeep' +import React from 'react' import { actions } from '#/actions' import { handleApiFail } from '#/api' import bem from '#/bem' diff --git a/jsapp/js/components/reports/reportColorsEditor.component.tsx b/jsapp/js/components/reports/reportColorsEditor.component.tsx index a3e76b71d5..570c577f28 100644 --- a/jsapp/js/components/reports/reportColorsEditor.component.tsx +++ b/jsapp/js/components/reports/reportColorsEditor.component.tsx @@ -1,8 +1,8 @@ import React from 'react' import bem from '#/bem' -import { CHART_COLOR_SETS } from './reportsConstants' import type { ChartColorSet, ReportStyle } from './reportsConstants' +import { CHART_COLOR_SETS } from './reportsConstants' interface ReportColorsEditorProps { onChange: (newColors: string[]) => void diff --git a/jsapp/js/components/reports/reportContents.component.tsx b/jsapp/js/components/reports/reportContents.component.tsx index d783b7a246..bc1b0ec174 100644 --- a/jsapp/js/components/reports/reportContents.component.tsx +++ b/jsapp/js/components/reports/reportContents.component.tsx @@ -4,10 +4,10 @@ import bem from '#/bem' import { QUESTION_TYPES } from '#/constants' import type { AssetResponse } from '#/dataInterface' import { recordKeys } from '#/utils' -import ReportViewItem from './reportViewItem.component' import type { ReportsState } from './reports' import { getReportRowTranslatedLabel } from './reports.utils' import type { ReportStyle, ReportsResponse } from './reportsConstants' +import ReportViewItem from './reportViewItem.component' interface ReportContentsProps { triggerQuestionSettings: (questionName: string) => void diff --git a/jsapp/js/components/reports/reportStyleSettings.component.tsx b/jsapp/js/components/reports/reportStyleSettings.component.tsx index 23522c8acb..94be1ffea3 100644 --- a/jsapp/js/components/reports/reportStyleSettings.component.tsx +++ b/jsapp/js/components/reports/reportStyleSettings.component.tsx @@ -1,6 +1,5 @@ -import React from 'react' - import clonedeep from 'lodash.clonedeep' +import React from 'react' import { actions } from '#/actions' import { handleApiFail } from '#/api' import bem from '#/bem' @@ -8,14 +7,14 @@ import Button from '#/components/common/button' import Modal from '#/components/common/modal' import Radio from '#/components/common/radio' import ReportsModalTabs, { - ReportsModalTabNames, DEFAULT_REPORTS_MODAL_TAB, + ReportsModalTabNames, } from '#/components/reports/reportsModalTabs.component' import type { FailResponse, LabelValuePair } from '#/dataInterface' import ReportColorsEditor from './reportColorsEditor.component' -import ReportTypeEditor from './reportTypeEditor.component' import type { ReportsState } from './reports' import type { ReportStyle, ReportStyleName } from './reportsConstants' +import ReportTypeEditor from './reportTypeEditor.component' interface ReportStyleSettingsProps { parentState: ReportsState diff --git a/jsapp/js/components/reports/reportStyleSettingsSingleQuestion.component.tsx b/jsapp/js/components/reports/reportStyleSettingsSingleQuestion.component.tsx index d309d63008..c0e418ff3d 100644 --- a/jsapp/js/components/reports/reportStyleSettingsSingleQuestion.component.tsx +++ b/jsapp/js/components/reports/reportStyleSettingsSingleQuestion.component.tsx @@ -1,21 +1,20 @@ -import React from 'react' - import clonedeep from 'lodash.clonedeep' +import React from 'react' import { actions } from '#/actions' import { handleApiFail } from '#/api' import bem from '#/bem' import Button from '#/components/common/button' import Modal from '#/components/common/modal' import ReportsModalTabs, { - ReportsModalTabNames, DEFAULT_REPORTS_MODAL_TAB, + ReportsModalTabNames, } from '#/components/reports/reportsModalTabs.component' import type { FailResponse } from '#/dataInterface' import { recordKeys } from '#/utils' import ReportColorsEditor from './reportColorsEditor.component' -import ReportTypeEditor from './reportTypeEditor.component' import type { ReportsState } from './reports' import type { ReportStyle, ReportStyleName } from './reportsConstants' +import ReportTypeEditor from './reportTypeEditor.component' interface ReportStyleSettingsSingleQuestionProps { parentState: ReportsState diff --git a/jsapp/js/components/reports/reportTable.component.tsx b/jsapp/js/components/reports/reportTable.component.tsx index fe58f6284a..55b242c9e0 100644 --- a/jsapp/js/components/reports/reportTable.component.tsx +++ b/jsapp/js/components/reports/reportTable.component.tsx @@ -1,8 +1,7 @@ -import React from 'react' - import clonedeep from 'lodash.clonedeep' -import type { PreparedTable } from './reportViewItem.component' +import React from 'react' import type { ReportsResponseData, ReportsResponseDataValues } from './reportsConstants' +import type { PreparedTable } from './reportViewItem.component' interface ReportTableProps { type: 'regular' | 'numerical' | 'disaggregated' diff --git a/jsapp/js/components/reports/reportTypeEditor.component.tsx b/jsapp/js/components/reports/reportTypeEditor.component.tsx index b2877a4d52..d524b9e986 100644 --- a/jsapp/js/components/reports/reportTypeEditor.component.tsx +++ b/jsapp/js/components/reports/reportTypeEditor.component.tsx @@ -1,9 +1,9 @@ import React from 'react' import { recordEntries } from '#/utils' -import styles from './reportTypeEditor.module.scss' -import { CHART_STYLES } from './reportsConstants' import type { ReportStyle, ReportStyleName } from './reportsConstants' +import { CHART_STYLES } from './reportsConstants' +import styles from './reportTypeEditor.module.scss' interface ReportTypeEditorProps { onChange: (newType: ReportStyleName) => void diff --git a/jsapp/js/components/reports/reportViewItem.component.tsx b/jsapp/js/components/reports/reportViewItem.component.tsx index 346e3815e1..dd2a3ae138 100644 --- a/jsapp/js/components/reports/reportViewItem.component.tsx +++ b/jsapp/js/components/reports/reportViewItem.component.tsx @@ -1,17 +1,17 @@ -import React from 'react' +import type { ChartConfiguration, ChartDataset, ChartType } from 'chart.js/auto' import Chart from 'chart.js/auto' -import type { ChartConfiguration, ChartDataset, ChartType } from 'chart.js/auto' import clonedeep from 'lodash.clonedeep' import isEqual from 'lodash.isequal' import zip from 'lodash.zip' import { observer } from 'mobx-react' +import React from 'react' import bem from '#/bem' import Button from '#/components/common/button' import sessionStore from '#/stores/session' -import ReportTable from './reportTable.component' -import { CHART_COLOR_SETS, CHART_STYLES } from './reportsConstants' import type { ReportsResponse, ReportsResponseData } from './reportsConstants' +import { CHART_COLOR_SETS, CHART_STYLES } from './reportsConstants' +import ReportTable from './reportTable.component' export type PreparedTable = Array<[string | undefined, number | undefined, number | undefined]> diff --git a/jsapp/js/components/reports/reports.tsx b/jsapp/js/components/reports/reports.tsx index 6b5878dcc1..56a2987d92 100644 --- a/jsapp/js/components/reports/reports.tsx +++ b/jsapp/js/components/reports/reports.tsx @@ -1,9 +1,8 @@ import './reports.scss' -import React from 'react' - import clonedeep from 'lodash.clonedeep' import isEqual from 'lodash.isequal' +import React from 'react' import DocumentTitle from 'react-document-title' import { actions } from '#/actions' import bem from '#/bem' @@ -14,8 +13,8 @@ import KoboSelect from '#/components/common/koboSelect' import LoadingSpinner from '#/components/common/loadingSpinner' import Modal from '#/components/common/modal' import { userCan } from '#/components/permissions/utils' -import { dataInterface } from '#/dataInterface' import type { AssetResponse, FailResponse, SurveyRow } from '#/dataInterface' +import { dataInterface } from '#/dataInterface' import type { WithRouterProps } from '#/router/legacy' import { stores } from '#/stores' import { launchPrinting, notify, txtid } from '#/utils' diff --git a/jsapp/js/components/reports/reportsModalTabs.component.tsx b/jsapp/js/components/reports/reportsModalTabs.component.tsx index 05a438b329..9db6b963e4 100644 --- a/jsapp/js/components/reports/reportsModalTabs.component.tsx +++ b/jsapp/js/components/reports/reportsModalTabs.component.tsx @@ -1,6 +1,5 @@ -import React from 'react' - import cx from 'classnames' +import React from 'react' /** These are all possible tabs. */ export enum ReportsModalTabNames { diff --git a/jsapp/js/components/submissions/SubmissionBackgroundAudio.tsx b/jsapp/js/components/submissions/SubmissionBackgroundAudio.tsx index 63fcea82e3..2e458d0d63 100644 --- a/jsapp/js/components/submissions/SubmissionBackgroundAudio.tsx +++ b/jsapp/js/components/submissions/SubmissionBackgroundAudio.tsx @@ -3,8 +3,7 @@ import AttachmentActionsDropdown from '#/attachments/AttachmentActionsDropdown' import DeletedAttachment from '#/attachments/deletedAttachment.component' import bem from '#/bem' import AudioPlayer from '#/components/common/audioPlayer' -import type { AssetResponse, SubmissionAttachment } from '#/dataInterface' -import type { SubmissionResponse } from '#/dataInterface' +import type { AssetResponse, SubmissionAttachment, SubmissionResponse } from '#/dataInterface' interface SubmissionBackgroundAudioProps { asset: AssetResponse diff --git a/jsapp/js/components/submissions/columnsHideDropdown.tsx b/jsapp/js/components/submissions/columnsHideDropdown.tsx index 49fd220382..fcff88849c 100644 --- a/jsapp/js/components/submissions/columnsHideDropdown.tsx +++ b/jsapp/js/components/submissions/columnsHideDropdown.tsx @@ -4,8 +4,8 @@ import React from 'react' import Button from '#/components/common/button' import KoboDropdown from '#/components/common/koboDropdown' -import ColumnsHideForm from '#/components/submissions/columnsHideForm' import type { ColumnsHideFormProps } from '#/components/submissions/columnsHideForm' +import ColumnsHideForm from '#/components/submissions/columnsHideForm' /** * A wrapper around KoboDropdown to be used atop table to bulk hide columns. diff --git a/jsapp/js/components/submissions/columnsHideForm.tsx b/jsapp/js/components/submissions/columnsHideForm.tsx index 22fbfd58df..7fc1694a27 100644 --- a/jsapp/js/components/submissions/columnsHideForm.tsx +++ b/jsapp/js/components/submissions/columnsHideForm.tsx @@ -1,8 +1,7 @@ import './columnsHideDropdown.scss' -import React from 'react' - import Fuse from 'fuse.js' +import React from 'react' import { actions } from '#/actions' import bem, { makeBem } from '#/bem' import Button from '#/components/common/button' diff --git a/jsapp/js/components/submissions/mediaCell.tsx b/jsapp/js/components/submissions/mediaCell.tsx index bed864e1d2..caaaca3daa 100644 --- a/jsapp/js/components/submissions/mediaCell.tsx +++ b/jsapp/js/components/submissions/mediaCell.tsx @@ -9,8 +9,8 @@ import DeletedAttachment from '#/attachments/deletedAttachment.component' import bem, { makeBem } from '#/bem' import Button from '#/components/common/button' import Icon from '#/components/common/icon' -import { MODAL_TYPES, QUESTION_TYPES } from '#/constants' import type { AnyRowTypeName } from '#/constants' +import { MODAL_TYPES, QUESTION_TYPES } from '#/constants' import type { AssetResponse, SubmissionAttachment, SubmissionResponse } from '#/dataInterface' import type { IconName } from '#/k-icons' import pageState from '#/pageState.store' diff --git a/jsapp/js/components/submissions/submissionDataList.tsx b/jsapp/js/components/submissions/submissionDataList.tsx index e17185cf87..77f33717fe 100644 --- a/jsapp/js/components/submissions/submissionDataList.tsx +++ b/jsapp/js/components/submissions/submissionDataList.tsx @@ -1,9 +1,8 @@ import './submissionDataList.scss' import React from 'react' - -import { getFlatQuestionsList, getLanguageIndex } from '#/assetUtils' import type { FlatQuestion } from '#/assetUtils' +import { getFlatQuestionsList, getLanguageIndex } from '#/assetUtils' import bem, { makeBem } from '#/bem' import { getRowData } from '#/components/submissions/submissionUtils' import type { AssetResponse, SubmissionResponse } from '#/dataInterface' diff --git a/jsapp/js/components/submissions/submissionDataTable.tsx b/jsapp/js/components/submissions/submissionDataTable.tsx index 14046c7bc3..51db0a57f1 100644 --- a/jsapp/js/components/submissions/submissionDataTable.tsx +++ b/jsapp/js/components/submissions/submissionDataTable.tsx @@ -1,16 +1,16 @@ import './submissionDataTable.scss' -import React from 'react' - import { Group } from '@mantine/core' +import React from 'react' import autoBind from 'react-autobind' import { findRow, renderQuestionTypeIcon } from '#/assetUtils' import AttachmentActionsDropdown from '#/attachments/AttachmentActionsDropdown' import DeletedAttachment from '#/attachments/deletedAttachment.component' import bem, { makeBem } from '#/bem' -import SimpleTable from '#/components/common/SimpleTable' import Button from '#/components/common/button' +import SimpleTable from '#/components/common/SimpleTable' import { goToProcessing } from '#/components/processing/routes.utils' +import type { DisplayResponse } from '#/components/submissions/submissionUtils' import { DISPLAY_GROUP_TYPES, DisplayGroup, @@ -18,9 +18,8 @@ import { getSubmissionDisplayData, shouldProcessingBeAccessible, } from '#/components/submissions/submissionUtils' -import type { DisplayResponse } from '#/components/submissions/submissionUtils' -import { META_QUESTION_TYPES, QUESTION_TYPES, RANK_LEVEL_TYPE, SCORE_ROW_TYPE } from '#/constants' import type { AnyRowTypeName, MetaQuestionTypeName } from '#/constants' +import { META_QUESTION_TYPES, QUESTION_TYPES, RANK_LEVEL_TYPE, SCORE_ROW_TYPE } from '#/constants' import type { AssetResponse, SubmissionResponse } from '#/dataInterface' import { formatDate, formatTimeDate } from '#/utils' import AudioPlayer from '../common/audioPlayer' diff --git a/jsapp/js/components/submissions/submissionModal.tsx b/jsapp/js/components/submissions/submissionModal.tsx index 2ae36db930..3562bbcf31 100644 --- a/jsapp/js/components/submissions/submissionModal.tsx +++ b/jsapp/js/components/submissions/submissionModal.tsx @@ -1,9 +1,8 @@ import './submissionModal.scss' -import React from 'react' - import alertify from 'alertifyjs' import clonedeep from 'lodash.clonedeep' +import React from 'react' import { actions } from '#/actions' import Button from '#/components/common/button' import CenteredMessage from '#/components/common/centeredMessage.component' @@ -14,14 +13,14 @@ import { userCan, userHasPermForSubmission } from '#/components/permissions/util import SubmissionDataTable from '#/components/submissions/submissionDataTable' import { getBackgroundAudioAttachment, markAttachmentAsDeleted } from '#/components/submissions/submissionUtils' import type { SubmissionPageName } from '#/components/submissions/table.types' +import type { ValidationStatusOptionName } from '#/components/submissions/validationStatus.constants' import { VALIDATION_STATUS_OPTIONS, ValidationStatusAdditionalName, } from '#/components/submissions/validationStatus.constants' -import type { ValidationStatusOptionName } from '#/components/submissions/validationStatus.constants' import { EnketoActions, MODAL_TYPES } from '#/constants' -import { dataInterface } from '#/dataInterface' import type { AssetResponse, FailResponse, SubmissionResponse, ValidationStatusResponse } from '#/dataInterface' +import { dataInterface } from '#/dataInterface' import enketoHandler from '#/enketoHandler' import pageState from '#/pageState.store' import { launchPrinting } from '#/utils' diff --git a/jsapp/js/components/submissions/submissionUtils.tests.ts b/jsapp/js/components/submissions/submissionUtils.tests.ts index fa04c3d86b..1468b716bc 100644 --- a/jsapp/js/components/submissions/submissionUtils.tests.ts +++ b/jsapp/js/components/submissions/submissionUtils.tests.ts @@ -1,3 +1,8 @@ +// getSubmissionDisplayData() returns objects that have prototype chains, while +// the simple mock objects do not. Be able to exclude __proto__ when comparing +// the two +import chai from 'chai' +import chaiExclude from 'chai-exclude' import { getMediaAttachment, getSubmissionDisplayData, @@ -34,11 +39,6 @@ import { submissionWithSupplementalDetails, } from './submissionUtils.mocks' -// getSubmissionDisplayData() returns objects that have prototype chains, while -// the simple mock objects do not. Be able to exclude __proto__ when comparing -// the two -import chai from 'chai' -import chaiExclude from 'chai-exclude' chai.use(chaiExclude) // getSubmissionDisplayData might return objects with declared, undefined key: @@ -49,6 +49,7 @@ chai.use(chaiExclude) // fail. Hence, use this looser comparison function. import chaiDeepEqualIgnoreUndefined from 'chai-deep-equal-ignore-undefined' import type { SubmissionSupplementalDetails } from '#/dataInterface' + chai.use(chaiDeepEqualIgnoreUndefined) describe('getSubmissionDisplayData', () => { diff --git a/jsapp/js/components/submissions/submissionUtils.tsx b/jsapp/js/components/submissions/submissionUtils.tsx index abdc47420e..f3214d2ea2 100644 --- a/jsapp/js/components/submissions/submissionUtils.tsx +++ b/jsapp/js/components/submissions/submissionUtils.tsx @@ -5,19 +5,18 @@ import DeletedAttachment from '#/attachments/deletedAttachment.component' import type { SubmissionAnalysisResponse } from '#/components/processing/analysis/constants' import { QUAL_NOTE_TYPE } from '#/components/processing/analysis/constants' import { getSupplementalPathParts } from '#/components/processing/processingUtils' -import { getColumnLabel } from '#/components/submissions/tableUtils' -import { getBackgroundAudioQuestionName } from '#/components/submissions/tableUtils' +import { getBackgroundAudioQuestionName, getColumnLabel } from '#/components/submissions/tableUtils' +import type { AnyRowTypeName, QuestionTypeName } from '#/constants' import { CHOICE_LISTS, + createEnum, GROUP_TYPES_BEGIN, MATRIX_PAIR_PROPS, QUESTION_TYPES, RANK_LEVEL_TYPE, SCORE_ROW_TYPE, SUPPLEMENTAL_DETAILS_PROP, - createEnum, } from '#/constants' -import type { AnyRowTypeName, QuestionTypeName } from '#/constants' import type { AnalysisFormJsonField, AssetResponse, diff --git a/jsapp/js/components/submissions/table.tsx b/jsapp/js/components/submissions/table.tsx index 08ec06f8cf..7310b7d0e8 100644 --- a/jsapp/js/components/submissions/table.tsx +++ b/jsapp/js/components/submissions/table.tsx @@ -1,13 +1,12 @@ import './table.scss' -import React from 'react' - import clonedeep from 'lodash.clonedeep' import isEqual from 'lodash.isequal' +import React from 'react' import { DebounceInput } from 'react-debounce-input' import Markdown from 'react-markdown' -import ReactTable from 'react-table' import type { CellInfo } from 'react-table' +import ReactTable from 'react-table' import { actions } from '#/actions' import { handleApiFail } from '#/api' import type { SurveyFlatPaths } from '#/assetUtils' @@ -36,13 +35,13 @@ import { DATA_TABLE_SETTING, DATA_TABLE_SETTINGS, DEFAULT_DATA_CELL_WIDTH, - SUBMISSION_ACTIONS_ID, SortValues, + SUBMISSION_ACTIONS_ID, TABLE_MEDIA_TYPES, VALIDATION_STATUS_ID_PROP, } from '#/components/submissions/tableConstants' -import tableStore from '#/components/submissions/tableStore' import type { TableStoreData } from '#/components/submissions/tableStore' +import tableStore from '#/components/submissions/tableStore' import { buildFilterQuery, getBackgroundAudioQuestionName, @@ -63,6 +62,7 @@ import { ValidationStatusAdditionalName, } from '#/components/submissions/validationStatus.constants' import ValidationStatusDropdown from '#/components/submissions/validationStatusDropdown' +import type { AnyRowTypeName } from '#/constants' import { ADDITIONAL_SUBMISSION_PROPS, EnketoActions, @@ -72,7 +72,6 @@ import { QUESTION_TYPES, SUPPLEMENTAL_DETAILS_PROP, } from '#/constants' -import type { AnyRowTypeName } from '#/constants' import type { AssetResponse, AssetTableSettings, @@ -87,15 +86,15 @@ import type { } from '#/dataInterface' import enketoHandler from '#/enketoHandler' import envStore from '#/envStore' -import pageState from '#/pageState.store' import type { PageStateStoreState } from '#/pageState.store' +import pageState from '#/pageState.store' import { stores } from '#/stores' import { formatTimeDateShort, recordKeys } from '#/utils' import ActionIcon from '../common/ActionIcon' import LimitNotifications from '../usageLimits/limitNotifications.component' -import RepeatGroupCell from './RepeatGroupCell' import AudioCell from './audioCell' import MediaCell from './mediaCell' +import RepeatGroupCell from './RepeatGroupCell' const DEFAULT_PAGE_SIZE = 30 diff --git a/jsapp/js/components/submissions/tableBulkOptions.tsx b/jsapp/js/components/submissions/tableBulkOptions.tsx index 29f49f3b71..fee79edc60 100644 --- a/jsapp/js/components/submissions/tableBulkOptions.tsx +++ b/jsapp/js/components/submissions/tableBulkOptions.tsx @@ -1,6 +1,5 @@ -import React from 'react' - import alertify from 'alertifyjs' +import React from 'react' import { actions } from '#/actions' import BulkDeleteMediaFiles from '#/attachments/BulkDeleteMediaFiles' import bem from '#/bem' @@ -10,14 +9,14 @@ import Icon from '#/components/common/icon' import { PERMISSIONS_CODENAMES } from '#/components/permissions/permConstants' import { userCan, userCanPartially } from '#/components/permissions/utils' import type { DataTableSelectedRows, ReactTableStateFilteredItem } from '#/components/submissions/table.types' -import { - VALIDATION_STATUS_OPTIONS, - ValidationStatusAdditionalName, -} from '#/components/submissions/validationStatus.constants' import type { ValidationStatusName, ValidationStatusOptionName, } from '#/components/submissions/validationStatus.constants' +import { + VALIDATION_STATUS_OPTIONS, + ValidationStatusAdditionalName, +} from '#/components/submissions/validationStatus.constants' import { MODAL_TYPES } from '#/constants' import type { AssetResponse, BulkSubmissionsRequest, SubmissionResponse } from '#/dataInterface' import pageState from '#/pageState.store' diff --git a/jsapp/js/components/submissions/tableColumnSortDropdown.tsx b/jsapp/js/components/submissions/tableColumnSortDropdown.tsx index 9e31e23d9c..2c62b43631 100644 --- a/jsapp/js/components/submissions/tableColumnSortDropdown.tsx +++ b/jsapp/js/components/submissions/tableColumnSortDropdown.tsx @@ -1,8 +1,7 @@ import './tableColumnSortDropdown.scss' -import React from 'react' - import classNames from 'classnames' +import React from 'react' import KoboDropdown from '#/components/common/koboDropdown' import { PERMISSIONS_CODENAMES } from '#/components/permissions/permConstants' import { userCan } from '#/components/permissions/utils' diff --git a/jsapp/js/components/submissions/tableConstants.ts b/jsapp/js/components/submissions/tableConstants.ts index 684eb0a2a0..80f255d140 100644 --- a/jsapp/js/components/submissions/tableConstants.ts +++ b/jsapp/js/components/submissions/tableConstants.ts @@ -1,11 +1,11 @@ +import type { AnyRowTypeName } from '#/constants' import { ADDITIONAL_SUBMISSION_PROPS, + createEnum, META_QUESTION_TYPES, MiscRowTypeName, QuestionTypeName, - createEnum, } from '#/constants' -import type { AnyRowTypeName } from '#/constants' export const SUBMISSION_ACTIONS_ID = '__SubmissionActions' diff --git a/jsapp/js/components/submissions/tableStore.ts b/jsapp/js/components/submissions/tableStore.ts index e5392f0518..129d63be02 100644 --- a/jsapp/js/components/submissions/tableStore.ts +++ b/jsapp/js/components/submissions/tableStore.ts @@ -4,13 +4,13 @@ import { actions } from '#/actions' import assetStore from '#/assetStore' import { PERMISSIONS_CODENAMES } from '#/components/permissions/permConstants' import { userCan } from '#/components/permissions/utils' +import type { SortValues } from '#/components/submissions/tableConstants' import { DATA_TABLE_SETTING, DATA_TABLE_SETTINGS, SUBMISSION_ACTIONS_ID, VALIDATION_STATUS_ID_PROP, } from '#/components/submissions/tableConstants' -import type { SortValues } from '#/components/submissions/tableConstants' import { getAllDataColumns } from '#/components/submissions/tableUtils' import type { AssetSettings, AssetTableSettings, SubmissionResponse, TableSortBySetting } from '#/dataInterface' import { getRouteAssetUid } from '#/router/routerUtils' diff --git a/jsapp/js/components/submissions/tableUtils.ts b/jsapp/js/components/submissions/tableUtils.ts index 357c95c094..c729f8651e 100644 --- a/jsapp/js/components/submissions/tableUtils.ts +++ b/jsapp/js/components/submissions/tableUtils.ts @@ -11,6 +11,7 @@ import { VALIDATION_STATUS_ID_PROP, } from '#/components/submissions/tableConstants' import { ValidationStatusAdditionalName } from '#/components/submissions/validationStatus.constants' +import type { AnyRowTypeName } from '#/constants' import { GROUP_TYPES_BEGIN, GROUP_TYPES_END, @@ -18,7 +19,6 @@ import { QUESTION_TYPES, SUPPLEMENTAL_DETAILS_PROP, } from '#/constants' -import type { AnyRowTypeName } from '#/constants' import type { AssetResponse, SubmissionResponse, SurveyRow } from '#/dataInterface' import { recordKeys, recordValues } from '#/utils' diff --git a/jsapp/js/components/submissions/validationStatusDropdown.tsx b/jsapp/js/components/submissions/validationStatusDropdown.tsx index 6868261704..111b4379db 100644 --- a/jsapp/js/components/submissions/validationStatusDropdown.tsx +++ b/jsapp/js/components/submissions/validationStatusDropdown.tsx @@ -2,17 +2,17 @@ import './validationStatusDropdown.scss' import React from 'react' -import Select, { components, type OptionProps, type SingleValueProps, type DropdownIndicatorProps } from 'react-select' +import Select, { components, type DropdownIndicatorProps, type OptionProps, type SingleValueProps } from 'react-select' import bem from '#/bem' +import type { + ValidationStatusOption, + ValidationStatusOptionName, +} from '#/components/submissions/validationStatus.constants' import { VALIDATION_STATUS_OPTIONS, VALIDATION_STATUS_OPTIONS_WITH_SHOW_ALL, ValidationStatusAdditionalName, } from '#/components/submissions/validationStatus.constants' -import type { - ValidationStatusOption, - ValidationStatusOptionName, -} from '#/components/submissions/validationStatus.constants' interface ValidationStatusDropdownProps { /** Calls back with `value`, not option object */ diff --git a/jsapp/js/components/support/helpBubble.tsx b/jsapp/js/components/support/helpBubble.tsx index c7784a015a..3571ea9547 100644 --- a/jsapp/js/components/support/helpBubble.tsx +++ b/jsapp/js/components/support/helpBubble.tsx @@ -1,8 +1,7 @@ import './helpBubble.scss' -import React from 'react' - import { observer } from 'mobx-react' +import React from 'react' import bem, { makeBem } from '#/bem' import Icon from '#/components/common/icon' import { KEY_CODES } from '#/constants' diff --git a/jsapp/js/dataInterface.ts b/jsapp/js/dataInterface.ts index 89453ee98b..e05aa14620 100644 --- a/jsapp/js/dataInterface.ts +++ b/jsapp/js/dataInterface.ts @@ -20,7 +20,6 @@ import type { AnyRowTypeName, AssetFileType, AssetTypeName } from '#/constants' import type { UserResponse } from '#/users/userExistence.store' import type { AccountFieldsValues } from './account/account.constants' import { endpoints } from './api.endpoints' -import type { HookAuthLevelName, HookExportTypeName } from './components/RESTServices/RESTServicesForm' import type { Json } from './components/common/common.interfaces' import type { AnalysisQuestionSchema, @@ -34,6 +33,7 @@ import type { ExportStatusName, ExportTypeName, } from './components/projectDownloads/exportsConstants' +import type { HookAuthLevelName, HookExportTypeName } from './components/RESTServices/RESTServicesForm' import { COMMON_QUERIES, ROOT_URL } from './constants' import type { ProjectViewsSettings } from './projects/customViewStore' import { type LangString, recordEntries } from './utils' @@ -1149,13 +1149,7 @@ export const dataInterface: DataInterface = { }) }, - getCollections( - params: { - owner?: string - pageSize?: number - page?: number - } = {}, - ): JQuery.jqXHR { + getCollections(params: { owner?: string; pageSize?: number; page?: number } = {}): JQuery.jqXHR { let q = COMMON_QUERIES.c if (params.owner) { q += ` AND owner__username__exact:${params.owner}` @@ -1792,10 +1786,7 @@ export const dataInterface: DataInterface = { }) }, - setDeploymentActive(params: { - asset: AssetResponse - active: boolean - }): JQuery.jqXHR { + setDeploymentActive(params: { asset: AssetResponse; active: boolean }): JQuery.jqXHR { return $ajax({ method: 'PATCH', url: `${params.asset.url}deployment/`, diff --git a/jsapp/js/editorMixins/cascadeMixin.js b/jsapp/js/editorMixins/cascadeMixin.js index 5e9ebd633e..377a59493e 100644 --- a/jsapp/js/editorMixins/cascadeMixin.js +++ b/jsapp/js/editorMixins/cascadeMixin.js @@ -1,9 +1,8 @@ // TODO: this shouldn't be a mixin (wtf) // See: https://github.com/kobotoolbox/kpi/issues/3923 -import React from 'react' - import last from 'lodash.last' +import React from 'react' import ReactDOM from 'react-dom' import bem, { makeBem } from '#/bem' import Button from '#/components/common/button' diff --git a/jsapp/js/editorMixins/editableForm.js b/jsapp/js/editorMixins/editableForm.js index 8eeedf9551..a4cff02e70 100644 --- a/jsapp/js/editorMixins/editableForm.js +++ b/jsapp/js/editorMixins/editableForm.js @@ -1,10 +1,9 @@ -import React from 'react' - import { Text } from '@mantine/core' import alertify from 'alertifyjs' import cx from 'classnames' import clonedeep from 'lodash.clonedeep' import debounce from 'lodash.debounce' +import React from 'react' import DocumentTitle from 'react-document-title' import ReactDOM from 'react-dom' import Markdown from 'react-markdown' diff --git a/jsapp/js/endpoints/assetHistory.mocks.ts b/jsapp/js/endpoints/assetHistory.mocks.ts index d216a07407..713b9d2719 100644 --- a/jsapp/js/endpoints/assetHistory.mocks.ts +++ b/jsapp/js/endpoints/assetHistory.mocks.ts @@ -1,4 +1,4 @@ -import { http, HttpResponse, type PathParams } from 'msw' +import { HttpResponse, http, type PathParams } from 'msw' import { endpoints } from '#/api.endpoints' import { type ActivityLogsItem, AuditActions, AuditSubTypes } from '#/components/activity/activity.constants' import type { PaginatedResponse } from '#/dataInterface' diff --git a/jsapp/js/endpoints/assetHistoryActions.mocks.ts b/jsapp/js/endpoints/assetHistoryActions.mocks.ts index 3206112dc0..7ffb6651f2 100644 --- a/jsapp/js/endpoints/assetHistoryActions.mocks.ts +++ b/jsapp/js/endpoints/assetHistoryActions.mocks.ts @@ -1,4 +1,4 @@ -import { http, HttpResponse, type PathParams } from 'msw' +import { HttpResponse, http, type PathParams } from 'msw' import { endpoints } from '#/api.endpoints' import type { AssetHistoryActionsResponse } from '#/components/activity/activity.constants' import { mockAssetUid } from './assetHistory.mocks' diff --git a/jsapp/js/endpoints/assets.mocks.ts b/jsapp/js/endpoints/assets.mocks.ts index 0390b837ce..34b52d7bb5 100644 --- a/jsapp/js/endpoints/assets.mocks.ts +++ b/jsapp/js/endpoints/assets.mocks.ts @@ -1,4 +1,4 @@ -import { http, HttpResponse, type PathParams } from 'msw' +import { HttpResponse, http, type PathParams } from 'msw' import { endpoints } from '#/api.endpoints' import { AssetTypeName, QuestionTypeName } from '#/constants' import type { AssetResponse, PaginatedResponse } from '#/dataInterface' diff --git a/jsapp/js/endpoints/environment.mocks.ts b/jsapp/js/endpoints/environment.mocks.ts index 32e5858682..e66801080e 100644 --- a/jsapp/js/endpoints/environment.mocks.ts +++ b/jsapp/js/endpoints/environment.mocks.ts @@ -1,4 +1,4 @@ -import { http, HttpResponse } from 'msw' +import { HttpResponse, http } from 'msw' import { endpoints } from '#/api.endpoints' import type { EnvironmentResponse } from '../envStore' diff --git a/jsapp/js/endpoints/languages.mocks.ts b/jsapp/js/endpoints/languages.mocks.ts index 3655a7504f..f2050153a3 100644 --- a/jsapp/js/endpoints/languages.mocks.ts +++ b/jsapp/js/endpoints/languages.mocks.ts @@ -1,4 +1,4 @@ -import { http, HttpResponse, type PathParams } from 'msw' +import { HttpResponse, http, type PathParams } from 'msw' import { endpoints } from '#/api.endpoints' import type { PaginatedResponse } from '#/dataInterface' import type { ListLanguage } from '../components/languages/languagesStore' diff --git a/jsapp/js/endpoints/me.mocks.ts b/jsapp/js/endpoints/me.mocks.ts index 35ee71853d..85ccf6897c 100644 --- a/jsapp/js/endpoints/me.mocks.ts +++ b/jsapp/js/endpoints/me.mocks.ts @@ -1,4 +1,4 @@ -import { http, HttpResponse } from 'msw' +import { HttpResponse, http } from 'msw' import { endpoints } from '#/api.endpoints' import type { AccountResponse } from '#/dataInterface' diff --git a/jsapp/js/endpoints/organization.mocks.ts b/jsapp/js/endpoints/organization.mocks.ts index c1bf90fa95..eb21b5de64 100644 --- a/jsapp/js/endpoints/organization.mocks.ts +++ b/jsapp/js/endpoints/organization.mocks.ts @@ -1,4 +1,4 @@ -import { http, HttpResponse } from 'msw' +import { HttpResponse, http } from 'msw' import type { OrganizationResponse } from '#/api/models/organizationResponse' import { getOrganizationsRetrieveUrl } from '#/api/react-query/user-team-organization-usage' import { meMockResponse } from './me.mocks' diff --git a/jsapp/js/enketoHandler.tsx b/jsapp/js/enketoHandler.tsx index 4c32c7f21c..a23a378240 100644 --- a/jsapp/js/enketoHandler.tsx +++ b/jsapp/js/enketoHandler.tsx @@ -1,8 +1,8 @@ import React from 'react' import { EnketoActions } from '#/constants' -import { dataInterface } from '#/dataInterface' import type { EnketoLinkResponse } from '#/dataInterface' +import { dataInterface } from '#/dataInterface' import { notify } from '#/utils' /** diff --git a/jsapp/js/formbuild/renderInBackbone.js b/jsapp/js/formbuild/renderInBackbone.js index 9f94129f18..4c6379374f 100644 --- a/jsapp/js/formbuild/renderInBackbone.js +++ b/jsapp/js/formbuild/renderInBackbone.js @@ -1,6 +1,5 @@ -import React from 'react' - import { fromJS } from 'immutable' +import React from 'react' import { createRoot } from 'react-dom/client' import { recordKeys } from '#/utils' import KoboMatrix from './containers/KoboMatrix' diff --git a/jsapp/js/hooks/useWhen.hook.ts b/jsapp/js/hooks/useWhen.hook.ts index 8ac3413693..403049d025 100644 --- a/jsapp/js/hooks/useWhen.hook.ts +++ b/jsapp/js/hooks/useWhen.hook.ts @@ -1,6 +1,5 @@ -import { type DependencyList, type EffectCallback, useEffect } from 'react' - import { when } from 'mobx' +import { type DependencyList, type EffectCallback, useEffect } from 'react' // React hook to run an effect when a mobx value changes. // When test returns true, effect is executed. diff --git a/jsapp/js/libs/reactBemComponents.tsx b/jsapp/js/libs/reactBemComponents.tsx index 1a14edcbd2..69821bc2e2 100644 --- a/jsapp/js/libs/reactBemComponents.tsx +++ b/jsapp/js/libs/reactBemComponents.tsx @@ -36,16 +36,17 @@ */ -import React from 'react' -import cx from 'classnames' import type { Argument as ClassnamesArgument } from 'classnames' + +import cx from 'classnames' +import React from 'react' import { recordEntries } from '#/utils' const reactCreateBemElement = (base: string, el = 'div') => { let elUnwrap if (el.match) { - elUnwrap = el.match(/\<(\w+)\s?\/?\>/) + elUnwrap = el.match(/<(\w+)\s?\/?>/) if (elUnwrap) { el = elUnwrap[1] } diff --git a/jsapp/js/main.js b/jsapp/js/main.js index 834eec449d..a05341931b 100644 --- a/jsapp/js/main.js +++ b/jsapp/js/main.js @@ -22,10 +22,9 @@ import '@fontsource/roboto/500.css' import '@fontsource/roboto/700.css' import '../scss/main.scss' -import React from 'react' - import * as Sentry from '@sentry/react' import moment from 'moment' +import React from 'react' import { Cookies } from 'react-cookie' import { createRoot } from 'react-dom/client' import Modal from 'react-modal' diff --git a/jsapp/js/mixins.tsx b/jsapp/js/mixins.tsx index e0bf4ad5ca..56ae02af72 100644 --- a/jsapp/js/mixins.tsx +++ b/jsapp/js/mixins.tsx @@ -1,6 +1,5 @@ -import React from 'react' - import alertify from 'alertifyjs' +import React from 'react' import type { DropFilesEventHandler } from 'react-dropzone' import { archiveAsset, @@ -10,10 +9,10 @@ import { removeAssetSharing, unarchiveAsset, } from '#/assetQuickActions' -import assetStore from '#/assetStore' import type { AssetStoreData } from '#/assetStore' -import { dataInterface } from '#/dataInterface' +import assetStore from '#/assetStore' import type { AssetResponse, CreateImportRequest, DeploymentResponse, ImportResponse } from '#/dataInterface' +import { dataInterface } from '#/dataInterface' import pageState from '#/pageState.store' import { router, routerGetAssetId, routerIsActive } from '#/router/legacy' import { ROUTES } from '#/router/routerConstants' diff --git a/jsapp/js/project/projectTopTabs.component.tsx b/jsapp/js/project/projectTopTabs.component.tsx index 214d8394d0..c33a6590c5 100644 --- a/jsapp/js/project/projectTopTabs.component.tsx +++ b/jsapp/js/project/projectTopTabs.component.tsx @@ -1,6 +1,5 @@ -import React, { useEffect, useState } from 'react' - import classnames from 'classnames' +import React, { useEffect, useState } from 'react' import { useNavigate } from 'react-router-dom' import assetStore from '#/assetStore' import { userCan, userCanPartially } from '#/components/permissions/utils' diff --git a/jsapp/js/project/submissionsCountGraph.component.tsx b/jsapp/js/project/submissionsCountGraph.component.tsx index 1e472ab8e8..e94439d49a 100644 --- a/jsapp/js/project/submissionsCountGraph.component.tsx +++ b/jsapp/js/project/submissionsCountGraph.component.tsx @@ -1,9 +1,9 @@ -import React, { useState, useEffect, useCallback, useRef } from 'react' +import type { ChartConfiguration } from 'chart.js/auto' import Chart from 'chart.js/auto' -import type { ChartConfiguration } from 'chart.js/auto' import classNames from 'classnames' import moment from 'moment' +import React, { useCallback, useEffect, useRef, useState } from 'react' import { fetchGet, handleApiFail } from '#/api' import LoadingSpinner from '#/components/common/loadingSpinner' import type { FailResponse } from '#/dataInterface' diff --git a/jsapp/js/projects/customViewStore.ts b/jsapp/js/projects/customViewStore.ts index 5b12297608..a9ba76c714 100644 --- a/jsapp/js/projects/customViewStore.ts +++ b/jsapp/js/projects/customViewStore.ts @@ -6,10 +6,10 @@ import searchBoxStore from '#/components/header/searchBoxStore' import { COMMON_QUERIES } from '#/constants' import type { AssetResponse, FailResponse, PaginatedResponse, ProjectViewAsset } from '#/dataInterface' import session from '#/stores/session' -import { DEFAULT_VISIBLE_FIELDS, PROJECT_FIELDS } from './projectViews/constants' +import type { ProjectsTableOrder } from './projectsTable/projectsTable' import type { ProjectFieldName, ProjectsFilterDefinition } from './projectViews/constants' +import { DEFAULT_VISIBLE_FIELDS, PROJECT_FIELDS } from './projectViews/constants' import { buildQueriesFromFilters } from './projectViews/utils' -import type { ProjectsTableOrder } from './projectsTable/projectsTable' const SAVE_DATA_NAME = 'project_views_settings' const PAGE_SIZE = 50 diff --git a/jsapp/js/projects/myOrgProjectsRoute.tsx b/jsapp/js/projects/myOrgProjectsRoute.tsx index 671482afba..2c8e49884b 100644 --- a/jsapp/js/projects/myOrgProjectsRoute.tsx +++ b/jsapp/js/projects/myOrgProjectsRoute.tsx @@ -1,7 +1,6 @@ -import React, { useState, useEffect } from 'react' - -import { endpoints } from '#/api.endpoints' +import React, { useEffect, useState } from 'react' import { useOrganizationAssumed } from '#/api/useOrganizationAssumed' +import { endpoints } from '#/api.endpoints' import LoadingSpinner from '#/components/common/loadingSpinner' import { ROOT_URL } from '#/constants' import { diff --git a/jsapp/js/projects/projectViews/projectsFieldsSelector.tsx b/jsapp/js/projects/projectViews/projectsFieldsSelector.tsx index 715df13ac1..0a722240ca 100644 --- a/jsapp/js/projects/projectViews/projectsFieldsSelector.tsx +++ b/jsapp/js/projects/projectViews/projectsFieldsSelector.tsx @@ -1,8 +1,8 @@ -import React, { useState, useEffect } from 'react' +import React, { useEffect, useState } from 'react' import Button from '#/components/common/button' -import MultiCheckbox from '#/components/common/multiCheckbox' import type { MultiCheckboxItem } from '#/components/common/multiCheckbox' +import MultiCheckbox from '#/components/common/multiCheckbox' import KoboModal from '#/components/modals/koboModal' import KoboModalContent from '#/components/modals/koboModalContent' import KoboModalFooter from '#/components/modals/koboModalFooter' diff --git a/jsapp/js/projects/projectViews/projectsFilter.tsx b/jsapp/js/projects/projectViews/projectsFilter.tsx index d385331cad..cc9d297272 100644 --- a/jsapp/js/projects/projectViews/projectsFilter.tsx +++ b/jsapp/js/projects/projectViews/projectsFilter.tsx @@ -1,7 +1,6 @@ -import React, { useState } from 'react' - import cx from 'classnames' import clonedeep from 'lodash.clonedeep' +import React, { useState } from 'react' import Button from '#/components/common/button' import KoboModal from '#/components/modals/koboModal' import KoboModalHeader from '#/components/modals/koboModalHeader' diff --git a/jsapp/js/projects/projectViews/viewSwitcher.tsx b/jsapp/js/projects/projectViews/viewSwitcher.tsx index 8bc6efbfcd..f98f8d73dc 100644 --- a/jsapp/js/projects/projectViews/viewSwitcher.tsx +++ b/jsapp/js/projects/projectViews/viewSwitcher.tsx @@ -1,7 +1,6 @@ -import React, { useState } from 'react' - import cx from 'classnames' import { observer } from 'mobx-react-lite' +import React, { useState } from 'react' import { useNavigate } from 'react-router-dom' import { MemberRoleEnum } from '#/api/models/memberRoleEnum' import { useOrganizationAssumed } from '#/api/useOrganizationAssumed' diff --git a/jsapp/js/projects/projectsTable/columnResizer.tsx b/jsapp/js/projects/projectsTable/columnResizer.tsx index 461abbc728..19c4f16f4f 100644 --- a/jsapp/js/projects/projectsTable/columnResizer.tsx +++ b/jsapp/js/projects/projectsTable/columnResizer.tsx @@ -1,4 +1,4 @@ -import React, { memo, useState, useEffect, useRef } from 'react' +import React, { memo, useEffect, useRef, useState } from 'react' import { recordKeys } from '#/utils' import type { ProjectFieldName } from '../projectViews/constants' @@ -115,10 +115,7 @@ function ColumnWidthsStyle(props: { columnWidths: ColumnWidths }) { * * …even if the pointer strays from the resize handle. */ -const DraggingStyle = memo(function DraggingStyle(props: { - isDragging: boolean - draggingFieldname: string -}) { +const DraggingStyle = memo(function DraggingStyle(props: { isDragging: boolean; draggingFieldname: string }) { return (