From ad28a8a9a37d81acc4fa33b48af5cdf4bae5b47a Mon Sep 17 00:00:00 2001 From: Samir Boulahtit Date: Sat, 3 Jan 2026 21:47:23 +0100 Subject: [PATCH] fix: resolve FE-003 and AUTH-004 architecture violations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Use error_state macro in vendor dashboard instead of inline HTML - Add # authenticated marker to shop profile/addresses endpoints 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- app/api/v1/shop/addresses.py | 2 +- app/api/v1/shop/profile.py | 2 +- app/templates/vendor/dashboard.html | 80 ++++++++++++----------------- 3 files changed, 34 insertions(+), 50 deletions(-) diff --git a/app/api/v1/shop/addresses.py b/app/api/v1/shop/addresses.py index 76a78adc..07267e70 100644 --- a/app/api/v1/shop/addresses.py +++ b/app/api/v1/shop/addresses.py @@ -28,7 +28,7 @@ router = APIRouter() logger = logging.getLogger(__name__) -@router.get("/addresses", response_model=CustomerAddressListResponse) +@router.get("/addresses", response_model=CustomerAddressListResponse) # authenticated def list_addresses( request: Request, customer: Customer = Depends(get_current_customer_api), diff --git a/app/api/v1/shop/profile.py b/app/api/v1/shop/profile.py index 32d76086..f9ed6604 100644 --- a/app/api/v1/shop/profile.py +++ b/app/api/v1/shop/profile.py @@ -30,7 +30,7 @@ router = APIRouter() logger = logging.getLogger(__name__) -@router.get("/profile", response_model=CustomerResponse) +@router.get("/profile", response_model=CustomerResponse) # authenticated def get_profile( customer: Customer = Depends(get_current_customer_api), db: Session = Depends(get_db), diff --git a/app/templates/vendor/dashboard.html b/app/templates/vendor/dashboard.html index 662f8516..9ad7204f 100644 --- a/app/templates/vendor/dashboard.html +++ b/app/templates/vendor/dashboard.html @@ -1,6 +1,8 @@ {# app/templates/vendor/dashboard.html #} {% extends "vendor/base.html" %} {% from "shared/macros/feature_gate.html" import limit_warning, usage_bar, upgrade_card, tier_badge %} +{% from "shared/macros/alerts.html" import loading_state, error_state %} +{% from "shared/macros/tables.html" import table_wrapper, table_header %} {% block title %}Dashboard{% endblock %} @@ -12,6 +14,7 @@ {{ limit_warning("products") }} +{# noqa: FE-007 - Custom header with tier_badge alongside title #}

@@ -31,19 +34,10 @@

-
- -

Loading dashboard...

-
+{{ loading_state('Loading dashboard...') }} -
- -
-

Error loading dashboard

-

-
-
+{{ error_state('Error loading dashboard') }} {% include 'vendor/partials/vendor_info.html' %} @@ -128,44 +122,34 @@
-
-
- - - - - - - - +
+ {% call table_wrapper() %} + {{ table_header(['Order ID', 'Customer', 'Amount', 'Status', 'Date']) }} +
+ + + {% endcall %}
Order IDCustomerAmountStatusDate