diff --git a/src/components/ActionsMenu/index.jsx b/src/components/ActionsMenu/index.jsx index b888ade0..7bc36da3 100644 --- a/src/components/ActionsMenu/index.jsx +++ b/src/components/ActionsMenu/index.jsx @@ -100,7 +100,11 @@ const ActionsMenu = ({ options = [] }) => { onClick={closeOnAction(option.action)} role="button" tabIndex={0} - styleName="option" + styleName={ + "option" + + (option.style ? " " + option.style : "") + + (option.disabled ? " disabled" : "") + } > {option.label} diff --git a/src/components/ActionsMenu/styles.module.scss b/src/components/ActionsMenu/styles.module.scss index c9556de7..18d15c78 100644 --- a/src/components/ActionsMenu/styles.module.scss +++ b/src/components/ActionsMenu/styles.module.scss @@ -39,10 +39,23 @@ } .option { - color: #0d61bf; + color: #219174; cursor: pointer; - font-size: 14px; - line-height: 20px; + font-size: 12px; + font-weight: bold; + letter-spacing: 0.8px; + line-height: 30px; + text-transform: uppercase; outline: none; padding: 5px 0; } + +.danger { + color: #EF476F; +} + +.disabled { + color: gray; + opacity: 0.6; + pointer-events: none; +} diff --git a/src/constants/index.js b/src/constants/index.js index 9155d978..7cd2c580 100644 --- a/src/constants/index.js +++ b/src/constants/index.js @@ -97,8 +97,10 @@ export const RATE_TYPE = { export const CANDIDATE_STATUS = { OPEN: "open", SELECTED: "selected", - SHORTLIST: "shortlist", - REJECTED: "rejected", + PLACED: "placed", + CLIENT_REJECTED_SCREENING: "client rejected - screening", + CLIENT_REJECTED_INTERVIEW: "client rejected - interview", + REJECTED_OTHER: "rejected - other", INTERVIEW: "interview", TOPCODER_REJECTED: "topcoder-rejected", }; @@ -126,13 +128,18 @@ export const CANDIDATE_STATUS_FILTERS = [ key: CANDIDATE_STATUS_FILTER_KEY.INTERESTED, buttonText: "Interviews", title: "Interviews", - statuses: [CANDIDATE_STATUS.SHORTLIST, CANDIDATE_STATUS.INTERVIEW], + statuses: [CANDIDATE_STATUS.SELECTED, CANDIDATE_STATUS.INTERVIEW], }, { key: CANDIDATE_STATUS_FILTER_KEY.NOT_INTERESTED, buttonText: "Declined", title: "Declined", - statuses: [CANDIDATE_STATUS.REJECTED, CANDIDATE_STATUS.TOPCODER_REJECTED], + statuses: [ + CANDIDATE_STATUS.CLIENT_REJECTED_SCREENING, + CANDIDATE_STATUS.CLIENT_REJECTED_INTERVIEW, + CANDIDATE_STATUS.REJECTED_OTHER, + CANDIDATE_STATUS.TOPCODER_REJECTED, + ], }, ]; @@ -297,7 +304,7 @@ export const JOB_STATUS_OPTIONS = [ * resource booking status options */ export const RESOURCE_BOOKING_STATUS_OPTIONS = [ - { value: "assigned", label: "assigned" }, + { value: "placed", label: "placed" }, { value: "closed", label: "closed" }, { value: "cancelled", label: "cancelled" }, ]; diff --git a/src/routes/PositionDetails/components/InterviewDetailsPopup/index.jsx b/src/routes/PositionDetails/components/InterviewDetailsPopup/index.jsx index 363bf95c..e7a6d363 100644 --- a/src/routes/PositionDetails/components/InterviewDetailsPopup/index.jsx +++ b/src/routes/PositionDetails/components/InterviewDetailsPopup/index.jsx @@ -4,11 +4,13 @@ * Popup that allows user to schedule an interview * Calls addInterview action */ -import React, { useCallback } from "react"; +import React, { useCallback, useEffect, useState } from "react"; +import { getAuthUserProfile } from "@topcoder/micro-frontends-navbar-app"; import { Form } from "react-final-form"; import arrayMutators from "final-form-arrays"; import { FieldArray } from "react-final-form-arrays"; -import { useDispatch } from "react-redux"; +import { toastr } from "react-redux-toastr"; +import { useDispatch, useSelector } from "react-redux"; import { addInterview } from "../../actions"; import User from "components/User"; import BaseModal from "components/BaseModal"; @@ -39,10 +41,20 @@ const validator = (values) => { }; /********************* */ - +// TODO: preserve form input in case of error function InterviewDetailsPopup({ open, onClose, candidate, openNext }) { + const [isLoading, setIsLoading] = useState(true); + const [myEmail, setMyEmail] = useState(""); + const { loading } = useSelector((state) => state.positionDetails); const dispatch = useDispatch(); + useEffect(() => { + getAuthUserProfile().then((res) => { + setMyEmail(res.email || ""); + setIsLoading(false); + }); + }, []); + const onSubmitCallback = useCallback( async (formData) => { const attendeesList = @@ -54,15 +66,21 @@ function InterviewDetailsPopup({ open, onClose, candidate, openNext }) { attendeesList, }; - await dispatch(addInterview(candidate.id, interviewData)); + try { + await dispatch(addInterview(candidate.id, interviewData)); + } catch (err) { + toastr.error("Interview Creation Failed", err.message); + throw err; + } }, [dispatch, candidate] ); - return ( + return isLoading ? null : (