From b023e57717cf2df68f1d2ee590bd40c38a88850e Mon Sep 17 00:00:00 2001 From: Jose Carlos Laura Ramirez Date: Thu, 13 Jun 2024 00:16:10 -0400 Subject: [PATCH] improve code --- .../ResourceTabs/AuditLogTab/AuditLogTab.tsx | 2 +- .../SiteAuditLogEntityStatusSide.tsx | 2 +- .../components/SiteAuditLogProjectStatus.tsx | 75 ++++--------------- .../PolygonStatus/StatusDisplay.tsx | 4 +- .../elements/CommentaryBox/CommentaryBox.tsx | 6 +- 5 files changed, 20 insertions(+), 69 deletions(-) diff --git a/src/admin/components/ResourceTabs/AuditLogTab/AuditLogTab.tsx b/src/admin/components/ResourceTabs/AuditLogTab/AuditLogTab.tsx index a7e5573fa..967ddd7e3 100644 --- a/src/admin/components/ResourceTabs/AuditLogTab/AuditLogTab.tsx +++ b/src/admin/components/ResourceTabs/AuditLogTab/AuditLogTab.tsx @@ -67,7 +67,7 @@ const AuditLogTab: FC = ({ label, ...rest }) => { /> - + {`${entityType} Status`} void; auditLogData?: { data: AuditStatusResponse[] }; } -export const gridData = [ - { - id: "1", - date: "28/11/2023 09.39", - user: "Jessica Chaimers", - site: null, - status: "Need More Information", - comentary: null - }, - { - id: "2", - date: "28/11/2023 09.39", - user: "Teresa Muthoni", - site: null, - status: "Need More Information", - comentary: - "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." - }, - { - id: "3", - date: "28/11/2023 09.39", - user: "Jessica Chaimers", - site: null, - status: "Awaiting Approval", - comentary: null - }, - { - id: "4", - date: "28/11/2023 09.39", - user: "Jessica Chaimers", - site: null, - status: "Awaiting Approval", - comentary: null - }, - { - id: "5", - date: "28/11/2023 09.39", - user: "Jessica Chaimers", - site: null, - status: "Awaiting Approval", - comentary: null - } -]; - -const SiteAuditLogProjectStatus: FC = ({ record, auditLogData, refresh }) => { - return ( -
-
- - Project Status and Comments - - - Update the project status, view updates, or add comments - - -
- History and Discussion for {record && record?.name} - {auditLogData && } +const SiteAuditLogProjectStatus: FC = ({ record, auditLogData }) => ( +
+
+ + Project Status and Comments + + + Update the project status, view updates, or add comments +
- ); -}; + History and Discussion for {record && record?.name} + {auditLogData && } +
+); export default SiteAuditLogProjectStatus; diff --git a/src/admin/components/ResourceTabs/PolygonReviewTab/components/PolygonStatus/StatusDisplay.tsx b/src/admin/components/ResourceTabs/PolygonReviewTab/components/PolygonStatus/StatusDisplay.tsx index a0aa03e63..aa6fac8a9 100644 --- a/src/admin/components/ResourceTabs/PolygonReviewTab/components/PolygonStatus/StatusDisplay.tsx +++ b/src/admin/components/ResourceTabs/PolygonReviewTab/components/PolygonStatus/StatusDisplay.tsx @@ -156,8 +156,8 @@ const StatusDisplay = ({ ); const onFinallyRequest = () => { - refresh && refresh(); - reloadEntity && reloadEntity(); + refresh?.(); + reloadEntity(); closeModal(); }; diff --git a/src/components/elements/CommentaryBox/CommentaryBox.tsx b/src/components/elements/CommentaryBox/CommentaryBox.tsx index 71c9f7eb3..477d01afa 100644 --- a/src/components/elements/CommentaryBox/CommentaryBox.tsx +++ b/src/components/elements/CommentaryBox/CommentaryBox.tsx @@ -128,8 +128,8 @@ const CommentaryBox = (props: CommentaryBoxProps) => {
- {(name && name[0]) ?? ""} - {(lastName && lastName[0]) ?? ""} + {name?.[0] ?? ""} + {lastName?.[0] ?? ""}