Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 77f0e42

Browse files
authored
Merge pull request #185 from cagdas001/dev-2
feat(interview-scheduler): add cap on round & Selected tab features
2 parents a7d019a + f5c6534 commit 77f0e42

File tree

4 files changed

+46
-2
lines changed

4 files changed

+46
-2
lines changed

src/components/BaseModal/index.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ const modalStyle = {
2121
maxWidth: "640px",
2222
width: "100%",
2323
margin: 0,
24+
"overflow-x": "hidden",
2425
};
2526

2627
const containerStyle = {

src/constants/index.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ export const CANDIDATE_STATUS = {
111111
export const CANDIDATE_STATUS_FILTER_KEY = {
112112
TO_REVIEW: "TO_REVIEW",
113113
INTERESTED: "INTERESTED",
114+
SELECTED: "SELECTED",
114115
NOT_INTERESTED: "NOT_INTERESTED",
115116
};
116117

@@ -128,7 +129,13 @@ export const CANDIDATE_STATUS_FILTERS = [
128129
key: CANDIDATE_STATUS_FILTER_KEY.INTERESTED,
129130
buttonText: "Interviews",
130131
title: "Interviews",
131-
statuses: [CANDIDATE_STATUS.SELECTED, CANDIDATE_STATUS.INTERVIEW],
132+
statuses: [CANDIDATE_STATUS.INTERVIEW],
133+
},
134+
{
135+
key: CANDIDATE_STATUS_FILTER_KEY.SELECTED,
136+
buttonText: "Selected",
137+
title: "Selected",
138+
statuses: [CANDIDATE_STATUS.SELECTED],
132139
},
133140
{
134141
key: CANDIDATE_STATUS_FILTER_KEY.NOT_INTERESTED,
@@ -320,3 +327,5 @@ export const DISABLED_DESCRIPTION_MESSAGE =
320327
*/
321328
export const INTERVIEW_POPUP_MEDIA_URL =
322329
"http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4";
330+
331+
export const MAX_ALLOWED_INTERVIEWS = 3;

src/routes/PositionDetails/components/InterviewDetailsPopup/index.jsx

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import User from "components/User";
1616
import BaseModal from "components/BaseModal";
1717
import FormField from "components/FormField";
1818
import Button from "components/Button";
19-
import { FORM_FIELD_TYPE } from "constants";
19+
import { FORM_FIELD_TYPE, MAX_ALLOWED_INTERVIEWS } from "constants";
2020
import "./styles.module.scss";
2121
import RadioFieldGroup from "components/RadioFieldGroup";
2222

@@ -76,6 +76,23 @@ function InterviewDetailsPopup({ open, onClose, candidate, openNext }) {
7676
[dispatch, candidate]
7777
);
7878

79+
// show the warning if exceeds MAX_ALLOWED_INTERVIEW
80+
if (
81+
candidate &&
82+
candidate.interviews &&
83+
candidate.interviews.length >= MAX_ALLOWED_INTERVIEWS
84+
) {
85+
return (
86+
<BaseModal open={open} onClose={onClose} title="Schedule an Interview">
87+
<p styleName="exceeds-max-number-txt">
88+
You've reached the cap of {MAX_ALLOWED_INTERVIEWS} interviews with
89+
this candidate. Now please make your decision to Select and Decline
90+
them.
91+
</p>
92+
</BaseModal>
93+
);
94+
}
95+
7996
return isLoading ? null : (
8097
<Form
8198
initialValues={{
@@ -136,6 +153,10 @@ function InterviewDetailsPopup({ open, onClose, candidate, openNext }) {
136153
hideFullName
137154
/>
138155
)}
156+
<p styleName="max-warning-txt">
157+
You may have as many as {MAX_ALLOWED_INTERVIEWS} interviews
158+
with each candidate for the job.
159+
</p>
139160
</div>
140161
<RadioFieldGroup
141162
name="time"

src/routes/PositionDetails/components/InterviewDetailsPopup/styles.module.scss

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,24 @@
11
@import "styles/include";
22

3+
.exceeds-max-number-txt {
4+
padding: 15px;
5+
letter-spacing: 0.5px;
6+
}
7+
38
.user {
49
font-size: 14px;
510
color: #0D61BF;
11+
max-width: 37%;
12+
.max-warning-txt {
13+
padding-top: 5px;
14+
padding-left: 5px;
15+
font-size: 11px;
16+
color: gray;
17+
}
618
}
719

820
.top {
21+
width: 100%;
922
padding-bottom: 25px;
1023
border-bottom: 1px solid #E9E9E9;
1124
display: flex;

0 commit comments

Comments
 (0)