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

Commit 33e75f6

Browse files
committed
fix: issue #138
1 parent 2c2cd29 commit 33e75f6

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

src/components/FormField/index.jsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ const FormField = ({ field }) => {
3737
<TextInput
3838
maxLength={field.maxLength}
3939
placeholder={field.placeholder}
40+
disabled={field.disabled}
4041
value={input.value ?? ""}
4142
type="text"
4243
className={meta.error && meta.touched ? "error" : ""}
@@ -52,6 +53,7 @@ const FormField = ({ field }) => {
5253
value={input?.value ?? ""}
5354
isRequired={field.isRequired}
5455
type="number"
56+
disabled={field.disabled}
5557
minValue={field.minValue}
5658
onChange={input.onChange}
5759
onBlur={input.onBlur}
@@ -86,6 +88,7 @@ const FormField = ({ field }) => {
8688
placeholder={field.placeholder}
8789
value={input?.value ?? ""}
8890
onChange={input.onChange}
91+
disabled={field.disabled}
8992
onBlur={input.onBlur}
9093
onFocus={input.onFocus}
9194
className={meta.error && meta.touched ? "error" : ""}

src/routes/JobForm/index.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ const JobForm = ({ teamId, jobId }) => {
108108
configuration={getEditJobConfig(
109109
options,
110110
job.isApplicationPageActive,
111+
isEdit ? job.status === 'assigned' || job.status === 'closed' || job.status === 'cancelled' : false,
111112
onSubmit
112113
)}
113114
initialValue={job}

src/routes/JobForm/utils.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,13 @@ const EDIT_JOB_ROWS = [
2828
* return edit job configuration
2929
* @param {any} skillOptions skill options
3030
* @param {boolean} isMarkdownEditorDisabled is markedownEditor disabled
31+
* @param {onlyEnableStatus} only can select status field
3132
* @param {func} onSubmit submit callback
3233
*/
3334
export const getEditJobConfig = (
3435
skillOptions,
3536
isMarkdownEditorDisabled,
37+
onlyEnableStatus,
3638
onSubmit
3739
) => {
3840
return {
@@ -44,13 +46,14 @@ export const getEditJobConfig = (
4446
validationMessage: "Please, enter Job Name",
4547
name: "title",
4648
maxLength: 128,
49+
disabled: onlyEnableStatus,
4750
placeholder: "Job Name",
4851
},
4952
{
5053
label: "Job Description",
5154
type: FORM_FIELD_TYPE.MARKDOWNEDITOR,
5255
name: "description",
53-
disabled: isMarkdownEditorDisabled,
56+
disabled: isMarkdownEditorDisabled || onlyEnableStatus,
5457
placeholder: "Job Description",
5558
},
5659
{
@@ -61,19 +64,22 @@ export const getEditJobConfig = (
6164
name: "numPositions",
6265
minValue: 1,
6366
placeholder: "Number Of Opening",
67+
disabled: onlyEnableStatus,
6468
step: 1,
6569
},
6670
{
6771
label: "Job Skills",
6872
type: FORM_FIELD_TYPE.SELECT,
6973
isMulti: true,
7074
name: "skills",
75+
disabled: onlyEnableStatus,
7176
selectOptions: skillOptions,
7277
},
7378
{
7479
label: "Start Date",
7580
type: FORM_FIELD_TYPE.DATE,
7681
name: "startDate",
82+
disabled: onlyEnableStatus,
7783
placeholder: "Start Date",
7884
},
7985
{
@@ -82,24 +88,28 @@ export const getEditJobConfig = (
8288
name: "duration",
8389
minValue: 1,
8490
placeholder: "Duration",
91+
disabled: onlyEnableStatus,
8592
step: 1,
8693
},
8794
{
8895
label: "Resource Type",
8996
type: FORM_FIELD_TYPE.SELECT,
9097
name: "resourceType",
98+
disabled: onlyEnableStatus,
9199
selectOptions: RESOURCE_TYPE_OPTIONS,
92100
},
93101
{
94102
label: "Resource Rate Frequency",
95103
type: FORM_FIELD_TYPE.SELECT,
96104
name: "rateType",
105+
disabled: onlyEnableStatus,
97106
selectOptions: RATE_TYPE_OPTIONS,
98107
},
99108
{
100109
label: "Workload",
101110
type: FORM_FIELD_TYPE.SELECT,
102111
name: "workload",
112+
disabled: onlyEnableStatus,
103113
selectOptions: WORKLOAD_OPTIONS,
104114
},
105115
{

0 commit comments

Comments
 (0)