From 3fe5fbef317f93d70a582ab482bf9434c6a0e6e3 Mon Sep 17 00:00:00 2001 From: Fachba Date: Wed, 29 Apr 2026 17:38:38 +0700 Subject: [PATCH] Update DetailDevice component to set 'listen_channel' to null and modify NotificationDetailTab to enhance the display of spare part reminders and update the title from 'Error Notification Detail' to 'Notification Detail'. --- .../master/device/component/DetailDevice.jsx | 2 +- .../IndexNotificationDetail.jsx | 273 ++++++++++++++---- 2 files changed, 212 insertions(+), 63 deletions(-) diff --git a/src/pages/master/device/component/DetailDevice.jsx b/src/pages/master/device/component/DetailDevice.jsx index 8ba0c7b..815fe5e 100644 --- a/src/pages/master/device/component/DetailDevice.jsx +++ b/src/pages/master/device/component/DetailDevice.jsx @@ -36,7 +36,7 @@ const DetailDevice = (props) => { device_description: '', ip_address: '', reminder_at: null, - listen_channel: '', + listen_channel: null, }; const [formData, setFormData] = useState(defaultData); diff --git a/src/pages/notificationDetail/IndexNotificationDetail.jsx b/src/pages/notificationDetail/IndexNotificationDetail.jsx index 86dad89..7f55bc9 100644 --- a/src/pages/notificationDetail/IndexNotificationDetail.jsx +++ b/src/pages/notificationDetail/IndexNotificationDetail.jsx @@ -353,7 +353,7 @@ const NotificationDetailTab = (props) => { }} > - Error Notification Detail + Notification Detail @@ -361,59 +361,214 @@ const NotificationDetailTab = (props) => { {/* Kolom Kiri: Data Kompresor */} - - - - - -
- -
- - - {notification.title} -
- - Error Code {notification.issue} - -
- -
-
- Plant Subsection -
{notification.location}
- - Date & Time - -
{notification.timestamp}
-
-
-
- + {notification.is_reminder && ( + +
+ + + + + Spare Part Reminder Maintenance + + + + + {notification.spareparts_reminder && + notification.spareparts_reminder.length > 0 ? ( + notification.spareparts_reminder.map( + (sparepart, index) => ( + + + +
+ +
+ + { + sparepart.sparepart_stok + } + + + + + + { + sparepart.sparepart_name + } + + + {sparepart.sparepart_description || + 'Deskripsi tidak tersedia'} + +
+ Kode:{' '} + { + sparepart.sparepart_code + }{' '} + | Qty:{' '} + { + sparepart.sparepart_qty + }{' '} + | Unit:{' '} + { + sparepart.sparepart_unit + } +
+
+ +
+
+ ) + ) + ) : ( +
+ Tidak ada spare parts terkait +
+ )} +
+
+
+ + )} + + {!notification.is_reminder && ( + + + + + +
+ +
+ + + {notification.title} +
+ + Error Code {notification.issue} + +
+ +
+
+ Plant Subsection +
{notification.location}
+ + Date & Time + +
{notification.timestamp}
+
+
+
+ + )} {/* Kolom Tengah: Informasi Teknis */} {
- + {
- + {
- +