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

Implement Monthly-checking Feature for Mentees, Mentors and Admins #199

Merged
merged 25 commits into from
Oct 15, 2024

Conversation

mayura-andrew
Copy link
Member

@mayura-andrew mayura-andrew commented Sep 30, 2024

Purpose

The purpose of this PR is to fix #198 by introducing a comprehensive monthly check-in feature for mentees, mentors, and admins.

Goals

  • Mentees: Allow mentees to submit their monthly progress, view mentor feedback, and see the history of their submissions.
  • Mentors: Enable mentors to view their mentees' submissions, provide feedback, and track the history of check-ins.
  • Admins: Provide admins with the ability to oversee the progress of all mentees, ensuring that mentors are providing timely feedback and that mentees are completing their check-ins.

Approach

  • Implemented a submission form UI for mentees to submit their monthly progress.
  • Created a view for mentors to see the submitted check-ins and provide feedback.
  • Developed an admin dashboard to monitor the progress of all mentees.
  • Integrated the feedback form into the mentor dashboard.
  • Integrated the check-in status view into the mentee dashboard.
  • Integrated the admin dashboard view to oversee the check-in process.
  • Added necessary hooks and schemas for form validation and submission.

Screenshots

New Mentor Dashboard

image

New Mentee Dashboard UI

image

image

image

image

image

image

image

Mentee Monthly-checking Form Modal

image

Mentor Feedback UI

image

image

Checklist

  • This PR doesn't commit any keys, passwords, tokens, usernames, or other secrets.
  • I have read and understood the development best practices guidelines ( http://bit.ly/sef-best-practices )
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation

Related PRs

Test environment

NodeJS: 20.15.0
FireFox: 129.0

Learning

  • Researched best practices for form validation using react-hook-form and zod.
  • Reviewed UI/UX patterns for feedback forms and admin dashboards.

mayura-andrew and others added 17 commits September 20, 2024 01:19
- Refactor MonthlyChecking component to include UI changes for viewing submissions in both mentor and mentee side.
- Add TagInput functionality to allow users to input and display tags for monthly check-ins.
…ogress Towards Goals; Prevent multiple submissions
Remove menteeName property from MonthlyCheckIn interface in types.ts

Refactor useMonthlyCheckIns hook: Update return type to include MonthlyCheckIn[]

Update formatDate function in utils.ts: Handle null and invalid date strings

Add HistoryClockIcon component

Add NewSubmissionsIcon component

Refactor MentorFeedbackForm component: Update submit button styling

Update MenteeCheckInSchema in schemas.ts: Update validation rules for generalUpdatesAndFeedback and progressTowardsGoals

Add HistoryToggle component

Add NotificationBadge component

Refactor MenteeCheckIn component: Update remove button styling

Refactor MenteeMonthlyChecking component: Update media link text and date format
@mayura-andrew mayura-andrew requested review from anjula-sack and Madhawa97 and removed request for anjula-sack October 1, 2024 18:45
@anjula-sack anjula-sack changed the base branch from main to development October 5, 2024 12:37
package.json Outdated
"dotenv": "^16.0.3",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-hook-form": "^7.51.0",
"react-intersection-observer": "^9.13.1",
"react-router": "^6.11.2",
"react-router-dom": "^6.11.2",
"react-spring": "^9.7.4",
"react-tag-input": "^6.10.3",
Copy link
Member

Choose a reason for hiding this comment

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

We are not using this right?

onValidationError?: (error: string) => void;
}

