feat(04-cookie-notice-bugfix): fix CookieNoticePro injectScripts error
Phase 4 complete: - remove undefined injectScripts calls from CookieNoticePro - preserve Consent Mode v2 and GTM integration - add PAUL plan, summary, and changelog
This commit is contained in:
130
.paul/phases/04-cookie-notice-bugfix/04-01-PLAN.md
Normal file
130
.paul/phases/04-cookie-notice-bugfix/04-01-PLAN.md
Normal file
@@ -0,0 +1,130 @@
|
||||
---
|
||||
phase: 04-cookie-notice-bugfix
|
||||
plan: 01
|
||||
type: execute
|
||||
wave: 1
|
||||
depends_on: []
|
||||
files_modified:
|
||||
- libraries/CookieNoticePro/cookienoticepro.script.js
|
||||
autonomous: true
|
||||
delegation: off
|
||||
---
|
||||
|
||||
<objective>
|
||||
## Goal
|
||||
Naprawic blad JavaScript `Uncaught ReferenceError: injectScripts is not defined` w CookieNoticePro.
|
||||
|
||||
## Purpose
|
||||
Baner cookies musi dzialac bez bledow konsoli, bo kontroluje zgody RODO i Google Consent Mode v2 przed uruchamianiem analityki.
|
||||
|
||||
## Output
|
||||
Zmodyfikowany `libraries/CookieNoticePro/cookienoticepro.script.js` bez wywolan nieistniejacej funkcji `injectScripts()`.
|
||||
</objective>
|
||||
|
||||
<context>
|
||||
<clarifications>
|
||||
- No clarifications needed - blad jest jednoznaczny: `injectScripts()` jest wywolywane w `cookienoticepro.script.js`, ale nie jest zdefiniowane w tej kopii biblioteki.
|
||||
</clarifications>
|
||||
|
||||
## Project Context
|
||||
@.paul/PROJECT.md
|
||||
@.paul/ROADMAP.md
|
||||
@.paul/STATE.md
|
||||
|
||||
## Prior Work
|
||||
@.paul/phases/03-cookie-consent/03-01-SUMMARY.md
|
||||
|
||||
## Source Files
|
||||
@libraries/CookieNoticePro/cookienoticepro.script.js
|
||||
@templates/site/layout-logged.php
|
||||
</context>
|
||||
|
||||
<acceptance_criteria>
|
||||
|
||||
## AC-1: Brak ReferenceError przy akceptacji cookies
|
||||
```gherkin
|
||||
Given strona laduje CookieNoticePro i baner jest widoczny
|
||||
When uzytkownik klika "Akceptuj"
|
||||
Then konsola przegladarki nie pokazuje `ReferenceError: injectScripts is not defined`
|
||||
```
|
||||
|
||||
## AC-2: Brak ReferenceError przy zapisanych zgodach
|
||||
```gherkin
|
||||
Given przegladarka ma zapisane cookies `cnp_consent` i `cnp_prefs`
|
||||
When strona inicjalizuje `cookieNoticePro.init()`
|
||||
Then konsola przegladarki nie pokazuje `ReferenceError: injectScripts is not defined`
|
||||
```
|
||||
|
||||
## AC-3: Consent Mode pozostaje aktywny
|
||||
```gherkin
|
||||
Given uzytkownik akceptuje lub aktualizuje preferencje cookies
|
||||
When CookieNoticePro zapisuje preferencje
|
||||
Then `googleConsentModeHandler()` nadal aktualizuje `analytics_storage` oraz zgody reklamowe zgodnie z preferencjami
|
||||
```
|
||||
|
||||
</acceptance_criteria>
|
||||
|
||||
<tasks>
|
||||
|
||||
<task type="auto">
|
||||
<name>Task 1: Usun wywolania nieistniejacego injectScripts</name>
|
||||
<files>libraries/CookieNoticePro/cookienoticepro.script.js</files>
|
||||
<action>
|
||||
Usun lub zastap bezpiecznie dwa wywolania `injectScripts()`:
|
||||
- w handlerze klikniecia `#cookieAccept`
|
||||
- w galezi dla juz zapisanej zgody
|
||||
|
||||
Zachowaj wywolania `config.onConsentAccept.call(this)` i `googleConsentModeHandler()`.
|
||||
Nie dodawaj pustej globalnej funkcji jako obejscia, bo maskowaloby to blad integracji biblioteki bez rzeczywistej potrzeby w projekcie.
|
||||
</action>
|
||||
<verify>rg -n "injectScripts" libraries/CookieNoticePro/cookienoticepro.script.js zwraca brak wynikow</verify>
|
||||
<done>AC-1 i AC-2 satisfied: CookieNoticePro nie odwoluje sie do niezdefiniowanej funkcji.</done>
|
||||
</task>
|
||||
|
||||
<task type="auto">
|
||||
<name>Task 2: Zweryfikuj skladnie i sciezke inicjalizacji</name>
|
||||
<files>libraries/CookieNoticePro/cookienoticepro.script.js, templates/site/layout-logged.php</files>
|
||||
<action>
|
||||
Sprawdz, ze po zmianie plik JavaScript nadal jest parsowalny, a `templates/site/layout-logged.php` dalej laduje biblioteke i wywoluje `cookieNoticePro.init()`.
|
||||
Nie zmieniaj snippetow GTM ani domyslnych ustawien Consent Mode v2 w layoutcie.
|
||||
</action>
|
||||
<verify>node --check libraries/CookieNoticePro/cookienoticepro.script.js; rg -n "cookieNoticePro.init|Google Consent Mode v2|GTM-TW9WCD9J" templates/site/layout-logged.php</verify>
|
||||
<done>AC-3 satisfied: mechanizm zgody pozostaje podlaczony, a plik JS przechodzi walidacje skladni.</done>
|
||||
</task>
|
||||
|
||||
</tasks>
|
||||
|
||||
<boundaries>
|
||||
|
||||
## DO NOT CHANGE
|
||||
- `templates/site/layout-logged.php` poza ewentualna weryfikacja; nie zmieniac GTM ani Consent Mode v2.
|
||||
- `libraries/CookieNoticePro/cookienoticepro.style.css`.
|
||||
- Checkout, order flow, data layer purchase i integracja Przelewy24.
|
||||
- Baza danych i konfiguracja serwera.
|
||||
|
||||
## SCOPE LIMITS
|
||||
- Plan dotyczy tylko bledu `injectScripts is not defined`.
|
||||
- Nie aktualizowac calej biblioteki CookieNoticePro.
|
||||
- Nie dodawac nowych zaleznosci frontendowych.
|
||||
|
||||
</boundaries>
|
||||
|
||||
<verification>
|
||||
Before declaring plan complete:
|
||||
- [ ] `rg -n "injectScripts" libraries/CookieNoticePro/cookienoticepro.script.js` returns no results.
|
||||
- [ ] `node --check libraries/CookieNoticePro/cookienoticepro.script.js` passes.
|
||||
- [ ] `rg -n "cookieNoticePro.init|Google Consent Mode v2|GTM-TW9WCD9J" templates/site/layout-logged.php` confirms existing integration remains present.
|
||||
- [ ] Browser console has no `ReferenceError: injectScripts is not defined` after accepting cookies and after reload with saved consent.
|
||||
- [ ] All acceptance criteria met.
|
||||
</verification>
|
||||
|
||||
<success_criteria>
|
||||
- CookieNoticePro does not call undefined functions.
|
||||
- Consent Mode v2 updates still run after preference changes.
|
||||
- No unrelated files or flows are modified.
|
||||
- Summary created after apply.
|
||||
</success_criteria>
|
||||
|
||||
<output>
|
||||
After completion, create `.paul/phases/04-cookie-notice-bugfix/04-01-SUMMARY.md`.
|
||||
</output>
|
||||
Reference in New Issue
Block a user