From c7c5a336139490c278acd7a4dc700f82168b5400 Mon Sep 17 00:00:00 2001 From: Iqbal Rizqi Kurniawan Date: Fri, 17 Oct 2025 11:13:05 +0700 Subject: [PATCH] feat: remove section name handling from DetailPlantSection and ListPlantSection components --- .../component/DetailPlantSection.jsx | 28 ++----------------- .../component/ListPlantSection.jsx | 21 ++++---------- 2 files changed, 7 insertions(+), 42 deletions(-) diff --git a/src/pages/master/plantSection/component/DetailPlantSection.jsx b/src/pages/master/plantSection/component/DetailPlantSection.jsx index d0361f7..b3761de 100644 --- a/src/pages/master/plantSection/component/DetailPlantSection.jsx +++ b/src/pages/master/plantSection/component/DetailPlantSection.jsx @@ -10,7 +10,6 @@ const DetailPlantSection = (props) => { const defaultData = { plant_section_id: '', plantName: '', - sectionName: '', status: true, }; @@ -34,19 +33,8 @@ const DetailPlantSection = (props) => { return; } - if (!FormData.sectionName) { - NotifOk({ - icon: 'warning', - title: 'Peringatan', - message: 'Kolom Section Name Tidak Boleh Kosong', - }); - setConfirmLoading(false); - return; - } - const payload = { plantName: FormData.plantName, - sectionName: FormData.sectionName, status: FormData.status, }; @@ -57,7 +45,6 @@ const DetailPlantSection = (props) => { statusCode: FormData.plant_section_id ? 200 : 201, data: { plantName: FormData.plantName, - sectionName: FormData.sectionName, }, }; @@ -67,7 +54,7 @@ const DetailPlantSection = (props) => { title: 'Berhasil', message: `Data Plant Section "${ response.data?.plantName || FormData.plantName - } - ${response.data?.sectionName || FormData.sectionName}" berhasil ${FormData.plant_section_id ? 'diubah' : 'ditambahkan'}.`, + }" berhasil ${FormData.plant_section_id ? 'diubah' : 'ditambahkan'}.`, }); props.setActionMode('list'); @@ -120,7 +107,7 @@ const DetailPlantSection = (props) => { return ( { readOnly={props.readOnly} /> -
- Section Name - * - -
)}
diff --git a/src/pages/master/plantSection/component/ListPlantSection.jsx b/src/pages/master/plantSection/component/ListPlantSection.jsx index 33d34e1..dff4c08 100644 --- a/src/pages/master/plantSection/component/ListPlantSection.jsx +++ b/src/pages/master/plantSection/component/ListPlantSection.jsx @@ -16,25 +16,21 @@ const initialPlantSectionData = [ { plant_section_id: 1, plantName: 'Assembly', - sectionName: 'Line 1', status: 'Active', }, { plant_section_id: 2, plantName: 'Assembly', - sectionName: 'Line 2', status: 'Active', }, { plant_section_id: 3, plantName: 'Painting', - sectionName: 'Booth A', status: 'Active', }, { plant_section_id: 4, plantName: 'Warehouse', - sectionName: 'Receiving', status: 'Inactive', }, ]; @@ -51,13 +47,7 @@ const columns = (showPreviewModal, showEditModal, showDeleteDialog) => [ title: 'Plant Name', dataIndex: 'plantName', key: 'plantName', - width: '30%', - }, - { - title: 'Section Name', - dataIndex: 'sectionName', - key: 'sectionName', - width: '30%', + width: '60%', }, { title: 'Status', @@ -137,8 +127,7 @@ const ListPlantSection = memo(function ListPlantSection(props) { const searchLower = searchParam.toLowerCase(); filteredPlantSections = plantSectionData.filter( (plant) => - plant.plantName.toLowerCase().includes(searchLower) || - plant.sectionName.toLowerCase().includes(searchLower) + plant.plantName.toLowerCase().includes(searchLower) ); } @@ -210,7 +199,7 @@ const ListPlantSection = memo(function ListPlantSection(props) { NotifConfirmDialog({ icon: 'question', title: 'Konfirmasi', - message: 'Apakah anda yakin hapus data "' + param.plantName + ' - ' + param.sectionName + '" ?', + message: 'Apakah anda yakin hapus data "' + param.plantName + '" ?', onConfirm: () => handleDelete(param.plant_section_id), onCancel: () => props.setSelectedData(null), }); @@ -227,7 +216,7 @@ const ListPlantSection = memo(function ListPlantSection(props) { NotifAlert({ icon: 'success', title: 'Berhasil', - message: `Data Plant Section "${plantToDelete?.plantName || ''} - ${plantToDelete?.sectionName || ''}" berhasil dihapus.`, + message: `Data Plant Section "${plantToDelete?.plantName || ''}" berhasil dihapus.`, }); }; @@ -301,7 +290,7 @@ const ListPlantSection = memo(function ListPlantSection(props) { mobile cardColor={'#42AAFF'} header={'plantName'} - subHeader={'sectionName'} + subHeader={null} showPreviewModal={showPreviewModal} showEditModal={showEditModal} showDeleteDialog={showDeleteDialog}