fix: A27 phase 2c — database_table 1 314 L, extraction A27 terminée (v7.24.0)
- `_database_table_scripts.html` → `static/js/database_table.js` (1 314 L).
Le Jinja du bloc était confiné à la construction de l'objet de config
(4 clés + `{% if collection_data %}`) → config JSON `#db-config`
null-vs-objet : `new DBInstance(container, PAGE_COLLECTION_ID, DB_CONFIG)`
remplace les 2 branches Jinja (le `else` était déjà un literal null).
- Loader DB_CONFIG : JSON.parse du bloc, `null` si absent (parité stricte
avec le else d'origine) ; acrlade try corrigée par node --check avant
commit.
- 2 tests adaptés (lisaient le template source → static/js/database_table.js)
; `FlowDeckDB` / `db-board` / `db-cal-grid` / `db-gallery` plus dans le
HTML → asserts sur le JS extrait.
BILAN A27 : 11 874 L extraites en 4 phases (4 243 + 2 516 + 3 801 + 1 314),
inline 13 904 → 2 022 L (-85 %), 22 fichiers static/js/*.js, node --check
vert partout, eslint 0 erreur / 285 warnings. Reste : base 1 523 L
structurel ({% block %}/{% for %} — inline par nature), ~500 L de petits
blocs hors cibles, nettoyage des 285 warnings.
suite **1089/1089** · ruff OK · docs à jour
This commit is contained in:
@@ -294,7 +294,7 @@ def test_editor_has_autocomplete(client):
|
||||
|
||||
|
||||
def test_database_has_ai_properties(client):
|
||||
src = _read_template("_database_table_scripts.html")
|
||||
src = _read_js("database_table.js")
|
||||
assert "db-ai-fill-btn" in src
|
||||
assert "aiFillRow" in src
|
||||
assert "/api/agent/writing/properties" in src
|
||||
|
||||
@@ -8,6 +8,7 @@ from __future__ import annotations
|
||||
|
||||
import json
|
||||
import os
|
||||
import pathlib
|
||||
import secrets
|
||||
import tempfile
|
||||
|
||||
@@ -273,8 +274,10 @@ def test_collection_page_renders_multi_view(client):
|
||||
resp = client.get(f"/pages/{page}", cookies={"flowdeck_session": cookie})
|
||||
assert resp.status_code == 200
|
||||
assert "db-view-bar" in resp.text
|
||||
assert "FlowDeckDB" in resp.text
|
||||
# New view types + settings are available client-side.
|
||||
assert "db-board" in resp.text
|
||||
assert "db-cal-grid" in resp.text
|
||||
assert "db-gallery" in resp.text
|
||||
# (A27 : le JS de la DB est extrait dans static/js/database_table.js.)
|
||||
src = pathlib.Path("static/js/database_table.js").read_text(encoding="utf-8")
|
||||
assert "FlowDeckDB" in src
|
||||
assert "db-board" in src
|
||||
assert "db-cal-grid" in src
|
||||
assert "db-gallery" in src
|
||||
|
||||
@@ -417,7 +417,7 @@ def test_notification_prefs_extended_keys(client):
|
||||
|
||||
def test_calendar_front_end_wired(client):
|
||||
import pathlib
|
||||
src = pathlib.Path("app/templates/_database_table_scripts.html").read_text(encoding="utf-8")
|
||||
src = pathlib.Path("static/js/database_table.js").read_text(encoding="utf-8")
|
||||
assert "calendar/api" in src
|
||||
assert "data-cal-mode" in src and "refreshCalendar" in src
|
||||
assert "openEventEditor" in src and "__recurrence__" in src and "__reminder__" in src
|
||||
|
||||
Reference in New Issue
Block a user