From 73b5cd6e9702919babf8c1d859cbf7640d540ee6 Mon Sep 17 00:00:00 2001 From: Iqbal Rizqi Kurniawan Date: Thu, 20 Nov 2025 16:41:21 +0700 Subject: [PATCH] feat: add detail notification page and update notification links --- src/App.jsx | 3 + .../component/ListNotification.jsx | 42 ++-- .../sparepartGudang/IndexSparepartGudang.jsx | 237 ++++++++++++++++++ 3 files changed, 261 insertions(+), 21 deletions(-) create mode 100644 src/pages/sparepartGudang/IndexSparepartGudang.jsx diff --git a/src/App.jsx b/src/App.jsx index 9081ffe..1b24484 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -34,6 +34,7 @@ import IndexNotification from './pages/notification/IndexNotification'; import IndexRole from './pages/role/IndexRole'; import IndexUser from './pages/user/IndexUser'; import IndexContact from './pages/contact/IndexContact'; +import DetailNotification from './pages/sparepartGudang/IndexSparepartGudang' import SvgTest from './pages/home/SvgTest'; import SvgOverviewCompressor from './pages/home/SvgOverviewCompressor'; @@ -57,6 +58,8 @@ const App = () => { } /> } /> } /> + } /> + {/* Protected Routes */} }> diff --git a/src/pages/notification/component/ListNotification.jsx b/src/pages/notification/component/ListNotification.jsx index 22e8971..97c3412 100644 --- a/src/pages/notification/component/ListNotification.jsx +++ b/src/pages/notification/component/ListNotification.jsx @@ -34,10 +34,10 @@ import { PlusOutlined, ExclamationCircleOutlined, } from '@ant-design/icons'; -import { useNavigate } from 'react-router-dom'; +import { useNavigate, Link as RouterLink } from 'react-router-dom'; import { getAllNotification } from '../../../api/notification'; -const { Text, Paragraph, Link } = Typography; +const { Text, Paragraph, Link: AntdLink } = Typography; // Transform API response to component format const transformNotificationData = (apiData) => { @@ -57,7 +57,7 @@ const transformNotificationData = (apiData) => { }) + ' WIB', location: item.device_location || 'Location not specified', details: item.message_error_issue || 'No details available', - link: '#', // Will be updated when API provides link + link: `/verification/spare-part/${item.notification_error_id}`, // Dummy URL untuk verifikasi spare part subsection: item.solution_name || 'N/A', isRead: item.is_read, status: item.is_read ? 'Resolved' : item.is_delivered ? 'Delivered' : 'Pending', @@ -333,9 +333,9 @@ const ListNotification = memo(function ListNotification(props) { - + {notification.link} - + } + /> + + ); + } + + const { color } = getIconAndColor(notification.type); + + return ( + + + +
+ + + + + + + + +
+ + Error Notification Detail + +
+
+ + + + {/* Kolom Kiri: Data Kompresor */} + + + + + +
+ + + {notification.title} +
{notification.issue}
+ +
+
+ Plant Subsection +
{notification.subsection}
+ Time +
{notification.timestamp}
+
+
+ + Value
N/A
+ Treshold
N/A
+
+
+
+
+ + + {/* Kolom Kanan: Informasi Teknis */} + + + +
PLC
{notification.plc || 'N/A'}
+
Status
{notification.status}
+
Tag
{notification.tag}
+
+
+ +
+ + + Handling Guideline + Spare Part + setModalContent('log')} style={{ cursor: 'pointer' }}>Log Activity + + + + Error 303.pdflihat disini SOP Kompresor.pdflihat disini +
AvailableAir FilterFilters incoming air to remove dust.
+ setModalContent('log')}>View Logs}>
Click 'View Logs' to see the full activity history.
+
+
+
+
+ + setModalContent(null)} + notificationData={notification} + /> + setModalContent(null)} + notificationData={notification} + /> +
+ ); +}; + +export default IndexSparepartGudang; \ No newline at end of file