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

Commit d8604e6

Browse files
committed
fix: wrong labels in job create form
- made create job form same to edit ref issue #84
1 parent f6b734f commit d8604e6

File tree

3 files changed

+4
-105
lines changed

3 files changed

+4
-105
lines changed

src/routes/JobForm/index.jsx

+1-5
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,7 @@ const JobForm = ({ teamId, jobId }) => {
104104
/>
105105
<div styleName="job-modification-details">
106106
<TCForm
107-
configuration={
108-
isEdit
109-
? getEditJobConfig(options, onSubmit)
110-
: getCreateJobConfig(options, onSubmit)
111-
}
107+
configuration={getEditJobConfig(options, onSubmit)}
112108
initialValue={job}
113109
submitButton={{ text: isEdit ? "Save" : "Create" }}
114110
backButton={{

src/routes/JobForm/utils.js

+1-98
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,6 @@ import {
99
FORM_FIELD_TYPE,
1010
} from "../../constants";
1111

12-
const CREATE_JOB_ROWS = [
13-
{ type: FORM_ROW_TYPE.SINGLE, fields: ["title"] },
14-
{ type: FORM_ROW_TYPE.SINGLE, fields: ["description"] },
15-
{ type: FORM_ROW_TYPE.SINGLE, fields: ["numPositions"] },
16-
{ type: FORM_ROW_TYPE.SINGLE, fields: ["skills"] },
17-
{ type: FORM_ROW_TYPE.GROUP, fields: ["startDate", "duration"] },
18-
{ type: FORM_ROW_TYPE.SINGLE, fields: ["resourceType"] },
19-
{ type: FORM_ROW_TYPE.SINGLE, fields: ["rateType"] },
20-
{ type: FORM_ROW_TYPE.SINGLE, fields: ["workload"] },
21-
{ type: FORM_ROW_TYPE.SINGLE, fields: ["status"] },
22-
];
23-
2412
const EDIT_JOB_ROWS = [
2513
{ type: FORM_ROW_TYPE.SINGLE, fields: ["title"] },
2614
{ type: FORM_ROW_TYPE.SINGLE, fields: ["description"] },
@@ -117,89 +105,4 @@ export const getEditJobConfig = (skillOptions, onSubmit) => {
117105
onSubmit: onSubmit,
118106
rows: EDIT_JOB_ROWS,
119107
};
120-
};
121-
122-
/**
123-
* return create job configuration
124-
* @param {any} skillOptions skill options
125-
* @param {func} onSubmit submit callback
126-
*/
127-
export const getCreateJobConfig = (skillOptions, onSubmit) => {
128-
return {
129-
fields: [
130-
{
131-
label: "Job Name",
132-
type: FORM_FIELD_TYPE.TEXT,
133-
isRequired: true,
134-
validationMessage: "Please, enter Job Name",
135-
name: "title",
136-
maxLength: 128,
137-
placeholder: "Job Name",
138-
},
139-
{
140-
label: "Job Description",
141-
type: FORM_FIELD_TYPE.TEXTAREA,
142-
name: "description",
143-
placeholder: "Job Description",
144-
},
145-
{
146-
label: "Number Of Opening",
147-
type: FORM_FIELD_TYPE.NUMBER,
148-
isRequired: true,
149-
validationMessage: "Please, enter Job Name",
150-
name: "numPositions",
151-
minValue: 1,
152-
placeholder: "Number Of Opening",
153-
},
154-
{
155-
label: "Job Skills",
156-
type: FORM_FIELD_TYPE.SELECT,
157-
isMulti: true,
158-
name: "skills",
159-
selectOptions: skillOptions,
160-
},
161-
{
162-
label: "Start Date",
163-
type: FORM_FIELD_TYPE.DATE,
164-
name: "startDate",
165-
placeholder: "Start Date",
166-
},
167-
{
168-
label: "Duration",
169-
type: FORM_FIELD_TYPE.NUMBER,
170-
name: "duration",
171-
minValue: 1,
172-
placeholder: "Duration",
173-
},
174-
{
175-
label: "Resource Type",
176-
type: FORM_FIELD_TYPE.TEXT,
177-
name: "resourceType",
178-
maxLength: 255,
179-
placeholder: "Resource Type",
180-
},
181-
{
182-
label: "Rate Type",
183-
type: FORM_FIELD_TYPE.SELECT,
184-
name: "rateType",
185-
selectOptions: RATE_TYPE_OPTIONS,
186-
},
187-
{
188-
label: "Workload",
189-
type: FORM_FIELD_TYPE.SELECT,
190-
name: "workload",
191-
selectOptions: WORKLOAD_OPTIONS,
192-
},
193-
{
194-
label: "Status",
195-
type: FORM_FIELD_TYPE.SELECT,
196-
isRequired: true,
197-
validationMessage: "Please, select Status",
198-
name: "status",
199-
selectOptions: STATUS_OPTIONS,
200-
},
201-
],
202-
onSubmit: onSubmit,
203-
rows: CREATE_JOB_ROWS,
204-
};
205-
};
108+
};

src/routes/ResourceBookingForm/utils.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
FORM_FIELD_TYPE,
1212
} from "../../constants";
1313

14-
const EDIT_ResourceBooking_ROWS = [
14+
const EDIT_RESOURCEBOOKING_ROWS = [
1515
{ type: FORM_ROW_TYPE.SINGLE, fields: ["handle"] },
1616
{ type: FORM_ROW_TYPE.SINGLE, fields: ["jobTitle"] },
1717
{ type: FORM_ROW_TYPE.GROUP, fields: ["startDate", "endDate"] },
@@ -96,6 +96,6 @@ export const getEditResourceBookingConfig = (onSubmit) => {
9696
},
9797
],
9898
onSubmit: onSubmit,
99-
rows: EDIT_ResourceBooking_ROWS,
99+
rows: EDIT_RESOURCE_BOOKING_ROWS,
100100
};
101101
};

0 commit comments

Comments
 (0)