const TagInput: React.FC<TagInputProps> = ({
Copy link
Member

Choose a reason for hiding this comment

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

Remove this unused component

package.json Outdated
"dotenv": "^16.0.3",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-hook-form": "^7.51.0",
"react-intersection-observer": "^9.13.1",
"react-router": "^6.11.2",
"react-router-dom": "^6.11.2",
"react-spring": "^9.7.4",
Copy link
Member

Choose a reason for hiding this comment

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

Remov this library as well. We don't need animations for now.

if (!isOpen) return null;

return (
<div className="fixed inset-0 flex items-center justify-center z-50 bg-black bg-opacity-50">
Copy link
Member

Choose a reason for hiding this comment

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

Try to reuse the existing modal component for this

Copy link
Member Author

Choose a reason for hiding this comment

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

this is not using, i'll remove this

Comment on lines 100 to 112
<option value="">Select a month</option>
<option value="January">January</option>
<option value="February">February</option>
<option value="March">March</option>
<option value="April">April</option>
<option value="May">May</option>
<option value="June">June</option>
<option value="July">July</option>
<option value="August">August</option>
<option value="September">September</option>
<option value="October">October</option>
<option value="November">November</option>
<option value="December">December</option>
Copy link
Member

Choose a reason for hiding this comment

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

Create a loop for this

const months = ['January', 'February', 'March' ....]

months.map()

Comment on lines 25 to 35
{showGuidelines ? (
<>
<ArrowDownIcon />
Guidelines
</>
) : (
<>
<ArrowRightIcon />
Guidelines
</>
)}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
{showGuidelines ? (
<>
<ArrowDownIcon />
Guidelines
</>
) : (
<>
<ArrowRightIcon />
Guidelines
</>
)}
{showGuidelines ? <ArrowDownIcon /> : <ArrowRightIcon />} Guidelines

src/App.tsx Outdated
<Route path="/mentors" element={<Mentors />} />
<Route path="/mentors/:mentorId" element={<MentorProfile />} />
<Route path="/mentees/:menteeId" element={<MenteeProfile />} />
<Route path="/mentee-checkin" element={<MenteeCheckIn />} />

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change

package.json Outdated
@@ -19,9 +19,11 @@
"license": "ISC",
"dependencies": {
"@hookform/resolvers": "^3.3.4",
"@react-spring/web": "^9.7.4",
Copy link
Member

Choose a reason for hiding this comment

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

Remove this

Suggested change
"@react-spring/web": "^9.7.4",

mentor: Mentor;
}

const MentorProfileCard: React.FC<MentorCardProps> = ({ mentor }) => {
Copy link
Member

Choose a reason for hiding this comment

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

Can't we reuse the existing mentor card?

Comment on lines 22 to 52
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
className="w-6 h-6"
>
<path
fill="none"
stroke={iconColor}
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="1.5"
d="M12 6.5V3m0 3.5a5 5 0 015 5v3.5c0 1 .5 2 1.5 2.5H5.5c1-.5 1.5-1.5 1.5-2.5V11.5a5 5 0 015-5zm-3.5 14h7"
/>
{count > 0 && (
<>
<circle cx="18" cy="6" r="5.5" fill={badgeColor} />
<text
x="18"
y="6"
fontFamily="Arial, sans-serif"
fontSize="7"
fontWeight="bold"
fill={textColor}
textAnchor="middle"
dominantBaseline="central"
>
{displayCount}
</text>
</>
)}
</svg>
Copy link
Member

Choose a reason for hiding this comment

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

Move this to svgs

@@ -0,0 +1,6 @@
import React from 'react';

const Spinner: React.FC = () => (
Copy link
Member

Choose a reason for hiding this comment

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

import React from 'react';
import { NotificationProps } from '../../../types';

const NotificationBellSVG: React.FC<NotificationProps> = ({
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
const NotificationBellSVG: React.FC<NotificationProps> = ({
const NotificationBell: React.FC<NotificationProps> = ({

Rename the component folder as well NotificationBell

Copy link
Member

@anjula-sack anjula-sack left a comment

Choose a reason for hiding this comment

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

Good job! @mayura-andrew

@anjula-sack anjula-sack merged commit f23f016 into sef-global:development Oct 15, 2024
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Introduce Monthly Check-In Feature for Mentees, Mentors, and Admins
2 participants