Initial commit: timeline-elements-demo app
Interactive Angular 19 demo for @sda/timeline-elements-ui with vertical/horizontal timelines, Gantt charts, activity feeds, audit trails, changelogs, and dark mode toggle. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
84
src/app/mock-data/activity-data.ts
Normal file
84
src/app/mock-data/activity-data.ts
Normal file
@@ -0,0 +1,84 @@
|
||||
import type { TlActivityItem } from '@sda/timeline-elements-ui';
|
||||
|
||||
export const RECENT_ACTIVITY: TlActivityItem[] = [
|
||||
{
|
||||
id: '1',
|
||||
actor: { id: '1', name: 'Sarah Johnson', avatar: '', initials: 'SJ' },
|
||||
action: 'created',
|
||||
target: 'Incident Report #2453',
|
||||
description: 'Fall in dining area - resident Mrs. Anderson',
|
||||
date: new Date(Date.now() - 1000 * 60 * 15),
|
||||
type: 'create',
|
||||
unread: true,
|
||||
},
|
||||
{
|
||||
id: '2',
|
||||
actor: { id: '2', name: 'Michael Chen', avatar: '', initials: 'MC' },
|
||||
action: 'updated',
|
||||
target: 'Care Plan',
|
||||
description: 'Revised medication schedule for Mr. Roberts',
|
||||
date: new Date(Date.now() - 1000 * 60 * 45),
|
||||
type: 'update',
|
||||
unread: true,
|
||||
},
|
||||
{
|
||||
id: '3',
|
||||
actor: { id: '3', name: 'Emily Davis', avatar: '', initials: 'ED' },
|
||||
action: 'commented on',
|
||||
target: 'Incident Report #2453',
|
||||
description: 'Added witness statement and photos',
|
||||
date: new Date(Date.now() - 1000 * 60 * 120),
|
||||
type: 'comment',
|
||||
unread: false,
|
||||
},
|
||||
{
|
||||
id: '4',
|
||||
actor: { id: '4', name: 'System', avatar: '', initials: 'SY' },
|
||||
action: 'assigned',
|
||||
target: 'Maintenance Task #891',
|
||||
description: 'Broken window in Room 12 → Facilities Team',
|
||||
date: new Date(Date.now() - 1000 * 60 * 240),
|
||||
type: 'assign',
|
||||
unread: false,
|
||||
},
|
||||
{
|
||||
id: '5',
|
||||
actor: { id: '1', name: 'Sarah Johnson', avatar: '', initials: 'SJ' },
|
||||
action: 'uploaded',
|
||||
target: '3 documents',
|
||||
description: 'Medical reports for quarterly review',
|
||||
date: new Date(Date.now() - 1000 * 60 * 360),
|
||||
type: 'upload',
|
||||
unread: false,
|
||||
},
|
||||
{
|
||||
id: '6',
|
||||
actor: { id: '5', name: 'David Martinez', avatar: '', initials: 'DM' },
|
||||
action: 'completed',
|
||||
target: 'Fire Safety Drill',
|
||||
description: 'All residents and staff participated successfully',
|
||||
date: new Date(Date.now() - 1000 * 60 * 60 * 24),
|
||||
type: 'status',
|
||||
unread: false,
|
||||
},
|
||||
{
|
||||
id: '7',
|
||||
actor: { id: '3', name: 'Emily Davis', avatar: '', initials: 'ED' },
|
||||
action: 'shared',
|
||||
target: 'Weekly Schedule',
|
||||
description: 'Activity calendar shared with family members',
|
||||
date: new Date(Date.now() - 1000 * 60 * 60 * 36),
|
||||
type: 'share',
|
||||
unread: false,
|
||||
},
|
||||
{
|
||||
id: '8',
|
||||
actor: { id: '4', name: 'System', avatar: '', initials: 'SY' },
|
||||
action: 'sent',
|
||||
target: 'Medication Reminder',
|
||||
description: 'Automated reminders sent to nursing staff',
|
||||
date: new Date(Date.now() - 1000 * 60 * 60 * 48),
|
||||
type: 'system',
|
||||
unread: false,
|
||||
},
|
||||
];
|
||||
98
src/app/mock-data/audit-data.ts
Normal file
98
src/app/mock-data/audit-data.ts
Normal file
@@ -0,0 +1,98 @@
|
||||
import type { TlAuditEntry } from '@sda/timeline-elements-ui';
|
||||
|
||||
export const AUDIT_LOG: TlAuditEntry[] = [
|
||||
{
|
||||
id: '1',
|
||||
action: 'User Login',
|
||||
category: 'Authentication',
|
||||
user: 'sarah.johnson@example.com',
|
||||
date: new Date(Date.now() - 1000 * 60 * 10),
|
||||
severity: 'info',
|
||||
description: 'Successful login via SSO',
|
||||
ipAddress: '192.168.1.45',
|
||||
},
|
||||
{
|
||||
id: '2',
|
||||
action: 'Care Plan Modified',
|
||||
category: 'Clinical',
|
||||
user: 'michael.chen@example.com',
|
||||
date: new Date(Date.now() - 1000 * 60 * 30),
|
||||
severity: 'warning',
|
||||
description: 'Medication dosage updated for resident #1234',
|
||||
resource: 'CarePlan:1234',
|
||||
changes: [
|
||||
{ field: 'medication.dosage', oldValue: '10mg', newValue: '15mg' },
|
||||
{ field: 'medication.frequency', oldValue: 'Once daily', newValue: 'Twice daily' },
|
||||
{ field: 'lastReviewedBy', oldValue: 'Dr. Smith', newValue: 'Dr. Johnson' },
|
||||
],
|
||||
},
|
||||
{
|
||||
id: '3',
|
||||
action: 'Document Deleted',
|
||||
category: 'Data',
|
||||
user: 'emily.davis@example.com',
|
||||
date: new Date(Date.now() - 1000 * 60 * 75),
|
||||
severity: 'error',
|
||||
description: 'Incident report permanently deleted',
|
||||
resource: 'IncidentReport:2451',
|
||||
ipAddress: '192.168.1.78',
|
||||
},
|
||||
{
|
||||
id: '4',
|
||||
action: 'Permission Changed',
|
||||
category: 'Security',
|
||||
user: 'admin@example.com',
|
||||
date: new Date(Date.now() - 1000 * 60 * 120),
|
||||
severity: 'critical',
|
||||
description: 'User role elevated to Administrator',
|
||||
resource: 'User:8821',
|
||||
changes: [
|
||||
{ field: 'role', oldValue: 'Staff', newValue: 'Administrator' },
|
||||
{ field: 'permissions', oldValue: 'read,write', newValue: 'read,write,admin,delete' },
|
||||
],
|
||||
},
|
||||
{
|
||||
id: '5',
|
||||
action: 'Database Query',
|
||||
category: 'System',
|
||||
user: 'system@example.com',
|
||||
date: new Date(Date.now() - 1000 * 60 * 180),
|
||||
severity: 'debug',
|
||||
description: 'Automated backup completed successfully',
|
||||
ipAddress: '10.0.0.5',
|
||||
},
|
||||
{
|
||||
id: '6',
|
||||
action: 'Export Data',
|
||||
category: 'Data',
|
||||
user: 'sarah.johnson@example.com',
|
||||
date: new Date(Date.now() - 1000 * 60 * 240),
|
||||
severity: 'info',
|
||||
description: 'Monthly report exported to CSV',
|
||||
resource: 'Report:monthly-2024-03',
|
||||
ipAddress: '192.168.1.45',
|
||||
},
|
||||
{
|
||||
id: '7',
|
||||
action: 'Failed Login Attempt',
|
||||
category: 'Authentication',
|
||||
user: 'unknown@example.com',
|
||||
date: new Date(Date.now() - 1000 * 60 * 300),
|
||||
severity: 'warning',
|
||||
description: 'Invalid credentials entered 3 times',
|
||||
ipAddress: '203.45.67.89',
|
||||
},
|
||||
{
|
||||
id: '8',
|
||||
action: 'Configuration Changed',
|
||||
category: 'System',
|
||||
user: 'admin@example.com',
|
||||
date: new Date(Date.now() - 1000 * 60 * 400),
|
||||
severity: 'warning',
|
||||
description: 'Email notification settings updated',
|
||||
changes: [
|
||||
{ field: 'notifications.email.enabled', oldValue: 'false', newValue: 'true' },
|
||||
{ field: 'notifications.email.frequency', oldValue: null, newValue: 'immediate' },
|
||||
],
|
||||
},
|
||||
];
|
||||
86
src/app/mock-data/changelog-data.ts
Normal file
86
src/app/mock-data/changelog-data.ts
Normal file
@@ -0,0 +1,86 @@
|
||||
import type { TlChangelogVersion } from '@sda/timeline-elements-ui';
|
||||
|
||||
export const CHANGELOG: TlChangelogVersion[] = [
|
||||
{
|
||||
version: '2.1.0',
|
||||
date: new Date('2024-03-15'),
|
||||
title: 'Care Planning Enhancements',
|
||||
description: 'Major updates to care plan workflow and medication tracking',
|
||||
entries: [
|
||||
{
|
||||
description: 'New medication interaction warnings in care plans',
|
||||
category: 'added',
|
||||
},
|
||||
{
|
||||
description: 'Real-time collaboration for care plan editing',
|
||||
category: 'added',
|
||||
},
|
||||
{
|
||||
description: 'Improved incident report workflow with better categorization',
|
||||
category: 'changed',
|
||||
},
|
||||
{
|
||||
description: 'Fixed issue with care plan PDF exports missing signatures',
|
||||
category: 'fixed',
|
||||
},
|
||||
{
|
||||
description: 'Enhanced medication schedule conflict detection',
|
||||
category: 'security',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
version: '2.0.0',
|
||||
date: new Date('2024-02-01'),
|
||||
title: 'Major Platform Upgrade',
|
||||
description: 'Complete redesign with improved performance and accessibility',
|
||||
entries: [
|
||||
{
|
||||
description: 'Completely redesigned user interface with improved accessibility',
|
||||
category: 'changed',
|
||||
breaking: true,
|
||||
},
|
||||
{
|
||||
description: 'New dashboard with customizable widgets',
|
||||
category: 'added',
|
||||
},
|
||||
{
|
||||
description: 'Mobile app for iOS and Android',
|
||||
category: 'added',
|
||||
},
|
||||
{
|
||||
description: 'Legacy API endpoints deprecated (v1.x)',
|
||||
category: 'deprecated',
|
||||
reference: 'https://docs.example.com/api/migration',
|
||||
},
|
||||
{
|
||||
description: 'Removed Flash-based document viewer',
|
||||
category: 'removed',
|
||||
},
|
||||
{
|
||||
description: 'Fixed critical security vulnerability in authentication',
|
||||
category: 'security',
|
||||
breaking: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
version: '1.9.2',
|
||||
date: new Date('2024-01-10'),
|
||||
description: 'Bug fixes and performance improvements',
|
||||
entries: [
|
||||
{
|
||||
description: 'Fixed date picker not working in Firefox',
|
||||
category: 'fixed',
|
||||
},
|
||||
{
|
||||
description: 'Improved page load times by 40%',
|
||||
category: 'changed',
|
||||
},
|
||||
{
|
||||
description: 'Fixed memory leak in real-time notifications',
|
||||
category: 'fixed',
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
112
src/app/mock-data/gantt-data.ts
Normal file
112
src/app/mock-data/gantt-data.ts
Normal file
@@ -0,0 +1,112 @@
|
||||
import type { TlGanttTask, TlGanttDependency } from '@sda/timeline-elements-ui';
|
||||
|
||||
const today = new Date();
|
||||
const addDays = (date: Date, days: number) => new Date(date.getTime() + days * 24 * 60 * 60 * 1000);
|
||||
|
||||
export const FACILITY_RENOVATION: TlGanttTask[] = [
|
||||
{
|
||||
id: '1',
|
||||
name: 'Planning & Design',
|
||||
startDate: addDays(today, -14),
|
||||
endDate: addDays(today, -7),
|
||||
progress: 100,
|
||||
status: 'completed',
|
||||
assignee: 'Architecture Team',
|
||||
},
|
||||
{
|
||||
id: '2',
|
||||
name: 'Permits & Approvals',
|
||||
startDate: addDays(today, -10),
|
||||
endDate: addDays(today, -2),
|
||||
progress: 100,
|
||||
status: 'completed',
|
||||
assignee: 'Legal Team',
|
||||
},
|
||||
{
|
||||
id: '3',
|
||||
name: 'Common Area Renovation',
|
||||
startDate: addDays(today, -1),
|
||||
endDate: addDays(today, 20),
|
||||
progress: 15,
|
||||
status: 'in-progress',
|
||||
group: 'Phase 1',
|
||||
color: '#3b82f6',
|
||||
},
|
||||
{
|
||||
id: '4',
|
||||
name: 'Dining Hall Upgrade',
|
||||
startDate: addDays(today, 5),
|
||||
endDate: addDays(today, 18),
|
||||
progress: 0,
|
||||
status: 'not-started',
|
||||
parentId: '3',
|
||||
assignee: 'Construction Team A',
|
||||
},
|
||||
{
|
||||
id: '5',
|
||||
name: 'Lounge Area Remodeling',
|
||||
startDate: addDays(today, 10),
|
||||
endDate: addDays(today, 20),
|
||||
progress: 0,
|
||||
status: 'not-started',
|
||||
parentId: '3',
|
||||
assignee: 'Construction Team B',
|
||||
},
|
||||
{
|
||||
id: '6',
|
||||
name: 'Room Renovations',
|
||||
startDate: addDays(today, 21),
|
||||
endDate: addDays(today, 50),
|
||||
progress: 0,
|
||||
status: 'not-started',
|
||||
group: 'Phase 2',
|
||||
color: '#10b981',
|
||||
},
|
||||
{
|
||||
id: '7',
|
||||
name: 'Rooms 1-10',
|
||||
startDate: addDays(today, 21),
|
||||
endDate: addDays(today, 35),
|
||||
progress: 0,
|
||||
status: 'not-started',
|
||||
parentId: '6',
|
||||
assignee: 'Construction Team A',
|
||||
},
|
||||
{
|
||||
id: '8',
|
||||
name: 'Rooms 11-20',
|
||||
startDate: addDays(today, 36),
|
||||
endDate: addDays(today, 50),
|
||||
progress: 0,
|
||||
status: 'not-started',
|
||||
parentId: '6',
|
||||
assignee: 'Construction Team B',
|
||||
},
|
||||
{
|
||||
id: '9',
|
||||
name: 'Final Inspection',
|
||||
startDate: addDays(today, 51),
|
||||
endDate: addDays(today, 55),
|
||||
progress: 0,
|
||||
status: 'not-started',
|
||||
assignee: 'Inspections Dept',
|
||||
},
|
||||
{
|
||||
id: '10',
|
||||
name: 'Furniture Delivery',
|
||||
startDate: addDays(today, 56),
|
||||
endDate: addDays(today, 60),
|
||||
progress: 0,
|
||||
status: 'not-started',
|
||||
assignee: 'Logistics Team',
|
||||
},
|
||||
];
|
||||
|
||||
export const RENOVATION_DEPENDENCIES: TlGanttDependency[] = [
|
||||
{ fromTaskId: '1', toTaskId: '2' },
|
||||
{ fromTaskId: '2', toTaskId: '3' },
|
||||
{ fromTaskId: '3', toTaskId: '6' },
|
||||
{ fromTaskId: '7', toTaskId: '8' },
|
||||
{ fromTaskId: '6', toTaskId: '9' },
|
||||
{ fromTaskId: '9', toTaskId: '10' },
|
||||
];
|
||||
60
src/app/mock-data/timeline-data.ts
Normal file
60
src/app/mock-data/timeline-data.ts
Normal file
@@ -0,0 +1,60 @@
|
||||
import type { TlTimelineItem } from '@sda/timeline-elements-ui';
|
||||
|
||||
export const TENANCY_HISTORY: TlTimelineItem[] = [
|
||||
{
|
||||
id: '1',
|
||||
title: 'Tenancy Agreement Signed',
|
||||
description: 'John Doe signed 12-month tenancy agreement for Unit 24B',
|
||||
date: new Date('2024-01-15'),
|
||||
icon: 'file-text',
|
||||
status: 'completed',
|
||||
category: 'Legal',
|
||||
tags: ['contract', 'tenancy'],
|
||||
},
|
||||
{
|
||||
id: '2',
|
||||
title: 'Move-In Inspection',
|
||||
description: 'Property condition documented with photos',
|
||||
date: new Date('2024-01-20'),
|
||||
icon: 'clipboard',
|
||||
status: 'completed',
|
||||
category: 'Inspection',
|
||||
},
|
||||
{
|
||||
id: '3',
|
||||
title: 'First Rent Payment',
|
||||
description: 'Rent payment of $1,200 received',
|
||||
date: new Date('2024-02-01'),
|
||||
icon: 'dollar-sign',
|
||||
status: 'completed',
|
||||
category: 'Financial',
|
||||
},
|
||||
{
|
||||
id: '4',
|
||||
title: 'Maintenance Request',
|
||||
description: 'Tenant reported leaking faucet in bathroom',
|
||||
date: new Date('2024-03-10'),
|
||||
icon: 'tool',
|
||||
status: 'completed',
|
||||
category: 'Maintenance',
|
||||
tags: ['plumbing', 'urgent'],
|
||||
},
|
||||
{
|
||||
id: '5',
|
||||
title: 'Quarterly Inspection',
|
||||
description: 'Routine property inspection scheduled',
|
||||
date: new Date('2024-04-15'),
|
||||
icon: 'eye',
|
||||
status: 'active',
|
||||
category: 'Inspection',
|
||||
},
|
||||
{
|
||||
id: '6',
|
||||
title: 'Lease Renewal Reminder',
|
||||
description: 'Automated reminder sent to tenant',
|
||||
date: new Date('2024-12-15'),
|
||||
icon: 'bell',
|
||||
status: 'pending',
|
||||
category: 'Administrative',
|
||||
},
|
||||
];
|
||||
Reference in New Issue
Block a user