ContactManagerTile Documentation
Overview
The ContactManagerTile is a fully functional Contact Management dashboard tile providing CRUD (Create, Read, Update, Delete) capabilities. It enables users to manage contacts seamlessly, storing them locally and allowing for operations like editing, deleting, and importing via CSV. The tile is designed to enhance the usability of data management directly within a dashboard interface, ensuring users can maintain an organized contact list efficiently.
Purpose
The primary objective of the ContactManagerTile is to facilitate the management of contacts for users, enabling tasks such as searching, adding, editing, deleting, and importing contacts. It interacts with an external API to fetch and manipulate contact data while providing a user-friendly interface.
Settings
The ContactManagerTile accepts various settings to customize its behavior and appearance. Detailed descriptions of each setting are outlined below:
1. Title
- Input Type: String
- Description: This is the main title displayed on the tile. It identifies the purpose of the tile to the users. Changing this value will adjust the title shown prominently at the top of the tile.
- Default Value:
'Contacts'
2. Subtitle
- Input Type: String
- Description: This provides a secondary title or description beneath the main title. It can offer additional context or instructions related to the displayed contacts. Modifying this will change the subtitle accordingly.
- Default Value:
''(empty string)
3. ID (tileId)
- Input Type: String
- Description: A unique identifier for the tile, which helps in differentiating and managing multiple tiles within the dashboard. This ID is crucial for state management and data-fetching logic, allowing the system to route specific requests and updates correctly.
- Default Value: Not set by the tile; must be provided externally.
4. Storage Provider
- Input Type: String
- Description: Specifies the service used for storing contacts (e.g., OneDrive). Changing this setting modifies where the contacts will be fetched from and saved to, which can directly affect data persistence and accessibility.
- Default Value:
'onedrive'
How It Works
-
State Management: The tile manages its state internally. States include contacts, loading status, errors, search queries, sort fields, and CRUD operation handlers.
-
Fetching Data: Upon initialization, the tile fetches contact data from an API endpoint (
/api/apps/contacts) and configuration settings from (/api/apps/config). The fetched contact data can be filtered, searched, and sorted based on user input. -
Contact Display: The tile displays contacts in a table format. Users can view details such as name, email, phone, company, and job title. It also supports inline editing with a form.
-
CRUD Operations: Users can add a new contact, edit existing ones, or delete contacts. These operations send requests to the backend API to persist changes.
-
CSV Import/Export: The tile allows users to import contacts from a CSV file. The CSV parser reads the contents and maps fields to the contact schema.
-
AI Integrations: The tile integrates with a global AI context, exposing contact data to an AI assistant for advanced querying and management.
Expected Data
The ContactManagerTile expects contact data in a specific structure that includes the following fields:
- first_name: String
- last_name: String
- email: String
- phone: String
- company: String
- job_title: String
- address: String
- tags: Array of Strings
- notes: String
- id (optional): Custom unique identifier for editing and deleting purposes.
The backend should ensure that these fields are always provided correctly in responses to maintain the integrity of data management.
Use Cases & Examples
Use Case 1: Personal Contact Management
An individual user wants to maintain a contacts list encompassing family and friends, needing straightforward access to manage details like phone numbers and addresses.
Use Case 2: Business Contact Database
A small business owner requires a way to manage their clients. The business owner utilizes the ContactManagerTile to add, edit, and remove clients efficiently, ensuring that employee details are up to date.
Use Case 3: Importing Large Contact Lists
A user needs to quickly populate their contact list with a significant number of entries from a CSV file. They can utilize the tile’s import feature to bulk upload contact details.
Example Configuration
For a small business needing an organized client database, they may configure the ContactManagerTile as follows:
- Title:
Client Contacts - Subtitle:
Manage all client relations here. - ID:
client-contacts-tile - Storage Provider:
onedrive
After setup, the user can then prepare a CSV file with the following data:
"First Name","Last Name","Email","Phone","Company","Job Title"
"John","Doe","john.doe@example.com","1234567890","Acme Corp","Sales Manager"
"Jane","Smith","jane.smith@example.com","0987654321","Tech Solutions","CTO"They would upload this CSV using the tile’s import functionality. The system would parse the file, ensure each contact is formatted correctly, and populate the contacts list displayed within the tile interface.