NewsBoard Documentation
Overview
The NewsBoard component is a user interface module in the Vantage analytics & data platform that displays real-time notifications and updates to users. It aggregates messages regarding system alerts, task assignments, and billing updates, providing a concise overview of important activities. The NewsBoard not only renders a notification feed but also allows users to manage their notifications effectively, enabling actions such as marking them as read or dismissing them.
Purpose
The primary purpose of the NewsBoard component is to enhance user experience by keeping users informed about relevant notifications and updates within the platform. It aims to facilitate efficient workflow management by allowing users to track and respond to notifications as they arise.
Data Expectations
The NewsBoard expects to receive the following data from the underlying notification store:
- Notifications: An array of notification objects, each containing properties like
id,title,message,severity,type,created, andstatus. - Unread Count: A numeric count of unread notifications.
How It Works
-
Data Fetching:
- On component mount, the NewsBoard fetches notifications and news tile content from specific API endpoints.
- The notifications are fetched with a limit (e.g., 20) to avoid overloading the component with excessive data.
-
Sorting Notifications:
- The notifications are sorted according to severity, with critical notifications appearing first.
- The component provides visual indicators (icons) for different severities (e.g., critical, warning, information).
-
User Actions:
- Users can mark notifications as read or dismiss them directly from the notification feed.
- A modal can be opened to view all notifications in detail.
-
Dynamic Rendering:
- The component renders a visual representation of notifications and their current state, updating reactively based on user interactions or incoming data.
Settings
The following settings are critical for configuring the NewsBoard component:
| Setting Name | Input Type | Description | Default Value |
|---|---|---|---|
fetchNotifications | Function | This function is called to retrieve the notifications data. Configuring this affects how notifications are fetched and may include limits. | None |
openModal | Function | This function is responsible for opening the notifications modal. Changing its reference might alter which modal is displayed. | None |
unreadCount | Numeric | This represents the number of unread notifications. It is visually depicted on the notifications icon, indicating the urgency to the user. | 0 |
notifications | Array | This array contains all notification objects that the NewsBoard should render. Altering its contents directly affects what the user sees. | [] |
markAs | Function | This function marks notifications as read or dismissed based on user actions. It can be configured to change notification states at will. | None |
newsHtml | String | This field contains the HTML content to be displayed as news in the component. If empty or invalid, the component displays a message indicating no news is available. | '' |
newsLoading | Boolean | This boolean indicates whether the news content is still loading. Affects loading states in the UI. A true value indicates that content is being resolved. | true |
Use Cases & Examples
Use Cases
- System Alerts: A company can use the NewsBoard to notify users of critical system updates or emergencies, ensuring that users have real-time access to urgent information.
- Task Management: Teams can implement the NewsBoard to deliver notifications regarding task assignments, reminders for deadlines, and updates on team activities, thereby improving productivity.
- Billing Notifications: Businesses can leverage the component to inform users about billing updates, payment reminders, or account status changes to maintain transparent financial communication.
Example Configuration
Use Case: Task Management Notifications
To implement a use case where the NewsBoard is used for task management notifications, consider the following configuration:
const notifications = [
{
id: '1',
title: 'New Task Assigned',
message: 'You have been assigned a new task: Update the project documentation.',
severity: 'info',
type: 'task',
created: '2023-10-10T12:00:00Z',
status: 'unread'
},
{
id: '2',
title: 'Task Deadline Approaching',
message: 'The deadline for your task "Update the project documentation" is this Friday.',
severity: 'warning',
type: 'task',
created: '2023-10-11T09:00:00Z',
status: 'unread'
},
{
id: '3',
title: 'Task Completed',
message: 'You have marked "Update the project documentation" as completed.',
severity: 'info',
type: 'task',
created: '2023-10-11T15:00:00Z',
status: 'read'
}
];
// Implementing the NewsBoard component
<NewsBoard
notifications={notifications}
unreadCount={2}
fetchNotifications={yourFetchFunction}
markAs={yourMarkAsFunction}
openModal={yourOpenModalFunction}
/>In this configuration example, the notifications array contains multiple task-related notifications, showcasing both urgent and informational messages. The unreadCount reflects the number of notifications that need the user's attention.
This setup allows users to get alerted to tasks assigned to them, reminders about deadlines, and updates on the status of their work—providing comprehensive management of their task workflow directly through the NewsBoard component within the Vantage platform.