Adds support for completable task events

Enables marking scheduled events as complete based on a new "event-type" tag.

This change introduces the concept of "completable" events, specifically for events of type "task". It modifies the ScheduledEventCard component to:

- Display completion information only for completable events
- Show the "Mark Complete" button only for completable events that are not yet completed
- Adjust the opacity and strikethrough styling based on the event's completable and completed status.

The ScheduledEventService is updated to extract the event type from the "event-type" tag.
This commit is contained in:
padreug 2025-10-21 22:53:08 +02:00
parent 46418ef6fd
commit 661b700092
2 changed files with 12 additions and 6 deletions

View file

@ -15,6 +15,7 @@ export interface ScheduledEvent {
description?: string
location?: string
status: string
eventType?: string // 'task' for completable events, 'announcement' for informational
content: string
tags: string[][]
}
@ -76,6 +77,7 @@ export class ScheduledEventService extends BaseService {
const description = event.tags.find(tag => tag[0] === 'description')?.[1]
const location = event.tags.find(tag => tag[0] === 'location')?.[1]
const status = event.tags.find(tag => tag[0] === 'status')?.[1] || 'pending'
const eventType = event.tags.find(tag => tag[0] === 'event-type')?.[1]
if (!start) {
console.warn('Scheduled event missing start date:', event.id)
@ -96,6 +98,7 @@ export class ScheduledEventService extends BaseService {
description,
location,
status,
eventType,
content: event.content,
tags: event.tags
}