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

Commit e7aa3dc

Browse files
committed
fix: issue #138
1 parent c94b38d commit e7aa3dc

File tree

6 files changed

+43
-23
lines changed

6 files changed

+43
-23
lines changed

src/components/FormField/index.jsx

+1
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ const FormField = ({ field }) => {
6666
<MarkdownEditor
6767
placeholder={field.placeholder}
6868
value={input?.value ?? ""}
69+
errorMessage={field.errorMessage}
6970
disabled={field.disabled}
7071
onChange={input.onChange}
7172
onBlur={input.onBlur}

src/components/MarkdownEditor/index.jsx

+19-17
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import cn from "classnames";
88
import TuiEditor from "../TuiEditor";
99
import MarkdownEditorViewer from "../MarkdownEditorViewer";
1010
import styles from "./styles.module.scss";
11-
import { DISABLED_DESCRIPTION_MESSAGE } from "constants";
1211

1312
const MarkdownEditor = (props) => {
1413
const editorElement = useRef(null);
@@ -21,7 +20,9 @@ const MarkdownEditor = (props) => {
2120
return (
2221
<div styleName="editor-viewer">
2322
<MarkdownEditorViewer {...props} />
24-
<div styleName="message">{DISABLED_DESCRIPTION_MESSAGE}</div>
23+
{props.errorMessage && (
24+
<div styleName="message">{props.errorMessage}</div>
25+
)}
2526
</div>
2627
);
2728
}
@@ -34,21 +35,21 @@ const MarkdownEditor = (props) => {
3435
onChange={onChange}
3536
initialValue={props.value}
3637
toolbarItems={[
37-
'heading',
38-
'bold',
39-
'italic',
40-
'strike',
41-
'code',
42-
'divider',
43-
'quote',
44-
'codeblock',
45-
'hr',
46-
'divider',
47-
'ul',
48-
'ol',
49-
'divider',
50-
'image',
51-
'link',
38+
"heading",
39+
"bold",
40+
"italic",
41+
"strike",
42+
"code",
43+
"divider",
44+
"quote",
45+
"codeblock",
46+
"hr",
47+
"divider",
48+
"ul",
49+
"ol",
50+
"divider",
51+
"image",
52+
"link",
5253
]}
5354
plugins={[]}
5455
/>
@@ -59,6 +60,7 @@ const MarkdownEditor = (props) => {
5960
MarkdownEditor.propTypes = {
6061
value: PropTypes.string,
6162
disabled: PropTypes.bool,
63+
errorMessage: PropTypes.string,
6264
className: PropTypes.string,
6365
onChange: PropTypes.func,
6466
onFocus: PropTypes.func,

src/components/MarkdownEditor/styles.module.scss

+6-1
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,18 @@
22

33
.editor-viewer {
44
> div:first-child {
5-
border: 1px solid #aaaaab;
5+
// border: 1px solid #aaaaab;
66
border-radius: 4px;
77
overflow: hidden;
88
box-sizing: border-box;
99
padding: 16px 25px 0px 25px;
1010
height: 280px;
1111
overflow-y: auto;
12+
border: 0;
13+
background: #fafafb;
14+
box-shadow: none;
15+
color: #6b6b6b;
16+
-webkit-text-fill-color: #808080;
1217
}
1318
.message {
1419
@include font-roboto;

src/components/ReactSelect/index.jsx

+10-4
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,15 @@ const ReactSelect = (props) => {
1414
control: (provided, state) => ({
1515
...provided,
1616
minHeight: "40px",
17-
border: "1px solid #aaaaab",
17+
border: state.isDisabled ? "none" : "1px solid #aaaaab",
1818
borderColor: state.isFocused ? "#55a5ff" : "#aaaaab",
19-
boxShadow: state.isFocused ? "0 0 2px 1px #cee6ff" : provided.boxShadow,
19+
boxShadow: state.isDisabled
20+
? "none"
21+
: state.isFocused
22+
? "0 0 2px 1px #cee6ff"
23+
: provided.boxShadow,
24+
backgroundColor: state.isDisabled ? "#fafafb" : provided.backgroundColor,
25+
color: state.isDisabled ? "#6b6b6b" : provided.color,
2026
}),
2127
menu: (provided) => ({
2228
...provided,
@@ -53,10 +59,10 @@ const ReactSelect = (props) => {
5359
textAlign: "left",
5460
fontWeight: "400",
5561
}),
56-
multiValue: (provided) => ({
62+
multiValue: (provided, state) => ({
5763
...provided,
5864
margin: "3px 3px",
59-
color: "#AAAAAA",
65+
color: state.isDisabled ? "#808080" : "#AAAAAA",
6066
fontFamily: "Roboto",
6167
fontSize: "14px",
6268
lineHeight: "22px",

src/routes/JobForm/index.jsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,11 @@ const JobForm = ({ teamId, jobId }) => {
108108
configuration={getEditJobConfig(
109109
options,
110110
job.isApplicationPageActive,
111-
isEdit ? job.status === 'assigned' || job.status === 'closed' || job.status === 'cancelled' : false,
111+
isEdit
112+
? job.status === "assigned" ||
113+
job.status === "closed" ||
114+
job.status === "cancelled"
115+
: false,
112116
onSubmit
113117
)}
114118
initialValue={job}

src/routes/JobForm/utils.js

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
*/
44
import { PERMISSIONS } from "constants/permissions";
55
import { hasPermission } from "utils/permissions";
6+
import { DISABLED_DESCRIPTION_MESSAGE } from "constants";
67
import {
78
RATE_TYPE_OPTIONS,
89
STATUS_OPTIONS,
@@ -54,6 +55,7 @@ export const getEditJobConfig = (
5455
type: FORM_FIELD_TYPE.MARKDOWNEDITOR,
5556
name: "description",
5657
disabled: isMarkdownEditorDisabled || onlyEnableStatus,
58+
errorMessage: isMarkdownEditorDisabled && DISABLED_DESCRIPTION_MESSAGE,
5759
placeholder: "Job Description",
5860
},
5961
{

0 commit comments

Comments
 (0)