# Dashboard report — 2026-11-10

**The dashboard is a Vue 3 + PrimeVue app, not React** (Vue and PrimeVue bundles in the network log). "React" in the brief was read as "the admin dashboard". Under test: https://joshen-dashboard.front.aait-d.com against https://joshen-back.elkady.aait-d.com (shared staging). Account: the provided test admin. Browser: Playwright Chromium; the Antigravity browser agent could not be used (launch denied by the permission classifier, not bypassed).

## Results

| Check | Result |
|---|---|
| Login with wrong password | API 422; page stayed on login. Message text not captured |
| Login with correct password | API 200, token and permissions stored, redirected to `/` (after a long blank load, see below) |
| 41 sidebar routes load | 41 / 41 loaded with heading and content |
| Console errors across 41 routes | 0 (the only error in the session was the intended wrong-password 422) |
| API calls with status >= 400 across 41 routes | 0 |
| Responsive: orders at 375 / 768 / 1440 px | no horizontal overflow at any width; at 375 px filters stack above the table |
| Order -> customer link | Link rendered as `/users/{profile uuid}`; the API proves that id gives 404 (QA-03). Clicking it on the hosted site was not done. **Backend fix now available, dashboard change still needed: see Remediation** |
| Time to settle | 6.7 - 31.4 s per page, median about 11 s (QA-NEW-02). First render after login was blank for more than 10 s |

Per page (all loaded, no errors): home 25.3 s, notifications 7.3, categories 12.1, main-services 18.4, packages 21.0 (empty table), orders 19.1 (15 rows), conversations 23.0, trips 7.6, joshan/searches 7.1, occasions 7.7, users 11.2, providers 9.0 (9 rows), drivers 7.0 (12), registration-requests 7.3, categories-requests 6.7 (empty), support-tickets 7.3 (9), contacts 11.4 (0 rows), cancellations 17.2, refunds 14.5, cancellation-rules 10.7, payments 14.8 (15), coupons 12.3 (4), payouts 19.2, commission-rules 7.1, ratings 9.4, reports 7.7, banners 7.9, featured-plans 16.7, featured-subscriptions 10.8, faqs 11.8, pages 13.2, onboarding-slides 18.1, countries 9.6, cities 10.8, districts 18.6, delivery-fee-rules 31.4, admins 10.6, roles 20.5, audit 8.1 (25), settings 9.0, feature-flags 7.2.

## Not tested

Every create / edit / delete form, validation messages, uploads, modals, filters and search interaction, sorting, pagination, exports, language/RTL switch, logout, session expiry, permission-driven menu hiding, the `++966` display, and the "scheduled/instant" label for package purchases. So there is **no UI -> API -> database -> UI** verification of any write action. This is a gap, not a pass.

## Bugs

No dashboard-only defect was found. Dashboard-related: QA-03 (contract), QA-08 (contract), QA-09 (label), QA-NEW-02 (slowness, layer not isolated). Evidence: the screenshots (orders at three widths, login-to-home) were removed from the repo at the owner's request to keep only Markdown files; the numbers above come from the scripted runs and are not re-attachable.

## Remediation (2026-11-10, backend side; nothing committed)

The dashboard source is not in this repository, so only the backend half could be done here. **No dashboard code was changed and the dashboard was not re-tested in a browser after these changes**; only the API responses it consumes were verified (fresh local seed).

| Item | Backend change (done, uncommitted) | What the dashboard team must do | Status |
|---|---|---|---|
| QA-03 order -> customer link 404 | `customer.user_id` now in order list and details, payments (and the customer filter list), conversations, cancellations, refunds and reviews. `customer.id` is unchanged. Verified: each `user_id` opens `GET /admin/users/{user_id}` (200) | Build customer links as `/users/{customer.user_id}` everywhere a customer is shown; keep `customer.id` only for `filters[customer_id]` | Backend **fixed**; dashboard **pending**; hosted server needs a deploy |
| QA-08 `++966` | No API change (would break integrated clients). Formats documented in API_CONVENTIONS section 4 (4.11.0): users and requests use `+966`, country catalogs use bare `966` | Add `+` only when the value does not already start with it | Documented; dashboard **pending** |
| QA-09 package purchase shows "scheduled" | None. The BRD has no label for it; working assumption in DECISIONS TD-185 (read `order_kind`; null `scheduled_at` means no appointment) | Show a neutral label when `order_kind` is `package_purchase` | Owner decision **open**; dashboard **pending** |
| QA-NEW-01 English field names in validation messages | 269 Arabic field labels and 76 message labels added; coupon, featured-plan, cancellation-rule and commission-rule forms covered. Verified live: coupon error bodies have no English | None. Forms will show the new Arabic messages as-is | Backend **fixed**; deploy needed |
| QA-NEW-02 slow pages (7-31 s) | None; not a code defect found in the API (local API calls answered in well under 3 s) | None until Ops finds the cause | **Open** (Ops) |
| QA-10 CORS | `CORS_ALLOWED_ORIGINS` / `CORS_MAX_AGE` read from the environment | Tell Ops the exact dashboard origin (`https://joshen-dashboard.front.aait-d.com`) | Backend **fixed**; env setting **pending** on each host |

