From b18c422ee3f4e1ca423370597bf469e1f9e07a28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ricks?= Date: Thu, 11 Apr 2024 08:49:04 +0200 Subject: [PATCH 001/149] Add: Add opensight-ui-components and mantine for new UI Start to implement new UI components for GSA. --- package-lock.json | 783 +++++++++++++++++++++++++++++++++++++++++++++- package.json | 2 + 2 files changed, 784 insertions(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index 4b43c90fe2..01058fa7f3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,8 @@ "version": "23.0.1-dev1", "license": "AGPL-3.0+", "dependencies": { + "@greenbone/opensight-ui-components": "^0.1.3-alpha0", + "@mantine/core": "^6.0.0", "@reduxjs/toolkit": "^2.2.5", "@sentry/react": "^8.7.0", "@visx/axis": "^3.10.1", @@ -2185,6 +2187,64 @@ "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", "dev": true }, + "node_modules/@emotion/babel-plugin": { + "version": "11.11.0", + "resolved": "https://registry.npmjs.org/@emotion/babel-plugin/-/babel-plugin-11.11.0.tgz", + "integrity": "sha512-m4HEDZleaaCH+XgDDsPF15Ht6wTLsgDTeR3WYj9Q/k76JtWhrJjcP4+/XlG8LGT/Rol9qUfOIztXeA84ATpqPQ==", + "dependencies": { + "@babel/helper-module-imports": "^7.16.7", + "@babel/runtime": "^7.18.3", + "@emotion/hash": "^0.9.1", + "@emotion/memoize": "^0.8.1", + "@emotion/serialize": "^1.1.2", + "babel-plugin-macros": "^3.1.0", + "convert-source-map": "^1.5.0", + "escape-string-regexp": "^4.0.0", + "find-root": "^1.1.0", + "source-map": "^0.5.7", + "stylis": "4.2.0" + } + }, + "node_modules/@emotion/babel-plugin/node_modules/convert-source-map": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", + "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==" + }, + "node_modules/@emotion/babel-plugin/node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/@emotion/babel-plugin/node_modules/stylis": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/stylis/-/stylis-4.2.0.tgz", + "integrity": "sha512-Orov6g6BB1sDfYgzWfTHDOxamtX1bE/zo104Dh9e6fqJ3PooipYyfJ0pUmrZO2wAvO8YbEyeFrkV91XTsGMSrw==" + }, + "node_modules/@emotion/cache": { + "version": "11.11.0", + "resolved": "https://registry.npmjs.org/@emotion/cache/-/cache-11.11.0.tgz", + "integrity": "sha512-P34z9ssTCBi3e9EI1ZsWpNHcfY1r09ZO0rZbRO2ob3ZQMnFI35jB536qoXbkdesr5EUhYi22anuEJuyxifaqAQ==", + "dependencies": { + "@emotion/memoize": "^0.8.1", + "@emotion/sheet": "^1.2.2", + "@emotion/utils": "^1.2.1", + "@emotion/weak-memoize": "^0.3.1", + "stylis": "4.2.0" + } + }, + "node_modules/@emotion/cache/node_modules/stylis": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/stylis/-/stylis-4.2.0.tgz", + "integrity": "sha512-Orov6g6BB1sDfYgzWfTHDOxamtX1bE/zo104Dh9e6fqJ3PooipYyfJ0pUmrZO2wAvO8YbEyeFrkV91XTsGMSrw==" + }, + "node_modules/@emotion/hash": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/@emotion/hash/-/hash-0.9.1.tgz", + "integrity": "sha512-gJB6HLm5rYwSLI6PQa+X1t5CFGrv1J1TWG+sOyMCeKz2ojaj6Fnl/rZEspogG+cvqbt4AE/2eIyD2QfLKTBNlQ==" + }, "node_modules/@emotion/is-prop-valid": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/@emotion/is-prop-valid/-/is-prop-valid-1.2.2.tgz", @@ -2198,11 +2258,69 @@ "resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.8.1.tgz", "integrity": "sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==" }, + "node_modules/@emotion/react": { + "version": "11.11.4", + "resolved": "https://registry.npmjs.org/@emotion/react/-/react-11.11.4.tgz", + "integrity": "sha512-t8AjMlF0gHpvvxk5mAtCqR4vmxiGHCeJBaQO6gncUSdklELOgtwjerNY2yuJNfwnc6vi16U/+uMF+afIawJ9iw==", + "dependencies": { + "@babel/runtime": "^7.18.3", + "@emotion/babel-plugin": "^11.11.0", + "@emotion/cache": "^11.11.0", + "@emotion/serialize": "^1.1.3", + "@emotion/use-insertion-effect-with-fallbacks": "^1.0.1", + "@emotion/utils": "^1.2.1", + "@emotion/weak-memoize": "^0.3.1", + "hoist-non-react-statics": "^3.3.1" + }, + "peerDependencies": { + "react": ">=16.8.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@emotion/serialize": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@emotion/serialize/-/serialize-1.1.4.tgz", + "integrity": "sha512-RIN04MBT8g+FnDwgvIUi8czvr1LU1alUMI05LekWB5DGyTm8cCBMCRpq3GqaiyEDRptEXOyXnvZ58GZYu4kBxQ==", + "dependencies": { + "@emotion/hash": "^0.9.1", + "@emotion/memoize": "^0.8.1", + "@emotion/unitless": "^0.8.1", + "@emotion/utils": "^1.2.1", + "csstype": "^3.0.2" + } + }, + "node_modules/@emotion/sheet": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@emotion/sheet/-/sheet-1.2.2.tgz", + "integrity": "sha512-0QBtGvaqtWi+nx6doRwDdBIzhNdZrXUppvTM4dtZZWEGTXL/XE/yJxLMGlDT1Gt+UHH5IX1n+jkXyytE/av7OA==" + }, "node_modules/@emotion/unitless": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.8.1.tgz", "integrity": "sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==" }, + "node_modules/@emotion/use-insertion-effect-with-fallbacks": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@emotion/use-insertion-effect-with-fallbacks/-/use-insertion-effect-with-fallbacks-1.0.1.tgz", + "integrity": "sha512-jT/qyKZ9rzLErtrjGgdkMBn2OP8wl0G3sQlBb3YPryvKHsjvINUhVaPFfP+fpBcOkmrVOVEEHQFJ7nbj2TH2gw==", + "peerDependencies": { + "react": ">=16.8.0" + } + }, + "node_modules/@emotion/utils": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@emotion/utils/-/utils-1.2.1.tgz", + "integrity": "sha512-Y2tGf3I+XVnajdItskUCn6LX+VUDmP6lTL4fcqsXAv43dnlbZiuW4MWQW38rW/BVWSE7Q/7+XQocmpnRYILUmg==" + }, + "node_modules/@emotion/weak-memoize": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@emotion/weak-memoize/-/weak-memoize-0.3.1.tgz", + "integrity": "sha512-EsBwpc7hBUJWAsNPBmJy4hxWx12v6bshQsldrVmjxJoc3isbxhOrF2IcCpaXxfvq03NwkI7sbsOLXbYuqF/8Ww==" + }, "node_modules/@esbuild/aix-ppc64": { "version": "0.20.2", "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.20.2.tgz", @@ -2712,6 +2830,42 @@ "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.1.tgz", "integrity": "sha512-9TANp6GPoMtYzQdt54kfAyMmz1+osLlXdg2ENroU7zzrtflTLrrC/lgrIfaSe+Wu0b89GKccT7vxXA0MoAIO+Q==" }, + "node_modules/@greenbone/opensight-ui-components": { + "version": "0.1.3-alpha2", + "resolved": "https://registry.npmjs.org/@greenbone/opensight-ui-components/-/opensight-ui-components-0.1.3-alpha2.tgz", + "integrity": "sha512-Kn16uRoKO7pruC10FUR+Qoyw1aXmXCNZOkx+j+nE1+Y8E2YhvT0xJu9clg1mQYQHVaUXJ1DM4XOo5azWRL08vw==", + "dependencies": { + "@mantine/core": "^6.x.x", + "@mantine/dates": "^6.x.x", + "@mantine/hooks": "^6.x.x", + "@mantine/notifications": "^6.x.x", + "lucide-react": "^0.376.0", + "luxon": "^3.4.4", + "react": "^18.3.1", + "react-dom": "^18.3.1", + "react-hook-form": "^7", + "react-i18next": "^14.1.1", + "react-select": "^5.8.0", + "tiny-invariant": "^1.3.3", + "urlcat": "^3", + "webfontloader": "^1.6.28", + "yup": "^1.4.0" + }, + "optionalDependencies": { + "@reduxjs/toolkit": "^2.2.3", + "@swc/core-darwin-arm64": "^1.3.107" + }, + "peerDependencies": { + "@mantine/core": "^6.x.x", + "@mantine/dates": "^6.x.x", + "@mantine/hooks": "^6.x.x", + "@mantine/notifications": "^6.x.x", + "lucide-react": "^0.344.0", + "react": "^18.x.x", + "react-dom": "^18.x.x", + "react-i18next": "^14.x.x" + } + }, "node_modules/@humanwhocodes/config-array": { "version": "0.11.14", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", @@ -3338,6 +3492,122 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, + "node_modules/@mantine/core": { + "version": "6.0.21", + "resolved": "https://registry.npmjs.org/@mantine/core/-/core-6.0.21.tgz", + "integrity": "sha512-Kx4RrRfv0I+cOCIcsq/UA2aWcYLyXgW3aluAuW870OdXnbII6qg7RW28D+r9D76SHPxWFKwIKwmcucAG08Divg==", + "dependencies": { + "@floating-ui/react": "^0.19.1", + "@mantine/styles": "6.0.21", + "@mantine/utils": "6.0.21", + "@radix-ui/react-scroll-area": "1.0.2", + "react-remove-scroll": "^2.5.5", + "react-textarea-autosize": "8.3.4" + }, + "peerDependencies": { + "@mantine/hooks": "6.0.21", + "react": ">=16.8.0", + "react-dom": ">=16.8.0" + } + }, + "node_modules/@mantine/core/node_modules/@floating-ui/react": { + "version": "0.19.2", + "resolved": "https://registry.npmjs.org/@floating-ui/react/-/react-0.19.2.tgz", + "integrity": "sha512-JyNk4A0Ezirq8FlXECvRtQOX/iBe5Ize0W/pLkrZjfHW9GUV7Xnq6zm6fyZuQzaHHqEnVizmvlA96e1/CkZv+w==", + "dependencies": { + "@floating-ui/react-dom": "^1.3.0", + "aria-hidden": "^1.1.3", + "tabbable": "^6.0.1" + }, + "peerDependencies": { + "react": ">=16.8.0", + "react-dom": ">=16.8.0" + } + }, + "node_modules/@mantine/core/node_modules/@floating-ui/react-dom": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@floating-ui/react-dom/-/react-dom-1.3.0.tgz", + "integrity": "sha512-htwHm67Ji5E/pROEAr7f8IKFShuiCKHwUC/UY4vC3I5jiSvGFAYnSYiZO5MlGmads+QqvUkR9ANHEguGrDv72g==", + "dependencies": { + "@floating-ui/dom": "^1.2.1" + }, + "peerDependencies": { + "react": ">=16.8.0", + "react-dom": ">=16.8.0" + } + }, + "node_modules/@mantine/dates": { + "version": "6.0.21", + "resolved": "https://registry.npmjs.org/@mantine/dates/-/dates-6.0.21.tgz", + "integrity": "sha512-nSX7MxNkHyyDJqEJOT7Wg930jBfgWz+3pnoWo601cYDvFjh5GgcRz66v36rnMJFK1/56k5G9rWzUOzuM94j6hg==", + "dependencies": { + "@mantine/utils": "6.0.21" + }, + "peerDependencies": { + "@mantine/core": "6.0.21", + "@mantine/hooks": "6.0.21", + "dayjs": ">=1.0.0", + "react": ">=16.8.0" + } + }, + "node_modules/@mantine/hooks": { + "version": "6.0.21", + "resolved": "https://registry.npmjs.org/@mantine/hooks/-/hooks-6.0.21.tgz", + "integrity": "sha512-sYwt5wai25W6VnqHbS5eamey30/HD5dNXaZuaVEAJ2i2bBv8C0cCiczygMDpAFiSYdXoSMRr/SZ2CrrPTzeNew==", + "peerDependencies": { + "react": ">=16.8.0" + } + }, + "node_modules/@mantine/notifications": { + "version": "6.0.21", + "resolved": "https://registry.npmjs.org/@mantine/notifications/-/notifications-6.0.21.tgz", + "integrity": "sha512-qsrqxuJHK8b67sf9Pfk+xyhvpf9jMsivW8vchfnJfjv7yz1lLvezjytMFp4fMDoYhjHnDPOEc/YFockK4muhOw==", + "dependencies": { + "@mantine/utils": "6.0.21", + "react-transition-group": "4.4.2" + }, + "peerDependencies": { + "@mantine/core": "6.0.21", + "@mantine/hooks": "6.0.21", + "react": ">=16.8.0", + "react-dom": ">=16.8.0" + } + }, + "node_modules/@mantine/styles": { + "version": "6.0.21", + "resolved": "https://registry.npmjs.org/@mantine/styles/-/styles-6.0.21.tgz", + "integrity": "sha512-PVtL7XHUiD/B5/kZ/QvZOZZQQOj12QcRs3Q6nPoqaoPcOX5+S7bMZLMH0iLtcGq5OODYk0uxlvuJkOZGoPj8Mg==", + "dependencies": { + "clsx": "1.1.1", + "csstype": "3.0.9" + }, + "peerDependencies": { + "@emotion/react": ">=11.9.0", + "react": ">=16.8.0", + "react-dom": ">=16.8.0" + } + }, + "node_modules/@mantine/styles/node_modules/clsx": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-1.1.1.tgz", + "integrity": "sha512-6/bPho624p3S2pMyvP5kKBPXnI3ufHLObBFCfgx+LkeR5lg2XYy2hqZqUf45ypD8COn2bhgGJSUE+l5dhNBieA==", + "engines": { + "node": ">=6" + } + }, + "node_modules/@mantine/styles/node_modules/csstype": { + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.0.9.tgz", + "integrity": "sha512-rpw6JPxK6Rfg1zLOYCSwle2GFOOsnjmDYDaBwEcwoOg4qlsIVCN789VkBZDJAGi4T07gI4YSutR43t9Zz4Lzuw==" + }, + "node_modules/@mantine/utils": { + "version": "6.0.21", + "resolved": "https://registry.npmjs.org/@mantine/utils/-/utils-6.0.21.tgz", + "integrity": "sha512-33RVDRop5jiWFao3HKd3Yp7A9mEq4HAJxJPTuYm1NkdqX6aTKOQK7wT8v8itVodBp+sb4cJK6ZVdD1UurK/txQ==", + "peerDependencies": { + "react": ">=16.8.0" + } + }, "node_modules/@nicolo-ribaudo/chokidar-2": { "version": "2.1.8-no-fsevents.3", "resolved": "https://registry.npmjs.org/@nicolo-ribaudo/chokidar-2/-/chokidar-2-2.1.8-no-fsevents.3.tgz", @@ -3386,6 +3656,137 @@ "integrity": "sha512-j7P6Rgr3mmtdkeDGTe0E/aYyWEWVtc5yFXtHCRHs28/jptDEWfaVOc5T7cblqy1XKPPfCxJc/8DwQ5YgLOZOVQ==", "dev": true }, + "node_modules/@radix-ui/number": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@radix-ui/number/-/number-1.0.0.tgz", + "integrity": "sha512-Ofwh/1HX69ZfJRiRBMTy7rgjAzHmwe4kW9C9Y99HTRUcYLUuVT0KESFj15rPjRgKJs20GPq8Bm5aEDJ8DuA3vA==", + "dependencies": { + "@babel/runtime": "^7.13.10" + } + }, + "node_modules/@radix-ui/primitive": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@radix-ui/primitive/-/primitive-1.0.0.tgz", + "integrity": "sha512-3e7rn8FDMin4CgeL7Z/49smCA3rFYY3Ha2rUQ7HRWFadS5iCRw08ZgVT1LaNTCNqgvrUiyczLflrVrF0SRQtNA==", + "dependencies": { + "@babel/runtime": "^7.13.10" + } + }, + "node_modules/@radix-ui/react-compose-refs": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@radix-ui/react-compose-refs/-/react-compose-refs-1.0.0.tgz", + "integrity": "sha512-0KaSv6sx787/hK3eF53iOkiSLwAGlFMx5lotrqD2pTjB18KbybKoEIgkNZTKC60YECDQTKGTRcDBILwZVqVKvA==", + "dependencies": { + "@babel/runtime": "^7.13.10" + }, + "peerDependencies": { + "react": "^16.8 || ^17.0 || ^18.0" + } + }, + "node_modules/@radix-ui/react-context": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@radix-ui/react-context/-/react-context-1.0.0.tgz", + "integrity": "sha512-1pVM9RfOQ+n/N5PJK33kRSKsr1glNxomxONs5c49MliinBY6Yw2Q995qfBUUo0/Mbg05B/sGA0gkgPI7kmSHBg==", + "dependencies": { + "@babel/runtime": "^7.13.10" + }, + "peerDependencies": { + "react": "^16.8 || ^17.0 || ^18.0" + } + }, + "node_modules/@radix-ui/react-direction": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@radix-ui/react-direction/-/react-direction-1.0.0.tgz", + "integrity": "sha512-2HV05lGUgYcA6xgLQ4BKPDmtL+QbIZYH5fCOTAOOcJ5O0QbWS3i9lKaurLzliYUDhORI2Qr3pyjhJh44lKA3rQ==", + "dependencies": { + "@babel/runtime": "^7.13.10" + }, + "peerDependencies": { + "react": "^16.8 || ^17.0 || ^18.0" + } + }, + "node_modules/@radix-ui/react-presence": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@radix-ui/react-presence/-/react-presence-1.0.0.tgz", + "integrity": "sha512-A+6XEvN01NfVWiKu38ybawfHsBjWum42MRPnEuqPsBZ4eV7e/7K321B5VgYMPv3Xx5An6o1/l9ZuDBgmcmWK3w==", + "dependencies": { + "@babel/runtime": "^7.13.10", + "@radix-ui/react-compose-refs": "1.0.0", + "@radix-ui/react-use-layout-effect": "1.0.0" + }, + "peerDependencies": { + "react": "^16.8 || ^17.0 || ^18.0", + "react-dom": "^16.8 || ^17.0 || ^18.0" + } + }, + "node_modules/@radix-ui/react-primitive": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-primitive/-/react-primitive-1.0.1.tgz", + "integrity": "sha512-fHbmislWVkZaIdeF6GZxF0A/NH/3BjrGIYj+Ae6eTmTCr7EB0RQAAVEiqsXK6p3/JcRqVSBQoceZroj30Jj3XA==", + "dependencies": { + "@babel/runtime": "^7.13.10", + "@radix-ui/react-slot": "1.0.1" + }, + "peerDependencies": { + "react": "^16.8 || ^17.0 || ^18.0", + "react-dom": "^16.8 || ^17.0 || ^18.0" + } + }, + "node_modules/@radix-ui/react-scroll-area": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@radix-ui/react-scroll-area/-/react-scroll-area-1.0.2.tgz", + "integrity": "sha512-k8VseTxI26kcKJaX0HPwkvlNBPTs56JRdYzcZ/vzrNUkDlvXBy8sMc7WvCpYzZkHgb+hd72VW9MqkqecGtuNgg==", + "dependencies": { + "@babel/runtime": "^7.13.10", + "@radix-ui/number": "1.0.0", + "@radix-ui/primitive": "1.0.0", + "@radix-ui/react-compose-refs": "1.0.0", + "@radix-ui/react-context": "1.0.0", + "@radix-ui/react-direction": "1.0.0", + "@radix-ui/react-presence": "1.0.0", + "@radix-ui/react-primitive": "1.0.1", + "@radix-ui/react-use-callback-ref": "1.0.0", + "@radix-ui/react-use-layout-effect": "1.0.0" + }, + "peerDependencies": { + "react": "^16.8 || ^17.0 || ^18.0", + "react-dom": "^16.8 || ^17.0 || ^18.0" + } + }, + "node_modules/@radix-ui/react-slot": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.0.1.tgz", + "integrity": "sha512-avutXAFL1ehGvAXtPquu0YK5oz6ctS474iM3vNGQIkswrVhdrS52e3uoMQBzZhNRAIE0jBnUyXWNmSjGHhCFcw==", + "dependencies": { + "@babel/runtime": "^7.13.10", + "@radix-ui/react-compose-refs": "1.0.0" + }, + "peerDependencies": { + "react": "^16.8 || ^17.0 || ^18.0" + } + }, + "node_modules/@radix-ui/react-use-callback-ref": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@radix-ui/react-use-callback-ref/-/react-use-callback-ref-1.0.0.tgz", + "integrity": "sha512-GZtyzoHz95Rhs6S63D2t/eqvdFCm7I+yHMLVQheKM7nBD8mbZIt+ct1jz4536MDnaOGKIxynJ8eHTkVGVVkoTg==", + "dependencies": { + "@babel/runtime": "^7.13.10" + }, + "peerDependencies": { + "react": "^16.8 || ^17.0 || ^18.0" + } + }, + "node_modules/@radix-ui/react-use-layout-effect": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@radix-ui/react-use-layout-effect/-/react-use-layout-effect-1.0.0.tgz", + "integrity": "sha512-6Tpkq+R6LOlmQb1R5NNETLG0B4YP0wc+klfXafpUCj6JGyaUc8il7/kUZ7m59rGbXGczE9Bs+iz2qloqsZBduQ==", + "dependencies": { + "@babel/runtime": "^7.13.10" + }, + "peerDependencies": { + "react": "^16.8 || ^17.0 || ^18.0" + } + }, "node_modules/@reduxjs/toolkit": { "version": "2.2.5", "resolved": "https://registry.npmjs.org/@reduxjs/toolkit/-/toolkit-2.2.5.tgz", @@ -3987,6 +4388,21 @@ "@svgr/core": "*" } }, + "node_modules/@swc/core-darwin-arm64": { + "version": "1.5.25", + "resolved": "https://registry.npmjs.org/@swc/core-darwin-arm64/-/core-darwin-arm64-1.5.25.tgz", + "integrity": "sha512-YbD0SBgVJS2DM0vwJTU5m7+wOyCjHPBDMf3nCBJQzFZzOLzK11eRW7SzU2jhJHr9HI9sKcNFfN4lIC2Sj+4inA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=10" + } + }, "node_modules/@testing-library/dom": { "version": "10.0.0", "resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-10.0.0.tgz", @@ -4423,6 +4839,14 @@ "@babel/runtime": "^7.9.2" } }, + "node_modules/@types/react-transition-group": { + "version": "4.4.10", + "resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.10.tgz", + "integrity": "sha512-hT/+s0VQs2ojCX823m60m5f0sL5idt9SO6Tj6Dg+rdphGPIeJbJ6CxvBYkgkGKrYeDjvIpKTR38UzmtHJOGW3Q==", + "dependencies": { + "@types/react": "*" + } + }, "node_modules/@types/stack-utils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.3.tgz", @@ -5211,6 +5635,17 @@ "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "dev": true }, + "node_modules/aria-hidden": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/aria-hidden/-/aria-hidden-1.2.4.tgz", + "integrity": "sha512-y+CcFFwelSXpLZk/7fMB2mUbGtX9lKycf1MWJ7CaTIERyitVlyQx6C+sxcROU2BAJ24OiZyK+8wj2i8AlBoS3A==", + "dependencies": { + "tslib": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/aria-query": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.0.tgz", @@ -6590,6 +7025,12 @@ "url": "https://github.com/sponsors/kossnocorp" } }, + "node_modules/dayjs": { + "version": "1.11.11", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.11.tgz", + "integrity": "sha512-okzr3f11N6WuqYtZSvm+F776mB41wRZMhKP+hc34YdW+KmtYYK9iqvHSwo2k9FEH3fhGXvOPV6yz2IcSrfRUDg==", + "peer": true + }, "node_modules/debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", @@ -6734,6 +7175,11 @@ "node": ">=8" } }, + "node_modules/detect-node-es": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/detect-node-es/-/detect-node-es-1.1.0.tgz", + "integrity": "sha512-ypdmJU/TbBby2Dxibuv7ZLW3Bs1QEmM7nHjEANfohJLvE0XVujisn1qPJcZxg+qDucsr+bP6fLD1rPS3AhJ7EQ==" + }, "node_modules/diff-sequences": { "version": "29.6.3", "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", @@ -6773,6 +7219,15 @@ "integrity": "sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg==", "dev": true }, + "node_modules/dom-helpers": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/dom-helpers/-/dom-helpers-5.2.1.tgz", + "integrity": "sha512-nRCa7CK3VTrM2NmGkIy4cbK7IZlgBE/PYMn55rrXefr5xXDP0LdtfPnblFDoVdcAfslJ7or6iqAUnx0CCGIWQA==", + "dependencies": { + "@babel/runtime": "^7.8.7", + "csstype": "^3.0.2" + } + }, "node_modules/domexception": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/domexception/-/domexception-4.0.0.tgz", @@ -7079,7 +7534,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true, "engines": { "node": ">=10" }, @@ -7674,6 +8128,11 @@ "node": ">=8" } }, + "node_modules/find-root": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/find-root/-/find-root-1.1.0.tgz", + "integrity": "sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng==" + }, "node_modules/find-up": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", @@ -7842,6 +8301,14 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/get-nonce": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-nonce/-/get-nonce-1.0.1.tgz", + "integrity": "sha512-FJhYRoDaiatfEkUK8HKlicmu/3SGFD51q3itKDGoSTysQJBnfOcxU5GxnhE1E6soB76MbT0MBtnKJuXyAx+96Q==", + "engines": { + "node": ">=6" + } + }, "node_modules/get-package-type": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", @@ -8142,6 +8609,14 @@ "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", "dev": true }, + "node_modules/html-parse-stringify": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/html-parse-stringify/-/html-parse-stringify-3.0.1.tgz", + "integrity": "sha512-KknJ50kTInJ7qIScF3jeaFRpMpE8/lfiTdzf/twXyPBLAGrLRTmkz3AdTnKeh40X8k9L2fdYwEp/42WGXIRGcg==", + "dependencies": { + "void-elements": "3.1.0" + } + }, "node_modules/http-proxy-agent": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", @@ -10618,6 +11093,22 @@ "yallist": "^3.0.2" } }, + "node_modules/lucide-react": { + "version": "0.376.0", + "resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-0.376.0.tgz", + "integrity": "sha512-g91IX3ERD6yUR1TL2dsL4BkcGygpZz/EsqjAeL/kcRQV0EApIOr/9eBfKhYOVyQIcGGuotFGjF3xKLHMEz+b7g==", + "peerDependencies": { + "react": "^16.5.1 || ^17.0.0 || ^18.0.0" + } + }, + "node_modules/luxon": { + "version": "3.4.4", + "resolved": "https://registry.npmjs.org/luxon/-/luxon-3.4.4.tgz", + "integrity": "sha512-zobTr7akeGHnv7eBOXcRgMeCP6+uyYsczwmeRCauvpvaAltgNyTbLH/+VaEAPUeWBT+1GuNmz4wC/6jtQzbbVA==", + "engines": { + "node": ">=12" + } + }, "node_modules/lz-string": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/lz-string/-/lz-string-1.5.0.tgz", @@ -11545,6 +12036,11 @@ "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" }, + "node_modules/property-expr": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/property-expr/-/property-expr-2.0.6.tgz", + "integrity": "sha512-SVtmxhRE/CGkn3eZY1T6pC8Nln6Fr/lu1mKSgRud0eC73whjGfoAogbn78LkD8aFL0zz3bAFerKSnOl7NlErBA==" + }, "node_modules/psl": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", @@ -11747,6 +12243,42 @@ "react": "^18.3.1" } }, + "node_modules/react-hook-form": { + "version": "7.51.5", + "resolved": "https://registry.npmjs.org/react-hook-form/-/react-hook-form-7.51.5.tgz", + "integrity": "sha512-J2ILT5gWx1XUIJRETiA7M19iXHlG74+6O3KApzvqB/w8S5NQR7AbU8HVZrMALdmDgWpRPYiZJl0zx8Z4L2mP6Q==", + "engines": { + "node": ">=12.22.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/react-hook-form" + }, + "peerDependencies": { + "react": "^16.8.0 || ^17 || ^18" + } + }, + "node_modules/react-i18next": { + "version": "14.1.2", + "resolved": "https://registry.npmjs.org/react-i18next/-/react-i18next-14.1.2.tgz", + "integrity": "sha512-FSIcJy6oauJbGEXfhUgVeLzvWBhIBIS+/9c6Lj4niwKZyGaGb4V4vUbATXSlsHJDXXB+ociNxqFNiFuV1gmoqg==", + "dependencies": { + "@babel/runtime": "^7.23.9", + "html-parse-stringify": "^3.0.1" + }, + "peerDependencies": { + "i18next": ">= 23.2.3", + "react": ">= 16.8.0" + }, + "peerDependenciesMeta": { + "react-dom": { + "optional": true + }, + "react-native": { + "optional": true + } + } + }, "node_modules/react-is": { "version": "18.2.0", "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", @@ -11796,6 +12328,51 @@ "node": ">=0.10.0" } }, + "node_modules/react-remove-scroll": { + "version": "2.5.10", + "resolved": "https://registry.npmjs.org/react-remove-scroll/-/react-remove-scroll-2.5.10.tgz", + "integrity": "sha512-m3zvBRANPBw3qxVVjEIPEQinkcwlFZ4qyomuWVpNJdv4c6MvHfXV0C3L9Jx5rr3HeBHKNRX+1jreB5QloDIJjA==", + "dependencies": { + "react-remove-scroll-bar": "^2.3.6", + "react-style-singleton": "^2.2.1", + "tslib": "^2.1.0", + "use-callback-ref": "^1.3.0", + "use-sidecar": "^1.1.2" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/react-remove-scroll-bar": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/react-remove-scroll-bar/-/react-remove-scroll-bar-2.3.6.tgz", + "integrity": "sha512-DtSYaao4mBmX+HDo5YWYdBWQwYIQQshUV/dVxFxK+KM26Wjwp1gZ6rv6OC3oujI6Bfu6Xyg3TwK533AQutsn/g==", + "dependencies": { + "react-style-singleton": "^2.2.1", + "tslib": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, "node_modules/react-router": { "version": "5.3.4", "resolved": "https://registry.npmjs.org/react-router/-/react-router-5.3.4.tgz", @@ -11837,6 +12414,79 @@ "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" }, + "node_modules/react-select": { + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/react-select/-/react-select-5.8.0.tgz", + "integrity": "sha512-TfjLDo58XrhP6VG5M/Mi56Us0Yt8X7xD6cDybC7yoRMUNm7BGO7qk8J0TLQOua/prb8vUOtsfnXZwfm30HGsAA==", + "dependencies": { + "@babel/runtime": "^7.12.0", + "@emotion/cache": "^11.4.0", + "@emotion/react": "^11.8.1", + "@floating-ui/dom": "^1.0.1", + "@types/react-transition-group": "^4.4.0", + "memoize-one": "^6.0.0", + "prop-types": "^15.6.0", + "react-transition-group": "^4.3.0", + "use-isomorphic-layout-effect": "^1.1.2" + }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" + } + }, + "node_modules/react-style-singleton": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/react-style-singleton/-/react-style-singleton-2.2.1.tgz", + "integrity": "sha512-ZWj0fHEMyWkHzKYUr2Bs/4zU6XLmq9HsgBURm7g5pAVfyn49DgUiNgY2d4lXRlYSiCif9YBGpQleewkcqddc7g==", + "dependencies": { + "get-nonce": "^1.0.0", + "invariant": "^2.2.4", + "tslib": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/react-textarea-autosize": { + "version": "8.3.4", + "resolved": "https://registry.npmjs.org/react-textarea-autosize/-/react-textarea-autosize-8.3.4.tgz", + "integrity": "sha512-CdtmP8Dc19xL8/R6sWvtknD/eCXkQr30dtvC4VmGInhRsfF8X/ihXCq6+9l9qbxmKRiq407/7z5fxE7cVWQNgQ==", + "dependencies": { + "@babel/runtime": "^7.10.2", + "use-composed-ref": "^1.3.0", + "use-latest": "^1.2.1" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + } + }, + "node_modules/react-transition-group": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.2.tgz", + "integrity": "sha512-/RNYfRAMlZwDSr6z4zNKV6xu53/e2BuaBbGhbyYIXTrmgu/bGHzmqOs7mJSJBHy9Ud+ApHx3QjrkKSp1pxvlFg==", + "dependencies": { + "@babel/runtime": "^7.5.5", + "dom-helpers": "^5.0.1", + "loose-envify": "^1.4.0", + "prop-types": "^15.6.2" + }, + "peerDependencies": { + "react": ">=16.6.0", + "react-dom": ">=16.6.0" + } + }, "node_modules/read-pkg": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", @@ -12987,6 +13637,11 @@ "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", "dev": true }, + "node_modules/tiny-case": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/tiny-case/-/tiny-case-1.0.3.tgz", + "integrity": "sha512-Eet/eeMhkO6TX8mnUteS9zgPbUMQa4I6Kkp5ORiBD5476/m+PIRiumP5tmh5ioJpH7k51Kehawy2UDfsnxxY8Q==" + }, "node_modules/tiny-invariant": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.3.tgz", @@ -13049,6 +13704,11 @@ "node": ">=8.0" } }, + "node_modules/toposort": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/toposort/-/toposort-2.0.2.tgz", + "integrity": "sha512-0a5EOkAUp8D4moMi2W8ZF8jcga7BgZd91O/yabJCFY8az+XSzeGyTKs0Aoo897iV1Nj6guFq8orWDS96z91oGg==" + }, "node_modules/totalist": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/totalist/-/totalist-3.0.1.tgz", @@ -13351,6 +14011,71 @@ "requires-port": "^1.0.0" } }, + "node_modules/urlcat": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/urlcat/-/urlcat-3.1.0.tgz", + "integrity": "sha512-qY6b94/aGMIHh70EEQ/4hfR2LUGZ+fPQNp64cf7yRX9kAp4XG2tx7LgYUU1Qkh17bFylME0u4n3lOezonougPw==", + "dependencies": { + "qs": "^6.9.4" + } + }, + "node_modules/use-callback-ref": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/use-callback-ref/-/use-callback-ref-1.3.2.tgz", + "integrity": "sha512-elOQwe6Q8gqZgDA8mrh44qRTQqpIHDcZ3hXTLjBe1i4ph8XpNJnO+aQf3NaG+lriLopI4HMx9VjQLfPQ6vhnoA==", + "dependencies": { + "tslib": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/use-composed-ref": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/use-composed-ref/-/use-composed-ref-1.3.0.tgz", + "integrity": "sha512-GLMG0Jc/jiKov/3Ulid1wbv3r54K9HlMW29IWcDFPEqFkSO2nS0MuefWgMJpeHQ9YJeXDL3ZUF+P3jdXlZX/cQ==", + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + } + }, + "node_modules/use-isomorphic-layout-effect": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/use-isomorphic-layout-effect/-/use-isomorphic-layout-effect-1.1.2.tgz", + "integrity": "sha512-49L8yCO3iGT/ZF9QttjwLF/ZD9Iwto5LnH5LmEdk/6cFmXddqi2ulF0edxTwjj+7mqvpVVGQWvbXZdn32wRSHA==", + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/use-latest": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/use-latest/-/use-latest-1.2.1.tgz", + "integrity": "sha512-xA+AVm/Wlg3e2P/JiItTziwS7FK92LWrDB0p+hgXloIMuVCeJJ8v6f0eeHyPZaJrM+usM1FkFfbNCrJGs8A/zw==", + "dependencies": { + "use-isomorphic-layout-effect": "^1.1.1" + }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, "node_modules/use-memo-one": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/use-memo-one/-/use-memo-one-1.1.3.tgz", @@ -13359,6 +14084,27 @@ "react": "^16.8.0 || ^17.0.0 || ^18.0.0" } }, + "node_modules/use-sidecar": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/use-sidecar/-/use-sidecar-1.1.2.tgz", + "integrity": "sha512-epTbsLuzZ7lPClpz2TyryBfztm7m+28DlEv2ZCQ3MDr5ssiwyOwGH/e5F9CkfWjJ1t4clvI58yF822/GUkjjhw==", + "dependencies": { + "detect-node-es": "^1.1.0", + "tslib": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "@types/react": "^16.9.0 || ^17.0.0 || ^18.0.0", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, "node_modules/use-sync-external-store": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz", @@ -13756,6 +14502,14 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/void-elements": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/void-elements/-/void-elements-3.1.0.tgz", + "integrity": "sha512-Dhxzh5HZuiHQhbvTW9AMetFfBHDMYpo23Uo9btPXgdYP+3T5S+p+jgNy7spra+veYhBP2dCSgxR/i2Y02h5/6w==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/w3c-xmlserializer": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-4.0.0.tgz", @@ -13781,6 +14535,11 @@ "makeerror": "1.0.12" } }, + "node_modules/webfontloader": { + "version": "1.6.28", + "resolved": "https://registry.npmjs.org/webfontloader/-/webfontloader-1.6.28.tgz", + "integrity": "sha512-Egb0oFEga6f+nSgasH3E0M405Pzn6y3/9tOVanv/DLfa1YBIgcv90L18YyWnvXkRbIM17v5Kv6IT2N6g1x5tvQ==" + }, "node_modules/webidl-conversions": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", @@ -14174,6 +14933,28 @@ "funding": { "url": "https://github.com/sponsors/sindresorhus" } + }, + "node_modules/yup": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/yup/-/yup-1.4.0.tgz", + "integrity": "sha512-wPbgkJRCqIf+OHyiTBQoJiP5PFuAXaWiJK6AmYkzQAh5/c2K9hzSApBZG5wV9KoKSePF7sAxmNSvh/13YHkFDg==", + "dependencies": { + "property-expr": "^2.0.5", + "tiny-case": "^1.0.3", + "toposort": "^2.0.2", + "type-fest": "^2.19.0" + } + }, + "node_modules/yup/node_modules/type-fest": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", + "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", + "engines": { + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } } } } diff --git a/package.json b/package.json index 3fd89621a7..ebf0f17658 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,8 @@ "node": ">=18.0" }, "dependencies": { + "@greenbone/opensight-ui-components": "^0.1.3-alpha0", + "@mantine/core": "^6.0.0", "@reduxjs/toolkit": "^2.2.5", "@sentry/react": "^8.7.0", "@visx/axis": "^3.10.1", From cf751df7f4c5ffb06ca56e1642235aa0acb4a1a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ricks?= Date: Tue, 16 Apr 2024 11:10:01 +0200 Subject: [PATCH 002/149] Add: Add new components for row and column layouts Both components are based on mantine and flexbox. They are intended to replace Layout especially in dialogs. --- src/web/components/layout/column.jsx | 46 ++++++++++++++++++++++++++++ src/web/components/layout/row.jsx | 46 ++++++++++++++++++++++++++++ 2 files changed, 92 insertions(+) create mode 100644 src/web/components/layout/column.jsx create mode 100644 src/web/components/layout/row.jsx diff --git a/src/web/components/layout/column.jsx b/src/web/components/layout/column.jsx new file mode 100644 index 0000000000..1b88bdd7b4 --- /dev/null +++ b/src/web/components/layout/column.jsx @@ -0,0 +1,46 @@ +/* SPDX-FileCopyrightText: 2024 Greenbone AG + * + * SPDX-License-Identifier: AGPL-3.0-or-later + */ + +import {Flex} from '@mantine/core'; + +import PropTypes from 'web/utils/proptypes'; + +/** + * React component that renders a stack (column) layout + * + */ +const Column = ({ + children, + gap = 'md', + grow, + align = 'stretch', + wrap, + justify = 'flex-start', + ...props +}) => { + return ( + + {children} + + ); +}; + +Column.propTypes = { + align: PropTypes.string, + gap: PropTypes.string, + grow: PropTypes.numberOrNumberString, + justify: PropTypes.string, + wrap: PropTypes.string, +}; + +export default Column; diff --git a/src/web/components/layout/row.jsx b/src/web/components/layout/row.jsx new file mode 100644 index 0000000000..d19883cef9 --- /dev/null +++ b/src/web/components/layout/row.jsx @@ -0,0 +1,46 @@ +/* SPDX-FileCopyrightText: 2024 Greenbone AG + * + * SPDX-License-Identifier: AGPL-3.0-or-later + */ + +import {Flex} from '@mantine/core'; + +import PropTypes from 'web/utils/proptypes'; + +/** + * React component that renders a row layout + * + */ +const Row = ({ + children, + gap = 'md', + grow, + align = 'center', + wrap, + justify, + ...props +}) => { + return ( + + {children} + + ); +}; + +Row.propTypes = { + align: PropTypes.string, + gap: PropTypes.string, + grow: PropTypes.numberOrNumberString, + justify: PropTypes.string, + wrap: PropTypes.string, +}; + +export default Row; From 0d0e5f23a926cc724596150cf7296e022f6aea49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ricks?= Date: Tue, 16 Apr 2024 11:23:44 +0200 Subject: [PATCH 003/149] Add: Add useValueChange hook for form components All form components should be able to call the onChange handler with the value, name pair. Therefore introduce a generic hook to abstract the event handling. --- .../form/__tests__/useValueChange.jsx | 43 +++++++++++++++ src/web/components/form/useValueChange.jsx | 52 +++++++++++++++++++ 2 files changed, 95 insertions(+) create mode 100644 src/web/components/form/__tests__/useValueChange.jsx create mode 100644 src/web/components/form/useValueChange.jsx diff --git a/src/web/components/form/__tests__/useValueChange.jsx b/src/web/components/form/__tests__/useValueChange.jsx new file mode 100644 index 0000000000..c559686db2 --- /dev/null +++ b/src/web/components/form/__tests__/useValueChange.jsx @@ -0,0 +1,43 @@ +/* SPDX-FileCopyrightText: 2024 Greenbone AG + * + * SPDX-License-Identifier: AGPL-3.0-or-later + */ + +import {render, screen, fireEvent} from 'web/utils/testing'; + +import useValueChange from '../useValueChange'; + +const TestComponent = ({value, onChange, name, disabled}) => { + const handleChange = useValueChange({onChange, name, disabled}); + + return ( + + ); +}; + +describe('onValueChange Tests', () => { + test('should call onChange when value changes', () => { + const onChange = jest.fn(); + + render(); + + const input = screen.getByRole('textbox'); + + fireEvent.change(input, {target: {value: 'new value'}}); + + expect(onChange).toHaveBeenCalledTimes(1); + expect(onChange).toHaveBeenCalledWith('new value', 'test'); + }); + + test('should not call onChange when disabled', () => { + const onChange = jest.fn(); + + render(); + + const input = screen.getByRole('textbox'); + + fireEvent.change(input, {target: {value: 'new value'}}); + + expect(onChange).not.toHaveBeenCalled(); + }); +}); diff --git a/src/web/components/form/useValueChange.jsx b/src/web/components/form/useValueChange.jsx new file mode 100644 index 0000000000..b23ecfaf8c --- /dev/null +++ b/src/web/components/form/useValueChange.jsx @@ -0,0 +1,52 @@ +/* SPDX-FileCopyrightText: 2024 Greenbone AG + * + * SPDX-License-Identifier: AGPL-3.0-or-later + */ + +import {useCallback} from 'react'; + +import {isDefined} from 'gmp/utils/identity'; + +const eventTargetValue = event => event.target.value; +const noOpConvert = value => value; +/** + * A hook that handles the change of a value of an input field. + * + * It gets the event target value and optionally converts it. + * value and name are passed to the onChange function. + * + * @param {Object} param0 An object with the following properties: + * - disabled: A boolean that indicates if the value can be changed. + * - name: A string that represents the name of the value. + * - onChange: A function that is called when the value changes. + * - convert: A function that converts the value optionally. + * - valueFunc: A function that gets the value from the event. Defaults to event.target.value. + * @returns A function as a callback that handles the change of a value in an input field. + */ +const useValueChange = ({ + disabled, + name, + onChange, + convert = noOpConvert, + valueFunc = eventTargetValue, +}) => { + const notifyChange = useCallback( + value => { + if (isDefined(onChange) && !disabled) { + onChange(value, name); + } + }, + [disabled, name, onChange], + ); + + const handleChange = useCallback( + event => { + notifyChange(convert(valueFunc(event))); + }, + [notifyChange, convert, valueFunc], + ); + + return handleChange; +}; + +export default useValueChange; From ccb064d44da4eb756133623562935a827a68d256 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ricks?= Date: Tue, 16 Apr 2024 11:28:15 +0200 Subject: [PATCH 004/149] Provide userEvent from @testing-library/user-event@14 Use latest release of userEvent. --- package-lock.json | 20 ++++++++++++-------- package.json | 3 ++- src/web/utils/testing.jsx | 1 + 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index 01058fa7f3..fcd9f07ce4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -56,7 +56,7 @@ "@babel/cli": "^7.24.6", "@testing-library/jest-dom": "^6.4.5", "@testing-library/react": "^15.0.6", - "@testing-library/user-event": "^13.5.0", + "@testing-library/user-event": "^14.0.0", "@types/react": "^18.3.3", "@types/react-dom": "^18.3.0", "@typescript-eslint/eslint-plugin": "^7.12.0", @@ -76,6 +76,7 @@ "jest-styled-components": "^7.2.0", "lint-staged": "^13.1.0", "prettier": "^3.2.5", + "resize-observer-polyfill": "^1.5.1", "typescript": "^5.2.2", "vite": "^5.2.12", "vite-plugin-eslint": "^1.8.1", @@ -4511,15 +4512,12 @@ } }, "node_modules/@testing-library/user-event": { - "version": "13.5.0", - "resolved": "https://registry.npmjs.org/@testing-library/user-event/-/user-event-13.5.0.tgz", - "integrity": "sha512-5Kwtbo3Y/NowpkbRuSepbyMFkZmHgD+vPzYB/RJ4oxt5Gj/avFFBYjhw27cqSVPVw/3a67NK1PbiIr9k4Gwmdg==", + "version": "14.5.2", + "resolved": "https://registry.npmjs.org/@testing-library/user-event/-/user-event-14.5.2.tgz", + "integrity": "sha512-YAh82Wh4TIrxYLmfGcixwD18oIjyC1pFQC2Y01F2lzV2HTMiYrI0nze0FD0ocB//CKS/7jIUgae+adPqxK5yCQ==", "dev": true, - "dependencies": { - "@babel/runtime": "^7.12.5" - }, "engines": { - "node": ">=10", + "node": ">=12", "npm": ">=6" }, "peerDependencies": { @@ -12707,6 +12705,12 @@ "resolved": "https://registry.npmjs.org/reselect/-/reselect-5.1.0.tgz", "integrity": "sha512-aw7jcGLDpSgNDyWBQLv2cedml85qd95/iszJjN988zX1t7AVRJi19d9kto5+W7oCfQ94gyo40dVbT6g2k4/kXg==" }, + "node_modules/resize-observer-polyfill": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/resize-observer-polyfill/-/resize-observer-polyfill-1.5.1.tgz", + "integrity": "sha512-LwZrotdHOo12nQuZlHEmtuXdqGoOD0OhaxopaNFxWzInpEgaLWoVuAMbTzixuosCx2nEG58ngzW3vxdWoxIgdg==", + "dev": true + }, "node_modules/resolve": { "version": "1.22.8", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", diff --git a/package.json b/package.json index ebf0f17658..f6df1a05a4 100644 --- a/package.json +++ b/package.json @@ -79,7 +79,7 @@ "@babel/cli": "^7.24.6", "@testing-library/jest-dom": "^6.4.5", "@testing-library/react": "^15.0.6", - "@testing-library/user-event": "^13.5.0", + "@testing-library/user-event": "^14.0.0", "@types/react": "^18.3.3", "@types/react-dom": "^18.3.0", "@typescript-eslint/eslint-plugin": "^7.12.0", @@ -99,6 +99,7 @@ "jest-styled-components": "^7.2.0", "lint-staged": "^13.1.0", "prettier": "^3.2.5", + "resize-observer-polyfill": "^1.5.1", "typescript": "^5.2.2", "vite": "^5.2.12", "vite-plugin-eslint": "^1.8.1", diff --git a/src/web/utils/testing.jsx b/src/web/utils/testing.jsx index 24c0f7c6aa..21435ed5fb 100644 --- a/src/web/utils/testing.jsx +++ b/src/web/utils/testing.jsx @@ -98,6 +98,7 @@ export const render = ui => { {ui}, ); return { + userEvent: userEvent.setup(), baseElement, container, element: hasValue(container) ? container.firstChild : undefined, From f7810934ec0943bcfcf2873bcb7f53b64d995d89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ricks?= Date: Tue, 16 Apr 2024 11:29:24 +0200 Subject: [PATCH 005/149] Render theme provider for opensight-ui in tests The theme provider is required to be able to test components based on opensight-ui and mantine. --- src/web/utils/testing.jsx | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/web/utils/testing.jsx b/src/web/utils/testing.jsx index 21435ed5fb..abd7066e1e 100644 --- a/src/web/utils/testing.jsx +++ b/src/web/utils/testing.jsx @@ -34,6 +34,8 @@ import { } from '@testing-library/react/pure'; import userEvent from '@testing-library/user-event'; +import {ThemeProvider, theme} from '@greenbone/opensight-ui-components'; + import {Router} from 'react-router-dom'; import {Provider} from 'react-redux'; @@ -93,9 +95,17 @@ export const getByName = (container, name) => { return elements[0]; }; +const Main = ({children}) => { + return ( + + {children} + + ); +}; + export const render = ui => { const {container, baseElement, rerender, ...other} = reactTestingRender( - {ui}, +
{ui}
, ); return { userEvent: userEvent.setup(), @@ -106,10 +116,7 @@ export const render = ui => { getByName: name => getByName(baseElement, name), queryByName: name => queryByName(baseElement, name), queryAllByName: name => queryAllByName(baseElement, name), - rerender: component => - rerender( - {component}, - ), + rerender: component => rerender(
{component}
), ...other, }; }; From 17c66e93217339335a5df039c62ebc3b520bcda4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ricks?= Date: Tue, 16 Apr 2024 11:32:03 +0200 Subject: [PATCH 006/149] Add: Add a useDownload hook The useDownload hook in conjunction with the Download component should replace the withDownload HOC in future. --- src/web/components/form/useDownload.jsx | 37 +++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 src/web/components/form/useDownload.jsx diff --git a/src/web/components/form/useDownload.jsx b/src/web/components/form/useDownload.jsx new file mode 100644 index 0000000000..160b586535 --- /dev/null +++ b/src/web/components/form/useDownload.jsx @@ -0,0 +1,37 @@ +/* SPDX-FileCopyrightText: 2024 Greenbone AG + * + * SPDX-License-Identifier: AGPL-3.0-or-later + */ + +import {useRef, useCallback} from 'react'; + +import logger from 'gmp/log'; + +import {hasValue} from 'gmp/utils/identity'; + +const log = logger.getLogger('web.components.form.useDownload'); + +/** + * Hook to download a file + * + * Should be used in combination with the Download component + * + * @returns Array of downloadRef and download function + */ +const useDownload = () => { + const downloadRef = useRef(null); + + const download = useCallback(({filename, data, mimetype}) => { + if (!hasValue(downloadRef.current)) { + log.warn('Download ref not set.'); + return; + } + + downloadRef.current.setFilename(filename); + downloadRef.current.setData(data, mimetype); + downloadRef.current.download(); + }, []); + return [downloadRef, download]; +}; + +export default useDownload; From 411b94ccd847d786f6702eee04d139215bdf2e60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ricks?= Date: Tue, 16 Apr 2024 11:33:26 +0200 Subject: [PATCH 007/149] Setup ResizeObserver for components based on opensight-ui/mantine The ResizeObserver is required to be able to run the tests for opensight based components. --- src/web/setupTests.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/web/setupTests.js b/src/web/setupTests.js index 3927cd57e0..d4967e727c 100644 --- a/src/web/setupTests.js +++ b/src/web/setupTests.js @@ -23,6 +23,8 @@ import '../setupTests'; // setup additional matchers for vitest import '@testing-library/jest-dom/vitest'; +import * as ResizeObserverModule from 'resize-observer-polyfill'; + global.beforeEach = beforeEach; global.expect = expect; @@ -33,3 +35,5 @@ HTMLAnchorElement.prototype.click = testing.fn(); // createObjectURL is not implemented in JSDOM and required for the Download component window.URL.createObjectURL = testing.fn(); + +global.ResizeObserver = ResizeObserverModule.default; From 53b033eb3437e9ca9d8e6cd53d3179f6654dfb0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ricks?= Date: Tue, 16 Apr 2024 12:08:21 +0200 Subject: [PATCH 008/149] Add: Add a hook to load the user's capabilities from the backend The capabilities of the user are provided via a react context and therefore it should be able to load them independently from the redux store. --- .../hooks/__tests__/useLoadCapabilities.jsx | 46 +++++++++++++++++++ src/web/hooks/useLoadCapabilities.jsx | 45 ++++++++++++++++++ 2 files changed, 91 insertions(+) create mode 100644 src/web/hooks/__tests__/useLoadCapabilities.jsx create mode 100644 src/web/hooks/useLoadCapabilities.jsx diff --git a/src/web/hooks/__tests__/useLoadCapabilities.jsx b/src/web/hooks/__tests__/useLoadCapabilities.jsx new file mode 100644 index 0000000000..8aefc0c858 --- /dev/null +++ b/src/web/hooks/__tests__/useLoadCapabilities.jsx @@ -0,0 +1,46 @@ +/* SPDX-FileCopyrightText: 2024 Greenbone AG + * + * SPDX-License-Identifier: AGPL-3.0-or-later + */ + +import {describe, test, expect, testing} from '@gsa/testing'; + +import {rendererWith, screen, wait} from 'web/utils/testing'; + +import useLoadCapabilities from '../useLoadCapabilities'; + +const TestComponent = () => { + const capabilities = useLoadCapabilities(); + return ( + <> + {capabilities && + capabilities.map(capability => { + return ( +
+ {capability.name} +
+ ); + })} + + ); +}; + +describe('useLoadCapabilities tests', () => { + test('should load capabilities', async () => { + const capabilities = [{name: 'cap_1'}, {name: 'cap_2'}]; + const response = {data: capabilities}; + const gmp = { + user: { + currentCapabilities: testing.fn(() => Promise.resolve(response)), + }, + }; + const {render} = rendererWith({gmp}); + + render(); + + await wait(); + + expect(gmp.user.currentCapabilities).toHaveBeenCalled(); + expect(screen.getAllByTestId('capability').length).toEqual(2); + }); +}); diff --git a/src/web/hooks/useLoadCapabilities.jsx b/src/web/hooks/useLoadCapabilities.jsx new file mode 100644 index 0000000000..63a5ce9ee3 --- /dev/null +++ b/src/web/hooks/useLoadCapabilities.jsx @@ -0,0 +1,45 @@ +/* SPDX-FileCopyrightText: 2024 Greenbone AG + * + * SPDX-License-Identifier: AGPL-3.0-or-later + */ + +import {useEffect, useState} from 'react'; + +import logger from 'gmp/log'; +import Capabilities from 'gmp/capabilities/capabilities'; + +import useGmp from '../utils/useGmp'; + +const log = logger.getLogger('web.useLoadCapabilities'); + +/** + * Hook to load the user's capabilities from the backend + */ +const useLoadCapabilities = () => { + const gmp = useGmp(); + const [capabilities, setCapabilities] = useState(); + + useEffect(() => { + gmp.user + .currentCapabilities() + .then(response => { + const loadedCapabilities = response.data; + log.debug('User capabilities', loadedCapabilities); + setCapabilities(loadedCapabilities); + }) + .catch(rejection => { + if (rejection.isError()) { + log.error( + 'An error occurred during fetching capabilities', + rejection, + ); + } + // use empty capabilities + setCapabilities(new Capabilities()); + }); + }, [gmp.user]); + + return capabilities; +}; + +export default useLoadCapabilities; From 9cea0cf4b70a0790c8c99cb7490582025de8fdb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ricks?= Date: Tue, 16 Apr 2024 12:11:50 +0200 Subject: [PATCH 009/149] Add: Add hooks for handling the filter dialog state Using the new hooks allows to rewrite all filter dialogs to function components more easily. --- .../powerfilter/useFilterDialog.jsx | 86 ++++++++++++++++++ .../powerfilter/useFilterDialogSave.jsx | 87 +++++++++++++++++++ 2 files changed, 173 insertions(+) create mode 100644 src/web/components/powerfilter/useFilterDialog.jsx create mode 100644 src/web/components/powerfilter/useFilterDialogSave.jsx diff --git a/src/web/components/powerfilter/useFilterDialog.jsx b/src/web/components/powerfilter/useFilterDialog.jsx new file mode 100644 index 0000000000..dbf9432dae --- /dev/null +++ b/src/web/components/powerfilter/useFilterDialog.jsx @@ -0,0 +1,86 @@ +/* SPDX-FileCopyrightText: 2024 Greenbone AG + * + * SPDX-License-Identifier: AGPL-3.0-or-later + */ + +import {useCallback, useState} from 'react'; + +import Filter from 'gmp/models/filter'; + +import {isDefined} from 'gmp/utils/identity'; + +/** + * React hook for handling filter dialog state + * + * @param {Filter} initialFilter + * @returns Object + */ +const useFilterDialog = initialFilter => { + const [originalFilter] = useState(initialFilter); + const [filter, setFilter] = useState(() => + isDefined(initialFilter) ? initialFilter.copy() : new Filter(), + ); + const [filterDialogState, setFilterDialogState] = useState({}); + + const [filterString, setFilterString] = useState(() => + isDefined(initialFilter) ? initialFilter.toFilterCriteriaString() : '', + ); + + // eslint-disable-next-line no-shadow + const handleFilterChange = useCallback(filter => { + setFilter(filter); + }, []); + + const handleFilterValueChange = useCallback((value, name, relation = '=') => { + setFilter(filter => filter.copy().set(name, value, relation)); // eslint-disable-line no-shadow + }, []); + + const handleSearchTermChange = useCallback((value, name, relation = '~') => { + setFilter(filter => filter.copy().set(name, `"${value}"`, relation)); // eslint-disable-line no-shadow + }, []); + + const handleFilterStringChange = useCallback(value => { + setFilterString(value); + }, []); + + const handleSortByChange = useCallback(value => { + setFilter(filter => filter.copy().setSortBy(value)); // eslint-disable-line no-shadow + }, []); + + const handleSortOrderChange = useCallback(value => { + setFilter(filter => filter.copy().setSortOrder(value)); // eslint-disable-line no-shadow + }, []); + + const handleChange = useCallback((value, name) => { + setFilterDialogState(state => ({...state, [name]: value})); + }, []); + + const {filterName, saveNamedFilter, ...other} = filterDialogState; + + return { + ...other, + filter, + filterString, + filterName, + originalFilter, + saveNamedFilter, + handleFilterChange, + handleFilterValueChange, + handleSearchTermChange, + handleFilterStringChange, + handleSortByChange, + handleSortOrderChange, + handleChange, + // provide old names + filterstring: filterString, + onFilterChange: handleFilterChange, + onFilterValueChange: handleFilterValueChange, + onSearchTermChange: handleSearchTermChange, + onFilterStringChange: handleFilterStringChange, + onSortOrderChange: handleSortOrderChange, + onSortByChange: handleSortByChange, + onValueChange: handleChange, + }; +}; + +export default useFilterDialog; diff --git a/src/web/components/powerfilter/useFilterDialogSave.jsx b/src/web/components/powerfilter/useFilterDialogSave.jsx new file mode 100644 index 0000000000..9adaa8df8f --- /dev/null +++ b/src/web/components/powerfilter/useFilterDialogSave.jsx @@ -0,0 +1,87 @@ +/* SPDX-FileCopyrightText: 2024 Greenbone AG + * + * SPDX-License-Identifier: AGPL-3.0-or-later + */ + +import {useCallback} from 'react'; + +import Filter from 'gmp/models/filter'; + +import {apiType} from 'gmp/utils/entitytype'; +import {isDefined} from 'gmp/utils/identity'; + +import useTranslation from 'web/hooks/useTranslation'; +import useGmp from 'web/utils/useGmp'; + +const useFilterDialogSave = ( + createFilterType, + {onClose, onFilterChanged, onFilterCreated}, + {filterName, filter, filterString, originalFilter, saveNamedFilter}, +) => { + const [_] = useTranslation(); + const gmp = useGmp(); + + const createFilter = useCallback( + newFilter => { + return gmp.filter + .create({ + term: newFilter.toFilterString(), + type: apiType(createFilterType), + name: filterName, + }) + .then(response => { + const {data} = response; + // load new filter + return gmp.filter.get(data); + }) + .then(response => { + const {data: f} = response; + + if (isDefined(onFilterCreated)) { + onFilterCreated(f); + } + }); + }, + [gmp, createFilterType, filterName, onFilterCreated], + ); + + const handleSave = useCallback(() => { + const newFilter = filter + .copy() + .mergeKeywords(Filter.fromString(filterString)); + + if (saveNamedFilter) { + if (isDefined(filterName) && filterName.trim().length > 0) { + return createFilter(newFilter).then(onClose); + } + return Promise.reject( + new Error(_('Please insert a name for the new filter')), + ); + } + + if (isDefined(onFilterChanged) && !newFilter.equals(originalFilter)) { + onFilterChanged(newFilter); + } + + if (isDefined(onClose)) { + onClose(); + } + return Promise.resolve(); + }, [ + onClose, + onFilterChanged, + createFilter, + filter, + filterString, + filterName, + originalFilter, + saveNamedFilter, + _, + ]); + + const ret = [handleSave]; + ret.handleSave = handleSave; + return ret; +}; + +export default useFilterDialogSave; From 066583d677b8027fe250a99c964731ac2835c3b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ricks?= Date: Tue, 16 Apr 2024 12:13:29 +0200 Subject: [PATCH 010/149] Add theme provider for opensight-ui based components When rendering the react app the theme provider for mantine is required. --- src/web/app.jsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/web/app.jsx b/src/web/app.jsx index d26cedd3ac..a9f6bde540 100644 --- a/src/web/app.jsx +++ b/src/web/app.jsx @@ -19,6 +19,8 @@ import React from 'react'; import {Provider as StoreProvider} from 'react-redux'; +import {ThemeProvider, theme} from '@greenbone/opensight-ui-components'; + import Gmp from 'gmp'; import GmpSettings from 'gmp/gmpsettings'; @@ -99,7 +101,7 @@ class App extends React.Component { render() { return ( - + @@ -110,7 +112,7 @@ class App extends React.Component { - + ); } } From 43601a46c04948cb8d857fde810650630dcfc645 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ricks?= Date: Tue, 16 Apr 2024 12:16:15 +0200 Subject: [PATCH 011/149] Change: Refactor all form UI components Use opensight-ui and mantine for all form components. With this change all the form components are refreshed in their visual appearance. --- .../__tests__/__snapshots__/button.jsx.snap | 77 --- .../__tests__/__snapshots__/checkbox.jsx.snap | 111 ----- .../__tests__/__snapshots__/download.jsx.snap | 20 - .../__tests__/__snapshots__/field.jsx.snap | 89 ---- .../__snapshots__/filefield.jsx.snap | 52 -- .../__snapshots__/formgroup.jsx.snap | 114 ----- .../__snapshots__/loadingbutton.jsx.snap | 173 ------- .../__snapshots__/multiselect.jsx.snap | 357 -------------- .../__snapshots__/numberfield.jsx.snap | 7 - .../__snapshots__/passwordfield.jsx.snap | 91 ---- .../__tests__/__snapshots__/radio.jsx.snap | 217 -------- .../__tests__/__snapshots__/select.jsx.snap | 355 -------------- .../__snapshots__/selectelement.jsx.snap | 462 ------------------ .../__tests__/__snapshots__/spinner.jsx.snap | 101 ---- .../__tests__/__snapshots__/textarea.jsx.snap | 75 --- .../__snapshots__/textfield.jsx.snap | 91 ---- .../__snapshots__/timezoneselect.jsx.snap | 178 ------- .../__snapshots__/yesnoradio.jsx.snap | 153 ------ src/web/components/form/__tests__/button.jsx | 47 +- .../components/form/__tests__/checkbox.jsx | 44 +- .../components/form/__tests__/download.jsx | 4 +- src/web/components/form/__tests__/field.jsx | 81 --- .../components/form/__tests__/filefield.jsx | 18 +- .../components/form/__tests__/formgroup.jsx | 64 +-- .../form/__tests__/loadingbutton.jsx | 100 ---- .../components/form/__tests__/multiselect.jsx | 142 +++--- .../components/form/__tests__/numberfield.jsx | 215 +++----- .../form/__tests__/passwordfield.jsx | 58 ++- src/web/components/form/__tests__/radio.jsx | 90 +--- src/web/components/form/__tests__/select.jsx | 165 ++++--- .../form/__tests__/selectelement.jsx | 324 ------------ src/web/components/form/__tests__/spinner.jsx | 257 +++++----- .../components/form/__tests__/textarea.jsx | 54 +- .../components/form/__tests__/textfield.jsx | 42 +- .../form/__tests__/timezoneselect.jsx | 54 +- .../form/__tests__/useFormValidation.jsx | 9 +- .../form/__tests__/useValueChange.jsx | 17 +- .../components/form/__tests__/yesnoradio.jsx | 41 +- src/web/components/form/button.jsx | 98 ++-- src/web/components/form/checkbox.jsx | 79 ++- src/web/components/form/field.jsx | 99 ---- src/web/components/form/filefield.jsx | 45 +- src/web/components/form/formgroup.jsx | 117 +---- src/web/components/form/loadingbutton.jsx | 42 -- src/web/components/form/multiselect.jsx | 347 +++---------- src/web/components/form/numberfield.jsx | 260 +++------- src/web/components/form/passwordfield.jsx | 52 +- src/web/components/form/radio.jsx | 127 ++--- src/web/components/form/select.jsx | 325 +++--------- src/web/components/form/selectelements.jsx | 282 ----------- src/web/components/form/spinner.jsx | 294 +---------- src/web/components/form/textarea.jsx | 99 ++-- src/web/components/form/textfield.jsx | 53 +- src/web/components/form/timezoneselect.jsx | 40 +- src/web/components/form/useFormValidation.jsx | 8 +- src/web/components/form/yesnoradio.jsx | 46 +- 56 files changed, 1143 insertions(+), 5819 deletions(-) delete mode 100644 src/web/components/form/__tests__/__snapshots__/button.jsx.snap delete mode 100644 src/web/components/form/__tests__/__snapshots__/checkbox.jsx.snap delete mode 100644 src/web/components/form/__tests__/__snapshots__/download.jsx.snap delete mode 100644 src/web/components/form/__tests__/__snapshots__/field.jsx.snap delete mode 100644 src/web/components/form/__tests__/__snapshots__/filefield.jsx.snap delete mode 100644 src/web/components/form/__tests__/__snapshots__/formgroup.jsx.snap delete mode 100644 src/web/components/form/__tests__/__snapshots__/loadingbutton.jsx.snap delete mode 100644 src/web/components/form/__tests__/__snapshots__/multiselect.jsx.snap delete mode 100644 src/web/components/form/__tests__/__snapshots__/numberfield.jsx.snap delete mode 100644 src/web/components/form/__tests__/__snapshots__/passwordfield.jsx.snap delete mode 100644 src/web/components/form/__tests__/__snapshots__/radio.jsx.snap delete mode 100644 src/web/components/form/__tests__/__snapshots__/select.jsx.snap delete mode 100644 src/web/components/form/__tests__/__snapshots__/selectelement.jsx.snap delete mode 100644 src/web/components/form/__tests__/__snapshots__/spinner.jsx.snap delete mode 100644 src/web/components/form/__tests__/__snapshots__/textarea.jsx.snap delete mode 100644 src/web/components/form/__tests__/__snapshots__/textfield.jsx.snap delete mode 100644 src/web/components/form/__tests__/__snapshots__/timezoneselect.jsx.snap delete mode 100644 src/web/components/form/__tests__/__snapshots__/yesnoradio.jsx.snap delete mode 100644 src/web/components/form/__tests__/field.jsx delete mode 100644 src/web/components/form/__tests__/loadingbutton.jsx delete mode 100644 src/web/components/form/__tests__/selectelement.jsx delete mode 100644 src/web/components/form/field.jsx delete mode 100644 src/web/components/form/loadingbutton.jsx delete mode 100644 src/web/components/form/selectelements.jsx diff --git a/src/web/components/form/__tests__/__snapshots__/button.jsx.snap b/src/web/components/form/__tests__/__snapshots__/button.jsx.snap deleted file mode 100644 index d242844dc2..0000000000 --- a/src/web/components/form/__tests__/__snapshots__/button.jsx.snap +++ /dev/null @@ -1,77 +0,0 @@ -// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html - -exports[`Button tests > should render button 1`] = ` -.c0 { - display: inline-block; - padding: 0 15px; - color: #4C4C4C; - text-align: center; - vertical-align: middle; - font-size: 11px; - font-weight: bold; - line-height: 30px; - -webkit-text-decoration: none; - text-decoration: none; - white-space: nowrap; - background-color: #fff; - border-radius: 2px; - border: 1px solid #bfbfbf; - cursor: pointer; - overflow: visible; - z-index: 1; -} - -.c0:focus, -.c0:hover { - border: 1px solid #4C4C4C; -} - -.c0:hover { - -webkit-text-decoration: none; - text-decoration: none; - background: #11ab51; - font-weight: bold; - color: #fff; -} - -.c0[disabled] { - cursor: not-allowed; - opacity: 0.65; - box-shadow: none; -} - -.c0 img { - height: 32px; - width: 32px; - margin-top: 5px 10px 5px -10px; - vertical-align: middle; -} - -.c0:link { - -webkit-text-decoration: none; - text-decoration: none; - color: #4C4C4C; -} - -.c1 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - - - - - -
-
-
-
- - - -
- -`; - -exports[`New Report Config Dialog component tests > should render dialog 1`] = ` -.c3 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: justify; - -webkit-justify-content: space-between; - justify-content: space-between; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c7 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - -webkit-box-flex: 1; - -webkit-flex-grow: 1; - -ms-flex-positive: 1; - flex-grow: 1; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-align-items: flex-start; - -webkit-box-align: flex-start; - -ms-flex-align: flex-start; - align-items: flex-start; -} - -.c10 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-align-items: stretch; - -webkit-box-align: stretch; - -ms-flex-align: stretch; - align-items: stretch; -} - -.c13 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: start; - -ms-flex-pack: start; - -webkit-justify-content: start; - justify-content: start; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c23 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c26 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-flex-shrink: 0; - -ms-flex-negative: 0; - flex-shrink: 0; - -webkit-box-pack: end; - -ms-flex-pack: end; - -webkit-justify-content: flex-end; - justify-content: flex-end; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c1 { - position: relative; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - margin: 10% auto; - border: 0; - outline: 0; - width: 800px; - height: px; -} - -.c0 { - position: fixed; - font-family: Trebuchet MS,Tahoma,Verdana,Arial,sans-serif; - font-size: 1.1em; - top: 0; - right: 0; - bottom: 0; - left: 0; - margin: 0; - background: rgba(102, 102, 102, 0.5); - z-index: 600; - -webkit-transition: opacity 1s ease-in; - transition: opacity 1s ease-in; - width: 100%; - height: 100%; -} - -.c33 { - width: 0; - height: 0; - cursor: nwse-resize; - border-right: 20px solid transparent; - border-bottom: 20px solid transparent; - border-top: 20px solid #fff; -} - -.c32 { - position: absolute; - bottom: 3px; - right: 3px; - width: 20px; - height: 20px; - background: repeating-linear-gradient( -45deg, transparent, transparent 2px, #000 2px, #000 3px ); -} - -.c2 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - height: inherit; - padding: 0; - background: #fff; - box-shadow: 5px 5px 10px #7F7F7F; - border-radius: 3px; - border: 1px solid #7F7F7F; -} - -.c5 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - font-weight: bold; - font-size: 12px; - font-family: Verdana,sans-serif; - color: #074320; - cursor: pointer; - border-radius: 2px; - padding: 0; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-flex-shrink: 0; - -ms-flex-negative: 0; - flex-shrink: 0; -} - -.c5 :hover { - border: 1px solid #074320; -} - -.c6 { - height: 24px; - width: 24px; - line-height: 24px; -} - -.c6 * { - height: inherit; - width: inherit; -} - -.c29 { - display: inline-block; - padding: 0 15px; - color: #4C4C4C; - text-align: center; - vertical-align: middle; - font-size: 11px; - font-weight: bold; - line-height: 30px; - -webkit-text-decoration: none; - text-decoration: none; - white-space: nowrap; - background-color: #fff; - border-radius: 2px; - border: 1px solid #bfbfbf; - cursor: pointer; - overflow: visible; - z-index: 1; -} - -.c29:focus, -.c29:hover { - border: 1px solid #4C4C4C; -} - -.c29:hover { - -webkit-text-decoration: none; - text-decoration: none; - background: #11ab51; - font-weight: bold; - color: #fff; -} - -.c29[disabled] { - cursor: not-allowed; - opacity: 0.65; - box-shadow: none; -} - -.c29 img { - height: 32px; - width: 32px; - margin-top: 5px 10px 5px -10px; - vertical-align: middle; -} - -.c29:link { - -webkit-text-decoration: none; - text-decoration: none; - color: #4C4C4C; -} - -.c30 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c31 { - border: 1px solid #7F7F7F; - color: #fff; - background: #11ab51; -} - -.c31 :hover { - color: #074320; - background: #A1DDBA; -} - -.c27 { - border-width: 1px 0 0 0; - border-style: solid; - border-color: #e5e5e5; - margin-top: 15px; - padding: 10px 20px 10px 20px; -} - -.c28 { - -webkit-box-pack: justify; - -webkit-justify-content: space-between; - justify-content: space-between; -} - -.c4 { - padding: 5px 5px 5px 10px; - margin-bottom: 15px; - border-radius: 2px 2px 0 0; - border-bottom: 1px solid #7F7F7F; - color: #fff; - font-weight: bold; - background: #11ab51; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: justify; - -webkit-justify-content: space-between; - justify-content: space-between; - -webkit-flex-shrink: 0; - -ms-flex-negative: 0; - flex-shrink: 0; - cursor: -webkit-grab; - cursor: grab; -} - -.c9 { - overflow: auto; - padding: 0 15px; - width: 100%; - height: 100%; - max-height: 400px; -} - -.c8 { - overflow: hidden; - height: 100%; -} - -.c11 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: start; - -ms-flex-pack: start; - -webkit-justify-content: start; - justify-content: start; - padding-bottom: 10px; -} - -.c12 { - display: inline-block; - max-width: 100%; - font-weight: bold; - text-align: right; - padding-left: 10px; - padding-right: 10px; - width: 16.66666667%; - margin-left: 0; -} - -.c14 { - width: 83.33333333%; - padding-left: 10px; - padding-right: 10px; -} - -.c24 { - background-color: transparent; - border: none; - cursor: pointer; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - outline: none; - margin: 1px; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - cursor: pointer; -} - -.c25 { - height: 16px; - width: 16px; - line-height: 16px; -} - -.c25 * { - height: inherit; - width: inherit; -} - -.c20 { - border: 1px solid #bfbfbf; - border-radius: 2px; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-align-items: stretch; - -webkit-box-align: stretch; - -ms-flex-align: stretch; - align-items: stretch; - -webkit-box-flex: 1; - -webkit-flex-grow: 1; - -ms-flex-positive: 1; - flex-grow: 1; - padding: 1px 5px; - background-color: #fff; - color: #000; - font-weight: normal; -} - -.c19 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - position: relative; - width: 180px; -} - -.c21 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-flex: 1; - -webkit-flex-grow: 1; - -ms-flex-positive: 1; - flex-grow: 1; - word-break: keep-all; - white-space: nowrap; - overflow: hidden; - cursor: pointer; -} - -.c17 { - color: #c12c30; - font-weight: bold; - font-size: 19px; - padding-bottom: 1px; - padding-left: 4px; - display: none; -} - -.c22 { - cursor: default; -} - -.c18 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; -} - -.c15 { - font-family: inherit; - font-size: inherit; - line-height: inherit; - display: block; - height: 22px; - color: #4C4C4C; - background-color: #fff; - background-image: none; - border: 1px solid #bfbfbf; - border-radius: 2px; - padding: 1px 8px; -} - -.c15:-webkit-autofill { - box-shadow: 0 0 0 1000px white inset; -} - -.c16 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-flex: 1; - -webkit-flex-grow: 1; - -ms-flex-positive: 1; - flex-grow: 1; - -webkit-box-pack: start; - -ms-flex-pack: start; - -webkit-justify-content: start; - justify-content: start; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - - -
-
-
- -
-
- -`; diff --git a/src/web/pages/reportconfigs/__tests__/__snapshots__/listpage.jsx.snap b/src/web/pages/reportconfigs/__tests__/__snapshots__/listpage.jsx.snap deleted file mode 100644 index 60016ebc7d..0000000000 --- a/src/web/pages/reportconfigs/__tests__/__snapshots__/listpage.jsx.snap +++ /dev/null @@ -1,1883 +0,0 @@ -// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html - -exports[`ReportConfigsPage tests > ReportConfigsPage ToolBarIcons test > should render 1`] = ` -.c0 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: start; - -ms-flex-pack: start; - -webkit-justify-content: start; - justify-content: start; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c2 { - margin-left: -5px; -} - -.c2>* { - display: -webkit-inline-box; - display: -webkit-inline-flex; - display: -ms-inline-flexbox; - display: inline-flex; -} - -.c2>* { - margin-left: 5px; -} - -.c1 { - display: -webkit-inline-box; - display: -webkit-inline-flex; - display: -ms-inline-flexbox; - display: inline-flex; -} - -.c4 { - cursor: pointer; -} - -.c3 { - height: 16px; - width: 16px; - line-height: 16px; -} - -.c3 * { - height: inherit; - width: inherit; -} - -@media print { - .c4 { - display: none; - } -} - -
-
- - - - - - - - - - - - - - - - - - -
-
-`; - -exports[`ReportConfigsPage tests > should render full ReportConfigsPage 1`] = ` -.c0 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - -webkit-box-flex: 1; - -webkit-flex-grow: 1; - -ms-flex-positive: 1; - flex-grow: 1; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-align-items: stretch; - -webkit-box-align: stretch; - -ms-flex-align: stretch; - align-items: stretch; -} - -.c1 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: justify; - -webkit-justify-content: space-between; - justify-content: space-between; - -webkit-align-items: flex-start; - -webkit-box-align: flex-start; - -ms-flex-align: flex-start; - align-items: flex-start; -} - -.c2 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: start; - -ms-flex-pack: start; - -webkit-justify-content: start; - justify-content: start; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c7 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-flex: 1; - -webkit-flex-grow: 1; - -ms-flex-positive: 1; - flex-grow: 1; - -webkit-box-pack: end; - -ms-flex-pack: end; - -webkit-justify-content: flex-end; - justify-content: flex-end; -} - -.c8 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - -webkit-box-pack: start; - -ms-flex-pack: start; - -webkit-justify-content: flex-start; - justify-content: flex-start; - -webkit-align-items: stetch; - -webkit-box-align: stetch; - -ms-flex-align: stetch; - align-items: stetch; -} - -.c9 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: justify; - -webkit-justify-content: space-between; - justify-content: space-between; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c10 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: start; - -ms-flex-pack: start; - -webkit-justify-content: flex-start; - justify-content: flex-start; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c21 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c24 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: justify; - -webkit-justify-content: space-between; - justify-content: space-between; - -webkit-align-items: flex-end; - -webkit-box-align: flex-end; - -ms-flex-align: flex-end; - align-items: flex-end; -} - -.c28 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: start; - -ms-flex-pack: start; - -webkit-justify-content: flex-start; - justify-content: flex-start; - -webkit-align-items: flex-end; - -webkit-box-align: flex-end; - -ms-flex-align: flex-end; - align-items: flex-end; -} - -.c33 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-flex: 1; - -webkit-flex-grow: 1; - -ms-flex-positive: 1; - flex-grow: 1; - -webkit-box-pack: justify; - -webkit-justify-content: space-between; - justify-content: space-between; -} - -.c35 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: end; - -ms-flex-pack: end; - -webkit-justify-content: flex-end; - justify-content: flex-end; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c47 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; -} - -.c48 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-align-items: stretch; - -webkit-box-align: stretch; - -ms-flex-align: stretch; - align-items: stretch; -} - -.c49 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: justify; - -webkit-justify-content: space-between; - justify-content: space-between; -} - -.c52 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-flex: 1; - -webkit-flex-grow: 1; - -ms-flex-positive: 1; - flex-grow: 1; - -webkit-box-pack: start; - -ms-flex-pack: start; - -webkit-justify-content: start; - justify-content: start; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c53 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-flex: 1; - -webkit-flex-grow: 1; - -ms-flex-positive: 1; - flex-grow: 1; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c51 { - display: -webkit-inline-box; - display: -webkit-inline-flex; - display: -ms-inline-flexbox; - display: inline-flex; -} - -.c4 { - margin-left: -5px; -} - -.c4>* { - display: -webkit-inline-box; - display: -webkit-inline-flex; - display: -ms-inline-flexbox; - display: inline-flex; -} - -.c4>* { - margin-left: 5px; -} - -.c3 { - display: -webkit-inline-box; - display: -webkit-inline-flex; - display: -ms-inline-flexbox; - display: inline-flex; -} - -.c6 { - cursor: pointer; -} - -.c37 svg path { - fill: #bfbfbf; -} - -.c5 { - height: 16px; - width: 16px; - line-height: 16px; -} - -.c5 * { - height: inherit; - width: inherit; -} - -.c30 { - height: 50px; - width: 50px; - line-height: 50px; -} - -.c30 * { - height: inherit; - width: inherit; -} - -.c25 { - margin: 10px 0px; - padding-bottom: 1px; - border-bottom: 2px solid #e5e5e5; - position: relative; -} - -.c26 { - margin: 0 0 1px 0; -} - -.c27 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: start; - -ms-flex-pack: start; - -webkit-justify-content: flex-start; - justify-content: flex-start; - -webkit-align-items: stretch; - -webkit-box-align: stretch; - -ms-flex-align: stretch; - align-items: stretch; -} - -.c29 { - margin-right: 5px; -} - -.c31 { - word-break: break-all; - min-width: 100px; -} - -.c22 { - background-color: transparent; - border: none; - cursor: pointer; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - outline: none; - margin: 1px; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - cursor: pointer; -} - -.c23 { - height: 16px; - width: 16px; - line-height: 16px; -} - -.c23 * { - height: inherit; - width: inherit; -} - -.c18 { - border: 1px solid #bfbfbf; - border-radius: 2px; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-align-items: stretch; - -webkit-box-align: stretch; - -ms-flex-align: stretch; - align-items: stretch; - -webkit-box-flex: 1; - -webkit-flex-grow: 1; - -ms-flex-positive: 1; - flex-grow: 1; - padding: 1px 5px; - background-color: #fff; - color: #000; - font-weight: normal; -} - -.c17 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - position: relative; - width: 150px; -} - -.c54 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - position: relative; - width: 180px; -} - -.c19 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-flex: 1; - -webkit-flex-grow: 1; - -ms-flex-positive: 1; - flex-grow: 1; - word-break: keep-all; - white-space: nowrap; - overflow: hidden; - cursor: pointer; -} - -.c15 { - color: #c12c30; - font-weight: bold; - font-size: 19px; - padding-bottom: 1px; - padding-left: 4px; - display: none; -} - -.c20 { - cursor: default; -} - -.c16 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; -} - -.c39 { - border: 0; - border-spacing: 0px; - font-size: 12px; - text-align: left; - table-layout: auto; - width: 100%; -} - -.c40 th, -.c40 td { - padding: 4px 10px; - border-bottom: 1px solid #e5e5e5; -} - -.c40 tfoot tr { - background: #fff; -} - -.c40 tfoot tr td { - border-bottom: 1px solid #e5e5e5; -} - -.c42 a { - -webkit-text-decoration: none; - text-decoration: none; - color: #000; -} - -.c42 a:hover { - -webkit-text-decoration: underline; - text-decoration: underline; - color: #000; -} - -.c44 { - cursor: pointer; -} - -.c43 { - background-color: #fff; - color: #000; - border-top: 1px solid #e5e5e5; - font-weight: bold; - width: 25%; -} - -.c45 { - background-color: #fff; - color: #000; - border-top: 1px solid #e5e5e5; - font-weight: bold; - width: 50%; -} - -.c46 { - background-color: #fff; - color: #000; - border-top: 1px solid #e5e5e5; - font-weight: bold; - width: 8%; -} - -.c13 { - font-family: inherit; - font-size: inherit; - line-height: inherit; - display: block; - height: 22px; - color: #4C4C4C; - background-color: #fff; - background-image: none; - border: 1px solid #bfbfbf; - border-radius: 2px; - padding: 1px 8px; -} - -.c13:-webkit-autofill { - box-shadow: 0 0 0 1000px white inset; -} - -.c14 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: start; - -ms-flex-pack: start; - -webkit-justify-content: start; - justify-content: start; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c12 { - margin-right: 5px; -} - -.c11 { - margin-right: 5px; -} - -.c55 { - font-size: 10px; - color: #7F7F7F; - text-align: left; -} - -.c38 { - margin: 0 3px; -} - -.c36 { - margin: 2px 3px; -} - -.c41 { - opacity: 1.0; -} - -.c34 { - margin-top: 2px; - margin-left: 2px; -} - -.c32 { - margin-top: 20px; -} - -.c50 { - cursor: pointer; - -webkit-text-decoration: none; - text-decoration: none; - color: #0a53b8; -} - -.c50 :hover { - -webkit-text-decoration: underline; - text-decoration: underline; - color: #0a53b8; -} - -@media print { - .c6 { - display: none; - } -} - -@media print { - .c39 { - border-collapse: collapse; - } -} - -@media screen { - .c40>tbody:nth-of-type(even), - .c40>tbody:only-of-type>tr:nth-of-type(even) { - background: #f3f3f3; - } - - .c40>tbody:not(:only-of-type):hover, - .c40>tbody:only-of-type>tr:hover { - background: #e5e5e5; - } -} - -@media print { - .c42 { - border-bottom: 1px solid black; - } - - .c42 a, - .c42 a:hover { - -webkit-text-decoration: none; - text-decoration: none; - color: #000; - } -} - -@media print { - .c43 { - color: #000; - font-size: 1.2em; - background-color: transparent; - font-weight: bold; - } -} - -@media print { - .c45 { - color: #000; - font-size: 1.2em; - background-color: transparent; - font-weight: bold; - } -} - -@media print { - .c46 { - color: #000; - font-size: 1.2em; - background-color: transparent; - font-weight: bold; - } -} - -@media print { - .c36 svg { - display: none; - } -} - -@media print { - .c50 { - color: #000; - } -} - - -
-
-
-
-
-
- - - - - - - - - - - - - - - - - - -
-
-
-
-
-
-
-
- - -
- × -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- -
-
-
-
-
-
-

-
- - - - - - - -
-
- Report Configs 0 of 0 -
-

-
-
-
-
-
- - - - - - - - - -
-
-
- - - - - - - - - - - - - - - - - - -
-
- - 0 - 0 of 0 - -
-
- - - - - - - - - - - - - - - - - - -
-
-
-
- - - - - - - - - - - - - - - - - - - - -
- -
- Name -
-
-
- -
- Report Format -
-
-
-
- Actions -
-
-
-
-
- - - foo - - -
-
-
- ( - bar - ) -
-
-
-
- - - baz - - -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
-
-
-
- -
-
- - - - - - - - - - - - - - -
-
-
-
-
-
-
-
- (Applied filter: ) -
-
-
-
- - - - - - - - - - - - - - - - - - -
-
- - 0 - 0 of 0 - -
-
- - - - - - - - - - - - - - - - - - -
-
-
-
-
-
-
-
- -
- -`; diff --git a/src/web/pages/reportconfigs/__tests__/__snapshots__/row.jsx.snap b/src/web/pages/reportconfigs/__tests__/__snapshots__/row.jsx.snap deleted file mode 100644 index 480de3ed58..0000000000 --- a/src/web/pages/reportconfigs/__tests__/__snapshots__/row.jsx.snap +++ /dev/null @@ -1,719 +0,0 @@ -// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html - -exports[`Report Config row tests > should render 1`] = ` -.c0 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-align-items: stretch; - -webkit-box-align: stretch; - -ms-flex-align: stretch; - align-items: stretch; -} - -.c1 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: justify; - -webkit-justify-content: space-between; - justify-content: space-between; -} - -.c5 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - -webkit-box-flex: 1; - -webkit-flex-grow: 1; - -ms-flex-positive: 1; - flex-grow: 1; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-align-items: stretch; - -webkit-box-align: stretch; - -ms-flex-align: stretch; - align-items: stretch; -} - -.c6 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-flex: 1; - -webkit-flex-grow: 1; - -ms-flex-positive: 1; - flex-grow: 1; - -webkit-box-pack: start; - -ms-flex-pack: start; - -webkit-justify-content: start; - justify-content: start; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c8 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-flex: 1; - -webkit-flex-grow: 1; - -ms-flex-positive: 1; - flex-grow: 1; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c4 { - display: -webkit-inline-box; - display: -webkit-inline-flex; - display: -ms-inline-flexbox; - display: inline-flex; -} - -.c9 { - margin-left: -5px; -} - -.c9>* { - display: -webkit-inline-box; - display: -webkit-inline-flex; - display: -ms-inline-flexbox; - display: inline-flex; -} - -.c9>* { - margin-left: 5px; -} - -.c7 { - display: -webkit-inline-box; - display: -webkit-inline-flex; - display: -ms-inline-flexbox; - display: inline-flex; -} - -.c10 { - cursor: pointer; -} - -.c3 { - height: 16px; - width: 16px; - line-height: 16px; -} - -.c3 * { - height: inherit; - width: inherit; -} - -.c2 { - cursor: pointer; - -webkit-text-decoration: none; - text-decoration: none; - color: #0a53b8; -} - -.c2 :hover { - -webkit-text-decoration: underline; - text-decoration: underline; - color: #0a53b8; -} - -@media print { - .c10 { - display: none; - } -} - -@media print { - .c2 { - color: #000; - } -} - - -
-
- - -
-
-
- - - foo - - -
- - - - - - - - - -
-
- ( - bar - ) -
-
- - -
- - - baz - - -
- - -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
- - -
- -`; - -exports[`Report Config row tests > should render orphan 1`] = ` -.c0 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-align-items: stretch; - -webkit-box-align: stretch; - -ms-flex-align: stretch; - align-items: stretch; -} - -.c1 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: justify; - -webkit-justify-content: space-between; - justify-content: space-between; -} - -.c4 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - -webkit-box-flex: 1; - -webkit-flex-grow: 1; - -ms-flex-positive: 1; - flex-grow: 1; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-align-items: stretch; - -webkit-box-align: stretch; - -ms-flex-align: stretch; - align-items: stretch; -} - -.c5 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-flex: 1; - -webkit-flex-grow: 1; - -ms-flex-positive: 1; - flex-grow: 1; - -webkit-box-pack: start; - -ms-flex-pack: start; - -webkit-justify-content: start; - justify-content: start; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c7 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-flex: 1; - -webkit-flex-grow: 1; - -ms-flex-positive: 1; - flex-grow: 1; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c8 { - margin-left: -5px; -} - -.c8>* { - display: -webkit-inline-box; - display: -webkit-inline-flex; - display: -ms-inline-flexbox; - display: inline-flex; -} - -.c8>* { - margin-left: 5px; -} - -.c6 { - display: -webkit-inline-box; - display: -webkit-inline-flex; - display: -ms-inline-flexbox; - display: inline-flex; -} - -.c9 { - cursor: pointer; -} - -.c3 { - height: 16px; - width: 16px; - line-height: 16px; -} - -.c3 * { - height: inherit; - width: inherit; -} - -.c2 { - cursor: pointer; - -webkit-text-decoration: none; - text-decoration: none; - color: #0a53b8; -} - -.c2 :hover { - -webkit-text-decoration: underline; - text-decoration: underline; - color: #0a53b8; -} - -@media print { - .c9 { - display: none; - } -} - -@media print { - .c2 { - color: #000; - } -} - - -
-
- - -
-
-
- - Orphan - - - - foo - - -
- - - - - - - - - -
-
- ( - bar - ) -
-
- - -
- - 4321 - -
- - -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
- - -
- -`; diff --git a/src/web/pages/reportconfigs/__tests__/__snapshots__/table.jsx.snap b/src/web/pages/reportconfigs/__tests__/__snapshots__/table.jsx.snap deleted file mode 100644 index eafe1dcb5e..0000000000 --- a/src/web/pages/reportconfigs/__tests__/__snapshots__/table.jsx.snap +++ /dev/null @@ -1,1465 +0,0 @@ -// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html - -exports[`Scan Config table tests > should render 1`] = ` -.c0 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - -webkit-box-flex: 1; - -webkit-flex-grow: 1; - -ms-flex-positive: 1; - flex-grow: 1; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-align-items: stretch; - -webkit-box-align: stretch; - -ms-flex-align: stretch; - align-items: stretch; -} - -.c2 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-flex: 1; - -webkit-flex-grow: 1; - -ms-flex-positive: 1; - flex-grow: 1; - -webkit-box-pack: justify; - -webkit-justify-content: space-between; - justify-content: space-between; -} - -.c6 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: end; - -ms-flex-pack: end; - -webkit-justify-content: flex-end; - justify-content: flex-end; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c8 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: start; - -ms-flex-pack: start; - -webkit-justify-content: start; - justify-content: start; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c20 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; -} - -.c21 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-align-items: stretch; - -webkit-box-align: stretch; - -ms-flex-align: stretch; - align-items: stretch; -} - -.c22 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: justify; - -webkit-justify-content: space-between; - justify-content: space-between; -} - -.c25 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-flex: 1; - -webkit-flex-grow: 1; - -ms-flex-positive: 1; - flex-grow: 1; - -webkit-box-pack: start; - -ms-flex-pack: start; - -webkit-justify-content: start; - justify-content: start; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c26 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-flex: 1; - -webkit-flex-grow: 1; - -ms-flex-positive: 1; - flex-grow: 1; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c32 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c24 { - display: -webkit-inline-box; - display: -webkit-inline-flex; - display: -ms-inline-flexbox; - display: inline-flex; -} - -.c10 { - margin-left: -5px; -} - -.c10>* { - display: -webkit-inline-box; - display: -webkit-inline-flex; - display: -ms-inline-flexbox; - display: inline-flex; -} - -.c10>* { - margin-left: 5px; -} - -.c9 { - display: -webkit-inline-box; - display: -webkit-inline-flex; - display: -ms-inline-flexbox; - display: inline-flex; -} - -.c3 { - cursor: pointer; -} - -.c11 svg path { - fill: #bfbfbf; -} - -.c4 { - height: 16px; - width: 16px; - line-height: 16px; -} - -.c4 * { - height: inherit; - width: inherit; -} - -.c33 { - background-color: transparent; - border: none; - cursor: pointer; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - outline: none; - margin: 1px; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - cursor: pointer; -} - -.c34 { - height: 16px; - width: 16px; - line-height: 16px; -} - -.c34 * { - height: inherit; - width: inherit; -} - -.c29 { - border: 1px solid #bfbfbf; - border-radius: 2px; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-align-items: stretch; - -webkit-box-align: stretch; - -ms-flex-align: stretch; - align-items: stretch; - -webkit-box-flex: 1; - -webkit-flex-grow: 1; - -ms-flex-positive: 1; - flex-grow: 1; - padding: 1px 5px; - background-color: #fff; - color: #000; - font-weight: normal; -} - -.c28 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - position: relative; - width: 180px; -} - -.c30 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-flex: 1; - -webkit-flex-grow: 1; - -ms-flex-positive: 1; - flex-grow: 1; - word-break: keep-all; - white-space: nowrap; - overflow: hidden; - cursor: pointer; -} - -.c35 { - color: #c12c30; - font-weight: bold; - font-size: 19px; - padding-bottom: 1px; - padding-left: 4px; - display: none; -} - -.c31 { - cursor: default; -} - -.c27 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; -} - -.c13 { - border: 0; - border-spacing: 0px; - font-size: 12px; - text-align: left; - table-layout: auto; - width: 100%; -} - -.c14 th, -.c14 td { - padding: 4px 10px; - border-bottom: 1px solid #e5e5e5; -} - -.c14 tfoot tr { - background: #fff; -} - -.c14 tfoot tr td { - border-bottom: 1px solid #e5e5e5; -} - -.c16 a { - -webkit-text-decoration: none; - text-decoration: none; - color: #000; -} - -.c16 a:hover { - -webkit-text-decoration: underline; - text-decoration: underline; - color: #000; -} - -.c17 { - background-color: #fff; - color: #000; - border-top: 1px solid #e5e5e5; - font-weight: bold; - width: 25%; -} - -.c18 { - background-color: #fff; - color: #000; - border-top: 1px solid #e5e5e5; - font-weight: bold; - width: 50%; -} - -.c19 { - background-color: #fff; - color: #000; - border-top: 1px solid #e5e5e5; - font-weight: bold; - width: 8%; -} - -.c36 { - font-size: 10px; - color: #7F7F7F; - text-align: left; -} - -.c12 { - margin: 0 3px; -} - -.c7 { - margin: 2px 3px; -} - -.c15 { - opacity: 1.0; -} - -.c5 { - margin-top: 2px; - margin-left: 2px; -} - -.c1 { - margin-top: 20px; -} - -.c23 { - cursor: pointer; - -webkit-text-decoration: none; - text-decoration: none; - color: #0a53b8; -} - -.c23 :hover { - -webkit-text-decoration: underline; - text-decoration: underline; - color: #0a53b8; -} - -@media print { - .c3 { - display: none; - } -} - -@media print { - .c13 { - border-collapse: collapse; - } -} - -@media screen { - .c14>tbody:nth-of-type(even), - .c14>tbody:only-of-type>tr:nth-of-type(even) { - background: #f3f3f3; - } - - .c14>tbody:not(:only-of-type):hover, - .c14>tbody:only-of-type>tr:hover { - background: #e5e5e5; - } -} - -@media print { - .c16 { - border-bottom: 1px solid black; - } - - .c16 a, - .c16 a:hover { - -webkit-text-decoration: none; - text-decoration: none; - color: #000; - } -} - -@media print { - .c17 { - color: #000; - font-size: 1.2em; - background-color: transparent; - font-weight: bold; - } -} - -@media print { - .c18 { - color: #000; - font-size: 1.2em; - background-color: transparent; - font-weight: bold; - } -} - -@media print { - .c19 { - color: #000; - font-size: 1.2em; - background-color: transparent; - font-weight: bold; - } -} - -@media print { - .c7 svg { - display: none; - } -} - -@media print { - .c23 { - color: #000; - } -} - - -
-
-
-
- - - - - - - - - -
-
-
- - - - - - - - - - - - - - - - - - -
-
- - 1 - 1 of 1 - -
-
- - - - - - - - - - - - - - - - - - -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- Name -
-
-
- Report Format -
-
-
- Actions -
-
-
-
-
- - - foo - - -
-
-
- ( - bar - ) -
-
-
-
- - - baz - - -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
-
-
-
- - - lorem - - -
-
-
- ( - ipsum - ) -
-
-
-
- - - dolor - - -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
-
-
-
- - - hello - - -
-
-
- ( - world - ) -
-
-
-
- - - baz - - -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
-
-
-
- -
-
-
-
-
- (Applied filter: rows=2) -
-
-
-
- - - - - - - - - - - - - - - - - - -
-
- - 1 - 1 of 1 - -
-
- - - - - - - - - - - - - - - - - - -
-
-
-
-
-
- -`; diff --git a/src/web/pages/reportconfigs/__tests__/component.jsx b/src/web/pages/reportconfigs/__tests__/component.jsx index 066da2dfbf..65fe5a00cc 100644 --- a/src/web/pages/reportconfigs/__tests__/component.jsx +++ b/src/web/pages/reportconfigs/__tests__/component.jsx @@ -21,14 +21,17 @@ import {describe, test, expect, testing} from '@gsa/testing'; import ReportConfig from 'gmp/models/reportconfig'; import Capabilities from 'gmp/capabilities/capabilities'; +import {fireEvent, getByTestId, rendererWith, wait} from 'web/utils/testing'; + import { - fireEvent, - getAllByRole, - getAllByTestId, - getByTestId, - rendererWith, - wait, -} from 'web/utils/testing'; + clickElement, + getDialogContent, + getDialogSaveButton, + getDialogTitle, + getSelectElements, + getSelectItemElementsForSelect, + getTextInputs, +} from 'web/components/testing'; import ReportFormatComponent from '../component'; @@ -104,7 +107,7 @@ describe('Report Config Component tests', () => { store: true, }); - const {baseElement} = render( + render( {children} , @@ -112,20 +115,23 @@ describe('Report Config Component tests', () => { editClick({id: 'rc123'}); await wait(); - expect(baseElement).toMatchSnapshot(); expect(getReportConfig).toHaveBeenCalledWith({ id: 'rc123', }); expect(getAllReportFormats).toHaveBeenCalledWith(); - const titleBar = getByTestId(baseElement, 'dialog-title-bar'); - expect(titleBar).toHaveTextContent('Edit Report Config test report config'); - const content = getByTestId(baseElement, 'save-dialog-content'); - expect(content).toHaveTextContent('test report format'); - expect(content).toHaveTextContent('test param'); + expect(getDialogTitle()).toHaveTextContent( + 'Edit Report Config test report config', + ); + const content = getDialogContent(); + const inputs = getTextInputs(content); + expect(inputs[0]).toHaveValue('test report config'); + + const select = getSelectElements(content); + expect(select[0]).toHaveValue('test report format'); - const saveButton = getByTestId(baseElement, 'dialog-save-button'); + const saveButton = getDialogSaveButton(); fireEvent.click(saveButton); expect(saveReportConfig).toHaveBeenCalledWith({ @@ -189,7 +195,7 @@ describe('Report Config Component tests', () => { store: true, }); - const {baseElement} = render( + render( {children} , @@ -197,31 +203,24 @@ describe('Report Config Component tests', () => { createClick(); await wait(); - expect(baseElement).toMatchSnapshot(); expect(getAllReportFormats).toHaveBeenCalledWith(); - const titleBar = getByTestId(baseElement, 'dialog-title-bar'); - expect(titleBar).toHaveTextContent('New Report Config'); - const content = getByTestId(baseElement, 'save-dialog-content'); + expect(getDialogTitle()).toHaveTextContent('New Report Config'); + const content = getDialogContent(); + + const selects = getSelectElements(content); // No report format selected at start - expect(content).not.toHaveTextContent('test report format'); + expect(selects[0]).not.toHaveTextContent('test report format'); // No params before report format has been selected expect(content).not.toHaveTextContent('test param'); // Choose report format - const comboBoxes = getAllByRole(content, 'combobox'); - fireEvent.click(getByTestId(comboBoxes[0], 'select-open-button')); - const menuId = comboBoxes[0].getAttribute('aria-owns'); - const menuItems = getAllByTestId( - baseElement.querySelector('#' + menuId), - 'select-item', - ); - fireEvent.click(menuItems[0]); - await wait(); + const items = await getSelectItemElementsForSelect(selects[0]); + await clickElement(items[0]); - const saveButton = getByTestId(baseElement, 'dialog-save-button'); + const saveButton = getDialogSaveButton(); fireEvent.click(saveButton); expect(createReportConfig).toHaveBeenCalledWith({ diff --git a/src/web/pages/reportconfigs/__tests__/details.jsx b/src/web/pages/reportconfigs/__tests__/details.jsx index cc4c5403dc..c69d39738b 100644 --- a/src/web/pages/reportconfigs/__tests__/details.jsx +++ b/src/web/pages/reportconfigs/__tests__/details.jsx @@ -35,8 +35,6 @@ describe('Report Config Details tests', () => { const {element, getAllByTestId} = render(
); - expect(element).toMatchSnapshot(); - expect(element).toHaveTextContent('StringParam'); expect(element).toHaveTextContent('StringValue'); @@ -51,25 +49,25 @@ describe('Report Config Details tests', () => { expect(element).toHaveTextContent('ReportFormatListParam'); expect(element).toHaveTextContent('non-configurable'); - const detailslinks = getAllByTestId('details-link'); + const detailsLinks = getAllByTestId('details-link'); // Report format of the config - expect(detailslinks[0]).toHaveTextContent('example-configurable-1'); - expect(detailslinks[0]).toHaveAttribute('href', '/reportformat/123456'); + expect(detailsLinks[0]).toHaveTextContent('example-configurable-1'); + expect(detailsLinks[0]).toHaveAttribute('href', '/reportformat/123456'); // Report format params - expect(detailslinks[1]).toHaveTextContent('non-configurable-1'); - expect(detailslinks[1]).toHaveAttribute('href', '/reportformat/654321'); + expect(detailsLinks[1]).toHaveTextContent('non-configurable-1'); + expect(detailsLinks[1]).toHaveAttribute('href', '/reportformat/654321'); - expect(detailslinks[2]).toHaveTextContent('non-configurable-2'); - expect(detailslinks[2]).toHaveAttribute('href', '/reportformat/7654321'); + expect(detailsLinks[2]).toHaveTextContent('non-configurable-2'); + expect(detailsLinks[2]).toHaveAttribute('href', '/reportformat/7654321'); // Alerts - expect(detailslinks[3]).toHaveTextContent('ABC'); - expect(detailslinks[3]).toHaveAttribute('href', '/alert/321'); + expect(detailsLinks[3]).toHaveTextContent('ABC'); + expect(detailsLinks[3]).toHaveAttribute('href', '/alert/321'); - expect(detailslinks[4]).toHaveTextContent('XYZ'); - expect(detailslinks[4]).toHaveAttribute('href', '/alert/789'); + expect(detailsLinks[4]).toHaveTextContent('XYZ'); + expect(detailsLinks[4]).toHaveAttribute('href', '/alert/789'); }); test('should render orphaned config details', () => { @@ -86,8 +84,6 @@ describe('Report Config Details tests', () => { const {element} = render(
); - expect(element).toMatchSnapshot(); - expect(element).toHaveTextContent( 'not available for orphaned report configs', ); diff --git a/src/web/pages/reportconfigs/__tests__/detailspage.jsx b/src/web/pages/reportconfigs/__tests__/detailspage.jsx index c805615f2c..e9283d8c56 100644 --- a/src/web/pages/reportconfigs/__tests__/detailspage.jsx +++ b/src/web/pages/reportconfigs/__tests__/detailspage.jsx @@ -88,7 +88,6 @@ describe('Report Config Details Page tests', () => { store.dispatch(entityLoadingActions.success('12345', config)); const {element} = render(); - expect(element).toMatchSnapshot(); // Test parameter details const spans = element.querySelectorAll('span'); diff --git a/src/web/pages/reportconfigs/__tests__/dialog.jsx b/src/web/pages/reportconfigs/__tests__/dialog.jsx index 75e4f55278..6ec615a39b 100644 --- a/src/web/pages/reportconfigs/__tests__/dialog.jsx +++ b/src/web/pages/reportconfigs/__tests__/dialog.jsx @@ -23,16 +23,29 @@ import ReportFormat from 'gmp/models/reportformat'; import { rendererWith, fireEvent, - getAllByTestId, - wait, - getAllByRole, - getByRole, - getByTestId, + getByName, + getAllByName, } from 'web/utils/testing'; import {mockReportConfig} from 'web/pages/reportconfigs/__mocks__/mockreportconfig'; import {mockReportFormats} from '../__mocks__/mockreportformats'; +import { + changeInputValue, + clickElement, + getCheckBoxes, + getDialogCloseButton, + getDialogContent, + getDialogSaveButton, + getDialogTitle, + getMultiSelectElements, + getSelectElements, + getSelectItemElementsForMultiSelect, + getSelectItemElementsForSelect, + getSelectedItems, + getTableBody, +} from 'web/components/testing'; + import ReportConfigDialog from '../dialog'; const config = ReportConfig.fromElement(mockReportConfig); @@ -47,7 +60,7 @@ describe('Edit Report Config Dialog component tests', () => { const {render} = rendererWith({capabilities: true, router: true, gmp}); - const {baseElement} = render( + render( { />, ); - expect(baseElement).toMatchSnapshot(); + expect(getDialogTitle()).toHaveTextContent('Edit Report Config'); - const titleBar = getByTestId(baseElement, 'dialog-title-bar'); - expect(titleBar).toHaveTextContent('Edit Report Config'); - - const content = getByTestId(baseElement, 'save-dialog-content'); - - const comboBoxes = getAllByRole(content, 'combobox'); - expect(comboBoxes[0]).toHaveTextContent('example-configurable-1'); - expect(getByTestId(comboBoxes[0], 'select-selected-value')).toHaveAttribute( - 'disabled', - ); + const content = getDialogContent(); + const selects = getSelectElements(content); + expect(selects[0]).toHaveValue('example-configurable-1'); + expect(selects[0]).toBeDisabled(); }); test('should save data', () => { @@ -79,7 +86,7 @@ describe('Edit Report Config Dialog component tests', () => { const formats = mockReportFormats; const {render} = rendererWith({capabilities: true, router: true, gmp}); - const {baseElement} = render( + render( { />, ); - const saveButton = getByTestId(baseElement, 'dialog-save-button'); + const saveButton = getDialogSaveButton(); fireEvent.click(saveButton); expect(handleSave).toHaveBeenCalledWith({ @@ -131,7 +138,7 @@ describe('Edit Report Config Dialog component tests', () => { const formats = mockReportFormats; const {render} = rendererWith({capabilities: true, router: true, gmp}); - const {baseElement} = render( + render( { />, ); - const closeButton = getByTestId(baseElement, 'dialog-close-button'); - + const closeButton = getDialogCloseButton(); fireEvent.click(closeButton); expect(handleClose).toHaveBeenCalled(); expect(handleSave).not.toHaveBeenCalled(); }); - test('should allow to change name, comment and params', () => { + test('should allow to change name, comment and params', async () => { const handleClose = testing.fn(); const handleSave = testing.fn(); const handleValueChange = testing.fn(); @@ -158,7 +164,7 @@ describe('Edit Report Config Dialog component tests', () => { const formats = mockReportFormats; const {render} = rendererWith({capabilities: true, router: true, gmp}); - const {baseElement} = render( + render( { />, ); - const content = getByTestId(baseElement, 'save-dialog-content'); - const comboBoxes = getAllByRole(content, 'combobox'); - let inputs; + const content = getDialogContent(); // Set name and comment - inputs = content.querySelectorAll('input[name="name"]'); - fireEvent.change(inputs[0], {target: {value: 'lorem'}}); + const nameInput = getByName(content, 'name'); + changeInputValue(nameInput, 'lorem'); - inputs = content.querySelectorAll('input[name="comment"]'); - fireEvent.change(inputs[0], {target: {value: 'ipsum'}}); + const commentInput = getByName(content, 'comment'); + changeInputValue(commentInput, 'ipsum'); // Set params - inputs = content.querySelectorAll('input[name="BooleanParam"]'); - fireEvent.click(inputs[1]); + const booleanParam = getAllByName(content, 'BooleanParam'); + fireEvent.click(booleanParam[1]); - inputs = content.querySelectorAll('input[name="IntegerParam"]'); - fireEvent.change(inputs[0], {target: {value: '7'}}); + const integerParam = getByName(content, 'IntegerParam'); + changeInputValue(integerParam, '7'); - inputs = content.querySelectorAll('input[name="StringParam"]'); - fireEvent.change(inputs[0], {target: {value: 'NewString'}}); + const stringParam = getByName(content, 'StringParam'); + changeInputValue(stringParam, 'NewString'); - inputs = content.querySelectorAll('textarea[name="TextParam"]'); - fireEvent.change(inputs[0], {target: {value: 'NewText'}}); + const textParam = getByName(content, 'TextParam'); + changeInputValue(textParam, 'NewText'); // Choose new SelectionParam - fireEvent.click(getByTestId(comboBoxes[1], 'select-open-button')); - const menuId = comboBoxes[1].getAttribute('aria-owns'); - const menuItems = getAllByTestId( - baseElement.querySelector('#' + menuId), - 'select-item', - ); - fireEvent.click(menuItems[0]); + const selects = getSelectElements(content); + const menuItems = await getSelectItemElementsForSelect(selects[1]); + await clickElement(menuItems[0]); // Unselect report format from ReportFormatListParam - const multiselectDeleteButtons = getAllByTestId( - comboBoxes[2], - 'multiselect-selected-delete', - ); - fireEvent.click(multiselectDeleteButtons[1]); + const multiSelects = getMultiSelectElements(content); + const selectedItems = getSelectedItems(multiSelects[0]); + const deleteIcon = selectedItems[1].querySelector('button'); + await clickElement(deleteIcon); expect(handleValueChange).toHaveBeenCalledTimes(6); - const saveButton = getByTestId(baseElement, 'dialog-save-button'); + const saveButton = getDialogSaveButton(); fireEvent.click(saveButton); expect(handleSave).toHaveBeenCalledWith({ @@ -247,7 +246,7 @@ describe('Edit Report Config Dialog component tests', () => { }); }); - test('should be able to toggle which params use default value', () => { + test('should be able to toggle which params use default value', async () => { const handleClose = testing.fn(); const handleSave = testing.fn(); const handleValueChange = testing.fn(); @@ -256,7 +255,7 @@ describe('Edit Report Config Dialog component tests', () => { const formats = mockReportFormats; const {render} = rendererWith({capabilities: true, router: true, gmp}); - const {baseElement} = render( + render( { />, ); - const content = getByTestId(baseElement, 'save-dialog-content'); - let inputs; + const content = getDialogContent(); + const tableBody = getTableBody(content); + const tableRows = tableBody.querySelectorAll('tr'); - inputs = content.querySelectorAll('input[name="BooleanParam"]'); - fireEvent.click(inputs[2]); + const stringParamRow = tableRows[0]; + await clickElement(getCheckBoxes(stringParamRow)[0]); - inputs = content.querySelectorAll('input[name="IntegerParam"]'); - fireEvent.click(inputs[1]); + const textParamRow = tableRows[1]; + await clickElement(getCheckBoxes(textParamRow)[0]); - inputs = content.querySelectorAll('input[name="StringParam"]'); - fireEvent.click(inputs[1]); + const integerParamRow = tableRows[2]; + await clickElement(getCheckBoxes(integerParamRow)[0]); - inputs = content.querySelectorAll('input[name="TextParam"]'); - fireEvent.click(inputs[0]); + const booleanParaRow = tableRows[3]; + await clickElement(getCheckBoxes(booleanParaRow)[0]); - inputs = content.querySelectorAll('input[name="ReportFormatListParam"]'); - fireEvent.click(inputs[0]); + const selectionParamRow = tableRows[4]; + await clickElement(getCheckBoxes(selectionParamRow)[0]); - inputs = content.querySelectorAll('input[name="SelectionParam"]'); - fireEvent.click(inputs[0]); + const reportFormatListParamRow = tableRows[5]; + await clickElement(getCheckBoxes(reportFormatListParamRow)[0]); expect(handleValueChange).toHaveBeenCalledTimes(6); - const saveButton = getByTestId(baseElement, 'dialog-save-button'); + const saveButton = getDialogSaveButton(); fireEvent.click(saveButton); expect(handleSave).toHaveBeenCalledWith({ @@ -311,7 +311,7 @@ describe('Edit Report Config Dialog component tests', () => { StringParam: 'StringValue', TextParam: 'TextValue', }, - // Should be reverse of "shpuld save data" case + // Should be reverse of "should save data" case params_using_default: { BooleanParam: true, IntegerParam: false, @@ -345,10 +345,7 @@ describe('New Report Config Dialog component tests', () => { />, ); - expect(baseElement).toMatchSnapshot(); - - const titleBar = getByTestId(baseElement, 'dialog-title-bar'); - expect(titleBar).toHaveTextContent('New Report Config'); + expect(getDialogTitle()).toHaveTextContent('New Report Config'); expect(baseElement).not.toHaveTextContent('Param'); }); @@ -385,14 +382,14 @@ describe('New Report Config Dialog component tests', () => { __text: 'RF01', report_format: { _id: 'RF01', - name: 'report format 1' + name: 'report format 1', }, }, default: { __text: 'RF01', report_format: { _id: 'RF01', - name: 'report format 1' + name: 'report format 1', }, }, type: { @@ -419,7 +416,7 @@ describe('New Report Config Dialog component tests', () => { const handleValueChange = testing.fn(); - const {baseElement} = render( + render( { />, ); - const content = getByTestId(baseElement, 'save-dialog-content'); - let comboBoxes = getAllByRole(content, 'combobox'); - let inputs; - let menuId; - let menuItems; - - inputs = content.querySelectorAll('input[name="name"]'); - fireEvent.change(inputs[0], {target: {value: 'lorem'}}); + const content = getDialogContent(); + const nameInput = getByName(content, 'name'); + changeInputValue(nameInput, 'lorem'); - inputs = content.querySelectorAll('input[name="comment"]'); - fireEvent.change(inputs[0], {target: {value: 'ipsum'}}); + const commentInput = getByName(content, 'comment'); + changeInputValue(commentInput, 'ipsum'); // Choose new report format - fireEvent.click(getByTestId(comboBoxes[0], 'select-open-button')); - menuId = comboBoxes[0].getAttribute('aria-owns'); - menuItems = getAllByTestId( - baseElement.querySelector('#' + menuId), - 'select-item', - ); - fireEvent.click(menuItems[1]); - await wait(); + const select = getSelectElements(content); + const menuItems = await getSelectItemElementsForSelect(select[0]); + await clickElement(menuItems[1]); // Set params expect(getReportFormat).toHaveBeenCalledWith({id: '1234567'}); - inputs = content.querySelectorAll('input[name="Param2"]'); - fireEvent.change(inputs[0], {target: {value: 'XYZ'}}); - - comboBoxes = getAllByRole(content, 'combobox'); - fireEvent.click(getByRole(comboBoxes[1], 'button')); - menuId = comboBoxes[1].getAttribute('aria-owns'); - menuItems = getAllByTestId( - baseElement.querySelector('#' + menuId), - 'multiselect-item-label', - ); - fireEvent.click(menuItems[1]); - const saveButton = getByTestId(baseElement, 'dialog-save-button'); + const param2Input = getByName(content, 'Param2'); + changeInputValue(param2Input, 'XYZ'); + + const multiSelect = getMultiSelectElements(content)[0]; + const multiSelectMenuItems = + await getSelectItemElementsForMultiSelect(multiSelect); + await clickElement(multiSelectMenuItems[1]); + + const saveButton = getDialogSaveButton(); fireEvent.click(saveButton); expect(handleSave).toHaveBeenCalledWith({ @@ -480,7 +464,7 @@ describe('New Report Config Dialog component tests', () => { params: { Param1: 'ABC', Param2: 'XYZ', - ReportFormatListParam: ['RF01', '654321'], + ReportFormatListParam: ['654321'], }, params_using_default: { Param1: true, diff --git a/src/web/pages/reportconfigs/__tests__/listpage.jsx b/src/web/pages/reportconfigs/__tests__/listpage.jsx index c695c9d632..64f26f68fe 100644 --- a/src/web/pages/reportconfigs/__tests__/listpage.jsx +++ b/src/web/pages/reportconfigs/__tests__/listpage.jsx @@ -29,7 +29,9 @@ import {entitiesLoadingActions} from 'web/store/entities/scanconfigs'; import {loadingActions} from 'web/store/usersettings/defaults/actions'; import {defaultFilterLoadingActions} from 'web/store/usersettings/defaultfilters/actions'; -import {rendererWith, waitFor, fireEvent, act} from 'web/utils/testing'; +import {rendererWith, fireEvent, wait, screen} from 'web/utils/testing'; + +import {clickElement} from 'web/components/testing'; import ReportConfigsPage, {ToolBarIcons} from '../listpage'; @@ -99,10 +101,10 @@ describe('ReportConfigsPage tests', () => { store.dispatch(setUsername('admin')); - const defaultSettingfilter = Filter.fromString('foo=bar'); + const defaultSettingFilter = Filter.fromString('foo=bar'); store.dispatch(loadingActions.success({rowsperpage: {value: '2'}})); store.dispatch( - defaultFilterLoadingActions.success('reportconfig', defaultSettingfilter), + defaultFilterLoadingActions.success('reportconfig', defaultSettingFilter), ); const counts = new CollectionCounts({ @@ -120,9 +122,9 @@ describe('ReportConfigsPage tests', () => { const {baseElement} = render(); - await waitFor(() => baseElement.querySelectorAll('table')); + await wait(); - expect(baseElement).toMatchSnapshot(); + expect(baseElement).toBeInTheDocument(); }); test('should call commands for bulk actions', async () => { @@ -159,10 +161,10 @@ describe('ReportConfigsPage tests', () => { store.dispatch(setUsername('admin')); - const defaultSettingfilter = Filter.fromString('foo=bar'); + const defaultSettingFilter = Filter.fromString('foo=bar'); store.dispatch(loadingActions.success({rowsperpage: {value: '2'}})); store.dispatch( - defaultFilterLoadingActions.success('reportconfig', defaultSettingfilter), + defaultFilterLoadingActions.success('reportconfig', defaultSettingFilter), ); const counts = new CollectionCounts({ @@ -178,22 +180,15 @@ describe('ReportConfigsPage tests', () => { entitiesLoadingActions.success([config], filter, loadedFilter, counts), ); - const {baseElement, getAllByTestId} = render(); - - await waitFor(() => baseElement.querySelectorAll('table')); - - const icons = getAllByTestId('svg-icon'); + render(); - await act(async () => { - expect(icons[17]).toHaveAttribute('title', 'Add tag to page contents'); + await wait(); - expect(icons[18]).toHaveAttribute( - 'title', - 'Move page contents to trashcan', - ); - fireEvent.click(icons[18]); - expect(deleteByFilter).toHaveBeenCalled(); - }); + const deleteIcon = screen.getAllByTitle( + 'Move page contents to trashcan', + )[0]; + await clickElement(deleteIcon); + expect(deleteByFilter).toHaveBeenCalled(); }); describe('ReportConfigsPage ToolBarIcons test', () => { @@ -215,7 +210,6 @@ describe('ReportConfigsPage tests', () => { onReportConfigCreateClick={handleReportConfigCreateClick} />, ); - expect(element).toMatchSnapshot(); const icons = getAllByTestId('svg-icon'); const links = element.querySelectorAll('a'); diff --git a/src/web/pages/reportconfigs/__tests__/row.jsx b/src/web/pages/reportconfigs/__tests__/row.jsx index 7fbcd2a6a2..ac6c203aea 100644 --- a/src/web/pages/reportconfigs/__tests__/row.jsx +++ b/src/web/pages/reportconfigs/__tests__/row.jsx @@ -76,7 +76,7 @@ describe('Report Config row tests', () => { router: true, }); - const {baseElement, getAllByTestId} = render( + const {baseElement} = render( { />, ); - expect(baseElement).toMatchSnapshot(); expect(baseElement).toHaveTextContent('foo'); expect(baseElement).toHaveTextContent('(bar)'); expect(baseElement).toHaveTextContent('baz'); @@ -107,7 +106,7 @@ describe('Report Config row tests', () => { router: true, }); - const {baseElement, getAllByTestId} = render( + const {baseElement} = render( { />, ); - expect(baseElement).toMatchSnapshot(); expect(baseElement).toHaveTextContent('foo'); expect(baseElement).toHaveTextContent('Orphan'); expect(baseElement).toHaveTextContent('(bar)'); diff --git a/src/web/pages/reportconfigs/__tests__/table.jsx b/src/web/pages/reportconfigs/__tests__/table.jsx index f885cbb799..b7c6e995f6 100644 --- a/src/web/pages/reportconfigs/__tests__/table.jsx +++ b/src/web/pages/reportconfigs/__tests__/table.jsx @@ -106,7 +106,6 @@ describe('Scan Config table tests', () => { />, ); - expect(baseElement).toMatchSnapshot(); const header = baseElement.querySelectorAll('th'); expect(header[0]).toHaveTextContent('Name'); expect(header[1]).toHaveTextContent('Report Format'); From c7107392ac87f25a0eca61928e4ab73fd4182e46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ricks?= Date: Tue, 7 May 2024 10:43:49 +0200 Subject: [PATCH 072/149] Allow to display a menu entry for asset management --- src/gmp/__tests__/gmpsettings.js | 8 ++++++++ src/gmp/gmpsettings.js | 2 ++ src/web/components/menu/menu.jsx | 9 +++++++++ 3 files changed, 19 insertions(+) diff --git a/src/gmp/__tests__/gmpsettings.js b/src/gmp/__tests__/gmpsettings.js index 504ba481cb..ac04450b68 100644 --- a/src/gmp/__tests__/gmpsettings.js +++ b/src/gmp/__tests__/gmpsettings.js @@ -61,6 +61,7 @@ describe('GmpSettings tests', () => { expect(settings.apiServer).toEqual('localhost:9392'); expect(settings.disableLoginForm).toEqual(false); expect(settings.enableStoreDebugLog).toBeUndefined(); + expect(settings.enableAssetManagement).toEqual(false); expect(settings.guestUsername).toBeUndefined(); expect(settings.guestPassword).toBeUndefined(); expect(settings.logLevel).toEqual(DEFAULT_LOG_LEVEL); @@ -97,6 +98,7 @@ describe('GmpSettings tests', () => { disableLoginForm: true, enableGreenboneSensor: true, enableStoreDebugLog: true, + enableAssetManagement: true, guestUsername: 'guest', guestPassword: 'pass', locale: 'en', @@ -121,6 +123,7 @@ describe('GmpSettings tests', () => { expect(settings.apiProtocol).toEqual('http'); expect(settings.apiServer).toEqual('localhost'); expect(settings.disableLoginForm).toEqual(true); + expect(settings.enableAssetManagement).toEqual(true); expect(settings.enableGreenboneSensor).toEqual(true); expect(settings.enableStoreDebugLog).toEqual(true); expect(settings.guestUsername).toEqual('guest'); @@ -313,6 +316,7 @@ describe('GmpSettings tests', () => { apiProtocol: 'http', apiServer: 'localhost', disableLoginForm: true, + enableAssetManagement: true, enableGreenboneSensor: true, guestUsername: 'guest', guestPassword: 'pass', @@ -342,6 +346,10 @@ describe('GmpSettings tests', () => { settings.disableLoginForm = false; }).toThrow(); expect(settings.disableLoginForm).toEqual(true); + expect(() => { + settings.enableAssetManagement = false; + }).toThrow(); + expect(settings.enableAssetManagement).toEqual(true); expect(() => { settings.enableGreenboneSensor = false; }).toThrow(); diff --git a/src/gmp/gmpsettings.js b/src/gmp/gmpsettings.js index e2f6dc4d6d..7ce5fea16d 100644 --- a/src/gmp/gmpsettings.js +++ b/src/gmp/gmpsettings.js @@ -59,6 +59,7 @@ class GmpSettings { enableGreenboneSensor = false, disableLoginForm = false, enableStoreDebugLog, + enableAssetManagement = false, guestUsername, guestPassword, loglevel, @@ -129,6 +130,7 @@ class GmpSettings { setAndFreeze(this, 'protocolDocUrl', protocolDocUrl); setAndFreeze(this, 'vendorVersion', vendorVersion); setAndFreeze(this, 'vendorLabel', vendorLabel); + setAndFreeze(this, 'enableAssetManagement', enableAssetManagement); } set token(value) { diff --git a/src/web/components/menu/menu.jsx b/src/web/components/menu/menu.jsx index 85e95aa52c..75768dd06d 100644 --- a/src/web/components/menu/menu.jsx +++ b/src/web/components/menu/menu.jsx @@ -9,6 +9,7 @@ import {AppNavigation} from '@greenbone/opensight-ui-components'; import useTranslation from 'web/hooks/useTranslation'; import useCapabilities from 'web/utils/useCapabilities'; +import useGmp from 'web/utils/useGmp'; import TaskIcon from 'web/components/icon/taskicon'; import Link from 'web/components/link/link'; @@ -52,6 +53,7 @@ import RadiusIcon from 'web/components/icon/radiusicon'; const Menu = () => { const [_] = useTranslation(); const capabilities = useCapabilities(); + const gmp = useGmp(); const mayOpScans = [ 'tasks', @@ -342,6 +344,13 @@ const Menu = () => { ], }, ].filter(Boolean), + [ + gmp.settings.enableAssetManagement && { + icon: () => {}, + label: _('Asset'), + to: '/asset-management', + }, + ].filter(Boolean), ]; return ; }; From 9d552a395511e3aa56049ebcf24efe7c7f69c43a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ricks?= Date: Tue, 7 May 2024 11:46:36 +0200 Subject: [PATCH 073/149] Update and fix report pages tests --- .../reports/__tests__/deltadetailscontent.jsx | 31 ++++++++++--------- .../reports/__tests__/detailscontent.jsx | 25 ++++++--------- 2 files changed, 25 insertions(+), 31 deletions(-) diff --git a/src/web/pages/reports/__tests__/deltadetailscontent.jsx b/src/web/pages/reports/__tests__/deltadetailscontent.jsx index 95bafd67c6..c97be59762 100644 --- a/src/web/pages/reports/__tests__/deltadetailscontent.jsx +++ b/src/web/pages/reports/__tests__/deltadetailscontent.jsx @@ -27,6 +27,12 @@ import {rendererWith} from 'web/utils/testing'; import {getMockDeltaReport} from 'web/pages/reports/__mocks__/mockdeltareport'; +import { + getPowerFilter, + getSelectElement, + getTextInputs, +} from 'web/components/testing'; + import DeltaDetailsContent from '../deltadetailscontent'; const filter = Filter.fromString( @@ -141,19 +147,17 @@ describe('Delta Report Details Content tests', () => { />, ); - const icons = baseElement.querySelectorAll('svg'); - const inputs = baseElement.querySelectorAll('input'); const links = baseElement.querySelectorAll('a'); const tableData = baseElement.querySelectorAll('td'); - const selects = getAllByTestId('select-selected-value'); const bars = getAllByTestId('progressbar-box'); - - expect(icons.length).toEqual(15); + const powerFilter = getPowerFilter(); + const select = getSelectElement(powerFilter); + const inputs = getTextInputs(powerFilter); // Powerfilter expect(inputs[0]).toHaveAttribute('name', 'userFilterString'); - expect(selects[0]).toHaveAttribute('title', 'Loaded filter'); - expect(selects[0]).toHaveTextContent('foo'); + expect(select).toHaveAttribute('title', 'Loaded filter'); + expect(select).toHaveValue('foo'); // Header expect(baseElement).toHaveTextContent( @@ -313,20 +317,17 @@ describe('Delta Report Details Content tests', () => { />, ); - const icons = baseElement.querySelectorAll('svg'); - const inputs = baseElement.querySelectorAll('input'); const header = baseElement.querySelectorAll('th'); const rows = baseElement.querySelectorAll('tr'); - const selects = getAllByTestId('select-selected-value'); const bars = getAllByTestId('progressbar-box'); - - // Toolbar Icons - expect(icons.length).toEqual(26); + const powerFilter = getPowerFilter(); + const select = getSelectElement(powerFilter); + const inputs = getTextInputs(powerFilter); // Powerfilter expect(inputs[0]).toHaveAttribute('name', 'userFilterString'); - expect(selects[0]).toHaveAttribute('title', 'Loaded filter'); - expect(selects[0]).toHaveTextContent('--'); + expect(select).toHaveAttribute('title', 'Loaded filter'); + expect(select).toHaveValue('--'); // Header expect(baseElement).toHaveTextContent( diff --git a/src/web/pages/reports/__tests__/detailscontent.jsx b/src/web/pages/reports/__tests__/detailscontent.jsx index 41c3447b2a..8ca4b87049 100644 --- a/src/web/pages/reports/__tests__/detailscontent.jsx +++ b/src/web/pages/reports/__tests__/detailscontent.jsx @@ -27,6 +27,8 @@ import {rendererWith} from 'web/utils/testing'; import {getMockReport} from 'web/pages/reports/__mocks__/mockreport'; +import {getPowerFilter, getTextInputs} from 'web/components/testing'; + import DetailsContent from '../detailscontent'; const filter = Filter.fromString( @@ -54,7 +56,7 @@ const getReportComposerDefaults = testing.fn().mockResolvedValue({ }); describe('Report Details Content tests', () => { - test('should render Report Details Content', () => { + test('should render Report Details Content', async () => { const onActivateTab = testing.fn(); const onAddToAssetsClick = testing.fn(); const onError = testing.fn(); @@ -154,20 +156,15 @@ describe('Report Details Content tests', () => { />, ); - const icons = baseElement.querySelectorAll('svg'); - const inputs = baseElement.querySelectorAll('input'); const links = baseElement.querySelectorAll('a'); const tableData = baseElement.querySelectorAll('td'); - const selects = getAllByTestId('select-selected-value'); const bars = getAllByTestId('progressbar-box'); - - // Toolbar Icons - expect(icons.length).toEqual(17); + const powerFilter = getPowerFilter(); + const inputs = getTextInputs(powerFilter); // Powerfilter expect(inputs[0]).toHaveAttribute('name', 'userFilterString'); - expect(selects[0]).toHaveAttribute('title', 'Loaded filter'); - expect(selects[0]).toHaveTextContent('Loading...'); + expect(inputs[1]).toHaveAttribute('placeholder', 'Loading...'); // Header expect(baseElement).toHaveTextContent( @@ -328,17 +325,13 @@ describe('Report Details Content tests', () => { />, ); - const icons = baseElement.querySelectorAll('svg'); - const inputs = baseElement.querySelectorAll('input'); - const selects = getAllByTestId('select-selected-value'); const bars = getAllByTestId('progressbar-box'); + const powerFilter = getPowerFilter(); + const inputs = getTextInputs(powerFilter); - // Toolbar Icons - expect(icons.length).toEqual(20); // Powerfilter expect(inputs[0]).toHaveAttribute('name', 'userFilterString'); - expect(selects[0]).toHaveAttribute('title', 'Loaded filter'); - expect(selects[0]).toHaveTextContent('Loading...'); + expect(inputs[1]).toHaveAttribute('placeholder', 'Loading...'); // Header expect(baseElement).toHaveTextContent( From b5e9804eed2b96fd1146e458e2e751961c691b7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ricks?= Date: Tue, 7 May 2024 13:39:16 +0200 Subject: [PATCH 074/149] Update and fix result pages tests --- .../__tests__/__snapshots__/diff.jsx.snap | 121 ------------------ src/web/pages/results/__tests__/diff.jsx | 4 +- src/web/pages/results/__tests__/listpage.jsx | 96 +++++++------- 3 files changed, 46 insertions(+), 175 deletions(-) delete mode 100644 src/web/pages/results/__tests__/__snapshots__/diff.jsx.snap diff --git a/src/web/pages/results/__tests__/__snapshots__/diff.jsx.snap b/src/web/pages/results/__tests__/__snapshots__/diff.jsx.snap deleted file mode 100644 index 89c96f85f6..0000000000 --- a/src/web/pages/results/__tests__/__snapshots__/diff.jsx.snap +++ /dev/null @@ -1,121 +0,0 @@ -// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html - -exports[`Diff component tests > should render 1`] = ` -.c0 { - white-space: pre-wrap; - word-wrap: normal; - font-family: monospace; -} - -.c2 { - background-color: #ffeef0; -} - -.c3 { - background-color: #e6ffed; -} - -.c1 { - color: rgba(0, 0, 0, 0.3); -} - -
-
-
- @@ -1,9 +1,14 @@ -
-
- -Remote SSH server version: SSH-2.0-OpenSSH_7.6p1 Ubuntu-4 -
-
- +Remote SSH server banner: SSH-2.0-OpenSSH_7.6p1 Ubuntu-4ubuntu0.3 -
-
- Remote SSH supported authentication: password,publickey -
-
- -Remote SSH banner: (not available) -
-
- +Remote SSH text/login banner: (not available) -
-
- + -
-
- +This is probably: -
-
- + -
-
- +- OpenSSH -
-
-
- CPE: cpe:/a:openbsd:openssh:7.6p1 -
-
-
- Concluded from remote connection attempt with credentials: -
-
- - Login: VulnScan -
-
- - Password: VulnScan -
-
- + -
-
- +Login: OpenVAS-VT -
-
- +Password: OpenVAS-VT -
-
-
-`; diff --git a/src/web/pages/results/__tests__/diff.jsx b/src/web/pages/results/__tests__/diff.jsx index a4c023f824..f03c7d74e2 100644 --- a/src/web/pages/results/__tests__/diff.jsx +++ b/src/web/pages/results/__tests__/diff.jsx @@ -46,8 +46,8 @@ const diff = ` describe('Diff component tests', () => { test('should render', () => { - const {container} = render({diff}); + const {element} = render({diff}); - expect(container).toMatchSnapshot(); + expect(element).toBeInTheDocument(); }); }); diff --git a/src/web/pages/results/__tests__/listpage.jsx b/src/web/pages/results/__tests__/listpage.jsx index b3d6131bd6..2cb724b1cb 100644 --- a/src/web/pages/results/__tests__/listpage.jsx +++ b/src/web/pages/results/__tests__/listpage.jsx @@ -28,7 +28,18 @@ import {setTimezone, setUsername} from 'web/store/usersettings/actions'; import {loadingActions} from 'web/store/usersettings/defaults/actions'; import {defaultFilterLoadingActions} from 'web/store/usersettings/defaultfilters/actions'; -import {rendererWith, fireEvent, screen, wait} from 'web/utils/testing'; +import {rendererWith, screen, wait} from 'web/utils/testing'; + +import { + clickElement, + getCheckBoxes, + getPowerFilter, + getSelectElement, + getSelectItemElementsForSelect, + getTableBody, + getTableFooter, + getTextInputs, +} from 'web/components/testing'; import ResultsPage from '../listpage'; @@ -192,10 +203,10 @@ describe('Results listpage tests', () => { store.dispatch(setTimezone('CET')); store.dispatch(setUsername('admin')); - const defaultSettingfilter = Filter.fromString('foo=bar'); + const defaultSettingFilter = Filter.fromString('foo=bar'); store.dispatch(loadingActions.success({rowsperpage: {value: '2'}})); store.dispatch( - defaultFilterLoadingActions.success('result', defaultSettingfilter), + defaultFilterLoadingActions.success('result', defaultSettingFilter), ); const counts = new CollectionCounts({ @@ -215,8 +226,9 @@ describe('Results listpage tests', () => { await wait(); - const inputs = baseElement.querySelectorAll('input'); - const selects = screen.getAllByTestId('select-selected-value'); + const powerFilter = getPowerFilter(); + const select = getSelectElement(powerFilter); + const inputs = getTextInputs(powerFilter); // Toolbar Icons expect(screen.getAllByTitle('Help: Results')[0]).toBeInTheDocument(); @@ -230,8 +242,8 @@ describe('Results listpage tests', () => { ).toBeInTheDocument(); expect(screen.getAllByTitle('Help: Powerfilter')[0]).toBeInTheDocument(); expect(screen.getAllByTitle('Edit Filter')[0]).toBeInTheDocument(); - expect(selects[0]).toHaveAttribute('title', 'Loaded filter'); - expect(selects[0]).toHaveTextContent('--'); + expect(select).toHaveAttribute('title', 'Loaded filter'); + expect(select).toHaveValue('--'); // Dashboard expect( @@ -324,10 +336,10 @@ describe('Results listpage tests', () => { store.dispatch(setTimezone('CET')); store.dispatch(setUsername('admin')); - const defaultSettingfilter = Filter.fromString('foo=bar'); + const defaultSettingFilter = Filter.fromString('foo=bar'); store.dispatch(loadingActions.success({rowsperpage: {value: '2'}})); store.dispatch( - defaultFilterLoadingActions.success('result', defaultSettingfilter), + defaultFilterLoadingActions.success('result', defaultSettingFilter), ); const counts = new CollectionCounts({ @@ -347,10 +359,7 @@ describe('Results listpage tests', () => { await wait(); - fireEvent.click(screen.getAllByTitle('Export page contents')[0]); - - await wait(); - + await clickElement(screen.getAllByTitle('Export page contents')[0]); expect(exportByFilter).toHaveBeenCalled(); }); @@ -386,10 +395,10 @@ describe('Results listpage tests', () => { store.dispatch(setTimezone('CET')); store.dispatch(setUsername('admin')); - const defaultSettingfilter = Filter.fromString('foo=bar'); + const defaultSettingFilter = Filter.fromString('foo=bar'); store.dispatch(loadingActions.success({rowsperpage: {value: '2'}})); store.dispatch( - defaultFilterLoadingActions.success('result', defaultSettingfilter), + defaultFilterLoadingActions.success('result', defaultSettingFilter), ); const counts = new CollectionCounts({ @@ -405,32 +414,24 @@ describe('Results listpage tests', () => { entitiesLoadingActions.success(results, filter, loadedFilter, counts), ); - const {element} = render(); + render(); await wait(); - // open drop down menu - const selectFields = screen.getAllByTestId('select-open-button'); - fireEvent.click(selectFields[1]); - - // select option "Apply to selection" - const selectItems = screen.getAllByTestId('select-item'); - fireEvent.click(selectItems[1]); - - const selected = screen.getAllByTestId('select-selected-value'); - expect(selected[1]).toHaveTextContent('Apply to selection'); + // change to apply to selection + const tableFooter = getTableFooter(); + const select = getSelectElement(tableFooter); + const selectItems = await getSelectItemElementsForSelect(select); + await clickElement(selectItems[1]); + expect(select).toHaveValue('Apply to selection'); // select a result - const inputs = element.querySelectorAll('input'); - - fireEvent.click(inputs[1]); - await wait(); + const tableBody = getTableBody(); + const inputs = getCheckBoxes(tableBody); + await clickElement(inputs[1]); // export selected result - fireEvent.click(screen.getAllByTitle('Export selection')[0]); - - await wait(); - + await clickElement(screen.getAllByTitle('Export selection')[0]); expect(exportByIds).toHaveBeenCalled(); }); @@ -466,10 +467,10 @@ describe('Results listpage tests', () => { store.dispatch(setTimezone('CET')); store.dispatch(setUsername('admin')); - const defaultSettingfilter = Filter.fromString('foo=bar'); + const defaultSettingFilter = Filter.fromString('foo=bar'); store.dispatch(loadingActions.success({rowsperpage: {value: '2'}})); store.dispatch( - defaultFilterLoadingActions.success('result', defaultSettingfilter), + defaultFilterLoadingActions.success('result', defaultSettingFilter), ); const counts = new CollectionCounts({ @@ -489,24 +490,15 @@ describe('Results listpage tests', () => { await wait(); - // open drop down menu - const selectFields = screen.getAllByTestId('select-open-button'); - fireEvent.click(selectFields[1]); - - // select option "Apply to all filtered" - const selectItems = screen.getAllByTestId('select-item'); - fireEvent.click(selectItems[2]); - - await wait(); - - const selected = screen.getAllByTestId('select-selected-value'); - expect(selected[1]).toHaveTextContent('Apply to all filtered'); + // change to all filtered + const tableFooter = getTableFooter(); + const select = getSelectElement(tableFooter); + const selectItems = await getSelectItemElementsForSelect(select); + await clickElement(selectItems[2]); + expect(select).toHaveValue('Apply to all filtered'); // export all filtered results - fireEvent.click(screen.getAllByTitle('Export all filtered')[0]); - - await wait(); - + await clickElement(screen.getAllByTitle('Export all filtered')[0]); expect(exportByFilter).toHaveBeenCalled(); }); }); From d3d14a0e1a893e3e5f182257d370bb516034450b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ricks?= Date: Tue, 7 May 2024 15:25:02 +0200 Subject: [PATCH 075/149] Add a testing function for getting a table header Besides getting the footer and body also allow to get the header of a table. --- src/web/components/testing.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/web/components/testing.js b/src/web/components/testing.js index 527905f30d..cc4fd67cb6 100644 --- a/src/web/components/testing.js +++ b/src/web/components/testing.js @@ -246,6 +246,14 @@ export const getTableFooter = element => { return element.querySelector('tfoot'); }; +/** + * Get the table header element + */ +export const getTableHeader = element => { + element = getElementOrDocument(element); + return element.querySelector('thead'); +}; + /** * Get action items */ From 8a16076b4d5d3b15f3ded696c9edb5c61416bf8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ricks?= Date: Tue, 7 May 2024 15:28:07 +0200 Subject: [PATCH 076/149] Update and fix scan config pages tests --- .../__tests__/__snapshots__/details.jsx.snap | 219 -- .../__snapshots__/detailspage.jsx.snap | 1321 ------- .../editconfigfamilydialog.jsx.snap | 1566 -------- .../__snapshots__/editdialog.jsx.snap | 3416 ----------------- .../__tests__/__snapshots__/listpage.jsx.snap | 2112 ---------- .../__tests__/__snapshots__/row.jsx.snap | 405 -- .../__tests__/__snapshots__/table.jsx.snap | 1772 --------- .../__tests__/__snapshots__/trend.jsx.snap | 47 - .../pages/scanconfigs/__tests__/details.jsx | 7 +- .../scanconfigs/__tests__/detailspage.jsx | 9 +- .../pages/scanconfigs/__tests__/dialog.jsx | 60 +- .../__tests__/editconfigfamilydialog.jsx | 92 +- .../scanconfigs/__tests__/editdialog.jsx | 80 +- .../__tests__/editnvtdetailsdialog.jsx | 47 +- .../pages/scanconfigs/__tests__/listpage.jsx | 43 +- src/web/pages/scanconfigs/__tests__/row.jsx | 1 - src/web/pages/scanconfigs/__tests__/table.jsx | 1 - src/web/pages/scanconfigs/__tests__/trend.jsx | 2 +- .../scanconfigs/editconfigfamilydialog.jsx | 21 +- 19 files changed, 189 insertions(+), 11032 deletions(-) delete mode 100644 src/web/pages/scanconfigs/__tests__/__snapshots__/details.jsx.snap delete mode 100644 src/web/pages/scanconfigs/__tests__/__snapshots__/detailspage.jsx.snap delete mode 100644 src/web/pages/scanconfigs/__tests__/__snapshots__/editconfigfamilydialog.jsx.snap delete mode 100644 src/web/pages/scanconfigs/__tests__/__snapshots__/editdialog.jsx.snap delete mode 100644 src/web/pages/scanconfigs/__tests__/__snapshots__/listpage.jsx.snap delete mode 100644 src/web/pages/scanconfigs/__tests__/__snapshots__/row.jsx.snap delete mode 100644 src/web/pages/scanconfigs/__tests__/__snapshots__/table.jsx.snap delete mode 100644 src/web/pages/scanconfigs/__tests__/__snapshots__/trend.jsx.snap diff --git a/src/web/pages/scanconfigs/__tests__/__snapshots__/details.jsx.snap b/src/web/pages/scanconfigs/__tests__/__snapshots__/details.jsx.snap deleted file mode 100644 index 0960b0fddc..0000000000 --- a/src/web/pages/scanconfigs/__tests__/__snapshots__/details.jsx.snap +++ /dev/null @@ -1,219 +0,0 @@ -// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html - -exports[`Scan Config Details tests > should render full Details 1`] = ` -.c0 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - -webkit-box-flex: 1; - -webkit-flex-grow: 1; - -ms-flex-positive: 1; - flex-grow: 1; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-align-items: stretch; - -webkit-box-align: stretch; - -ms-flex-align: stretch; - align-items: stretch; -} - -.c5 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-align-items: stretch; - -webkit-box-align: stretch; - -ms-flex-align: stretch; - align-items: stretch; -} - -.c6 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: start; - -ms-flex-pack: start; - -webkit-justify-content: start; - justify-content: start; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c8 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-flex-wrap: wrap; - -webkit-flex-wrap: wrap; - -ms-flex-wrap: wrap; - flex-wrap: wrap; - -webkit-box-pack: start; - -ms-flex-pack: start; - -webkit-justify-content: start; - justify-content: start; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c10 { - display: -webkit-inline-box; - display: -webkit-inline-flex; - display: -ms-inline-flexbox; - display: inline-flex; -} - -.c9 { - margin-left: -5px; -} - -.c9>* { - display: -webkit-inline-box; - display: -webkit-inline-flex; - display: -ms-inline-flexbox; - display: inline-flex; -} - -.c9>* { - margin-left: 5px; -} - -.c7 { - display: -webkit-inline-box; - display: -webkit-inline-flex; - display: -ms-inline-flexbox; - display: inline-flex; -} - -.c1 { - border: 0; - border-spacing: 0px; - font-size: 12px; - text-align: left; - table-layout: auto; -} - -.c2 td { - padding: 4px 4px 4px 0; -} - -.c2 tr td:first-child { - padding-right: 5px; -} - -.c3 { - width: 10%; -} - -.c4 { - width: 90%; -} - -@media print { - .c1 { - border-collapse: collapse; - } -} - -
- - - - - - - - - - - - - - - -
-
- Comment -
-
-
- bar -
-
-
- Tasks using this Scan Config -
-
-
- -
-
-
-`; diff --git a/src/web/pages/scanconfigs/__tests__/__snapshots__/detailspage.jsx.snap b/src/web/pages/scanconfigs/__tests__/__snapshots__/detailspage.jsx.snap deleted file mode 100644 index cab1e7a7f9..0000000000 --- a/src/web/pages/scanconfigs/__tests__/__snapshots__/detailspage.jsx.snap +++ /dev/null @@ -1,1321 +0,0 @@ -// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html - -exports[`Scan Config Detailspage tests > should render full Detailspage 1`] = ` -.c0 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - -webkit-box-flex: 1; - -webkit-flex-grow: 1; - -ms-flex-positive: 1; - flex-grow: 1; - -webkit-box-pack: start; - -ms-flex-pack: start; - -webkit-justify-content: flex-start; - justify-content: flex-start; -} - -.c1 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: justify; - -webkit-justify-content: space-between; - justify-content: space-between; - -webkit-align-items: flex-start; - -webkit-box-align: flex-start; - -ms-flex-align: flex-start; - align-items: flex-start; -} - -.c2 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: start; - -ms-flex-pack: start; - -webkit-justify-content: start; - justify-content: start; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c9 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: justify; - -webkit-justify-content: space-between; - justify-content: space-between; - -webkit-align-items: flex-end; - -webkit-box-align: flex-end; - -ms-flex-align: flex-end; - align-items: flex-end; -} - -.c13 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: start; - -ms-flex-pack: start; - -webkit-justify-content: flex-start; - justify-content: flex-start; - -webkit-align-items: flex-end; - -webkit-box-align: flex-end; - -ms-flex-align: flex-end; - align-items: flex-end; -} - -.c17 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: justify; - -webkit-justify-content: space-between; - justify-content: space-between; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c18 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: start; - -ms-flex-pack: start; - -webkit-justify-content: flex-start; - justify-content: flex-start; -} - -.c20 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - -webkit-box-flex: 1; - -webkit-flex-grow: 1; - -ms-flex-positive: 1; - flex-grow: 1; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-align-items: stretch; - -webkit-box-align: stretch; - -ms-flex-align: stretch; - align-items: stretch; -} - -.c21 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-flex: 1; - -webkit-flex-grow: 1; - -ms-flex-positive: 1; - flex-grow: 1; - -webkit-box-pack: start; - -ms-flex-pack: start; - -webkit-justify-content: flex-start; - justify-content: flex-start; - -webkit-align-items: flex-end; - -webkit-box-align: flex-end; - -ms-flex-align: flex-end; - align-items: flex-end; -} - -.c23 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: start; - -ms-flex-pack: start; - -webkit-justify-content: flex-start; - justify-content: flex-start; - -webkit-align-items: stretch; - -webkit-box-align: stretch; - -ms-flex-align: stretch; - align-items: stretch; -} - -.c26 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c28 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-align-items: stretch; - -webkit-box-align: stretch; - -ms-flex-align: stretch; - align-items: stretch; -} - -.c33 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-flex-wrap: wrap; - -webkit-flex-wrap: wrap; - -ms-flex-wrap: wrap; - flex-wrap: wrap; - -webkit-box-pack: start; - -ms-flex-pack: start; - -webkit-justify-content: start; - justify-content: start; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c7 { - display: -webkit-inline-box; - display: -webkit-inline-flex; - display: -ms-inline-flexbox; - display: inline-flex; -} - -.c4 { - margin-left: -10px; -} - -.c4>* { - display: -webkit-inline-box; - display: -webkit-inline-flex; - display: -ms-inline-flexbox; - display: inline-flex; -} - -.c4>* { - margin-left: 10px; -} - -.c5 { - margin-left: -5px; -} - -.c5>* { - display: -webkit-inline-box; - display: -webkit-inline-flex; - display: -ms-inline-flexbox; - display: inline-flex; -} - -.c5>* { - margin-left: 5px; -} - -.c3 { - display: -webkit-inline-box; - display: -webkit-inline-flex; - display: -ms-inline-flexbox; - display: inline-flex; -} - -.c8 { - cursor: pointer; -} - -.c6 { - height: 16px; - width: 16px; - line-height: 16px; -} - -.c6 * { - height: inherit; - width: inherit; -} - -.c15 { - height: 50px; - width: 50px; - line-height: 50px; -} - -.c15 * { - height: inherit; - width: inherit; -} - -.c10 { - margin: 10px 0px; - padding-bottom: 1px; - border-bottom: 2px solid #e5e5e5; - position: relative; -} - -.c11 { - margin: 0 0 1px 0; -} - -.c12 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: start; - -ms-flex-pack: start; - -webkit-justify-content: flex-start; - justify-content: flex-start; - -webkit-align-items: stretch; - -webkit-box-align: stretch; - -ms-flex-align: stretch; - align-items: stretch; -} - -.c14 { - margin-right: 5px; -} - -.c16 { - word-break: break-all; - min-width: 100px; -} - -.c24 { - font-size: 16px; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-align-items: start; - -webkit-box-align: start; - -ms-flex-align: start; - align-items: start; - -webkit-box-flex: 1; - -webkit-flex-grow: 1; - -ms-flex-positive: 1; - flex-grow: 1; - padding-left: 8px; - padding-right: 8px; - padding-bottom: 2px; - padding-top: 2px; - border-left: 1px solid #f3f3f3; - border-right: 1px solid #e5e5e5; - cursor: pointer; - background-color: #f3f3f3; - border-bottom: 1px solid #f3f3f3; - margin-bottom: -2px; - border-top: 2px solid #11ab51; -} - -.c24:hover { - border-top: 2px solid #11ab51; -} - -.c24:first-child { - border-left: 1px solid #e5e5e5; -} - -.c25 { - font-size: 16px; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-align-items: start; - -webkit-box-align: start; - -ms-flex-align: start; - align-items: start; - -webkit-box-flex: 1; - -webkit-flex-grow: 1; - -ms-flex-positive: 1; - flex-grow: 1; - padding-left: 8px; - padding-right: 8px; - padding-bottom: 2px; - padding-top: 2px; - border-left: 1px solid #fff; - border-right: 1px solid #e5e5e5; - cursor: pointer; - border-top: 2px solid #fff; -} - -.c25:hover { - border-top: 2px solid #e5e5e5; -} - -.c25:first-child { - border-left: 1px solid #fff; -} - -.c22 { - border-bottom: 2px solid #11ab51; - margin-top: 30px; - margin-bottom: 15px; -} - -.c29 { - border: 0; - border-spacing: 0px; - font-size: 12px; - text-align: left; - table-layout: auto; -} - -.c30 td { - padding: 4px 4px 4px 0; -} - -.c30 tr td:first-child { - padding-right: 5px; -} - -.c19 { - border-spacing: 0px; - color: #7F7F7F; - font-size: 10px; -} - -.c19 :nth-child(even) { - margin-left: 3px; -} - -.c19 :nth-child(odd) { - margin-left: 30px; -} - -.c31 { - width: 10%; -} - -.c32 { - width: 90%; -} - -.c27 { - font-size: 0.7em; -} - -@media print { - .c8 { - display: none; - } -} - -@media print { - .c29 { - border-collapse: collapse; - } -} - -
-
-
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
-
-
-
-

-
- - - - - - - - - -
-
- Scan Config: foo -
-

-
-
-
-
- ID: -
-
- 12345 -
-
- Created: -
-
- Tue, Jul 16, 2019 8:31 AM CEST -
-
- Modified: -
-
- Tue, Jul 16, 2019 8:44 AM CEST -
-
- Owner: -
- - admin - -
-
-
-
-
-
-
-
- Information -
-
-
- - Scanner Preferences - - - ( - - 1 - - ) - -
-
-
-
- - NVT Families - - - ( - - 3 - - ) - -
-
-
-
- - NVT Preferences - - - ( - - 3 - - ) - -
-
-
-
- - User Tags - - - ( - - 0 - - ) - -
-
-
-
- - Permissions - - - ( - - 0 - - ) - -
-
-
-
-
-
- - - - - - - - - - - - - - - -
-
- Comment -
-
-
- bar -
-
-
- Tasks using this Scan Config -
-
-
- -
-
-
-
-
-
-
-`; - -exports[`Scan Config ToolBarIcons tests > should render 1`] = ` -.c0 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: start; - -ms-flex-pack: start; - -webkit-justify-content: start; - justify-content: start; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c5 { - display: -webkit-inline-box; - display: -webkit-inline-flex; - display: -ms-inline-flexbox; - display: inline-flex; -} - -.c2 { - margin-left: -10px; -} - -.c2>* { - display: -webkit-inline-box; - display: -webkit-inline-flex; - display: -ms-inline-flexbox; - display: inline-flex; -} - -.c2>* { - margin-left: 10px; -} - -.c3 { - margin-left: -5px; -} - -.c3>* { - display: -webkit-inline-box; - display: -webkit-inline-flex; - display: -ms-inline-flexbox; - display: inline-flex; -} - -.c3>* { - margin-left: 5px; -} - -.c1 { - display: -webkit-inline-box; - display: -webkit-inline-flex; - display: -ms-inline-flexbox; - display: inline-flex; -} - -.c6 { - cursor: pointer; -} - -.c4 { - height: 16px; - width: 16px; - line-height: 16px; -} - -.c4 * { - height: inherit; - width: inherit; -} - -@media print { - .c6 { - display: none; - } -} - -
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
-`; diff --git a/src/web/pages/scanconfigs/__tests__/__snapshots__/editconfigfamilydialog.jsx.snap b/src/web/pages/scanconfigs/__tests__/__snapshots__/editconfigfamilydialog.jsx.snap deleted file mode 100644 index 82bb80b9d0..0000000000 --- a/src/web/pages/scanconfigs/__tests__/__snapshots__/editconfigfamilydialog.jsx.snap +++ /dev/null @@ -1,1566 +0,0 @@ -// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html - -exports[`EditConfigFamilyDialog component tests > should render dialog 1`] = ` -.c3 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: justify; - -webkit-justify-content: space-between; - justify-content: space-between; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c7 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - -webkit-box-flex: 1; - -webkit-flex-grow: 1; - -ms-flex-positive: 1; - flex-grow: 1; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-align-items: flex-start; - -webkit-box-align: flex-start; - -ms-flex-align: flex-start; - align-items: flex-start; -} - -.c10 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-align-items: stretch; - -webkit-box-align: stretch; - -ms-flex-align: stretch; - align-items: stretch; -} - -.c12 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: justify; - -webkit-justify-content: space-between; - justify-content: space-between; - -webkit-align-items: flex-end; - -webkit-box-align: flex-end; - -ms-flex-align: flex-end; - align-items: flex-end; -} - -.c16 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: start; - -ms-flex-pack: start; - -webkit-justify-content: flex-start; - justify-content: flex-start; - -webkit-align-items: flex-end; - -webkit-box-align: flex-end; - -ms-flex-align: flex-end; - align-items: flex-end; -} - -.c23 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: start; - -ms-flex-pack: start; - -webkit-justify-content: start; - justify-content: start; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c24 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; -} - -.c28 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; -} - -.c34 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c38 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-flex-shrink: 0; - -ms-flex-negative: 0; - flex-shrink: 0; - -webkit-box-pack: end; - -ms-flex-pack: end; - -webkit-justify-content: flex-end; - justify-content: flex-end; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c31 { - margin-left: -5px; -} - -.c31>* { - display: -webkit-inline-box; - display: -webkit-inline-flex; - display: -ms-inline-flexbox; - display: inline-flex; -} - -.c31>* { - margin-left: 5px; -} - -.c30 { - display: -webkit-inline-box; - display: -webkit-inline-flex; - display: -ms-inline-flexbox; - display: inline-flex; -} - -.c35 { - cursor: pointer; -} - -.c36 { - height: 16px; - width: 16px; - line-height: 16px; -} - -.c36 * { - height: inherit; - width: inherit; -} - -.c13 { - margin: 10px 0px; - padding-bottom: 1px; - border-bottom: 2px solid #e5e5e5; - position: relative; -} - -.c14 { - margin: 0 0 1px 0; -} - -.c15 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: start; - -ms-flex-pack: start; - -webkit-justify-content: flex-start; - justify-content: flex-start; - -webkit-align-items: stretch; - -webkit-box-align: stretch; - -ms-flex-align: stretch; - align-items: stretch; -} - -.c17 { - word-break: break-all; - min-width: 100px; -} - -.c1 { - position: relative; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - margin: 10% auto; - border: 0; - outline: 0; - width: 800px; - height: px; -} - -.c0 { - position: fixed; - font-family: Trebuchet MS,Tahoma,Verdana,Arial,sans-serif; - font-size: 1.1em; - top: 0; - right: 0; - bottom: 0; - left: 0; - margin: 0; - background: rgba(102, 102, 102, 0.5); - z-index: 600; - -webkit-transition: opacity 1s ease-in; - transition: opacity 1s ease-in; - width: 100%; - height: 100%; -} - -.c45 { - width: 0; - height: 0; - cursor: nwse-resize; - border-right: 20px solid transparent; - border-bottom: 20px solid transparent; - border-top: 20px solid #fff; -} - -.c44 { - position: absolute; - bottom: 3px; - right: 3px; - width: 20px; - height: 20px; - background: repeating-linear-gradient( -45deg, transparent, transparent 2px, #000 2px, #000 3px ); -} - -.c2 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - height: inherit; - padding: 0; - background: #fff; - box-shadow: 5px 5px 10px #7F7F7F; - border-radius: 3px; - border: 1px solid #7F7F7F; -} - -.c5 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - font-weight: bold; - font-size: 12px; - font-family: Verdana,sans-serif; - color: #074320; - cursor: pointer; - border-radius: 2px; - padding: 0; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-flex-shrink: 0; - -ms-flex-negative: 0; - flex-shrink: 0; -} - -.c5 :hover { - border: 1px solid #074320; -} - -.c6 { - height: 24px; - width: 24px; - line-height: 24px; -} - -.c6 * { - height: inherit; - width: inherit; -} - -.c41 { - display: inline-block; - padding: 0 15px; - color: #4C4C4C; - text-align: center; - vertical-align: middle; - font-size: 11px; - font-weight: bold; - line-height: 30px; - -webkit-text-decoration: none; - text-decoration: none; - white-space: nowrap; - background-color: #fff; - border-radius: 2px; - border: 1px solid #bfbfbf; - cursor: pointer; - overflow: visible; - z-index: 1; -} - -.c41:focus, -.c41:hover { - border: 1px solid #4C4C4C; -} - -.c41:hover { - -webkit-text-decoration: none; - text-decoration: none; - background: #11ab51; - font-weight: bold; - color: #fff; -} - -.c41[disabled] { - cursor: not-allowed; - opacity: 0.65; - box-shadow: none; -} - -.c41 img { - height: 32px; - width: 32px; - margin-top: 5px 10px 5px -10px; - vertical-align: middle; -} - -.c41:link { - -webkit-text-decoration: none; - text-decoration: none; - color: #4C4C4C; -} - -.c42 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c43 { - border: 1px solid #7F7F7F; - color: #fff; - background: #11ab51; -} - -.c43 :hover { - color: #074320; - background: #A1DDBA; -} - -.c39 { - border-width: 1px 0 0 0; - border-style: solid; - border-color: #e5e5e5; - margin-top: 15px; - padding: 10px 20px 10px 20px; -} - -.c40 { - -webkit-box-pack: justify; - -webkit-justify-content: space-between; - justify-content: space-between; -} - -.c4 { - padding: 5px 5px 5px 10px; - margin-bottom: 15px; - border-radius: 2px 2px 0 0; - border-bottom: 1px solid #7F7F7F; - color: #fff; - font-weight: bold; - background: #11ab51; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: justify; - -webkit-justify-content: space-between; - justify-content: space-between; - -webkit-flex-shrink: 0; - -ms-flex-negative: 0; - flex-shrink: 0; - cursor: -webkit-grab; - cursor: grab; -} - -.c9 { - overflow: auto; - padding: 0 15px; - width: 100%; - height: 100%; - max-height: 400px; -} - -.c8 { - overflow: hidden; - height: 100%; -} - -.c11 { - border: 0; - border-spacing: 0px; - font-size: 12px; - text-align: left; - table-layout: auto; -} - -.c18 { - border: 0; - border-spacing: 0px; - font-size: 12px; - text-align: left; - table-layout: auto; - width: 100%; -} - -.c19 th, -.c19 td { - padding: 4px 10px; - border-bottom: 1px solid #e5e5e5; -} - -.c19 tfoot tr { - background: #fff; -} - -.c19 tfoot tr td { - border-bottom: 1px solid #e5e5e5; -} - -.c20 a { - -webkit-text-decoration: none; - text-decoration: none; - color: #000; -} - -.c20 a:hover { - -webkit-text-decoration: underline; - text-decoration: underline; - color: #000; -} - -.c22 { - cursor: pointer; -} - -.c21 { - background-color: #fff; - color: #000; - border-top: 1px solid #e5e5e5; - font-weight: bold; -} - -.c29 { - display: -webkit-inline-box; - display: -webkit-inline-flex; - display: -ms-inline-flexbox; - display: inline-flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - font-weight: normal; - cursor: pointer; -} - -.c32 { - font-family: inherit; - font-size: inherit; - padding: 0; - margin: 0; - margin-left: 10px; - line-height: normal; - width: auto; - height: auto; -} - -.c33 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: start; - -ms-flex-pack: start; - -webkit-justify-content: start; - justify-content: start; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c25 { - height: 13px; - box-sizing: content-box; - display: inline-block; - width: 100px; - background: #4C4C4C; - vertical-align: middle; - text-align: center; -} - -.c27 { - z-index: 1; - font-weight: bold; - color: #fff; - font-size: 9px; - margin: 0; - position: relative; - top: -13px; - padding-top: 1px; -} - -.c26 { - height: 13px; - width: 10%; - background: #4f91c7; -} - -.c37 { - height: 13px; - width: 100%; - background: #c83814; -} - -@media print { - .c35 { - display: none; - } -} - -@media print { - .c11 { - border-collapse: collapse; - } -} - -@media print { - .c18 { - border-collapse: collapse; - } -} - -@media screen { - .c19>tbody:nth-of-type(even), - .c19>tbody:only-of-type>tr:nth-of-type(even) { - background: #f3f3f3; - } - - .c19>tbody:not(:only-of-type):hover, - .c19>tbody:only-of-type>tr:hover { - background: #e5e5e5; - } -} - -@media print { - .c20 { - border-bottom: 1px solid black; - } - - .c20 a, - .c20 a:hover { - -webkit-text-decoration: none; - text-decoration: none; - color: #000; - } -} - -@media print { - .c21 { - color: #000; - font-size: 1.2em; - background-color: transparent; - font-weight: bold; - } -} - -@media print { - .c25 { - background: none; - border: 0; - } -} - -@media print { - .c27 { - color: black; - } -} - -@media print { - .c26 { - background: none; - } -} - -@media print { - .c37 { - background: none; - } -} - - -
-
-
- -
-
-
- -`; - -exports[`EditConfigFamilyDialog component tests > should render loading indicator 1`] = ` -.c3 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: justify; - -webkit-justify-content: space-between; - justify-content: space-between; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c7 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - -webkit-box-flex: 1; - -webkit-flex-grow: 1; - -ms-flex-positive: 1; - flex-grow: 1; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-align-items: flex-start; - -webkit-box-align: flex-start; - -ms-flex-align: flex-start; - align-items: flex-start; -} - -.c10 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c13 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-flex-shrink: 0; - -ms-flex-negative: 0; - flex-shrink: 0; - -webkit-box-pack: end; - -ms-flex-pack: end; - -webkit-justify-content: flex-end; - justify-content: flex-end; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c12 { - width: 80px; - height: 80px; - margin: 40px auto; - background-image: url(/src/web/components/icon/svg/greenbone.svg); - -webkit-background-size: 90%; - background-size: 90%; - -webkit-background-position: center; - background-position: center; - background-repeat: no-repeat; - -webkit-animation: hGzRiT 2s infinite ease-in-out; - animation: hGzRiT 2s infinite ease-in-out; -} - -.c11 { - width: 100%; -} - -.c1 { - position: relative; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - margin: 10% auto; - border: 0; - outline: 0; - width: 800px; - height: px; -} - -.c0 { - position: fixed; - font-family: Trebuchet MS,Tahoma,Verdana,Arial,sans-serif; - font-size: 1.1em; - top: 0; - right: 0; - bottom: 0; - left: 0; - margin: 0; - background: rgba(102, 102, 102, 0.5); - z-index: 600; - -webkit-transition: opacity 1s ease-in; - transition: opacity 1s ease-in; - width: 100%; - height: 100%; -} - -.c20 { - width: 0; - height: 0; - cursor: nwse-resize; - border-right: 20px solid transparent; - border-bottom: 20px solid transparent; - border-top: 20px solid #fff; -} - -.c19 { - position: absolute; - bottom: 3px; - right: 3px; - width: 20px; - height: 20px; - background: repeating-linear-gradient( -45deg, transparent, transparent 2px, #000 2px, #000 3px ); -} - -.c2 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - height: inherit; - padding: 0; - background: #fff; - box-shadow: 5px 5px 10px #7F7F7F; - border-radius: 3px; - border: 1px solid #7F7F7F; -} - -.c5 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - font-weight: bold; - font-size: 12px; - font-family: Verdana,sans-serif; - color: #074320; - cursor: pointer; - border-radius: 2px; - padding: 0; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-flex-shrink: 0; - -ms-flex-negative: 0; - flex-shrink: 0; -} - -.c5 :hover { - border: 1px solid #074320; -} - -.c6 { - height: 24px; - width: 24px; - line-height: 24px; -} - -.c6 * { - height: inherit; - width: inherit; -} - -.c16 { - display: inline-block; - padding: 0 15px; - color: #4C4C4C; - text-align: center; - vertical-align: middle; - font-size: 11px; - font-weight: bold; - line-height: 30px; - -webkit-text-decoration: none; - text-decoration: none; - white-space: nowrap; - background-color: #fff; - border-radius: 2px; - border: 1px solid #bfbfbf; - cursor: pointer; - overflow: visible; - z-index: 1; -} - -.c16:focus, -.c16:hover { - border: 1px solid #4C4C4C; -} - -.c16:hover { - -webkit-text-decoration: none; - text-decoration: none; - background: #11ab51; - font-weight: bold; - color: #fff; -} - -.c16[disabled] { - cursor: not-allowed; - opacity: 0.65; - box-shadow: none; -} - -.c16 img { - height: 32px; - width: 32px; - margin-top: 5px 10px 5px -10px; - vertical-align: middle; -} - -.c16:link { - -webkit-text-decoration: none; - text-decoration: none; - color: #4C4C4C; -} - -.c17 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c18 { - border: 1px solid #7F7F7F; - color: #fff; - background: #11ab51; -} - -.c18 :hover { - color: #074320; - background: #A1DDBA; -} - -.c14 { - border-width: 1px 0 0 0; - border-style: solid; - border-color: #e5e5e5; - margin-top: 15px; - padding: 10px 20px 10px 20px; -} - -.c15 { - -webkit-box-pack: justify; - -webkit-justify-content: space-between; - justify-content: space-between; -} - -.c4 { - padding: 5px 5px 5px 10px; - margin-bottom: 15px; - border-radius: 2px 2px 0 0; - border-bottom: 1px solid #7F7F7F; - color: #fff; - font-weight: bold; - background: #11ab51; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: justify; - -webkit-justify-content: space-between; - justify-content: space-between; - -webkit-flex-shrink: 0; - -ms-flex-negative: 0; - flex-shrink: 0; - cursor: -webkit-grab; - cursor: grab; -} - -.c9 { - overflow: auto; - padding: 0 15px; - width: 100%; - height: 100%; - max-height: 400px; -} - -.c8 { - overflow: hidden; - height: 100%; -} - - -
-
-
- -
-
- -`; diff --git a/src/web/pages/scanconfigs/__tests__/__snapshots__/editdialog.jsx.snap b/src/web/pages/scanconfigs/__tests__/__snapshots__/editdialog.jsx.snap deleted file mode 100644 index 766f77aae1..0000000000 --- a/src/web/pages/scanconfigs/__tests__/__snapshots__/editdialog.jsx.snap +++ /dev/null @@ -1,3416 +0,0 @@ -// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html - -exports[`EditScanConfigDialog component tests > should render dialog 1`] = ` -.c3 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: justify; - -webkit-justify-content: space-between; - justify-content: space-between; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c7 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - -webkit-box-flex: 1; - -webkit-flex-grow: 1; - -ms-flex-positive: 1; - flex-grow: 1; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-align-items: flex-start; - -webkit-box-align: flex-start; - -ms-flex-align: flex-start; - align-items: flex-start; -} - -.c10 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-align-items: stretch; - -webkit-box-align: stretch; - -ms-flex-align: stretch; - align-items: stretch; -} - -.c13 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: start; - -ms-flex-pack: start; - -webkit-justify-content: start; - justify-content: start; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c18 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: justify; - -webkit-justify-content: space-between; - justify-content: space-between; - -webkit-align-items: flex-end; - -webkit-box-align: flex-end; - -ms-flex-align: flex-end; - align-items: flex-end; -} - -.c22 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: start; - -ms-flex-pack: start; - -webkit-justify-content: flex-start; - justify-content: flex-start; - -webkit-align-items: flex-end; - -webkit-box-align: flex-end; - -ms-flex-align: flex-end; - align-items: flex-end; -} - -.c28 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-flex: 1; - -webkit-flex-grow: 1; - -ms-flex-positive: 1; - flex-grow: 1; - -webkit-box-pack: start; - -ms-flex-pack: start; - -webkit-justify-content: start; - justify-content: start; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c34 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; -} - -.c35 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - -webkit-box-pack: start; - -ms-flex-pack: start; - -webkit-justify-content: flex-start; - justify-content: flex-start; -} - -.c36 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-align-items: flex-start; - -webkit-box-align: flex-start; - -ms-flex-align: flex-start; - align-items: flex-start; -} - -.c42 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - -webkit-box-pack: start; - -ms-flex-pack: start; - -webkit-justify-content: flex-start; - justify-content: flex-start; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c44 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c51 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-flex-shrink: 0; - -ms-flex-negative: 0; - flex-shrink: 0; - -webkit-box-pack: end; - -ms-flex-pack: end; - -webkit-justify-content: flex-end; - justify-content: flex-end; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c38 { - margin-left: -5px; -} - -.c38>* { - display: -webkit-inline-box; - display: -webkit-inline-flex; - display: -ms-inline-flexbox; - display: inline-flex; -} - -.c38>* { - margin-left: 5px; -} - -.c37 { - display: -webkit-inline-box; - display: -webkit-inline-flex; - display: -ms-inline-flexbox; - display: inline-flex; -} - -.c25 { - cursor: pointer; -} - -.c26 { - height: 16px; - width: 16px; - line-height: 16px; -} - -.c26 * { - height: inherit; - width: inherit; -} - -.c27 { - overflow: hidden; - -webkit-transition: 0.4s; - transition: 0.4s; -} - -.c45 { - overflow: hidden; - -webkit-transition: 0.4s; - transition: 0.4s; - display: none; - height: 0; -} - -.c19 { - margin: 10px 0px; - padding-bottom: 1px; - border-bottom: 2px solid #e5e5e5; - position: relative; -} - -.c20 { - margin: 0 0 1px 0; -} - -.c21 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: start; - -ms-flex-pack: start; - -webkit-justify-content: flex-start; - justify-content: flex-start; - -webkit-align-items: stretch; - -webkit-box-align: stretch; - -ms-flex-align: stretch; - align-items: stretch; -} - -.c23 { - word-break: break-all; - min-width: 100px; -} - -.c24 { - margin-left: 3px; - margin-top: -2px; -} - -.c1 { - position: relative; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - margin: 10% auto; - border: 0; - outline: 0; - width: 800px; - height: px; -} - -.c0 { - position: fixed; - font-family: Trebuchet MS,Tahoma,Verdana,Arial,sans-serif; - font-size: 1.1em; - top: 0; - right: 0; - bottom: 0; - left: 0; - margin: 0; - background: rgba(102, 102, 102, 0.5); - z-index: 600; - -webkit-transition: opacity 1s ease-in; - transition: opacity 1s ease-in; - width: 100%; - height: 100%; -} - -.c58 { - width: 0; - height: 0; - cursor: nwse-resize; - border-right: 20px solid transparent; - border-bottom: 20px solid transparent; - border-top: 20px solid #fff; -} - -.c57 { - position: absolute; - bottom: 3px; - right: 3px; - width: 20px; - height: 20px; - background: repeating-linear-gradient( -45deg, transparent, transparent 2px, #000 2px, #000 3px ); -} - -.c2 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - height: inherit; - padding: 0; - background: #fff; - box-shadow: 5px 5px 10px #7F7F7F; - border-radius: 3px; - border: 1px solid #7F7F7F; -} - -.c5 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - font-weight: bold; - font-size: 12px; - font-family: Verdana,sans-serif; - color: #074320; - cursor: pointer; - border-radius: 2px; - padding: 0; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-flex-shrink: 0; - -ms-flex-negative: 0; - flex-shrink: 0; -} - -.c5 :hover { - border: 1px solid #074320; -} - -.c6 { - height: 24px; - width: 24px; - line-height: 24px; -} - -.c6 * { - height: inherit; - width: inherit; -} - -.c54 { - display: inline-block; - padding: 0 15px; - color: #4C4C4C; - text-align: center; - vertical-align: middle; - font-size: 11px; - font-weight: bold; - line-height: 30px; - -webkit-text-decoration: none; - text-decoration: none; - white-space: nowrap; - background-color: #fff; - border-radius: 2px; - border: 1px solid #bfbfbf; - cursor: pointer; - overflow: visible; - z-index: 1; -} - -.c54:focus, -.c54:hover { - border: 1px solid #4C4C4C; -} - -.c54:hover { - -webkit-text-decoration: none; - text-decoration: none; - background: #11ab51; - font-weight: bold; - color: #fff; -} - -.c54[disabled] { - cursor: not-allowed; - opacity: 0.65; - box-shadow: none; -} - -.c54 img { - height: 32px; - width: 32px; - margin-top: 5px 10px 5px -10px; - vertical-align: middle; -} - -.c54:link { - -webkit-text-decoration: none; - text-decoration: none; - color: #4C4C4C; -} - -.c55 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c56 { - border: 1px solid #7F7F7F; - color: #fff; - background: #11ab51; -} - -.c56 :hover { - color: #074320; - background: #A1DDBA; -} - -.c52 { - border-width: 1px 0 0 0; - border-style: solid; - border-color: #e5e5e5; - margin-top: 15px; - padding: 10px 20px 10px 20px; -} - -.c53 { - -webkit-box-pack: justify; - -webkit-justify-content: space-between; - justify-content: space-between; -} - -.c4 { - padding: 5px 5px 5px 10px; - margin-bottom: 15px; - border-radius: 2px 2px 0 0; - border-bottom: 1px solid #7F7F7F; - color: #fff; - font-weight: bold; - background: #11ab51; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: justify; - -webkit-justify-content: space-between; - justify-content: space-between; - -webkit-flex-shrink: 0; - -ms-flex-negative: 0; - flex-shrink: 0; - cursor: -webkit-grab; - cursor: grab; -} - -.c9 { - overflow: auto; - padding: 0 15px; - width: 100%; - height: 100%; - max-height: 400px; -} - -.c8 { - overflow: hidden; - height: 100%; -} - -.c11 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: start; - -ms-flex-pack: start; - -webkit-justify-content: start; - justify-content: start; - padding-bottom: 10px; -} - -.c12 { - display: inline-block; - max-width: 100%; - font-weight: bold; - text-align: right; - padding-left: 10px; - padding-right: 10px; - width: 16.66666667%; - margin-left: 0; -} - -.c14 { - width: 83.33333333%; - padding-left: 10px; - padding-right: 10px; -} - -.c17 { - color: #c12c30; - font-weight: bold; - font-size: 19px; - padding-bottom: 1px; - padding-left: 4px; - display: none; -} - -.c29 { - border: 0; - border-spacing: 0px; - font-size: 12px; - text-align: left; - table-layout: auto; - width: 100%; -} - -.c47 { - border: 0; - border-spacing: 0px; - font-size: 12px; - text-align: left; - table-layout: fixed; - width: 100%; -} - -.c30 th, -.c30 td { - padding: 4px 10px; - border-bottom: 1px solid #e5e5e5; -} - -.c30 tfoot tr { - background: #fff; -} - -.c30 tfoot tr td { - border-bottom: 1px solid #e5e5e5; -} - -.c31 a { - -webkit-text-decoration: none; - text-decoration: none; - color: #000; -} - -.c31 a:hover { - -webkit-text-decoration: underline; - text-decoration: underline; - color: #000; -} - -.c32 { - background-color: #fff; - color: #000; - border-top: 1px solid #e5e5e5; - font-weight: bold; -} - -.c33 { - background-color: #fff; - color: #000; - border-top: 1px solid #e5e5e5; - font-weight: bold; - width: 9em; -} - -.c48 { - background-color: #fff; - color: #000; - border-top: 1px solid #e5e5e5; - font-weight: bold; - width: 30%; -} - -.c49 { - background-color: #fff; - color: #000; - border-top: 1px solid #e5e5e5; - font-weight: bold; - width: 10%; -} - -.c15 { - font-family: inherit; - font-size: inherit; - line-height: inherit; - display: block; - height: 22px; - color: #4C4C4C; - background-color: #fff; - background-image: none; - border: 1px solid #bfbfbf; - border-radius: 2px; - padding: 1px 8px; -} - -.c15:-webkit-autofill { - box-shadow: 0 0 0 1000px white inset; -} - -.c16 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-flex: 1; - -webkit-flex-grow: 1; - -ms-flex-positive: 1; - flex-grow: 1; - -webkit-box-pack: start; - -ms-flex-pack: start; - -webkit-justify-content: start; - justify-content: start; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c46 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: start; - -ms-flex-pack: start; - -webkit-justify-content: start; - justify-content: start; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c39 { - display: -webkit-inline-box; - display: -webkit-inline-flex; - display: -ms-inline-flexbox; - display: inline-flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - font-weight: normal; - cursor: pointer; -} - -.c40 { - font-family: inherit; - font-size: inherit; - padding: 0; - margin: 0; - margin-left: 10px; - line-height: normal; - width: auto; - height: auto; -} - -.c41 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: start; - -ms-flex-pack: start; - -webkit-justify-content: flex-start; - justify-content: flex-start; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c43 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: start; - -ms-flex-pack: start; - -webkit-justify-content: start; - justify-content: start; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c50 { - overflow-wrap: break-word; -} - -@media print { - .c25 { - display: none; - } -} - -@media print { - .c29 { - border-collapse: collapse; - } -} - -@media print { - .c47 { - border-collapse: collapse; - } -} - -@media screen { - .c30>tbody:nth-of-type(even), - .c30>tbody:only-of-type>tr:nth-of-type(even) { - background: #f3f3f3; - } - - .c30>tbody:not(:only-of-type):hover, - .c30>tbody:only-of-type>tr:hover { - background: #e5e5e5; - } -} - -@media print { - .c31 { - border-bottom: 1px solid black; - } - - .c31 a, - .c31 a:hover { - -webkit-text-decoration: none; - text-decoration: none; - color: #000; - } -} - -@media print { - .c32 { - color: #000; - font-size: 1.2em; - background-color: transparent; - font-weight: bold; - } -} - -@media print { - .c33 { - color: #000; - font-size: 1.2em; - background-color: transparent; - font-weight: bold; - } -} - -@media print { - .c48 { - color: #000; - font-size: 1.2em; - background-color: transparent; - font-weight: bold; - } -} - -@media print { - .c49 { - color: #000; - font-size: 1.2em; - background-color: transparent; - font-weight: bold; - } -} - - -
-
-
- -
-
-
- -`; - -exports[`EditScanConfigDialog component tests > should render dialog for config in use 1`] = ` -.c3 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: justify; - -webkit-justify-content: space-between; - justify-content: space-between; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c7 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - -webkit-box-flex: 1; - -webkit-flex-grow: 1; - -ms-flex-positive: 1; - flex-grow: 1; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-align-items: flex-start; - -webkit-box-align: flex-start; - -ms-flex-align: flex-start; - align-items: flex-start; -} - -.c10 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-align-items: stretch; - -webkit-box-align: stretch; - -ms-flex-align: stretch; - align-items: stretch; -} - -.c13 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: start; - -ms-flex-pack: start; - -webkit-justify-content: start; - justify-content: start; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c19 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-flex-shrink: 0; - -ms-flex-negative: 0; - flex-shrink: 0; - -webkit-box-pack: end; - -ms-flex-pack: end; - -webkit-justify-content: flex-end; - justify-content: flex-end; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c1 { - position: relative; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - margin: 10% auto; - border: 0; - outline: 0; - width: 800px; - height: px; -} - -.c0 { - position: fixed; - font-family: Trebuchet MS,Tahoma,Verdana,Arial,sans-serif; - font-size: 1.1em; - top: 0; - right: 0; - bottom: 0; - left: 0; - margin: 0; - background: rgba(102, 102, 102, 0.5); - z-index: 600; - -webkit-transition: opacity 1s ease-in; - transition: opacity 1s ease-in; - width: 100%; - height: 100%; -} - -.c26 { - width: 0; - height: 0; - cursor: nwse-resize; - border-right: 20px solid transparent; - border-bottom: 20px solid transparent; - border-top: 20px solid #fff; -} - -.c25 { - position: absolute; - bottom: 3px; - right: 3px; - width: 20px; - height: 20px; - background: repeating-linear-gradient( -45deg, transparent, transparent 2px, #000 2px, #000 3px ); -} - -.c2 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - height: inherit; - padding: 0; - background: #fff; - box-shadow: 5px 5px 10px #7F7F7F; - border-radius: 3px; - border: 1px solid #7F7F7F; -} - -.c5 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - font-weight: bold; - font-size: 12px; - font-family: Verdana,sans-serif; - color: #074320; - cursor: pointer; - border-radius: 2px; - padding: 0; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-flex-shrink: 0; - -ms-flex-negative: 0; - flex-shrink: 0; -} - -.c5 :hover { - border: 1px solid #074320; -} - -.c6 { - height: 24px; - width: 24px; - line-height: 24px; -} - -.c6 * { - height: inherit; - width: inherit; -} - -.c22 { - display: inline-block; - padding: 0 15px; - color: #4C4C4C; - text-align: center; - vertical-align: middle; - font-size: 11px; - font-weight: bold; - line-height: 30px; - -webkit-text-decoration: none; - text-decoration: none; - white-space: nowrap; - background-color: #fff; - border-radius: 2px; - border: 1px solid #bfbfbf; - cursor: pointer; - overflow: visible; - z-index: 1; -} - -.c22:focus, -.c22:hover { - border: 1px solid #4C4C4C; -} - -.c22:hover { - -webkit-text-decoration: none; - text-decoration: none; - background: #11ab51; - font-weight: bold; - color: #fff; -} - -.c22[disabled] { - cursor: not-allowed; - opacity: 0.65; - box-shadow: none; -} - -.c22 img { - height: 32px; - width: 32px; - margin-top: 5px 10px 5px -10px; - vertical-align: middle; -} - -.c22:link { - -webkit-text-decoration: none; - text-decoration: none; - color: #4C4C4C; -} - -.c23 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c24 { - border: 1px solid #7F7F7F; - color: #fff; - background: #11ab51; -} - -.c24 :hover { - color: #074320; - background: #A1DDBA; -} - -.c20 { - border-width: 1px 0 0 0; - border-style: solid; - border-color: #e5e5e5; - margin-top: 15px; - padding: 10px 20px 10px 20px; -} - -.c21 { - -webkit-box-pack: justify; - -webkit-justify-content: space-between; - justify-content: space-between; -} - -.c4 { - padding: 5px 5px 5px 10px; - margin-bottom: 15px; - border-radius: 2px 2px 0 0; - border-bottom: 1px solid #7F7F7F; - color: #fff; - font-weight: bold; - background: #11ab51; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: justify; - -webkit-justify-content: space-between; - justify-content: space-between; - -webkit-flex-shrink: 0; - -ms-flex-negative: 0; - flex-shrink: 0; - cursor: -webkit-grab; - cursor: grab; -} - -.c9 { - overflow: auto; - padding: 0 15px; - width: 100%; - height: 100%; - max-height: 400px; -} - -.c8 { - overflow: hidden; - height: 100%; -} - -.c11 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: start; - -ms-flex-pack: start; - -webkit-justify-content: start; - justify-content: start; - padding-bottom: 10px; -} - -.c12 { - display: inline-block; - max-width: 100%; - font-weight: bold; - text-align: right; - padding-left: 10px; - padding-right: 10px; - width: 16.66666667%; - margin-left: 0; -} - -.c14 { - width: 83.33333333%; - padding-left: 10px; - padding-right: 10px; -} - -.c17 { - color: #c12c30; - font-weight: bold; - font-size: 19px; - padding-bottom: 1px; - padding-left: 4px; - display: none; -} - -.c15 { - font-family: inherit; - font-size: inherit; - line-height: inherit; - display: block; - height: 22px; - color: #4C4C4C; - background-color: #fff; - background-image: none; - border: 1px solid #bfbfbf; - border-radius: 2px; - padding: 1px 8px; -} - -.c15:-webkit-autofill { - box-shadow: 0 0 0 1000px white inset; -} - -.c16 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-flex: 1; - -webkit-flex-grow: 1; - -ms-flex-positive: 1; - flex-grow: 1; - -webkit-box-pack: start; - -ms-flex-pack: start; - -webkit-justify-content: start; - justify-content: start; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c18 { - font-size: 14px; - margin-bottom: 0px; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; -} - - -
-
-
- -
-
-
- -`; - -exports[`EditScanConfigDialog component tests > should render dialog inline notification for policy in use 1`] = ` -.c3 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: justify; - -webkit-justify-content: space-between; - justify-content: space-between; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c7 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - -webkit-box-flex: 1; - -webkit-flex-grow: 1; - -ms-flex-positive: 1; - flex-grow: 1; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-align-items: flex-start; - -webkit-box-align: flex-start; - -ms-flex-align: flex-start; - align-items: flex-start; -} - -.c10 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-align-items: stretch; - -webkit-box-align: stretch; - -ms-flex-align: stretch; - align-items: stretch; -} - -.c13 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: start; - -ms-flex-pack: start; - -webkit-justify-content: start; - justify-content: start; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c19 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-flex-shrink: 0; - -ms-flex-negative: 0; - flex-shrink: 0; - -webkit-box-pack: end; - -ms-flex-pack: end; - -webkit-justify-content: flex-end; - justify-content: flex-end; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c1 { - position: relative; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - margin: 10% auto; - border: 0; - outline: 0; - width: 800px; - height: px; -} - -.c0 { - position: fixed; - font-family: Trebuchet MS,Tahoma,Verdana,Arial,sans-serif; - font-size: 1.1em; - top: 0; - right: 0; - bottom: 0; - left: 0; - margin: 0; - background: rgba(102, 102, 102, 0.5); - z-index: 600; - -webkit-transition: opacity 1s ease-in; - transition: opacity 1s ease-in; - width: 100%; - height: 100%; -} - -.c26 { - width: 0; - height: 0; - cursor: nwse-resize; - border-right: 20px solid transparent; - border-bottom: 20px solid transparent; - border-top: 20px solid #fff; -} - -.c25 { - position: absolute; - bottom: 3px; - right: 3px; - width: 20px; - height: 20px; - background: repeating-linear-gradient( -45deg, transparent, transparent 2px, #000 2px, #000 3px ); -} - -.c2 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - height: inherit; - padding: 0; - background: #fff; - box-shadow: 5px 5px 10px #7F7F7F; - border-radius: 3px; - border: 1px solid #7F7F7F; -} - -.c5 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - font-weight: bold; - font-size: 12px; - font-family: Verdana,sans-serif; - color: #074320; - cursor: pointer; - border-radius: 2px; - padding: 0; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-flex-shrink: 0; - -ms-flex-negative: 0; - flex-shrink: 0; -} - -.c5 :hover { - border: 1px solid #074320; -} - -.c6 { - height: 24px; - width: 24px; - line-height: 24px; -} - -.c6 * { - height: inherit; - width: inherit; -} - -.c22 { - display: inline-block; - padding: 0 15px; - color: #4C4C4C; - text-align: center; - vertical-align: middle; - font-size: 11px; - font-weight: bold; - line-height: 30px; - -webkit-text-decoration: none; - text-decoration: none; - white-space: nowrap; - background-color: #fff; - border-radius: 2px; - border: 1px solid #bfbfbf; - cursor: pointer; - overflow: visible; - z-index: 1; -} - -.c22:focus, -.c22:hover { - border: 1px solid #4C4C4C; -} - -.c22:hover { - -webkit-text-decoration: none; - text-decoration: none; - background: #11ab51; - font-weight: bold; - color: #fff; -} - -.c22[disabled] { - cursor: not-allowed; - opacity: 0.65; - box-shadow: none; -} - -.c22 img { - height: 32px; - width: 32px; - margin-top: 5px 10px 5px -10px; - vertical-align: middle; -} - -.c22:link { - -webkit-text-decoration: none; - text-decoration: none; - color: #4C4C4C; -} - -.c23 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c24 { - border: 1px solid #7F7F7F; - color: #fff; - background: #11ab51; -} - -.c24 :hover { - color: #074320; - background: #A1DDBA; -} - -.c20 { - border-width: 1px 0 0 0; - border-style: solid; - border-color: #e5e5e5; - margin-top: 15px; - padding: 10px 20px 10px 20px; -} - -.c21 { - -webkit-box-pack: justify; - -webkit-justify-content: space-between; - justify-content: space-between; -} - -.c4 { - padding: 5px 5px 5px 10px; - margin-bottom: 15px; - border-radius: 2px 2px 0 0; - border-bottom: 1px solid #7F7F7F; - color: #fff; - font-weight: bold; - background: #11ab51; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: justify; - -webkit-justify-content: space-between; - justify-content: space-between; - -webkit-flex-shrink: 0; - -ms-flex-negative: 0; - flex-shrink: 0; - cursor: -webkit-grab; - cursor: grab; -} - -.c9 { - overflow: auto; - padding: 0 15px; - width: 100%; - height: 100%; - max-height: 400px; -} - -.c8 { - overflow: hidden; - height: 100%; -} - -.c11 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: start; - -ms-flex-pack: start; - -webkit-justify-content: start; - justify-content: start; - padding-bottom: 10px; -} - -.c12 { - display: inline-block; - max-width: 100%; - font-weight: bold; - text-align: right; - padding-left: 10px; - padding-right: 10px; - width: 16.66666667%; - margin-left: 0; -} - -.c14 { - width: 83.33333333%; - padding-left: 10px; - padding-right: 10px; -} - -.c17 { - color: #c12c30; - font-weight: bold; - font-size: 19px; - padding-bottom: 1px; - padding-left: 4px; - display: none; -} - -.c15 { - font-family: inherit; - font-size: inherit; - line-height: inherit; - display: block; - height: 22px; - color: #4C4C4C; - background-color: #fff; - background-image: none; - border: 1px solid #bfbfbf; - border-radius: 2px; - padding: 1px 8px; -} - -.c15:-webkit-autofill { - box-shadow: 0 0 0 1000px white inset; -} - -.c16 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-flex: 1; - -webkit-flex-grow: 1; - -ms-flex-positive: 1; - flex-grow: 1; - -webkit-box-pack: start; - -ms-flex-pack: start; - -webkit-justify-content: start; - justify-content: start; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c18 { - font-size: 14px; - margin-bottom: 0px; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; -} - - -
-
-
- -
-
-
- -`; diff --git a/src/web/pages/scanconfigs/__tests__/__snapshots__/listpage.jsx.snap b/src/web/pages/scanconfigs/__tests__/__snapshots__/listpage.jsx.snap deleted file mode 100644 index 5c389dcaf3..0000000000 --- a/src/web/pages/scanconfigs/__tests__/__snapshots__/listpage.jsx.snap +++ /dev/null @@ -1,2112 +0,0 @@ -// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html - -exports[`ScanConfigsPage ToolBarIcons test > should render 1`] = ` -.c0 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: start; - -ms-flex-pack: start; - -webkit-justify-content: start; - justify-content: start; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c2 { - margin-left: -5px; -} - -.c2>* { - display: -webkit-inline-box; - display: -webkit-inline-flex; - display: -ms-inline-flexbox; - display: inline-flex; -} - -.c2>* { - margin-left: 5px; -} - -.c1 { - display: -webkit-inline-box; - display: -webkit-inline-flex; - display: -ms-inline-flexbox; - display: inline-flex; -} - -.c4 { - cursor: pointer; -} - -.c3 { - height: 16px; - width: 16px; - line-height: 16px; -} - -.c3 * { - height: inherit; - width: inherit; -} - -@media print { - .c4 { - display: none; - } -} - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-`; - -exports[`ScanConfigsPage tests > should render full ScanConfigsPage 1`] = ` -.c0 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - -webkit-box-flex: 1; - -webkit-flex-grow: 1; - -ms-flex-positive: 1; - flex-grow: 1; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-align-items: stretch; - -webkit-box-align: stretch; - -ms-flex-align: stretch; - align-items: stretch; -} - -.c1 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: justify; - -webkit-justify-content: space-between; - justify-content: space-between; - -webkit-align-items: flex-start; - -webkit-box-align: flex-start; - -ms-flex-align: flex-start; - align-items: flex-start; -} - -.c2 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: start; - -ms-flex-pack: start; - -webkit-justify-content: start; - justify-content: start; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c7 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-flex: 1; - -webkit-flex-grow: 1; - -ms-flex-positive: 1; - flex-grow: 1; - -webkit-box-pack: end; - -ms-flex-pack: end; - -webkit-justify-content: flex-end; - justify-content: flex-end; -} - -.c8 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - -webkit-box-pack: start; - -ms-flex-pack: start; - -webkit-justify-content: flex-start; - justify-content: flex-start; - -webkit-align-items: stetch; - -webkit-box-align: stetch; - -ms-flex-align: stetch; - align-items: stetch; -} - -.c9 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: justify; - -webkit-justify-content: space-between; - justify-content: space-between; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c10 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: start; - -ms-flex-pack: start; - -webkit-justify-content: flex-start; - justify-content: flex-start; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c21 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c24 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: justify; - -webkit-justify-content: space-between; - justify-content: space-between; - -webkit-align-items: flex-end; - -webkit-box-align: flex-end; - -ms-flex-align: flex-end; - align-items: flex-end; -} - -.c28 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: start; - -ms-flex-pack: start; - -webkit-justify-content: flex-start; - justify-content: flex-start; - -webkit-align-items: flex-end; - -webkit-box-align: flex-end; - -ms-flex-align: flex-end; - align-items: flex-end; -} - -.c33 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-flex: 1; - -webkit-flex-grow: 1; - -ms-flex-positive: 1; - flex-grow: 1; - -webkit-box-pack: justify; - -webkit-justify-content: space-between; - justify-content: space-between; -} - -.c35 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: end; - -ms-flex-pack: end; - -webkit-justify-content: flex-end; - justify-content: flex-end; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c47 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; -} - -.c49 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-align-items: stretch; - -webkit-box-align: stretch; - -ms-flex-align: stretch; - align-items: stretch; -} - -.c50 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: justify; - -webkit-justify-content: space-between; - justify-content: space-between; -} - -.c52 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-flex: 1; - -webkit-flex-grow: 1; - -ms-flex-positive: 1; - flex-grow: 1; - -webkit-box-pack: start; - -ms-flex-pack: start; - -webkit-justify-content: start; - justify-content: start; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c53 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-flex: 1; - -webkit-flex-grow: 1; - -ms-flex-positive: 1; - flex-grow: 1; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c4 { - margin-left: -5px; -} - -.c4>* { - display: -webkit-inline-box; - display: -webkit-inline-flex; - display: -ms-inline-flexbox; - display: inline-flex; -} - -.c4>* { - margin-left: 5px; -} - -.c3 { - display: -webkit-inline-box; - display: -webkit-inline-flex; - display: -ms-inline-flexbox; - display: inline-flex; -} - -.c6 { - cursor: pointer; -} - -.c37 svg path { - fill: #bfbfbf; -} - -.c5 { - height: 16px; - width: 16px; - line-height: 16px; -} - -.c5 * { - height: inherit; - width: inherit; -} - -.c30 { - height: 50px; - width: 50px; - line-height: 50px; -} - -.c30 * { - height: inherit; - width: inherit; -} - -.c25 { - margin: 10px 0px; - padding-bottom: 1px; - border-bottom: 2px solid #e5e5e5; - position: relative; -} - -.c26 { - margin: 0 0 1px 0; -} - -.c27 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: start; - -ms-flex-pack: start; - -webkit-justify-content: flex-start; - justify-content: flex-start; - -webkit-align-items: stretch; - -webkit-box-align: stretch; - -ms-flex-align: stretch; - align-items: stretch; -} - -.c29 { - margin-right: 5px; -} - -.c31 { - word-break: break-all; - min-width: 100px; -} - -.c22 { - background-color: transparent; - border: none; - cursor: pointer; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - outline: none; - margin: 1px; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - cursor: pointer; -} - -.c23 { - height: 16px; - width: 16px; - line-height: 16px; -} - -.c23 * { - height: inherit; - width: inherit; -} - -.c18 { - border: 1px solid #bfbfbf; - border-radius: 2px; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-align-items: stretch; - -webkit-box-align: stretch; - -ms-flex-align: stretch; - align-items: stretch; - -webkit-box-flex: 1; - -webkit-flex-grow: 1; - -ms-flex-positive: 1; - flex-grow: 1; - padding: 1px 5px; - background-color: #fff; - color: #000; - font-weight: normal; -} - -.c17 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - position: relative; - width: 150px; -} - -.c54 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - position: relative; - width: 180px; -} - -.c19 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-flex: 1; - -webkit-flex-grow: 1; - -ms-flex-positive: 1; - flex-grow: 1; - word-break: keep-all; - white-space: nowrap; - overflow: hidden; - cursor: pointer; -} - -.c15 { - color: #c12c30; - font-weight: bold; - font-size: 19px; - padding-bottom: 1px; - padding-left: 4px; - display: none; -} - -.c20 { - cursor: default; -} - -.c16 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; -} - -.c39 { - border: 0; - border-spacing: 0px; - font-size: 12px; - text-align: left; - table-layout: auto; - width: 100%; -} - -.c40 th, -.c40 td { - padding: 4px 10px; - border-bottom: 1px solid #e5e5e5; -} - -.c40 tfoot tr { - background: #fff; -} - -.c40 tfoot tr td { - border-bottom: 1px solid #e5e5e5; -} - -.c42 a { - -webkit-text-decoration: none; - text-decoration: none; - color: #000; -} - -.c42 a:hover { - -webkit-text-decoration: underline; - text-decoration: underline; - color: #000; -} - -.c44 { - cursor: pointer; -} - -.c43 { - background-color: #fff; - color: #000; - border-top: 1px solid #e5e5e5; - font-weight: bold; - width: 72%; -} - -.c45 { - background-color: #fff; - color: #000; - border-top: 1px solid #e5e5e5; - font-weight: bold; - width: 10%; -} - -.c46 { - background-color: #fff; - color: #000; - border-top: 1px solid #e5e5e5; - font-weight: bold; - width: 8%; -} - -.c48 { - background-color: #fff; - color: #000; - border-top: 1px solid #e5e5e5; - font-weight: bold; - width: 5%; -} - -.c13 { - font-family: inherit; - font-size: inherit; - line-height: inherit; - display: block; - height: 22px; - color: #4C4C4C; - background-color: #fff; - background-image: none; - border: 1px solid #bfbfbf; - border-radius: 2px; - padding: 1px 8px; -} - -.c13:-webkit-autofill { - box-shadow: 0 0 0 1000px white inset; -} - -.c14 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: start; - -ms-flex-pack: start; - -webkit-justify-content: start; - justify-content: start; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c12 { - margin-right: 5px; -} - -.c11 { - margin-right: 5px; -} - -.c55 { - font-size: 10px; - color: #7F7F7F; - text-align: left; -} - -.c38 { - margin: 0 3px; -} - -.c36 { - margin: 2px 3px; -} - -.c41 { - opacity: 1.0; -} - -.c34 { - margin-top: 2px; - margin-left: 2px; -} - -.c32 { - margin-top: 20px; -} - -.c51 { - cursor: pointer; - -webkit-text-decoration: none; - text-decoration: none; - color: #0a53b8; -} - -.c51 :hover { - -webkit-text-decoration: underline; - text-decoration: underline; - color: #0a53b8; -} - -@media print { - .c6 { - display: none; - } -} - -@media print { - .c39 { - border-collapse: collapse; - } -} - -@media screen { - .c40>tbody:nth-of-type(even), - .c40>tbody:only-of-type>tr:nth-of-type(even) { - background: #f3f3f3; - } - - .c40>tbody:not(:only-of-type):hover, - .c40>tbody:only-of-type>tr:hover { - background: #e5e5e5; - } -} - -@media print { - .c42 { - border-bottom: 1px solid black; - } - - .c42 a, - .c42 a:hover { - -webkit-text-decoration: none; - text-decoration: none; - color: #000; - } -} - -@media print { - .c43 { - color: #000; - font-size: 1.2em; - background-color: transparent; - font-weight: bold; - } -} - -@media print { - .c45 { - color: #000; - font-size: 1.2em; - background-color: transparent; - font-weight: bold; - } -} - -@media print { - .c46 { - color: #000; - font-size: 1.2em; - background-color: transparent; - font-weight: bold; - } -} - -@media print { - .c48 { - color: #000; - font-size: 1.2em; - background-color: transparent; - font-weight: bold; - } -} - -@media print { - .c36 svg { - display: none; - } -} - -@media print { - .c51 { - color: #000; - } -} - - -
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
-
-
-
-
- - -
- × -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- -
-
-
-
-
-
-

-
- - - - - - - - - -
-
- Scan Configs 0 of 0 -
-

-
-
-
-
-
- - - - - - - - - -
-
-
- - - - - - - - - - - - - - - - - - -
-
- - 0 - 0 of 0 - -
-
- - - - - - - - - - - - - - - - - - -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- Name -
-
-
-
- Family -
-
-
- NVTs -
-
-
- Actions -
-
- -
- Total -
-
-
- -
- Trend -
-
-
- -
- Total -
-
-
- -
- Trend -
-
-
-
-
-
- - - foo - - -
-
-
- ( - bar - ) -
-
-
-
- 2 -
-
-
- - - - - - - - - - - -
-
-
- 4 -
-
-
- - - - - - - - - - - -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
-
-
-
- -
-
- - - - - - - - - - - - - - - - - - - - - -
-
-
-
-
-
-
-
- (Applied filter: ) -
-
-
-
- - - - - - - - - - - - - - - - - - -
-
- - 0 - 0 of 0 - -
-
- - - - - - - - - - - - - - - - - - -
-
-
-
-
-
-
-
- -
- -`; diff --git a/src/web/pages/scanconfigs/__tests__/__snapshots__/row.jsx.snap b/src/web/pages/scanconfigs/__tests__/__snapshots__/row.jsx.snap deleted file mode 100644 index df44a48430..0000000000 --- a/src/web/pages/scanconfigs/__tests__/__snapshots__/row.jsx.snap +++ /dev/null @@ -1,405 +0,0 @@ -// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html - -exports[`Scan Config row tests > should render 1`] = ` -.c0 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-align-items: stretch; - -webkit-box-align: stretch; - -ms-flex-align: stretch; - align-items: stretch; -} - -.c1 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: justify; - -webkit-justify-content: space-between; - justify-content: space-between; -} - -.c4 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - -webkit-box-flex: 1; - -webkit-flex-grow: 1; - -ms-flex-positive: 1; - flex-grow: 1; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-align-items: stretch; - -webkit-box-align: stretch; - -ms-flex-align: stretch; - align-items: stretch; -} - -.c5 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-flex: 1; - -webkit-flex-grow: 1; - -ms-flex-positive: 1; - flex-grow: 1; - -webkit-box-pack: start; - -ms-flex-pack: start; - -webkit-justify-content: start; - justify-content: start; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c7 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-flex: 1; - -webkit-flex-grow: 1; - -ms-flex-positive: 1; - flex-grow: 1; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c8 { - margin-left: -5px; -} - -.c8>* { - display: -webkit-inline-box; - display: -webkit-inline-flex; - display: -ms-inline-flexbox; - display: inline-flex; -} - -.c8>* { - margin-left: 5px; -} - -.c6 { - display: -webkit-inline-box; - display: -webkit-inline-flex; - display: -ms-inline-flexbox; - display: inline-flex; -} - -.c9 { - cursor: pointer; -} - -.c3 { - height: 16px; - width: 16px; - line-height: 16px; -} - -.c3 * { - height: inherit; - width: inherit; -} - -.c2 { - cursor: pointer; - -webkit-text-decoration: none; - text-decoration: none; - color: #0a53b8; -} - -.c2 :hover { - -webkit-text-decoration: underline; - text-decoration: underline; - color: #0a53b8; -} - -@media print { - .c9 { - display: none; - } -} - -@media print { - .c2 { - color: #000; - } -} - - -
-
- - -
-
-
- - - foo - - -
-
-
- ( - bar - ) -
-
- - -
- 2 -
- - -
- - - - - - - - - - - -
- - -
- 4 -
- - -
- - - - - - - - - - - -
- - -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
- - -
- -`; diff --git a/src/web/pages/scanconfigs/__tests__/__snapshots__/table.jsx.snap b/src/web/pages/scanconfigs/__tests__/__snapshots__/table.jsx.snap deleted file mode 100644 index d231968767..0000000000 --- a/src/web/pages/scanconfigs/__tests__/__snapshots__/table.jsx.snap +++ /dev/null @@ -1,1772 +0,0 @@ -// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html - -exports[`Scan Config table tests > should render 1`] = ` -.c0 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - -webkit-box-flex: 1; - -webkit-flex-grow: 1; - -ms-flex-positive: 1; - flex-grow: 1; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-align-items: stretch; - -webkit-box-align: stretch; - -ms-flex-align: stretch; - align-items: stretch; -} - -.c2 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-flex: 1; - -webkit-flex-grow: 1; - -ms-flex-positive: 1; - flex-grow: 1; - -webkit-box-pack: justify; - -webkit-justify-content: space-between; - justify-content: space-between; -} - -.c6 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: end; - -ms-flex-pack: end; - -webkit-justify-content: flex-end; - justify-content: flex-end; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c8 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: start; - -ms-flex-pack: start; - -webkit-justify-content: start; - justify-content: start; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c20 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; -} - -.c22 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-align-items: stretch; - -webkit-box-align: stretch; - -ms-flex-align: stretch; - align-items: stretch; -} - -.c23 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: justify; - -webkit-justify-content: space-between; - justify-content: space-between; -} - -.c25 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-flex: 1; - -webkit-flex-grow: 1; - -ms-flex-positive: 1; - flex-grow: 1; - -webkit-box-pack: start; - -ms-flex-pack: start; - -webkit-justify-content: start; - justify-content: start; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c26 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-flex: 1; - -webkit-flex-grow: 1; - -ms-flex-positive: 1; - flex-grow: 1; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c32 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c10 { - margin-left: -5px; -} - -.c10>* { - display: -webkit-inline-box; - display: -webkit-inline-flex; - display: -ms-inline-flexbox; - display: inline-flex; -} - -.c10>* { - margin-left: 5px; -} - -.c9 { - display: -webkit-inline-box; - display: -webkit-inline-flex; - display: -ms-inline-flexbox; - display: inline-flex; -} - -.c3 { - cursor: pointer; -} - -.c11 svg path { - fill: #bfbfbf; -} - -.c4 { - height: 16px; - width: 16px; - line-height: 16px; -} - -.c4 * { - height: inherit; - width: inherit; -} - -.c33 { - background-color: transparent; - border: none; - cursor: pointer; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - outline: none; - margin: 1px; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - cursor: pointer; -} - -.c34 { - height: 16px; - width: 16px; - line-height: 16px; -} - -.c34 * { - height: inherit; - width: inherit; -} - -.c29 { - border: 1px solid #bfbfbf; - border-radius: 2px; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-align-items: stretch; - -webkit-box-align: stretch; - -ms-flex-align: stretch; - align-items: stretch; - -webkit-box-flex: 1; - -webkit-flex-grow: 1; - -ms-flex-positive: 1; - flex-grow: 1; - padding: 1px 5px; - background-color: #fff; - color: #000; - font-weight: normal; -} - -.c28 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - position: relative; - width: 180px; -} - -.c30 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-flex: 1; - -webkit-flex-grow: 1; - -ms-flex-positive: 1; - flex-grow: 1; - word-break: keep-all; - white-space: nowrap; - overflow: hidden; - cursor: pointer; -} - -.c35 { - color: #c12c30; - font-weight: bold; - font-size: 19px; - padding-bottom: 1px; - padding-left: 4px; - display: none; -} - -.c31 { - cursor: default; -} - -.c27 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; -} - -.c13 { - border: 0; - border-spacing: 0px; - font-size: 12px; - text-align: left; - table-layout: auto; - width: 100%; -} - -.c14 th, -.c14 td { - padding: 4px 10px; - border-bottom: 1px solid #e5e5e5; -} - -.c14 tfoot tr { - background: #fff; -} - -.c14 tfoot tr td { - border-bottom: 1px solid #e5e5e5; -} - -.c16 a { - -webkit-text-decoration: none; - text-decoration: none; - color: #000; -} - -.c16 a:hover { - -webkit-text-decoration: underline; - text-decoration: underline; - color: #000; -} - -.c17 { - background-color: #fff; - color: #000; - border-top: 1px solid #e5e5e5; - font-weight: bold; - width: 72%; -} - -.c18 { - background-color: #fff; - color: #000; - border-top: 1px solid #e5e5e5; - font-weight: bold; - width: 10%; -} - -.c19 { - background-color: #fff; - color: #000; - border-top: 1px solid #e5e5e5; - font-weight: bold; - width: 8%; -} - -.c21 { - background-color: #fff; - color: #000; - border-top: 1px solid #e5e5e5; - font-weight: bold; - width: 5%; -} - -.c36 { - font-size: 10px; - color: #7F7F7F; - text-align: left; -} - -.c12 { - margin: 0 3px; -} - -.c7 { - margin: 2px 3px; -} - -.c15 { - opacity: 1.0; -} - -.c5 { - margin-top: 2px; - margin-left: 2px; -} - -.c1 { - margin-top: 20px; -} - -.c24 { - cursor: pointer; - -webkit-text-decoration: none; - text-decoration: none; - color: #0a53b8; -} - -.c24 :hover { - -webkit-text-decoration: underline; - text-decoration: underline; - color: #0a53b8; -} - -@media print { - .c3 { - display: none; - } -} - -@media print { - .c13 { - border-collapse: collapse; - } -} - -@media screen { - .c14>tbody:nth-of-type(even), - .c14>tbody:only-of-type>tr:nth-of-type(even) { - background: #f3f3f3; - } - - .c14>tbody:not(:only-of-type):hover, - .c14>tbody:only-of-type>tr:hover { - background: #e5e5e5; - } -} - -@media print { - .c16 { - border-bottom: 1px solid black; - } - - .c16 a, - .c16 a:hover { - -webkit-text-decoration: none; - text-decoration: none; - color: #000; - } -} - -@media print { - .c17 { - color: #000; - font-size: 1.2em; - background-color: transparent; - font-weight: bold; - } -} - -@media print { - .c18 { - color: #000; - font-size: 1.2em; - background-color: transparent; - font-weight: bold; - } -} - -@media print { - .c19 { - color: #000; - font-size: 1.2em; - background-color: transparent; - font-weight: bold; - } -} - -@media print { - .c21 { - color: #000; - font-size: 1.2em; - background-color: transparent; - font-weight: bold; - } -} - -@media print { - .c7 svg { - display: none; - } -} - -@media print { - .c24 { - color: #000; - } -} - - -
-
-
-
- - - - - - - - - -
-
-
- - - - - - - - - - - - - - - - - - -
-
- - 1 - 1 of 1 - -
-
- - - - - - - - - - - - - - - - - - -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- Name -
-
-
- Family -
-
-
- NVTs -
-
-
- Actions -
-
-
- Total -
-
-
- Trend -
-
-
- Total -
-
-
- Trend -
-
-
-
-
- - - foo - - -
-
-
- ( - bar - ) -
-
-
-
- 2 -
-
-
- - - - - - - - - - - -
-
-
- 4 -
-
-
- - - - - - - - - - - -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
-
-
-
- - - lorem - - -
-
-
- ( - ipsum - ) -
-
-
-
- 3 -
-
-
- - - - - - - - - - - -
-
-
- 5 -
-
-
- - - - - - - - - - - -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
-
-
-
- - - hello - - -
-
-
- ( - world - ) -
-
-
-
- 1 -
-
-
- - - - - - - - - - - -
-
-
- 1 -
-
-
- - - - - - - - - - - -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
-
-
-
- -
-
-
-
-
- (Applied filter: rows=2) -
-
-
-
- - - - - - - - - - - - - - - - - - -
-
- - 1 - 1 of 1 - -
-
- - - - - - - - - - - - - - - - - - -
-
-
-
-
-
- -`; diff --git a/src/web/pages/scanconfigs/__tests__/__snapshots__/trend.jsx.snap b/src/web/pages/scanconfigs/__tests__/__snapshots__/trend.jsx.snap deleted file mode 100644 index 49a37ee85a..0000000000 --- a/src/web/pages/scanconfigs/__tests__/__snapshots__/trend.jsx.snap +++ /dev/null @@ -1,47 +0,0 @@ -// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html - -exports[`Scan Config Trend tests > should render 1`] = ` -.c0 { - height: 16px; - width: 16px; - line-height: 16px; -} - -.c0 * { - height: inherit; - width: inherit; -} - - - - - - - - - - - - -`; diff --git a/src/web/pages/scanconfigs/__tests__/details.jsx b/src/web/pages/scanconfigs/__tests__/details.jsx index 7ad7a421aa..9cee73f4de 100644 --- a/src/web/pages/scanconfigs/__tests__/details.jsx +++ b/src/web/pages/scanconfigs/__tests__/details.jsx @@ -46,16 +46,15 @@ describe('Scan Config Details tests', () => { const {element, getAllByTestId} = render(
); - expect(element).toMatchSnapshot(); expect(element).toHaveTextContent('bar'); - const detailslinks = getAllByTestId('details-link'); + const detailsLinks = getAllByTestId('details-link'); expect(element).toHaveTextContent('task1'); - expect(detailslinks[0]).toHaveAttribute('href', '/task/1234'); + expect(detailsLinks[0]).toHaveAttribute('href', '/task/1234'); expect(element).toHaveTextContent('task2'); - expect(detailslinks[1]).toHaveAttribute('href', '/task/5678'); + expect(detailsLinks[1]).toHaveAttribute('href', '/task/5678'); expect(element).not.toHaveTextContent('scanner'); }); diff --git a/src/web/pages/scanconfigs/__tests__/detailspage.jsx b/src/web/pages/scanconfigs/__tests__/detailspage.jsx index e7a614ea63..48ebd3482b 100644 --- a/src/web/pages/scanconfigs/__tests__/detailspage.jsx +++ b/src/web/pages/scanconfigs/__tests__/detailspage.jsx @@ -257,12 +257,11 @@ describe('Scan Config Detailspage tests', () => { , ); - expect(element).toMatchSnapshot(); expect(element).toHaveTextContent('Scan Config: foo'); const links = baseElement.querySelectorAll('a'); const icons = getAllByTestId('svg-icon'); - const detailslinks = getAllByTestId('details-link'); + const detailsLinks = getAllByTestId('details-link'); expect(icons[0]).toHaveAttribute('title', 'Help: ScanConfigs'); expect(links[0]).toHaveAttribute( @@ -281,10 +280,10 @@ describe('Scan Config Detailspage tests', () => { expect(element).toHaveTextContent('bar'); expect(element).toHaveTextContent('task1'); - expect(detailslinks[0]).toHaveAttribute('href', '/task/1234'); + expect(detailsLinks[0]).toHaveAttribute('href', '/task/1234'); expect(element).toHaveTextContent('task2'); - expect(detailslinks[1]).toHaveAttribute('href', '/task/5678'); + expect(detailsLinks[1]).toHaveAttribute('href', '/task/5678'); expect(element).not.toHaveTextContent('scanner'); }); @@ -954,8 +953,6 @@ describe('Scan Config ToolBarIcons tests', () => { />, ); - expect(element).toMatchSnapshot(); - const links = element.querySelectorAll('a'); const icons = getAllByTestId('svg-icon'); diff --git a/src/web/pages/scanconfigs/__tests__/dialog.jsx b/src/web/pages/scanconfigs/__tests__/dialog.jsx index 07a395753c..b3ac545d32 100644 --- a/src/web/pages/scanconfigs/__tests__/dialog.jsx +++ b/src/web/pages/scanconfigs/__tests__/dialog.jsx @@ -19,6 +19,15 @@ import {describe, test, expect, testing} from '@gsa/testing'; import {render, fireEvent} from 'web/utils/testing'; +import { + changeInputValue, + closeDialog, + getDialog, + getDialogCloseButton, + getDialogSaveButton, + getRadioInputs, +} from 'web/components/testing'; + import CreateScanConfigDialog from '../dialog'; describe('CreateScanConfigDialog component tests', () => { @@ -26,7 +35,7 @@ describe('CreateScanConfigDialog component tests', () => { const handleClose = testing.fn(); const handleSave = testing.fn(); - const {getAllByTestId} = render( + render( { />, ); - const formgroups = getAllByTestId('formgroup-title'); - const radioInputs = getAllByTestId('radio-input'); - const radioTitles = getAllByTestId('radio-title'); - - expect(formgroups[0]).toHaveTextContent('Name'); - - expect(formgroups[1]).toHaveTextContent('Comment'); - - expect(formgroups[2]).toHaveTextContent('Base'); + const dialog = getDialog(); + const radioInputs = getRadioInputs(dialog); + const radioTitles = dialog.querySelectorAll('.mantine-Radio-label'); expect(radioInputs[0]).toHaveAttribute( 'value', 'd21f6c81-2b88-4ac1-b7b4-a2a9f2ad4663', ); - expect(radioInputs[0].checked).toEqual(true); + expect(radioInputs[0]).toBeChecked(); expect(radioTitles[0]).toHaveTextContent('Base with a minimum set of NVTs'); expect(radioInputs[1]).toHaveAttribute( 'value', '085569ce-73ed-11df-83c3-002264764cea', ); - expect(radioInputs[1].checked).toEqual(false); + expect(radioInputs[1]).not.toBeChecked(); expect(radioTitles[1]).toHaveTextContent('Empty, static and fast'); expect(radioInputs[2]).toHaveAttribute( @@ -70,7 +73,7 @@ describe('CreateScanConfigDialog component tests', () => { const handleClose = testing.fn(); const handleSave = testing.fn(); - const {getByTestId} = render( + render( { />, ); - const closeButton = getByTestId('dialog-title-close-button'); - - fireEvent.click(closeButton); - + closeDialog(); expect(handleClose).toHaveBeenCalled(); }); @@ -89,7 +89,7 @@ describe('CreateScanConfigDialog component tests', () => { const handleClose = testing.fn(); const handleSave = testing.fn(); - const {getByTestId} = render( + render( { />, ); - const cancelButton = getByTestId('dialog-close-button'); - + const cancelButton = getDialogCloseButton(); fireEvent.click(cancelButton); - expect(handleClose).toHaveBeenCalled(); }); @@ -108,7 +106,7 @@ describe('CreateScanConfigDialog component tests', () => { const handleClose = testing.fn(); const handleSave = testing.fn(); - const {getByName, getByTestId} = render( + const {getByName} = render( { ); const nameInput = getByName('name'); - fireEvent.change(nameInput, {target: {value: 'foo'}}); + changeInputValue(nameInput, 'foo'); const commentInput = getByName('comment'); - fireEvent.change(commentInput, {target: {value: 'bar'}}); + changeInputValue(commentInput, 'bar'); - const saveButton = getByTestId('dialog-save-button'); + const saveButton = getDialogSaveButton(); fireEvent.click(saveButton); expect(handleSave).toHaveBeenCalledWith({ @@ -137,7 +135,7 @@ describe('CreateScanConfigDialog component tests', () => { const handleClose = testing.fn(); const handleSave = testing.fn(); - const {getByName, getByTestId, getAllByTestId} = render( + const {getByName} = render( { />, ); + const dialog = getDialog(); + const nameInput = getByName('name'); - fireEvent.change(nameInput, {target: {value: 'foo'}}); + changeInputValue(nameInput, 'foo'); const commentInput = getByName('comment'); - fireEvent.change(commentInput, {target: {value: 'bar'}}); + changeInputValue(commentInput, 'bar'); - const radioInputs = getAllByTestId('radio-input'); + const radioInputs = getRadioInputs(dialog); fireEvent.click(radioInputs[1]); - const saveButton = getByTestId('dialog-save-button'); + const saveButton = getDialogSaveButton(); fireEvent.click(saveButton); expect(handleSave).toHaveBeenCalledWith({ diff --git a/src/web/pages/scanconfigs/__tests__/editconfigfamilydialog.jsx b/src/web/pages/scanconfigs/__tests__/editconfigfamilydialog.jsx index 35271d0220..b40e983851 100644 --- a/src/web/pages/scanconfigs/__tests__/editconfigfamilydialog.jsx +++ b/src/web/pages/scanconfigs/__tests__/editconfigfamilydialog.jsx @@ -21,6 +21,14 @@ import Nvt from 'gmp/models/nvt'; import {rendererWith, fireEvent} from 'web/utils/testing'; +import { + clickElement, + getDialog, + getDialogSaveButton, + getTableBody, + getTableHeader, +} from 'web/components/testing'; + import EditConfigFamilyDialog from '../editconfigfamilydialog'; const nvt = Nvt.fromElement({ @@ -76,8 +84,6 @@ describe('EditConfigFamilyDialog component tests', () => { />, ); - expect(baseElement).toMatchSnapshot(); - expect(baseElement).toHaveTextContent('Config'); expect(baseElement).toHaveTextContent('foo'); }); @@ -104,8 +110,6 @@ describe('EditConfigFamilyDialog component tests', () => { />, ); - expect(baseElement).toMatchSnapshot(); - expect(getByTestId('loading')).toBeInTheDocument(); expect(baseElement).not.toHaveTextContent('Config'); @@ -118,7 +122,7 @@ describe('EditConfigFamilyDialog component tests', () => { const handleOpenEditNvtDetailsDialog = testing.fn(); const {render} = rendererWith({capabilities: true}); - const {getByTestId} = render( + render( { />, ); - const saveButton = getByTestId('dialog-save-button'); + const saveButton = getDialogSaveButton(); fireEvent.click(saveButton); expect(handleSave).toHaveBeenCalledWith({ @@ -242,7 +246,7 @@ describe('EditConfigFamilyDialog component tests', () => { expect(handleOpenEditNvtDetailsDialog).toHaveBeenCalledWith(nvt.id); }); - test('should sort table', () => { + test('should sort table', async () => { const handleClose = testing.fn(); const handleSave = testing.fn(); const handleOpenEditNvtDetailsDialog = testing.fn(); @@ -254,7 +258,7 @@ describe('EditConfigFamilyDialog component tests', () => { }; const {render} = rendererWith({capabilities: true}); - const {baseElement} = render( + render( { onSave={handleSave} />, ); + const getOidColumn = row => row.querySelectorAll('td')[1]; - let inputs = baseElement.querySelectorAll('input'); + const dialog = getDialog(); + const tableHeader = getTableHeader(dialog); + const tableBody = getTableBody(dialog); + let rows = tableBody.querySelectorAll('tr'); + const columns = tableHeader.querySelectorAll('a'); - expect(inputs[0]).toHaveAttribute('name', '1234'); - expect(inputs[1]).toHaveAttribute('name', '5678'); - expect(inputs[2]).toHaveAttribute('name', '2345'); + expect(getOidColumn(rows[0])).toHaveTextContent('1234'); + expect(getOidColumn(rows[1])).toHaveTextContent('5678'); + expect(getOidColumn(rows[2])).toHaveTextContent('2345'); - const columns = baseElement.querySelectorAll('a'); - fireEvent.click(columns[0]); + // sort by name column desc + expect(columns[0]).toHaveTextContent('Name'); + await clickElement(columns[0]); - inputs = baseElement.querySelectorAll('input'); + rows = tableBody.querySelectorAll('tr'); - expect(inputs[0]).toHaveAttribute('name', '2345'); - expect(inputs[1]).toHaveAttribute('name', '5678'); - expect(inputs[2]).toHaveAttribute('name', '1234'); + expect(getOidColumn(rows[0])).toHaveTextContent('2345'); + expect(getOidColumn(rows[1])).toHaveTextContent('5678'); + expect(getOidColumn(rows[2])).toHaveTextContent('1234'); - fireEvent.click(columns[1]); + // sort by oid column + expect(columns[1]).toHaveTextContent('OID'); + await clickElement(columns[1]); - inputs = baseElement.querySelectorAll('input'); + rows = tableBody.querySelectorAll('tr'); - expect(inputs[0]).toHaveAttribute('name', '1234'); - expect(inputs[1]).toHaveAttribute('name', '2345'); - expect(inputs[2]).toHaveAttribute('name', '5678'); + expect(getOidColumn(rows[0])).toHaveTextContent('1234'); + expect(getOidColumn(rows[1])).toHaveTextContent('2345'); + expect(getOidColumn(rows[2])).toHaveTextContent('5678'); - fireEvent.click(columns[2]); + // sort by severity column + expect(columns[2]).toHaveTextContent('Severity'); + await clickElement(columns[2]); - inputs = baseElement.querySelectorAll('input'); + rows = tableBody.querySelectorAll('tr'); - expect(inputs[0]).toHaveAttribute('name', '2345'); - expect(inputs[1]).toHaveAttribute('name', '1234'); - expect(inputs[2]).toHaveAttribute('name', '5678'); + expect(getOidColumn(rows[0])).toHaveTextContent('2345'); + expect(getOidColumn(rows[1])).toHaveTextContent('1234'); + expect(getOidColumn(rows[2])).toHaveTextContent('5678'); - fireEvent.click(columns[3]); + // sort by timeout column + expect(columns[3]).toHaveTextContent('Timeout'); + await clickElement(columns[3]); - inputs = baseElement.querySelectorAll('input'); + rows = tableBody.querySelectorAll('tr'); - expect(inputs[0]).toHaveAttribute('name', '1234'); - expect(inputs[1]).toHaveAttribute('name', '5678'); - expect(inputs[2]).toHaveAttribute('name', '2345'); + expect(getOidColumn(rows[0])).toHaveTextContent('1234'); + expect(getOidColumn(rows[1])).toHaveTextContent('5678'); + expect(getOidColumn(rows[2])).toHaveTextContent('2345'); + // sort by selected column + expect(columns[4]).toHaveTextContent('Selected'); fireEvent.click(columns[4]); - inputs = baseElement.querySelectorAll('input'); + rows = tableBody.querySelectorAll('tr'); - expect(inputs[0]).toHaveAttribute('name', '5678'); - expect(inputs[1]).toHaveAttribute('name', '1234'); - expect(inputs[2]).toHaveAttribute('name', '2345'); + expect(getOidColumn(rows[0])).toHaveTextContent('5678'); + expect(getOidColumn(rows[1])).toHaveTextContent('1234'); + expect(getOidColumn(rows[2])).toHaveTextContent('2345'); }); }); diff --git a/src/web/pages/scanconfigs/__tests__/editdialog.jsx b/src/web/pages/scanconfigs/__tests__/editdialog.jsx index 8f4d98da5c..235324adaf 100644 --- a/src/web/pages/scanconfigs/__tests__/editdialog.jsx +++ b/src/web/pages/scanconfigs/__tests__/editdialog.jsx @@ -24,6 +24,18 @@ import { import {rendererWith, fireEvent, getAllByTestId} from 'web/utils/testing'; +import { + changeInputValue, + clickElement, + getCheckBoxes, + getDialogContent, + getDialogSaveButton, + getDialogTitle, + getRadioInputs, + getTableBody, + getTextInputs, +} from 'web/components/testing'; + import EditScanConfigDialog from '../editdialog'; const families = [ @@ -137,7 +149,7 @@ describe('EditScanConfigDialog component tests', () => { const {render} = rendererWith({capabilities: true}); - const {baseElement, getByTestId} = render( + render( { />, ); - expect(baseElement).toMatchSnapshot(); - - const titleBar = getByTestId('dialog-title-bar'); - expect(titleBar).toHaveTextContent('Edit Scan Config'); + expect(getDialogTitle()).toHaveTextContent('Edit Scan Config'); - const content = getByTestId('save-dialog-content'); + const content = getDialogContent(); expect(content).toHaveTextContent( 'Edit Network Vulnerability Test Families', ); @@ -184,7 +193,7 @@ describe('EditScanConfigDialog component tests', () => { const handleOpenEditNvtDetailsDialog = testing.fn(); const {render} = rendererWith({capabilities: true}); - const {baseElement, getByTestId} = render( + const {getByTestId} = render( { />, ); - expect(baseElement).toMatchSnapshot(); - - const titleBar = getByTestId('dialog-title-bar'); - expect(titleBar).toHaveTextContent('Edit Scan Config'); + expect(getDialogTitle()).toHaveTextContent('Edit Scan Config'); - const content = getByTestId('save-dialog-content'); + const content = getDialogContent(); expect(content).not.toHaveTextContent( 'Edit Network Vulnerability Test Families', ); @@ -238,7 +244,7 @@ describe('EditScanConfigDialog component tests', () => { const handleOpenEditNvtDetailsDialog = testing.fn(); const {render} = rendererWith({capabilities: true}); - const {baseElement, getByTestId} = render( + const {getByTestId} = render( { />, ); - expect(baseElement).toMatchSnapshot(); + expect(getDialogTitle()).toHaveTextContent('Edit Policy'); - const titleBar = getByTestId('dialog-title-bar'); - expect(titleBar).toHaveTextContent('Edit Policy'); - - const content = getByTestId('save-dialog-content'); + const content = getDialogContent(); expect(content).not.toHaveTextContent( 'Edit Network Vulnerability Test Families', ); @@ -290,7 +293,7 @@ describe('EditScanConfigDialog component tests', () => { const handleOpenEditNvtDetailsDialog = testing.fn(); const {render} = rendererWith({capabilities: true, router: true}); - const {getByTestId} = render( + render( { />, ); - const saveButton = getByTestId('dialog-save-button'); + const saveButton = getDialogSaveButton(); fireEvent.click(saveButton); expect(handleSave).toHaveBeenCalledWith({ @@ -376,7 +379,7 @@ describe('EditScanConfigDialog component tests', () => { const handleOpenEditNvtDetailsDialog = testing.fn(); const {render} = rendererWith({capabilities: true, router: true}); - const {getByTestId} = render( + render( { />, ); - const content = getByTestId('save-dialog-content'); - const inputs = content.querySelectorAll('input'); + const content = getDialogContent(); + const inputs = getTextInputs(content); - fireEvent.change(inputs[0], {target: {value: 'lorem'}}); - fireEvent.change(inputs[1], {target: {value: 'ipsum'}}); + changeInputValue(inputs[0], 'lorem'); + changeInputValue(inputs[1], 'ipsum'); - const saveButton = getByTestId('dialog-save-button'); + const saveButton = getDialogSaveButton(); fireEvent.click(saveButton); expect(handleSave).toHaveBeenCalledWith({ @@ -422,14 +425,14 @@ describe('EditScanConfigDialog component tests', () => { }); }); - test('should allow to edit nvt families for openvas configs', () => { + test('should allow to edit nvt families for openvas configs', async () => { const handleClose = testing.fn(); const handleSave = testing.fn(); const handleOpenEditConfigFamilyDialog = testing.fn(); const handleOpenEditNvtDetailsDialog = testing.fn(); const {render} = rendererWith({capabilities: true, router: true}); - const {getByTestId, queryAllByName} = render( + render( { />, ); - const family1Inputs = queryAllByName('family1'); - expect(family1Inputs.length).toEqual(3); - fireEvent.click(family1Inputs[1]); + const dialogContent = getDialogContent(); + const tableBody = getTableBody(dialogContent); - const family2Inputs = queryAllByName('family2'); - expect(family2Inputs.length).toEqual(3); - fireEvent.click(family2Inputs[2]); + const rows = tableBody.querySelectorAll('tr'); - const saveButton = getByTestId('dialog-save-button'); + const family1Inputs = getRadioInputs(rows[0]); + await clickElement(family1Inputs[1]); + + const family2Checkboxes = getCheckBoxes(rows[1]); + await clickElement(family2Checkboxes[0]); + + const saveButton = getDialogSaveButton(); fireEvent.click(saveButton); const newSelect = { @@ -498,7 +504,7 @@ describe('EditScanConfigDialog component tests', () => { const handleOpenEditNvtDetailsDialog = testing.fn(); const {render} = rendererWith({capabilities: true, router: true}); - const {getByTestId} = render( + render( { />, ); - const content = getByTestId('save-dialog-content'); + const content = getDialogContent(); const sections = content.querySelectorAll('section'); const editFamilyIcons = getAllByTestId(sections[0], 'svg-icon'); diff --git a/src/web/pages/scanconfigs/__tests__/editnvtdetailsdialog.jsx b/src/web/pages/scanconfigs/__tests__/editnvtdetailsdialog.jsx index 8c31014fd6..0ccaf67335 100644 --- a/src/web/pages/scanconfigs/__tests__/editnvtdetailsdialog.jsx +++ b/src/web/pages/scanconfigs/__tests__/editnvtdetailsdialog.jsx @@ -23,6 +23,15 @@ import {setTimezone} from 'web/store/usersettings/actions'; import {rendererWith, fireEvent} from 'web/utils/testing'; +import { + changeInputValue, + getDialogCloseButton, + getDialogContent, + getDialogSaveButton, + getDialogTitle, + getRadioInputs, +} from 'web/components/testing'; + import EditNvtDetailsDialog from '../editnvtdetailsdialog'; const preferences = [ @@ -46,7 +55,7 @@ describe('EditNvtDetailsDialog component tests', () => { store.dispatch(setTimezone('UTC')); - const {getByTestId} = render( + render( { />, ); - const titleBar = getByTestId('dialog-title-bar'); - expect(titleBar).toHaveTextContent('Edit Scan Config NVT'); - - const content = getByTestId('save-dialog-content'); + expect(getDialogTitle()).toHaveTextContent('Edit Scan Config NVT'); + const content = getDialogContent(); expect(content).toHaveTextContent('Config'); expect(content).toHaveTextContent('foo'); }); @@ -88,7 +95,7 @@ describe('EditNvtDetailsDialog component tests', () => { store.dispatch(setTimezone('UTC')); - const {getByTestId} = render( + render( { />, ); - const titleBar = getByTestId('dialog-title-bar'); - expect(titleBar).toHaveTextContent('Edit Scan Config NVT'); - - const content = getByTestId('save-dialog-content'); + expect(getDialogTitle()).toHaveTextContent('Edit Scan Config NVT'); + const content = getDialogContent(); expect(content).not.toHaveTextContent('Config'); expect(content).not.toHaveTextContent('foo'); }); @@ -128,7 +133,7 @@ describe('EditNvtDetailsDialog component tests', () => { router: true, }); - const {getByTestId} = render( + render( { />, ); - const saveButton = getByTestId('dialog-save-button'); + const saveButton = getDialogSaveButton(); fireEvent.click(saveButton); expect(handleSave).toHaveBeenCalledWith({ @@ -187,7 +192,7 @@ describe('EditNvtDetailsDialog component tests', () => { router: true, }); - const {getByTestId} = render( + render( { />, ); - const closeButton = getByTestId('dialog-close-button'); + const closeButton = getDialogCloseButton(); fireEvent.click(closeButton); expect(handleClose).toHaveBeenCalled(); @@ -225,7 +230,7 @@ describe('EditNvtDetailsDialog component tests', () => { router: true, }); - const {baseElement, getByTestId, getAllByTestId} = render( + const {baseElement} = render( { />, ); - const radios = getAllByTestId('radio-input'); + const radios = getRadioInputs(); fireEvent.click(radios[2]); fireEvent.click(radios[5]); const inputs = baseElement.querySelectorAll('input[type="text"]'); - fireEvent.change(inputs[1], {target: {value: 'bar'}}); + changeInputValue(inputs[1], 'bar'); - const saveButton = getByTestId('dialog-save-button'); + const saveButton = getDialogSaveButton(); fireEvent.click(saveButton); const newPreferenceValues = { @@ -281,7 +286,7 @@ describe('EditNvtDetailsDialog component tests', () => { router: true, }); - const {getByTestId, getAllByName, getByName} = render( + const {getAllByName, getByName} = render( { fireEvent.click(useDefaultTimeoutRadios[1]); const timeoutField = getByName('timeout'); - fireEvent.change(timeoutField, {target: {value: '100'}}); + changeInputValue(timeoutField, '100'); - const saveButton = getByTestId('dialog-save-button'); + const saveButton = getDialogSaveButton(); fireEvent.click(saveButton); const preferenceValues = { diff --git a/src/web/pages/scanconfigs/__tests__/listpage.jsx b/src/web/pages/scanconfigs/__tests__/listpage.jsx index 7f58ffabf9..874b40ff97 100644 --- a/src/web/pages/scanconfigs/__tests__/listpage.jsx +++ b/src/web/pages/scanconfigs/__tests__/listpage.jsx @@ -32,7 +32,9 @@ import {entitiesLoadingActions} from 'web/store/entities/scanconfigs'; import {loadingActions} from 'web/store/usersettings/defaults/actions'; import {defaultFilterLoadingActions} from 'web/store/usersettings/defaultfilters/actions'; -import {rendererWith, waitFor, fireEvent, act} from 'web/utils/testing'; +import {rendererWith, fireEvent, wait, screen} from 'web/utils/testing'; + +import {clickElement, getTable} from 'web/components/testing'; import ScanConfigsPage, {ToolBarIcons} from '../listpage'; @@ -115,10 +117,10 @@ describe('ScanConfigsPage tests', () => { store.dispatch(setUsername('admin')); - const defaultSettingfilter = Filter.fromString('foo=bar'); + const defaultSettingFilter = Filter.fromString('foo=bar'); store.dispatch(loadingActions.success({rowsperpage: {value: '2'}})); store.dispatch( - defaultFilterLoadingActions.success('scanconfig', defaultSettingfilter), + defaultFilterLoadingActions.success('scanconfig', defaultSettingFilter), ); const counts = new CollectionCounts({ @@ -136,9 +138,10 @@ describe('ScanConfigsPage tests', () => { const {baseElement} = render(); - await waitFor(() => baseElement.querySelectorAll('table')); + await wait(); - expect(baseElement).toMatchSnapshot(); + expect(baseElement).toBeInTheDocument(); + getTable(); }); test('should call commands for bulk actions', async () => { @@ -175,10 +178,10 @@ describe('ScanConfigsPage tests', () => { store.dispatch(setUsername('admin')); - const defaultSettingfilter = Filter.fromString('foo=bar'); + const defaultSettingFilter = Filter.fromString('foo=bar'); store.dispatch(loadingActions.success({rowsperpage: {value: '2'}})); store.dispatch( - defaultFilterLoadingActions.success('scanconfig', defaultSettingfilter), + defaultFilterLoadingActions.success('scanconfig', defaultSettingFilter), ); const counts = new CollectionCounts({ @@ -194,24 +197,19 @@ describe('ScanConfigsPage tests', () => { entitiesLoadingActions.success([config], filter, loadedFilter, counts), ); - const {baseElement, getAllByTestId} = render(); + render(); - await waitFor(() => baseElement.querySelectorAll('table')); + await wait(); - const icons = getAllByTestId('svg-icon'); + const deleteIcon = screen.getAllByTitle( + 'Move page contents to trashcan', + )[0]; + await clickElement(deleteIcon); + expect(deleteByFilter).toHaveBeenCalled(); - await act(async () => { - expect(icons[21]).toHaveAttribute( - 'title', - 'Move page contents to trashcan', - ); - fireEvent.click(icons[21]); - expect(deleteByFilter).toHaveBeenCalled(); - - expect(icons[22]).toHaveAttribute('title', 'Export page contents'); - fireEvent.click(icons[22]); - expect(exportByFilter).toHaveBeenCalled(); - }); + const exportIcon = screen.getAllByTitle('Export page contents')[0]; + await clickElement(exportIcon); + expect(exportByFilter).toHaveBeenCalled(); }); }); @@ -236,7 +234,6 @@ describe('ScanConfigsPage ToolBarIcons test', () => { onScanConfigImportClick={handleScanConfigImportClick} />, ); - expect(element).toMatchSnapshot(); const icons = getAllByTestId('svg-icon'); const links = element.querySelectorAll('a'); diff --git a/src/web/pages/scanconfigs/__tests__/row.jsx b/src/web/pages/scanconfigs/__tests__/row.jsx index 55dd93b927..7e12428d6f 100644 --- a/src/web/pages/scanconfigs/__tests__/row.jsx +++ b/src/web/pages/scanconfigs/__tests__/row.jsx @@ -82,7 +82,6 @@ describe('Scan Config row tests', () => { />, ); - expect(baseElement).toMatchSnapshot(); expect(baseElement).toHaveTextContent('foo'); expect(baseElement).toHaveTextContent('(bar)'); diff --git a/src/web/pages/scanconfigs/__tests__/table.jsx b/src/web/pages/scanconfigs/__tests__/table.jsx index e38661ee6e..7468eadf53 100644 --- a/src/web/pages/scanconfigs/__tests__/table.jsx +++ b/src/web/pages/scanconfigs/__tests__/table.jsx @@ -120,7 +120,6 @@ describe('Scan Config table tests', () => { />, ); - expect(baseElement).toMatchSnapshot(); const header = baseElement.querySelectorAll('th'); expect(header[0]).toHaveTextContent('Name'); expect(header[1]).toHaveTextContent('Family'); diff --git a/src/web/pages/scanconfigs/__tests__/trend.jsx b/src/web/pages/scanconfigs/__tests__/trend.jsx index a081533ed8..593b290fae 100644 --- a/src/web/pages/scanconfigs/__tests__/trend.jsx +++ b/src/web/pages/scanconfigs/__tests__/trend.jsx @@ -37,7 +37,7 @@ describe('Scan Config Trend tests', () => { />, ); - expect(element).toMatchSnapshot(); + expect(element).toBeInTheDocument(); }); test('should render static title', () => { diff --git a/src/web/pages/scanconfigs/editconfigfamilydialog.jsx b/src/web/pages/scanconfigs/editconfigfamilydialog.jsx index 5e63364ae6..3f63cc3ce4 100644 --- a/src/web/pages/scanconfigs/editconfigfamilydialog.jsx +++ b/src/web/pages/scanconfigs/editconfigfamilydialog.jsx @@ -40,7 +40,6 @@ import Section from 'web/components/section/section'; import SortBy from 'web/components/sortby/sortby'; -import SimpleTable from 'web/components/table/simpletable'; import Table from 'web/components/table/stripedtable'; import TableBody from 'web/components/table/body'; import TableData from 'web/components/table/data'; @@ -206,18 +205,14 @@ const EditScanConfigFamilyDialog = ({ ) : ( <> - - - - {configNameLabel} - {configName} - - - {_('Family')} - {familyName} - - - +
+
+ {configNameLabel}: {configName} +
+
+ {_('Family')}: {familyName} +
+
From 42be55627a6e3001267d20a9defc1764349f6003 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ricks?= Date: Tue, 7 May 2024 15:35:31 +0200 Subject: [PATCH 077/149] Update and fix scanner dialog tests --- .../__tests__/__snapshots__/dialog.jsx.snap | 758 ------------------ src/web/pages/scanners/__tests__/dialog.jsx | 58 +- 2 files changed, 33 insertions(+), 783 deletions(-) delete mode 100644 src/web/pages/scanners/__tests__/__snapshots__/dialog.jsx.snap diff --git a/src/web/pages/scanners/__tests__/__snapshots__/dialog.jsx.snap b/src/web/pages/scanners/__tests__/__snapshots__/dialog.jsx.snap deleted file mode 100644 index 56d9653883..0000000000 --- a/src/web/pages/scanners/__tests__/__snapshots__/dialog.jsx.snap +++ /dev/null @@ -1,758 +0,0 @@ -// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html - -exports[`ScannerDialog component tests > should render 1`] = ` -.c3 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: justify; - -webkit-justify-content: space-between; - justify-content: space-between; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c7 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - -webkit-box-flex: 1; - -webkit-flex-grow: 1; - -ms-flex-positive: 1; - flex-grow: 1; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-align-items: flex-start; - -webkit-box-align: flex-start; - -ms-flex-align: flex-start; - align-items: flex-start; -} - -.c10 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-align-items: stretch; - -webkit-box-align: stretch; - -ms-flex-align: stretch; - align-items: stretch; -} - -.c13 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: start; - -ms-flex-pack: start; - -webkit-justify-content: start; - justify-content: start; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c23 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c26 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-flex-shrink: 0; - -ms-flex-negative: 0; - flex-shrink: 0; - -webkit-box-pack: end; - -ms-flex-pack: end; - -webkit-justify-content: flex-end; - justify-content: flex-end; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c1 { - position: relative; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - margin: 10% auto; - border: 0; - outline: 0; - width: 800px; - height: px; -} - -.c0 { - position: fixed; - font-family: Trebuchet MS,Tahoma,Verdana,Arial,sans-serif; - font-size: 1.1em; - top: 0; - right: 0; - bottom: 0; - left: 0; - margin: 0; - background: rgba(102, 102, 102, 0.5); - z-index: 600; - -webkit-transition: opacity 1s ease-in; - transition: opacity 1s ease-in; - width: 100%; - height: 100%; -} - -.c33 { - width: 0; - height: 0; - cursor: nwse-resize; - border-right: 20px solid transparent; - border-bottom: 20px solid transparent; - border-top: 20px solid #fff; -} - -.c32 { - position: absolute; - bottom: 3px; - right: 3px; - width: 20px; - height: 20px; - background: repeating-linear-gradient( -45deg, transparent, transparent 2px, #000 2px, #000 3px ); -} - -.c2 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - height: inherit; - padding: 0; - background: #fff; - box-shadow: 5px 5px 10px #7F7F7F; - border-radius: 3px; - border: 1px solid #7F7F7F; -} - -.c5 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - font-weight: bold; - font-size: 12px; - font-family: Verdana,sans-serif; - color: #074320; - cursor: pointer; - border-radius: 2px; - padding: 0; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-flex-shrink: 0; - -ms-flex-negative: 0; - flex-shrink: 0; -} - -.c5 :hover { - border: 1px solid #074320; -} - -.c6 { - height: 24px; - width: 24px; - line-height: 24px; -} - -.c6 * { - height: inherit; - width: inherit; -} - -.c29 { - display: inline-block; - padding: 0 15px; - color: #4C4C4C; - text-align: center; - vertical-align: middle; - font-size: 11px; - font-weight: bold; - line-height: 30px; - -webkit-text-decoration: none; - text-decoration: none; - white-space: nowrap; - background-color: #fff; - border-radius: 2px; - border: 1px solid #bfbfbf; - cursor: pointer; - overflow: visible; - z-index: 1; -} - -.c29:focus, -.c29:hover { - border: 1px solid #4C4C4C; -} - -.c29:hover { - -webkit-text-decoration: none; - text-decoration: none; - background: #11ab51; - font-weight: bold; - color: #fff; -} - -.c29[disabled] { - cursor: not-allowed; - opacity: 0.65; - box-shadow: none; -} - -.c29 img { - height: 32px; - width: 32px; - margin-top: 5px 10px 5px -10px; - vertical-align: middle; -} - -.c29:link { - -webkit-text-decoration: none; - text-decoration: none; - color: #4C4C4C; -} - -.c30 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c31 { - border: 1px solid #7F7F7F; - color: #fff; - background: #11ab51; -} - -.c31 :hover { - color: #074320; - background: #A1DDBA; -} - -.c27 { - border-width: 1px 0 0 0; - border-style: solid; - border-color: #e5e5e5; - margin-top: 15px; - padding: 10px 20px 10px 20px; -} - -.c28 { - -webkit-box-pack: justify; - -webkit-justify-content: space-between; - justify-content: space-between; -} - -.c4 { - padding: 5px 5px 5px 10px; - margin-bottom: 15px; - border-radius: 2px 2px 0 0; - border-bottom: 1px solid #7F7F7F; - color: #fff; - font-weight: bold; - background: #11ab51; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: justify; - -webkit-justify-content: space-between; - justify-content: space-between; - -webkit-flex-shrink: 0; - -ms-flex-negative: 0; - flex-shrink: 0; - cursor: -webkit-grab; - cursor: grab; -} - -.c9 { - overflow: auto; - padding: 0 15px; - width: 100%; - height: 100%; - max-height: 400px; -} - -.c8 { - overflow: hidden; - height: 100%; -} - -.c11 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: start; - -ms-flex-pack: start; - -webkit-justify-content: start; - justify-content: start; - padding-bottom: 10px; -} - -.c12 { - display: inline-block; - max-width: 100%; - font-weight: bold; - text-align: right; - padding-left: 10px; - padding-right: 10px; - width: 16.66666667%; - margin-left: 0; -} - -.c14 { - width: 83.33333333%; - padding-left: 10px; - padding-right: 10px; -} - -.c24 { - background-color: transparent; - border: none; - cursor: pointer; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - outline: none; - margin: 1px; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - cursor: pointer; -} - -.c25 { - height: 16px; - width: 16px; - line-height: 16px; -} - -.c25 * { - height: inherit; - width: inherit; -} - -.c20 { - border: 1px solid #bfbfbf; - border-radius: 2px; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-align-items: stretch; - -webkit-box-align: stretch; - -ms-flex-align: stretch; - align-items: stretch; - -webkit-box-flex: 1; - -webkit-flex-grow: 1; - -ms-flex-positive: 1; - flex-grow: 1; - padding: 1px 5px; - background-color: #fff; - color: #000; - font-weight: normal; -} - -.c19 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - position: relative; - width: 180px; -} - -.c21 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-flex: 1; - -webkit-flex-grow: 1; - -ms-flex-positive: 1; - flex-grow: 1; - word-break: keep-all; - white-space: nowrap; - overflow: hidden; - cursor: pointer; -} - -.c17 { - color: #c12c30; - font-weight: bold; - font-size: 19px; - padding-bottom: 1px; - padding-left: 4px; - display: none; -} - -.c22 { - cursor: default; -} - -.c18 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; -} - -.c15 { - font-family: inherit; - font-size: inherit; - line-height: inherit; - display: block; - height: 22px; - color: #4C4C4C; - background-color: #fff; - background-image: none; - border: 1px solid #bfbfbf; - border-radius: 2px; - padding: 1px 8px; -} - -.c15:-webkit-autofill { - box-shadow: 0 0 0 1000px white inset; -} - -.c16 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-flex: 1; - -webkit-flex-grow: 1; - -ms-flex-positive: 1; - flex-grow: 1; - -webkit-box-pack: start; - -ms-flex-pack: start; - -webkit-justify-content: start; - justify-content: start; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - - -
-
-
- -
-
-
- -`; diff --git a/src/web/pages/scanners/__tests__/dialog.jsx b/src/web/pages/scanners/__tests__/dialog.jsx index fa109b9a16..bca75f19df 100644 --- a/src/web/pages/scanners/__tests__/dialog.jsx +++ b/src/web/pages/scanners/__tests__/dialog.jsx @@ -26,6 +26,15 @@ import Scanner, {GREENBONE_SENSOR_SCANNER_TYPE} from 'gmp/models/scanner'; import {rendererWith, fireEvent} from 'web/utils/testing'; +import { + changeInputValue, + getDialog, + getDialogCloseButton, + getDialogSaveButton, + getSelectElement, + getTextInputs, +} from 'web/components/testing'; + import ScannerDialog from 'web/pages/scanners/dialog'; const sensorScanner = { @@ -71,7 +80,7 @@ describe('ScannerDialog component tests', () => { const {render} = rendererWith({gmp}); - const {baseElement} = render( + render( { />, ); - expect(baseElement).toMatchSnapshot(); + expect(getDialog()).toBeInTheDocument(); }); test('should display default info', () => { @@ -97,7 +106,7 @@ describe('ScannerDialog component tests', () => { const {render} = rendererWith({gmp}); - const {getAllByTestId, baseElement} = render( + render( { />, ); - const inputs = baseElement.querySelectorAll('input'); + const inputs = getTextInputs(); expect(inputs[0]).toHaveAttribute('name', 'name'); - expect(inputs[0]).toHaveAttribute('value', 'Unnamed'); // name field + expect(inputs[0]).toHaveValue('Unnamed'); // name field expect(inputs[1]).toHaveAttribute('name', 'comment'); - expect(inputs[1]).toHaveAttribute('value', ''); // comment field + expect(inputs[1]).toHaveValue(''); // comment field expect(inputs[2]).toHaveAttribute('name', 'host'); - expect(inputs[2]).toHaveAttribute('value', 'localhost'); + expect(inputs[2]).toHaveValue('localhost'); - const selectedValues = getAllByTestId('select-selected-value'); + const select = getSelectElement(); - expect(selectedValues[0]).toHaveAttribute('title', 'Greenbone Sensor'); + expect(select).toHaveValue('Greenbone Sensor'); }); test('should display value from props', () => { @@ -136,7 +145,7 @@ describe('ScannerDialog component tests', () => { const {render} = rendererWith({gmp}); - const {getAllByTestId, baseElement} = render( + render( { />, ); - const inputs = baseElement.querySelectorAll('input'); + const inputs = getTextInputs(); expect(inputs[0]).toHaveAttribute('name', 'name'); expect(inputs[0]).toHaveAttribute('value', 'john'); @@ -163,9 +172,9 @@ describe('ScannerDialog component tests', () => { expect(inputs[2]).toHaveAttribute('name', 'host'); expect(inputs[2]).toHaveAttribute('value', 'mypc'); - const selectedValues = getAllByTestId('select-selected-value'); + const select = getSelectElement(); - expect(selectedValues[0]).toHaveAttribute('title', 'Greenbone Sensor'); + expect(select).toHaveValue('Greenbone Sensor'); }); test('should save valid form state', () => { @@ -177,7 +186,7 @@ describe('ScannerDialog component tests', () => { const {render} = rendererWith({gmp}); - const {getByTestId} = render( + render( { />, ); - const saveButton = getByTestId('dialog-save-button'); + const saveButton = getDialogSaveButton(); fireEvent.click(saveButton); @@ -221,7 +230,7 @@ describe('ScannerDialog component tests', () => { const {render} = rendererWith({gmp}); - const {baseElement, getByName, getByTestId} = render( + const {getByName} = render( { />, ); - const inputs = baseElement.querySelectorAll('input'); + const inputs = getTextInputs(); - expect(inputs[0]).toHaveAttribute('value', 'john'); - expect(inputs[1]).toHaveAttribute('value', 'lorem ipsum'); + expect(inputs[0]).toHaveValue('john'); + expect(inputs[1]).toHaveValue('lorem ipsum'); const nameInput = getByName('name'); - fireEvent.change(nameInput, {target: {value: 'ipsum'}}); + changeInputValue(nameInput, 'ipsum'); const commentInput = getByName('comment'); - fireEvent.change(commentInput, {target: {value: 'lorem'}}); + changeInputValue(commentInput, 'lorem'); - const saveButton = getByTestId('dialog-save-button'); + const saveButton = getDialogSaveButton(); fireEvent.click(saveButton); expect(handleSave).toHaveBeenCalledWith({ @@ -275,7 +284,7 @@ describe('ScannerDialog component tests', () => { const {render} = rendererWith({gmp}); - const {getByTestId} = render( + render( { />, ); - const closeButton = getByTestId('dialog-close-button'); - + const closeButton = getDialogCloseButton(); fireEvent.click(closeButton); expect(handleClose).toHaveBeenCalled(); From c1a2ff638b1fb01644fe00bd0c06b9a17396e31b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ricks?= Date: Tue, 7 May 2024 16:06:49 +0200 Subject: [PATCH 078/149] Update and fix schedule pages tests --- src/web/pages/schedules/__tests__/dialog.jsx | 166 +++++------------- .../pages/schedules/__tests__/listpage.jsx | 134 ++++++-------- 2 files changed, 102 insertions(+), 198 deletions(-) diff --git a/src/web/pages/schedules/__tests__/dialog.jsx b/src/web/pages/schedules/__tests__/dialog.jsx index 1f97ed9bab..d9ce6e2050 100644 --- a/src/web/pages/schedules/__tests__/dialog.jsx +++ b/src/web/pages/schedules/__tests__/dialog.jsx @@ -19,7 +19,17 @@ import {describe, test, expect, testing} from '@gsa/testing'; import Schedule from 'gmp/models/schedule'; -import {render, fireEvent, screen} from 'web/utils/testing'; +import {render, fireEvent} from 'web/utils/testing'; + +import { + changeInputValue, + clickElement, + closeDialog, + getDialogSaveButton, + getSelectElements, + getSelectItemElementsForSelect, + getTextInputs, +} from 'web/components/testing'; import ScheduleDialog from '../dialog'; @@ -66,7 +76,7 @@ const { describe('ScheduleDialog component tests', () => { test('should render with default values', () => { - const {baseElement, getAllByTestId} = render( + const {baseElement, getByName} = render( { />, ); - const inputs = baseElement.querySelectorAll('input'); - const formgroups = getAllByTestId('formgroup-title'); - const spinnerInputs = getAllByTestId('spinner-input'); + const inputs = getTextInputs(); + const selects = getSelectElements(); - expect(formgroups.length).toBe(7); - - expect(formgroups[0]).toHaveTextContent('Name'); expect(inputs[0]).toHaveAttribute('name', 'name'); - expect(inputs[0]).toHaveAttribute('value', 'schedule 1'); // name field + expect(inputs[0]).toHaveValue('schedule 1'); // name field - expect(formgroups[1]).toHaveTextContent('Comment'); expect(inputs[1]).toHaveAttribute('name', 'comment'); - expect(inputs[1]).toHaveAttribute('value', 'hello world'); // comment field + expect(inputs[1]).toHaveValue('hello world'); // comment field - expect(formgroups[2]).toHaveTextContent('Timezone'); - const defaultTimezone = screen.getAllByTitle( - 'Coordinated Universal Time/UTC', - ); - expect(defaultTimezone[0]).toBeInTheDocument(); + const defaultTimezone = selects[0]; + expect(defaultTimezone).toHaveValue('Coordinated Universal Time/UTC'); - expect(formgroups[3]).toHaveTextContent('First Run'); expect(baseElement).toHaveTextContent('02/08/2021'); - expect(spinnerInputs.length).toBe(4); - expect(spinnerInputs[0]).toHaveAttribute('value', '15'); - expect(spinnerInputs[1]).toHaveAttribute('value', '0'); + expect(getByName('startHour')).toHaveValue('15'); + expect(getByName('startMinute')).toHaveValue('0'); - expect(spinnerInputs[2]).toHaveAttribute('value', '19'); - expect(spinnerInputs[3]).toHaveAttribute('value', '45'); + expect(getByName('endHour')).toHaveValue('19'); + expect(getByName('endMinute')).toHaveValue('45'); expect(baseElement).toHaveTextContent('5 hours'); - const recurrenceValue = screen.getAllByTitle('Weekly'); - - expect(recurrenceValue[0]).toBeInTheDocument(); + const recurrence = selects[1]; + expect(recurrence).toHaveValue('Weekly'); }); test('should allow to change text field', () => { - const {getByName, getByTestId} = render( + const {getByName} = render( { ); const nameInput = getByName('name'); - expect(nameInput).toHaveAttribute('value', 'Unnamed'); - fireEvent.change(nameInput, {target: {value: 'foo'}}); - expect(nameInput).toHaveAttribute('value', 'foo'); + expect(nameInput).toHaveValue('Unnamed'); + changeInputValue(nameInput, 'foo'); + expect(nameInput).toHaveValue('foo'); const commentInput = getByName('comment'); - expect(commentInput).toHaveAttribute('value', ''); - fireEvent.change(commentInput, {target: {value: 'bar'}}); - expect(commentInput).toHaveAttribute('value', 'bar'); + expect(commentInput).toHaveValue(''); + changeInputValue(commentInput, 'bar'); + expect(commentInput).toHaveValue('bar'); - const saveButton = getByTestId('dialog-save-button'); + const saveButton = getDialogSaveButton(); fireEvent.click(saveButton); expect(handleSave).toHaveBeenCalled(); // handleSave in dialog is over 100 lines long and generates an icalendar. toHaveBeenCalledWith(...) is extremely difficult to test... }); test('should allow to close the dialog', () => { - const {getByTestId} = render( + render( { />, ); - const closeButton = getByTestId('dialog-title-close-button'); - - fireEvent.click(closeButton); - + closeDialog(); expect(handleClose).toHaveBeenCalled(); }); - test('should allow changing spinner values', () => { - const {getAllByTestId, getByTestId} = render( - , - ); - - const spinnerUpButtons = getAllByTestId('spinner-up'); - const spinnerDownButtons = getAllByTestId('spinner-down'); - const spinnerInputs = getAllByTestId('spinner-input'); - - expect(spinnerUpButtons.length).toBe(4); - expect(spinnerDownButtons.length).toBe(4); - expect(spinnerInputs.length).toBe(4); - - fireEvent.click(spinnerUpButtons[0]); - expect(spinnerInputs[0]).toHaveAttribute('value', '16'); - - fireEvent.click(spinnerDownButtons[0]); - expect(spinnerInputs[0]).toHaveAttribute('value', '15'); - - fireEvent.click(spinnerUpButtons[1]); - expect(spinnerInputs[1]).toHaveAttribute('value', '1'); - - fireEvent.click(spinnerDownButtons[1]); - expect(spinnerInputs[1]).toHaveAttribute('value', '0'); - - fireEvent.click(spinnerUpButtons[2]); - expect(spinnerInputs[2]).toHaveAttribute('value', '20'); - - fireEvent.click(spinnerDownButtons[2]); - expect(spinnerInputs[2]).toHaveAttribute('value', '19'); - - fireEvent.click(spinnerUpButtons[3]); - expect(spinnerInputs[3]).toHaveAttribute('value', '46'); - - fireEvent.click(spinnerDownButtons[3]); - expect(spinnerInputs[3]).toHaveAttribute('value', '45'); - - const saveButton = getByTestId('dialog-save-button'); - fireEvent.click(saveButton); - - expect(handleSave).toHaveBeenCalled(); - }); - - test('should allow changing select values', () => { - const {getAllByTestId, getByTestId} = render( + test('should allow changing select values', async () => { + render( { ); let selectItems; - const selectedValues = getAllByTestId('select-selected-value'); - const selectOpenButton = getAllByTestId('select-open-button'); - expect(selectOpenButton.length).toBe(2); - expect(selectedValues.length).toBe(2); - - expect(selectedValues[0]).toHaveTextContent( - 'Coordinated Universal Time/UTC', - ); - expect(selectedValues[1]).toHaveTextContent('Weekly'); - - fireEvent.click(selectOpenButton[0]); + const selects = getSelectElements(); + expect(selects[0]).toHaveValue('Coordinated Universal Time/UTC'); + expect(selects[1]).toHaveValue('Weekly'); - selectItems = getAllByTestId('select-item'); + selectItems = await getSelectItemElementsForSelect(selects[0]); expect(selectItems.length).toBe(422); - fireEvent.click(selectItems[1]); - - expect(selectedValues[0]).toHaveTextContent('Africa/Abidjan'); + await clickElement(selectItems[1]); + expect(selects[0]).toHaveValue('Africa/Abidjan'); - fireEvent.click(selectOpenButton[1]); - - selectItems = getAllByTestId('select-item'); + selectItems = await getSelectItemElementsForSelect(selects[1]); expect(selectItems.length).toBe(8); - fireEvent.click(selectItems[6]); + await clickElement(selectItems[6]); - expect(selectedValues[1]).toHaveTextContent( - 'Workweek (Monday till Friday)', - ); + expect(selects[1]).toHaveValue('Workweek (Monday till Friday)'); - const saveButton = getByTestId('dialog-save-button'); + const saveButton = getDialogSaveButton(); fireEvent.click(saveButton); expect(handleSave).toHaveBeenCalled(); diff --git a/src/web/pages/schedules/__tests__/listpage.jsx b/src/web/pages/schedules/__tests__/listpage.jsx index 081a537496..3b5400175b 100644 --- a/src/web/pages/schedules/__tests__/listpage.jsx +++ b/src/web/pages/schedules/__tests__/listpage.jsx @@ -31,6 +31,17 @@ import {loadingActions} from 'web/store/usersettings/defaults/actions'; import {rendererWith, fireEvent, screen, wait} from 'web/utils/testing'; +import { + clickElement, + getCheckBoxes, + getPowerFilter, + getSelectElement, + getSelectItemElementsForSelect, + getTableBody, + getTableFooter, + getTextInputs, +} from 'web/components/testing'; + import SchedulePage, {ToolBarIcons} from '../listpage'; const schedule = Schedule.fromElement({ @@ -107,10 +118,10 @@ describe('SchedulePage tests', () => { store.dispatch(setTimezone('CET')); store.dispatch(setUsername('admin')); - const defaultSettingfilter = Filter.fromString('foo=bar'); + const defaultSettingFilter = Filter.fromString('foo=bar'); store.dispatch(loadingActions.success({rowsperpage: {value: '2'}})); store.dispatch( - defaultFilterLoadingActions.success('schedule', defaultSettingfilter), + defaultFilterLoadingActions.success('schedule', defaultSettingFilter), ); const counts = new CollectionCounts({ @@ -130,8 +141,9 @@ describe('SchedulePage tests', () => { await wait(); - const inputs = baseElement.querySelectorAll('input'); - const selects = screen.getAllByTestId('select-selected-value'); + const powerFilter = getPowerFilter(); + const select = getSelectElement(powerFilter); + const inputs = getTextInputs(powerFilter); // Toolbar Icons expect(screen.getAllByTitle('Help: Schedules')[0]).toBeInTheDocument(); @@ -146,8 +158,8 @@ describe('SchedulePage tests', () => { ).toBeInTheDocument(); expect(screen.getAllByTitle('Help: Powerfilter')[0]).toBeInTheDocument(); expect(screen.getAllByTitle('Edit Filter')[0]).toBeInTheDocument(); - expect(selects[0]).toHaveAttribute('title', 'Loaded filter'); - expect(selects[0]).toHaveTextContent('--'); + expect(select).toHaveAttribute('title', 'Loaded filter'); + expect(select).toHaveValue('--'); // Table const header = baseElement.querySelectorAll('th'); @@ -174,6 +186,7 @@ describe('SchedulePage tests', () => { expect(screen.getAllByTitle('Clone Schedule')[0]).toBeInTheDocument(); expect(screen.getAllByTitle('Export Schedule')[0]).toBeInTheDocument(); }); + test('should allow to bulk action on page contents', async () => { const deleteByFilter = testing.fn().mockResolvedValue({ foo: 'bar', @@ -206,10 +219,10 @@ describe('SchedulePage tests', () => { store.dispatch(setTimezone('CET')); store.dispatch(setUsername('admin')); - const defaultSettingfilter = Filter.fromString('foo=bar'); + const defaultSettingFilter = Filter.fromString('foo=bar'); store.dispatch(loadingActions.success({rowsperpage: {value: '2'}})); store.dispatch( - defaultFilterLoadingActions.success('schedule', defaultSettingfilter), + defaultFilterLoadingActions.success('schedule', defaultSettingFilter), ); const counts = new CollectionCounts({ @@ -230,23 +243,15 @@ describe('SchedulePage tests', () => { await wait(); // export page contents - const exportIcon = screen.getAllByTitle('Export page contents'); - - expect(exportIcon[0]).toBeInTheDocument(); - fireEvent.click(exportIcon[0]); - - await wait(); - + const exportIcon = screen.getAllByTitle('Export page contents')[0]; + await clickElement(exportIcon); expect(exportByFilter).toHaveBeenCalled(); // move page contents to trashcan - const deleteIcon = screen.getAllByTitle('Move page contents to trashcan'); - - expect(deleteIcon[0]).toBeInTheDocument(); - fireEvent.click(deleteIcon[0]); - - await wait(); - + const deleteIcon = screen.getAllByTitle( + 'Move page contents to trashcan', + )[0]; + await clickElement(deleteIcon); expect(deleteByFilter).toHaveBeenCalled(); }); @@ -282,10 +287,10 @@ describe('SchedulePage tests', () => { store.dispatch(setTimezone('CET')); store.dispatch(setUsername('admin')); - const defaultSettingfilter = Filter.fromString('foo=bar'); + const defaultSettingFilter = Filter.fromString('foo=bar'); store.dispatch(loadingActions.success({rowsperpage: {value: '2'}})); store.dispatch( - defaultFilterLoadingActions.success('schedule', defaultSettingfilter), + defaultFilterLoadingActions.success('schedule', defaultSettingFilter), ); const counts = new CollectionCounts({ @@ -301,43 +306,30 @@ describe('SchedulePage tests', () => { entitiesLoadingActions.success([schedule], filter, loadedFilter, counts), ); - const {element} = render(); + render(); await wait(); - const selectFields = screen.getAllByTestId('select-open-button'); - fireEvent.click(selectFields[1]); - - const selectItems = screen.getAllByTestId('select-item'); - fireEvent.click(selectItems[1]); - - const selected = screen.getAllByTestId('select-selected-value'); - expect(selected[1]).toHaveTextContent('Apply to selection'); - - const inputs = element.querySelectorAll('input'); + // change to apply to selection + const tableFooter = getTableFooter(); + const select = getSelectElement(tableFooter); + const selectItems = await getSelectItemElementsForSelect(select); + await clickElement(selectItems[1]); + expect(select).toHaveValue('Apply to selection'); // select an schedule - fireEvent.click(inputs[1]); - await wait(); + const tableBody = getTableBody(); + const inputs = getCheckBoxes(tableBody); + await clickElement(inputs[1]); // export selected schedule - const exportIcon = screen.getAllByTitle('Export selection'); - - expect(exportIcon[0]).toBeInTheDocument(); - fireEvent.click(exportIcon[0]); - - await wait(); - + const exportIcon = screen.getAllByTitle('Export selection')[0]; + await clickElement(exportIcon); expect(exportByIds).toHaveBeenCalled(); // move selected schedule to trashcan - const deleteIcon = screen.getAllByTitle('Move selection to trashcan'); - - expect(deleteIcon[0]).toBeInTheDocument(); - fireEvent.click(deleteIcon[0]); - - await wait(); - + const deleteIcon = screen.getAllByTitle('Move selection to trashcan')[0]; + await clickElement(deleteIcon); expect(deleteByIds).toHaveBeenCalled(); }); @@ -373,10 +365,10 @@ describe('SchedulePage tests', () => { store.dispatch(setTimezone('CET')); store.dispatch(setUsername('admin')); - const defaultSettingfilter = Filter.fromString('foo=bar'); + const defaultSettingFilter = Filter.fromString('foo=bar'); store.dispatch(loadingActions.success({rowsperpage: {value: '2'}})); store.dispatch( - defaultFilterLoadingActions.success('schedule', defaultSettingfilter), + defaultFilterLoadingActions.success('schedule', defaultSettingFilter), ); const counts = new CollectionCounts({ @@ -396,35 +388,21 @@ describe('SchedulePage tests', () => { await wait(); - const selectFields = screen.getAllByTestId('select-open-button'); - fireEvent.click(selectFields[1]); - - const selectItems = screen.getAllByTestId('select-item'); - fireEvent.click(selectItems[2]); - - await wait(); - - const selected = screen.getAllByTestId('select-selected-value'); - expect(selected[1]).toHaveTextContent('Apply to all filtered'); + // change to all filtered + const tableFooter = getTableFooter(); + const select = getSelectElement(tableFooter); + const selectItems = await getSelectItemElementsForSelect(select); + await clickElement(selectItems[2]); + expect(select).toHaveValue('Apply to all filtered'); // export all filtered schedules - const exportIcon = screen.getAllByTitle('Export all filtered'); - - expect(exportIcon[0]).toBeInTheDocument(); - fireEvent.click(exportIcon[0]); - - await wait(); - + const exportIcon = screen.getAllByTitle('Export all filtered')[0]; + await clickElement(exportIcon); expect(exportByFilter).toHaveBeenCalled(); // move all filtered schedules to trashcan - const deleteIcon = screen.getAllByTitle('Move all filtered to trashcan'); - - expect(deleteIcon[0]).toBeInTheDocument(); - fireEvent.click(deleteIcon[0]); - - await wait(); - + const deleteIcon = screen.getAllByTitle('Move all filtered to trashcan')[0]; + await clickElement(deleteIcon); expect(deleteByFilter).toHaveBeenCalled(); }); }); @@ -496,7 +474,7 @@ describe('SchedulePage ToolBarIcons test', () => { , ); - const icons = queryAllByTestId('svg-icon'); // this test is probably approppriate to keep in the old format + const icons = queryAllByTestId('svg-icon'); // this test is probably appropriate to keep in the old format expect(icons.length).toBe(1); expect(icons[0]).toHaveAttribute('title', 'Help: Schedules'); }); From 0229d5ea10ccfda2cfa5763f8ecbbc1b6efb31f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ricks?= Date: Tue, 7 May 2024 17:09:22 +0200 Subject: [PATCH 079/149] Update and fix ticket pages tests --- .../__snapshots__/createdialog.jsx.snap | 696 --------------- .../__snapshots__/editdialog.jsx.snap | 808 ------------------ .../pages/tickets/__tests__/createdialog.jsx | 52 +- .../pages/tickets/__tests__/editdialog.jsx | 68 +- 4 files changed, 59 insertions(+), 1565 deletions(-) delete mode 100644 src/web/pages/tickets/__tests__/__snapshots__/createdialog.jsx.snap delete mode 100644 src/web/pages/tickets/__tests__/__snapshots__/editdialog.jsx.snap diff --git a/src/web/pages/tickets/__tests__/__snapshots__/createdialog.jsx.snap b/src/web/pages/tickets/__tests__/__snapshots__/createdialog.jsx.snap deleted file mode 100644 index 0866b87b7b..0000000000 --- a/src/web/pages/tickets/__tests__/__snapshots__/createdialog.jsx.snap +++ /dev/null @@ -1,696 +0,0 @@ -// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html - -exports[`CreateTicketDialog component tests > should render dialog 1`] = ` -.c3 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: justify; - -webkit-justify-content: space-between; - justify-content: space-between; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c7 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - -webkit-box-flex: 1; - -webkit-flex-grow: 1; - -ms-flex-positive: 1; - flex-grow: 1; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-align-items: flex-start; - -webkit-box-align: flex-start; - -ms-flex-align: flex-start; - align-items: flex-start; -} - -.c10 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-align-items: stretch; - -webkit-box-align: stretch; - -ms-flex-align: stretch; - align-items: stretch; -} - -.c13 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: start; - -ms-flex-pack: start; - -webkit-justify-content: start; - justify-content: start; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c20 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c26 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-flex-shrink: 0; - -ms-flex-negative: 0; - flex-shrink: 0; - -webkit-box-pack: end; - -ms-flex-pack: end; - -webkit-justify-content: flex-end; - justify-content: flex-end; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c1 { - position: relative; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - margin: 10% auto; - border: 0; - outline: 0; - width: 800px; - height: px; -} - -.c0 { - position: fixed; - font-family: Trebuchet MS,Tahoma,Verdana,Arial,sans-serif; - font-size: 1.1em; - top: 0; - right: 0; - bottom: 0; - left: 0; - margin: 0; - background: rgba(102, 102, 102, 0.5); - z-index: 600; - -webkit-transition: opacity 1s ease-in; - transition: opacity 1s ease-in; - width: 100%; - height: 100%; -} - -.c33 { - width: 0; - height: 0; - cursor: nwse-resize; - border-right: 20px solid transparent; - border-bottom: 20px solid transparent; - border-top: 20px solid #fff; -} - -.c32 { - position: absolute; - bottom: 3px; - right: 3px; - width: 20px; - height: 20px; - background: repeating-linear-gradient( -45deg, transparent, transparent 2px, #000 2px, #000 3px ); -} - -.c2 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - height: inherit; - padding: 0; - background: #fff; - box-shadow: 5px 5px 10px #7F7F7F; - border-radius: 3px; - border: 1px solid #7F7F7F; -} - -.c5 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - font-weight: bold; - font-size: 12px; - font-family: Verdana,sans-serif; - color: #074320; - cursor: pointer; - border-radius: 2px; - padding: 0; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-flex-shrink: 0; - -ms-flex-negative: 0; - flex-shrink: 0; -} - -.c5 :hover { - border: 1px solid #074320; -} - -.c6 { - height: 24px; - width: 24px; - line-height: 24px; -} - -.c6 * { - height: inherit; - width: inherit; -} - -.c29 { - display: inline-block; - padding: 0 15px; - color: #4C4C4C; - text-align: center; - vertical-align: middle; - font-size: 11px; - font-weight: bold; - line-height: 30px; - -webkit-text-decoration: none; - text-decoration: none; - white-space: nowrap; - background-color: #fff; - border-radius: 2px; - border: 1px solid #bfbfbf; - cursor: pointer; - overflow: visible; - z-index: 1; -} - -.c29:focus, -.c29:hover { - border: 1px solid #4C4C4C; -} - -.c29:hover { - -webkit-text-decoration: none; - text-decoration: none; - background: #11ab51; - font-weight: bold; - color: #fff; -} - -.c29[disabled] { - cursor: not-allowed; - opacity: 0.65; - box-shadow: none; -} - -.c29 img { - height: 32px; - width: 32px; - margin-top: 5px 10px 5px -10px; - vertical-align: middle; -} - -.c29:link { - -webkit-text-decoration: none; - text-decoration: none; - color: #4C4C4C; -} - -.c30 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c31 { - border: 1px solid #7F7F7F; - color: #fff; - background: #11ab51; -} - -.c31 :hover { - color: #074320; - background: #A1DDBA; -} - -.c27 { - border-width: 1px 0 0 0; - border-style: solid; - border-color: #e5e5e5; - margin-top: 15px; - padding: 10px 20px 10px 20px; -} - -.c28 { - -webkit-box-pack: justify; - -webkit-justify-content: space-between; - justify-content: space-between; -} - -.c4 { - padding: 5px 5px 5px 10px; - margin-bottom: 15px; - border-radius: 2px 2px 0 0; - border-bottom: 1px solid #7F7F7F; - color: #fff; - font-weight: bold; - background: #11ab51; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: justify; - -webkit-justify-content: space-between; - justify-content: space-between; - -webkit-flex-shrink: 0; - -ms-flex-negative: 0; - flex-shrink: 0; - cursor: -webkit-grab; - cursor: grab; -} - -.c9 { - overflow: auto; - padding: 0 15px; - width: 100%; - height: 100%; - max-height: 400px; -} - -.c8 { - overflow: hidden; - height: 100%; -} - -.c11 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: start; - -ms-flex-pack: start; - -webkit-justify-content: start; - justify-content: start; - padding-bottom: 10px; -} - -.c12 { - display: inline-block; - max-width: 100%; - font-weight: bold; - text-align: right; - padding-left: 10px; - padding-right: 10px; - width: 16.66666667%; - margin-left: 0; -} - -.c14 { - width: 83.33333333%; - padding-left: 10px; - padding-right: 10px; -} - -.c21 { - background-color: transparent; - border: none; - cursor: pointer; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - outline: none; - margin: 1px; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - cursor: pointer; -} - -.c22 { - height: 16px; - width: 16px; - line-height: 16px; -} - -.c22 * { - height: inherit; - width: inherit; -} - -.c17 { - border: 1px solid #bfbfbf; - border-radius: 2px; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-align-items: stretch; - -webkit-box-align: stretch; - -ms-flex-align: stretch; - align-items: stretch; - -webkit-box-flex: 1; - -webkit-flex-grow: 1; - -ms-flex-positive: 1; - flex-grow: 1; - padding: 1px 5px; - background-color: #fff; - color: #000; - font-weight: normal; -} - -.c16 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - position: relative; - width: 180px; -} - -.c18 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-flex: 1; - -webkit-flex-grow: 1; - -ms-flex-positive: 1; - flex-grow: 1; - word-break: keep-all; - white-space: nowrap; - overflow: hidden; - cursor: pointer; -} - -.c23 { - color: #c12c30; - font-weight: bold; - font-size: 19px; - padding-bottom: 1px; - padding-left: 4px; - display: none; -} - -.c19 { - cursor: default; -} - -.c15 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; -} - -.c24 { - display: block; - height: auto; - color: #4C4C4C; - background-color: #fff; - background-image: none; - border: 1px solid #bfbfbf; - border-radius: 2px; - padding: 4px 8px; -} - -.c25 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-flex: 1; - -webkit-flex-grow: 1; - -ms-flex-positive: 1; - flex-grow: 1; - -webkit-box-pack: start; - -ms-flex-pack: start; - -webkit-justify-content: start; - justify-content: start; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - - -
-
-
-