From 90dc7555654b844a8f411cd4fe979971fae521e4 Mon Sep 17 00:00:00 2001 From: Devdeep Ghosh <63492939+thedevildude@users.noreply.github.com> Date: Wed, 24 Apr 2024 17:40:24 +0530 Subject: [PATCH] Added Timeline UI for Bed Activity (#6901) * BedActivityTimeline component added * In Use indicator added to BedActivityTimeLine * fixed deepscan failure due to missing key prop * UI revision | reduced IN USE size | created BedTitleSuffix component * moved BedActivityTimeline one level up * Timeline note accepts react node | Bed timeline ui changed * improved logic for showing asset changes * moved all input fields to one row * changed in use badge color * Introduced i button popover to BedActivityTimeline * Added Asset diffing function * minor css change * added icons for adding and removing asset * no assets linked text added * moved input fields back to different lines * changed in use bed timeline node icon to l-bed * added missing key props to map objects * added icon style customizability for Timeline Node * fixed null value error * icon color changed for first node * added divider between form and timeline | moved button to right * Refactor BedAllocationNode and BedTimelineAsset components * fixed linting * fixed linting * minor fixes based on review --------- Co-authored-by: rithviknishad --- src/CAREUI/display/Timeline.tsx | 16 +- .../Consultations/BedActivityTimeline.tsx | 260 ++++++++++++++++++ .../Facility/Consultations/Beds.tsx | 72 +---- 3 files changed, 287 insertions(+), 61 deletions(-) create mode 100644 src/Components/Facility/Consultations/BedActivityTimeline.tsx diff --git a/src/CAREUI/display/Timeline.tsx b/src/CAREUI/display/Timeline.tsx index b2401630e93..3414a792398 100644 --- a/src/CAREUI/display/Timeline.tsx +++ b/src/CAREUI/display/Timeline.tsx @@ -10,7 +10,9 @@ export interface TimelineEvent { timestamp: string; by: PerformedByModel | undefined; icon: IconName; - notes?: string; + iconStyle?: string; + iconWrapperStyle?: string; + notes?: string | React.ReactNode; cancelled?: boolean; } @@ -126,9 +128,17 @@ interface TimelineNodeTitleProps { export const TimelineNodeTitle = (props: TimelineNodeTitleProps) => { return ( <> -
+