From 00f26c8ecc5fc9a1d0c611ca300059e89b3f30b2 Mon Sep 17 00:00:00 2001 From: myeeli Date: Fri, 27 Jun 2025 17:30:34 -0500 Subject: [PATCH 01/11] Implemented the bar chart with sample data --- package-lock.json | 231 -------------------- src/components/Analytics/PopularPRChart.jsx | 73 +++++++ src/routes.js | 51 +++-- 3 files changed, 103 insertions(+), 252 deletions(-) create mode 100644 src/components/Analytics/PopularPRChart.jsx diff --git a/package-lock.json b/package-lock.json index 99d7794580..40ae2bf4d8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7741,11 +7741,6 @@ "warning": "^4.0.3" } }, - "@ioredis/commands": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@ioredis/commands/-/commands-1.2.0.tgz", - "integrity": "sha512-Sx1pU8EM64o2BrqNpEO1CNLtKQwyhuXuqyfH7oGKCk+1a33d2r5saW8zNwm3j6BTExtjrv2BxTgzzkMwts6vGg==" - }, "@istanbuljs/load-nyc-config": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", @@ -8385,42 +8380,6 @@ } } }, - "@msgpackr-extract/msgpackr-extract-darwin-arm64": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-darwin-arm64/-/msgpackr-extract-darwin-arm64-3.0.3.tgz", - "integrity": "sha512-QZHtlVgbAdy2zAqNA9Gu1UpIuI8Xvsd1v8ic6B2pZmeFnFcMWiPLfWXh7TVw4eGEZ/C9TH281KwhVoeQUKbyjw==", - "optional": true - }, - "@msgpackr-extract/msgpackr-extract-darwin-x64": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-darwin-x64/-/msgpackr-extract-darwin-x64-3.0.3.tgz", - "integrity": "sha512-mdzd3AVzYKuUmiWOQ8GNhl64/IoFGol569zNRdkLReh6LRLHOXxU4U8eq0JwaD8iFHdVGqSy4IjFL4reoWCDFw==", - "optional": true - }, - "@msgpackr-extract/msgpackr-extract-linux-arm": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-linux-arm/-/msgpackr-extract-linux-arm-3.0.3.tgz", - "integrity": "sha512-fg0uy/dG/nZEXfYilKoRe7yALaNmHoYeIoJuJ7KJ+YyU2bvY8vPv27f7UKhGRpY6euFYqEVhxCFZgAUNQBM3nw==", - "optional": true - }, - "@msgpackr-extract/msgpackr-extract-linux-arm64": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-linux-arm64/-/msgpackr-extract-linux-arm64-3.0.3.tgz", - "integrity": "sha512-YxQL+ax0XqBJDZiKimS2XQaf+2wDGVa1enVRGzEvLLVFeqa5kx2bWbtcSXgsxjQB7nRqqIGFIcLteF/sHeVtQg==", - "optional": true - }, - "@msgpackr-extract/msgpackr-extract-linux-x64": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-linux-x64/-/msgpackr-extract-linux-x64-3.0.3.tgz", - "integrity": "sha512-cvwNfbP07pKUfq1uH+S6KJ7dT9K8WOE4ZiAcsrSes+UY55E/0jLYc+vq+DO7jlmqRb5zAggExKm0H7O/CBaesg==", - "optional": true - }, - "@msgpackr-extract/msgpackr-extract-win32-x64": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-win32-x64/-/msgpackr-extract-win32-x64-3.0.3.tgz", - "integrity": "sha512-x0fWaQtYp4E6sktbsdAqnehxDgEc/VwM7uLsRCYWaiGu0ykYdZPiS8zCWdnjHwyiumousxfBm4SO31eXqwEZhQ==", - "optional": true - }, "@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -8978,11 +8937,6 @@ "integrity": "sha512-sXXKG+uL9IrKqViTtao2Ws6dy0znu9sOaP1di/jKGW1M6VssO8vlpXCQcpZ+jisQ1tTFAC5Jo/EOzFbggBagFQ==", "dev": true }, - "@socket.io/component-emitter": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@socket.io/component-emitter/-/component-emitter-3.1.2.tgz", - "integrity": "sha512-9BCxFwvbGg/RsZK9tjXd8s4UcwR0MWeFQ1XEKIQVVvAGJyINdrqKMcTRyLoK8Rse1GjzLV9cwjWV1olXRWEXVA==" - }, "@surma/rollup-plugin-off-main-thread": { "version": "1.4.2", "resolved": "https://registry.npmjs.org/@surma/rollup-plugin-off-main-thread/-/rollup-plugin-off-main-thread-1.4.2.tgz", @@ -14552,32 +14506,6 @@ "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", "integrity": "sha512-HpGFw18DgFWlncDfjTa2rcQ4W88O1mC8e8yZ2AvQY5KDaktSTwo+KRf6nHK6FRI5FyRyb/5T6+TSxfP7QyGsmQ==" }, - "bull": { - "version": "4.16.5", - "resolved": "https://registry.npmjs.org/bull/-/bull-4.16.5.tgz", - "integrity": "sha512-lDsx2BzkKe7gkCYiT5Acj02DpTwDznl/VNN7Psn7M3USPG7Vs/BaClZJJTAG+ufAR9++N1/NiUTdaFBWDIl5TQ==", - "requires": { - "cron-parser": "^4.9.0", - "get-port": "^5.1.1", - "ioredis": "^5.3.2", - "lodash": "^4.17.21", - "msgpackr": "^1.11.2", - "semver": "^7.5.2", - "uuid": "^8.3.0" - }, - "dependencies": { - "semver": { - "version": "7.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", - "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==" - }, - "uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" - } - } - }, "bytes": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", @@ -15127,11 +15055,6 @@ "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==" }, - "cluster-key-slot": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/cluster-key-slot/-/cluster-key-slot-1.1.2.tgz", - "integrity": "sha512-RMr0FhtfXemyinomL4hrWcYJxmX6deFdCxpJzhDttxgO1+bcCnkk+9drydLVDmAMG7NE6aN/fl4F7ucU/90gAA==" - }, "co": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", @@ -15590,14 +15513,6 @@ "sha.js": "^2.4.8" } }, - "cron-parser": { - "version": "4.9.0", - "resolved": "https://registry.npmjs.org/cron-parser/-/cron-parser-4.9.0.tgz", - "integrity": "sha512-p0SaNjrHOnQeR8/VnfGbmg9te2kfyYSQ7Sc/j/6DtPL3JQvKxmjO9TSjNFpujqV3vEYYBvNNvXSxzyksBWAx1Q==", - "requires": { - "luxon": "^3.2.1" - } - }, "cross-env": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-5.2.1.tgz", @@ -16677,11 +16592,6 @@ "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==", "dev": true }, - "denque": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/denque/-/denque-2.1.0.tgz", - "integrity": "sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==" - }, "depd": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", @@ -16706,12 +16616,6 @@ "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==" }, - "detect-libc": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.3.tgz", - "integrity": "sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==", - "optional": true - }, "detect-newline": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", @@ -17130,30 +17034,6 @@ "once": "^1.4.0" } }, - "engine.io-client": { - "version": "6.6.3", - "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-6.6.3.tgz", - "integrity": "sha512-T0iLjnyNWahNyv/lcjS2y4oE358tVS/SYQNxYXGAJ9/GLgH4VCvOQ/mhTjqU88mLZCQgiG8RIegFHYCdVC+j5w==", - "requires": { - "@socket.io/component-emitter": "~3.1.0", - "debug": "~4.3.1", - "engine.io-parser": "~5.2.1", - "ws": "~8.17.1", - "xmlhttprequest-ssl": "~2.1.1" - }, - "dependencies": { - "ws": { - "version": "8.17.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", - "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==" - } - } - }, - "engine.io-parser": { - "version": "5.2.3", - "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.2.3.tgz", - "integrity": "sha512-HqD3yTBfnBxIrbnM1DoD6Pcq8NECnh8d4As1Qgh0z5Gg3jRRIqijury0CL3ghu/edArpUYiYqQiDUQBIs4np3Q==" - }, "enhanced-resolve": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.5.0.tgz", @@ -21349,11 +21229,6 @@ "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==" }, - "get-port": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/get-port/-/get-port-5.1.1.tgz", - "integrity": "sha512-g/Q1aTSDOxFpchXC4i8ZWvxA1lnPqx/JHqcpIw0/LX9T8x/GBbi6YnlN5nhaKIFkT8oFsscUKgDJYxfwfS6QsQ==" - }, "get-proto": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", @@ -22368,22 +22243,6 @@ "loose-envify": "^1.0.0" } }, - "ioredis": { - "version": "5.6.1", - "resolved": "https://registry.npmjs.org/ioredis/-/ioredis-5.6.1.tgz", - "integrity": "sha512-UxC0Yv1Y4WRJiGQxQkP0hfdL0/5/6YvdfOOClRgJ0qppSarkhneSa6UvkMkms0AkdGimSH3Ikqm+6mkMmX7vGA==", - "requires": { - "@ioredis/commands": "^1.1.1", - "cluster-key-slot": "^1.1.0", - "debug": "^4.3.4", - "denque": "^2.1.0", - "lodash.defaults": "^4.2.0", - "lodash.isarguments": "^3.1.0", - "redis-errors": "^1.2.0", - "redis-parser": "^3.0.0", - "standard-as-callback": "^2.1.0" - } - }, "ip": { "version": "1.1.9", "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.9.tgz", @@ -23934,11 +23793,6 @@ "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", "integrity": "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==" }, - "lodash.defaults": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-4.2.0.tgz", - "integrity": "sha512-qjxPLHd3r5DnsdGacqOMU6pb/avJzdh9tFX2ymgoZE27BmjXrNy/y4LoaiTeAb+O3gL8AfpJGtqfX/ae2leYYQ==" - }, "lodash.escape": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/lodash.escape/-/lodash.escape-4.0.1.tgz", @@ -23951,11 +23805,6 @@ "integrity": "sha512-uHaJFihxmJcEX3kT4I23ABqKKalJ/zDrDg0lsFtc1h+3uw49SIJ5beyhx5ExVRti3AvKoOJngIj7xz3oylPdWQ==", "dev": true }, - "lodash.isarguments": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", - "integrity": "sha512-chi4NHZlZqZD18a0imDHnZPrDeBbTtVN7GXMwuGdRH9qotxAjYs3aVLKc7zNOG9eddR5Ksd8rvFEBc9SsggPpg==" - }, "lodash.isequal": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", @@ -24062,11 +23911,6 @@ "resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-0.484.0.tgz", "integrity": "sha512-oZy8coK9kZzvqhSgfbGkPtTgyjpBvs3ukLgDPv14dSOZtBtboryWF5o8i3qen7QbGg7JhiJBz5mK1p8YoMZTLQ==" }, - "luxon": { - "version": "3.6.1", - "resolved": "https://registry.npmjs.org/luxon/-/luxon-3.6.1.tgz", - "integrity": "sha512-tJLxrKJhO2ukZ5z0gyjY1zPh3Rh88Ej9P7jNrZiHMUXHae1yvI2imgOZtL1TO8TW6biMMKfTtAOoEJANgtWBMQ==" - }, "lz-string": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/lz-string/-/lz-string-1.5.0.tgz", @@ -24752,29 +24596,6 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, - "msgpackr": { - "version": "1.11.2", - "resolved": "https://registry.npmjs.org/msgpackr/-/msgpackr-1.11.2.tgz", - "integrity": "sha512-F9UngXRlPyWCDEASDpTf6c9uNhGPTqnTeLVt7bN+bU1eajoR/8V9ys2BRaV5C/e5ihE6sJ9uPIKaYt6bFuO32g==", - "requires": { - "msgpackr-extract": "^3.0.2" - } - }, - "msgpackr-extract": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/msgpackr-extract/-/msgpackr-extract-3.0.3.tgz", - "integrity": "sha512-P0efT1C9jIdVRefqjzOQ9Xml57zpOXnIuS+csaB4MdZbTdmGDLo8XhzBG1N7aO11gKDDkJvBLULeFTo46wwreA==", - "optional": true, - "requires": { - "@msgpackr-extract/msgpackr-extract-darwin-arm64": "3.0.3", - "@msgpackr-extract/msgpackr-extract-darwin-x64": "3.0.3", - "@msgpackr-extract/msgpackr-extract-linux-arm": "3.0.3", - "@msgpackr-extract/msgpackr-extract-linux-arm64": "3.0.3", - "@msgpackr-extract/msgpackr-extract-linux-x64": "3.0.3", - "@msgpackr-extract/msgpackr-extract-win32-x64": "3.0.3", - "node-gyp-build-optional-packages": "5.2.2" - } - }, "msw": { "version": "0.19.5", "resolved": "https://registry.npmjs.org/msw/-/msw-0.19.5.tgz", @@ -25047,15 +24868,6 @@ } } }, - "node-gyp-build-optional-packages": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/node-gyp-build-optional-packages/-/node-gyp-build-optional-packages-5.2.2.tgz", - "integrity": "sha512-s+w+rBWnpTMwSFbaE0UXsRlg7hU4FjekKU4eyAih5T8nJuNZT1nNsskXpxmeqSK9UzkBl6UgRlnKc8hz8IEqOw==", - "optional": true, - "requires": { - "detect-libc": "^2.0.1" - } - }, "node-int64": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", @@ -30541,19 +30353,6 @@ "strip-indent": "^3.0.0" } }, - "redis-errors": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/redis-errors/-/redis-errors-1.2.0.tgz", - "integrity": "sha512-1qny3OExCf0UvUV/5wpYKf2YwPcOqXzkwKKSmKHiE6ZMQs5heeE/c8eXK+PNllPvmjgAbfnsbpkGZWy8cBpn9w==" - }, - "redis-parser": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/redis-parser/-/redis-parser-3.0.0.tgz", - "integrity": "sha512-DJnGAeenTdpMEH6uAJRK/uiyEIH9WVsUmoLwzudwGJUwZPp80PDBWPHXSAGNPwNvIXAbe7MSUB1zQFugFml66A==", - "requires": { - "redis-errors": "^1.0.0" - } - }, "reduce-reducers": { "version": "0.4.3", "resolved": "https://registry.npmjs.org/reduce-reducers/-/reduce-reducers-0.4.3.tgz", @@ -32221,26 +32020,6 @@ } } }, - "socket.io-client": { - "version": "4.8.1", - "resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-4.8.1.tgz", - "integrity": "sha512-hJVXfu3E28NmzGk8o1sHhN3om52tRvwYeidbj7xKy2eIIse5IoKX3USlS6Tqt3BHAtflLIkCQBkzVrEEfWUyYQ==", - "requires": { - "@socket.io/component-emitter": "~3.1.0", - "debug": "~4.3.2", - "engine.io-client": "~6.6.1", - "socket.io-parser": "~4.2.4" - } - }, - "socket.io-parser": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.4.tgz", - "integrity": "sha512-/GbIKmo8ioc+NIWIhwdecY0ge+qVBSMdgxGygevmdHj24bsfgtCmcUUcQ5ZzcylGFHsN3k4HB4Cgkl96KVnuew==", - "requires": { - "@socket.io/component-emitter": "~3.1.0", - "debug": "~4.3.1" - } - }, "sockjs": { "version": "0.3.24", "resolved": "https://registry.npmjs.org/sockjs/-/sockjs-0.3.24.tgz", @@ -32494,11 +32273,6 @@ "resolved": "https://registry.npmjs.org/stackframe/-/stackframe-1.3.4.tgz", "integrity": "sha512-oeVtt7eWQS+Na6F//S4kJ2K2VbRlS9D43mAlMyVpVWovy9o+jfgH8O9agzANzaiLjclA0oYzUXEM4PurhSUChw==" }, - "standard-as-callback": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/standard-as-callback/-/standard-as-callback-2.1.0.tgz", - "integrity": "sha512-qoRRSyROncaz1z0mvYqIE4lCd9p2R90i6GxW3uZv5ucSu8tU7B5HXUP1gG8pVZsYNVaXjk8ClXHPttLyxAL48A==" - }, "static-eval": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/static-eval/-/static-eval-2.0.2.tgz", @@ -36512,11 +36286,6 @@ "sax": "^1.2.4" } }, - "xmlhttprequest-ssl": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-2.1.2.tgz", - "integrity": "sha512-TEU+nJVUUnA4CYJFLvK5X9AOeH4KvDvhIfm0vV1GaQRtchnG0hgK5p8hw/xjv8cunWYCsiPCSDzObPyhEwq3KQ==" - }, "xtend": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", diff --git a/src/components/Analytics/PopularPRChart.jsx b/src/components/Analytics/PopularPRChart.jsx new file mode 100644 index 0000000000..db543029cb --- /dev/null +++ b/src/components/Analytics/PopularPRChart.jsx @@ -0,0 +1,73 @@ +import React, { useState } from 'react'; +import { + BarChart, Bar, XAxis, YAxis, Tooltip, ResponsiveContainer, LabelList +} from 'recharts'; + +const data = [ + { prNumber: 'PR1234', reviews: 10 }, + { prNumber: 'PR1235', reviews: 8 }, + { prNumber: 'PR1236', reviews: 15 }, + { prNumber: 'PR1237', reviews: 5 }, + { prNumber: 'PR1238', reviews: 12 }, + { prNumber: 'PR1231', reviews: 12 }, + { prNumber: 'PR1256', reviews: 17 }, + { prNumber: 'PR1255', reviews: 19 }, + { prNumber: 'PR1254', reviews: 1 }, + { prNumber: 'PR1253', reviews: 2 }, + { prNumber: 'PR1252', reviews: 7 }, + { prNumber: 'PR1251', reviews: 9 }, + { prNumber: 'PR1250', reviews: 11 }, + { prNumber: 'PR1249', reviews: 19 }, + { prNumber: 'PR1248', reviews: 0 }, + { prNumber: 'PR1242', reviews: 2 }, + { prNumber: 'PR1241', reviews: 20 }, +]; + +const durationOptions = ['Last Week', 'Last 2 weeks', 'Last Month', 'All Time']; + +const PopularPRChart = () => { + const [duration, setDuration] = useState('Last Week'); + + // Temporary data + const filteredData = data; + + return ( +
+
+ + +
+ + + + + + + + + + + +
+ ); +}; + +export default PopularPRChart; diff --git a/src/routes.js b/src/routes.js index 0b1e01f085..44e9f9f8e3 100644 --- a/src/routes.js +++ b/src/routes.js @@ -113,7 +113,7 @@ import NoshowViz from './components/CommunityPortal/Attendence/NoshowViz'; // import AddActivities from './components/CommunityPortal/Activities/AddActivities'; // import ActvityDetailPage from './components/CommunityPortal/Activities/ActivityDetailPage'; -import ActivitiesPage from './components/CommunityPortal/Activities/ActivitiesPage'; +import ActivitiesPage from './components/CommunityPortal/Activities/ActivitiesPage'; import EventStats from './components/CommunityPortal/EventPersonalization/EventStats'; @@ -134,6 +134,7 @@ import SkillsOverviewPage from './components/HGNHelpSkillsDashboard/SkillsOvervi import CommunityMembersPage from './components/HGNHelpSkillsDashboard/CommunityMembersPage'; import UserProfilePage from './components/HGNHelpSkillsDashboard/UserProfilePage'; import FeedbackModal from './components/HGNHelpSkillsDashboard/FeedbackModal'; +import PopularPRChart from 'components/Analytics/PopularPRChart'; // eslint-disable-next-line import/order, import/no-unresolved @@ -358,7 +359,7 @@ export default ( fallback routePermissions={RoutePermissions.workBreakdownStructure} /> - + + + + {/* ----- BEGIN BM Dashboard Routing ----- */} @@ -523,7 +532,7 @@ export default ( component={PurchaseConsumable} /> - + @@ -581,11 +590,11 @@ export default ( - + - + @@ -633,31 +642,31 @@ export default ( - + - {/* ----- HGN Help Community Skills Dashboard Routes ----- */} + {/* ----- HGN Help Community Skills Dashboard Routes ----- */} - - - - - - + + + + + + - - - - - - - - + + + + + + + + From 4cef0ada3950ad2d686964cf101e09156650a7f2 Mon Sep 17 00:00:00 2001 From: myeeli Date: Sat, 28 Jun 2025 08:58:54 -0500 Subject: [PATCH 02/11] implemented-review-summary-barchart --- .../Analytics/ReviewersRequirementChart.jsx | 114 ++++++++++++++++++ src/routes.js | 7 ++ 2 files changed, 121 insertions(+) create mode 100644 src/components/Analytics/ReviewersRequirementChart.jsx diff --git a/src/components/Analytics/ReviewersRequirementChart.jsx b/src/components/Analytics/ReviewersRequirementChart.jsx new file mode 100644 index 0000000000..4a164fce87 --- /dev/null +++ b/src/components/Analytics/ReviewersRequirementChart.jsx @@ -0,0 +1,114 @@ +import React, { useState, useEffect } from 'react'; +import { + BarChart, Bar, XAxis, YAxis, Tooltip, ResponsiveContainer, Legend +} from 'recharts'; + +const durationOptions = [ + { label: 'Last Week', value: 'lastWeek' }, + { label: 'Last 2 weeks', value: 'last2weeks' }, + { label: 'Last Month', value: 'lastMonth' }, + { label: 'All Time', value: 'allTime' }, +]; + +const sampleData = [ + { + reviewer: 'Alice', + team: 'Team A', + isMentor: true, + Exceptional: 5, + Sufficient: 3, + NeedsChanges: 2, + DidNotReview: 0 + }, + { + reviewer: 'Bob', + team: 'Team B', + isMentor: false, + Exceptional: 2, + Sufficient: 4, + NeedsChanges: 1, + DidNotReview: 1 + }, + { + reviewer: 'Carol', + team: 'Team C', + isMentor: true, + Exceptional: 6, + Sufficient: 2, + NeedsChanges: 0, + DidNotReview: 0 + }, + { + reviewer: 'David', + team: 'Team A', + isMentor: false, + Exceptional: 1, + Sufficient: 2, + NeedsChanges: 3, + DidNotReview: 4 + }, + { + reviewer: 'Eve', + team: 'Team B', + isMentor: true, + Exceptional: 3, + Sufficient: 3, + NeedsChanges: 2, + DidNotReview: 1 + } +]; + + +const ReviewersRequirementChart = () => { + const [duration, setDuration] = useState('lastWeek'); + + useEffect(() => { + const fetchAPIData = async () => { + try { + const res = await fetch(`http://localhost:4500/api/analytics/review-summary?duration=${duration}`); + const data = await res.json(); + console.log('API Response:', data); + } catch (err) { + console.error('Error fetching data:', err); + } + }; + + fetchAPIData(); + }, [duration]); + + return ( +
+
+ + +
+ + + + + + + + + + + + + +
+ ); +}; + +export default ReviewersRequirementChart; diff --git a/src/routes.js b/src/routes.js index 44e9f9f8e3..e33478b927 100644 --- a/src/routes.js +++ b/src/routes.js @@ -140,6 +140,7 @@ import PopularPRChart from 'components/Analytics/PopularPRChart'; // eslint-disable-next-line import/order, import/no-unresolved import LogTools from './components/BMDashboard/LogTools/LogTools'; import EquipmentUpdate from './components/BMDashboard/Tools/EquipmentUpdate'; +import ReviewersRequirementChart from 'components/Analytics/ReviewersRequirementChart'; // Social Architecture const ResourceManagement = lazy(() => import('./components/ResourceManagement/ResourceManagement')); @@ -486,6 +487,12 @@ export default ( component={PopularPRChart} fallback /> + {/* ----- BEGIN BM Dashboard Routing ----- */} From c3317f1dc1591dda53d7c7fd3ae8705a453d578a Mon Sep 17 00:00:00 2001 From: myeeli Date: Sat, 28 Jun 2025 13:44:47 -0500 Subject: [PATCH 03/11] implemented filter function integrated reviewrs requirement and popularPR chart --- .../Analytics/AnalyticsDashboard.jsx | 43 +++++ src/components/Analytics/PopularPRChart.jsx | 50 ++---- .../Analytics/ReviewersRequirementChart.jsx | 153 ++++++++---------- src/routes.js | 7 + 4 files changed, 138 insertions(+), 115 deletions(-) create mode 100644 src/components/Analytics/AnalyticsDashboard.jsx diff --git a/src/components/Analytics/AnalyticsDashboard.jsx b/src/components/Analytics/AnalyticsDashboard.jsx new file mode 100644 index 0000000000..f1b0a10731 --- /dev/null +++ b/src/components/Analytics/AnalyticsDashboard.jsx @@ -0,0 +1,43 @@ +import React, { useState } from 'react'; +import ReviewersRequirementChart from './ReviewersRequirementChart'; +import PopularPRChart from './PopularPRChart'; + +const durationOptions = [ + { label: 'Last Week', value: 'lastWeek' }, + { label: 'Last 2 weeks', value: 'last2weeks' }, + { label: 'Last Month', value: 'lastMonth' }, + { label: 'All Time', value: 'allTime' }, +]; + +const AnalyticsDashboard = () => { + const [duration, setDuration] = useState('lastWeek'); + + return ( +
+
+ + +
+ +
+

