feat: Add event automation system for plugins attached to appointments
- Add GlobalEventPlugin model for auto-attaching plugins to all events - Create signals for auto-attachment on new events and rescheduling - Add API endpoints for global event plugins (CRUD, toggle, reapply) - Update CreateTaskModal with "Scheduled Task" vs "Event Automation" choice - Add option to apply to all events or future events only - Display event automations in Tasks page alongside scheduled tasks - Add EditEventAutomationModal for editing trigger and timing - Handle event reschedule - update Celery task timing on time/duration changes - Add Marketplace to Plugins menu in sidebar 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -18,7 +18,9 @@ import {
|
||||
Bot,
|
||||
Package as PackageIcon,
|
||||
X,
|
||||
AlertTriangle
|
||||
AlertTriangle,
|
||||
Clock,
|
||||
Settings
|
||||
} from 'lucide-react';
|
||||
import api from '../api/client';
|
||||
import { PluginInstallation, PluginCategory } from '../types';
|
||||
@@ -377,6 +379,27 @@ const MyPlugins: React.FC = () => {
|
||||
|
||||
{/* Actions */}
|
||||
<div className="flex items-center gap-2 ml-4">
|
||||
{/* Schedule button - only if not already scheduled */}
|
||||
{!plugin.scheduledTaskId && (
|
||||
<button
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
navigate('/tasks');
|
||||
}}
|
||||
className="flex items-center gap-2 px-3 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors text-sm font-medium"
|
||||
title={t('plugins.schedule', 'Schedule')}
|
||||
>
|
||||
<Clock className="h-4 w-4" />
|
||||
{t('plugins.schedule', 'Schedule')}
|
||||
</button>
|
||||
)}
|
||||
{/* Already scheduled indicator */}
|
||||
{plugin.scheduledTaskId && (
|
||||
<span className="flex items-center gap-1.5 px-3 py-2 bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-300 rounded-lg text-sm font-medium">
|
||||
<Clock className="h-4 w-4" />
|
||||
{t('plugins.scheduled', 'Scheduled')}
|
||||
</span>
|
||||
)}
|
||||
{plugin.hasUpdate && (
|
||||
<button
|
||||
onClick={(e) => {
|
||||
|
||||
Reference in New Issue
Block a user