feat(120): alert component unification

Phase 120 - Plan 01:
- Reusable PHP alert component (resources/views/components/alert.php)
  with inline SVG icon per type, optional dismiss button.
- Missing .alert--info SCSS variant added (#eff6ff/#bfdbfe/#1e3a8a) -
  fixes black-on-white alert after Fakturownia test connection.
- Flash::push(type, message) + Flash::all() with BC for set/get;
  legacy key heuristic (error/.save/warning -> typed entries).
- Central flash renderer in 3 layouts (app/auth/public) iterating
  Flash::all() through component (.alerts-stack wrap).
- Vanilla JS alert-dismiss.js with idempotent guard and delegated
  click handler on [data-alert-dismiss].
- 36 views migrated off inline <div class="alert alert--TYPE">;
  .flash--error/success removed from views (orders/show, shipments/prepare).
- SCSS rebuilt: public/assets/css/{app,login}.css.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-12 18:47:41 +02:00
parent 3a2c419c25
commit 933dfcc67b
51 changed files with 1109 additions and 210 deletions

View File

@@ -11,6 +11,16 @@
- Dodano klienta SMSPLANET (`POST https://api2.smsplanet.pl/sms`) z obsluga Bearer token oraz `key` + `password`, bez parametru `test=1` dla testow realnych.
- Poprawiono uklad checkboxow i radio buttonow na ekranie integracji SMSPLANET przez wspolny komponent SCSS.
- Odnotowano blokery weryfikacji: lokalny MySQL odmawial polaczenia, `vendor\bin\phpunit` i `sonar-scanner` nie byly dostepne.
- [Phase 119, Plan 01] Re-import zamowien chroni `total_paid` przed nadpisaniem gdy `payment_status` sie nie zmienia (incydent #976: operator zwrocil 28,00 PLN klientowi).
- `OrderImportRepository::updateOrderDelta()` przepisane na dynamic SET builder z warunkowymi `total_paid` i `is_canceled_by_buyer`; cancel propagation ze zrodla nadal wymusza wpis flagi.
- Test PHPUnit `tests/Unit/OrderImportRepositoryTest.php` z 3 scenariuszami (preserve / transition / cancel) - syntax-checked, run odroczony do `composer install`.
- Operacyjnie: zamowienie #976 poprawione recznie w bazie (delete pozycji Girlanda, total_with_tax/total_paid 119->91, wpis do `order_activity_log`).
- [Phase 120, Plan 01] Ujednolicony moduł alertów: reusable komponent PHP `components/alert.php` z ikoną SVG i dismiss, brakujący wariant `.alert--info` (#eff6ff/#bfdbfe/#1e3a8a) - naprawa czarnego tekstu po teście Fakturowni.
- `Flash::push(type, message)` + `Flash::all()` z BC dla `set/get`; heurystyka klucza legacy (error/.save/warning/success).
- Centralny renderer flash w layoutach `app.php`, `auth.php`, `public.php` (foreach Flash::all() → component) - przyszłe `Flash::push()` zadziała bez ifów w widokach.
- Vanilla JS `alert-dismiss.js` z idempotent guardem + delegated click handlerem.
- 36 widoków zmigrowanych z inline `<div class="alert alert--TYPE">` / `.flash--*` na komponent (34 z planu + odkryte `orders/show.php` i `shipments/prepare.php`).
- CSS przebudowane via `npx sass --style=compressed`: `public/assets/css/app.css` (63 560 B), `login.css` (7 409 B).
## Zmienione pliki
@@ -42,3 +52,49 @@
- `src/Modules/Settings/SmsplanetApiClient.php`
- `src/Modules/Settings/SmsplanetIntegrationController.php`
- `src/Modules/Settings/SmsplanetIntegrationRepository.php`
- `.paul/phases/119-reimport-total-paid-protection/119-01-PLAN.md`
- `.paul/phases/119-reimport-total-paid-protection/119-01-SUMMARY.md`
- `src/Modules/Orders/OrderImportRepository.php`
- `tests/Unit/OrderImportRepositoryTest.php`
- `.paul/phases/120-alert-component-unification/120-01-PLAN.md`
- `.paul/phases/120-alert-component-unification/120-01-SUMMARY.md`
- `resources/views/components/alert.php`
- `public/assets/js/modules/alert-dismiss.js`
- `resources/scss/shared/_ui-components.scss`
- `public/assets/css/app.css`
- `public/assets/css/login.css`
- `src/Core/Support/Flash.php`
- `resources/views/layouts/app.php`
- `resources/views/layouts/auth.php`
- `resources/views/layouts/public.php`
- `resources/views/settings/fakturownia.php`
- `resources/views/settings/accounting-invoice-edit.php`
- `resources/views/settings/accounting-receipt-edit.php`
- `resources/views/settings/accounting-receipts.php`
- `resources/views/settings/accounting-invoices.php`
- `resources/views/settings/accounting.php`
- `resources/views/settings/allegro.php`
- `resources/views/settings/apaczka.php`
- `resources/views/settings/company.php`
- `resources/views/settings/cron.php`
- `resources/views/settings/database.php`
- `resources/views/settings/delivery-status-form.php`
- `resources/views/settings/delivery-statuses.php`
- `resources/views/settings/email-mailboxes.php`
- `resources/views/settings/email-templates.php`
- `resources/views/settings/email-templates-form.php`
- `resources/views/settings/integrations.php`
- `resources/views/settings/printing.php`
- `resources/views/settings/project-mappings.php`
- `resources/views/settings/shoppro.php`
- `resources/views/settings/statuses.php`
- `resources/views/orders/list.php`
- `resources/views/orders/show.php`
- `resources/views/orders/receipt-create.php`
- `resources/views/shipments/prepare.php`
- `resources/views/accounting/invoice_form.php`
- `resources/views/automation/index.php`
- `resources/views/automation/form.php`
- `resources/views/users/index.php`
- `resources/views/statistics/orders.php`
- `resources/views/auth/login.php`