Skip to content

Commit 491038e

Browse files
committed
Add job title to job description search page. Fixes for deleting searched roles.
1 parent 5f8794b commit 491038e

File tree

4 files changed

+21
-7
lines changed

4 files changed

+21
-7
lines changed

src/routes/CreateNewTeam/components/SubmitContainer/index.jsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,20 +46,16 @@ function SubmitContainer({
4646

4747
useEffect(() => {
4848
setCurrentStage(2, stages, setStages);
49-
if (!addedRoles || addedRoles.length === 0) {
50-
navigate("/taas/myteams/createnewteam");
51-
}
5249
// eslint-disable-next-line react-hooks/exhaustive-deps
5350
}, []);
5451

5552
// redirects user if they enter the page URL directly
56-
// without adding any roles.
53+
// without adding any roles or delete all roles.
5754
useLayoutEffect(() => {
5855
if (!addedRoles || addedRoles.length === 0) {
5956
navigate("/taas/myteams/createnewteam");
6057
}
61-
// eslint-disable-next-line react-hooks/exhaustive-deps
62-
}, []);
58+
}, [addedRoles]);
6359

6460
const openTeamDetails = () => {
6561
setAddAnotherOpen(false);

src/routes/CreateNewTeam/components/TeamDetailsModal/index.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,10 @@ function TeamDetailsModal({ open, onClose, submitForm, addedRoles }) {
240240
<td>
241241
<button
242242
styleName="delete-role"
243-
onClick={() => dispatch(deleteSearchedRole(id))}
243+
onClick={() => {
244+
clearField(id);
245+
dispatch(deleteSearchedRole(id));
246+
}}
244247
>
245248
<IconCrossLight height="12px" width="12px" />
246249
</button>

src/routes/CreateNewTeam/pages/InputJobDescription/index.jsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import PageHeader from "components/PageHeader";
99
import MarkdownEditor from "../../../../components/MarkdownEditor";
1010
import "./styles.module.scss";
1111
import SearchAndSubmit from "../../components/SearchAndSubmit";
12+
import TextInput from "components/TextInput";
1213

1314
function InputJobDescription() {
1415
const [stages, setStages] = useState([
@@ -17,6 +18,7 @@ function InputJobDescription() {
1718
{ name: "Overview of the Results" },
1819
]);
1920
const [jdString, setJdString] = useState("");
21+
const [jobTitle, setJobTitle] = useState("");
2022

2123
const onEditChange = useCallback((value) => {
2224
setJdString(value);
@@ -36,6 +38,15 @@ function InputJobDescription() {
3638
title="Input Job Description"
3739
backTo="/taas/myteams/createnewteam"
3840
/>
41+
<div styleName="job-title">
42+
<TextInput
43+
placeholder="Job title"
44+
value={jobTitle}
45+
onChange={setJobTitle}
46+
maxLength={100}
47+
type="text"
48+
/>
49+
</div>
3950
<MarkdownEditor
4051
height="482px"
4152
placeholder="input job description"

src/routes/CreateNewTeam/pages/InputJobDescription/styles.module.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,7 @@
77
padding: 0 30px 30px;
88
flex: 1;
99
}
10+
11+
.job-title {
12+
margin-bottom: 15px;
13+
}

0 commit comments

Comments
 (0)