Overview
Oracle Cloud Infrastructure (OCI) provides granular monitoring and auditing capabilities for its vast array of cloud resources. For operations teams, a clear and concise timeline of resource activities is critical for debugging, auditing, and understanding resource lifecycle. This problem asks you to build a React component to visualize these historical events, enabling administrators to quickly grasp a resource's history at a glance.
What you need to do / Task
Your primary goal is to implement a Timeline React component that displays a series of resource activity events.
- Render Timeline Events: Display all provided
TimelineEvent objects in chronological order, showing their timestamp, type, and description.
- Implement Event Grouping: Group consecutive events of the same type that occur within a 5-minute window into a single, collapsible timeline entry.
- Group Header Display: For grouped events, the header should show the time range (earliest to latest event timestamp within the group), the common event type, and the total count of events in that group.
- Collapsible Groups: Allow users to expand and collapse these grouped entries to reveal or hide the individual events contained within.
- Visual Distinction: Visually differentiate between different
EventTypes (e.g., using distinct colors or icons for the timeline markers).
UI/UX expectations
- Layout: The timeline should be presented vertically, with events ordered from oldest at the top to newest at the bottom.
- Timeline Axis: Each event (or group header) should have a clear visual indicator (e.g., a dot or line segment) aligned along a central vertical axis.
- Interactions: Group headers should be clickable to toggle their expanded/collapsed state. A clear visual cue (e.g., an arrow icon or text like 'Expand'/'Collapse') should indicate the current state.
- Clarity: Ensure event details (timestamp, type, description) are clearly legible for both individual and grouped events.
Acceptance criteria
- The
Timeline component renders all provided TimelineEvent data.
- Events are always displayed in strict chronological order.
- Consecutive events of the same
EventType occurring within a 5-minute (300,000 milliseconds) window are correctly grouped.
- Each group header accurately displays the aggregated time range (from the first event's timestamp to the last event's timestamp in the group), the common
EventType, and the total number of events in the group.
- Group headers are interactive and correctly toggle the visibility of their contained individual events.
- Individual events within an expanded group are rendered correctly, displaying their specific timestamp, type, and description.
- Different
EventTypes are visually distinguishable (e.g., via distinct colors for their timeline markers/dots).