Skip to content

Commit

Permalink
Merge branch 'main' into m04kashish/tces-48-endpoint-to-download-resume
Browse files Browse the repository at this point in the history
  • Loading branch information
penguinc00kies authored Jan 23, 2025
2 parents 76b44cc + 0594f68 commit a6598ce
Show file tree
Hide file tree
Showing 34 changed files with 1,644 additions and 75 deletions.
14 changes: 14 additions & 0 deletions client/public/img/sortIcon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 18 additions & 1 deletion client/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import AuthGuard from "./components/wrappers/auth-guard-component";
// data loading wrappers
import Navbar from "./components/shared/navbar-component/Navbar";
import JobLeadDashboard from "./pages/job-lead-dashboard";
import JobPostingsDashboard from "./pages/job-postings-dashboard";
import AddJobLeadPage from "./pages/add-job-lead";
import EditJobLead from "./pages/edit-job-lead";
import AddJobPostPage from "./pages/add-job-post";
Expand Down Expand Up @@ -237,8 +238,24 @@ function App() {
</AuthGuard>
}
/>
<Route
path="/job-postings"
element={
<AuthGuard
isAuthenticated={isAuthenticated}
loginUser={loginUser}
>
<JobPostingsDashboard
managedJobLeads={managedJobLeads}
setManagedJobLeads={setManagedJobLeads}
getUserById={getUserById}
/>
</AuthGuard>
}
/>
</Route>


{/* Render navbar for child routes that need confirm dialog e.g create job lead */}
<Route
element={
Expand Down Expand Up @@ -354,7 +371,7 @@ function App() {
}
/>
<Route
path="/job-posts/add"
path="/job-postings/add"
element={
<AuthGuard
isAuthenticated={isAuthenticated}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ function AddJobPostParent({ currUser }) {
creation_date: dayjs(),
close_date: dayjs().add(1, "month"),
job_type: [],
description: "",
job_description: "",
state: ""
},
applicationFields: {
custom_questions: [],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
.dotted fieldset {
border: 1px grey dotted;
border: 1px grey dotted;
}

.underline {
text-decoration: underline;
text-underline-offset: 0.2em;
text-decoration-color: #D8D8D8;
}
text-decoration: underline;
text-underline-offset: 0.2em;
text-decoration-color: #d8d8d8;
}
16 changes: 8 additions & 8 deletions client/src/components/add-job-post-component/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ import AddJobDetails from "./job-info-form";
import AddApplicationFields from "./application-form-fields";
import { Container, ButtonContainer } from "./index.styles";
import UserType from "../../prop-types/UserType";
import createJobPost from "./mockResponse";
import { createJobPost } from "../../utils/job_posts_api";
// import createJobPost from "./mockResponse";
import PostingResultDialog from "./posting-result-dialog";

function AddJobPost({ jobPostData, updateJobPostData, currUser }) {
Expand All @@ -33,7 +34,7 @@ function AddJobPost({ jobPostData, updateJobPostData, currUser }) {
const SUCCESS_DRAFT = {
isSuccess: true,
message: "Your job posting was saved",
handleClose: () => navigate("/dashboard"),
handleClose: () => navigate("/job-postings"),
buttonMessage: "CLOSE",
};
const ERROR_DRAFT = {
Expand All @@ -45,7 +46,7 @@ function AddJobPost({ jobPostData, updateJobPostData, currUser }) {
const SUCCESS_PUBLISH = {
isSuccess: true,
message: "Your job posting was published",
handleClose: () => navigate("/dashboard"),
handleClose: () => navigate("/job-postings"),
buttonMessage: "CLOSE",
};
const ERROR_PUBLISH = {
Expand Down Expand Up @@ -76,18 +77,17 @@ function AddJobPost({ jobPostData, updateJobPostData, currUser }) {

const handleSubmit = async (e, postState) => {
const DRAFT = "Draft";
jobPostData.jobInfo.state = postState // eslint-disable-line no-param-reassign
const updatedJobPost = { ...jobPostData, state: postState };
updateJobPostData("state", postState);

setIsLoading(true);
try {
const response = await createJobPost(
updatedJobPost,
updatedJobPost.jobInfo,
currUser.userID,
currUser.userID,
);

if (response.ok) {
if (response.status === "success") {
setResultModalValues(
postState === DRAFT ? SUCCESS_DRAFT : SUCCESS_PUBLISH,
);
Expand Down Expand Up @@ -231,7 +231,7 @@ function AddJobPost({ jobPostData, updateJobPostData, currUser }) {
variant="contained"
disabled={isLoading}
disableElevation
onClick={() => handleSubmit(null, "Publish")}
onClick={() => handleSubmit(null, "Active")}
>
PUBLISH
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,7 @@ function AddJobDetails({ jobPostData, setJobPostData }) {
sx={{ m: 1, width: "47%" }}
value={jobPostData.close_date}
minDate={dayjs()}
onChange={(newValue) =>
handleInputChange(newValue, jobPostData, "close_date")
}
onChange={(newValue) => handleInputChange(newValue, "close_date")}
renderInput={(params) => (
// eslint-disable-next-line
<TextField {...params} error={false} helperText="" required />
Expand All @@ -243,14 +241,14 @@ function AddJobDetails({ jobPostData, setJobPostData }) {
<TextField
fullWidth
sx={{ m: 1, width: "96%" }}
id="description"
id="job_description"
label="Description"
multiline
rows={4}
value={jobPostData.description}
value={jobPostData.job_description}
InputLabelProps={{ shrink: true, required: false }}
helperText="*Required"
onChange={(e) => handleInputChange(e.target.value, "description")}
onChange={(e) => handleInputChange(e.target.value, "job_description")}
required
/>
</Container>
Expand Down
12 changes: 6 additions & 6 deletions client/src/components/add-job-post-component/mockResponse.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ function mockFetch(jobPostData, currUserId) {
return new Promise((resolve, reject) => {
console.log(reject);
// Simulate error
setTimeout(() => {
reject(new Error("Failure"));
}, timeout);

// Simulate success
// setTimeout(() => {
// resolve({ ok: 200, jobPostData, currUserId });
// reject(new Error("Failure"));
// }, timeout);

// Simulate success
setTimeout(() => {
resolve({ ok: 200, jobPostData, currUserId });
}, timeout);
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ function DashboardHeaderComponent({ currUser }) {
Add New Client
</MenuItem>
<MenuItem
onClick={() => handleClose("/job-posts/add")}
onClick={() => handleClose("/job-postings/add")}
sx={{ justifyContent: "center" }}
>
Add New Job Posting
Expand Down
Loading

0 comments on commit a6598ce

Please sign in to comment.