feat: add description field to DetailUnit component and ListUnit table
This commit is contained in:
@@ -13,6 +13,7 @@ const DetailUnit = (props) => {
|
|||||||
unit_id: '',
|
unit_id: '',
|
||||||
unit_code: '',
|
unit_code: '',
|
||||||
unit_name: '',
|
unit_name: '',
|
||||||
|
description: '',
|
||||||
is_active: true,
|
is_active: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -27,9 +28,7 @@ const DetailUnit = (props) => {
|
|||||||
setConfirmLoading(true);
|
setConfirmLoading(true);
|
||||||
|
|
||||||
// Daftar aturan validasi
|
// Daftar aturan validasi
|
||||||
const validationRules = [
|
const validationRules = [{ field: 'unit_name', label: 'Unit Name', required: true }];
|
||||||
{ field: 'unit_name', label: 'Unit Name', required: true },
|
|
||||||
];
|
|
||||||
|
|
||||||
if (
|
if (
|
||||||
validateRun(formData, validationRules, (errorMessages) => {
|
validateRun(formData, validationRules, (errorMessages) => {
|
||||||
@@ -47,6 +46,7 @@ const DetailUnit = (props) => {
|
|||||||
const payload = {
|
const payload = {
|
||||||
is_active: formData.is_active,
|
is_active: formData.is_active,
|
||||||
unit_name: formData.unit_name,
|
unit_name: formData.unit_name,
|
||||||
|
description: formData.description,
|
||||||
};
|
};
|
||||||
|
|
||||||
const response =
|
const response =
|
||||||
@@ -202,6 +202,18 @@ const DetailUnit = (props) => {
|
|||||||
readOnly={props.readOnly}
|
readOnly={props.readOnly}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div style={{ marginBottom: 12 }}>
|
||||||
|
<Text strong>Description</Text>
|
||||||
|
<Input.TextArea
|
||||||
|
name="description"
|
||||||
|
value={formData.description}
|
||||||
|
onChange={handleInputChange}
|
||||||
|
placeholder="Enter Description"
|
||||||
|
readOnly={props.readOnly}
|
||||||
|
rows={4}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|||||||
@@ -32,6 +32,13 @@ const columns = (showPreviewModal, showEditModal, showDeleteDialog) => [
|
|||||||
key: 'unit_name',
|
key: 'unit_name',
|
||||||
width: '20%',
|
width: '20%',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: 'Description',
|
||||||
|
dataIndex: 'description',
|
||||||
|
key: 'description',
|
||||||
|
width: '25%',
|
||||||
|
render: (text) => text || '-',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: 'Status',
|
title: 'Status',
|
||||||
dataIndex: 'is_active',
|
dataIndex: 'is_active',
|
||||||
|
|||||||
Reference in New Issue
Block a user