From 54bbc0e9d8c34c8a51ec66c118b94e763aa8af2a Mon Sep 17 00:00:00 2001 From: Lucas Slunt <100328965+LucasSlunt@users.noreply.github.com> Date: Wed, 2 Apr 2025 12:17:15 -0700 Subject: [PATCH 01/11] No more irrelevant notifications Notifications won't be sent for task edits that don't change things. --- .../task_manager/service/TeamMemberService.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/backend/task-manager/src/main/java/com/example/task_manager/service/TeamMemberService.java b/backend/task-manager/src/main/java/com/example/task_manager/service/TeamMemberService.java index 59df3130..515e2c8f 100644 --- a/backend/task-manager/src/main/java/com/example/task_manager/service/TeamMemberService.java +++ b/backend/task-manager/src/main/java/com/example/task_manager/service/TeamMemberService.java @@ -146,14 +146,23 @@ public TaskDTO editTask(int taskId, TaskDTO taskDTO) { String oldStatus = task.getStatus(); LocalDate oldDueDate = task.getDueDate(); - if (taskDTO.getTitle() != null && !taskDTO.getTitle().isEmpty()) { + // if (taskDTO.getTitle() == oldTitle && + // taskDTO.getDescription() == oldDescription && + // taskDTO.getIsLocked() == oldLockStatus && + // taskDTO.getDueDate() == oldDueDate && + // taskDTO.getStatus() == oldStatus){ + // //nothing has been changed + // } + if ((taskDTO.getTitle() != null && !taskDTO.getTitle().isEmpty()) && + (!taskDTO.getTitle().equals(oldTitle))) { task.setTitle(taskDTO.getTitle()); //call notif method notifService.notifyTaskTitleChange(task, oldTitle); } - if (taskDTO.getDescription() != null && !taskDTO.getDescription().isEmpty()) { + if (taskDTO.getDescription() != null && !taskDTO.getDescription().isEmpty()&& + (!taskDTO.getDescription().equals(oldDescription))) { task.setDescription(taskDTO.getDescription()); //call notif method @@ -174,7 +183,7 @@ public TaskDTO editTask(int taskId, TaskDTO taskDTO) { notifService.notifyTaskStatusChange(task, oldStatus); } - if (taskDTO.getDueDate() != null) { + if (taskDTO.getDueDate() != null && !taskDTO.getDueDate().equals(oldDueDate)) { task.setDueDate(taskDTO.getDueDate()); //call notif method From 4134e0ce15293e846f2c4aacc62d591d53c4312a Mon Sep 17 00:00:00 2001 From: Lucas Slunt <100328965+LucasSlunt@users.noreply.github.com> Date: Wed, 2 Apr 2025 12:23:14 -0700 Subject: [PATCH 02/11] changed notification box colour --- .../example/task_manager/service/TeamMemberService.java | 7 ------- frontend/react-app/src/css/Notifications.css | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/backend/task-manager/src/main/java/com/example/task_manager/service/TeamMemberService.java b/backend/task-manager/src/main/java/com/example/task_manager/service/TeamMemberService.java index 515e2c8f..061f6703 100644 --- a/backend/task-manager/src/main/java/com/example/task_manager/service/TeamMemberService.java +++ b/backend/task-manager/src/main/java/com/example/task_manager/service/TeamMemberService.java @@ -146,13 +146,6 @@ public TaskDTO editTask(int taskId, TaskDTO taskDTO) { String oldStatus = task.getStatus(); LocalDate oldDueDate = task.getDueDate(); - // if (taskDTO.getTitle() == oldTitle && - // taskDTO.getDescription() == oldDescription && - // taskDTO.getIsLocked() == oldLockStatus && - // taskDTO.getDueDate() == oldDueDate && - // taskDTO.getStatus() == oldStatus){ - // //nothing has been changed - // } if ((taskDTO.getTitle() != null && !taskDTO.getTitle().isEmpty()) && (!taskDTO.getTitle().equals(oldTitle))) { task.setTitle(taskDTO.getTitle()); diff --git a/frontend/react-app/src/css/Notifications.css b/frontend/react-app/src/css/Notifications.css index 384dbd40..6f56a9dd 100644 --- a/frontend/react-app/src/css/Notifications.css +++ b/frontend/react-app/src/css/Notifications.css @@ -13,7 +13,7 @@ #notifContainer thead td { width: 100%; color: white; - background-color: #254E58; + background-color: #52799d; } /* #notifContainer tbody td { */ From fee0f42777b5b8636c56e82d3d95908f8950387c Mon Sep 17 00:00:00 2001 From: Lucas Slunt <100328965+LucasSlunt@users.noreply.github.com> Date: Wed, 2 Apr 2025 13:23:04 -0700 Subject: [PATCH 03/11] put silly purple box on the silly page --- frontend/react-app/src/pages/Notifications.jsx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/frontend/react-app/src/pages/Notifications.jsx b/frontend/react-app/src/pages/Notifications.jsx index 1963b0e4..df2a8251 100644 --- a/frontend/react-app/src/pages/Notifications.jsx +++ b/frontend/react-app/src/pages/Notifications.jsx @@ -1,3 +1,4 @@ +import TaskList from "../components/TaskList"; import React, { useEffect, useMemo, useState } from 'react'; import '../css/Notifications.css'; import Notification from "../components/Notification"; @@ -84,6 +85,7 @@ const Notifications = () => { // reusable section component const NotificationSection = ({ title, items }) => ( items.length > 0 && ( + <> {title} @@ -96,6 +98,7 @@ const Notifications = () => { deleteNotification={deleteNotification} /> ))} + ) ); @@ -107,6 +110,15 @@ const Notifications = () => {
+
+

My Completed Tasks

+
+
+ +

No tasks completed

+ +
+
From 74808bddafdf87042ba37b46677d80cbac03a8de Mon Sep 17 00:00:00 2001 From: Lucas Slunt <100328965+LucasSlunt@users.noreply.github.com> Date: Wed, 2 Apr 2025 13:31:51 -0700 Subject: [PATCH 04/11] notifications in the box --- .../react-app/src/pages/Notifications.jsx | 101 +++--------------- 1 file changed, 16 insertions(+), 85 deletions(-) diff --git a/frontend/react-app/src/pages/Notifications.jsx b/frontend/react-app/src/pages/Notifications.jsx index df2a8251..8e9be92d 100644 --- a/frontend/react-app/src/pages/Notifications.jsx +++ b/frontend/react-app/src/pages/Notifications.jsx @@ -111,95 +111,26 @@ const Notifications = () => {
-

My Completed Tasks

+

My Notifications

-
- -

No tasks completed

- +
+
+ + + + + + + + + +
Notifications
-
- - - - - - - - - - -
Notifications
- + + ); }; -export default Notifications; - - -//before refactoring - - -// import React from 'react'; -// import {useEffect, useState} from 'react'; -// import '../css/Notifications.css'; -// import Notification from "../components/Notification"; - -// const Notifications = () => { -// const [notifications, setNotifications] = useState([ -// {id: 1, team: "Team 2", message: 'Bob edited your task "Create wireframe"', read: false}, -// { id: 2, team: "Team 1", message: 'Mary completed your task "Code things"', read: false }, -// { id: 3, team: "Team 1", message: 'Adam assigned you to "Code more"', read: true } -// ]); - -// //mark as read or unread -// const toggleRead = (id) => { -// setNotifications(notifications.map(notif => -// notif.id === id ? { ...notif, read: !notif.read } : notif -// )); -// }; - -// //delete any notification -// const deleteNotification = (id) => { -// setNotifications(notifications.filter(notif => notif.id !== id)); -// }; - -// return ( -//
-// -// -// -// -// -// -// -// {notifications.some(notif => !notif.read) && ( -// <> -// -// -// -// {notifications.filter(notif => !notif.read).map(notif => ( -// -// ))} -// -// )} - -// {notifications.some(notif => notif.read) && ( -// <> -// -// -// -// {notifications.filter(notif => notif.read).map(notif => ( -// -// ))} -// -// )} -// -//
Notifications
Unread
Read
-//
-// ) -// } - -// export default Notifications; \ No newline at end of file +export default Notifications; \ No newline at end of file From eb4d037dc546d0e74b55900d7606d1e8ec11421a Mon Sep 17 00:00:00 2001 From: Lucas Slunt <100328965+LucasSlunt@users.noreply.github.com> Date: Wed, 2 Apr 2025 13:36:01 -0700 Subject: [PATCH 05/11] emphasized read vs unread --- frontend/react-app/src/css/Notifications.css | 13 ++++--------- frontend/react-app/src/pages/Notifications.jsx | 4 +--- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/frontend/react-app/src/css/Notifications.css b/frontend/react-app/src/css/Notifications.css index 6f56a9dd..f4e2a2d4 100644 --- a/frontend/react-app/src/css/Notifications.css +++ b/frontend/react-app/src/css/Notifications.css @@ -28,10 +28,6 @@ text-align: left !important; } -#notifContainer tbody td { - background-color: white; -} - #notifContainer input { border: none; } @@ -43,10 +39,8 @@ .subHeader { text-align: left !important; padding-left: 10px; -} - -.delete { - + color: white; + background-color: #52799d; } .delete:hover { @@ -67,4 +61,5 @@ border: none; background-color: black; -} \ No newline at end of file +} + diff --git a/frontend/react-app/src/pages/Notifications.jsx b/frontend/react-app/src/pages/Notifications.jsx index 8e9be92d..54b9ecb4 100644 --- a/frontend/react-app/src/pages/Notifications.jsx +++ b/frontend/react-app/src/pages/Notifications.jsx @@ -116,9 +116,7 @@ const Notifications = () => {
- - - + From 1e1704eef92dbd04dbb96e512baf34793f8dd62f Mon Sep 17 00:00:00 2001 From: Lucas Slunt <100328965+LucasSlunt@users.noreply.github.com> Date: Wed, 2 Apr 2025 13:47:11 -0700 Subject: [PATCH 06/11] centered notif box --- frontend/react-app/src/css/Notifications.css | 7 +++---- frontend/react-app/src/pages/Notifications.jsx | 4 +--- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/frontend/react-app/src/css/Notifications.css b/frontend/react-app/src/css/Notifications.css index f4e2a2d4..ea16bda3 100644 --- a/frontend/react-app/src/css/Notifications.css +++ b/frontend/react-app/src/css/Notifications.css @@ -1,14 +1,13 @@ #notifContainer { background-color: white; - width: 600px; + width: 1300px; height: 500px; margin: auto; + padding: 2%; font-family: Arial, Helvetica, sans-serif; } -#notifContainer table { - width: 100%; -} + #notifContainer thead td { width: 100%; diff --git a/frontend/react-app/src/pages/Notifications.jsx b/frontend/react-app/src/pages/Notifications.jsx index 54b9ecb4..623f1ea1 100644 --- a/frontend/react-app/src/pages/Notifications.jsx +++ b/frontend/react-app/src/pages/Notifications.jsx @@ -109,15 +109,13 @@ const Notifications = () => {
+

My Notifications

Notifications
- - - From e7add47107979d02dc9ee7121df4683d7dbb7061 Mon Sep 17 00:00:00 2001 From: Lucas Slunt <100328965+LucasSlunt@users.noreply.github.com> Date: Wed, 2 Apr 2025 14:28:03 -0700 Subject: [PATCH 07/11] added date to notifs --- .../service/NotificationService.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/backend/task-manager/src/main/java/com/example/task_manager/service/NotificationService.java b/backend/task-manager/src/main/java/com/example/task_manager/service/NotificationService.java index 50ced310..52d0fbde 100644 --- a/backend/task-manager/src/main/java/com/example/task_manager/service/NotificationService.java +++ b/backend/task-manager/src/main/java/com/example/task_manager/service/NotificationService.java @@ -52,7 +52,7 @@ public void notifyTaskTitleChange(Task updatedTask, String oldTitle) { teamMember, updatedTask, NotificationType.TASK_TITLE_EDITED, - "Task Update: The title of a task was changed from \"" + oldTitle + "\" to \"" + updatedTask.getTitle() + "\"" + "Task Update: The title of a task was changed from \"" + oldTitle + "\" to \"" + updatedTask.getTitle() + "\" on " + LocalDate.now() ); } } @@ -67,7 +67,7 @@ public void notifyTaskDescriptionChange(Task updatedTask, String oldDescription) teamMember, updatedTask, NotificationType.TASK_DESCRIPTION_EDITED, - "Task Update: The description of a task was changed from \"" + oldDescription + "\" to \"" + updatedTask.getDescription() + "\"" + "Task Update: The description of a task was changed from \"" + oldDescription + "\" to \"" + updatedTask.getDescription() + "\" on " + LocalDate.now() ); } } @@ -82,7 +82,7 @@ public void notifyTaskLockChange(Task updatedTask, boolean oldLockStatus) { teamMember, updatedTask, NotificationType.TASK_LOCK_STATUS_CHANGED, - "Task Update: The lock status of a task was changed from \"" + oldLockStatus + "\" to \"" + updatedTask.isLocked() + "\"" + "Task Update: The lock status of a task was changed from \"" + oldLockStatus + "\" to \"" + updatedTask.isLocked() + "\" on " + LocalDate.now() ); } } @@ -98,7 +98,7 @@ public void notifyTaskDueDateChange(Task updatedTask, LocalDate oldDueDate) { updatedTask, NotificationType.TASK_DUE_DATE_EDITED, "Task Update: The due date of a task was changed from \"" + oldDueDate + "\" to \"" + updatedTask.getDueDate() - + "\""); + + "\" on " + LocalDate.now()); } } @@ -112,7 +112,7 @@ public void notifyTaskStatusChange(Task updatedTask, String oldStatus) { teamMember, updatedTask, NotificationType.TASK_STATUS_EDITED, - "Task Update: The status of a task was changed from \"" + oldStatus + "\" to \"" + updatedTask.getStatus() + "\"" + "Task Update: The status of a task was changed from \"" + oldStatus + "\" to \"" + updatedTask.getStatus() + "\" on " + LocalDate.now() ); } } @@ -120,19 +120,19 @@ public void notifyTaskStatusChange(Task updatedTask, String oldStatus) { //notify member when task is assigned public void notifyTaskAssignment(TeamMember teamMember, Task task) { createNotification(teamMember, task, NotificationType.TASK_ASSIGNED, - "You have been assigned to a task: \"" + task.getTitle()); + "You have been assigned to a task: \"" + task.getTitle() + "\" on " + LocalDate.now()); } //notify member when task is unassigned public void notifyTaskUnassignment(TeamMember teamMember, Task task) { createNotification(teamMember, task, NotificationType.TASK_UNASSIGNED, - "You have been unassigned from a task: \"" + task.getTitle()); + "You have been unassigned from a task: \"" + task.getTitle() + "\" on " + LocalDate.now()); } //notify member when they are added to a team public void notifyTeamAssignment(TeamMember teamMember, Team team) { createNotification(teamMember, null, NotificationType.TEAM_ASSIGNED, - "You have been assigned to a team: \"" + team.getTeamName()); + "You have been assigned to a team: \"" + team.getTeamName() + "\" on " + LocalDate.now()); } //notify member when they are removed from a team From e74ac2bd997a5285a9b96ad1f6601720df0fcec9 Mon Sep 17 00:00:00 2001 From: Lucas Slunt <100328965+LucasSlunt@users.noreply.github.com> Date: Wed, 2 Apr 2025 15:02:53 -0700 Subject: [PATCH 08/11] changed notif box width --- frontend/react-app/src/css/Notifications.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/react-app/src/css/Notifications.css b/frontend/react-app/src/css/Notifications.css index ea16bda3..1929ffb6 100644 --- a/frontend/react-app/src/css/Notifications.css +++ b/frontend/react-app/src/css/Notifications.css @@ -1,6 +1,6 @@ #notifContainer { background-color: white; - width: 1300px; + width: 40%; height: 500px; margin: auto; padding: 2%; From 8b66efdb998753070b0535eb65293906a429ecd1 Mon Sep 17 00:00:00 2001 From: Lucas Slunt <100328965+LucasSlunt@users.noreply.github.com> Date: Wed, 2 Apr 2025 15:09:21 -0700 Subject: [PATCH 09/11] fixed row size changing on delete hover --- frontend/react-app/src/css/Notifications.css | 10 ++++++++-- frontend/react-app/src/pages/Notifications.jsx | 1 - 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/frontend/react-app/src/css/Notifications.css b/frontend/react-app/src/css/Notifications.css index 1929ffb6..f24538fa 100644 --- a/frontend/react-app/src/css/Notifications.css +++ b/frontend/react-app/src/css/Notifications.css @@ -1,12 +1,15 @@ #notifContainer { background-color: white; - width: 40%; + width: 1300px; height: 500px; margin: auto; padding: 2%; font-family: Arial, Helvetica, sans-serif; } +#notifContainer table { + width: 100%; +} #notifContainer thead td { @@ -42,11 +45,14 @@ background-color: #52799d; } +.delete{ + +} + .delete:hover { cursor: pointer; color: white; background-color: red; - border: none; } .smallTeamButton { diff --git a/frontend/react-app/src/pages/Notifications.jsx b/frontend/react-app/src/pages/Notifications.jsx index 623f1ea1..ebe2c5ed 100644 --- a/frontend/react-app/src/pages/Notifications.jsx +++ b/frontend/react-app/src/pages/Notifications.jsx @@ -109,7 +109,6 @@ const Notifications = () => {
-

My Notifications

From c791746b145864671c2d7c1037095e5a614665a9 Mon Sep 17 00:00:00 2001 From: Lucas Slunt <100328965+LucasSlunt@users.noreply.github.com> Date: Wed, 2 Apr 2025 15:10:11 -0700 Subject: [PATCH 10/11] change margin to left --- frontend/react-app/src/css/Notifications.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/react-app/src/css/Notifications.css b/frontend/react-app/src/css/Notifications.css index f24538fa..103c28d3 100644 --- a/frontend/react-app/src/css/Notifications.css +++ b/frontend/react-app/src/css/Notifications.css @@ -1,8 +1,8 @@ #notifContainer { background-color: white; - width: 1300px; + width: 600px; height: 500px; - margin: auto; + margin: left; padding: 2%; font-family: Arial, Helvetica, sans-serif; } From f61b779b41ba05b1459ee1c1e869a6ea93fa9b2a Mon Sep 17 00:00:00 2001 From: lucywalt Date: Wed, 2 Apr 2025 15:31:21 -0700 Subject: [PATCH 11/11] Fixed layout issues --- frontend/react-app/src/css/Notifications.css | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/frontend/react-app/src/css/Notifications.css b/frontend/react-app/src/css/Notifications.css index 103c28d3..bc244fc1 100644 --- a/frontend/react-app/src/css/Notifications.css +++ b/frontend/react-app/src/css/Notifications.css @@ -1,6 +1,6 @@ #notifContainer { - background-color: white; - width: 600px; + background-color: white;; + width: 75%; height: 500px; margin: left; padding: 2%; @@ -8,7 +8,7 @@ } #notifContainer table { - width: 100%; + width: 130%; } @@ -53,6 +53,7 @@ cursor: pointer; color: white; background-color: red; + border: none; } .smallTeamButton { @@ -68,3 +69,12 @@ } + +.notifBox { + width: 75%; + +} + +.column-box { + width: 120%; +} \ No newline at end of file