Reviewers Ranked by Requirement Satisfied

+ +
+ +
+

20 Most Popular PRs

+ +
+
+ ); +}; + +export default AnalyticsDashboard; diff --git a/src/components/Analytics/PopularPRChart.jsx b/src/components/Analytics/PopularPRChart.jsx index db543029cb..bcd765cc70 100644 --- a/src/components/Analytics/PopularPRChart.jsx +++ b/src/components/Analytics/PopularPRChart.jsx @@ -1,4 +1,4 @@ -import React, { useState } from 'react'; +import React from 'react'; import { BarChart, Bar, XAxis, YAxis, Tooltip, ResponsiveContainer, LabelList } from 'recharts'; @@ -20,49 +20,33 @@ const data = [ { prNumber: 'PR1249', reviews: 19 }, { prNumber: 'PR1248', reviews: 0 }, { prNumber: 'PR1242', reviews: 2 }, - { prNumber: 'PR1241', reviews: 20 }, + { prNumber: 'PR1241', reviews: 50 } ]; -const durationOptions = ['Last Week', 'Last 2 weeks', 'Last Month', 'All Time']; - -const PopularPRChart = () => { - const [duration, setDuration] = useState('Last Week'); - - // Temporary data +const PopularPRChart = ({ duration }) => { const filteredData = data; return ( -
-
- - -
- +
- + - - + + diff --git a/src/components/Analytics/ReviewersRequirementChart.jsx b/src/components/Analytics/ReviewersRequirementChart.jsx index 4a164fce87..5b7dca5164 100644 --- a/src/components/Analytics/ReviewersRequirementChart.jsx +++ b/src/components/Analytics/ReviewersRequirementChart.jsx @@ -1,6 +1,13 @@ import React, { useState, useEffect } from 'react'; import { - BarChart, Bar, XAxis, YAxis, Tooltip, ResponsiveContainer, Legend + BarChart, + Bar, + XAxis, + YAxis, + Tooltip, + ResponsiveContainer, + Legend, + LabelList } from 'recharts'; const durationOptions = [ @@ -10,59 +17,34 @@ const durationOptions = [ { label: 'All Time', value: 'allTime' }, ]; -const sampleData = [ - { - reviewer: 'Alice', - team: 'Team A', - isMentor: true, - Exceptional: 5, - Sufficient: 3, - NeedsChanges: 2, - DidNotReview: 0 - }, - { - reviewer: 'Bob', - team: 'Team B', - isMentor: false, - Exceptional: 2, - Sufficient: 4, - NeedsChanges: 1, - DidNotReview: 1 - }, - { - reviewer: 'Carol', - team: 'Team C', - isMentor: true, - Exceptional: 6, - Sufficient: 2, - NeedsChanges: 0, - DidNotReview: 0 - }, - { - reviewer: 'David', - team: 'Team A', - isMentor: false, - Exceptional: 1, - Sufficient: 2, - NeedsChanges: 3, - DidNotReview: 4 - }, - { - reviewer: 'Eve', - team: 'Team B', - isMentor: true, - Exceptional: 3, - Sufficient: 3, - NeedsChanges: 2, - DidNotReview: 1 - } -]; - - -const ReviewersRequirementChart = () => { - const [duration, setDuration] = useState('lastWeek'); +// Sample data +const fullSampleData = { + lastWeek: [ + { reviewer: 'Alice', Exceptional: 2, Sufficient: 1, NeedsChanges: 1, DidNotReview: 0 }, + { reviewer: 'Bob', Exceptional: 1, Sufficient: 2, NeedsChanges: 0, DidNotReview: 1 }, + ], + last2weeks: [ + { reviewer: 'Alice', Exceptional: 3, Sufficient: 2, NeedsChanges: 1, DidNotReview: 0 }, + { reviewer: 'Bob', Exceptional: 2, Sufficient: 3, NeedsChanges: 1, DidNotReview: 1 }, + { reviewer: 'Carol', Exceptional: 4, Sufficient: 2, NeedsChanges: 0, DidNotReview: 0 }, + ], + lastMonth: [ + { reviewer: 'Alice', Exceptional: 5, Sufficient: 3, NeedsChanges: 2, DidNotReview: 0 }, + { reviewer: 'Bob', Exceptional: 2, Sufficient: 4, NeedsChanges: 1, DidNotReview: 1 }, + { reviewer: 'Carol', Exceptional: 6, Sufficient: 2, NeedsChanges: 0, DidNotReview: 0 }, + { reviewer: 'David', Exceptional: 1, Sufficient: 2, NeedsChanges: 3, DidNotReview: 4 }, + ], + allTime: [ + { reviewer: 'Alice', Exceptional: 5, Sufficient: 3, NeedsChanges: 2, DidNotReview: 0 }, + { reviewer: 'Bob', Exceptional: 2, Sufficient: 4, NeedsChanges: 1, DidNotReview: 1 }, + { reviewer: 'Carol', Exceptional: 6, Sufficient: 2, NeedsChanges: 0, DidNotReview: 0 }, + { reviewer: 'David', Exceptional: 1, Sufficient: 2, NeedsChanges: 3, DidNotReview: 4 }, + { reviewer: 'Eve', Exceptional: 3, Sufficient: 3, NeedsChanges: 2, DidNotReview: 1 } + ] +}; - useEffect(() => { +const ReviewersRequirementChart = ({ duration }) => { + useEffect(() => { const fetchAPIData = async () => { try { const res = await fetch(`http://localhost:4500/api/analytics/review-summary?duration=${duration}`); @@ -75,40 +57,47 @@ const ReviewersRequirementChart = () => { fetchAPIData(); }, [duration]); - return (
-
- - -
- - - - - - - - - - - - +
+ + + + + + + + + + + + + + + + + + + + +
); }; + export default ReviewersRequirementChart; diff --git a/src/routes.js b/src/routes.js index e33478b927..8c6619f875 100644 --- a/src/routes.js +++ b/src/routes.js @@ -141,6 +141,7 @@ import PopularPRChart from 'components/Analytics/PopularPRChart'; import LogTools from './components/BMDashboard/LogTools/LogTools'; import EquipmentUpdate from './components/BMDashboard/Tools/EquipmentUpdate'; import ReviewersRequirementChart from 'components/Analytics/ReviewersRequirementChart'; +import AnalyticsDashboard from 'components/Analytics/AnalyticsDashboard'; // Social Architecture const ResourceManagement = lazy(() => import('./components/ResourceManagement/ResourceManagement')); @@ -493,6 +494,12 @@ export default ( component={ReviewersRequirementChart} fallback /> + {/* ----- BEGIN BM Dashboard Routing ----- */} From 883bcc801b21e1a1dddddc5d3112a32508522a28 Mon Sep 17 00:00:00 2001 From: myeeli Date: Sat, 5 Jul 2025 17:54:03 -0400 Subject: [PATCH 04/11] Tried fetching the data from the backend --- .../Analytics/ReviewersRequirementChart.jsx | 80 ++++++++++--------- 1 file changed, 43 insertions(+), 37 deletions(-) diff --git a/src/components/Analytics/ReviewersRequirementChart.jsx b/src/components/Analytics/ReviewersRequirementChart.jsx index 5b7dca5164..d9ff119ebf 100644 --- a/src/components/Analytics/ReviewersRequirementChart.jsx +++ b/src/components/Analytics/ReviewersRequirementChart.jsx @@ -1,4 +1,4 @@ -import React, { useState, useEffect } from 'react'; +import React, { useEffect } from 'react'; import { BarChart, Bar, @@ -10,14 +10,6 @@ import { LabelList } from 'recharts'; -const durationOptions = [ - { label: 'Last Week', value: 'lastWeek' }, - { label: 'Last 2 weeks', value: 'last2weeks' }, - { label: 'Last Month', value: 'lastMonth' }, - { label: 'All Time', value: 'allTime' }, -]; - -// Sample data const fullSampleData = { lastWeek: [ { reviewer: 'Alice', Exceptional: 2, Sufficient: 1, NeedsChanges: 1, DidNotReview: 0 }, @@ -44,53 +36,68 @@ const fullSampleData = { }; const ReviewersRequirementChart = ({ duration }) => { - useEffect(() => { + useEffect(() => { + console.log("reached here") const fetchAPIData = async () => { try { - const res = await fetch(`http://localhost:4500/api/analytics/review-summary?duration=${duration}`); + const token = localStorage.getItem('token'); + // console.log(token); + const res = await fetch( + `http://localhost:4500/api/analytics/github-reviews`, + { + headers: { + Authorization: `${token}`, + 'Content-Type': 'application/json', + }, + } + ); + + if (!res.ok) { + const error = await res.json(); + throw new Error(error.message); + } + const data = await res.json(); console.log('API Response:', data); } catch (err) { - console.error('Error fetching data:', err); + console.error('Error fetching data:', err.message); } }; fetchAPIData(); - }, [duration]); + }, []); + + const processedData = fullSampleData[duration].map(item => ({ + ...item, + total: + (item.Exceptional || 0) + + (item.Sufficient || 0) + + (item.NeedsChanges || 0) + + (item.DidNotReview || 0), + })); + return (
-
- - + + - - - - - - - - - + + + - + @@ -99,5 +106,4 @@ const ReviewersRequirementChart = ({ duration }) => { ); }; - export default ReviewersRequirementChart; From f6429a47ed79941adf01114cbd85a10d12cc2029 Mon Sep 17 00:00:00 2001 From: myeeli Date: Fri, 11 Jul 2025 09:29:18 -0400 Subject: [PATCH 05/11] Connected the API to the frontend and tested if the api is working effectively --- .../Analytics/AnalyticsDashboard.jsx | 4 +- .../Analytics/ReviewersRequirementChart.jsx | 90 ++++++++----------- 2 files changed, 39 insertions(+), 55 deletions(-) diff --git a/src/components/Analytics/AnalyticsDashboard.jsx b/src/components/Analytics/AnalyticsDashboard.jsx index f1b0a10731..ebb3da70ac 100644 --- a/src/components/Analytics/AnalyticsDashboard.jsx +++ b/src/components/Analytics/AnalyticsDashboard.jsx @@ -32,10 +32,10 @@ const AnalyticsDashboard = () => {
-
+ {/*

20 Most Popular PRs

-
+
*/}
); }; diff --git a/src/components/Analytics/ReviewersRequirementChart.jsx b/src/components/Analytics/ReviewersRequirementChart.jsx index d9ff119ebf..d85610b7fd 100644 --- a/src/components/Analytics/ReviewersRequirementChart.jsx +++ b/src/components/Analytics/ReviewersRequirementChart.jsx @@ -1,4 +1,4 @@ -import React, { useEffect } from 'react'; +import React, { useEffect, useState } from 'react'; import { BarChart, Bar, @@ -10,55 +10,38 @@ import { LabelList } from 'recharts'; -const fullSampleData = { - lastWeek: [ - { reviewer: 'Alice', Exceptional: 2, Sufficient: 1, NeedsChanges: 1, DidNotReview: 0 }, - { reviewer: 'Bob', Exceptional: 1, Sufficient: 2, NeedsChanges: 0, DidNotReview: 1 }, - ], - last2weeks: [ - { reviewer: 'Alice', Exceptional: 3, Sufficient: 2, NeedsChanges: 1, DidNotReview: 0 }, - { reviewer: 'Bob', Exceptional: 2, Sufficient: 3, NeedsChanges: 1, DidNotReview: 1 }, - { reviewer: 'Carol', Exceptional: 4, Sufficient: 2, NeedsChanges: 0, DidNotReview: 0 }, - ], - lastMonth: [ - { reviewer: 'Alice', Exceptional: 5, Sufficient: 3, NeedsChanges: 2, DidNotReview: 0 }, - { reviewer: 'Bob', Exceptional: 2, Sufficient: 4, NeedsChanges: 1, DidNotReview: 1 }, - { reviewer: 'Carol', Exceptional: 6, Sufficient: 2, NeedsChanges: 0, DidNotReview: 0 }, - { reviewer: 'David', Exceptional: 1, Sufficient: 2, NeedsChanges: 3, DidNotReview: 4 }, - ], - allTime: [ - { reviewer: 'Alice', Exceptional: 5, Sufficient: 3, NeedsChanges: 2, DidNotReview: 0 }, - { reviewer: 'Bob', Exceptional: 2, Sufficient: 4, NeedsChanges: 1, DidNotReview: 1 }, - { reviewer: 'Carol', Exceptional: 6, Sufficient: 2, NeedsChanges: 0, DidNotReview: 0 }, - { reviewer: 'David', Exceptional: 1, Sufficient: 2, NeedsChanges: 3, DidNotReview: 4 }, - { reviewer: 'Eve', Exceptional: 3, Sufficient: 3, NeedsChanges: 2, DidNotReview: 1 } - ] -}; +// const [data, setData] = useState([]); const ReviewersRequirementChart = ({ duration }) => { + const [data, setData] = useState([]); + useEffect(() => { - console.log("reached here") const fetchAPIData = async () => { try { const token = localStorage.getItem('token'); - // console.log(token); - const res = await fetch( - `http://localhost:4500/api/analytics/github-reviews`, - { - headers: { - Authorization: `${token}`, - 'Content-Type': 'application/json', - }, - } - ); + const res = await fetch(`http://localhost:4500/api/analytics/github-reviews`, { + headers: { + Authorization: `${token}`, + 'Content-Type': 'application/json', + }, + }); if (!res.ok) { const error = await res.json(); throw new Error(error.message); } - const data = await res.json(); - console.log('API Response:', data); + const result = await res.json(); + const processed = result.map(item => ({ + ...item, + total: + (item.Exceptional || 0) + + (item.Sufficient || 0) + + (item.NeedsChanges || 0) + + (item.DidNotReview || 0), + })); + + setData(processed); } catch (err) { console.error('Error fetching data:', err.message); } @@ -67,22 +50,25 @@ const ReviewersRequirementChart = ({ duration }) => { fetchAPIData(); }, []); - const processedData = fullSampleData[duration].map(item => ({ + const sortedData = [...data] + .map(item => ({ ...item, - total: - (item.Exceptional || 0) + - (item.Sufficient || 0) + - (item.NeedsChanges || 0) + - (item.DidNotReview || 0), - })); + ...item.counts, + total: Object.values(item.counts).reduce((acc, val) => acc + val, 0), + })) + .sort((a, b) => b.total - a.total) + + + const barHeight = 15; + const chartHeight = sortedData.length * barHeight; return ( -
+
- + @@ -93,11 +79,7 @@ const ReviewersRequirementChart = ({ duration }) => { - + @@ -107,3 +89,5 @@ const ReviewersRequirementChart = ({ duration }) => { }; export default ReviewersRequirementChart; + + From f111b348649e9d7a3d5b2174655dd907d59e76c2 Mon Sep 17 00:00:00 2001 From: myeeli Date: Sat, 12 Jul 2025 19:05:22 -0400 Subject: [PATCH 06/11] Corrected the API call --- src/components/Analytics/ReviewersRequirementChart.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Analytics/ReviewersRequirementChart.jsx b/src/components/Analytics/ReviewersRequirementChart.jsx index d85610b7fd..0433623504 100644 --- a/src/components/Analytics/ReviewersRequirementChart.jsx +++ b/src/components/Analytics/ReviewersRequirementChart.jsx @@ -19,7 +19,7 @@ const ReviewersRequirementChart = ({ duration }) => { const fetchAPIData = async () => { try { const token = localStorage.getItem('token'); - const res = await fetch(`http://localhost:4500/api/analytics/github-reviews`, { + const res = await fetch(`http://localhost:4500/api/analytics/github-reviews?duration=lastWeek&sort=asc`, { headers: { Authorization: `${token}`, 'Content-Type': 'application/json', From 32a3408eb50f9b3aee9f044a2fafd45742534323 Mon Sep 17 00:00:00 2001 From: myeeli Date: Tue, 17 Feb 2026 10:40:57 -0500 Subject: [PATCH 07/11] resolved conflicts --- src/routes.jsx | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/routes.jsx b/src/routes.jsx index 9903b17a57..f2603af96f 100644 --- a/src/routes.jsx +++ b/src/routes.jsx @@ -164,13 +164,6 @@ import BrowseLessonPlan from './components/EductionPortal/BrowseLessonPlan/Brows import EPDashboard from './components/EductionPortal'; import MostSusceptibleTools from './components/MostSusceptible/toolBreakdownChart'; - -import HelpPage from './components/LandingPage/HelpPage'; - -import LandingPage from './components/HGNHelpSkillsDashboard/LandingPage'; -import SkillsOverviewPage from './components/HGNHelpSkillsDashboard/SkillsOverviewPage'; -import CommunityMembersPage from './components/HGNHelpSkillsDashboard/CommunityMembersPage'; -import UserProfilePage from './components/HGNHelpSkillsDashboard/UserProfilePage'; import FeedbackModal from './components/HGNHelpSkillsDashboard/FeedbackModal'; import PopularPRChart from './components/Analytics/PopularPRChart'; From a3eaf50d6fa7dfbbb32de1e0016c93b5381f9349 Mon Sep 17 00:00:00 2001 From: myeeli Date: Tue, 17 Feb 2026 10:47:53 -0500 Subject: [PATCH 08/11] resolved conflicts --- src/routes.jsx | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/routes.jsx b/src/routes.jsx index f2603af96f..94aa6474ab 100644 --- a/src/routes.jsx +++ b/src/routes.jsx @@ -164,12 +164,10 @@ import BrowseLessonPlan from './components/EductionPortal/BrowseLessonPlan/Brows import EPDashboard from './components/EductionPortal'; import MostSusceptibleTools from './components/MostSusceptible/toolBreakdownChart'; -import FeedbackModal from './components/HGNHelpSkillsDashboard/FeedbackModal'; import PopularPRChart from './components/Analytics/PopularPRChart'; // import AddActivities from './components/CommunityPortal/Activities/AddActivities'; // import ActvityDetailPage from './components/CommunityPortal/Activities/ActivityDetailPage'; -import ActivityAgenda from './components/CommunityPortal/Activities/ActivityAgenda'; // HGN PR Dashboard import AssignAtoms from './components/EductionPortal/AssignAtoms/AssignAtoms'; import ReportDownloadButton from './components/EductionPortal/AnalyticsDashboard/ReportDownloadButton'; @@ -203,11 +201,8 @@ import SupportLogViewer from './components/SupportPortal/SupportLogViewer'; import MaterialUtilizationChart from './components/MaterialUtilization/MaterialUtilizationChart'; // eslint-disable-next-line import/order, import/no-unresolved -import LogTools from './components/BMDashboard/LogTools/LogTools'; // import IssueDashboard from './components/BMDashboard/Issues/IssueDashboard'; -import EquipmentUpdate from './components/BMDashboard/Tools/EquipmentUpdate'; import ReviewersRequirementChart from './components/Analytics/ReviewersRequirementChart'; -import AnalyticsDashboard from './components/Analytics/AnalyticsDashboard'; // Social Architecture From b9562c8d6d71ae5e5fdb0638c3b5f47927b90123 Mon Sep 17 00:00:00 2001 From: myeeli Date: Tue, 17 Feb 2026 10:56:12 -0500 Subject: [PATCH 09/11] resolved conflicts --- src/routes.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes.jsx b/src/routes.jsx index 94aa6474ab..b0c8411a75 100644 --- a/src/routes.jsx +++ b/src/routes.jsx @@ -163,7 +163,7 @@ import EPLogin from './components/EductionPortal/Login'; import BrowseLessonPlan from './components/EductionPortal/BrowseLessonPlan/BrowseLP'; import EPDashboard from './components/EductionPortal'; -import MostSusceptibleTools from './components/MostSusceptible/toolBreakdownChart'; +// import MostSusceptibleTools from './components/MostSusceptible/toolBreakdownChart'; import PopularPRChart from './components/Analytics/PopularPRChart'; // import AddActivities from './components/CommunityPortal/Activities/AddActivities'; From 7b454b3011dea31586a08f31527589360fd6321d Mon Sep 17 00:00:00 2001 From: myeeli Date: Tue, 17 Feb 2026 11:10:11 -0500 Subject: [PATCH 10/11] resolved conflicts --- .../Analytics/AnalyticsDashboard.jsx | 43 +++++++------ src/components/Analytics/PopularPRChart.jsx | 63 ++++++++++++------- .../Analytics/ReviewersRequirementChart.jsx | 63 ++++++++++--------- src/routes.jsx | 18 ++---- 4 files changed, 104 insertions(+), 83 deletions(-) diff --git a/src/components/Analytics/AnalyticsDashboard.jsx b/src/components/Analytics/AnalyticsDashboard.jsx index ebb3da70ac..adaff255be 100644 --- a/src/components/Analytics/AnalyticsDashboard.jsx +++ b/src/components/Analytics/AnalyticsDashboard.jsx @@ -1,41 +1,48 @@ -import React, { useState } from 'react'; -import ReviewersRequirementChart from './ReviewersRequirementChart'; -import PopularPRChart from './PopularPRChart'; +import React, { useState } from "react"; +import ReviewersRequirementChart from "./ReviewersRequirementChart"; +import PopularPRChart from "./PopularPRChart"; const durationOptions = [ - { label: 'Last Week', value: 'lastWeek' }, - { label: 'Last 2 weeks', value: 'last2weeks' }, - { label: 'Last Month', value: 'lastMonth' }, - { label: 'All Time', value: 'allTime' }, + { label: "Last Week", value: "lastWeek" }, + { label: "Last 2 weeks", value: "last2weeks" }, + { label: "Last Month", value: "lastMonth" }, + { label: "All Time", value: "allTime" }, ]; const AnalyticsDashboard = () => { - const [duration, setDuration] = useState('lastWeek'); + const [duration, setDuration] = useState("lastWeek"); return ( -
-
- +
+
+ +
-
-

Reviewers Ranked by Requirement Satisfied

+
+

+ Reviewers Ranked by Requirement Satisfied +

- {/*
-

20 Most Popular PRs

+ {/* +
+

20 Most Popular PRs

-
*/} +
+ */}
); }; diff --git a/src/components/Analytics/PopularPRChart.jsx b/src/components/Analytics/PopularPRChart.jsx index bcd765cc70..939a703c87 100644 --- a/src/components/Analytics/PopularPRChart.jsx +++ b/src/components/Analytics/PopularPRChart.jsx @@ -1,33 +1,39 @@ -import React from 'react'; +import React from "react"; import { - BarChart, Bar, XAxis, YAxis, Tooltip, ResponsiveContainer, LabelList -} from 'recharts'; + BarChart, + Bar, + XAxis, + YAxis, + Tooltip, + ResponsiveContainer, + LabelList, +} from "recharts"; const data = [ - { prNumber: 'PR1234', reviews: 10 }, - { prNumber: 'PR1235', reviews: 8 }, - { prNumber: 'PR1236', reviews: 15 }, - { prNumber: 'PR1237', reviews: 5 }, - { prNumber: 'PR1238', reviews: 12 }, - { prNumber: 'PR1231', reviews: 12 }, - { prNumber: 'PR1256', reviews: 17 }, - { prNumber: 'PR1255', reviews: 19 }, - { prNumber: 'PR1254', reviews: 1 }, - { prNumber: 'PR1253', reviews: 2 }, - { prNumber: 'PR1252', reviews: 7 }, - { prNumber: 'PR1251', reviews: 9 }, - { prNumber: 'PR1250', reviews: 11 }, - { prNumber: 'PR1249', reviews: 19 }, - { prNumber: 'PR1248', reviews: 0 }, - { prNumber: 'PR1242', reviews: 2 }, - { prNumber: 'PR1241', reviews: 50 } + { prNumber: "PR1234", reviews: 10 }, + { prNumber: "PR1235", reviews: 8 }, + { prNumber: "PR1236", reviews: 15 }, + { prNumber: "PR1237", reviews: 5 }, + { prNumber: "PR1238", reviews: 12 }, + { prNumber: "PR1231", reviews: 12 }, + { prNumber: "PR1256", reviews: 17 }, + { prNumber: "PR1255", reviews: 19 }, + { prNumber: "PR1254", reviews: 1 }, + { prNumber: "PR1253", reviews: 2 }, + { prNumber: "PR1252", reviews: 7 }, + { prNumber: "PR1251", reviews: 9 }, + { prNumber: "PR1250", reviews: 11 }, + { prNumber: "PR1249", reviews: 19 }, + { prNumber: "PR1248", reviews: 0 }, + { prNumber: "PR1242", reviews: 2 }, + { prNumber: "PR1241", reviews: 50 }, ]; const PopularPRChart = ({ duration }) => { const filteredData = data; return ( -
+
{ > + + + diff --git a/src/components/Analytics/ReviewersRequirementChart.jsx b/src/components/Analytics/ReviewersRequirementChart.jsx index d7c6b6eea8..1789dbc99c 100644 --- a/src/components/Analytics/ReviewersRequirementChart.jsx +++ b/src/components/Analytics/ReviewersRequirementChart.jsx @@ -1,4 +1,4 @@ -import React, { useEffect, useState } from 'react'; +import React, { useEffect, useState } from "react"; import { BarChart, Bar, @@ -7,10 +7,8 @@ import { Tooltip, ResponsiveContainer, Legend, - LabelList -} from 'recharts'; - -// const [data, setData] = useState([]); + LabelList, +} from "recharts"; const ReviewersRequirementChart = ({ duration }) => { const [data, setData] = useState([]); @@ -18,13 +16,17 @@ const ReviewersRequirementChart = ({ duration }) => { useEffect(() => { const fetchAPIData = async () => { try { - const token = localStorage.getItem('token'); - const res = await fetch(`http://localhost:4500/api/analytics/github-reviews?duration=${duration}&sort=asc`, { - headers: { - Authorization: `${token}`, - 'Content-Type': 'application/json', - }, - }); + const token = localStorage.getItem("token"); + + const res = await fetch( + `http://localhost:4500/api/analytics/github-reviews?duration=${duration}&sort=asc`, + { + headers: { + Authorization: `${token}`, + "Content-Type": "application/json", + }, + } + ); if (!res.ok) { const error = await res.json(); @@ -32,8 +34,8 @@ const ReviewersRequirementChart = ({ duration }) => { } const result = await res.json(); - console.log(result); - const processed = result.map(item => ({ + + const processed = result.map((item) => ({ ...item, total: (item.Exceptional || 0) + @@ -44,7 +46,7 @@ const ReviewersRequirementChart = ({ duration }) => { setData(processed); } catch (err) { - console.error('Error fetching data:', err.message); + // If your lint blocks console, keep it silent or wire to your logger/toast } }; @@ -52,20 +54,22 @@ const ReviewersRequirementChart = ({ duration }) => { }, [duration]); const sortedData = [...data] - .map(item => ({ - ...item, - ...item.counts, - total: Object.values(item.counts).reduce((acc, val) => acc + val, 0), - })) - .sort((a, b) => b.total - a.total) - + .map((item) => ({ + ...item, + ...item.counts, + total: Object.values(item.counts || {}).reduce( + (acc, val) => acc + val, + 0 + ), + })) + .sort((a, b) => b.total - a.total); - const barHeight = 15; + const barHeight = 15; const chartHeight = sortedData.length * barHeight; return ( -
-
+
+
{ + - + @@ -90,5 +99,3 @@ const ReviewersRequirementChart = ({ duration }) => { }; export default ReviewersRequirementChart; - - diff --git a/src/routes.jsx b/src/routes.jsx index b0c8411a75..82fb3dcd76 100644 --- a/src/routes.jsx +++ b/src/routes.jsx @@ -572,25 +572,15 @@ export default ( allowedRoles={[UserRole.Owner]} /> - + + - - + @@ -639,7 +629,7 @@ export default ( exact component={AnalyticsDashboard} fallback - // allowedRoles={[UserRole.Administrator, UserRole.Owner]} + // allowedRoles={[UserRole.Administrator, UserRole.Owner]} /> {/* ----- BEGIN BM Dashboard Routing ----- */} From 868ec127ed54d3877ace499d02663de5d49bd67c Mon Sep 17 00:00:00 2001 From: myeeli Date: Tue, 17 Feb 2026 11:18:46 -0500 Subject: [PATCH 11/11] resolved conflicts --- src/components/Analytics/AnalyticsDashboard.jsx | 1 + src/components/Analytics/PopularPRChart.jsx | 1 + src/components/Analytics/ReviewersRequirementChart.jsx | 1 + src/routes.jsx | 2 +- 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/Analytics/AnalyticsDashboard.jsx b/src/components/Analytics/AnalyticsDashboard.jsx index adaff255be..1255b1c2d3 100644 --- a/src/components/Analytics/AnalyticsDashboard.jsx +++ b/src/components/Analytics/AnalyticsDashboard.jsx @@ -1,3 +1,4 @@ +/* eslint-disable prettier/prettier */ import React, { useState } from "react"; import ReviewersRequirementChart from "./ReviewersRequirementChart"; import PopularPRChart from "./PopularPRChart"; diff --git a/src/components/Analytics/PopularPRChart.jsx b/src/components/Analytics/PopularPRChart.jsx index 939a703c87..45f7d23e36 100644 --- a/src/components/Analytics/PopularPRChart.jsx +++ b/src/components/Analytics/PopularPRChart.jsx @@ -1,3 +1,4 @@ +/* eslint-disable prettier/prettier */ import React from "react"; import { BarChart, diff --git a/src/components/Analytics/ReviewersRequirementChart.jsx b/src/components/Analytics/ReviewersRequirementChart.jsx index 1789dbc99c..c19dfdf42d 100644 --- a/src/components/Analytics/ReviewersRequirementChart.jsx +++ b/src/components/Analytics/ReviewersRequirementChart.jsx @@ -1,3 +1,4 @@ +/* eslint-disable prettier/prettier */ import React, { useEffect, useState } from "react"; import { BarChart, diff --git a/src/routes.jsx b/src/routes.jsx index 82fb3dcd76..e8f7d5f231 100644 --- a/src/routes.jsx +++ b/src/routes.jsx @@ -629,7 +629,7 @@ export default ( exact component={AnalyticsDashboard} fallback - // allowedRoles={[UserRole.Administrator, UserRole.Owner]} + // allowedRoles={[UserRole.Administrator, UserRole.Owner]} /> {/* ----- BEGIN BM Dashboard Routing ----- */}