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

Roles finalfix #346

Merged
merged 9 commits into from
Jun 23, 2021
3 changes: 2 additions & 1 deletion src/components/MonthPicker/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function getCurrMonthYear() {
return new Date(`${year}-${month + 1}`);
}

function MonthPicker({ name, value, onChange, onBlur }) {
function MonthPicker({ name, value, onChange, onBlur, onFocus }) {
return (
<div styleName="month-picker">
<DatePicker
Expand All @@ -26,6 +26,7 @@ function MonthPicker({ name, value, onChange, onBlur }) {
showMonthYearPicker
showPopperArrow={false}
onBlur={onBlur}
onFocus={onFocus}
popperPlacement="top-end"
showFourColumnMonthYearPicker
minDate={getCurrMonthYear()}
Expand Down
56 changes: 56 additions & 0 deletions src/components/NumberInput/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/**
* Number Input
* A custom number input to be used in forms
* Removed default buttons and adds custom buttons
*/
import React from "react";
import PT from "prop-types";
import cn from "classnames";
import "./styles.module.scss";

function NumberInput({ name, value, onChange, onBlur, onFocus, min, error }) {
const incrementVal = (step) => {
const newVal = +value + step;
if (typeof newVal === "number" && !isNaN(newVal)) {
onChange(newVal);
}
};
const decrementVal = (step) => {
const newVal = value - step;
if (newVal >= min) {
onChange(value - step);
}
};

return (
<div styleName="container">
<button styleName="left-button" onClick={() => decrementVal(1)}>
</button>
<input
styleName={cn("input", { error: error })}
type="number"
name={name}
value={value}
onChange={onChange}
onBlur={onBlur}
onFocus={onFocus}
/>
<button styleName="right-button" onClick={() => incrementVal(1)}>
+
</button>
</div>
);
}

NumberInput.propTypes = {
name: PT.string,
value: PT.string,
onChange: PT.func,
onFocus: PT.func,
onBlur: PT.func,
min: PT.string,
error: PT.bool,
};

export default NumberInput;
43 changes: 43 additions & 0 deletions src/components/NumberInput/styles.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
@import "styles/include";

// remove default buttons and style input as text input
.input {
appearance: textfield;
text-align: center;

&.error {
border-color: #fe665d;
}
}
.input::-webkit-inner-spin-button,
.input::-webkit-outer-spin-button {
appearance: none;
margin: 0;
}

.container {
position: relative;
width: fit-content;
}

.left-button,
.right-button {
@include font-roboto;
font-size: 22px;
color: #137D60;
outline: none;
border: none;
background: none;
position: absolute;
top: 0;
height: 100%;
padding: 0 11px;
}

.left-button {
left: 0;
}

.right-button {
right: 0;
}
2 changes: 1 addition & 1 deletion src/constants/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ export const ACTION_TYPE = {
CLEAR_SEARCHED_ROLES: "CLEAR_SEARCHED_ROLES",
ADD_SEARCHED_ROLE: "ADD_SEARCHED_ROLE",
ADD_ROLE_SEARCH_ID: "ADD_ROLE_SEARCH_ID",
REPLACE_SEARCHED_ROLES: "REPLACE_SEARCHED_ROLES",
DELETE_SEARCHED_ROLE: "DELETE_SEARCHED_ROLE",
};

/**
Expand Down
8 changes: 4 additions & 4 deletions src/root.component.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default function Root() {
<Router>
<Redirect from="/taas" to="/taas/myteams" exact />
<MyTeamsList path="/taas/myteams" />
<CreateNewTeam path="/taas/myteams/createnewteam" />
<CreateNewTeam path="/taas/createnewteam" />
<MyTeamsDetails path="/taas/myteams/:teamId" />
<JobDetails path="/taas/myteams/:teamId/positions/:jobId" />
<JobForm path="/taas/myteams/:teamId/positions/:jobId/edit" />
Expand All @@ -34,9 +34,9 @@ export default function Root() {
<ResourceBookingForm path="/taas/myteams/:teamId/rb/:resourceBookingId/edit" />
<PositionDetails path="/taas/myteams/:teamId/positions/:positionId/candidates" />
<TeamAccess path="/taas/myteams/:teamId/access" />
<InputJobDescription path="/taas/myteams/createnewteam/jd/*" />
<InputSkills path="/taas/myteams/createnewteam/skills/*" />
<SelectRole path="/taas/myteams/createnewteam/role/*" />
<InputJobDescription path="/taas/createnewteam/jd/*" />
<InputSkills path="/taas/createnewteam/skills/*" />
<SelectRole path="/taas/createnewteam/role/*" />
</Router>

{/* Global config for Toastr popups */}
Expand Down
11 changes: 8 additions & 3 deletions src/routes/CreateNewTeam/actions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ const addPreviousSearchId = (id) => ({
payload: id,
});

export const replaceSearchedRoles = (roles) => ({
type: ACTION_TYPE.REPLACE_SEARCHED_ROLES,
payload: { roles, lastRoleId: roles[roles.length - 1].searchId },
const deleteRole = (id) => ({
type: ACTION_TYPE.DELETE_SEARCHED_ROLE,
payload: id,
});

export const clearSearchedRoles = () => (dispatch, getState) => {
Expand All @@ -41,3 +41,8 @@ export const addRoleSearchId = (id) => (dispatch, getState) => {
dispatch(addPreviousSearchId(id));
updateLocalStorage(getState().searchedRoles);
};

export const deleteSearchedRole = (id) => (dispatch, getState) => {
dispatch(deleteRole(id));
updateLocalStorage(getState().searchedRoles);
};
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ function AddedRolesAccordion({ addedRoles }) {
<div styleName="heading">
<h4 styleName="title">
{addedRoles.length}{" "}
{addedRoles.length > 1 ? "roles have" : "role has"} been added.
{addedRoles.length > 1 ? "positions have" : "position has"} been
added.
</h4>
</div>
<div styleName={cn("arrow", { [isOpen ? "up" : "down"]: true })}></div>
Expand Down
2 changes: 1 addition & 1 deletion src/routes/CreateNewTeam/components/ItemList/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function ItemList({
<div styleName="item-list">
<PageHeader
title={title}
backTo="/taas/myteams/createnewteam"
backTo="/taas/createnewteam"
aside={
<>
<Input
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
margin-right: 20px;
position: relative;
height: 80vh;
overflow-y: scroll;
overflow-y: auto;

> header {
padding: 16px 24px;
Expand All @@ -33,9 +33,9 @@ input:not([type="checkbox"]).filter-input {
color: #2a2a2a;
font-size: 14px;
height: 40px;
line-height: 38px;
line-height: normal;
outline: none;
padding: 0 15px;
padding: 8px 15px;

&:not(:focus) {
background-image: url("../../../../assets/images/icon-search.svg");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function NoMatchingProfilesResultCard({ role }) {
<p>/Week</p>
</div>
)}
<Link to="/taas/myteams/createnewteam">
<Link to="/taas/createnewteam">
<Button type="secondary" styleName="button">
Modify Search Criteria
</Button>
Expand Down
11 changes: 9 additions & 2 deletions src/routes/CreateNewTeam/components/ResultCard/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ function ResultCard({ role }) {
isExternalMember,
skillsMatch,
rates: [rates],
jobTitle,
name,
timeToCandidate,
timeToInterview,
} = role;
const [userHandle, setUserHandle] = useState(null);
const [showRates, setShowRates] = useState(false);
Expand All @@ -54,6 +58,9 @@ function ResultCard({ role }) {
<Curve styleName="curve" />
<IconEarthCheck styleName="transparent-icon" />
</div>
<h4 styleName="job-title">
{jobTitle && jobTitle.length ? jobTitle : name}
</h4>
<div styleName="button-group">
<Button
type={!showRates ? "segment-selected" : "segment"}
Expand Down Expand Up @@ -202,14 +209,14 @@ function ResultCard({ role }) {
<IconMultipleActionsCheck />
<div>
<p>Qualified candidates within</p>
<h6>24h</h6>
<h6>{timeToCandidate}h</h6>
</div>
</div>
<div styleName="timeline-info">
<IconTeamMeetingChat />
<div>
<p>Interviews can start within</p>
<h6>48h</h6>
<h6>{timeToInterview}h</h6>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
justify-content: flex-start;
align-items: center;
padding: 30px 0 60px 0;
margin-bottom: 30px;
margin-bottom: 14px;
color: #fff;
background-image: linear-gradient(225deg, #0ab88a 0%, #137d60 100%);
position: relative;
Expand All @@ -40,6 +40,18 @@
}
}

.job-title {
@include font-barlow;
font-size: 22px;
margin-bottom: 18px;
font-weight: 600;
text-align: center;
text-transform: uppercase;
// position text over bottom of header image
position: relative;
z-index: 100;
}

.button-group {
display: flex;
flex-direction: row;
Expand Down
28 changes: 15 additions & 13 deletions src/routes/CreateNewTeam/components/RoleDetailsModal/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,19 +90,21 @@ function RoleDetailsModal({ roleId, open, onClose }) {
Skills
</Button>
</div>
{showSkills ? (
<ul styleName="body skill-list">
{skills.map((skill, i) => (
<li styleName="skill-item" key={i}>
{skill}
</li>
))}
</ul>
) : (
<div styleName="markdown-container">
<MarkdownViewer value={role?.description} />
</div>
)}
<div styleName="content">
{showSkills ? (
<ul styleName="body skill-list">
{skills.map((skill, i) => (
<li styleName="skill-item" key={i}>
{skill}
</li>
))}
</ul>
) : (
<div styleName="markdown-container">
<MarkdownViewer value={role?.description} />
</div>
)}
</div>
</div>
</BaseCreateModal>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,8 @@
margin-bottom: 10px;
font-size: 12px;
}

.content {
height: 180px;
overflow-y: auto;
}
Loading