Phase 14 complete (2 plans):
- 14-01: CRUD szablonów, Quill.js editor, system zmiennych {{grupa.pole}}, podgląd, toggle
- 14-02: Select "Załącznik nr 1" z mapą ATTACHMENT_TYPES, kolumna w liście, migracja attachment_1
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
89 lines
2.7 KiB
Markdown
89 lines
2.7 KiB
Markdown
---
|
|
phase: 14-email-templates
|
|
plan: 01
|
|
subsystem: database, ui
|
|
tags: [email, templates, quill, variables, crud]
|
|
|
|
requires:
|
|
- phase: 13-email-mailboxes
|
|
provides: Tabele email_mailboxes, email_templates, email_logs + SMTP CRUD
|
|
provides:
|
|
- CRUD szablonów e-mail z Quill.js
|
|
- System zmiennych {{grupa.pole}} z podglądem
|
|
- Toggle status (AJAX) + usuwanie z potwierdzeniem
|
|
affects: [14-email-templates/14-02, 15-email-sending]
|
|
|
|
tech-stack:
|
|
added: [quill.js 2.0.3 CDN]
|
|
patterns: [VARIABLE_GROUPS const, resolveVariables regex, Quill.js rich text]
|
|
|
|
key-files:
|
|
created:
|
|
- src/Modules/Settings/EmailTemplateController.php
|
|
- src/Modules/Settings/EmailTemplateRepository.php
|
|
- resources/views/settings/email-templates.php
|
|
modified:
|
|
- resources/views/layouts/app.php
|
|
- routes/web.php
|
|
- resources/scss/app.scss
|
|
|
|
key-decisions:
|
|
- "Quill.js CDN zamiast npm — brak build pipeline w projekcie"
|
|
- "VARIABLE_GROUPS jako stała w kontrolerze — centralna definicja zmiennych"
|
|
- "Namespace fixes: AuthService → App\\Modules\\Auth, Flash → App\\Core\\Support"
|
|
|
|
duration: ~45min
|
|
started: 2026-03-16
|
|
completed: 2026-03-16
|
|
---
|
|
|
|
# Phase 14 Plan 01: CRUD szablonów e-mail z Quill.js — Summary
|
|
|
|
**Pełny CRUD szablonów e-mail z edytorem Quill.js, systemem zmiennych {{grupa.pole}}, podglądem, toggle statusu i linkiem w sidebarze.**
|
|
|
|
## Performance
|
|
|
|
| Metric | Value |
|
|
|--------|-------|
|
|
| Duration | ~45min |
|
|
| Completed | 2026-03-16 |
|
|
| Tasks | 3 completed (2 auto + 1 checkpoint) |
|
|
| Files modified | 6 |
|
|
|
|
## Acceptance Criteria Results
|
|
|
|
| Criterion | Status | Notes |
|
|
|-----------|--------|-------|
|
|
| CRUD szablonów | Pass | Lista, dodawanie, edycja, usuwanie |
|
|
| Quill.js editor | Pass | Rich text z toolbar |
|
|
| System zmiennych | Pass | Panel z grupami, wstawianie do edytora |
|
|
| Podgląd z rozwiązanymi zmiennymi | Pass | AJAX preview z sample data |
|
|
| Toggle aktywności | Pass | AJAX bez przeładowania |
|
|
|
|
## Accomplishments
|
|
|
|
- EmailTemplateController + EmailTemplateRepository (pełny CRUD)
|
|
- Quill.js 2.0.3 rich text editor z toolbar
|
|
- System zmiennych: 4 grupy (zamówienie, kupujący, adres, firma) z 16 zmiennymi
|
|
- Podgląd szablonu z rozwiązanymi zmiennymi (sample data)
|
|
- AJAX toggle statusu + usuwanie z OrderProAlerts.confirm
|
|
|
|
## Deviations from Plan
|
|
|
|
### Auto-fixed Issues
|
|
|
|
**1. Namespace bugs**
|
|
- AuthService: `App\Core\Auth\AuthService` → `App\Modules\Auth\AuthService`
|
|
- Flash: `App\Core\Session\Flash` → `App\Core\Support\Flash`
|
|
- Odkryte podczas testów na serwerze, naprawione natychmiast
|
|
|
|
## Next Phase Readiness
|
|
|
|
**Ready:**
|
|
- Szablony gotowe do rozszerzenia o załączniki (plan 14-02)
|
|
- resolveVariables() gotowy do użycia w fazie 15
|
|
|
|
---
|
|
*Phase: 14-email-templates, Plan: 01*
|
|
*Completed: 2026-03-16*
|