Skip to content

Commit

Permalink
WIP - tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
tamsay committed Jun 22, 2023
1 parent de5212c commit de67d44
Show file tree
Hide file tree
Showing 10 changed files with 228 additions and 279 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,19 @@ function SelectionSideBar({ data, selectedMenuItem, activeClassName }) {
<div className={cx(styles.selectionSideBarHeader, "flexCol")}>{data?.headerComponent}</div>

<ul>
{data.listItems.map((item, index) => (
<li
key={index}
onClick={() => handleMenuClick(item?.id)}
className={currentId === item.id.toString() ? activeClassName : ""}
>
{item?.component}
</li>
))}
{Array.isArray(data?.listItems) && data?.listItems.length > 0 ? (
data.listItems.map((item, index) => (
<li
key={index}
onClick={() => handleMenuClick(item?.id)}
className={currentId === item.id.toString() ? activeClassName : ""}
>
{item?.component}
</li>
))
) : (
<span>Data is not available</span>
)}
</ul>
</div>
);
Expand Down
113 changes: 113 additions & 0 deletions frontend/mms-Admin/src/constants/testData.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
import mentorManagerImage from "@/assets/images/mentor-manager-thumbnail.svg";
import mentorImage from "@/assets/images/sample-profile-image.svg";

export const mentorsArray = [
{
id: "1",
name: "Kabiru Omo Isaka",
designation: "Program Assistant, Andela, He/Him",
image: mentorImage,
positionTags: ["PROGRAM ASST.", "MENTOR-GADS"]
},
{
id: "2",
name: "Kabiru Omo Isaka",
designation: "Program Assistant, Andela, He/Him",
image: mentorImage,
positionTags: ["PROGRAM ASST.", "MENTOR-GADS"]
},
{
id: "3",
name: "Kabiru Omo Isaka",
designation: "Program Assistant, Andela, He/Him",
image: mentorImage,
positionTags: ["PROGRAM ASST.", "MENTOR-GADS"]
},
{
id: "4",
name: "Kabiru Omo Isaka",
designation: "Program Assistant, Andela, He/Him",
image: mentorImage,
positionTags: ["PROGRAM ASST.", "MENTOR-GADS"]
},
{
id: "5",
name: "Kabiru Omo Isaka",
designation: "Program Assistant, Andela, He/Him",
image: mentorImage,
positionTags: ["PROGRAM ASST.", "MENTOR-GADS"]
},
{
id: "6",
name: "Kabiru Omo Isaka",
designation: "Program Assistant, Andela, He/Him",
image: mentorImage,
positionTags: ["PROGRAM ASST.", "MENTOR-GADS"]
},
{
id: "7",
name: "Kabiru Omo Isaka",
designation: "Program Assistant, Andela, He/Him",
image: mentorImage,
positionTags: ["PROGRAM ASST.", "MENTOR-GADS"]
},
{
id: "8",
name: "Kabiru Omo Isaka",
designation: "Program Assistant, Andela, He/Him",
image: mentorImage,
positionTags: ["PROGRAM ASST.", "MENTOR-GADS"]
},
{
id: "9",
name: "Kabiru Omo Isaka",
designation: "Program Assistant, Andela, He/Him",
image: mentorImage,
positionTags: ["PROGRAM ASST.", "MENTOR-GADS"]
},
{
id: "10",
name: "Kabiru Omo Isaka",
designation: "Program Assistant, Andela, He/Him",
image: mentorImage,
positionTags: ["PROGRAM ASST.", "MENTOR-GADS"]
}
];

export const mentorManagersArray = [
{
id: "91",
name: "Alice Davies",
designation: "Program Assistant, Andela, Her/She",
image: mentorManagerImage,
positionTags: ["PROGRAM ASST.", "MENTOR-GADS"]
},
{
id: "92",
name: "Alice Davies",
designation: "Program Assistant, Andela, Her/She",
image: mentorManagerImage,
positionTags: ["PROGRAM ASST.", "MENTOR-GADS"]
},
{
id: "93",
name: "Alice Davies",
designation: "Program Assistant, Andela, Her/She",
image: mentorManagerImage,
positionTags: ["PROGRAM ASST.", "MENTOR-GADS"]
},
{
id: "94",
name: "Alice Davies",
designation: "Program Assistant, Andela, Her/She",
image: mentorManagerImage,
positionTags: ["PROGRAM ASST.", "MENTOR-GADS"]
},
{
id: "95",
name: "Alice Davies",
designation: "Program Assistant, Andela, Her/She",
image: mentorManagerImage,
positionTags: ["PROGRAM ASST.", "MENTOR-GADS"]
}
];
6 changes: 3 additions & 3 deletions frontend/mms-Admin/src/helpers/validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export const settingsSupportSchema = Yup.object().shape({
});

export const createTaskSchema = Yup.object().shape({
title: Yup.string().required("Title is required").max(32, "The title must contain a maximum of 32 characters"),
title: Yup.string().required("Title is required"),
description: Yup.string().required("Task description is required")
});

Expand All @@ -79,12 +79,12 @@ export const editProgramCriteriaSchema = Yup.object().shape({
});

export const editTaskSchema = Yup.object().shape({
title: Yup.string().required("Title is required").max(32, "The title must contain a maximum of 32 characters"),
title: Yup.string().required("Title is required"),
description: Yup.string().required("Task description is required")
});

export const createReportSchema = Yup.object().shape({
title: Yup.string().required("Title is required").max(32, "The title must contain a maximum of 32 characters"),
title: Yup.string().required("Title is required"),
achievements: Yup.string(),
blockers: Yup.string(),
recommendations: Yup.string()
Expand Down
6 changes: 1 addition & 5 deletions frontend/mms-Admin/src/pages/Dashboard/Profile/Profile.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useState, useEffect } from "react";
import { useSelector, useDispatch } from "react-redux";
import cx from "classnames";
import { getProfile, getAllUserProfiles } from "@/redux/Profile/ProfileSlice";
import { getProfile } from "@/redux/Profile/ProfileSlice";

import { Container, Row } from "react-bootstrap";
import ProfileHeader from "./ProfileHeader/ProfileHeader";
Expand All @@ -25,9 +25,6 @@ function Profile() {

const userProfile = useSelector((state) => state.profile.getProfileData);
const getProfileLoading = useSelector((state) => state.loading.getProfileLoading);
const getAllUserProfilesData = useSelector((state) => state.profile.getAllUserProfilesData);

console.log(getAllUserProfilesData, "all users data");

useEffect(() => {
if (Object.keys(userProfile).length > 0) {
Expand Down Expand Up @@ -93,7 +90,6 @@ function Profile() {

useEffect(() => {
dispatch(getProfile());
dispatch(getAllUserProfiles());
}, [dispatch]);

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import cx from "classnames";
import { useNavigate, useParams, Outlet } from "react-router-dom";
import styles from "./Programs.module.scss";
import GenericSideBar from "@/components/GenericSideBar/GenericSideBar";
// import FilterAndSearch from "@/components/FilterAndSearch/FilterAndSearch";
import backIcon from "@/assets/icons/back-icon.svg";
import Search from "@/components/Search/Search";
import Filter from "@/components/Filter/Filter";
Expand Down
Loading

0 comments on commit de67d44

Please sign in to comment.