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

feat(interview-scheduler): add cap on round & Selected tab features #185

Merged
merged 1 commit into from
May 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/components/BaseModal/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const modalStyle = {
maxWidth: "640px",
width: "100%",
margin: 0,
"overflow-x": "hidden",
};

const containerStyle = {
Expand Down
11 changes: 10 additions & 1 deletion src/constants/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ export const CANDIDATE_STATUS = {
export const CANDIDATE_STATUS_FILTER_KEY = {
TO_REVIEW: "TO_REVIEW",
INTERESTED: "INTERESTED",
SELECTED: "SELECTED",
NOT_INTERESTED: "NOT_INTERESTED",
};

Expand All @@ -128,7 +129,13 @@ export const CANDIDATE_STATUS_FILTERS = [
key: CANDIDATE_STATUS_FILTER_KEY.INTERESTED,
buttonText: "Interviews",
title: "Interviews",
statuses: [CANDIDATE_STATUS.SELECTED, CANDIDATE_STATUS.INTERVIEW],
statuses: [CANDIDATE_STATUS.INTERVIEW],
},
{
key: CANDIDATE_STATUS_FILTER_KEY.SELECTED,
buttonText: "Selected",
title: "Selected",
statuses: [CANDIDATE_STATUS.SELECTED],
},
{
key: CANDIDATE_STATUS_FILTER_KEY.NOT_INTERESTED,
Expand Down Expand Up @@ -320,3 +327,5 @@ export const DISABLED_DESCRIPTION_MESSAGE =
*/
export const INTERVIEW_POPUP_MEDIA_URL =
"http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4";

export const MAX_ALLOWED_INTERVIEWS = 3;
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import User from "components/User";
import BaseModal from "components/BaseModal";
import FormField from "components/FormField";
import Button from "components/Button";
import { FORM_FIELD_TYPE } from "constants";
import { FORM_FIELD_TYPE, MAX_ALLOWED_INTERVIEWS } from "constants";
import "./styles.module.scss";
import RadioFieldGroup from "components/RadioFieldGroup";

Expand Down Expand Up @@ -76,6 +76,23 @@ function InterviewDetailsPopup({ open, onClose, candidate, openNext }) {
[dispatch, candidate]
);

// show the warning if exceeds MAX_ALLOWED_INTERVIEW
if (
candidate &&
candidate.interviews &&
candidate.interviews.length >= MAX_ALLOWED_INTERVIEWS
) {
return (
<BaseModal open={open} onClose={onClose} title="Schedule an Interview">
<p styleName="exceeds-max-number-txt">
You've reached the cap of {MAX_ALLOWED_INTERVIEWS} interviews with
this candidate. Now please make your decision to Select and Decline
them.
</p>
</BaseModal>
);
}

return isLoading ? null : (
<Form
initialValues={{
Expand Down Expand Up @@ -136,6 +153,10 @@ function InterviewDetailsPopup({ open, onClose, candidate, openNext }) {
hideFullName
/>
)}
<p styleName="max-warning-txt">
You may have as many as {MAX_ALLOWED_INTERVIEWS} interviews
with each candidate for the job.
</p>
</div>
<RadioFieldGroup
name="time"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
@import "styles/include";

.exceeds-max-number-txt {
padding: 15px;
letter-spacing: 0.5px;
}

.user {
font-size: 14px;
color: #0D61BF;
max-width: 37%;
.max-warning-txt {
padding-top: 5px;
padding-left: 5px;
font-size: 11px;
color: gray;
}
}

.top {
width: 100%;
padding-bottom: 25px;
border-bottom: 1px solid #E9E9E9;
display: flex;
Expand Down