diff --git a/src/pages/master/brandDevice/component/BrandForm.jsx b/src/pages/master/brandDevice/component/BrandForm.jsx index 42365c4..046045b 100644 --- a/src/pages/master/brandDevice/component/BrandForm.jsx +++ b/src/pages/master/brandDevice/component/BrandForm.jsx @@ -4,6 +4,8 @@ import { Form, Input, Row, Col, Typography, Switch } from 'antd'; const { Text } = Typography; const BrandForm = ({ form, formData, onValuesChange, isEdit = false }) => { + const isActive = Form.useWatch('is_active', form) ?? formData.is_active ?? true; + return (
{
- {formData.is_active ? 'Running' : 'Offline'} + {isActive ? 'Running' : 'Offline'}
diff --git a/src/pages/master/brandDevice/component/ErrorCodeForm.jsx b/src/pages/master/brandDevice/component/ErrorCodeForm.jsx index fbfaff2..1001aa5 100644 --- a/src/pages/master/brandDevice/component/ErrorCodeForm.jsx +++ b/src/pages/master/brandDevice/component/ErrorCodeForm.jsx @@ -112,6 +112,7 @@ const ErrorCodeForm = ({ const solutionName = values[`solution_name_${fieldId}`]; const textSolution = values[`text_solution_${fieldId}`]; + const solutionStatus = values[`solution_status_${fieldId}`]; const filesForSolution = fileList.filter((file) => file.solutionId === fieldId); const solutionType = values[`solution_type_${fieldId}`] || solutionTypes[fieldId]; @@ -122,7 +123,7 @@ const ErrorCodeForm = ({ type_solution: 'text', text_solution: textSolution.trim(), path_solution: '', - is_active: solutionStatuses[fieldId] !== false, + is_active: solutionStatus !== undefined ? solutionStatus : true, }; if (window.currentSolutionData && window.currentSolutionData[fieldId]) { @@ -145,7 +146,7 @@ const ErrorCodeForm = ({ (file.type.startsWith('image/') ? 'image' : 'pdf'), text_solution: '', path_solution: file.uploadPath, - is_active: solutionStatuses[fieldId] !== false, + is_active: solutionStatus !== undefined ? solutionStatus : true, }; if (window.currentSolutionData && window.currentSolutionData[fieldId]) { diff --git a/src/pages/master/brandDevice/component/ListBrandDevice.jsx b/src/pages/master/brandDevice/component/ListBrandDevice.jsx index cbfef9c..b21df9e 100644 --- a/src/pages/master/brandDevice/component/ListBrandDevice.jsx +++ b/src/pages/master/brandDevice/component/ListBrandDevice.jsx @@ -67,7 +67,7 @@ const columns = (showPreviewModal, showEditModal, showDeleteDialog) => [ ), }, { - title: 'Aksi', + title: 'Action', key: 'action', align: 'center', width: '15%', @@ -251,7 +251,7 @@ const ListBrandDevice = memo(function ListBrandDevice(props) { }} size="large" > - Tambah Brand Device + Add Brand Device diff --git a/src/pages/master/brandDevice/component/SolutionField.jsx b/src/pages/master/brandDevice/component/SolutionField.jsx index 7df25d7..dca30ec 100644 --- a/src/pages/master/brandDevice/component/SolutionField.jsx +++ b/src/pages/master/brandDevice/component/SolutionField.jsx @@ -20,6 +20,8 @@ const SolutionField = ({ onFileView, errorCodeForm, }) => { + // Watch the solution status from the form + const watchedStatus = Form.useWatch(`solution_status_${fieldId}`, errorCodeForm); useEffect(() => { if (currentSolutionData && errorCodeForm) { if (currentSolutionData.solution_name) { @@ -146,34 +148,22 @@ const SolutionField = ({ - - prevValues[`solution_status_${fieldId}`] !== - currentValues[`solution_status_${fieldId}`] - } - noStyle - > - {({ getFieldValue, setFieldValue }) => { - const currentStatus = getFieldValue(`solution_status_${fieldId}`); - return ( -
- { - setFieldValue(`solution_status_${fieldId}`, checked); - }} - disabled={isReadOnly} - style={{ - backgroundColor: solutionStatus ? '#23A55A' : '#bfbfbf', - }} - /> - - {currentStatus === true ? 'Active' : 'Non Active'} - -
- ); - }} -
+
+ + { + onSolutionStatusChange(fieldId, checked); + }} + style={{ + backgroundColor: (watchedStatus ?? true) ? '#23A55A' : '#bfbfbf', + }} + /> + + + {(watchedStatus ?? true) ? 'Active' : 'Non Active'} + +
diff --git a/src/pages/master/brandDevice/hooks/errorCode.js b/src/pages/master/brandDevice/hooks/errorCode.js index f1d3e9f..0d748d5 100644 --- a/src/pages/master/brandDevice/hooks/errorCode.js +++ b/src/pages/master/brandDevice/hooks/errorCode.js @@ -194,9 +194,7 @@ export const useErrorCodeLogic = (errorCodeForm, fileList) => { }; const handleSolutionStatusChange = (fieldId, status) => { - // Update form immediately - errorCodeForm.setFieldValue(`solution_status_${fieldId}`, status); - // Then update local state + // Only update local state - form is already updated by Form.Item setSolutionStatuses(prev => ({ ...prev, [fieldId]: status diff --git a/src/pages/master/device/component/ListDevice.jsx b/src/pages/master/device/component/ListDevice.jsx index 875deba..d3cf0b9 100644 --- a/src/pages/master/device/component/ListDevice.jsx +++ b/src/pages/master/device/component/ListDevice.jsx @@ -81,7 +81,7 @@ const columns = (showPreviewModal, showEditModal, showDeleteDialog) => [ ), }, { - title: 'Aksi', + title: 'Action', key: 'aksi', align: 'center', width: '15%', @@ -249,7 +249,7 @@ const ListDevice = memo(function ListDevice(props) { onClick={() => showAddModal()} size="large" > - Tambah Data + Add data diff --git a/src/pages/master/plantSubSection/component/ListPlantSubSection.jsx b/src/pages/master/plantSubSection/component/ListPlantSubSection.jsx index fd18e0a..cd283ec 100644 --- a/src/pages/master/plantSubSection/component/ListPlantSubSection.jsx +++ b/src/pages/master/plantSubSection/component/ListPlantSubSection.jsx @@ -62,7 +62,7 @@ const columns = (showPreviewModal, showEditModal, showDeleteDialog) => [ ), }, { - title: 'Aksi', + title: 'Action', key: 'aksi', align: 'center', width: '15%', @@ -226,7 +226,7 @@ const ListPlantSubSection = memo(function ListPlantSubSection(props) { onClick={() => showAddModal()} size="large" > - Tambah Data + Add data diff --git a/src/pages/master/shift/component/ListShift.jsx b/src/pages/master/shift/component/ListShift.jsx index d177631..fb4b615 100644 --- a/src/pages/master/shift/component/ListShift.jsx +++ b/src/pages/master/shift/component/ListShift.jsx @@ -78,7 +78,7 @@ const columns = (showPreviewModal, showEditModal, showDeleteDialog) => [ ), }, { - title: 'Aksi', + title: 'Action', key: 'aksi', align: 'center', width: '25%', @@ -239,7 +239,7 @@ const ListShift = memo(function ListShift(props) { onClick={() => showAddModal()} size="large" > - Tambah Data + Add data diff --git a/src/pages/master/status/component/DetailStatus.jsx b/src/pages/master/status/component/DetailStatus.jsx index 360f2f6..ccfbedb 100644 --- a/src/pages/master/status/component/DetailStatus.jsx +++ b/src/pages/master/status/component/DetailStatus.jsx @@ -128,7 +128,7 @@ const DetailStatus = (props) => { title={ {props.actionMode === 'add' - ? 'Tambah Data' + ? 'Add data' : props.actionMode === 'preview' ? 'Preview Status' : 'Edit Status'} diff --git a/src/pages/master/status/component/ListStatus.jsx b/src/pages/master/status/component/ListStatus.jsx index babb6be..4e7ef01 100644 --- a/src/pages/master/status/component/ListStatus.jsx +++ b/src/pages/master/status/component/ListStatus.jsx @@ -43,7 +43,7 @@ const columns = (showPreviewModal, showEditModal, showDeleteDialog) => [ width: '40%', }, { - title: 'Aksi', + title: 'Action', key: 'aksi', align: 'center', width: '20%', @@ -198,7 +198,7 @@ const ListStatus = memo(function ListStatus(props) { }} > diff --git a/src/pages/master/tag/component/ListTag.jsx b/src/pages/master/tag/component/ListTag.jsx index 9325b9d..220eeb8 100644 --- a/src/pages/master/tag/component/ListTag.jsx +++ b/src/pages/master/tag/component/ListTag.jsx @@ -98,7 +98,7 @@ const columns = (showPreviewModal, showEditModal, showDeleteDialog) => [ ), }, { - title: 'Aksi', + title: 'Action', key: 'aksi', align: 'center', width: '15%', @@ -289,7 +289,7 @@ const ListTag = memo(function ListTag(props) { onClick={() => showAddModal()} size="large" > - Tambah Data + Add data diff --git a/src/pages/master/unit/component/ListUnit.jsx b/src/pages/master/unit/component/ListUnit.jsx index 18f1805..2181f64 100644 --- a/src/pages/master/unit/component/ListUnit.jsx +++ b/src/pages/master/unit/component/ListUnit.jsx @@ -61,7 +61,7 @@ const columns = (showPreviewModal, showEditModal, showDeleteDialog) => [ ), }, { - title: 'Aksi', + title: 'Action', key: 'aksi', align: 'center', width: '20%', @@ -258,7 +258,7 @@ const ListUnit = memo(function ListUnit(props) { onClick={() => showAddModal()} size="large" > - Tambah Data + Add Data diff --git a/src/pages/notification/IndexNotification.jsx b/src/pages/notification/IndexNotification.jsx index a4828dd..1c5ab9f 100644 --- a/src/pages/notification/IndexNotification.jsx +++ b/src/pages/notification/IndexNotification.jsx @@ -23,7 +23,7 @@ const IndexNotification = memo(function IndexNotification() { { title: ( - • Notifikasi + • Notification ), }, diff --git a/src/pages/notification/component/ListNotification.jsx b/src/pages/notification/component/ListNotification.jsx index 6ed7f4a..6db9cf5 100644 --- a/src/pages/notification/component/ListNotification.jsx +++ b/src/pages/notification/component/ListNotification.jsx @@ -168,7 +168,7 @@ const ListNotification = memo(function ListNotification(props) { color: '#262626', }} > - Notifikasi + Notification

Riwayat notifikasi yang dikirim ke engineer @@ -181,7 +181,7 @@ const ListNotification = memo(function ListNotification(props) { onClick={() => setActiveTab('all')} style={tabButtonStyle(activeTab === 'all')} > - Semua + All @@ -381,7 +381,7 @@ const ListNotification = memo(function ListNotification(props) { fontWeight: 500, }} > - Lihat Detail + View Detail @@ -397,3 +397,5 @@ const ListNotification = memo(function ListNotification(props) { }); export default ListNotification; + + diff --git a/src/pages/report/report/component/ListReport.jsx b/src/pages/report/report/component/ListReport.jsx index ce40586..16544cf 100644 --- a/src/pages/report/report/component/ListReport.jsx +++ b/src/pages/report/report/component/ListReport.jsx @@ -186,7 +186,7 @@ const ListReport = memo(function ListReport(props) { icon={} onClick={handleSearch} > - Tampilkan + Show diff --git a/src/pages/report/trending/ReportTrending.jsx b/src/pages/report/trending/ReportTrending.jsx index 8aa6be0..0a51025 100644 --- a/src/pages/report/trending/ReportTrending.jsx +++ b/src/pages/report/trending/ReportTrending.jsx @@ -174,7 +174,7 @@ const ReportTrending = memo(function ReportTrending(props) { icon={} onClick={handleSearch} > - Tampilkan + Show diff --git a/src/pages/role/component/DetailRole.jsx b/src/pages/role/component/DetailRole.jsx index 1c24dbf..f0ec5bf 100644 --- a/src/pages/role/component/DetailRole.jsx +++ b/src/pages/role/component/DetailRole.jsx @@ -42,7 +42,7 @@ const DetailRole = (props) => { setConfirmLoading(true); const validationRules = [ - { field: 'role_name', label: 'Nama Role', required: true }, + { field: 'role_name', label: 'Role name', required: true }, { field: 'role_level', label: 'Level', required: true }, ]; @@ -169,7 +169,7 @@ const DetailRole = (props) => {

- Nama Role + Role name * {
- Deskripsi Role + Role Description