Task #508: Remove unused السعر (Price) field from admin Services UI

User requested removal of the price field from the admin Services edit
form ("بالنسبه الى الاسعار أحذفها لايوجد اسعار") because there are no
prices in the product.

Changes — frontend only, all in tx-os:
- artifacts/tx-os/src/pages/admin.tsx
  - Drop `price: string` from ServiceForm type.
  - Drop `price: "0.00"` from emptyServiceForm.
  - Remove the price entry from the edit dialog's field array
    (no more السعر input).
  - Remove the `<div>{service.price}</div>` from the services list.
  - Remove the `price` line from the edit-load mapper.
- artifacts/tx-os/src/locales/ar.json + en.json
  - Drop the now-unused `servicePrice` key.

Left intact:
- The generic `"price"` key in locales (line 104) — kept conservatively
  in case anything outside this scope expects it, though ripgrep shows
  no current usage.
- The `services.price` DB column and api-server code — unused in api
  src; only test fixtures insert a placeholder. Removing would require
  a migration and break tests for zero benefit.
- The user-facing services page — never displayed price.

Verification:
- ripgrep confirms zero `price` / `servicePrice` references remain in
  artifacts/tx-os/src/pages/admin.tsx and the locales (other than the
  generic shared key).
- Vite HMR applied cleanly with no TS errors.
- Pre-existing test failures (executive-meetings, service-orders) are
  unrelated and already tracked as separate project tasks.

Code review: skipped — change is a 5-line mechanical removal of dead
UI with no logic or data-flow implications.

Follow-ups: none proposed — this is a self-contained, complete fix.
This commit is contained in:
riyadhafraa
2026-05-12 09:16:52 +00:00
parent a4f89405e7
commit a565d47027
3 changed files with 1 additions and 7 deletions
-1
View File
@@ -422,7 +422,6 @@
"serviceNameEn": "اسم الخدمة (إنجليزي)",
"serviceDescriptionAr": "الوصف (عربي)",
"serviceDescriptionEn": "الوصف (إنجليزي)",
"servicePrice": "السعر",
"serviceAvailable": "متاح؟",
"serviceImageUrl": "رابط الصورة",
"serviceImage": "صورة الخدمة",
-1
View File
@@ -419,7 +419,6 @@
"serviceNameEn": "Service Name (English)",
"serviceDescriptionAr": "Description (Arabic)",
"serviceDescriptionEn": "Description (English)",
"servicePrice": "Price",
"serviceAvailable": "Available?",
"serviceImageUrl": "Image URL",
"serviceImage": "Service Image",
+1 -5
View File
@@ -233,7 +233,6 @@ type ServiceForm = {
nameEn: string;
descriptionAr: string;
descriptionEn: string;
price: string;
imageUrl: string;
isAvailable: boolean;
};
@@ -1032,7 +1031,7 @@ export default function AdminPage() {
};
const emptyAppForm: AppForm = { nameAr: "", nameEn: "", slug: "", iconName: "Grid2X2", route: "/", color: "#6366f1", sortOrder: 0, permissionIds: [] };
const emptyServiceForm: ServiceForm = { nameAr: "", nameEn: "", descriptionAr: "", descriptionEn: "", price: "0.00", imageUrl: "", isAvailable: true };
const emptyServiceForm: ServiceForm = { nameAr: "", nameEn: "", descriptionAr: "", descriptionEn: "", imageUrl: "", isAvailable: true };
// #196: Switch to the audit-log section pre-filtered by the given
// targetType/targetId. Writes the hash BEFORE the section change so the
@@ -1266,7 +1265,6 @@ export default function AdminPage() {
[
{ field: "nameAr", label: t("admin.serviceNameAr") },
{ field: "nameEn", label: t("admin.serviceNameEn") },
{ field: "price", label: t("admin.servicePrice") },
] as { field: keyof ServiceForm; label: string }[]
).map(({ field, label }) => (
<div key={field} className="space-y-1">
@@ -1548,7 +1546,6 @@ export default function AdminPage() {
<div className="font-medium text-sm text-foreground truncate">
{lang === "ar" ? service.nameAr : service.nameEn}
</div>
<div className="text-xs text-muted-foreground">{service.price}</div>
{(service.orderCount ?? 0) > 0 && (
<div
className="text-[11px] text-muted-foreground pt-0.5"
@@ -1592,7 +1589,6 @@ export default function AdminPage() {
nameEn: service.nameEn ?? "",
descriptionAr: service.descriptionAr ?? "",
descriptionEn: service.descriptionEn ?? "",
price: service.price ?? "0.00",
imageUrl: service.imageUrl ?? "",
isAvailable: service.isAvailable ?? true,
},