Skip to content

Commit 6f4176f

Browse files
committed
Cleanup modals and login
1 parent f387392 commit 6f4176f

File tree

13 files changed

+36
-31
lines changed

13 files changed

+36
-31
lines changed

app/src/components/course/index.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ function Course() {
1717
case "MANAGER":
1818
return <p>You are logged in as MANAGER so you see no courses</p>;
1919
case "STAFF":
20-
default:
21-
// temporary addition for development, should not render anything without permission
2220
return (
2321
<>
2422
<SearchBar title='Search Courses' searchBarPlaceholder='Search by name, ID...' />
2523
<StaffCourse />
2624
</>
2725
);
26+
default:
27+
return <p>Please log in to view courses</p>;
2828
}
2929
}
3030

app/src/components/createLearningJourney/CourseModal.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ export default function CourseModal({ skillId, coursesAndSkillsMapping, isModalO
2626
className='fixed top-0 left-0 h-screen w-screen scale-100 backdrop-grayscale backdrop-blur-xl z-50'
2727
aria-hidden='true'
2828
onClick={handleCloseModal}
29+
id='modal-outer'
2930
>
3031
<div
3132
className='absolute flex flex-col justify-center space-y-5 mx-auto my-auto w-3/4 h-3/4 bg-gray-100 z-99 inset-0 shadow-lg rounded-lg items-center text-center'
3233
aria-labelledby='modal-title'
3334
role='dialog'
3435
aria-modal='true'
35-
id='modal-base'
3636
>
3737
<ModalHeader closeModal={closeModal} />
3838
<p className='font-bold text-2xl'>Choose a course to add it to your Learning Journey!</p>

app/src/components/createLearningJourney/DeleteSkillModal.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function DeleteSkillModal({ isDeleteSkillModalOpen, onDeleteSkillModalClose }) {
1616

1717
return (
1818
<div
19-
className='fixed top-0 left-0 h-screen w-screen scale-100 backdrop-grayscale backdrop-blur-xl z-8'
19+
className='fixed top-0 left-0 h-screen w-screen scale-100 backdrop-grayscale backdrop-blur-xl z-50'
2020
aria-hidden='true'
2121
onClick={handleDeleteSkillModalClose}
2222
>

app/src/components/job/JobTile.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import { useHistory } from "react-router-dom";
1010
import { useLJContext } from "src/contexts/LJContext";
1111
import { useUpdateJobContext } from "src/contexts/UpdateJobContext";
1212
import { useUserContext } from "src/contexts/UserContext";
13-
import { updateJob } from "src/api/jobs";
1413
import SkillBadge from "./SkillBadge";
1514
import JobDeletionPopUp from "./hr/JobDeletionPopUp";
1615

@@ -19,13 +18,14 @@ export default function JobTile({ jobId, jobName, jobDesc, skills, isActive, set
1918
const [isButtonPopUpOpen, setIsButtonPopUpOpen] = useState(false);
2019

2120
const { currentUserType } = useUserContext();
22-
const { setSelectedJobRole } = useLJContext();
21+
const { setSelectedJobRole, clearSelectedCourseDetails } = useLJContext();
2322
const { setUpdateJobRole } = useUpdateJobContext();
2423
const history = useHistory();
2524

2625
const handleCreateLJButtonClick = (e) => {
2726
e.stopPropagation();
2827
setSelectedJobRole({ jobId, jobName, jobDesc, skills, isActive });
28+
clearSelectedCourseDetails()
2929
history.push("create-learning-journey");
3030
};
3131

app/src/components/job/index.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ function Job() {
1717
case "MANAGER":
1818
return <p>You are logged in as MANAGER so you see no Jobs</p>;
1919
case "STAFF":
20-
default:
21-
// temporary addition for development, should not render anything without permission
2220
return (
2321
<>
2422
<SearchBar title="Search Job Roles" searchBarPlaceholder="Search by title, skills..." />
2523
<StaffJob />
2624
</>
2725
);
26+
default:
27+
return <p>Please log in to view Jobs</p>;
2828
}
2929
}
3030

app/src/components/job/staff/StaffJob.jsx

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,6 @@ import JobTile from "../JobTile";
66
function StaffJob() {
77
const [jobs, setJobs] = useState([]);
88

9-
const renderJobs = jobs.map(({ jobId, jobName, jobDesc, skills, isActive }, index) => {
10-
if (isActive === 1) {
11-
return <JobTile
12-
key={index}
13-
jobId={jobId}
14-
jobName={jobName}
15-
jobDesc={jobDesc}
16-
skills={skills}
17-
isActive={isActive}
18-
/> ;
19-
}
20-
return null;
21-
});
22-
239
useEffect(() => {
2410
getAllJobs();
2511

@@ -32,6 +18,22 @@ function StaffJob() {
3218
}
3319
}, []);
3420

21+
const renderJobs = jobs.map(({ jobId, jobName, jobDesc, skills, isActive }, index) => {
22+
if (isActive === 1) {
23+
return (
24+
<JobTile
25+
key={index}
26+
jobId={jobId}
27+
jobName={jobName}
28+
jobDesc={jobDesc}
29+
skills={skills}
30+
isActive={isActive}
31+
/>
32+
);
33+
}
34+
return null;
35+
});
36+
3537
return (
3638
<div className='flex flex-col container mt-10 bg-white p-10 mx-auto rounded-lg shadow-lg'>
3739
<h1 className='text-3xl text-left font-bold'>View All Job Roles</h1>

app/src/components/learningJourney/details/LJDeletionPopUp.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function LJDeletionPopUp({
3939
return (
4040
<div
4141
id='deletePopUp'
42-
className='flex justify-center fixed inset-0 h-screen items-center z-10 p-5 backdrop-grayscale backdrop-blur-xl z-8'
42+
className='flex justify-center fixed inset-0 h-screen items-center z-10 p-5 backdrop-grayscale backdrop-blur-xl z-50'
4343
aria-hidden='true'
4444
onClick={handleDeleteLJModalClose}
4545
>

app/src/components/learningJourney/index.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ function LearningJourney() {
1313
return <p>You are logged in as MANAGER so you see no Learning Journeys</p>;
1414
default:
1515
// temporary addition for development, should not render anything without permission
16-
return <StaffLearningJourney staffId={currentUserId} />;
16+
return <p>Please log in to view any Learning Journeys</p>;
17+
1718
}
1819
}
1920

app/src/components/learningJourney/staff/StaffLearningJourney.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ function StaffLearningJourney({ staffId }) {
6565

6666
return (
6767
<div className='flex flex-col container mt-10 p-10 mx-auto w-full w-full bg-white rounded-lg shadow-lg'>
68-
<h1 className='text-3xl text-left font-bold'>My Learning Journeys</h1>
68+
<h1 className='mb-5 text-3xl text-left font-bold'>My Learning Journeys</h1>
6969
<div className='flex grid lg:grid-cols-2 2xl:grid-cols-3 gap-4'>
7070
{learningJourneys.length === 0 ? "No Learning Journeys Found" : renderLearningJourneys}
7171
</div>

app/src/components/skill/hr/DeactivateSkillModal.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function DeactivateSkillModal({
3939

4040
return (
4141
<div
42-
className='fixed top-0 left-0 h-screen w-screen scale-100 backdrop-grayscale backdrop-blur-xl z-8'
42+
className='fixed top-0 left-0 h-screen w-screen scale-100 backdrop-grayscale backdrop-blur-xl z-50'
4343
aria-hidden='true'
4444
onClick={handleDeactivateSkillModalClose}
4545
>

app/src/components/skill/hr/HRSkill.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import { StarIcon } from "@heroicons/react/20/solid";
66
import SkillTile from "../SkillTile";
77

88
function HRSkill() {
9+
const history = useHistory();
10+
911
const [skills, setSkills] = useState([]);
1012
const [isDeactivateSkillButtonClick, setDeactivateSkillButtonClick] = useState(false);
1113
const [isDeactivateSkillModalOpen, setDeactivateSkillModalOpen] = useState(false);
@@ -46,7 +48,6 @@ function HRSkill() {
4648
getAllSkills();
4749
}, [isDeactivateSkillButtonClick === true]);
4850

49-
const history = useHistory();
5051

5152
const redirectToCreateSkillPage = () => {
5253
history.push("/create-skill");

app/src/components/skill/hr/StopDeactivateSkillModal.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function StopDeactivateSkillModal({ isStopDeactivateSkillModalOpen, onStopDeacti
1616

1717
return (
1818
<div
19-
className='fixed top-0 left-0 h-screen w-screen scale-100 backdrop-grayscale backdrop-blur-xl z-8'
19+
className='fixed top-0 left-0 h-screen w-screen scale-100 backdrop-grayscale backdrop-blur-xl z-50'
2020
aria-hidden='true'
2121
onClick={handleStopDeactivateSkillModalClose}
2222
>

app/src/components/skill/index.jsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,21 @@ function Skill() {
1010
case "HR":
1111
return (
1212
<>
13-
<SearchBar title="Search Skills" searchBarPlaceholder="Search by name..." />
13+
<SearchBar title='Search Skills' searchBarPlaceholder='Search by name...' />
1414
<HRSkill />
1515
</>
1616
);
1717
case "MANAGER":
1818
return <p>You are logged in as MANAGER so you see no skills</p>;
1919
case "STAFF":
20-
default:
2120
return (
2221
<>
23-
<SearchBar title="Search Skills" searchBarPlaceholder="Search by name..." />
22+
<SearchBar title='Search Skills' searchBarPlaceholder='Search by name...' />
2423
<StaffSkill />
2524
</>
2625
);
26+
default:
27+
return <p>Please log in to view Skills</p>;
2728
}
2829
}
2930

0 commit comments

Comments
 (0)