From 23ad1f01eb4f48cb7ae818a6d9d7d664085be982 Mon Sep 17 00:00:00 2001 From: anthonybernardi Date: Thu, 15 Sep 2022 15:59:34 -0400 Subject: [PATCH] Squashed commit of the following: commit 7d5d707e69b8e61312a0b40a9b58eef117cbf8a1 Merge: 2bf3abe b66247e Author: Anthony Bernardi <63663597+anthonybernardi@users.noreply.github.com> Date: Thu Sep 15 12:24:38 2022 -0700 Merge pull request #185 from Northeastern-Electric-Racing/#70-wire-up-cr-button #70 - Wire Up Create New CR Button for Risks commit b66247e3de1aa8685f2d8f3c0a3c8ec02dd80d7a Merge: 02d5a20 2bf3abe Author: anthonybernardi Date: Thu Sep 15 14:56:55 2022 -0400 Merge branch 'develop' into #70-wire-up-cr-button commit 2bf3abeef4cf269a4327cc8f5c2ce7a41078f662 Merge: 8d018ca 46dd804 Author: Anthony Bernardi <63663597+anthonybernardi@users.noreply.github.com> Date: Thu Sep 15 11:54:12 2022 -0700 Merge pull request #151 from Northeastern-Electric-Racing/#68 #68: Wire Up Risk Log commit 02d5a20f191c4135d11e0454ba41486c2b8cc4a6 Author: Aritra (Ari) Saharay <80832201+Ari-S-123@users.noreply.github.com> Date: Thu Sep 15 09:33:36 2022 -0400 #70 - post merge tweaks commit edddeb57294c26a63b4ddf05e07efb717987b617 Merge: 372f1f2 46dd804 Author: Aritra (Ari) Saharay <80832201+Ari-S-123@users.noreply.github.com> Date: Thu Sep 15 09:25:30 2022 -0400 Merge branch '#68' into #70-wire-up-cr-button # Conflicts: # src/frontend/src/pages/ProjectDetailPage/ProjectViewContainer/ProjectViewContainer.tsx # src/frontend/src/pages/ProjectDetailPage/ProjectViewContainer/RiskLog.tsx commit 46dd8041d38f5afaf420999b5743c362cae33906 Author: Anthony Bernardi Date: Wed Sep 14 23:10:21 2022 -0400 #68: forgot a curly brace lol commit 0e2a063320be00de2d6d4a6a7b5f89e30e9f728e Author: Anthony Bernardi Date: Wed Sep 14 23:05:06 2022 -0400 #68: describe skip is much better commit 663efe51efa1efdc4b65b0d178b08c438a4ed868 Author: Anthony Bernardi Date: Wed Sep 14 23:04:23 2022 -0400 #68: updated so that query invalidation works and other small stuff commit 977812816bef330cfca8586345d13b31d3fcb21b Author: Zack Roth Date: Wed Sep 14 20:44:59 2022 -0400 #68 - Pushing Everything git add -A! commit 372f1f2f08ac33c76e80bf8d005cb8d9356d4e59 Author: Aritra (Ari) Saharay <80832201+Ari-S-123@users.noreply.github.com> Date: Wed Sep 14 15:16:55 2022 -0400 #70 - Refactored according to feedback commit 77f4bd48b5ecf81fa88a0b0b037d7425b213ea6b Author: Aritra (Ari) Saharay <80832201+Ari-S-123@users.noreply.github.com> Date: Wed Sep 14 14:51:30 2022 -0400 #70 - post merge fixes commit 9e4d9478bcf0e7ada030e1a35468ebe64b307c3f Merge: 8d67dde cfa164f Author: Aritra (Ari) Saharay <80832201+Ari-S-123@users.noreply.github.com> Date: Wed Sep 14 14:30:27 2022 -0400 Merge branch '#68' into #70-wire-up-cr-button # Conflicts: # src/frontend/src/components/CheckList.tsx # src/frontend/src/pages/ProjectDetailPage/ProjectViewContainer/ProjectViewContainer.tsx # src/frontend/src/pages/ProjectDetailPage/ProjectViewContainer/RiskLog.tsx commit 8d018cacabe988dab347d72ac3b42959a7c9f85e Merge: 9be92ae 27138df Author: Anthony Bernardi <63663597+anthonybernardi@users.noreply.github.com> Date: Mon Sep 12 09:52:26 2022 -0700 Merge pull request #197 from Northeastern-Electric-Racing/#196 #196: Confluence commit 27138dfdbb47c30c0188d47181ff2a84c9bcec25 Author: anthonybernardi Date: Mon Sep 12 12:48:49 2022 -0400 #196: tearing out everything commit cfa164fceea7e687f4dacfbb0ce6c11920be205b Author: Zack Roth Date: Mon Sep 12 10:14:37 2022 -0400 #68 - Added Risks APIs, hooks, and began to implement frontend logic. commit 9be92ae346e0797f91e8f3b83b4b50fcbe4b0822 Merge: 34c368a 89533f6 Author: Anthony Bernardi <63663597+anthonybernardi@users.noreply.github.com> Date: Fri Sep 9 16:20:39 2022 -0700 Merge pull request #178 from Northeastern-Electric-Racing/#88-Add-New-Proposed-Solution-Endpoint #88-Added-a-new-endpoint-for-adding-proposed-solution commit 34c368a948bfe8095097b75de33781d02a84221d Merge: 69ded09 674f82f Author: Anthony Bernardi <63663597+anthonybernardi@users.noreply.github.com> Date: Fri Sep 9 16:02:31 2022 -0700 Merge pull request #193 from Northeastern-Electric-Racing/#184-google-calendar-links #184 - Add Google Calendar Links to the Dashboard commit 674f82fc254cc55c2f365814b717f53fec0d760f Author: Aritra (Ari) Saharay <80832201+Ari-S-123@users.noreply.github.com> Date: Fri Sep 9 17:00:20 2022 -0400 #184 - Refactored and updated tests commit 1391be9566914a2e2363f246fe9f92e16c96ceca Author: Aritra (Ari) Saharay <80832201+Ari-S-123@users.noreply.github.com> Date: Fri Sep 9 16:36:18 2022 -0400 #184 - Renamed Info to Information commit f0a78d7384c89199962a9935d0fcd0b08ae100c5 Author: Aritra (Ari) Saharay <80832201+Ari-S-123@users.noreply.github.com> Date: Fri Sep 9 00:57:10 2022 -0400 #184 - Rebranded Help to Info & implemented Calendar Links commit 8d67dde491e9be3b40335c2e63d44aebce736e5a Author: Aritra (Ari) Saharay <80832201+Ari-S-123@users.noreply.github.com> Date: Thu Sep 8 18:25:28 2022 -0400 #70 - Both wbsNum and risk details fill up properly now commit 759214528f8619c73021b1cdc97bd7b2c2f181f8 Merge: 4b21e39 28a17d3 Author: Aritra (Ari) Saharay <80832201+Ari-S-123@users.noreply.github.com> Date: Thu Sep 8 16:53:43 2022 -0400 Merge branch '#68' into #70-wire-up-cr-button commit 4b21e396f75008c49d06fb14d93cd51dae6a023e Merge: bf46676 a81a4b2 Author: Aritra (Ari) Saharay <80832201+Ari-S-123@users.noreply.github.com> Date: Thu Sep 8 16:26:58 2022 -0400 Merge branch '#702-wire-up-risk-log' into #70-wire-up-cr-button commit bf46676483f8912d1e15c66b9023c0ccd9b67d47 Merge: 6e2e6a1 69ded09 Author: Aritra (Ari) Saharay <80832201+Ari-S-123@users.noreply.github.com> Date: Thu Sep 8 15:59:33 2022 -0400 Merge branch 'develop' into #70-wire-up-cr-button commit 89533f6bbeb7e04c7f0d31aec06da7cf158f0db4 Author: Ji-min Kim Date: Wed Sep 7 13:10:07 2022 -0400 #88-updated-router-so-it-now-accpets-crId-instead-of-scopeCrId commit 69ded093123048eb7041ee23cdfec96020493050 Merge: 382e336 36b52a1 Author: James Chang-Davidson <51571627+jamescd18@users.noreply.github.com> Date: Fri Sep 2 17:37:26 2022 -0700 Merge pull request #179 from Northeastern-Electric-Racing/#35 #35: Create new WP Query Params commit 36b52a1c14b00373a5c7967311368e6c34a5da32 Author: Anthony Bernardi Date: Fri Sep 2 20:21:07 2022 -0400 #35: fixing tests commit a4e2774c405a69c2b4590b1c0da2668e81bc8d29 Author: Anthony Bernardi Date: Fri Sep 2 19:56:52 2022 -0400 #35: clicking create new change request now auto populates crid and wbs number commit 382e33688d975a14de6279147fa2e1b8b1f8e210 Merge: 2849be0 8c0ccf5 Author: Anthony Bernardi <63663597+anthonybernardi@users.noreply.github.com> Date: Fri Sep 2 16:20:21 2022 -0700 Merge pull request #173 from Northeastern-Electric-Racing/#172-stats-for-pm #172 - create baseline manual script for PM stats pull commit f1d933363e0b7fee62a0e6c4f4e7177018612ee7 Author: Ji-min Kim Date: Fri Sep 2 17:54:04 2022 -0400 #88-Added-a-new-endpoint-for-adding-proposed-solution commit 2849be06182401dcc74b61f00c25f0982fa77674 Merge: 759c9fe 7b436a9 Author: Anthony Bernardi <63663597+anthonybernardi@users.noreply.github.com> Date: Fri Sep 2 14:33:54 2022 -0700 Merge pull request #146 from Northeastern-Electric-Racing/#77-submit-cr-slack #77 submit cr slack notification commit 7b436a9215494e8bf995b31d65c05b2e5ce17edb Merge: 908f6c0 759c9fe Author: James C-D <51571627+jamescd18@users.noreply.github.com> Date: Thu Sep 1 21:24:42 2022 -0700 #77 - merge develop into branch commit 908f6c0699058dac9b4930dd639543a9a0ff9cdc Author: James C-D <51571627+jamescd18@users.noreply.github.com> Date: Thu Sep 1 21:17:05 2022 -0700 #77 - proper stop if not prod commit 97b066af3ebe3394a6438d85bfebba43eb552983 Author: James C-D <51571627+jamescd18@users.noreply.github.com> Date: Thu Sep 1 21:11:06 2022 -0700 #77 - only send messages if project linked to team and in prod commit 8c0ccf5711b7513e90e5cab3d653e9add7389441 Merge: bbb76cb 759c9fe Author: James Chang-Davidson <51571627+jamescd18@users.noreply.github.com> Date: Thu Sep 1 20:23:14 2022 -0700 Merge branch 'develop' into #172-stats-for-pm commit bbb76cb4f3a3deb5d12dc1c2edd452334ffebc9e Author: James C-D <51571627+jamescd18@users.noreply.github.com> Date: Thu Sep 1 20:20:34 2022 -0700 #172 - create baseline manual script for PM stats pull commit 964ee6049305f3b249bbcff1f83ef2f53f05381d Author: James C-D <51571627+jamescd18@users.noreply.github.com> Date: Thu Sep 1 20:17:22 2022 -0700 #77 - add manual script for creating teams commit 759c9fe7969b2e3aea949a8619ff3cc983341137 Merge: 0ba00c9 c85e9a2 Author: James Chang-Davidson <51571627+jamescd18@users.noreply.github.com> Date: Thu Sep 1 20:12:38 2022 -0700 #170 - Merge PR #170 - Apply prettier formatting commit c85e9a218e2d523e584d2082b7a27919c47229c2 Author: James C-D <51571627+jamescd18@users.noreply.github.com> Date: Thu Sep 1 20:08:58 2022 -0700 #170 - Apply prettier formatting commit 0ba00c968555a500699bd77f3312fbf4e5f6f93a Merge: 868e2db 1c3d633 Author: Anthony Bernardi <63663597+anthonybernardi@users.noreply.github.com> Date: Wed Aug 31 16:54:13 2022 -0700 Merge pull request #150 from Northeastern-Electric-Racing/#85 #85: Proposed Solution schema changes commit 4328d95788d4dd7063e5204215594949a240f825 Merge: 28a17d3 868e2db Author: Zack Roth Date: Wed Aug 31 19:47:42 2022 -0400 Merge branch 'develop' into #68 commit 28a17d3ea71eaa59e28e4522d1c16f2bdb3a5abe Author: Zack Roth Date: Wed Aug 31 19:39:14 2022 -0400 #68 - Wired risks from DB to frontend, updated tests, fixed bug with String/string commit 1c3d63334e4d981f64b08479761e061dc3a06911 Author: anthonybernardi Date: Wed Aug 31 19:23:39 2022 -0400 #85: account for accepted crs commit a73b2d6df1a89a82f77d96c3b5d7a216adbe0466 Merge: 6e1ca12 a81a4b2 Author: Zack Roth Date: Wed Aug 31 19:16:35 2022 -0400 Merge branch 'test' into #68 commit ecf2ba6530e4aa9b83d3a149afceeb64a2550a92 Author: anthonybernardi Date: Mon Aug 29 21:38:46 2022 -0400 #85: actual finishing touches commit 1f685b3483881dcd2195141cedde0b5f938554df Author: anthonybernardi Date: Mon Aug 29 21:33:42 2022 -0400 #85: finishing touches commit ec3ce622ac9f8b4b4cf4c0e35a833afaf8195258 Author: Anthony Bernardi Date: Mon Aug 29 19:52:39 2022 -0400 #85: adding more commit c2399abb195a8ae138a60c9611d62e50835f514f Author: anthonybernardi Date: Mon Aug 29 19:19:45 2022 -0400 #85: better script commit 0d5f8afdc59ef64f768eb7eb6308b07f78f3e9a1 Author: anthonybernardi Date: Mon Aug 29 19:13:24 2022 -0400 #85: migration script commit 13c0b176d59aefd1574142c127677abc47112c28 Author: anthonybernardi Date: Mon Aug 29 19:01:17 2022 -0400 #85: took out the proposed solutions on users lol commit 28d255a72aaa29444dbb8261d9803c5bf6e6ecbe Author: anthonybernardi Date: Mon Aug 29 19:00:08 2022 -0400 #85: feedback commit 868e2db3312ff29d6a257815f847dc6af7de47f6 Merge: e75e4a9 a38c574 Author: Anthony Bernardi <63663597+anthonybernardi@users.noreply.github.com> Date: Mon Aug 29 15:29:55 2022 -0700 Merge pull request #159 from Northeastern-Electric-Racing/#158 #158: changed the docs commit a38c574019cf0a3121ced66f30c3ee5b4a50d21e Author: anthonybernardi Date: Mon Aug 29 18:29:39 2022 -0400 #158: small typo commit f010b574cedb695f47a4bb2381f568d0d5ce4b20 Author: anthonybernardi Date: Mon Aug 29 18:26:02 2022 -0400 #158: changed the docs commit e75e4a9dadb222a14964ae84fee1fedbfbd6cec4 Merge: ffbea1b 7c9be41 Author: James Chang-Davidson <51571627+jamescd18@users.noreply.github.com> Date: Sun Aug 28 21:14:06 2022 -0700 Merge pull request #156 from Northeastern-Electric-Racing/#131 #131: Reset script is os agnostic commit ffbea1b20abb35c99641b39b4b49c0923ffcb677 Merge: 6333299 14a2309 Author: Anthony Bernardi <63663597+anthonybernardi@users.noreply.github.com> Date: Sun Aug 28 20:08:28 2022 -0700 Merge pull request #154 from Northeastern-Electric-Racing/#18 #18: added version number to settings page commit 14a230981bbf31a640351fbf049760117cad4953 Author: anthonybernardi Date: Sun Aug 28 23:04:24 2022 -0400 #18: renaming commit 7c9be41eda9820c7c82ce71bdc48d08bb782d08d Author: anthonybernardi Date: Sun Aug 28 22:50:58 2022 -0400 #131: added the package and changed the script commit 63332996eadfe9722881a5e326af754fd3b4375d Merge: ce8bb97 78d85e8 Author: Anthony Bernardi <63663597+anthonybernardi@users.noreply.github.com> Date: Sun Aug 28 15:54:35 2022 -0700 Merge pull request #155 from Northeastern-Electric-Racing/#100 #100: what does this ticket even mean commit cf723a4481c6082f64bb8868b7fd6863742b5d2c Author: Anthony Bernardi Date: Sun Aug 28 18:52:40 2022 -0400 #18: sidebar commit 78d85e868d3df5303d29c865418864432730f0b8 Author: Anthony Bernardi Date: Sun Aug 28 17:56:53 2022 -0400 #100: what does this ticket even mean commit 2fbf5318ce2ce3751cefd98817f1a9c382f216ca Author: Anthony Bernardi Date: Sun Aug 28 17:51:24 2022 -0400 #18: console log woops commit d5a4c0d6e85fa24745d1f4d63e72d9ad0d7262d0 Author: Anthony Bernardi Date: Sun Aug 28 17:49:34 2022 -0400 #18: added version number to settings page commit ce8bb979ad61b4213c1a85ab839de0860309c0a4 Merge: a8ad825 ff00731 Author: James Chang-Davidson <51571627+jamescd18@users.noreply.github.com> Date: Sat Aug 27 19:04:04 2022 -0400 Merge pull request #152 from Northeastern-Electric-Racing/#149-Make-WPs-appear-above-change-log commit ff0073171babf8c80a39a51f2ddf2237c96a8ae7 Author: Ji-min Kim Date: Sat Aug 27 17:30:59 2022 -0400 #149-updated-the-projects-page-so-the-wps-block-appears-above-the-changes-block commit 6e1ca1274a585adf869d8218077ca9135987e8de Author: Anthony Bernardi Date: Sat Aug 27 16:21:49 2022 -0400 #68: updating backend so that projects send risks commit d4e21f494fab274fe2fbc0e8eb51b1a6d6f489e7 Author: Anthony Bernardi Date: Sat Aug 27 13:29:38 2022 -0400 #85: added initial ideas commit a8ad8253bd32ff3cb0ef88fe650e574feb0fba08 Merge: c143e23 e837a16 Author: Anthony Bernardi Date: Sat Aug 27 12:32:05 2022 -0400 Merge branch 'main' into develop commit c143e231bcdd5591cbd93577cf71a387e85a5f4b Merge: 9705d87 34b3164 Author: James Chang-Davidson <51571627+jamescd18@users.noreply.github.com> Date: Fri Aug 26 19:13:19 2022 -0400 Merge pull request #147 from Northeastern-Electric-Racing/#24-fix-duration-calculation #24-now-uses-proper-duration-util-function commit 34b3164a03eaadb74e0abfc9a5beb73210221847 Author: Kevin Chen Date: Fri Aug 26 18:51:19 2022 -0400 #24-now-uses-proper-duration-util-function commit 719fa1d0d99234b48ed9296a22f0c02d303ac708 Author: James C-D <51571627+jamescd18@users.noreply.github.com> Date: Wed Aug 24 14:25:50 2022 -0400 #77 - add project name to activation and stage gate cr notifs commit 6d2cc8b240c629af3cbc12fe50988bf4f76b515e Author: James C-D <51571627+jamescd18@users.noreply.github.com> Date: Wed Aug 24 14:08:43 2022 -0400 #77 - fix wrong text for activation cr commit 8e04015fc7787647482995451b369517fe1eea2e Author: James C-D <51571627+jamescd18@users.noreply.github.com> Date: Wed Aug 24 13:51:10 2022 -0400 #77 - add budget threshold eboard ping commit 38f41064593a847d564d6f29586f8009e82f8587 Author: James C-D <51571627+jamescd18@users.noreply.github.com> Date: Wed Aug 24 02:56:33 2022 -0400 #77 - enhance the scope cr slack notification message commit 47363afdee25c1ca7cb7aebe176ff82ea0cee080 Author: James C-D <51571627+jamescd18@users.noreply.github.com> Date: Wed Aug 24 02:47:38 2022 -0400 #77 - abstraction and enhance cr slack notif commit 9ee68c1d2463a0a1e82ac17cfa2faf81571e08c3 Author: James C-D <51571627+jamescd18@users.noreply.github.com> Date: Wed Aug 24 02:33:42 2022 -0400 #77 - use more fun message format for stage gate commit 9f6ba07728ca5633da407fd5ba0444a8c2300a2d Author: James C-D <51571627+jamescd18@users.noreply.github.com> Date: Wed Aug 24 02:20:21 2022 -0400 #77 - add basic scope cr slack notification commit 1e8417783596a8eaecd8c4d7d5d4c1c106c8ba0e Author: James C-D <51571627+jamescd18@users.noreply.github.com> Date: Wed Aug 24 02:15:14 2022 -0400 #77 - add basic stage gate cr slack notification commit 3d4fd60b1205e4b0402ee593e96dafec6a848cad Author: James C-D <51571627+jamescd18@users.noreply.github.com> Date: Wed Aug 24 02:11:55 2022 -0400 #77 - add basic activation cr slack notification commit 8efa9b3ec6f98b4db8293848962d0bde5dd1be48 Author: James C-D <51571627+jamescd18@users.noreply.github.com> Date: Wed Aug 24 01:13:51 2022 -0400 #77 - add slack message send utility commit 16f4be42a8aeccd5d2c6e873f3950cd160d02212 Author: James C-D <51571627+jamescd18@users.noreply.github.com> Date: Wed Aug 24 00:17:53 2022 -0400 #77 - add Slack bot as first integration commit 9705d87178aa6eae4b1d5d4d481a68128484ab9d Merge: 5487962 cd4a6cf Author: Anthony Bernardi <63663597+anthonybernardi@users.noreply.github.com> Date: Sun Aug 21 16:33:26 2022 -0400 Merge pull request #144 from Northeastern-Electric-Racing/#67-delete-risk #67: Delete Risk Endpoint commit 5487962d4bf74ce26e2a689083ecd7f276092e0a Merge: 8f50afe f7d7eeb Author: Anthony Bernardi <63663597+anthonybernardi@users.noreply.github.com> Date: Sun Aug 21 16:30:22 2022 -0400 Merge pull request #140 from Northeastern-Electric-Racing/#138 #138: iykyk commit cd4a6cfdb3f3f867329087bbd38d3af1d54ca8a0 Author: anthonybernardi Date: Sat Aug 20 19:22:20 2022 -0400 #67: formatting commit a8d1d6b70fa1afb900fdd37863066a9e0503f58d Merge: d2372ef 8f50afe Author: Anthony Bernardi <63663597+anthonybernardi@users.noreply.github.com> Date: Sat Aug 20 19:21:03 2022 -0400 Merge branch 'develop' into #67-delete-risk commit 8f50afebc69ef32fd852113e9ef0db408b4bcb06 Merge: 099bc91 0dc1a38 Author: Anthony Bernardi <63663597+anthonybernardi@users.noreply.github.com> Date: Sat Aug 20 19:17:18 2022 -0400 Merge pull request #145 from Northeastern-Electric-Racing/#69-edit-risk #69: Edit Risk Endpoint commit 099bc917a70e628d0e8ea645484b48b78b506047 Merge: 685bd49 6ea0d01 Author: Anthony Bernardi <63663597+anthonybernardi@users.noreply.github.com> Date: Sat Aug 20 18:50:00 2022 -0400 Merge pull request #130 from Northeastern-Electric-Racing/#84-individual-proposed-solution-form #84 - Created Individual Proposed Solution Form commit 6ea0d01f6bd79d53610ba2e944a0600739e263b0 Author: Aritra (Ari) Saharay <80832201+Ari-S-123@users.noreply.github.com> Date: Sat Aug 20 17:05:46 2022 -0400 #84 - Moved files to proper location commit 0dc1a385df3cd8bf4b19842ec92e340b26f29238 Author: Anthony Bernardi Date: Sat Aug 20 14:35:12 2022 -0400 #69: updating perms for createRisk commit 87957e2609f05c21d0f096374daacac9ce13c860 Author: Anthony Bernardi Date: Sat Aug 20 14:22:03 2022 -0400 #69: (nice) adding the endpoint commit d2372ef6311dea1fe4fc641e2666d36b596d5cff Author: Anthony Bernardi Date: Sat Aug 20 13:02:25 2022 -0400 #67: added permissions commit f7d7eeb077c5a5d0970db6a2b86bf1cb94e93ca4 Author: anthonybernardi Date: Thu Aug 18 20:20:30 2022 -0400 #138: even better commit d56b0d73e6f4876f55fbcb90f72c0b1baad8685c Author: anthonybernardi Date: Thu Aug 18 14:03:13 2022 -0400 #138: tests commit cc48614d8d761d952aa487102c8f423a73338d3e Author: anthonybernardi Date: Thu Aug 18 13:56:12 2022 -0400 #138: iykyk commit a81a4b21ca6de8cbf1f9aac4614e9d95423ea845 Author: Zack Roth Date: Thu Aug 18 08:51:54 2022 -0400 #702 - Updating project type and transformer to support risks commit 3c0775e0d57276b8206f6031dbc719df0b431b25 Author: Zack Roth Date: Thu Aug 18 08:51:02 2022 -0400 #702 - Updated RiskLog, CheckList, ProjectViewContainer to handle risks commit ba06f5a1793cafcc708d85ab0e6b4dcaba62152f Author: Aritra (Ari) Saharay <80832201+Ari-S-123@users.noreply.github.com> Date: Wed Aug 17 22:54:04 2022 -0400 #84 - Added proper top margin for Add button commit 184070108edd50fcb722a9dfe30974b5c6c12e81 Author: Aritra (Ari) Saharay <80832201+Ari-S-123@users.noreply.github.com> Date: Wed Aug 17 22:48:39 2022 -0400 #84 - Rearranged components according to feedback and removed title commit 685bd498a641e31a0a17f3f313a0c318e56efd5f Merge: 429656a d138e19 Author: Anthony Bernardi <63663597+anthonybernardi@users.noreply.github.com> Date: Wed Aug 17 19:24:37 2022 -0400 Merge pull request #137 from Northeastern-Electric-Racing/#133-move-up-risk-log #133 - moving the risk log below summary above gantt chart commit 9e92f9de56f6ea33bf9e48379a6779b5e1199f2a Author: Zack Roth Date: Wed Aug 17 19:15:44 2022 -0400 #702 - Added Test Data commit d138e195c072d7ee8b4c8a6e4b69c31c6c652328 Author: leoRysing Date: Wed Aug 17 19:10:36 2022 -0400 #133 - moving the risk log below summary above gantt chart commit 004b100e841c720efe87bff2cf35ccc9cdfb13c6 Author: Aritra (Ari) Saharay <80832201+Ari-S-123@users.noreply.github.com> Date: Wed Aug 17 16:13:53 2022 -0400 #84 - Corrected Project Name in License commit 6d997740123fa59a28cb949c9a02623644637da7 Author: Aritra (Ari) Saharay <80832201+Ari-S-123@users.noreply.github.com> Date: Wed Aug 17 15:26:59 2022 -0400 #84 - Refactored according to feedback commit 429656a05ad811563bf7e08898473afed70182bd Author: anthonybernardi Date: Wed Aug 17 14:15:23 2022 -0400 updating documentation commit ccce8dc55279b3100f3417e3b0f675b999279140 Merge: 41f10a1 d95a677 Author: Anthony Bernardi <63663597+anthonybernardi@users.noreply.github.com> Date: Wed Aug 17 12:35:49 2022 -0400 Merge pull request #117 from Northeastern-Electric-Racing/#52-stop-self-reference-in-dependency-WP #52 stop self reference in dependency wp commit d95a67776607ae154baba17c76a1c9957d99421d Author: Kevin Chen Date: Wed Aug 17 01:36:01 2022 -0400 #79 - changed to use existing wbs number comparision util commit 41f10a122dc244540ff4b9390d833e42c465186f Merge: 960b678 76d533a Author: Anthony Bernardi <63663597+anthonybernardi@users.noreply.github.com> Date: Tue Aug 16 22:18:53 2022 -0400 Merge pull request #126 from Northeastern-Electric-Racing/#124-upcoming-deadlines-css #124 - updated home page to fix scroll commit 960b67837e24701bd8fbd2e229adb2ce176ee248 Merge: 7def825 c78c2de Author: Anthony Bernardi <63663597+anthonybernardi@users.noreply.github.com> Date: Tue Aug 16 22:16:41 2022 -0400 Merge pull request #127 from Northeastern-Electric-Racing/#125-fix-prettier-configs #125 fix prettier configs commit 33c6fbaf5789e0a1c9a161e76afac63e83e372c6 Author: Aritra (Ari) Saharay <80832201+Ari-S-123@users.noreply.github.com> Date: Tue Aug 16 18:14:23 2022 -0400 #84 - Added unit tests and updated Add Button behavior when readOnly commit 257ec045bf4b44fe1b8c4e3a2ec6edeb5a1c2fde Author: Aritra (Ari) Saharay <80832201+Ari-S-123@users.noreply.github.com> Date: Tue Aug 16 17:45:44 2022 -0400 #84 - Created Individual Proposed Solution Form commit 6e2e6a1213e56276938839d9c6c4365d58d88fb5 Author: Aritra (Ari) Saharay <80832201+Ari-S-123@users.noreply.github.com> Date: Tue Aug 16 14:59:08 2022 -0400 #70 - Create CR Button automatically opens the form with the 'what' section filled commit 76d533aaf1383debea47853e84de1408ec9a33a7 Merge: c7aef80 7def825 Author: James C-D <51571627+jamescd18@users.noreply.github.com> Date: Tue Aug 16 12:57:03 2022 -0400 Merge branch 'develop' into #124-upcoming-deadlines-css commit c78c2de38c7991f268d6eff3f76b53feab854e14 Merge: 930e43c 7def825 Author: James C-D <51571627+jamescd18@users.noreply.github.com> Date: Tue Aug 16 12:56:03 2022 -0400 Merge branch 'develop' into #125-fix-prettier-configs commit 7def8258a50a27886e9b16720fbee91be56497d9 Merge: 4cd7262 71ac95c Author: James Chang-Davidson <51571627+jamescd18@users.noreply.github.com> Date: Tue Aug 16 12:55:37 2022 -0400 Merge pull request #129 from Northeastern-Electric-Racing/#128-fix-name #128 - update test to FinishLine commit 71ac95c4e3ba81a31bf5308764479c896a49cb90 Author: James C-D <51571627+jamescd18@users.noreply.github.com> Date: Tue Aug 16 12:47:52 2022 -0400 #128 - update test to FinishLine commit 930e43cc9ee6ecd75239b9b9eafa6f37799b169a Author: James C-D <51571627+jamescd18@users.noreply.github.com> Date: Tue Aug 16 12:31:16 2022 -0400 #125 - run prettier on all files commit 446422485faf2500e184b0a4f612ae708db81e0d Author: James C-D <51571627+jamescd18@users.noreply.github.com> Date: Tue Aug 16 12:30:47 2022 -0400 #125 - add file types to be formatted by prettier commit c7aef80b0530e2180eb6e83616ce3249e4fb36b0 Author: James C-D <51571627+jamescd18@users.noreply.github.com> Date: Tue Aug 16 12:26:19 2022 -0400 #124 - updated home page to fix scroll commit 9b7f52fafd31a62472cabfea3204db13e16f9c61 Author: Anthony Bernardi Date: Sun Aug 14 23:41:39 2022 -0400 #67: added the endpoint commit d68f5b06b79e9cda6ef089b15f263c18ae7f3f3f Author: Kevin Chen Date: Fri Aug 12 16:12:38 2022 -0400 #52 - totally didn't get the issue number wrong and just reformatting commit 533cf5cd65f0a737173fcf127ff9e59f29961b01 Author: Kevin Chen Date: Fri Aug 12 16:10:48 2022 -0400 nothing here commit c90332a945d0a28130019d224b25b68f9373a4d7 Author: Kevin Chen Date: Fri Aug 12 16:09:34 2022 -0400 #79 - reformat and not committing just to adhere to commit message syntax commit 28d89c5d6277d4334a5fcf504d96cce3b72f8f9f Author: Kevin Chen Date: Fri Aug 12 16:03:10 2022 -0400 switched from checking wbs object ids to checking dependency list for both creation/edting wps commit e44c27dad522c6bf0bbd626b06f92983f45757f8 Author: Kevin Chen Date: Fri Aug 12 15:14:48 2022 -0400 Added prevention of self-reference for creation of work packages commit 500f8be588452b9c4ac977a925a29425ccf3e4c1 Author: Kevin Chen Date: Fri Aug 12 02:26:14 2022 -0400 prevents self dependency on editing, working on wp creation self dependency --- README.md | 11 +- docs/About.md | 45 ----- docs/ContributorGuide.md | 109 ----------- docs/Onboarding.md | 99 ---------- docs/OnboardingWindows.md | 118 ------------ docs/PrismaMigrationTools.md | 65 ------- .../change-requests.controllers.ts | 45 +++++ .../src/controllers/risks.controllers.ts | 9 +- .../src/routes/change-requests.routes.ts | 13 +- src/backend/src/utils/projects.utils.ts | 7 +- src/frontend/src/apis/Risks.api.ts | 46 +++++ src/frontend/src/app/AppAuthenticated.tsx | 4 +- src/frontend/src/components/CheckList.tsx | 103 ---------- src/frontend/src/components/ExternalLink.tsx | 8 +- src/frontend/src/hooks/Risks.hooks.ts | 82 ++++++++ src/frontend/src/layouts/Sidebar/Sidebar.tsx | 4 +- .../CreateChangeRequest.tsx | 8 +- .../CreateChangeRequestView.tsx | 9 +- src/frontend/src/pages/HelpPage.tsx | 63 ------ src/frontend/src/pages/InfoPage.tsx | 182 ++++++++++++++++++ .../ProjectViewContainer.tsx | 8 +- .../ProjectViewContainer/RiskLog.tsx | 181 ++++++++++++++++- ...heckList.module.css => RiskLog.module.css} | 0 .../TestSupport/TestData/Projects.stub.ts | 15 +- .../tests/TestSupport/TestData/Risks.stub.ts | 37 ++++ .../src/tests/components/CheckList.test.tsx | 68 ------- .../{HelpPage.test.tsx => InfoPage.test.tsx} | 21 +- .../ProjectViewContainer/RiskLog.test.tsx | 55 ++++-- src/frontend/src/utils/Routes.ts | 4 +- src/frontend/src/utils/Urls.ts | 13 ++ src/shared/src/types/project-types.ts | 2 + src/shared/src/types/risk-types.ts | 2 +- 32 files changed, 709 insertions(+), 727 deletions(-) delete mode 100644 docs/About.md delete mode 100644 docs/ContributorGuide.md delete mode 100644 docs/Onboarding.md delete mode 100644 docs/OnboardingWindows.md delete mode 100644 docs/PrismaMigrationTools.md create mode 100644 src/frontend/src/apis/Risks.api.ts delete mode 100644 src/frontend/src/components/CheckList.tsx create mode 100644 src/frontend/src/hooks/Risks.hooks.ts delete mode 100644 src/frontend/src/pages/HelpPage.tsx create mode 100644 src/frontend/src/pages/InfoPage.tsx rename src/frontend/src/stylesheets/components/{CheckList.module.css => RiskLog.module.css} (100%) create mode 100644 src/frontend/src/tests/TestSupport/TestData/Risks.stub.ts delete mode 100644 src/frontend/src/tests/components/CheckList.test.tsx rename src/frontend/src/tests/pages/{HelpPage.test.tsx => InfoPage.test.tsx} (52%) diff --git a/README.md b/README.md index fe8c137ae7..3ef7b70b23 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,8 @@ Also known as PM Dashboard v3. A project management web application built in Typescript, React, and Express. -Start by reading what the project is [all about](https://github.com/Northeastern-Electric-Racing/FinishLine/blob/develop/docs/About.md). + +Almost all of our documentation is on [our Confluence page](https://nerdocs.atlassian.net/wiki/spaces/NER/pages/5603329/Software). Start there to learn what the project is all about. All questions can be directed to `#software` in the [NER Slack](https://nu-electric-racing.slack.com) (backup contact: [`@anthonybernardi`](https://github.com/anthonybernardi)). @@ -22,12 +23,8 @@ Note: no more `npm` commands! Any time you would run `npm run ...` run `yarn ... ## Environment Setup for New Developers -NOTE: the environment setup docs have not been updated from v2 yet!!!!! - -Go through either the [Mac onboarding](https://github.com/Northeastern-Electric-Racing/FinishLine/blob/develop/docs/Onboarding.md) or [Windows onboarding](https://github.com/Northeastern-Electric-Racing/FinishLine/blob/develop/docs/OnboardingWindows.md) steps. +We have redone our onboarding docs and moved them to Confluence! [Check them out here](https://nerdocs.atlassian.net/wiki/spaces/NER/pages/5079215/Software+Onboarding). If you have questions, ask them in the `#software_env-setup` channel in Slack. When you're done, check out the contributor guide (see below). ## How to Contribute -First read the [Git contributor guide](https://github.com/Northeastern-Electric-Racing/FinishLine/blob/develop/docs/ContributorGuide.md). - -Next, head over to the [Project Board](https://github.com/orgs/Northeastern-Electric-Racing/projects/3) and find a ticket you like. Once you've chosen one, or if you need help, reach out to your Tech Lead or someone in the #software channel. +Check out the [contributor guide](https://nerdocs.atlassian.net/wiki/spaces/NER/pages/8060929/Software+Contributor+Guide). This will take you through the steps of finding a ticket, making a branch, committing code, creating a pull request, etc! diff --git a/docs/About.md b/docs/About.md deleted file mode 100644 index ac99372cbd..0000000000 --- a/docs/About.md +++ /dev/null @@ -1,45 +0,0 @@ -# About the Project - -FinishLine by NER is intended to assist NER’s Project Management Office (PMO) and other leadership with increasing efficiency in two aspects: - -1. understanding the state of the club’s projects and -2. handling the processes and procedures associated with a formal project and change management system - -To access the app, you can go [here](https://finishlinebyner.com) and sign in with your husky Google email. - -## Tech Stack - -This project is a full-stack Typescript web application that uses React on the frontend and Express on the backend. Yarn workspaces are used to maintain it as a monorepo. - -As the project evolves, technologies may be added or removed. -The current tech stack list is provided below: - -- TypeScript -- Node.js -- Express -- React -- Prisma -- PostgreSQL -- Jest - -The app is deployed on AWS Elastic Beanstalk using the Docker configuration for the backend and Netlify for the frontend. It uses AWS RDS for the database. - -## History - -The NER PM Dashboard v1 was created in July of 2020 as a Google Apps Script web application attached to the database Google Sheet file. -Major development took place during July and August prior to the start of the Fall 2020 semester. -During Fall 2020, two developers make incremental improvements, and then in Spring 2020 a team of developers was formed. - -The NER PM Dashboard v2 was hypothesized during the Fall 2020 semester as the v1 developers ran into platform and framework limitations. -Research, planning, and project initiation for v2 began in Spring 2021. -The end of Summer 2021 was selected as the initial launch deadline for v2, but was not met. -In Fall 2021, the team of developers was formalized into NER's Software Solutions team and grew to 20+ members. -January 18, 2022 was selected as the adjusted launch deadline for v2, but was yet again not met. -In Spring 2022, the Software Solutions team grew to 70+ members. -The application finally launched in May of 2022. - -However, there were more technical limitations with v2. This led to the creation of NER PM Dashboard v3 in Summer 2022. The biggest change was using Express on the backend instead of Netlify Lambdas. It also generally cleaned up the repo and used Yarn workspaces as a better way to keep the monorepo instead of the workarounds used in v2. It was also rebranded to FinishLine by NER. - -## More Reading - -If you're curious, check out the [deployment & production application documentation](https://github.com/Northeastern-Electric-Racing/FinishLine/blob/develop/docs/Deployment.md) and the [product management](https://github.com/Northeastern-Electric-Racing/FinishLine/blob/develop/docs/ProductManagement.md) details too. diff --git a/docs/ContributorGuide.md b/docs/ContributorGuide.md deleted file mode 100644 index 992c7d9f90..0000000000 --- a/docs/ContributorGuide.md +++ /dev/null @@ -1,109 +0,0 @@ -# Contributor Guide - -## Table of Contents - -- [Creating Issues And Suggesting Features](https://github.com/Northeastern-Electric-Racing/FinishLine/blob/develop/docs/ContributorGuide.md#creating-issues-and-suggesting-features) -- [Creating a Branch](https://github.com/Northeastern-Electric-Racing/FinishLine/blob/develop/docs/ContributorGuide.md#creating-a-branch) -- [Writing Code](https://github.com/Northeastern-Electric-Racing/FinishLine/blob/develop/docs/ContributorGuide.md#writing-code) -- [Creating a Commit](https://github.com/Northeastern-Electric-Racing/FinishLine/blob/develop/docs/ContributorGuide.md#creating-a-commit) -- [Testing Your Code](https://github.com/Northeastern-Electric-Racing/FinishLine/blob/develop/docs/ContributorGuide.md#testing-your-code) -- [Running the App Locally](https://github.com/Northeastern-Electric-Racing/FinishLine/blob/develop/docs/ContributorGuide.md#running-the-app-locally) -- [Creating a Pull Request](https://github.com/Northeastern-Electric-Racing/FinishLine/blob/develop/docs/ContributorGuide.md#creating-a-pull-request) - -## Git - -For an explanation of Git, see [this presentation by Nick DePatie](https://docs.google.com/presentation/d/18_T_kDgsussS3cp9YDVCT7ngH9Onzyu93btziPgIoC4/edit?usp=sharing) - -## Creating Issues And Suggesting Features - -Navigate to the [GitHub repository issues page](https://github.com/Northeastern-Electric-Racing/FinishLine/issues) and click the "New Issue" button. - -### Issue Title - -Give your issue an informative, but concise title that follows the naming syntax: `[Page] - [Description]`. -The page field should name one specific page within the application that the issue pertains to. -Alternatively, use `General` or `Docs` to indicate issues spanning the whole site or issues with the project's documentation. -The description field should briefly describe what the issue is. -Examples: `General - Increase Padding for Tables` or `Projects - Add Filter by Project Lead`. - -### Issue Description - -Include the required information in the issue description given by the template. - -Add labels as is appropriate for the issue, and put it in the #software_product channel for review. -Reviewers will determine whether the issue is valid, whether it will be accepted and worked on, and which milestone it will be a part of. -Once it is approved, it will be added to the project board. - -## Creating a Branch - -Before making a new branch, make sure you are on `develop` and you have the latest changes (`git pull`). - -Then use `git checkout -b [branch name]` to create and switch to a new branch. -Give the branch a short name that follows the naming syntax: `#[issue number]-[short but meaningful description]` and replace spaces with dashes. -Example: `#12-add-login-endpoint` or `#275-refactor-projects-table`. - -Use `git status` to check which branch you are on. -Ensure you stash, reset, or commit your changes before changing branches, unless you want to bring your changes to the other branch. -Use `git checkout develop` to switch back to the `develop` branch. - -## Writing Code - -Comment your code with JSDoc and inline comments to help others understand your code. - -Test your code to the best of your ability and avoid writing overly complex code. - -Follow good coding practices taught in Fundies 1 and Fundies 2. - -If you edit code in any local package (e.g. shared), you may need to run `yarn install` before the latest changes to the local package will be availible in the rest of the application. - -## Creating a Commit - -Commit early and often (within reason) to properly save your work and to make your changes more easily separable. - -Use `git status` to see which files have been changed. If you see `yarn.lock` in there, run `git restore yarn.lock`. These files should only be committed if you are adding new packages to the repo. - -Next, do `git add path/to/file` for each file you want to stage to your commit. You can also do `git add -A` to add all of them. - -Next, use `git commit -m [message]` to commit your staged file with the message. -Use the following syntax for commit messages: `#[issue number]: [description of changes made]`. -Examples: `#12: Expanded the creating commmits section` or `#79: Increased list padding`. - -Use `git push` to push your branch and commits to the remote GitHub repo. You may need to run `git push --set-upstream origin [branch name]` as instructed by the git CLI if the branch does not already exist in the GitHub repo and only exists on your local computer. - -## Testing Your Code - -Run the unit tests using `yarn test:frontend` or `yarn test:backend` and try to ensure they all pass. - -Write tests for anything new that you write. If you're unsure of what you should test, ask someone. - -## Running the App Locally - -First make sure you have run `yarn install` and `yarn prisma:generate` on the branch you want to start. Then use `yarn start` to boot up the React app and the Express server on your local computer. -Navigate to `localhost:3000` to see the frontend of the app. -The API endpoint can be found at `localhost:3001/` (check out `localhost:3001/users` for example). - -## When to commit yarn.lock? - -`yarn.lock` contains all the dependencies of the project. -Thus, when dependencies are added or removed from the project, or when the version of any dependency is changed, then `yarn.lock` needs to be committed to the branch and pushed to the remote repository. -Unless there are changes to `yarn.lock`, you should **_not_** commit and push any changes to `yarn.lock`. - -## Creating a Pull Request - -Pull requests (aka PRs) allow for others to review your code before it gets merged together with the `develop` branch. -Don't be afraid to open a PR before you are finished if you want feedback on your code, just make sure to note this in your PR. -Pushing more commits to the GitHub repo will add them to the PR. - -Ensure that you have pushed your branch to GitHub using `git push`. -You may need to run `git push --set-upstream origin [branch name]` as instructed by the git CLI if the branch does not already exist in the GitHub repo and only exists on your local computer. - -Navigate to the [PRs page on GitHub](https://github.com/Northeastern-Electric-Racing/FinishLine/pulls) and click "New pull request". -You may have to select the branch which you would like to merge into the `develop` branch. - -Give your PR an informative and concise title. -PR titles often match the title of the issue they are linked to, but they do not have to match. - -Use [closing keywords](https://docs.github.com/en/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue) in the description of the PR to link the PR with any associated issue(s). -Example: `closes #27` will link issue `#27` to the PR and close the issue when the PR is merged. - -In the sidebar, request review from any interested team members, which will usually include `@anthonybernardi`, `@jamescd18`, `@RChandler234`, or `@joshiarnav`. diff --git a/docs/Onboarding.md b/docs/Onboarding.md deleted file mode 100644 index 4dd5b84457..0000000000 --- a/docs/Onboarding.md +++ /dev/null @@ -1,99 +0,0 @@ -# Onboarding - -# NOTE: THIS IS DEPRECATE DUE TO THE SWITCH TO V3 - -# NEW ONBOARDING COMING SOON - -## Project Setup - -First, ensure that you have [Node.js](https://nodejs.org/en/) installed. - -[Clone the repository](https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/cloning-a-repository), potentially using `git clone` in your preferred CLI to pull the project down to your computer. - -Familiarize yourself with [common git commands](https://education.github.com/git-cheat-sheet-education.pdf), [CLI commands](https://www.w3schools.com/whatis/whatis_cli.asp), and [what Git is](https://www.atlassian.com/git/tutorials/what-is-git) if you aren't already. - -In your CLI, navigate to the folder for the project and run `npm install` to instruct [npm](https://www.npmjs.com/about) to install all neccessary packages. - -## Database - -### Installation - -The easiest way to install [PostgreSQL](https://www.postgresql.org) on a Mac is with [Postgres.app](https://postgresapp.com). -Alternative OS installs can be found [here](https://www.postgresql.org/download/). - -### Database Initialization - -After downloading and installing PostgreSQL properly, you'll need to run PostgreSQL and create a database named `nerpm`. -By default, PostgreSQL typically has a `postgres` database. -You can use `psql` in the CLI to create a database by running this SQL statement: `CREATE DATABASE nerpm;`. -Naming the new database `nerpm` will ensure it matches with the database URL specified in the project preparation section below. - -### ENV Setup - -Add a `.env` file to the project root directory via `touch .env` in the CLI or creating a file in your IDE. -Paste the following line into the `.env` file and replace `` with your computer username. -`DATABASE_URL="postgresql://:@localhost:5432/nerpm?schema=public"` - -### Initial Database Migration - -In order to run the database for the first time, you will need to execute the following command in the CLI. -Run `npm run prisma:reset`. -This should apply all the existing database migrations to the database (create the required tables in the database, see `npm run prisma:migrate`) and populate the database with seed data (see `npm run prisma:seed`). - -Refer to [prisma migration tools](https://github.com/Northeastern-Electric-Racing/FinishLine/blob/develop/docs/PrismaMigrationTools.md) for more information about these commands. - -### Run and Test - -To test that things are working, run `npm run start` in the CLI and go to an example API route. -Example: `localhost:3000/.netlify/functions/users`. - -If the application does not launch, you can replace the line in the `.env` file with the following. -`DATABASE_URL="postgresql://postgres:@localhost:5432/nerpm?schema=public"` -Change `` to your `postgres` database password. - -Test again to ensure that the application launches correctly. - -## IDE: VSCode - -**IMPORTANT NOTE:** We have a settings file in the project that will automatically configure all of these settings for you. -If for some reason they don't work, come back here to do it manually. -(the settings that should work are formatting on save and using prettier to format) - -Turn on `format on save` for Prettier. -Go to `Code > Preferences > Settings` (or via `cmd ,` on Mac) (or `File > Preferences > Settings` for Windows). -Search for `format on save` and make sure `Editor: Format On Save` is checked / yes. - -Open the VSCode Command Palette (`Ctrl/Cmd`+`Shift`+`P`) and search for `open settings json`. -Select `Preferences: Open Settings (JSON)`, which should open a file called `settings.json`. - -If `settings.json` doesn't open from the Command Palette, you can also navigate back to the settings and try searching for either of these: - -- `open settings json`: Then click `Edit in settings.json` under the `[JSON] Configure settings to be overridden for [json] language` section. -- `json file schema`: Then click `Edit in settings.json` under the `JSON schemas` section. - -Paste this into `settings.json`: - -```json -"[typescriptreact]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" -}, -"[typescript]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" -} -``` - -### VSCode Extensions - -When you launch the project in VSCode, you should see a popup in the bottom right asking you to "install all recommendeded extensions". -Click "install" to easily install all of the below extensions. - -If for some reason you don't see this popup you can install them manually using the extensions button on the left sidebar. -Below are the recommended extensions that you should install. -Only the starred ones are optional. - -- [Jest](https://marketplace.visualstudio.com/items?itemName=Orta.vscode-jest) (`orta.vscode-jest`) -- [Prisma](https://marketplace.visualstudio.com/items?itemName=Prisma.prisma) (`prisma.prisma`) -- [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) (`dbaeumer.vscode-eslint`) -- [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) (`esbenp.prettier-vscode`) -- [Babel\*](https://marketplace.visualstudio.com/items?itemName=mgmcdermott.vscode-language-babel) (`mgmcdermott.vscode-language-babel`) -- [Material Icon Theme\*](https://marketplace.visualstudio.com/items?itemName=PKief.material-icon-theme) (`pkief.material-icon-theme`) diff --git a/docs/OnboardingWindows.md b/docs/OnboardingWindows.md deleted file mode 100644 index 4975d58b5c..0000000000 --- a/docs/OnboardingWindows.md +++ /dev/null @@ -1,118 +0,0 @@ -# Onboarding - -# NOTE: THIS IS DEPRECATE DUE TO THE SWITCH TO V3 - -# NEW ONBOARDING COMING SOON - -## Project Setup - -First, ensure that you have [Node.js v14](https://nodejs.org/download/release/v14.18.3/) installed (you can also navigate to the Node.js website and find any v14 update you prefer). -However, you MUST have version 14 (not newer) installed for the dashboard to work. -Check your node version with `node -v`. -It must be version 14. -If any strange node related errors occur or any errors without descriptive messages, check this step again. - -[Clone the repository](https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/cloning-a-repository), potentially using `git clone` in your preferred CLI to pull the project down to your computer. - -Familiarize yourself with [common git commands](https://education.github.com/git-cheat-sheet-education.pdf), [CLI commands](https://www.w3schools.com/whatis/whatis_cli.asp), and [what Git is](https://www.atlassian.com/git/tutorials/what-is-git) if you aren't already. You may also follow tutorials found in the NER curriculum for this information. - -In your CLI, navigate to the folder for the project and run `npm install` to instruct [npm](https://www.npmjs.com/about) to install all neccessary packages. - -## Database - -### Installation - -Install [PostgreSQL](https://www.postgresql.org) and follow all default steps. -At points where it asks for any `psql` package installs, please include them. -If a password or multiple are required, remember these passwords (they will be important later). -If you are on a Mac, please follow the other onboarding steps. Alternative OS installs can be found [here](https://www.postgresql.org/download/). -After the installation, please restart your CLI of choice (Powershell, Command Prompt, etc). - -### Database Initialization - -After downloading and installing PostgreSQL properly, you'll need to run PostgreSQL and create a database named `nerpm`. -By default, PostgreSQL typically has a `postgres` database. -You can use `psql` in the CLI to create a database by running this SQL statement: `CREATE DATABASE nerpm;`. -Naming the new database `nerpm` will ensure it matches with the database URL specified in the project preparation section below. - -Alternatively, if the `psql` command does not work, try the command `psql -U postgres` (as postgres is the default username) and mimic the above steps after that. -If these both fail, you can use pgAdmin instead. -Search for the "pgAdmin 4" application on your computer's search bar and open it. -Here, click on "Servers" and right click on "Databases" and then navigate to "Create" and then "Database..." and then use the name `nerpm` (for the same reason as above). - -### ENV Setup - -Add a `.env` file to the project root directory via `ni .env` in the CLI or creating a file in your IDE. -Paste the following line into the `.env` file and replace `` with your computer username. -`DATABASE_URL="postgresql://:@localhost:5432/nerpm?schema=public"` - -Note: if the following step does not work with this database URL, try `DATABASE_URL="postgresql://postgres:@localhost:5432/nerpm?schema=public"` instead with the password you created earlier. - -### Initial Database Migration - -In order to run the database for the first time, you will need to execute the following command in the CLI. -Run `npm run prisma:reset`. -This should apply all the existing database migrations to the database (create the required tables in the database, see `npm run prisma:migrate`) and populate the database with seed data (see `npm run prisma:seed`). - -Refer to [prisma migration tools](https://github.com/Northeastern-Electric-Racing/FinishLine/blob/develop/docs/PrismaMigrationTools.md) for more information about these commands. - -### Run and Test - -To test that things are working, run `npm run start` in the CLI and go to an example API route. -Example: `localhost:3000/.netlify/functions/users`. - -Once again, if the application does not launch, you can replace the line in the `.env` file with the following. -`DATABASE_URL="postgresql://postgres:@localhost:5432/nerpm?schema=public"`. -Change `` to your `postgres` database password. - -Test again to ensure that the application launches correctly. - -## IDE: VSCode - -Turn on `format on save` for Prettier. -Go to `File > Preferences > Settings`. -Search for `format on save` and make sure `Editor: Format On Save` is checked / yes. - -Select Preferences: Open Settings (JSON) to open and edit settings.json. -Paste this into `settings.json` (make sure to put a comma after the last item or before the first item if necessary): - -```json -"[typescriptreact]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" -}, -"[typescript]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" -} -``` - -Below are extensions for VSCode that might make your developer experience more enjoyable. -Only the starred ones are optional. - -- [Jest](https://marketplace.visualstudio.com/items?itemName=Orta.vscode-jest) (`orta.vscode-jest`) -- [Prisma](https://marketplace.visualstudio.com/items?itemName=Prisma.prisma) (`prisma.prisma`) -- [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) (`dbaeumer.vscode-eslint`) -- [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) (`esbenp.prettier-vscode`) -- [Babel\*](https://marketplace.visualstudio.com/items?itemName=mgmcdermott.vscode-language-babel) (`mgmcdermott.vscode-language-babel`) -- [Material Icon Theme\*](https://marketplace.visualstudio.com/items?itemName=PKief.material-icon-theme) (`pkief.material-icon-theme`) - -## FAQ - -- [Prisma keeps giving me strange bugs/I don't understand it, how do I learn more?](#prisma-bugs) -- [I'm getting strange compilation errors or TypeScript errors that seem like the project is broken or incomplete, what should I do?](#possible-wrong-prisma-version) -- [My CLI says that node/any needed package is not recognized! What should I do?](#cli-package-bugs) - -### Prisma Bugs - -There is a lot of useful information in the [prisma docs](https://www.prisma.io/docs/)! -Specifically, the [environment files docs](https://www.prisma.io/docs/guides/development-environment/environment-variables/managing-env-files-and-setting-variables#manage-env-files-manually) and the [database URL formatting docs](https://www.prisma.io/docs/concepts/database-connectors/postgresql#connection-url). - -### Possible Wrong Prisma Version - -You may have the wrong prisma version installed or may not have run `npm install`. -If `npm install` does not work, try `git reset --hard` and then `npm ci` to get the right version of prisma. - -### CLI Package Bugs - -Try restarting your CLI first (in VS Code this means hitting the little trash can icon to the right of "powershell" and then going to "Terminal" on the top of your screen and clicking "New Terminal"). -If that doesn't work, try `npm install` again and then restart your CLI. If `psql` is the problem and restarting or the other commands don't work, try using "pgAdmin" instead. -Finally, the path variables for that package may not have set up correctly. For this, google the package name followed by "path variable" to find a solution (each package is slightly different). diff --git a/docs/PrismaMigrationTools.md b/docs/PrismaMigrationTools.md deleted file mode 100644 index feb6004834..0000000000 --- a/docs/PrismaMigrationTools.md +++ /dev/null @@ -1,65 +0,0 @@ -# Prisma Migration Tools - -## `yarn prisma:seed` - -### What it does - -This command seeds the database, which means populating the database with initial data it requires to run. -It can be dummy data, basic user accounts, a default language, example data in various states, etc. - -### Why to use it - -While developing the application, we need some data to be present in order for something to appear on the front end to interact with. -Running this command populates the database with a basic set of data for development purposes. - -For more detailed information about [prisma seed](https://www.prisma.io/docs/guides/database/seed-database), click the link. - -## `yarn prisma:reset` - -### What it does - -This command drops the database if possible or performs a soft reset if the database cannot be deleted. -If the database is dropped, it creates a new database with the same name and runs all migrations and seed scripts. -If `yarn prisma:reset` runs without any errors, then the `yarn prisma:seed` function is auto-invoked. -This means you do not need to run the `yarn prisma:seed` command again. - -### Why to use it - -You use this command to restore the data to its original state if you sufficiently modified the data via the front end. -If you need to undo changes you made to the database schema or if there are migration history conflicts, you can also run this command. - -For more detailed information about [prisma reset](https://www.prisma.io/docs/concepts/components/prisma-migrate), click the link. - -## `yarn prisma:migrate` - -### What it does - -This command enables you to keep your database schema in sync with the prisma schema. - -### Why to use it - -After you make a change to the prisma schema, you should run this function to update the database schema. -The new migration created is associated with the changes made to the prisma schema. - -There will be a `name` field that the terminal will ask you to enter for the migration. -Enter a concise and appropriate name that reflects the changes you made to the prisma schema. - -Each time you run this command, if there are new changes, a SQL file will be generated that is added to the `migrations` folder. -Otherwise, `yarn prisma:migrate` will apply the existing migration SQL files onto the database and not require a `name` field to be entered. - -For more detailed information about [prisma migrate](https://www.prisma.io/docs/concepts/components/prisma-migrate), click the link. - -## `yarn prisma:generate` - -### What it does - -This command generates and initializes the prisma client. -The prisma client is an auto-generated library that allows us to access data in our application. - -Note: In v2, the command `npm install` would automatically run `npm run prisma:generate`. However, in v3, this does not happen, so you will need to run `yarn install` then `yarn prisma:generate` yourself OR you can just run `yarn i` which does both. - -### Why to use it - -After changes are made to the prisma schema, you need to run this function to update the prisma client. - -For more detailed information about [prisma generate](https://www.prisma.io/docs/concepts/components/prisma-client/working-with-prismaclient/generating-prisma-client), click the link. diff --git a/src/backend/src/controllers/change-requests.controllers.ts b/src/backend/src/controllers/change-requests.controllers.ts index 86a5633df1..34e6a0e46b 100644 --- a/src/backend/src/controllers/change-requests.controllers.ts +++ b/src/backend/src/controllers/change-requests.controllers.ts @@ -274,3 +274,48 @@ export const createStandardChangeRequest = async (req: Request, res: Response) = message: `Successfully created standard change request #${createdCR.crId}.` }); }; + +export const addProposedSolution = async (req: Request, res: Response) => { + const errors = validationResult(req); + if (!errors.isEmpty()) { + return res.status(400).json({ errors: errors.array() }); + } + + const { body } = req; + + // verify user is allowed to create stage gate change requests + const user = await prisma.user.findUnique({ where: { userId: body.submitterId } }); + if (!user) { + return res.status(404).json({ message: `user with id #${body.submitterId} not found` }); + } + if (user.role === Role.GUEST) return res.status(401).json({ message: 'Access Denied' }); + + // ensure existence of change request + const foundCR = await prisma.change_Request.findUnique({ + where: { crId: body.crId } + }); + if (!foundCR) + return res.status(404).json({ message: `change request with id #${body.crId} not found` }); + + // ensure existence of scope change request + const foundScopeCR = await prisma.scope_CR.findUnique({ where: { changeRequestId: body.crId } }); + if (!foundScopeCR) + return res + .status(404) + .json({ message: `scope change request with change request id #${body.crId} not found` }); + + const createProposedSolution = await prisma.proposed_Solution.create({ + data: { + description: body.description, + scopeImpact: body.scopeImpact, + timelineImpact: body.timelineImpact, + budgetImpact: body.budgetImpact, + changeRequest: { connect: { scopeCrId: foundScopeCR.scopeCrId } }, + createdBy: { connect: { userId: body.submitterId } } + } + }); + + return res.status(200).json({ + message: `Successfully created the proposed solution #${createProposedSolution.proposedSolutionId}` + }); +}; diff --git a/src/backend/src/controllers/risks.controllers.ts b/src/backend/src/controllers/risks.controllers.ts index 2b943450dc..bf63eeb68c 100644 --- a/src/backend/src/controllers/risks.controllers.ts +++ b/src/backend/src/controllers/risks.controllers.ts @@ -25,7 +25,8 @@ export const createRisk = async (req: Request, res: Response) => { const { body } = req; const { projectId, detail, createdById } = body; - if (!hasRiskPermissions(createdById, projectId)) { + const hasPerms = await hasRiskPermissions(createdById, projectId); + if (!hasPerms) { return res.status(401).json({ message: 'Access Denied' }); } @@ -57,7 +58,8 @@ export const editRisk = async (req: Request, res: Response) => { return res.status(400).json({ message: 'Cant edit a deleted risk' }); } - if (!hasRiskPermissions(userId, originalRisk.projectId)) { + const hasPerms = await hasRiskPermissions(userId, originalRisk.projectId); + if (!hasPerms) { return res.status(401).json({ message: 'Access Denied' }); } @@ -119,7 +121,8 @@ export const deleteRisk = async (req: Request, res: Response) => { return res.status(400).json({ message: 'this risk has already been deleted' }); } - if (!hasRiskPermissions(deletedByUserId, targetRisk.projectId)) { + const hasPerms = await hasRiskPermissions(deletedByUserId, targetRisk.projectId); + if (!hasPerms) { return res.status(401).json({ message: 'Access Denied' }); } diff --git a/src/backend/src/routes/change-requests.routes.ts b/src/backend/src/routes/change-requests.routes.ts index 0390d3fceb..7479d31ba0 100644 --- a/src/backend/src/routes/change-requests.routes.ts +++ b/src/backend/src/routes/change-requests.routes.ts @@ -7,7 +7,8 @@ import { createStandardChangeRequest, getAllChangeRequests, getChangeRequestByID, - reviewChangeRequest + reviewChangeRequest, + addProposedSolution } from '../controllers/change-requests.controllers'; const changeRequestsRouter = express.Router(); @@ -66,5 +67,15 @@ changeRequestsRouter.post( body('why.*.type').custom((value) => Object.values(ChangeRequestReason).includes(value)), createStandardChangeRequest ); +changeRequestsRouter.post( + '/new/proposed-solution', + body('submitterId').isInt({ min: 0 }).not().isString(), + body('crId').isInt({ min: 0 }).not().isString(), + body('description').isString().not().isEmpty(), + body('scopeImpact').isString().not().isEmpty(), + body('timelineImpact').isInt({ min: 0 }).not().isString(), + body('budgetImpact').isInt({ min: 0 }).not().isString(), + addProposedSolution +); export default changeRequestsRouter; diff --git a/src/backend/src/utils/projects.utils.ts b/src/backend/src/utils/projects.utils.ts index 1aee3108ed..43ee147b19 100644 --- a/src/backend/src/utils/projects.utils.ts +++ b/src/backend/src/utils/projects.utils.ts @@ -6,10 +6,12 @@ import { DescriptionBullet, calculateEndDate, calculatePercentExpectedProgress, - calculateTimelineStatus, calculateDuration + calculateTimelineStatus, + calculateDuration } from 'shared'; import { descBulletConverter, wbsNumOf } from './utils'; import { userTransformer } from './users.utils'; +import { riskQueryArgs, riskTransformer } from './risks.utils'; export const manyRelationArgs = Prisma.validator()({ include: { @@ -23,6 +25,7 @@ export const manyRelationArgs = Prisma.validator()({ team: true, goals: true, features: true, + risks: riskQueryArgs, otherConstraints: true, workPackages: { include: { @@ -48,6 +51,7 @@ export const uniqueRelationArgs = Prisma.validator()({ team: true, goals: true, features: true, + risks: riskQueryArgs, otherConstraints: true, workPackages: { include: { @@ -117,6 +121,7 @@ export const projectTransformer = ( goals: project.goals.map(descBulletConverter), features: project.features.map(descBulletConverter), otherConstraints: project.otherConstraints.map(descBulletConverter), + risks: project.risks.map(riskTransformer), workPackages: project.workPackages.map((workPackage) => { const endDate = calculateEndDate(workPackage.startDate, workPackage.duration); const expectedProgress = calculatePercentExpectedProgress( diff --git a/src/frontend/src/apis/Risks.api.ts b/src/frontend/src/apis/Risks.api.ts new file mode 100644 index 0000000000..3429c5fb7f --- /dev/null +++ b/src/frontend/src/apis/Risks.api.ts @@ -0,0 +1,46 @@ +/* + * This file is part of NER's PM Dashboard and licensed under GNU AGPLv3. + * See the LICENSE file in the repository root folder for details. + */ + +import axios from 'axios'; +import { Risk } from 'shared'; +import { apiUrls } from '../utils/Urls'; + +/** + * Get the risks for a given project. + * + * @param projectId ID of given project. + */ +export const getRisksForProject = (projectId: number) => { + return axios.get(apiUrls.risksByProjectId(projectId)); +}; + +/** + * Create a single risk. + * + * @param payload Payload containing all information needed to create a risk. + */ +export const createSingleRisk = (payload: any) => { + return axios.post<{ message: string }>(apiUrls.risksCreate(), { + ...payload + }); +}; + +/** + * Edit a single risk. + */ +export const editSingleRisk = (payload: any) => { + return axios.post<{ message: string }>(apiUrls.risksEdit(), { + ...payload + }); +}; + +/** + * Delete a single risk. + */ +export const deleteSingleRisk = (payload: any) => { + return axios.post<{ message: string }>(apiUrls.risksDelete(), { + ...payload + }); +}; diff --git a/src/frontend/src/app/AppAuthenticated.tsx b/src/frontend/src/app/AppAuthenticated.tsx index a40171e0b3..2b33ecfcca 100644 --- a/src/frontend/src/app/AppAuthenticated.tsx +++ b/src/frontend/src/app/AppAuthenticated.tsx @@ -11,7 +11,7 @@ import { PageNotFound } from '../pages/PageNotFound'; import Home from '../pages/HomePage/Home'; import NavTopBar from '../layouts/NavTopBar/NavTopBar'; import Settings from '../pages/SettingsPage/Settings'; -import HelpPage from '../pages/HelpPage'; +import InfoPage from '../pages/InfoPage'; import Sidebar from '../layouts/Sidebar/Sidebar'; import TeamsPage from '../pages/TeamsPage'; @@ -35,7 +35,7 @@ const AppAuthenticated: React.FC = () => { - + diff --git a/src/frontend/src/components/CheckList.tsx b/src/frontend/src/components/CheckList.tsx deleted file mode 100644 index 1e08e4bc59..0000000000 --- a/src/frontend/src/components/CheckList.tsx +++ /dev/null @@ -1,103 +0,0 @@ -/* - * This file is part of NER's PM Dashboard and licensed under GNU AGPLv3. - * See the LICENSE file in the repository root folder for details. - */ - -import { ReactNode, useState } from 'react'; -import PageBlock from '../layouts/PageBlock'; -import { Form, Button, Modal, OverlayTrigger, Tooltip } from 'react-bootstrap'; -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; -import { faTrash, faArrowRight } from '@fortawesome/free-solid-svg-icons'; -import styles from '../stylesheets/components/CheckList.module.css'; - -interface CheckListProps { - title: string; - headerRight?: ReactNode; - listItems: { - details: string; - resolved: boolean; - }[]; -} - -const CheckList: React.FC = ({ title, headerRight, listItems }) => { - const [checks, setChecks] = useState(listItems); - const [show, setShow] = useState(false); - - const handleClose = () => setShow(false); - const handleShow = () => setShow(true); - - const handleCheck = (idx: number) => { - const updatedChecks = checks.map((check, i) => { - if (i === idx) { - check.resolved = !check.resolved; - return check; - } - return check; - }); - - setChecks(updatedChecks); - }; - - const renderTooltip = (message: string) => {message}; - - return ( - -
- {checks.map((check, idx) => ( -
- - {check.details} -

- } - defaultChecked={check.resolved} - data-testId={`testCheckbox${idx}`} - onChange={() => handleCheck(idx)} - /> - {check.resolved ? ( - - - - ) : ( - - - - )} -
- ))} -
- -
- - - Add New Risk - - - - - - - - - -
-
- ); -}; - -export default CheckList; diff --git a/src/frontend/src/components/ExternalLink.tsx b/src/frontend/src/components/ExternalLink.tsx index d10a238cc0..19c0e35dbb 100644 --- a/src/frontend/src/components/ExternalLink.tsx +++ b/src/frontend/src/components/ExternalLink.tsx @@ -7,7 +7,7 @@ import { IconProp } from '@fortawesome/fontawesome-svg-core'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; interface ExternalLinkProps { - icon: IconProp; + icon?: IconProp; link: string; description: string; } @@ -16,7 +16,11 @@ interface ExternalLinkProps { const ExternalLink: React.FC = ({ icon, link, description }) => { return (
- + {icon !== undefined ? ( + + ) : ( + '' + )} {description} diff --git a/src/frontend/src/hooks/Risks.hooks.ts b/src/frontend/src/hooks/Risks.hooks.ts new file mode 100644 index 0000000000..87f8b8eb14 --- /dev/null +++ b/src/frontend/src/hooks/Risks.hooks.ts @@ -0,0 +1,82 @@ +/* + * This file is part of NER's PM Dashboard and licensed under GNU AGPLv3. + * See the LICENSE file in the repository root folder for details. + */ + +import { useMutation, useQuery, useQueryClient } from 'react-query'; +import { + createSingleRisk, + deleteSingleRisk, + editSingleRisk, + getRisksForProject +} from '../apis/Risks.api'; +import { Risk } from 'shared'; + +/** + * Custom React hook to get all risks for a certain project. + */ +export const useGetRisksForProject = (projectId: number) => { + return useQuery(['risks'], async () => { + const { data } = await getRisksForProject(projectId); + return data; + }); +}; + +/** + * Custom React hook to create a new risk. + */ +export const useCreateSingleRisk = () => { + const queryClient = useQueryClient(); + return useMutation<{ message: string }, Error, any>( + ['risks', 'create'], + async (riskPayload: any) => { + const { data } = await createSingleRisk(riskPayload); + return data; + }, + { + onSuccess: () => { + queryClient.invalidateQueries(['risks']); + } + } + ); +}; + +/** + * Custom React hook to edit a risk. + */ + +export const useEditSingleRisk = () => { + const queryClient = useQueryClient(); + return useMutation<{ message: string }, Error, any>( + ['risks', 'edit'], + async (riskPayload: any) => { + const { data } = await editSingleRisk(riskPayload); + return data; + }, + { + onSuccess: () => { + queryClient.invalidateQueries(['risks']); + } + } + ); +}; + +/** + * Custom React hook to delete a risk. + */ + +export const useDeleteSingleRisk = () => { + const queryClient = useQueryClient(); + return useMutation<{ message: string }, Error, any>( + ['risks', 'delete'], + async (riskPayload: any) => { + const { data } = await deleteSingleRisk(riskPayload); + return data; + }, + { + onSuccess: () => { + queryClient.invalidateQueries(['risks']); + } + } + ); +}; diff --git a/src/frontend/src/layouts/Sidebar/Sidebar.tsx b/src/frontend/src/layouts/Sidebar/Sidebar.tsx index c2b8681461..d71a9f9990 100644 --- a/src/frontend/src/layouts/Sidebar/Sidebar.tsx +++ b/src/frontend/src/layouts/Sidebar/Sidebar.tsx @@ -47,9 +47,9 @@ const Sidebar: React.FC = () => { route: routes.TEAMS }, { - name: 'Help', + name: 'Info', icon: faQuestionCircle, - route: routes.HELP + route: routes.INFO } ]; return ( diff --git a/src/frontend/src/pages/CreateChangeRequestPage/CreateChangeRequest.tsx b/src/frontend/src/pages/CreateChangeRequestPage/CreateChangeRequest.tsx index 1ad02d9427..e712f17110 100644 --- a/src/frontend/src/pages/CreateChangeRequestPage/CreateChangeRequest.tsx +++ b/src/frontend/src/pages/CreateChangeRequestPage/CreateChangeRequest.tsx @@ -46,7 +46,13 @@ const CreateChangeRequest: React.FC = () => { if (isLoading) return ; if (isError) return ; - return ; + return ( + + ); }; export default CreateChangeRequest; diff --git a/src/frontend/src/pages/CreateChangeRequestPage/CreateChangeRequestView.tsx b/src/frontend/src/pages/CreateChangeRequestPage/CreateChangeRequestView.tsx index 5f89157eb4..0fa74e48a4 100644 --- a/src/frontend/src/pages/CreateChangeRequestPage/CreateChangeRequestView.tsx +++ b/src/frontend/src/pages/CreateChangeRequestPage/CreateChangeRequestView.tsx @@ -15,6 +15,7 @@ import PageBlock from '../../layouts/PageBlock'; interface CreateChangeRequestViewProps { wbsNum: string; + crDesc: string; onSubmit: (data: FormInput) => Promise; } @@ -66,10 +67,14 @@ const schema = yup.object().shape({ ) }); -const CreateChangeRequestsView: React.FC = ({ wbsNum, onSubmit }) => { +const CreateChangeRequestsView: React.FC = ({ + wbsNum, + crDesc, + onSubmit +}) => { const { register, handleSubmit, control, formState } = useForm({ resolver: yupResolver(schema), - defaultValues: { wbsNum, why: [{ type: ChangeRequestReason.Other, explain: '' }] } + defaultValues: { wbsNum, what: crDesc, why: [{ type: ChangeRequestReason.Other, explain: '' }] } }); const { fields, append, remove } = useFieldArray({ control, name: 'why' }); diff --git a/src/frontend/src/pages/HelpPage.tsx b/src/frontend/src/pages/HelpPage.tsx deleted file mode 100644 index 379cfda1ef..0000000000 --- a/src/frontend/src/pages/HelpPage.tsx +++ /dev/null @@ -1,63 +0,0 @@ -/* - * This file is part of NER's PM Dashboard and licensed under GNU AGPLv3. - * See the LICENSE file in the repository root folder for details. - */ - -import { Col, Container, Row } from 'react-bootstrap'; -import { faScroll, faCode, faCommentAlt } from '@fortawesome/free-solid-svg-icons'; -import ExternalLink from '../components/ExternalLink'; -import PageTitle from '../layouts/PageTitle/PageTitle'; -import PageBlock from '../layouts/PageBlock'; - -const HelpPage: React.FC = () => { - return ( - - - - - Check out these helpful resources: - - - - - Got any suggestions for additional resources? Drop a message in Slack! - - - - - - - Any and all questions, comments, suggestions, bugs, or other issues can be directed to - the resources below: - - - - - - - - - - - - - ); -}; - -export default HelpPage; diff --git a/src/frontend/src/pages/InfoPage.tsx b/src/frontend/src/pages/InfoPage.tsx new file mode 100644 index 0000000000..a725cc4335 --- /dev/null +++ b/src/frontend/src/pages/InfoPage.tsx @@ -0,0 +1,182 @@ +/* + * This file is part of NER's PM Dashboard and licensed under GNU AGPLv3. + * See the LICENSE file in the repository root folder for details. + */ + +import { Col, Container, Row } from 'react-bootstrap'; +import { + faScroll, + faCode, + faCommentAlt, + faBolt, + faCog, + faDollarSign, + faSearch +} from '@fortawesome/free-solid-svg-icons'; +import ExternalLink from '../components/ExternalLink'; +import PageTitle from '../layouts/PageTitle/PageTitle'; +import PageBlock from '../layouts/PageBlock'; +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; + +const InfoPage: React.FC = () => { + return ( + + + + + Check out these helpful resources: + + + + + Got any suggestions for additional resources? Drop a message in Slack! + + + + + + + Any and all questions, comments, suggestions, bugs, or other issues can be directed to + the resources below: + + + + + + + + + + + + + + + + + Club-Wide Meetings & Events + + + + + + + + + + + Electrical Meetings + + + + + + + + + + + Mechanical Meetings + + + + + + + + + + + + + Business Meetings + + + + + + + + + + + Software Meetings + + + + + + + + + + + Engineering Reviews + + + + + + + + + + + + + ); +}; + +export default InfoPage; diff --git a/src/frontend/src/pages/ProjectDetailPage/ProjectViewContainer/ProjectViewContainer.tsx b/src/frontend/src/pages/ProjectDetailPage/ProjectViewContainer/ProjectViewContainer.tsx index 07883d337b..2a951bdfa2 100644 --- a/src/frontend/src/pages/ProjectDetailPage/ProjectViewContainer/ProjectViewContainer.tsx +++ b/src/frontend/src/pages/ProjectDetailPage/ProjectViewContainer/ProjectViewContainer.tsx @@ -50,12 +50,6 @@ const ProjectViewContainer: React.FC = ({ proj, enter ); - const testRisks = [ - { details: 'Risk #1', resolved: false }, - { details: 'Risk #2', resolved: true }, - { details: 'Risk #3', resolved: false } - ]; - return ( = ({ proj, enter /> {proj.summary} - + !goal.dateDeleted)} /> = ({ risks }) => { - return ; +const sortRisksByDate = (a: Risk, b: Risk) => { + return new Date(a.dateCreated).getTime() - new Date(b.dateCreated).getTime(); +}; + +const RiskLog: React.FC = ({ projectId, wbsNum }) => { + const history = useHistory(); + const auth = useAuth(); + const { userId } = auth.user!; + + const { mutateAsync: createMutateAsync } = useCreateSingleRisk(); + const { mutateAsync: editMutateAsync } = useEditSingleRisk(); + const { mutateAsync: deleteMutateAsync } = useDeleteSingleRisk(); + + const [newDetail, setNewDetail] = useState(''); + const [show, setShow] = useState(false); + const risksQuery = useGetRisksForProject(projectId); + + if (risksQuery.isLoading) return ; + + const risks = [ + ...risksQuery.data!.filter((r) => !r.dateDeleted && !r.isResolved).sort(sortRisksByDate), + ...risksQuery.data!.filter((r) => !r.dateDeleted && r.isResolved).sort(sortRisksByDate) + ]; + + const handleClose = () => setShow(false); + const handleShow = () => setShow(true); + + const handleCheck = async (risk: Risk) => { + const payload = { + userId: userId, + id: risk.id, + detail: risk.detail, + resolved: !risk.isResolved + }; + try { + await editMutateAsync(payload); + } catch (e) { + if (e instanceof Error) { + console.log(e); + alert(e.message); + } + } + }; + + const handleCreate = async () => { + const payload = { + projectId: projectId, + createdById: userId, + detail: newDetail + }; + + try { + await createMutateAsync(payload); + handleClose(); + } catch (e) { + if (e instanceof Error) { + alert(e.message); + } + } + }; + + const handleDelete = async (id: string) => { + const payload = { + riskId: id, + deletedByUserId: userId + }; + + try { + await deleteMutateAsync(payload); + } catch (e) { + if (e instanceof Error) { + alert(e.message); + } + } + }; + + const renderTooltip = (message: string) => {message}; + + return ( + +
+ {risks.map((risk, idx) => ( +
+ + {risk.detail} +

+ } + checked={risk.isResolved} + data-testId={`testCheckbox${idx}`} + onChange={() => handleCheck(risk)} + /> + {risk.isResolved ? ( + + + + ) : ( + + + + )} +
+ ))} +
+ +
+ + + Add New Risk + + + setNewDetail(e.target.value)} + /> + + + + + + +
+
+ ); }; export default RiskLog; diff --git a/src/frontend/src/stylesheets/components/CheckList.module.css b/src/frontend/src/stylesheets/components/RiskLog.module.css similarity index 100% rename from src/frontend/src/stylesheets/components/CheckList.module.css rename to src/frontend/src/stylesheets/components/RiskLog.module.css diff --git a/src/frontend/src/tests/TestSupport/TestData/Projects.stub.ts b/src/frontend/src/tests/TestSupport/TestData/Projects.stub.ts index 129309df5a..845a5e228d 100644 --- a/src/frontend/src/tests/TestSupport/TestData/Projects.stub.ts +++ b/src/frontend/src/tests/TestSupport/TestData/Projects.stub.ts @@ -60,7 +60,8 @@ export const exampleProject1: Project = { } ], duration: 8, - workPackages: [exampleWorkPackage1, exampleWorkPackage2] + workPackages: [exampleWorkPackage1, exampleWorkPackage2], + risks: [] }; export const exampleProject2: Project = { @@ -97,7 +98,8 @@ export const exampleProject2: Project = { ], changes: [], duration: 0, - workPackages: [] + workPackages: [], + risks: [] }; export const exampleProject3: Project = { @@ -138,7 +140,8 @@ export const exampleProject3: Project = { ], changes: [], duration: 3, - workPackages: [exampleWorkPackage1] + workPackages: [exampleWorkPackage1], + risks: [] }; export const exampleProject4: Project = { @@ -175,7 +178,8 @@ export const exampleProject4: Project = { ], changes: [], duration: 5, - workPackages: [exampleWorkPackage2] + workPackages: [exampleWorkPackage2], + risks: [] }; export const exampleProject5: Project = { @@ -212,7 +216,8 @@ export const exampleProject5: Project = { ], changes: [], duration: 2, - workPackages: [exampleWorkPackage3] + workPackages: [exampleWorkPackage3], + risks: [] }; export const exampleAllProjects: Project[] = [ diff --git a/src/frontend/src/tests/TestSupport/TestData/Risks.stub.ts b/src/frontend/src/tests/TestSupport/TestData/Risks.stub.ts new file mode 100644 index 0000000000..b3642e89a9 --- /dev/null +++ b/src/frontend/src/tests/TestSupport/TestData/Risks.stub.ts @@ -0,0 +1,37 @@ +/* + * This file is part of NER's PM Dashboard and licensed under GNU AGPLv3. + * See the LICENSE file in the repository root folder for details. + */ + +import { Risk } from '../../../../../shared/src/types/risk-types'; +import { exampleProject1, exampleProject2, exampleProject3 } from './Projects.stub'; +import { exampleMemberUser, exampleProjectLeadUser, exampleProjectManagerUser } from './Users.stub'; + +export const exampleRisk1: Risk = { + id: 'risk1', + project: exampleProject1, + detail: 'Risk #1', + isResolved: false, + dateCreated: new Date('2022-08-10'), + createdBy: exampleMemberUser +}; + +export const exampleRisk2: Risk = { + id: 'risk2', + project: exampleProject2, + detail: 'Risk #2', + isResolved: true, + dateCreated: new Date('2022-06-09'), + createdBy: exampleProjectLeadUser, + resolvedBy: exampleMemberUser, + resolvedAt: new Date('2022-07-27') +}; + +export const exampleRisk3: Risk = { + id: 'risk3', + project: exampleProject3, + detail: 'Risk #3', + isResolved: false, + dateCreated: new Date('2021-04-20'), + createdBy: exampleProjectManagerUser +}; diff --git a/src/frontend/src/tests/components/CheckList.test.tsx b/src/frontend/src/tests/components/CheckList.test.tsx deleted file mode 100644 index 3d0786ae0e..0000000000 --- a/src/frontend/src/tests/components/CheckList.test.tsx +++ /dev/null @@ -1,68 +0,0 @@ -/* - * This file is part of NER's PM Dashboard and licensed under GNU AGPLv3. - * See the LICENSE file in the repository root folder for details. - */ - -import { render, screen } from '@testing-library/react'; -import { useTheme } from '../../hooks/Theme.hooks'; -import themes from '../../utils/Themes'; -import { Theme } from '../../utils/Types'; -import CheckList from '../../components/CheckList'; - -jest.mock('../../hooks/Theme.hooks'); -const mockTheme = useTheme as jest.Mock; - -const mockHook = () => { - mockTheme.mockReturnValue(themes[0]); -}; - -describe('Check List Component', () => { - const testList = [ - { details: 'Check #1', resolved: false }, - { details: 'Check #2', resolved: true }, - { details: 'Check #3', resolved: false } - ]; - - const testList2 = [ - { details: 'Check #1', resolved: false }, - { details: 'Check #2', resolved: true } - ]; - - beforeEach(() => mockHook()); - - it('renders the component title', () => { - render(); - - expect(screen.getByText('test')).toBeInTheDocument(); - }); - - it('renders all details', () => { - render(); - - expect(screen.getByText('Check #1')).toBeInTheDocument(); - expect(screen.getByText('Check #2')).toBeInTheDocument(); - expect(screen.getByText('Check #3')).toBeInTheDocument(); - }); - - it('checks checkboxes that should be checked', () => { - render(); - - expect(screen.getByTestId('testCheckbox0')).not.toBeChecked(); - expect(screen.getByTestId('testCheckbox1')).toBeChecked(); - expect(screen.getByTestId('testCheckbox2')).not.toBeChecked(); - }); - - it('renders all buttons"', () => { - render(); - - expect(screen.getByTestId('convertButton')).toBeInTheDocument(); - expect(screen.getByTestId('deleteButton')).toBeInTheDocument(); - expect(screen.getByText('Add New Risk')).toBeInTheDocument(); - }); - - it('renders the header right', () => { - render(); - - expect(screen.getByText('testheaderright')).toBeInTheDocument(); - }); -}); diff --git a/src/frontend/src/tests/pages/HelpPage.test.tsx b/src/frontend/src/tests/pages/InfoPage.test.tsx similarity index 52% rename from src/frontend/src/tests/pages/HelpPage.test.tsx rename to src/frontend/src/tests/pages/InfoPage.test.tsx index d05d9c2637..fa26e4dd4f 100644 --- a/src/frontend/src/tests/pages/HelpPage.test.tsx +++ b/src/frontend/src/tests/pages/InfoPage.test.tsx @@ -5,16 +5,16 @@ import { render, screen, routerWrapperBuilder } from '../TestSupport/TestUtils'; import { routes } from '../../utils/Routes'; -import HelpPage from '../../pages/HelpPage'; +import InfoPage from '../../pages/InfoPage'; /** * Sets up the component under test with the desired values and renders it. */ const renderComponent = () => { - const RouterWrapper = routerWrapperBuilder({ path: routes.HELP, route: routes.HELP }); + const RouterWrapper = routerWrapperBuilder({ path: routes.INFO, route: routes.INFO }); return render( - + ); }; @@ -22,7 +22,7 @@ const renderComponent = () => { describe('help page component', () => { it('renders title', () => { renderComponent(); - expect(screen.getAllByText('Help').length).toEqual(2); + expect(screen.getAllByText('Information').length).toEqual(2); }); it('renders resources section', () => { @@ -37,4 +37,17 @@ describe('help page component', () => { expect(screen.getByText(/Message in Slack/)).toBeInTheDocument(); expect(screen.getByText(/GitHub/)).toBeInTheDocument(); }); + + it('renders calendars section', () => { + renderComponent(); + expect(screen.getByText(/Calendars/)).toBeInTheDocument(); + expect(screen.getAllByText(/Public URL/).length).toEqual(6); + expect(screen.getAllByText(/iCal URL/).length).toEqual(6); + expect(screen.getByText(/Club-Wide Meetings & Events/)).toBeInTheDocument(); + expect(screen.getByText(/Electrical Meetings/)).toBeInTheDocument(); + expect(screen.getByText(/Mechanical Meetings/)).toBeInTheDocument(); + expect(screen.getByText(/Business Meetings/)).toBeInTheDocument(); + expect(screen.getByText(/Software Meetings/)).toBeInTheDocument(); + expect(screen.getByText(/Engineering Reviews/)).toBeInTheDocument(); + }); }); diff --git a/src/frontend/src/tests/pages/ProjectDetailPage/ProjectViewContainer/RiskLog.test.tsx b/src/frontend/src/tests/pages/ProjectDetailPage/ProjectViewContainer/RiskLog.test.tsx index 0066fb9b9d..3ac0e52dd1 100644 --- a/src/frontend/src/tests/pages/ProjectDetailPage/ProjectViewContainer/RiskLog.test.tsx +++ b/src/frontend/src/tests/pages/ProjectDetailPage/ProjectViewContainer/RiskLog.test.tsx @@ -8,6 +8,18 @@ import { useTheme } from '../../../../hooks/Theme.hooks'; import themes from '../../../../utils/Themes'; import { Theme } from '../../../../utils/Types'; import RiskLog from '../../../../pages/ProjectDetailPage/ProjectViewContainer/RiskLog'; +import { exampleRisk1, exampleRisk2, exampleRisk3 } from '../../../TestSupport/TestData/Risks.stub'; +import { Auth } from '../../../../utils/Types'; +import { useAuth } from '../../../../hooks/Auth.hooks'; +import { mockAuth, mockPromiseAxiosResponse } from '../../../TestSupport/TestData/TestUtils.stub'; +import { exampleAdminUser } from '../../../TestSupport/TestData/Users.stub'; +import { exampleProject1 } from '../../../TestSupport/TestData/Projects.stub'; +import { getRisksForProject } from '../../../../apis/Risks.api'; +import { AxiosResponse } from 'axios'; +import { Risk } from 'shared'; +import { useGetRisksForProject } from '../../../../hooks/Risks.hooks'; +import { renderHook } from '@testing-library/react-hooks'; +import wrapper from '../../../../app/AppContextQuery'; jest.mock('../../../../hooks/Theme.hooks'); const mockTheme = useTheme as jest.Mock; @@ -16,24 +28,41 @@ const mockHook = () => { mockTheme.mockReturnValue(themes[0]); }; -describe('Rendering Project Risk Log Component', () => { - beforeEach(() => mockHook()); +jest.mock('../../../../hooks/Auth.hooks'); +const mockedUseAuth = useAuth as jest.Mock; + +jest.mock('../../../../apis/Risks.api'); - const testRisks = [ - { details: 'Risk #1', resolved: false }, - { details: 'Risk #2', resolved: true }, - { details: 'Risk #3', resolved: false } - ]; +const mockAuthHook = (user = exampleAdminUser) => { + mockedUseAuth.mockReturnValue(mockAuth(false, user)); +}; - it('Renders the RiskLog title', () => { - render(); +const testRisks = [exampleRisk1, exampleRisk2, exampleRisk3]; +describe.skip('Rendering Project Risk Log Component', () => { + beforeEach(() => mockHook()); + it('Renders the RiskLog title', async () => { + mockAuthHook(); + const mockRisks = getRisksForProject as jest.Mock>>; + mockRisks.mockReturnValue(mockPromiseAxiosResponse(testRisks)); + const { result, waitFor } = renderHook(() => useGetRisksForProject(exampleProject1.id), { + wrapper + }); + await waitFor(() => result.current.isSuccess); + expect(result.current.data).toEqual(testRisks); + render(); expect(screen.getByText('Risk Log')).toBeInTheDocument(); }); - - it('Renders all of the risks', () => { - render(); - + it('Renders all of the risks', async () => { + mockAuthHook(); + const mockRisks = getRisksForProject as jest.Mock>>; + mockRisks.mockReturnValue(mockPromiseAxiosResponse(testRisks)); + const { result, waitFor } = renderHook(() => useGetRisksForProject(exampleProject1.id), { + wrapper + }); + await waitFor(() => result.current.isSuccess); + expect(result.current.data).toEqual(testRisks); + render(); expect(screen.getByText('Risk #1')).toBeInTheDocument(); expect(screen.getByText('Risk #2')).toBeInTheDocument(); expect(screen.getByText('Risk #3')).toBeInTheDocument(); diff --git a/src/frontend/src/utils/Routes.ts b/src/frontend/src/utils/Routes.ts index c5e320ea0d..b18366bf9f 100644 --- a/src/frontend/src/utils/Routes.ts +++ b/src/frontend/src/utils/Routes.ts @@ -7,7 +7,7 @@ const HOME = `/`; const LOGIN = `/login`; const SETTINGS = `/settings`; -const HELP = `/help`; +const INFO = `/info`; const TEAMS = `/teams`; /**************** Projects Section ****************/ @@ -27,7 +27,7 @@ export const routes = { HOME, LOGIN, SETTINGS, - HELP, + INFO, TEAMS, PROJECTS, diff --git a/src/frontend/src/utils/Urls.ts b/src/frontend/src/utils/Urls.ts index 0e74c09637..c91b01a081 100644 --- a/src/frontend/src/utils/Urls.ts +++ b/src/frontend/src/utils/Urls.ts @@ -21,6 +21,13 @@ const projectsByWbsNum = (wbsNum: string) => `${projects()}/${wbsNum}`; const projectsCreate = () => `${projects()}/new`; const projectsEdit = () => `${projects()}/edit`; +/**************** Risks Endpoints ********************/ +const risks = () => `${API_URL}/risks`; +const risksByProjectId = (projectId: number) => `${risks()}/${projectId}`; +const risksCreate = () => `${risks()}/create`; +const risksEdit = () => `${risks()}/edit`; +const risksDelete = () => `${risks()}/delete`; + /**************** Work Packages Endpoints ****************/ const workPackages = (queryParams?: { [field: string]: string }) => { const url = `${API_URL}/work-packages`; @@ -57,6 +64,12 @@ export const apiUrls = { projectsCreate, projectsEdit, + risks, + risksByProjectId, + risksCreate, + risksEdit, + risksDelete, + workPackages, workPackagesByWbsNum, workPackagesCreate, diff --git a/src/shared/src/types/project-types.ts b/src/shared/src/types/project-types.ts index 2f8f881456..9f7c10ee5b 100644 --- a/src/shared/src/types/project-types.ts +++ b/src/shared/src/types/project-types.ts @@ -7,6 +7,7 @@ import { User } from './user-types'; import { ImplementedChange } from './change-request-types'; import { TimelineStatus } from './work-package-types'; import { TeamPreview } from './team-types'; +import { Risk } from './risk-types'; export interface WbsNumber { carNumber: number; @@ -45,6 +46,7 @@ export interface Project extends WbsElement { otherConstraints: DescriptionBullet[]; workPackages: WorkPackage[]; team?: TeamPreview; + risks: Risk[]; } export type ProjectPreview = Pick; diff --git a/src/shared/src/types/risk-types.ts b/src/shared/src/types/risk-types.ts index 4e0f70c541..2a597468e8 100644 --- a/src/shared/src/types/risk-types.ts +++ b/src/shared/src/types/risk-types.ts @@ -7,7 +7,7 @@ import { ProjectPreview } from './project-types'; import { UserPreview } from './user-types'; export interface Risk { - id: String; + id: string; project: ProjectPreview; detail: string; isResolved: boolean;