Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ft(#84): Fetch Trainee Notifications #91

Merged
merged 1 commit into from
Nov 13, 2024
Merged

Conversation

munezeromicha
Copy link
Contributor

@munezeromicha munezeromicha commented Nov 8, 2024

What does this PR do?

This PR implements the functionality to fetch trainee notifications from the database using GraphQL queries and mutations. It enables real-time updates for notifications and allows trainees to mark notifications as read, improving user experience and data efficiency.

Description of Task to be completed

  • Fetch Trainee Notifications: Created a GET_TRAINEE_NOTIFICATIONS GraphQL query to retrieve notifications specific to trainees. This query includes fields such as id, message, createdAt, read status, and sender information.

  • Mark Notifications as Read: Implemented a MARK_NOTIFICATION_AS_READ mutation to allow trainees to mark notifications as read. This mutation updates the notification’s read status in the database.

  • Real-Time Notifications: Added a TRAINEE_NOTIFICATION_SUBSCRIPTION subscription for real-time notification updates. When a new notification is sent to a trainee, it is immediately pushed to their UI.

  • Frontend Integration: Integrated the GraphQL query, mutation, and subscription with the frontend to display notifications dynamically, handle real-time updates, and manage unread notification counts. Enhanced UI components to show notifications efficiently and updated styling where needed.

How should this be manually tested?

  • Setup: Ensure the backend server with GraphQL support is running and accessible.

Fetch Notifications:

  • Log in as a trainee and navigate to the notifications page.
  • Verify that notifications are fetched and displayed correctly from the database.

Mark as Read:

  • Click on an unread notification to mark it as read.
  • Confirm that the notification’s read status updates in the database, and the unread count in the UI decreases accordingly.

Error Handling:

Test with no internet connection and observe that appropriate error messages are displayed.

Screenshots:

Screenshot 1 Screenshot 1 Screenshot 2

@munezeromicha munezeromicha added the feature New feature or request label Nov 8, 2024
@munezeromicha munezeromicha self-assigned this Nov 8, 2024
@munezeromicha munezeromicha force-pushed the ft-trainee-notifictions branch 4 times, most recently from 0e848b7 to 4a72cb7 Compare November 8, 2024 10:38
Copy link
Contributor

@pacifiquemboni pacifiquemboni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is Good work @munezeromicha but there is some issues i found

  • Closing icon is not closing notificatin instead notifications are disappearing
  • I dont think that we have select all option on the design even on web
  • Icons to remove specific notification is not working
  • notification are not being marked as read whether clicking on cetain notification or using Mark all as read button

Those issues might be happening on my end, if there are working on your end let me know

@munezeromicha munezeromicha linked an issue Nov 8, 2024 that may be closed by this pull request
@munezeromicha munezeromicha reopened this Nov 11, 2024
@ncutixavier ncutixavier changed the title Fetch Trainee Notifications Using GraphQL Queries and Mutations Fetch Trainee Notifications Nov 11, 2024
@ncutixavier
Copy link

Please refer to this design to improve user experience

image

@munezeromicha munezeromicha changed the title Fetch Trainee Notifications ft(#84): Fetch Trainee Notifications Nov 11, 2024
@munezeromicha munezeromicha changed the title ft(#84): Fetch Trainee Notifications Ft(#84): Fetch Trainee Notifications Nov 11, 2024
@pacifiquemboni
Copy link
Contributor

Good work @munezeromicha, it is working well

@ncutixavier ncutixavier merged commit 9acae12 into dev Nov 13, 2024
4 checks passed
@ncutixavier ncutixavier deleted the ft-trainee-notifictions branch November 13, 2024 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Notifications
6 participants