Note on the earlier "(not tested)" list: it still stands. The write actions, forms, uploads, exports, logout and permission-driven menus have **not** been tested, so this report remains a smoke-level result, not a dashboard sign-off. Re-test after the deploy, starting with: order -> customer link, coupon form validation messages in Arabic, and the package-purchase label.

## Write-action testing (2026-11-11, hosted dashboard, FAQs module)

Done with Playwright in the real browser on https://joshen-dashboard.front.aait-d.com, using only records named `QA-`, and every result checked against the hosted API, not the toast.

| Action | UI | Request / response | Persistence (hosted API) |
|---|---|---|---|
| Open the add form, submit empty | Stays on the form | **No request sent** (client-side validation) | n/a |
| Create FAQ (4 required fields) | Redirect to list, success toast | `POST /admin/faqs` 201 | `GET /admin/faqs?search=QA-` returns the record with the typed Arabic text |
| Search "QA-" in the list | 1 row, URL gets `?keyword=QA-` | list request | consistent |
| Edit (form prefilled) | Redirect, toast | `PUT /admin/faqs/{id}` 200 | API shows English answer `QA-test answer EDITED` |
| Delete, press Cancel | Dialog closes, row stays | **No request** | unchanged |
| Delete, confirm | List refreshes, empty state | `DELETE /admin/faqs/{id}` 200 | `GET` returns 404; no `QA-` records left (cleanup done) |
| Coupon form, submit empty | Arabic messages next to the fields ("الرمز مطلوب", "نوع الخصم مطلوب", "قيمة الخصم مطلوب") | No request sent | n/a (no record created) |
| Logout | Confirmation dialog | `POST /admin/auth/logout` 200 | Token, permissions and profile removed from storage; `/orders` redirects to `/auth/login` |

Result: **create, search, edit, delete (with cancel), client-side validation and logout all work end to end for this module.** Every other module's write actions are still **not tested** in the browser (the FAQ module is only a representative sample).

New minor finding **QA-NEW-03 (P3, REACT):** the delete confirmation reads "هل أنت متأكد من حذف هذا **الملف**؟" ("delete this file") for an FAQ; the generic dialog text does not name the record type. Also seen: the success toast text is present in three DOM elements after a create (not confirmed as three visible toasts).

Not tested: file uploads, export (the list has a "تصدير" button), the other 40 modules' forms, role-restricted menus with a non-super-admin, session expiry, English/LTR switch.

## Full control crawl (2026-11-11, hosted dashboard, all 40 list pages + 16 add forms)

A scripted Playwright crawl visited every sidebar list page and, on each: recorded the toolbar, clicked the columns, grid/list and export buttons, opened every filter, clicked the first sortable header, tried the pagination control, opened the row action menu, and for pages with an "add" link opened the form and pressed حفظ empty. Console errors and API calls with status >= 400 were recorded per page.

| Result | Count |
|---|---|
| Pages crawled | 40 (plus `/` and the FAQ CRUD earlier) |
| Pages with console errors / failed API calls | **0** once the cache problem below is excluded |
| Add forms opened and submitted empty | 16 (categories, main services, occasions, cancellation rules, coupons, commission rules, banners, FAQs, pages, onboarding slides, countries, cities, districts, delivery-fee rules, admins, roles) |
| Of those: client-side validation, Arabic messages, **no request sent** | 16 of 16 (1 shows a raw key, see QA-NEW-05) |
| Filters opened | about 60 across lists, each showing its options (for example providers: account status 6, type 3, city 6, accepting bookings 3, instant 3) |
| Load time to settle | first batch 20-70 s, later batches 10-25 s (hosted environment, still slow) |

**New findings**
- **QA-NEW-04 (P2, infrastructure):** after a redeploy, `/orders` and `/trips` rendered blank with "Failed to fetch dynamically imported module" because the browser held the previous build and the old chunk answers 200 text/html. Clearing the cache fixed it. Evidence and fix in `BUG_REGISTER.md`.
- **QA-NEW-05 (P3):** the Admins add form shows the raw label key `LABELS.role_id`.
- **QA-NEW-03 (P3):** delete dialog says "file".

**Observations that the crawl could not settle (not counted as pass or fail)**
- Clicking the columns, grid/list and export buttons produced no error and no network request; my menu detector did not recognise their popovers, so their behaviour (what the columns menu offers, whether export downloads a file) is **not verified**.
- Clicking the first column header never sent a `sort` request on any list, and every list fitted on one page, so server-side sorting and page 2 were **not exercised** from the UI.
- The row action menus opened (the FAQ one showed Edit and Delete) but the crawler's item capture was empty on most lists, so those menus were verified only on FAQs.
- `/featured-plans/form`, the feature-flags "add" button (not a link), the 40 pages' detail views and every form's successful save are **not** covered except FAQs (see the write-action section above).
- Stored script-like text rendering was not tested.
