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

Commit 0e780ae

Browse files
committed
fix: issue #138
1 parent e6530ec commit 0e780ae

File tree

5 files changed

+20
-1
lines changed

5 files changed

+20
-1
lines changed

src/components/DateInput/index.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const DateInput = (props) => {
1616
dateFormat="MM/dd/yyyy"
1717
placeholderText={props.placeholder}
1818
selected={props.value}
19+
disabled={props.disabled}
1920
onChange={props.onChange}
2021
onBlur={props.onBlur}
2122
onCalendarClose={props.onBlur}
@@ -28,6 +29,7 @@ const DateInput = (props) => {
2829
DateInput.propTypes = {
2930
value: PT.string,
3031
onChange: PT.func.isRequired,
32+
disabled: PT.bool,
3133
placeholder: PT.string,
3234
onBlur: PT.func,
3335
onFocus: PT.func,

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/components/TextInput/index.jsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ function TextInput(props) {
1414
styleName={cn("TextInput", props.className, { readonly: props.readonly })}
1515
maxLength={props.maxLength}
1616
min={props.minValue}
17+
disabled={props.disabled}
1718
onChange={(event) => {
1819
if (props.type === "number") {
1920
if (event.target.value >= props.minValue) {
@@ -47,6 +48,7 @@ TextInput.defaultProps = {
4748
maxLength: Number.MAX_VALUE,
4849
placeholder: "",
4950
minValue: 0,
51+
disabled: false,
5052
step: null,
5153
};
5254

@@ -58,6 +60,7 @@ TextInput.propTypes = {
5860
onFocus: PT.func,
5961
placeholder: PT.string,
6062
value: PT.string.isRequired,
63+
disabled: PT.bool,
6164
type: PT.string.isRequired,
6265
readonly: PT.bool,
6366
minValue: PT.number,

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)