All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 3m10s
- OOB nav updates: AJAX navigation now swaps both menu bar levels (main nav highlighting + sub-nav with current page) using the same oob_header_sx/oob_page_sx pattern as blog/market/events - Enable OAuth for sx and test apps (removed from _NO_OAUTH, added sx to ALLOWED_CLIENTS, added app_urls for sx/test/orders) - Fetch real cross-service fragments (cart-mini, auth-menu, nav-tree) instead of hardcoding empty values - Add :selected param to ~menu-row-sx for white text current-page label - Fix duplicate element IDs: use menu-row-sx child_id/child mechanism instead of manual header_child_sx wrappers - Fix home page copy: "Server-rendered DOM over the wire (no HTML)" Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
59 lines
1.6 KiB
Python
59 lines
1.6 KiB
Python
from __future__ import annotations
|
|
import path_setup # noqa: F401
|
|
import sxc.sx_components as sx_components # noqa: F401
|
|
|
|
from shared.infrastructure.factory import create_base_app
|
|
|
|
from bp import register_pages
|
|
from services import register_domain_services
|
|
|
|
|
|
async def sx_docs_context() -> dict:
|
|
"""SX docs app context processor — fetches cross-service fragments."""
|
|
from quart import request, g
|
|
from shared.infrastructure.context import base_context
|
|
from shared.infrastructure.cart_identity import current_cart_identity
|
|
from shared.infrastructure.fragments import fetch_fragments
|
|
|
|
ctx = await base_context()
|
|
ctx["menu_items"] = []
|
|
|
|
ident = current_cart_identity()
|
|
user = getattr(g, "user", None)
|
|
|
|
cart_params = {}
|
|
if ident.get("user_id"):
|
|
cart_params["user_id"] = ident["user_id"]
|
|
if ident.get("session_id"):
|
|
cart_params["session_id"] = ident["session_id"]
|
|
|
|
auth_params = {"email": user.email} if user else None
|
|
|
|
cart_mini, auth_menu, nav_tree = await fetch_fragments([
|
|
("cart", "cart-mini", cart_params or None),
|
|
("account", "auth-menu", auth_params),
|
|
("blog", "nav-tree", {"app_name": "sx", "path": request.path}),
|
|
], required=False)
|
|
ctx["cart_mini"] = cart_mini
|
|
ctx["auth_menu"] = auth_menu
|
|
ctx["nav_tree"] = nav_tree
|
|
|
|
return ctx
|
|
|
|
|
|
def create_app() -> "Quart":
|
|
app = create_base_app(
|
|
"sx",
|
|
context_fn=sx_docs_context,
|
|
domain_services_fn=register_domain_services,
|
|
)
|
|
|
|
import sxc.sx_components # noqa: F401
|
|
|
|
app.register_blueprint(register_pages(url_prefix="/"))
|
|
|
|
return app
|
|
|
|
|
|
app = create_app()
|