From d67c8b898c3196f19931eb95a02c846f916f10ad Mon Sep 17 00:00:00 2001 From: Alex Pishcheiko Date: Mon, 27 Jul 2020 20:56:42 +0100 Subject: [PATCH 01/11] links to filter by status --- components/templates/Test.tsx | 2 +- components/templates/showStatusIcon.js | 42 +- components/templates/showTestStats.js | 6 +- package-lock.json | 528 ++++++++++++++----------- package.json | 2 +- pages/tests/[testsByRunId].tsx | 12 +- 6 files changed, 353 insertions(+), 239 deletions(-) diff --git a/components/templates/Test.tsx b/components/templates/Test.tsx index d995706..543d60f 100644 --- a/components/templates/Test.tsx +++ b/components/templates/Test.tsx @@ -73,7 +73,7 @@ export const TestExpanded = function(props: TestProps) {
{children.name ? ( // when page is just loaded and no test selected - half page to be blank diff --git a/components/templates/showStatusIcon.js b/components/templates/showStatusIcon.js index 7e61566..17cd92c 100644 --- a/components/templates/showStatusIcon.js +++ b/components/templates/showStatusIcon.js @@ -1,10 +1,11 @@ import React from "react" -import {Typography, Tooltip} from "@material-ui/core" +import {Typography, Tooltip, Chip, Link} from "@material-ui/core" import CheckIcon from "@material-ui/icons/Check" import CloseIcon from "@material-ui/icons/Close" import UseAnimations from "react-useanimations" import SnoozeIcon from "@material-ui/icons/Snooze" + export function showStatusIcon(status) { let statusIcon if (status === "Passed" || status === "Successful") { @@ -45,7 +46,7 @@ export function showStatusIcon(status) { } - export function showStatusText(status) { +export function showStatusText(status) { let statusIcon if (status === "Passed" || status === "Successful") { statusIcon = ( @@ -71,5 +72,38 @@ export function showStatusIcon(status) { ) } - return statusIcon - } \ No newline at end of file + return statusIcon +} + + +export function showAllStatusesLinks(testRunId) { + + let statusesLinks = ( +
+

Filter by Status:

+
+ + + + + + + + + + + + + + + + + + + + +
+
+ ) + return statusesLinks +} \ No newline at end of file diff --git a/components/templates/showTestStats.js b/components/templates/showTestStats.js index 8e810f8..34475e2 100644 --- a/components/templates/showTestStats.js +++ b/components/templates/showTestStats.js @@ -33,9 +33,9 @@ export function showTestStats(passed, failed, incomplete, skipped) { )} {skipped !== 0 ? ( - + ) : ( diff --git a/package-lock.json b/package-lock.json index 8f6b17a..d9c3bac 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,25 +11,88 @@ "requires": { "cross-fetch": "3.0.5", "lru-cache": "5.1.1" + }, + "dependencies": { + "cross-fetch": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.0.5.tgz", + "integrity": "sha512-FFLcLtraisj5eteosnX1gf01qYDCOc4fDy0+euOt8Kn9YBY2NtXL/pCoYPavw24NIQkQqm5ZOLsGD5Zzj0gyew==", + "requires": { + "node-fetch": "2.6.0" + } + } } }, "@ampproject/toolbox-optimizer": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/@ampproject/toolbox-optimizer/-/toolbox-optimizer-2.4.0.tgz", - "integrity": "sha512-Bmb+eMF9/VB3H0qPdZy0V5yPSkWe5RwuGbXiMxzqYdJgmMat+NL75EtozQnlpa0uBlESnOGe7bMojm/SA1ImrA==", + "version": "2.5.3", + "resolved": "https://registry.npmjs.org/@ampproject/toolbox-optimizer/-/toolbox-optimizer-2.5.3.tgz", + "integrity": "sha512-D6j7nU02sLRaW+ZKd1UNyUESu9GVLhVrtGHQ/rORj87ZJS5s0DCpoIDbq1slKQDCDHl7RknQ3A6CVm14ihXV2A==", "requires": { - "@ampproject/toolbox-core": "^2.4.0-alpha.1", - "@ampproject/toolbox-runtime-version": "^2.4.0-alpha.1", + "@ampproject/toolbox-core": "^2.5.1", + "@ampproject/toolbox-runtime-version": "^2.5.1", "@ampproject/toolbox-script-csp": "^2.3.0", "@ampproject/toolbox-validator-rules": "^2.3.0", + "abort-controller": "3.0.0", + "cross-fetch": "3.0.4", "cssnano": "4.1.10", + "dom-serializer": "1.0.1", "domhandler": "3.0.0", "domutils": "2.1.0", "htmlparser2": "4.1.0", "lru-cache": "5.1.1", + "node-fetch": "2.6.0", "normalize-html-whitespace": "1.0.0", + "postcss": "7.0.32", "postcss-safe-parser": "4.0.2", - "terser": "4.6.13" + "terser": "4.7.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "dependencies": { + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "postcss": { + "version": "7.0.32", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", + "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "requires": { + "chalk": "^2.4.2", + "source-map": "^0.6.1", + "supports-color": "^6.1.0" + } + }, + "supports-color": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", + "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", + "requires": { + "has-flag": "^3.0.0" + } + } } }, "@ampproject/toolbox-runtime-version": { @@ -51,6 +114,16 @@ "integrity": "sha512-bS7uF+h0s5aiklc/iRaujiSsiladOsZBLrJ6QImJDXvubCAQtvE7om7ShlGSXixkMAO0OVMDWyuwLlEy8V1Ing==", "requires": { "cross-fetch": "3.0.5" + }, + "dependencies": { + "cross-fetch": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.0.5.tgz", + "integrity": "sha512-FFLcLtraisj5eteosnX1gf01qYDCOc4fDy0+euOt8Kn9YBY2NtXL/pCoYPavw24NIQkQqm5ZOLsGD5Zzj0gyew==", + "requires": { + "node-fetch": "2.6.0" + } + } } }, "@babel/code-frame": { @@ -1509,9 +1582,9 @@ } }, "@next/react-dev-overlay": { - "version": "9.4.4", - "resolved": "https://registry.npmjs.org/@next/react-dev-overlay/-/react-dev-overlay-9.4.4.tgz", - "integrity": "sha512-UUAa8RbH7BeWDPCkagIkR4sUsyvTPlEdFrPZ9kGjf2+p8HkLHpcVY7y+XRnNvJQs4PsAF0Plh20FBz7t54U2iQ==", + "version": "9.5.0", + "resolved": "https://registry.npmjs.org/@next/react-dev-overlay/-/react-dev-overlay-9.5.0.tgz", + "integrity": "sha512-Ds+sQnyeYWq07QIJ7bbYE6WI6ZdPSa+3S+cysvdy0zLLaHemp/Ew8OteXvgNtZYo9OGYBbngxHVUORDcQHaCng==", "requires": { "@babel/code-frame": "7.8.3", "ally.js": "1.4.1", @@ -1593,9 +1666,9 @@ } }, "@next/react-refresh-utils": { - "version": "9.4.4", - "resolved": "https://registry.npmjs.org/@next/react-refresh-utils/-/react-refresh-utils-9.4.4.tgz", - "integrity": "sha512-9nKENeWRI6kQk44TbeqleIVtNLfcS3klVUepzl/ZCqzR5Bi06uqBCD277hdVvG/wL1pxA+R/pgJQLqnF5E2wPQ==" + "version": "9.5.0", + "resolved": "https://registry.npmjs.org/@next/react-refresh-utils/-/react-refresh-utils-9.5.0.tgz", + "integrity": "sha512-YaLBsyAQuEDTyzEuTzg/VwwSqpfNkJ5fiQNIBSGY+UmSpg1+1OHIyMRURzLKO1K7ad3w6kZ+ykgGcMLToR33EQ==" }, "@nodelib/fs.stat": { "version": "1.1.3", @@ -2330,6 +2403,14 @@ "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", "dev": true }, + "abort-controller": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", + "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", + "requires": { + "event-target-shim": "^5.0.0" + } + }, "accepts": { "version": "1.3.7", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", @@ -3090,14 +3171,14 @@ } }, "browserslist": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.12.0.tgz", - "integrity": "sha512-UH2GkcEDSI0k/lRkuDSzFl9ZZ87skSy9w2XAn1MsZnL+4c4rqbBd3e82UWHbYDpztABrPBhZsTEeuxVfHppqDg==", + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.13.0.tgz", + "integrity": "sha512-MINatJ5ZNrLnQ6blGvePd/QOz9Xtu+Ne+x29iQSCHfkU5BugKVJwZKn/iiL8UbpIpa3JhviKjz+XxMo0m2caFQ==", "requires": { - "caniuse-lite": "^1.0.30001043", - "electron-to-chromium": "^1.3.413", - "node-releases": "^1.1.53", - "pkg-up": "^2.0.0" + "caniuse-lite": "^1.0.30001093", + "electron-to-chromium": "^1.3.488", + "escalade": "^3.0.1", + "node-releases": "^1.1.58" } }, "buffer": { @@ -3276,9 +3357,9 @@ } }, "caniuse-lite": { - "version": "1.0.30001105", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001105.tgz", - "integrity": "sha512-JupOe6+dGMr7E20siZHIZQwYqrllxotAhiaej96y6x00b/48rPt42o+SzOSCPbrpsDWvRja40Hwrj0g0q6LZJg==" + "version": "1.0.30001107", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001107.tgz", + "integrity": "sha512-86rCH+G8onCmdN4VZzJet5uPELII59cUzDphko3thQFgAQG1RNa+sVLDoALIhRYmflo5iSIzWY3vu1XTWtNMQQ==" }, "chain-function": { "version": "1.0.1", @@ -3743,11 +3824,19 @@ } }, "cross-fetch": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.0.5.tgz", - "integrity": "sha512-FFLcLtraisj5eteosnX1gf01qYDCOc4fDy0+euOt8Kn9YBY2NtXL/pCoYPavw24NIQkQqm5ZOLsGD5Zzj0gyew==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.0.4.tgz", + "integrity": "sha512-MSHgpjQqgbT/94D4CyADeNoYh52zMkCX4pcJvPP5WqPsLFMKjr2TCMg381ox5qI0ii2dPwaLx/00477knXqXVw==", "requires": { - "node-fetch": "2.6.0" + "node-fetch": "2.6.0", + "whatwg-fetch": "3.0.0" + }, + "dependencies": { + "whatwg-fetch": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.0.0.tgz", + "integrity": "sha512-9GSJUgz1D4MfyKU7KRqwOjXCXTqWdFNvEr7eUBYchQiVc744mqK/MzXPNR2WsPkmkOa4ywfg8C2n8h+13Bey1Q==" + } } }, "cross-spawn": { @@ -3896,6 +3985,22 @@ "nth-check": "^1.0.2" }, "dependencies": { + "dom-serializer": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.2.2.tgz", + "integrity": "sha512-2/xPb3ORsQ42nHYiSunXkDjPLBaEj/xTwUO4B7XCZQTRk7EBtTOPaygh10YAAh2OI1Qrp6NWfpAhzswj0ydt9g==", + "requires": { + "domelementtype": "^2.0.1", + "entities": "^2.0.0" + }, + "dependencies": { + "domelementtype": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.0.1.tgz", + "integrity": "sha512-5HOHUDsYZWV8FGWN0Njbr/Rn7f/eWSQi1v7+HsUVwXgn8nWWlL64zKDkS0n8ZmQ3mlWOMuXOnR+7Nx/5tMO5AQ==" + } + } + }, "domutils": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.7.0.tgz", @@ -4108,6 +4213,119 @@ } } }, + "cssnano-preset-simple": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/cssnano-preset-simple/-/cssnano-preset-simple-1.1.4.tgz", + "integrity": "sha512-EYKDo65W+AxMViUijv/hvhbEnxUjmu3V7omcH1MatPOwjRLrAgVArUOE8wTUyc1ePFEtvV8oCT4/QSRJDorm/A==", + "requires": { + "postcss": "^7.0.32" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "dependencies": { + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "postcss": { + "version": "7.0.32", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", + "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "requires": { + "chalk": "^2.4.2", + "source-map": "^0.6.1", + "supports-color": "^6.1.0" + } + }, + "supports-color": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", + "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "cssnano-simple": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/cssnano-simple/-/cssnano-simple-1.0.5.tgz", + "integrity": "sha512-NJjx2Er1C3pa75v1GwMKm0w6xAp1GsW2Ql1As4CWPNFxTgYFN5e8wblYeHfna13sANAhyIdSIPqKJjBO4CU5Eg==", + "requires": { + "cssnano-preset-simple": "1.1.4", + "postcss": "^7.0.32" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "dependencies": { + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "postcss": { + "version": "7.0.32", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", + "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", + "requires": { + "chalk": "^2.4.2", + "source-map": "^0.6.1", + "supports-color": "^6.1.0" + } + }, + "supports-color": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", + "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, "cssnano-util-get-arguments": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/cssnano-util-get-arguments/-/cssnano-util-get-arguments-4.0.0.tgz", @@ -4483,11 +4701,12 @@ } }, "dom-serializer": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.2.2.tgz", - "integrity": "sha512-2/xPb3ORsQ42nHYiSunXkDjPLBaEj/xTwUO4B7XCZQTRk7EBtTOPaygh10YAAh2OI1Qrp6NWfpAhzswj0ydt9g==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-1.0.1.tgz", + "integrity": "sha512-1Aj1Qy3YLbdslkI75QEOfdp9TkQ3o8LRISAzxOibjBs/xWwr1WxZFOQphFkZuepHFGo+kB8e5FVJSS0faAJ4Rw==", "requires": { "domelementtype": "^2.0.1", + "domhandler": "^3.0.0", "entities": "^2.0.0" }, "dependencies": { @@ -4533,6 +4752,15 @@ "domhandler": "^3.0.0" }, "dependencies": { + "dom-serializer": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.2.2.tgz", + "integrity": "sha512-2/xPb3ORsQ42nHYiSunXkDjPLBaEj/xTwUO4B7XCZQTRk7EBtTOPaygh10YAAh2OI1Qrp6NWfpAhzswj0ydt9g==", + "requires": { + "domelementtype": "^2.0.1", + "entities": "^2.0.0" + } + }, "domelementtype": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.0.1.tgz", @@ -4595,9 +4823,9 @@ "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" }, "electron-to-chromium": { - "version": "1.3.504", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.504.tgz", - "integrity": "sha512-yOXnuPaaLAIZUVuXHYDCo3EeaiEfbFgYWCPH1tBMp+jznCq/zQYKnf6HmkKBmLJ0VES81avl18JZO1lx/XAHOw==" + "version": "1.3.509", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.509.tgz", + "integrity": "sha512-cN4lkjNRuTG8rtAqTOVgwpecEC2kbKA04PG6YijcKGHK/kD0xLjiqExcAOmLUwtXZRF8cBeam2I0VZcih919Ug==" }, "elliptic": { "version": "6.5.3", @@ -4755,6 +4983,11 @@ "ext": "^1.1.2" } }, + "escalade": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.0.2.tgz", + "integrity": "sha512-gPYAU37hYCUhW5euPeR+Y74F7BL+IBsV93j5cvGriSaD1aG6MGsqsV1yamRdrWrb2j3aiZvb0X+UBOWpx3JWtQ==" + }, "escape-html": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", @@ -4818,6 +5051,11 @@ "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" }, + "event-target-shim": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", + "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==" + }, "events": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/events/-/events-3.2.0.tgz", @@ -5166,137 +5404,6 @@ "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=" }, - "fork-ts-checker-webpack-plugin": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/fork-ts-checker-webpack-plugin/-/fork-ts-checker-webpack-plugin-3.1.1.tgz", - "integrity": "sha512-DuVkPNrM12jR41KM2e+N+styka0EgLkTnXmNcXdgOM37vtGeY+oCBK/Jx0hzSeEU6memFCtWb4htrHPMDfwwUQ==", - "requires": { - "babel-code-frame": "^6.22.0", - "chalk": "^2.4.1", - "chokidar": "^3.3.0", - "micromatch": "^3.1.10", - "minimatch": "^3.0.4", - "semver": "^5.6.0", - "tapable": "^1.0.0", - "worker-rpc": "^0.1.0" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "requires": { - "color-convert": "^1.9.0" - } - }, - "anymatch": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", - "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", - "requires": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - } - }, - "binary-extensions": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.1.0.tgz", - "integrity": "sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ==" - }, - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "requires": { - "fill-range": "^7.0.1" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "chokidar": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.4.1.tgz", - "integrity": "sha512-TQTJyr2stihpC4Sya9hs2Xh+O2wf+igjL36Y75xx2WdHuiICcn/XJza46Jwt0eT5hVpQOzo3FpY3cj3RVYLX0g==", - "requires": { - "anymatch": "~3.1.1", - "braces": "~3.0.2", - "fsevents": "~2.1.2", - "glob-parent": "~5.1.0", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.4.0" - } - }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "requires": { - "to-regex-range": "^5.0.1" - } - }, - "fsevents": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", - "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", - "optional": true - }, - "glob-parent": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", - "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", - "requires": { - "is-glob": "^4.0.1" - } - }, - "is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "requires": { - "binary-extensions": "^2.0.0" - } - }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" - }, - "readdirp": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.4.0.tgz", - "integrity": "sha512-0xe001vZBnJEK+uKcj8qOhyAKPzIT+gStxWr3LCB0DwcXR5NZJ3IaC+yGnHCYzB/S7ov3m3EEbZI2zeNvX+hGQ==", - "requires": { - "picomatch": "^2.2.1" - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "requires": { - "has-flag": "^3.0.0" - } - }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "requires": { - "is-number": "^7.0.0" - } - } - } - }, "forwarded": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", @@ -6587,11 +6694,6 @@ "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" }, - "microevent.ts": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/microevent.ts/-/microevent.ts-0.1.1.tgz", - "integrity": "sha512-jo1OfR4TaEwd5HOrt5+tAZ9mqT4jmpNAusXtyfNzqVm9uiSYFZlKM1wYL4oU7azZW/PxQW53wM0S6OR1JHNa2g==" - }, "micromatch": { "version": "3.1.10", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", @@ -6838,9 +6940,9 @@ } }, "native-url": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/native-url/-/native-url-0.3.1.tgz", - "integrity": "sha512-VL0XRW8nNBdSpxqZCbLJKrLHmIMn82FZ8pJzriJgyBmErjdEtrUX6eZAJbtHjlkMooEWUV+EtJ0D5tOP3+1Piw==", + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/native-url/-/native-url-0.3.4.tgz", + "integrity": "sha512-6iM8R99ze45ivyH8vybJ7X0yekIcPf5GgLV5K0ENCbmRcaRIDoj37BC8iLEmaaBfqqb8enuZ5p0uhY+lVAbAcA==", "requires": { "querystring": "^0.2.0" } @@ -6884,11 +6986,11 @@ "integrity": "sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw==" }, "next": { - "version": "9.4.4", - "resolved": "https://registry.npmjs.org/next/-/next-9.4.4.tgz", - "integrity": "sha512-ZT8bU2SAv5jkFQ+y8py+Rl5RJRJ6DnZDS+VUnB1cIscmtmUhDi7LYED7pYm4MCKkYhPbEEM1Lbpo7fnoZJGWNQ==", + "version": "9.5.0", + "resolved": "https://registry.npmjs.org/next/-/next-9.5.0.tgz", + "integrity": "sha512-kb6QnrbMyS/h4bvryZSQKgRqLtFVL2NZQed4jxrFZ15yxtwdsSCf5+LNfS7bcpVxh7HeD5Ddwh55l9+nOGkEBQ==", "requires": { - "@ampproject/toolbox-optimizer": "2.4.0", + "@ampproject/toolbox-optimizer": "2.5.3", "@babel/code-frame": "7.8.3", "@babel/core": "7.7.7", "@babel/plugin-proposal-class-properties": "7.8.3", @@ -6906,25 +7008,25 @@ "@babel/preset-typescript": "7.9.0", "@babel/runtime": "7.9.6", "@babel/types": "7.9.6", - "@next/react-dev-overlay": "9.4.4", - "@next/react-refresh-utils": "9.4.4", + "@next/react-dev-overlay": "9.5.0", + "@next/react-refresh-utils": "9.5.0", "babel-plugin-syntax-jsx": "6.18.0", "babel-plugin-transform-define": "2.0.0", "babel-plugin-transform-react-remove-prop-types": "0.4.24", - "browserslist": "4.12.0", + "browserslist": "4.13.0", "cacache": "13.0.1", "chokidar": "2.1.8", "css-loader": "3.5.3", + "cssnano-simple": "1.0.5", "find-cache-dir": "3.3.1", - "fork-ts-checker-webpack-plugin": "3.1.1", "jest-worker": "24.9.0", "loader-utils": "2.0.0", "mini-css-extract-plugin": "0.8.0", "mkdirp": "0.5.3", - "native-url": "0.3.1", + "native-url": "0.3.4", "neo-async": "2.6.1", "pnp-webpack-plugin": "1.6.4", - "postcss": "7.0.29", + "postcss": "7.0.32", "prop-types": "15.7.2", "prop-types-exact": "1.2.0", "react-is": "16.13.1", @@ -6937,7 +7039,7 @@ "use-subscription": "1.4.1", "watchpack": "2.0.0-beta.13", "web-vitals": "0.2.1", - "webpack": "4.43.0", + "webpack": "4.44.0", "webpack-sources": "1.4.3" }, "dependencies": { @@ -7082,9 +7184,9 @@ } }, "postcss": { - "version": "7.0.29", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.29.tgz", - "integrity": "sha512-ba0ApvR3LxGvRMMiUa9n0WR4HjzcYm7tS+ht4/2Nd0NLtHpPIH77fuB9Xh1/yJVz9O/E/95Y/dn8ygWsyffXtw==", + "version": "7.0.32", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz", + "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", @@ -7100,14 +7202,14 @@ } }, "postcss-modules-local-by-default": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/postcss-modules-local-by-default/-/postcss-modules-local-by-default-3.0.2.tgz", - "integrity": "sha512-jM/V8eqM4oJ/22j0gx4jrp63GSvDH6v86OqyTHHUvk4/k1vceipZsaymiZ5PvocqZOl5SFHiFJqjs3la0wnfIQ==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/postcss-modules-local-by-default/-/postcss-modules-local-by-default-3.0.3.tgz", + "integrity": "sha512-e3xDq+LotiGesympRlKNgaJ0PCzoUIdpH0dj47iWAui/kyTgh3CiAr1qP54uodmJhl6p9rN6BoNcdEDVJx9RDw==", "requires": { "icss-utils": "^4.1.1", - "postcss": "^7.0.16", + "postcss": "^7.0.32", "postcss-selector-parser": "^6.0.2", - "postcss-value-parser": "^4.0.0" + "postcss-value-parser": "^4.1.0" } }, "postcss-modules-scope": { @@ -7248,9 +7350,9 @@ } }, "node-releases": { - "version": "1.1.59", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.59.tgz", - "integrity": "sha512-H3JrdUczbdiwxN5FuJPyCHnGHIFqQ0wWxo+9j1kAXAzqNMAHlo+4I/sYYxpyK0irQ73HgdiyzD32oqQDcU2Osw==" + "version": "1.1.60", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.60.tgz", + "integrity": "sha512-gsO4vjEdQaTusZAEebUWp2a5d7dF5DYoIpDG7WySnk7BuZDW+GPpHXoXXuYawRBr/9t5q54tirPz79kFIWg4dA==" }, "nopt": { "version": "4.0.3", @@ -7725,14 +7827,6 @@ } } }, - "pkg-up": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/pkg-up/-/pkg-up-2.0.0.tgz", - "integrity": "sha1-yBmscoBZpGHKscOImivjxJoATX8=", - "requires": { - "find-up": "^2.1.0" - } - }, "platform": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/platform/-/platform-1.3.3.tgz", @@ -11251,9 +11345,9 @@ } }, "terser": { - "version": "4.6.13", - "resolved": "https://registry.npmjs.org/terser/-/terser-4.6.13.tgz", - "integrity": "sha512-wMvqukYgVpQlymbnNbabVZbtM6PN63AzqexpwJL8tbh/mRT9LE5o+ruVduAGL7D6Fpjl+Q+06U5I9Ul82odAhw==", + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-4.7.0.tgz", + "integrity": "sha512-Lfb0RiZcjRDXCC3OSHJpEkxJ9Qeqs6mp2v4jf2MHfy8vGERmVDuvjXdd/EnP5Deme5F2yBRBymKmKHCBg2echw==", "requires": { "commander": "^2.20.0", "source-map": "~0.6.1", @@ -11944,9 +12038,9 @@ "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==" }, "webpack": { - "version": "4.43.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.43.0.tgz", - "integrity": "sha512-GW1LjnPipFW2Y78OOab8NJlCflB7EFskMih2AHdvjbpKMeDJqEgSx24cXXXiPS65+WSwVyxtDsJH6jGX2czy+g==", + "version": "4.44.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.44.0.tgz", + "integrity": "sha512-wAuJxK123sqAw31SpkPiPW3iKHgFUiKvO7E7UZjtdExcsRe3fgav4mvoMM7vvpjLHVoJ6a0Mtp2fzkoA13e0Zw==", "requires": { "@webassemblyjs/ast": "1.9.0", "@webassemblyjs/helper-module-context": "1.9.0", @@ -11956,7 +12050,7 @@ "ajv": "^6.10.2", "ajv-keywords": "^3.4.1", "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^4.1.0", + "enhanced-resolve": "^4.3.0", "eslint-scope": "^4.0.3", "json-parse-better-errors": "^1.0.2", "loader-runner": "^2.4.0", @@ -11969,7 +12063,7 @@ "schema-utils": "^1.0.0", "tapable": "^1.1.3", "terser-webpack-plugin": "^1.4.3", - "watchpack": "^1.6.1", + "watchpack": "^1.7.4", "webpack-sources": "^1.4.1" }, "dependencies": { @@ -12072,11 +12166,11 @@ } }, "watchpack": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.7.2.tgz", - "integrity": "sha512-ymVbbQP40MFTp+cNMvpyBpBtygHnPzPkHqoIwRRj/0B8KhqQwV8LaKjtbaxF2lK4vl8zN9wCxS46IFCU5K4W0g==", + "version": "1.7.4", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.7.4.tgz", + "integrity": "sha512-aWAgTW4MoSJzZPAicljkO1hsi1oKj/RRq/OJQh2PKI2UKL04c2Bs+MBOB+BBABHTXJpf9mCwHN7ANCvYsvY2sg==", "requires": { - "chokidar": "^3.4.0", + "chokidar": "^3.4.1", "graceful-fs": "^4.1.2", "neo-async": "^2.5.0", "watchpack-chokidar2": "^2.0.0" @@ -12134,14 +12228,6 @@ "errno": "~0.1.7" } }, - "worker-rpc": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/worker-rpc/-/worker-rpc-0.1.1.tgz", - "integrity": "sha512-P1WjMrUB3qgJNI9jfmpZ/htmBEjFh//6l/5y8SD9hg1Ef5zTTVVoRjTrTEzPrNBQvmhMxkoTsjOXN10GWU7aCg==", - "requires": { - "microevent.ts": "~0.1.1" - } - }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", diff --git a/package.json b/package.json index d48ff3f..4928de4 100755 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "immer": "^4.0.2", "isomorphic-unfetch": "^3.0.0", "material-ui": "^0.20.2", - "next": "^9.4.1", + "next": "^9.5.0", "next-redux-wrapper": "^4.0.1", "react": "^16.12.0", "react-dom": "^16.13.1", diff --git a/pages/tests/[testsByRunId].tsx b/pages/tests/[testsByRunId].tsx index 61e5d13..56c7bde 100644 --- a/pages/tests/[testsByRunId].tsx +++ b/pages/tests/[testsByRunId].tsx @@ -2,7 +2,7 @@ import React from "react" import fetch from "isomorphic-unfetch" import { makeStyles } from "@material-ui/core/styles" import { SuiteAndTest } from "../index" -import { BasePage, ListOfSuites } from "../../components/templates" +import { BasePage, ListOfSuites, showAllStatusesLinks } from "../../components/templates" import { Grid, Paper, @@ -10,7 +10,6 @@ import { Typography, Link, Breadcrumbs, - Button, } from "@material-ui/core" const useStyles = makeStyles(theme => ({ @@ -83,14 +82,9 @@ function Tests(props: Props) { {props.test_history[0].test_type} {" "} run - + {showAllStatusesLinks(props.test_history[0].test_run_id)} + {/* https://stackoverflow.com/questions/41181513/remove-items-from-a-dynamic-array */} {props.test_history}
From 588ebb5a8bce55951d8b71e57f9b6fae25487515 Mon Sep 17 00:00:00 2001 From: Alex Pishcheiko Date: Tue, 28 Jul 2020 18:23:07 +0100 Subject: [PATCH 02/11] filter by status - buttons and hitting the endpoint --- components/templates/showStatusIcon.js | 33 -------- pages/tests/[testsByRunId].tsx | 101 ++++++++++++++++++++++++- 2 files changed, 97 insertions(+), 37 deletions(-) diff --git a/components/templates/showStatusIcon.js b/components/templates/showStatusIcon.js index 17cd92c..63c13b7 100644 --- a/components/templates/showStatusIcon.js +++ b/components/templates/showStatusIcon.js @@ -73,37 +73,4 @@ export function showStatusText(status) { ) } return statusIcon -} - - -export function showAllStatusesLinks(testRunId) { - - let statusesLinks = ( -
-

Filter by Status:

-
- - - - - - - - - - - - - - - - - - - - -
-
- ) - return statusesLinks } \ No newline at end of file diff --git a/pages/tests/[testsByRunId].tsx b/pages/tests/[testsByRunId].tsx index 56c7bde..aa0a4a4 100644 --- a/pages/tests/[testsByRunId].tsx +++ b/pages/tests/[testsByRunId].tsx @@ -1,8 +1,8 @@ -import React from "react" +import React, { useState, useEffect } from "react" import fetch from "isomorphic-unfetch" import { makeStyles } from "@material-ui/core/styles" import { SuiteAndTest } from "../index" -import { BasePage, ListOfSuites, showAllStatusesLinks } from "../../components/templates" +import { BasePage, ListOfSuites } from "../../components/templates" import { Grid, Paper, @@ -10,6 +10,7 @@ import { Typography, Link, Breadcrumbs, + Button, } from "@material-ui/core" const useStyles = makeStyles(theme => ({ @@ -36,6 +37,42 @@ const useStyles = makeStyles(theme => ({ marginLeft: "80%", color: "#353690", }, + passedSelected: { + backgroundColor: "#c6e1d4", + marginLeft:"10px", + }, + failedSelected: { + backgroundColor: "#e1c6c6", + marginLeft:"10px", + }, + incompleteSelected: { + backgroundColor: "#e1d4c6", + marginLeft:"10px", + }, + skippedSelected: { + backgroundColor: "#e3e1e1", + marginLeft:"10px", + }, + passedNotSelected: { + color: "#c6e1d4", + border: "#c6e1d4", + marginLeft:"10px", + }, + failedNotSelected: { + color: "#e1c6c6", + border: "#e1c6c6", + marginLeft:"10px", + }, + incompleteNotSelected: { + color: "#e1d4c6", + border: "#e1d4c6", + marginLeft:"10px", + }, + skippedNotSelected: { + color: "#e3e1e1", + border: "#e3e1e1", + marginLeft:"10px", + }, })) type Props = { @@ -45,6 +82,36 @@ type Props = { function Tests(props: Props) { const classes = useStyles(props) + let statusArrayForEndpoint + const [selectedStatus, setSelectedStatus] = useState(["1", "2", "3", "5"]) + + async function handleStatusFilter(status, testRunId) { + if(selectedStatus.includes(status)) { // to remove the item, if it was selected already and user clicks again + setSelectedStatus(selectedStatus.filter(item => item !== status)) + // we need to set the value for endpoint separately, + // cause selectedStatus state doesn't update immediately and it will have a wrong value at this stage + statusArrayForEndpoint = (selectedStatus.filter(item => item !== status)).toString() + } + else { + setSelectedStatus(selectedStatus.concat(status)) // to add status to array + statusArrayForEndpoint = (selectedStatus.concat(status)).toString() + } + + // GET request using fetch with async/await + const requestOptions = { + method: "GET", + headers: { "Content-Type": "application/json" }, + } + console.log(requestOptions) + + const response = await fetch( + `${process.env.publicDeltaCore}/api/v1/tests_history/test_status/${statusArrayForEndpoint}/test_run/${testRunId}`, + requestOptions + ) + const data = await response.json() + + } + return ( Δ | Tests @@ -83,8 +150,34 @@ function Tests(props: Props) { {" "} run - {showAllStatusesLinks(props.test_history[0].test_run_id)} - {/* https://stackoverflow.com/questions/41181513/remove-items-from-a-dynamic-array */} +
+

Filter by Status:

+ + + + +
{props.test_history} From 950418081041eeaf42e08f269a6aa5e18dc9938e Mon Sep 17 00:00:00 2001 From: Alex Pishcheiko Date: Tue, 28 Jul 2020 18:33:41 +0100 Subject: [PATCH 03/11] renaming expansionPanel to Accordion (material-ui requirement) --- components/templates/ListOfSuites.tsx | 18 +++++------ components/templates/Test.tsx | 12 ++++---- components/templates/TestExpandablePanels.tsx | 16 +++++----- components/templates/TestHistory.tsx | 30 +++++++++---------- 4 files changed, 38 insertions(+), 38 deletions(-) diff --git a/components/templates/ListOfSuites.tsx b/components/templates/ListOfSuites.tsx index f605507..c95f83f 100644 --- a/components/templates/ListOfSuites.tsx +++ b/components/templates/ListOfSuites.tsx @@ -7,9 +7,9 @@ import { } from "../../components/templates" import { Typography, - ExpansionPanel, - ExpansionPanelSummary, - ExpansionPanelDetails, + Accordion, + AccordionDetails, + AccordionSummary, List, ListItem, } from "@material-ui/core" @@ -98,13 +98,13 @@ export const ListOfSuites = function(props: Props) { {children.map(testRun => (
{testRun.test_suites.map(suite => ( - - }> + }> {showStatusIcon(suite.test_suite_status)} {suite.name} @@ -115,8 +115,8 @@ export const ListOfSuites = function(props: Props) { suite.tests_incomplete, suite.tests_skipped )} - - + + {/* Expandable tests list for each suite */} {suite.tests.map(test => ( @@ -143,8 +143,8 @@ export const ListOfSuites = function(props: Props) { ))} - - + + ))}
))} diff --git a/components/templates/Test.tsx b/components/templates/Test.tsx index 543d60f..d364a54 100644 --- a/components/templates/Test.tsx +++ b/components/templates/Test.tsx @@ -2,8 +2,8 @@ import React from "react" import { makeStyles } from "@material-ui/core/styles" import { Paper, Typography, Button } from "@material-ui/core" import { - TestErrorMessageExpansionPanel, - TestMediaExpansionPanel, + TestErrorMessageAccordion, + TestMediaAccordion, } from "./TestExpandablePanels" import { TestResolution } from "./TestResolution" import { showStatusText, HistoricalTests } from "." @@ -138,13 +138,13 @@ export const TestExpanded = function(props: TestProps) { - + {children} - + {children.media ? ( // check if there is any media for this test - + {children} - + ) : (
)} diff --git a/components/templates/TestExpandablePanels.tsx b/components/templates/TestExpandablePanels.tsx index 0cbebda..830afed 100644 --- a/components/templates/TestExpandablePanels.tsx +++ b/components/templates/TestExpandablePanels.tsx @@ -1,8 +1,8 @@ import React from "react" import ExpandMoreIcon from "@material-ui/icons/ExpandMore" -import MuiExpansionPanel from "@material-ui/core/ExpansionPanel" -import MuiExpansionPanelSummary from "@material-ui/core/ExpansionPanelSummary" -import MuiExpansionPanelDetails from "@material-ui/core/ExpansionPanelDetails" +import MuiAccordion from "@material-ui/core/Accordion" +import MuiAccordionSummary from "@material-ui/core/AccordionSummary" +import MuiAccordionDetails from "@material-ui/core/AccordionDetails" import { Typography, List, @@ -29,7 +29,7 @@ const ExpandablePanel = withStyles({ }, }, expanded: {}, -})(MuiExpansionPanel) +})(MuiAccordion) const CollapsedLineSummary = withStyles({ root: { @@ -46,20 +46,20 @@ const CollapsedLineSummary = withStyles({ }, }, expanded: {}, -})(MuiExpansionPanelSummary) +})(MuiAccordionSummary) const PanelDetails = withStyles(theme => ({ root: { padding: theme.spacing(2), width: "100%", }, -}))(MuiExpansionPanelDetails) +}))(MuiAccordionDetails) interface TestProps { children: any } -export const TestErrorMessageExpansionPanel = function(props: TestProps) { +export const TestErrorMessageAccordion = function(props: TestProps) { const { children } = props const [expandedErrorPanel, setExpandedErrorPanel] = React.useState< @@ -113,7 +113,7 @@ export const TestErrorMessageExpansionPanel = function(props: TestProps) { ) } -export const TestMediaExpansionPanel = function(props: TestProps) { +export const TestMediaAccordion = function(props: TestProps) { const { children } = props const [mediaExpandedPanel, setMediaExpandedPanel] = React.useState< diff --git a/components/templates/TestHistory.tsx b/components/templates/TestHistory.tsx index b5fdb3f..c37bd75 100644 --- a/components/templates/TestHistory.tsx +++ b/components/templates/TestHistory.tsx @@ -4,17 +4,17 @@ import ExpandMoreIcon from "@material-ui/icons/ExpandMore" import Container from "@material-ui/core/Container" import { Typography, - ExpansionPanel, - ExpansionPanelSummary, - ExpansionPanelDetails, + Accordion, + AccordionDetails, + AccordionSummary, Tooltip, } from "@material-ui/core" import { showStatusText, showResolutionText, showDateText, - TestErrorMessageExpansionPanel, - TestMediaExpansionPanel, + TestErrorMessageAccordion, + TestMediaAccordion, } from "." const fetcher = url => fetch(url).then(res => res.json()) @@ -67,13 +67,13 @@ export const HistoricalTests = function(props: TestProps) { {loading ? "Loading historical tests..." : data.map(test => ( - - }> + }> {showStatusText(test.status)}{" "} {showDateText(test.end_datetime)} @@ -94,8 +94,8 @@ export const HistoricalTests = function(props: TestProps) {
)}
-
- + + {test.error_type ? (
)} {test.trace ? ( - + {test} - + ) : (
Happy days :)
)} {test.media ? ( - + {test} - + ) : (
)} - - + + ))} ) From ea0986023f5791e5a3b3052c05295c9c2a266511 Mon Sep 17 00:00:00 2001 From: Alex Pishcheiko Date: Tue, 28 Jul 2020 20:38:10 +0100 Subject: [PATCH 04/11] fixing unit test, adding styling to status filters --- pages/tests/[testsByRunId].tsx | 26 +++++++++++-------- tests/end_to_end/test/specs/webdriver/core.ts | 4 +-- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/pages/tests/[testsByRunId].tsx b/pages/tests/[testsByRunId].tsx index aa0a4a4..26a7e45 100644 --- a/pages/tests/[testsByRunId].tsx +++ b/pages/tests/[testsByRunId].tsx @@ -55,22 +55,22 @@ const useStyles = makeStyles(theme => ({ }, passedNotSelected: { color: "#c6e1d4", - border: "#c6e1d4", + border: "1px #c6e1d4 solid", marginLeft:"10px", }, failedNotSelected: { color: "#e1c6c6", - border: "#e1c6c6", + border: "1px #e1c6c6 solid", marginLeft:"10px", }, incompleteNotSelected: { color: "#e1d4c6", - border: "#e1d4c6", + border: "1px #e1d4c6 solid", marginLeft:"10px", }, skippedNotSelected: { color: "#e3e1e1", - border: "#e3e1e1", + border: "1px #e3e1e1 solid", marginLeft:"10px", }, })) @@ -86,16 +86,20 @@ function Tests(props: Props) { const [selectedStatus, setSelectedStatus] = useState(["1", "2", "3", "5"]) async function handleStatusFilter(status, testRunId) { - if(selectedStatus.includes(status)) { // to remove the item, if it was selected already and user clicks again + let previousArray = selectedStatus + if(selectedStatus.includes(status) && selectedStatus.length!=1) { // to remove the item, if it was selected already and user clicks again setSelectedStatus(selectedStatus.filter(item => item !== status)) // we need to set the value for endpoint separately, // cause selectedStatus state doesn't update immediately and it will have a wrong value at this stage statusArrayForEndpoint = (selectedStatus.filter(item => item !== status)).toString() } - else { - setSelectedStatus(selectedStatus.concat(status)) // to add status to array + else if (!selectedStatus.includes(status)) { // to add status to array + setSelectedStatus(selectedStatus.concat(status)) statusArrayForEndpoint = (selectedStatus.concat(status)).toString() } + else { // if user tries to deselect all filters - don't allow and show previous result + statusArrayForEndpoint = previousArray.toString() + } // GET request using fetch with async/await const requestOptions = { @@ -156,26 +160,26 @@ function Tests(props: Props) { selectedStatus.includes("1") ? classes.passedSelected : classes.passedNotSelected - }> passed + }>passed {props.test_history} diff --git a/tests/end_to_end/test/specs/webdriver/core.ts b/tests/end_to_end/test/specs/webdriver/core.ts index bd4ed5d..2ac330f 100644 --- a/tests/end_to_end/test/specs/webdriver/core.ts +++ b/tests/end_to_end/test/specs/webdriver/core.ts @@ -35,8 +35,8 @@ describe("Main Delta Reporter", () => { $("p=Delta Reporter").click() $("span=End to End").waitForClickable({ timeout: 3000 }); $("span=End to End").click() - $("span=Show only Failed Tests").waitForClickable({ timeout: 3000 }); - $("span=Show only Failed Tests").click() + $("span=failed").waitForClickable({ timeout: 3000 }); + $("span=failed").click() browser.checkDocument() }) From ad3d6c033880a01c1746d0ac400fcf898fc080f6 Mon Sep 17 00:00:00 2001 From: Alex Pishcheiko Date: Wed, 29 Jul 2020 09:14:27 +0100 Subject: [PATCH 05/11] fixing unit test --- pages/tests/[testsByRunId].tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/tests/[testsByRunId].tsx b/pages/tests/[testsByRunId].tsx index 26a7e45..9e8b07b 100644 --- a/pages/tests/[testsByRunId].tsx +++ b/pages/tests/[testsByRunId].tsx @@ -1,4 +1,4 @@ -import React, { useState, useEffect } from "react" +import React, { useState } from "react" import fetch from "isomorphic-unfetch" import { makeStyles } from "@material-ui/core/styles" import { SuiteAndTest } from "../index" From c4846bbfe887978f2427af49243d1b207060b307 Mon Sep 17 00:00:00 2001 From: Alex Pishcheiko Date: Thu, 30 Jul 2020 15:44:48 +0100 Subject: [PATCH 06/11] fixing page refresh for filtering --- components/templates/DeltaViewForLaunches.tsx | 4 +- pages/launches/[launchesByProjectId].tsx | 8 +- pages/tests/[testsByRunId].tsx | 202 +++++++++++------- 3 files changed, 134 insertions(+), 80 deletions(-) diff --git a/components/templates/DeltaViewForLaunches.tsx b/components/templates/DeltaViewForLaunches.tsx index a2f34c1..89cb4a1 100644 --- a/components/templates/DeltaViewForLaunches.tsx +++ b/components/templates/DeltaViewForLaunches.tsx @@ -6,7 +6,7 @@ import Router from "next/router" let pyramidData = [] let roseData = [] -export function testRunButtonsDeltaView(testRunStats: any) { +export function testRunButtonsDefaultView(testRunStats: any) { return testRunStats.map(testRun => ( - - - - - {props.test_history} +
+

+ {" "} + Filter by Status:{" "} +

+ + + + +
+ {data} From 80c0498277cc902862ea827907665b2d37e446ef Mon Sep 17 00:00:00 2001 From: Alex Pishcheiko Date: Thu, 30 Jul 2020 17:44:50 +0100 Subject: [PATCH 07/11] making stats work with filtering --- components/templates/ListOfSuites.tsx | 16 ++++++++++++++-- components/templates/showTestStats.js | 8 +++++++- pages/tests/[testsByRunId].tsx | 10 ++++++---- 3 files changed, 27 insertions(+), 7 deletions(-) diff --git a/components/templates/ListOfSuites.tsx b/components/templates/ListOfSuites.tsx index c95f83f..3c17a0c 100644 --- a/components/templates/ListOfSuites.tsx +++ b/components/templates/ListOfSuites.tsx @@ -59,10 +59,11 @@ const useStyles = makeStyles(theme => ({ type Props = { children: SuiteAndTest[] + stats } export const ListOfSuites = function(props: Props) { - const { children } = props + const { children, stats } = props const classes = useStyles(props) const [testInfoSection, setTestInfoSection] = useState(["No test selected"]) const [highlightedTest, setHighlightedTest] = useState(0) @@ -72,6 +73,16 @@ export const ListOfSuites = function(props: Props) { setHighlightedTest(testId) } + function setStats() { + let settingStats = [] + if(stats.includes("2")) settingStats.push("passed") + if(stats.includes("1")) settingStats.push("failed") + if(stats.includes("3")) settingStats.push("incomplete") + if(stats.includes("5")) settingStats.push("skipped") + return settingStats + } + let statsArray = setStats() + const [expandedSuite, setExpandedSuite] = React.useState( false ) @@ -113,7 +124,8 @@ export const ListOfSuites = function(props: Props) { suite.tests_passed, suite.tests_failed, suite.tests_incomplete, - suite.tests_skipped + suite.tests_skipped, + statsArray )} diff --git a/components/templates/showTestStats.js b/components/templates/showTestStats.js index 34475e2..56e69a7 100644 --- a/components/templates/showTestStats.js +++ b/components/templates/showTestStats.js @@ -1,7 +1,13 @@ import React from "react" import { Tooltip, Chip } from "@material-ui/core" -export function showTestStats(passed, failed, incomplete, skipped) { +export function showTestStats(passed, failed, incomplete, skipped, statsArray) { + + if(!statsArray.includes("passed")) passed = 0 + if(!statsArray.includes("failed")) failed = 0 + if(!statsArray.includes("incomplete")) incomplete = 0 + if(!statsArray.includes("skipped")) skipped = 0 + return (
{passed !== 0 ? ( diff --git a/pages/tests/[testsByRunId].tsx b/pages/tests/[testsByRunId].tsx index 1e1ea3c..752b457 100644 --- a/pages/tests/[testsByRunId].tsx +++ b/pages/tests/[testsByRunId].tsx @@ -70,7 +70,10 @@ type Props = { function Tests(props: Props) { const classes = useStyles(props) - let statusArrayForEndpoint + // We are using two things here. State and var, they will hold the same value but used for different purposes + // the way states work, `selectedStatus` state doesn't update immediately and it will have a old value inside the function, and correct value outside the function + // So we use `selectedStatus` state for refreshing the component, and `statusArrayForEndpoint` var for enpoint + let statusArrayForEndpoint = "1+2+3+5" const [selectedStatus, setSelectedStatus] = useState(["1", "2", "3", "5"]) const [data, setData] = useState(props.test_history) @@ -80,8 +83,6 @@ function Tests(props: Props) { if (selectedStatus.includes(status) && selectedStatus.length != 1) { // to remove the item, if it was selected already and user clicks again setSelectedStatus(selectedStatus.filter(item => item !== status)) - // we need to set the value for endpoint separately, - // cause selectedStatus state doesn't update immediately and it will have a wrong value at this stage statusArrayForEndpoint = selectedStatus .filter(item => item !== status) .toString() @@ -109,6 +110,7 @@ function Tests(props: Props) { setData(await response.json()) } + return ( Δ | Tests @@ -236,7 +238,7 @@ function Tests(props: Props) { skipped
- {data} + From 883d126327e0c0cdd59be387ee8c6ee127356272 Mon Sep 17 00:00:00 2001 From: Alex Pishcheiko Date: Thu, 30 Jul 2020 19:38:35 +0100 Subject: [PATCH 08/11] clean up unused files --- .../failedTests/[failedTestsByRunId].tsx | 133 ------------------ .../passedTests/[passedTestsByRunId].tsx | 133 ------------------ .../skippedTests/[skippedTestsByRunId].tsx | 133 ------------------ 3 files changed, 399 deletions(-) delete mode 100644 pages/tests/failedTests/[failedTestsByRunId].tsx delete mode 100644 pages/tests/passedTests/[passedTestsByRunId].tsx delete mode 100644 pages/tests/skippedTests/[skippedTestsByRunId].tsx diff --git a/pages/tests/failedTests/[failedTestsByRunId].tsx b/pages/tests/failedTests/[failedTestsByRunId].tsx deleted file mode 100644 index e4614c8..0000000 --- a/pages/tests/failedTests/[failedTestsByRunId].tsx +++ /dev/null @@ -1,133 +0,0 @@ -import React from "react" -import fetch from "isomorphic-unfetch" -import { makeStyles } from "@material-ui/core/styles" -import { SuiteAndTest } from "../../index" -import { BasePage, ListOfSuites } from "../../../components/templates" -import { - Grid, - Paper, - Container, - Typography, - Link, - Breadcrumbs, - Button, -} from "@material-ui/core" - -const useStyles = makeStyles(theme => ({ - root: { - width: "100%", - maxWidth: 3500, - }, - title: { - fontSize: "2em", - }, - container: { - paddingTop: theme.spacing(4), - maxWidth: 3400, - paddingBottom: theme.spacing(4), - }, - paper: { - padding: theme.spacing(2), - display: "flex", - overflow: "auto", - flexDirection: "column", - }, - padding: { - marginBottom: "5px", - marginLeft: "80%", - color: "#353690", - }, -})) - -type Props = { - test_history: SuiteAndTest[] -} - -function Tests(props: Props) { - const classes = useStyles(props) - - return ( - - Δ | Failed Tests - {props.test_history[0] ? ( // checking if props exist (if there are tests for this run) -
- - - Projects - - - Launches - - - All Tests - - Failed Tests - - - - - - - Failed tests for{" "} - - {" "} - {props.test_history[0].test_type} - {" "} - run - - - {props.test_history} - - - - -
- ) : ( -

No failed tests for this run, relax! :)

- )} -
- ) -} - -// It runs on the server-side, making a request before page is loaded. -// The data required to render the page is available at build time ahead of a user’s request -// https://nextjs.org/docs/api-reference/data-fetching/getInitialProps - -Tests.getInitialProps = async (context): Promise => { - const { failedTestsByRunId } = context.query - - // Suites and tests (inside suites) - const testsByTestRunIdReq = await fetch( - `${process.env.deltaCore}/api/v1/tests_history/test_status/1/test_run/${failedTestsByRunId}`, - { - method: "GET", - } - ) - const failedTests = await testsByTestRunIdReq.json() - - return { - test_history: failedTests, - } -} - -export default Tests diff --git a/pages/tests/passedTests/[passedTestsByRunId].tsx b/pages/tests/passedTests/[passedTestsByRunId].tsx deleted file mode 100644 index af5b386..0000000 --- a/pages/tests/passedTests/[passedTestsByRunId].tsx +++ /dev/null @@ -1,133 +0,0 @@ -import React from "react" -import fetch from "isomorphic-unfetch" -import { makeStyles } from "@material-ui/core/styles" -import { SuiteAndTest } from "../../index" -import { BasePage, ListOfSuites } from "../../../components/templates" -import { - Grid, - Paper, - Container, - Typography, - Link, - Breadcrumbs, - Button, -} from "@material-ui/core" - -const useStyles = makeStyles(theme => ({ - root: { - width: "100%", - maxWidth: 3500, - }, - title: { - fontSize: "2em", - }, - container: { - paddingTop: theme.spacing(4), - maxWidth: 3400, - paddingBottom: theme.spacing(4), - }, - paper: { - padding: theme.spacing(2), - display: "flex", - overflow: "auto", - flexDirection: "column", - }, - padding: { - marginBottom: "5px", - marginLeft: "80%", - color: "#353690", - }, -})) - -type Props = { - test_history: SuiteAndTest[] -} - -function Tests(props: Props) { - const classes = useStyles(props) - - return ( - - Δ | Passed Tests - {props.test_history[0] ? ( // checking if props exist (if there are tests for this run) -
- - - Projects - - - Launches - - - All Tests - - Passed Tests - - - - - - - Passed tests for{" "} - - {" "} - {props.test_history[0].test_type} - {" "} - run - - - {props.test_history} - - - - -
- ) : ( -

No passed tests for this run :((

- )} -
- ) -} - -// It runs on the server-side, making a request before page is loaded. -// The data required to render the page is available at build time ahead of a user’s request -// https://nextjs.org/docs/api-reference/data-fetching/getInitialProps - -Tests.getInitialProps = async (context): Promise => { - const { passedTestsByRunId } = context.query - - // Suites and tests (inside suites) - const testsByTestRunIdReq = await fetch( - `${process.env.deltaCore}/api/v1/tests_history/test_status/2/test_run/${passedTestsByRunId}`, - { - method: "GET", - } - ) - const passedTests = await testsByTestRunIdReq.json() - - return { - test_history: passedTests, - } -} - -export default Tests diff --git a/pages/tests/skippedTests/[skippedTestsByRunId].tsx b/pages/tests/skippedTests/[skippedTestsByRunId].tsx deleted file mode 100644 index 00c412d..0000000 --- a/pages/tests/skippedTests/[skippedTestsByRunId].tsx +++ /dev/null @@ -1,133 +0,0 @@ -import React from "react" -import fetch from "isomorphic-unfetch" -import { makeStyles } from "@material-ui/core/styles" -import { SuiteAndTest } from "../../index" -import { BasePage, ListOfSuites } from "../../../components/templates" -import { - Grid, - Paper, - Container, - Typography, - Link, - Breadcrumbs, - Button, -} from "@material-ui/core" - -const useStyles = makeStyles(theme => ({ - root: { - width: "100%", - maxWidth: 3500, - }, - title: { - fontSize: "2em", - }, - container: { - paddingTop: theme.spacing(4), - maxWidth: 3400, - paddingBottom: theme.spacing(4), - }, - paper: { - padding: theme.spacing(2), - display: "flex", - overflow: "auto", - flexDirection: "column", - }, - padding: { - marginBottom: "5px", - marginLeft: "80%", - color: "#353690", - }, -})) - -type Props = { - test_history: SuiteAndTest[] -} - -function Tests(props: Props) { - const classes = useStyles(props) - - return ( - - Δ | Skipped Tests - {props.test_history[0] ? ( // checking if props exist (if there are tests for this run) -
- - - Projects - - - Launches - - - All Tests - - Skipped Tests - - - - - - - Skipped tests for{" "} - - {" "} - {props.test_history[0].test_type} - {" "} - run - - - {props.test_history} - - - - -
- ) : ( -

No skipped tests for this run, well done! :)

- )} -
- ) -} - -// It runs on the server-side, making a request before page is loaded. -// The data required to render the page is available at build time ahead of a user’s request -// https://nextjs.org/docs/api-reference/data-fetching/getInitialProps - -Tests.getInitialProps = async (context): Promise => { - const { skippedTestsByRunId } = context.query - - // Suites and tests (inside suites) - const testsByTestRunIdReq = await fetch( - `${process.env.deltaCore}/api/v1/tests_history/test_status/5/test_run/${skippedTestsByRunId}`, - { - method: "GET", - } - ) - const skippedTests = await testsByTestRunIdReq.json() - - return { - test_history: skippedTests, - } -} - -export default Tests From a6f20f70de4c3dc7e8ca3d5f4ae664fa96fbaa50 Mon Sep 17 00:00:00 2001 From: Alex Pishcheiko Date: Thu, 30 Jul 2020 19:52:01 +0100 Subject: [PATCH 09/11] prettier for function --- components/templates/showStatusIcon.js | 143 +++++++++++++++---------- 1 file changed, 85 insertions(+), 58 deletions(-) diff --git a/components/templates/showStatusIcon.js b/components/templates/showStatusIcon.js index 63c13b7..c48838d 100644 --- a/components/templates/showStatusIcon.js +++ b/components/templates/showStatusIcon.js @@ -1,11 +1,10 @@ import React from "react" -import {Typography, Tooltip, Chip, Link} from "@material-ui/core" +import { Typography, Tooltip } from "@material-ui/core" import CheckIcon from "@material-ui/icons/Check" import CloseIcon from "@material-ui/icons/Close" import UseAnimations from "react-useanimations" import SnoozeIcon from "@material-ui/icons/Snooze" - export function showStatusIcon(status) { let statusIcon if (status === "Passed" || status === "Successful") { @@ -15,62 +14,90 @@ export function showStatusIcon(status) { ) } else if (status === "Failed" || status === "Incomplete") { - statusIcon = ( - - - - ) - } else if (status === "Skipped") { - statusIcon = ( - - - - ) - } else if (status === "Running" || status === "In Process") { - statusIcon = ( - - - - ) - } else { - statusIcon = ( - - {status} - - ) - } - return statusIcon + statusIcon = ( + + + + ) + } else if (status === "Skipped") { + statusIcon = ( + + + + ) + } else if (status === "Running" || status === "In Process") { + statusIcon = ( + + + + ) + } else { + statusIcon = {status} } - + return statusIcon +} export function showStatusText(status) { - let statusIcon - if (status === "Passed" || status === "Successful") { - statusIcon = ( - - ) - } else if (status === "Failed" || status === "Incomplete") { - statusIcon = ( - - ) - } else if (status === "Skipped") { - statusIcon = ( - - ) - } else if (status === "Running" || status === "In Process") { - statusIcon = ( - - ) - } else { - statusIcon = ( - - {status} - - ) - } - return statusIcon -} \ No newline at end of file + let statusIcon + if (status === "Passed" || status === "Successful") { + statusIcon = ( + + ) + } else if (status === "Failed" || status === "Incomplete") { + statusIcon = ( + + ) + } else if (status === "Skipped") { + statusIcon = ( + + ) + } else if (status === "Running" || status === "In Process") { + statusIcon = ( + + ) + } else { + statusIcon = {status} + } + return statusIcon +} From 1c331b2678b298a36fdc2d94f8dfcddcdad440cd Mon Sep 17 00:00:00 2001 From: Alex Pishcheiko Date: Thu, 30 Jul 2020 22:21:41 +0100 Subject: [PATCH 10/11] covering the case when no matching tests after filter applied --- pages/tests/[testsByRunId].tsx | 36 ++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/pages/tests/[testsByRunId].tsx b/pages/tests/[testsByRunId].tsx index 752b457..70b1bfb 100644 --- a/pages/tests/[testsByRunId].tsx +++ b/pages/tests/[testsByRunId].tsx @@ -70,9 +70,9 @@ type Props = { function Tests(props: Props) { const classes = useStyles(props) - // We are using two things here. State and var, they will hold the same value but used for different purposes - // the way states work, `selectedStatus` state doesn't update immediately and it will have a old value inside the function, and correct value outside the function - // So we use `selectedStatus` state for refreshing the component, and `statusArrayForEndpoint` var for enpoint + // We are using two things here. State and var, they will hold the same value but used for different purposes + // the way states work, `selectedStatus` state doesn't update immediately and it will have a old value inside the function, and correct value outside the function + // So we use `selectedStatus` state for refreshing the component, and `statusArrayForEndpoint` var for enpoint let statusArrayForEndpoint = "1+2+3+5" const [selectedStatus, setSelectedStatus] = useState(["1", "2", "3", "5"]) @@ -110,18 +110,17 @@ function Tests(props: Props) { setData(await response.json()) } - return ( Δ | Tests - {data[0] ? ( // checking if props exist (if there are tests for this run) + {props.test_history[0] ? ( // checking if props exist (if there are tests for this run) // id needed here for scrolling to the top when needed
Projects - + Launches Tests @@ -142,7 +141,7 @@ function Tests(props: Props) { color="secondary" > {" "} - {data[0].test_type} + {props.test_history[0].test_type} {" "} run @@ -163,7 +162,7 @@ function Tests(props: Props) {

- + {data[0] ? ( // if there is no data returned from filtering - use initial props + + ) : ( +
+ Sorry, there was no matching tests for this filter, showing full list of tests + +
+ )} From eb535b18ef83d7f088506d465751c8dcf950f95a Mon Sep 17 00:00:00 2001 From: Alex Pishcheiko Date: Fri, 31 Jul 2020 09:08:29 +0100 Subject: [PATCH 11/11] when there are no matching tests - just show the message with no tests --- pages/tests/[testsByRunId].tsx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pages/tests/[testsByRunId].tsx b/pages/tests/[testsByRunId].tsx index 70b1bfb..3398442 100644 --- a/pages/tests/[testsByRunId].tsx +++ b/pages/tests/[testsByRunId].tsx @@ -244,11 +244,7 @@ function Tests(props: Props) { > ) : (
- Sorry, there was no matching tests for this filter, showing full list of tests - + Sorry, there are no matching tests for this filter
)}