IO-2327 timetickets validation
This commit is contained in:
@@ -244,7 +244,9 @@ export function JobsDetailHeaderActions({
|
||||
});
|
||||
}}
|
||||
>
|
||||
{t("timetickets.actions.enter")}
|
||||
<span data-cy="actions-timetickets">
|
||||
{t("timetickets.actions.enter")}
|
||||
</span>
|
||||
</Menu.Item>
|
||||
<Menu.Item
|
||||
key="enterpayments"
|
||||
|
||||
@@ -206,6 +206,7 @@ export function LaborAllocationsTable({
|
||||
<Col span={24}>
|
||||
<Card title={t("jobs.labels.laborallocations")}>
|
||||
<Table
|
||||
data-cy="labor-allocations-table"
|
||||
columns={columns}
|
||||
rowKey={(record) => `${record.cost_center} ${record.mod_lbr_ty}`}
|
||||
pagination={false}
|
||||
|
||||
@@ -113,7 +113,7 @@ export function TimeTicketModalComponent({
|
||||
},
|
||||
]}
|
||||
>
|
||||
<FormDatePicker />
|
||||
<FormDatePicker data-cy="form-timeticket-date" />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
name="employeeid"
|
||||
@@ -135,6 +135,8 @@ export function TimeTicketModalComponent({
|
||||
|
||||
form.setFieldsValue({ flat_rate: emps && emps.flat_rate });
|
||||
}}
|
||||
data-cy="form-timeticket-employee"
|
||||
className="ant-select-timeticket-employee"
|
||||
/>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
@@ -158,7 +160,11 @@ export function TimeTicketModalComponent({
|
||||
},
|
||||
]}
|
||||
>
|
||||
<CostCenterSelect emps={emps} />
|
||||
<CostCenterSelect
|
||||
emps={emps}
|
||||
data-cy="form-timeticket-cost-center"
|
||||
className="ant-select-cost-center"
|
||||
/>
|
||||
</Form.Item>
|
||||
);
|
||||
}}
|
||||
@@ -235,7 +241,10 @@ export function TimeTicketModalComponent({
|
||||
},
|
||||
]}
|
||||
>
|
||||
<InputNumber precision={1} />
|
||||
<InputNumber
|
||||
data-cy="form-timeticket-productivehrs"
|
||||
precision={1}
|
||||
/>
|
||||
</Form.Item>
|
||||
)}
|
||||
</Form.Item>
|
||||
@@ -262,7 +271,11 @@ export function TimeTicketModalComponent({
|
||||
}),
|
||||
]}
|
||||
>
|
||||
<InputNumber min={0} precision={1} />
|
||||
<InputNumber
|
||||
data-cy="form-timeticket-actualhrs"
|
||||
min={0}
|
||||
precision={1}
|
||||
/>
|
||||
</Form.Item>
|
||||
{
|
||||
<>
|
||||
@@ -320,7 +333,7 @@ export function TimeTicketModalComponent({
|
||||
}
|
||||
|
||||
<Form.Item label={t("timetickets.fields.memo")} name="memo">
|
||||
<MemoInput />
|
||||
<MemoInput data-cy="form-timeticket-memo" />
|
||||
</Form.Item>
|
||||
<Form.Item shouldUpdate>
|
||||
{() => (
|
||||
|
||||
@@ -174,7 +174,11 @@ export function TimeTicketModalContainer({
|
||||
footer={
|
||||
<span>
|
||||
<Button onClick={handleCancel}>{t("general.actions.cancel")}</Button>
|
||||
<Button loading={loading} onClick={() => form.submit()}>
|
||||
<Button
|
||||
loading={loading}
|
||||
onClick={() => form.submit()}
|
||||
data-cy="timeticket-save-button"
|
||||
>
|
||||
{t("general.actions.save")}
|
||||
</Button>
|
||||
{timeTicketModal.context && timeTicketModal.context.id ? null : (
|
||||
@@ -196,6 +200,7 @@ export function TimeTicketModalContainer({
|
||||
onFinish={handleFinish}
|
||||
layout="vertical"
|
||||
autoComplete={"off"}
|
||||
data-cy="form-timeticket"
|
||||
form={form}
|
||||
onFinishFailed={() => setEnterAgain(false)}
|
||||
initialValues={
|
||||
@@ -221,7 +226,11 @@ export function TimeTicketModalContainer({
|
||||
<Button onClick={handleCancel}>
|
||||
{t("general.actions.cancel")}
|
||||
</Button>
|
||||
<Button loading={loading} onClick={() => form.submit()}>
|
||||
<Button
|
||||
loading={loading}
|
||||
data-cy="timeticket-save-button"
|
||||
onClick={() => form.submit()}
|
||||
>
|
||||
{t("general.actions.save")}
|
||||
</Button>
|
||||
{timeTicketModal.context && timeTicketModal.context.id ? null : (
|
||||
|
||||
Reference in New Issue
Block a user