From 0704729e115d3011db09649d6f7603bbebb2a600 Mon Sep 17 00:00:00 2001 From: Flatlogic Bot Date: Wed, 1 Apr 2026 19:44:21 +0000 Subject: [PATCH] Autosave: 20260401-194421 --- frontend/lint-final.log | 10 + frontend/src/components/CardBoxModal.tsx | 2 +- .../components/Categories/CardCategories.tsx | 6 +- .../components/Categories/ListCategories.tsx | 6 +- .../components/Categories/TableCategories.tsx | 40 +- .../Categories/configureCategoriesCols.tsx | 4 +- .../src/components/KanbanBoard/KanbanCard.tsx | 2 +- .../src/components/ListActionsPopover.tsx | 7 +- .../src/components/PasswordSetOrReset.tsx | 20 +- .../src/components/Products/CardProducts.tsx | 22 +- .../src/components/Products/ListProducts.tsx | 22 +- .../src/components/Products/TableProducts.tsx | 42 +- .../Products/configureProductsCols.tsx | 22 +- .../CardSales_invoice_items.tsx | 2 +- .../ListSales_invoice_items.tsx | 2 +- .../configureSales_invoice_itemsCols.tsx | 2 +- .../Sales_invoices/CardSales_invoices.tsx | 26 +- .../Sales_invoices/ListSales_invoices.tsx | 26 +- .../Sales_invoices/TableSales_invoices.tsx | 66 +- .../configureSales_invoicesCols.tsx | 24 +- frontend/src/components/Search.tsx | 8 +- frontend/src/components/Shops/CardShops.tsx | 14 +- frontend/src/components/Shops/ListShops.tsx | 14 +- frontend/src/components/Shops/TableShops.tsx | 38 +- .../components/Shops/configureShopsCols.tsx | 12 +- frontend/src/helpers/salesInvoiceLabels.ts | 23 + frontend/src/layouts/Authenticated.tsx | 2 +- frontend/src/menuAside.ts | 97 +-- frontend/src/pages/cashier.tsx | 5 +- .../src/pages/categories/[categoriesId].tsx | 20 +- .../src/pages/categories/categories-edit.tsx | 20 +- .../src/pages/categories/categories-list.tsx | 20 +- .../src/pages/categories/categories-new.tsx | 20 +- .../src/pages/categories/categories-table.tsx | 22 +- .../src/pages/categories/categories-view.tsx | 72 +- frontend/src/pages/dashboard.tsx | 753 ++++++++---------- frontend/src/pages/forgot.tsx | 16 +- frontend/src/pages/login.tsx | 45 +- .../organizations/organizations-view.tsx | 26 +- .../pages/permissions/permissions-view.tsx | 2 +- .../price_change_logs-view.tsx | 14 +- frontend/src/pages/products/[productsId].tsx | 52 +- frontend/src/pages/products/products-edit.tsx | 52 +- frontend/src/pages/products/products-list.tsx | 22 +- frontend/src/pages/products/products-new.tsx | 52 +- .../src/pages/products/products-table.tsx | 22 +- frontend/src/pages/products/products-view.tsx | 72 +- frontend/src/pages/profile.tsx | 296 ++++--- frontend/src/pages/register.tsx | 251 +++--- frontend/src/pages/roles/roles-view.tsx | 2 +- .../[sales_invoice_itemsId].tsx | 4 +- .../sales_invoice_items-edit.tsx | 4 +- .../sales_invoice_items-list.tsx | 2 +- .../sales_invoice_items-new.tsx | 4 +- .../sales_invoice_items-table.tsx | 2 +- .../sales_invoice_items-view.tsx | 20 +- .../sales_invoices/[sales_invoicesId].tsx | 54 +- .../sales_invoices/sales_invoices-edit.tsx | 54 +- .../sales_invoices/sales_invoices-list.tsx | 28 +- .../sales_invoices/sales_invoices-new.tsx | 56 +- .../sales_invoices/sales_invoices-table.tsx | 28 +- .../sales_invoices/sales_invoices-view.tsx | 111 ++- frontend/src/pages/search.tsx | 2 +- frontend/src/pages/shops/[shopsId].tsx | 34 +- frontend/src/pages/shops/shops-edit.tsx | 34 +- frontend/src/pages/shops/shops-list.tsx | 22 +- frontend/src/pages/shops/shops-new.tsx | 34 +- frontend/src/pages/shops/shops-table.tsx | 22 +- frontend/src/pages/shops/shops-view.tsx | 150 ++-- frontend/src/pages/users/users-view.tsx | 20 +- 70 files changed, 1537 insertions(+), 1565 deletions(-) create mode 100644 frontend/lint-final.log create mode 100644 frontend/src/helpers/salesInvoiceLabels.ts diff --git a/frontend/lint-final.log b/frontend/lint-final.log new file mode 100644 index 0000000..1d28c03 --- /dev/null +++ b/frontend/lint-final.log @@ -0,0 +1,10 @@ + +> lint +> eslint . --ext .ts,.tsx + + +/home/ubuntu/executor/workspace/frontend/src/components/Logo/index.tsx + 9:5 warning Do not use `` element. Use `` from `next/image` instead. See: https://nextjs.org/docs/messages/no-img-element @next/next/no-img-element + +✖ 1 problem (0 errors, 1 warning) + diff --git a/frontend/src/components/CardBoxModal.tsx b/frontend/src/components/CardBoxModal.tsx index 27d5676..dae7481 100644 --- a/frontend/src/components/CardBoxModal.tsx +++ b/frontend/src/components/CardBoxModal.tsx @@ -33,7 +33,7 @@ const CardBoxModal = ({ const footer = ( - {!!onCancel && } + {!!onCancel && } ) diff --git a/frontend/src/components/Categories/CardCategories.tsx b/frontend/src/components/Categories/CardCategories.tsx index c9d1acf..9796b38 100644 --- a/frontend/src/components/Categories/CardCategories.tsx +++ b/frontend/src/components/Categories/CardCategories.tsx @@ -90,7 +90,7 @@ const CardCategories = ({
-
اسمالقسم
+
اسم القسم
{ item.category_name } @@ -114,7 +114,7 @@ const CardCategories = ({
-
ترتيبالعرض
+
ترتيب العرض
{ item.sort_order } @@ -141,7 +141,7 @@ const CardCategories = ({ ))} {!loading && categories.length === 0 && (
-

No data to display

+

لا توجد بيانات للعرض

)} diff --git a/frontend/src/components/Categories/ListCategories.tsx b/frontend/src/components/Categories/ListCategories.tsx index db09493..feb841d 100644 --- a/frontend/src/components/Categories/ListCategories.tsx +++ b/frontend/src/components/Categories/ListCategories.tsx @@ -56,7 +56,7 @@ const ListCategories = ({ categories, loading, onDelete, currentPage, numPages,
-

اسمالقسم

+

اسم القسم

{ item.category_name }

@@ -72,7 +72,7 @@ const ListCategories = ({ categories, loading, onDelete, currentPage, numPages,
-

ترتيبالعرض

+

ترتيب العرض

{ item.sort_order }

@@ -102,7 +102,7 @@ const ListCategories = ({ categories, loading, onDelete, currentPage, numPages, ))} {!loading && categories.length === 0 && (
-

No data to display

+

لا توجد بيانات للعرض

)}
diff --git a/frontend/src/components/Categories/TableCategories.tsx b/frontend/src/components/Categories/TableCategories.tsx index 35279d6..72eb240 100644 --- a/frontend/src/components/Categories/TableCategories.tsx +++ b/frontend/src/components/Categories/TableCategories.tsx @@ -277,7 +277,7 @@ const TableSampleCategories = ({ filterItems, setFilterItems, filters, showGrid return (
-
Filter
+
التصفية
- + {filters.find((filter) => filter.title === filterItem?.fields?.selectedField )?.options?.map((option) => ( @@ -326,22 +326,22 @@ const TableSampleCategories = ({ filterItems, setFilterItems, filters, showGrid )?.number ? (
-
From
+
من
-
To
+
إلى
- From + من
-
To
+
إلى
) : (
-
Contains
+
يحتوي على
)}
-
Action
+
الإجراء
{ deleteFilter(filterItem.id) }} @@ -413,13 +413,13 @@ const TableSampleCategories = ({ filterItems, setFilterItems, filters, showGrid
@@ -429,14 +429,14 @@ const TableSampleCategories = ({ filterItems, setFilterItems, filters, showGrid : null } -

Are you sure you want to delete this item?

+

هل أنت متأكد أنك تريد حذف هذا العنصر؟

@@ -450,7 +450,7 @@ const TableSampleCategories = ({ filterItems, setFilterItems, filters, showGrid onDeleteRows(selectedRows)} />, document.getElementById('delete-rows-button'), diff --git a/frontend/src/components/Categories/configureCategoriesCols.tsx b/frontend/src/components/Categories/configureCategoriesCols.tsx index 2336e6c..669f8b3 100644 --- a/frontend/src/components/Categories/configureCategoriesCols.tsx +++ b/frontend/src/components/Categories/configureCategoriesCols.tsx @@ -65,7 +65,7 @@ export const loadColumns = async ( { field: 'category_name', - headerName: 'اسمالقسم', + headerName: 'اسم القسم', flex: 1, minWidth: 120, filterable: false, @@ -95,7 +95,7 @@ export const loadColumns = async ( { field: 'sort_order', - headerName: 'ترتيبالعرض', + headerName: 'ترتيب العرض', flex: 1, minWidth: 120, filterable: false, diff --git a/frontend/src/components/KanbanBoard/KanbanCard.tsx b/frontend/src/components/KanbanBoard/KanbanCard.tsx index 7655572..be67a0b 100644 --- a/frontend/src/components/KanbanBoard/KanbanCard.tsx +++ b/frontend/src/components/KanbanBoard/KanbanCard.tsx @@ -42,7 +42,7 @@ const KanbanCard = ({ href={`/${entityName}/${entityName}-view/?id=${item.id}`} className={'text-base font-semibold'} > - {item[showFieldName] ?? 'No data'} + {item[showFieldName] ?? 'لا توجد بيانات'}
diff --git a/frontend/src/components/ListActionsPopover.tsx b/frontend/src/components/ListActionsPopover.tsx index 0f93245..5526c35 100644 --- a/frontend/src/components/ListActionsPopover.tsx +++ b/frontend/src/components/ListActionsPopover.tsx @@ -1,5 +1,4 @@ import React from 'react'; -import Link from 'next/link'; import Button from '@mui/material/Button'; import BaseIcon from './BaseIcon'; import { @@ -81,7 +80,7 @@ const ListActionsPopover = ({ href={linkView} sx={{ justifyContent: "start" }} > - View + عرض {hasUpdatePermission && ( )} {hasUpdatePermission && ( @@ -103,7 +102,7 @@ const ListActionsPopover = ({ }} sx={{ justifyContent: "start" }} > - Delete + حذف )}
diff --git a/frontend/src/components/PasswordSetOrReset.tsx b/frontend/src/components/PasswordSetOrReset.tsx index 07749ba..1b26a8d 100644 --- a/frontend/src/components/PasswordSetOrReset.tsx +++ b/frontend/src/components/PasswordSetOrReset.tsx @@ -49,16 +49,16 @@ export default function PasswordSetOrReset() { return ( <> - {isInvitation && {getPageTitle('Set Password')}} - {!isInvitation && {getPageTitle('Reset Password')}} + {isInvitation && {getPageTitle('تعيين كلمة المرور')}} + {!isInvitation && {getPageTitle('إعادة تعيين كلمة المرور')}}
- {isInvitation &&

Set Password

} - {!isInvitation &&

Reset Password

} -

Enter your new password

+ {isInvitation &&

تعيين كلمة المرور

} + {!isInvitation &&

إعادة تعيين كلمة المرور

} +

أدخل كلمة المرور الجديدة

@@ -93,10 +93,10 @@ export default function PasswordSetOrReset() { disabled={loading} label={ loading - ? 'Loading...' + ? 'جارٍ الحفظ...' : isInvitation - ? 'Set Password' - : 'Reset Password' + ? 'تعيين كلمة المرور' + : 'إعادة تعيين كلمة المرور' } color='info' /> diff --git a/frontend/src/components/Products/CardProducts.tsx b/frontend/src/components/Products/CardProducts.tsx index 1e0830a..2c424a2 100644 --- a/frontend/src/components/Products/CardProducts.tsx +++ b/frontend/src/components/Products/CardProducts.tsx @@ -111,7 +111,7 @@ const CardProducts = ({
-
اسمالمنتج
+
اسم المنتج
{ item.product_name } @@ -123,7 +123,7 @@ const CardProducts = ({
-
رمزالمنتج
+
رمز المنتج
{ item.sku } @@ -147,7 +147,7 @@ const CardProducts = ({
-
سعرالتكلفةالحقيقي
+
سعر التكلفة
{ item.cost_price } @@ -159,7 +159,7 @@ const CardProducts = ({
-
سعرالبيع
+
سعر البيع
{ item.sale_price } @@ -171,7 +171,7 @@ const CardProducts = ({
-
سعرالبيعالسابق
+
سعر البيع السابق
{ item.sale_price_backup } @@ -183,7 +183,7 @@ const CardProducts = ({
-
سعرالتكلفةالسابق
+
سعر التكلفة السابق
{ item.cost_price_backup } @@ -195,7 +195,7 @@ const CardProducts = ({
-
السعربالدولار
+
السعر بالدولار
{ item.usd_price } @@ -207,7 +207,7 @@ const CardProducts = ({
-
الكميةبالمخزون
+
الكمية بالمخزون
{ item.stock_quantity } @@ -219,7 +219,7 @@ const CardProducts = ({
-
حدالتنبيهلنقصالمخزون
+
حد التنبيه لنقص المخزون
{ item.low_stock_threshold } @@ -247,7 +247,7 @@ const CardProducts = ({
-
متاحللبيع
+
متاح للبيع
{ dataFormatter.booleanFormatter(item.is_active) } @@ -262,7 +262,7 @@ const CardProducts = ({ ))} {!loading && products.length === 0 && (
-

No data to display

+

لا توجد بيانات للعرض

)} diff --git a/frontend/src/components/Products/ListProducts.tsx b/frontend/src/components/Products/ListProducts.tsx index 964e0d4..6ba8ddf 100644 --- a/frontend/src/components/Products/ListProducts.tsx +++ b/frontend/src/components/Products/ListProducts.tsx @@ -71,7 +71,7 @@ const ListProducts = ({ products, loading, onDelete, currentPage, numPages, onPa
-

اسمالمنتج

+

اسم المنتج

{ item.product_name }

@@ -79,7 +79,7 @@ const ListProducts = ({ products, loading, onDelete, currentPage, numPages, onPa
-

رمزالمنتج

+

رمز المنتج

{ item.sku }

@@ -95,7 +95,7 @@ const ListProducts = ({ products, loading, onDelete, currentPage, numPages, onPa
-

سعرالتكلفةالحقيقي

+

سعر التكلفة

{ item.cost_price }

@@ -103,7 +103,7 @@ const ListProducts = ({ products, loading, onDelete, currentPage, numPages, onPa
-

سعرالبيع

+

سعر البيع

{ item.sale_price }

@@ -111,7 +111,7 @@ const ListProducts = ({ products, loading, onDelete, currentPage, numPages, onPa
-

سعرالبيعالسابق

+

سعر البيع السابق

{ item.sale_price_backup }

@@ -119,7 +119,7 @@ const ListProducts = ({ products, loading, onDelete, currentPage, numPages, onPa
-

سعرالتكلفةالسابق

+

سعر التكلفة السابق

{ item.cost_price_backup }

@@ -127,7 +127,7 @@ const ListProducts = ({ products, loading, onDelete, currentPage, numPages, onPa
-

السعربالدولار

+

السعر بالدولار

{ item.usd_price }

@@ -135,7 +135,7 @@ const ListProducts = ({ products, loading, onDelete, currentPage, numPages, onPa
-

الكميةبالمخزون

+

الكمية بالمخزون

{ item.stock_quantity }

@@ -143,7 +143,7 @@ const ListProducts = ({ products, loading, onDelete, currentPage, numPages, onPa
-

حدالتنبيهلنقصالمخزون

+

حد التنبيه لنقص المخزون

{ item.low_stock_threshold }

@@ -163,7 +163,7 @@ const ListProducts = ({ products, loading, onDelete, currentPage, numPages, onPa
-

متاحللبيع

+

متاح للبيع

{ dataFormatter.booleanFormatter(item.is_active) }

@@ -185,7 +185,7 @@ const ListProducts = ({ products, loading, onDelete, currentPage, numPages, onPa ))} {!loading && products.length === 0 && (
-

No data to display

+

لا توجد بيانات للعرض

)}
diff --git a/frontend/src/components/Products/TableProducts.tsx b/frontend/src/components/Products/TableProducts.tsx index c3ddaea..57e5e48 100644 --- a/frontend/src/components/Products/TableProducts.tsx +++ b/frontend/src/components/Products/TableProducts.tsx @@ -277,7 +277,7 @@ const TableSampleProducts = ({ filterItems, setFilterItems, filters, showGrid }) return (
-
Filter
+
التصفية
- Value + القيمة
- + {filters.find((filter) => filter.title === filterItem?.fields?.selectedField )?.options?.map((option) => ( @@ -326,22 +326,22 @@ const TableSampleProducts = ({ filterItems, setFilterItems, filters, showGrid }) )?.number ? (
-
From
+
من
-
To
+
إلى
- From + من
-
To
+
إلى
) : (
-
Contains
+
يحتوي على
)}
-
Action
+
الإجراء
{ deleteFilter(filterItem.id) }} @@ -413,13 +413,13 @@ const TableSampleProducts = ({ filterItems, setFilterItems, filters, showGrid })
@@ -429,14 +429,14 @@ const TableSampleProducts = ({ filterItems, setFilterItems, filters, showGrid }) : null } -

Are you sure you want to delete this item?

+

هل أنت متأكد أنك تريد حذف هذا العنصر؟

@@ -450,7 +450,7 @@ const TableSampleProducts = ({ filterItems, setFilterItems, filters, showGrid }) onDeleteRows(selectedRows)} />, document.getElementById('delete-rows-button'), diff --git a/frontend/src/components/Products/configureProductsCols.tsx b/frontend/src/components/Products/configureProductsCols.tsx index 709d55f..692e2cc 100644 --- a/frontend/src/components/Products/configureProductsCols.tsx +++ b/frontend/src/components/Products/configureProductsCols.tsx @@ -87,7 +87,7 @@ export const loadColumns = async ( { field: 'product_name', - headerName: 'اسمالمنتج', + headerName: 'اسم المنتج', flex: 1, minWidth: 120, filterable: false, @@ -102,7 +102,7 @@ export const loadColumns = async ( { field: 'sku', - headerName: 'رمزالمنتج', + headerName: 'رمز المنتج', flex: 1, minWidth: 120, filterable: false, @@ -132,7 +132,7 @@ export const loadColumns = async ( { field: 'cost_price', - headerName: 'سعرالتكلفةالحقيقي', + headerName: 'سعر التكلفة', flex: 1, minWidth: 120, filterable: false, @@ -148,7 +148,7 @@ export const loadColumns = async ( { field: 'sale_price', - headerName: 'سعرالبيع', + headerName: 'سعر البيع', flex: 1, minWidth: 120, filterable: false, @@ -164,7 +164,7 @@ export const loadColumns = async ( { field: 'sale_price_backup', - headerName: 'سعرالبيعالسابق', + headerName: 'سعر البيع السابق', flex: 1, minWidth: 120, filterable: false, @@ -180,7 +180,7 @@ export const loadColumns = async ( { field: 'cost_price_backup', - headerName: 'سعرالتكلفةالسابق', + headerName: 'سعر التكلفة السابق', flex: 1, minWidth: 120, filterable: false, @@ -196,7 +196,7 @@ export const loadColumns = async ( { field: 'usd_price', - headerName: 'السعربالدولار', + headerName: 'السعر بالدولار', flex: 1, minWidth: 120, filterable: false, @@ -212,7 +212,7 @@ export const loadColumns = async ( { field: 'stock_quantity', - headerName: 'الكميةبالمخزون', + headerName: 'الكمية بالمخزون', flex: 1, minWidth: 120, filterable: false, @@ -228,7 +228,7 @@ export const loadColumns = async ( { field: 'low_stock_threshold', - headerName: 'حدالتنبيهلنقصالمخزون', + headerName: 'حد التنبيه لنقص المخزون', flex: 1, minWidth: 120, filterable: false, @@ -244,7 +244,7 @@ export const loadColumns = async ( { field: 'product_images', - headerName: 'صورالمنتج', + headerName: 'صور المنتج', flex: 1, minWidth: 120, filterable: false, @@ -265,7 +265,7 @@ export const loadColumns = async ( { field: 'is_active', - headerName: 'متاحللبيع', + headerName: 'متاح للبيع', flex: 1, minWidth: 120, filterable: false, diff --git a/frontend/src/components/Sales_invoice_items/CardSales_invoice_items.tsx b/frontend/src/components/Sales_invoice_items/CardSales_invoice_items.tsx index 689dc4d..c7dfa12 100644 --- a/frontend/src/components/Sales_invoice_items/CardSales_invoice_items.tsx +++ b/frontend/src/components/Sales_invoice_items/CardSales_invoice_items.tsx @@ -126,7 +126,7 @@ const CardSales_invoice_items = ({
-
سعرالبيعوقتالبيع
+
سعر البيعوقتالبيع
{ item.sale_price_snapshot } diff --git a/frontend/src/components/Sales_invoice_items/ListSales_invoice_items.tsx b/frontend/src/components/Sales_invoice_items/ListSales_invoice_items.tsx index a7bdc83..b437141 100644 --- a/frontend/src/components/Sales_invoice_items/ListSales_invoice_items.tsx +++ b/frontend/src/components/Sales_invoice_items/ListSales_invoice_items.tsx @@ -80,7 +80,7 @@ const ListSales_invoice_items = ({ sales_invoice_items, loading, onDelete, curre
-

سعرالبيعوقتالبيع

+

سعر البيعوقتالبيع

{ item.sale_price_snapshot }

diff --git a/frontend/src/components/Sales_invoice_items/configureSales_invoice_itemsCols.tsx b/frontend/src/components/Sales_invoice_items/configureSales_invoice_itemsCols.tsx index b5aa39f..958354b 100644 --- a/frontend/src/components/Sales_invoice_items/configureSales_invoice_itemsCols.tsx +++ b/frontend/src/components/Sales_invoice_items/configureSales_invoice_itemsCols.tsx @@ -118,7 +118,7 @@ export const loadColumns = async ( { field: 'sale_price_snapshot', - headerName: 'سعرالبيعوقتالبيع', + headerName: 'سعر البيعوقتالبيع', flex: 1, minWidth: 120, filterable: false, diff --git a/frontend/src/components/Sales_invoices/CardSales_invoices.tsx b/frontend/src/components/Sales_invoices/CardSales_invoices.tsx index d3ffab3..a70b5d6 100644 --- a/frontend/src/components/Sales_invoices/CardSales_invoices.tsx +++ b/frontend/src/components/Sales_invoices/CardSales_invoices.tsx @@ -7,6 +7,10 @@ import { Pagination } from '../Pagination'; import {saveFile} from "../../helpers/fileSaver"; import LoadingSpinner from "../LoadingSpinner"; import Link from 'next/link'; +import { + formatSalesInvoicePaymentMethod, + formatSalesInvoiceStatus, +} from '../../helpers/salesInvoiceLabels'; import {hasPermission} from "../../helpers/userPermissions"; @@ -102,7 +106,7 @@ const CardSales_invoices = ({
-
رقمالفاتورة
+
رقم الفاتورة
{ item.invoice_number } @@ -114,7 +118,7 @@ const CardSales_invoices = ({
-
تاريخووقتالبيع
+
تاريخ ووقت البيع
{ dataFormatter.dateTimeFormatter(item.sold_at) } @@ -129,7 +133,7 @@ const CardSales_invoices = ({
الحالة
- { item.status } + { formatSalesInvoiceStatus(item.status) }
@@ -138,7 +142,7 @@ const CardSales_invoices = ({
-
الإجماليقبلالخصم
+
الإجمالي قبل الخصم
{ item.subtotal_amount } @@ -162,7 +166,7 @@ const CardSales_invoices = ({
-
الإجماليالنهائي
+
الإجمالي النهائي
{ item.total_amount } @@ -174,7 +178,7 @@ const CardSales_invoices = ({
-
إجماليالتكلفة
+
إجمالي التكلفة
{ item.total_cost_amount } @@ -186,7 +190,7 @@ const CardSales_invoices = ({
-
إجماليالربح
+
إجمالي الربح
{ item.total_profit_amount } @@ -198,10 +202,10 @@ const CardSales_invoices = ({
-
طريقةالدفع
+
طريقة الدفع
- { item.payment_method } + { formatSalesInvoicePaymentMethod(item.payment_method) }
@@ -222,7 +226,7 @@ const CardSales_invoices = ({
-
بنودالفاتورة
+
بنود الفاتورة
{ dataFormatter.sales_invoice_itemsManyListFormatter(item.items).join(', ')} @@ -237,7 +241,7 @@ const CardSales_invoices = ({ ))} {!loading && sales_invoices.length === 0 && (
-

No data to display

+

لا توجد بيانات للعرض

)} diff --git a/frontend/src/components/Sales_invoices/ListSales_invoices.tsx b/frontend/src/components/Sales_invoices/ListSales_invoices.tsx index c2d1702..a118ace 100644 --- a/frontend/src/components/Sales_invoices/ListSales_invoices.tsx +++ b/frontend/src/components/Sales_invoices/ListSales_invoices.tsx @@ -8,6 +8,10 @@ import {useAppSelector} from "../../stores/hooks"; import {Pagination} from "../Pagination"; import LoadingSpinner from "../LoadingSpinner"; import Link from 'next/link'; +import { + formatSalesInvoicePaymentMethod, + formatSalesInvoiceStatus, +} from '../../helpers/salesInvoiceLabels'; import {hasPermission} from "../../helpers/userPermissions"; @@ -64,7 +68,7 @@ const ListSales_invoices = ({ sales_invoices, loading, onDelete, currentPage, nu
-

رقمالفاتورة

+

رقم الفاتورة

{ item.invoice_number }

@@ -72,7 +76,7 @@ const ListSales_invoices = ({ sales_invoices, loading, onDelete, currentPage, nu
-

تاريخووقتالبيع

+

تاريخ ووقت البيع

{ dataFormatter.dateTimeFormatter(item.sold_at) }

@@ -81,14 +85,14 @@ const ListSales_invoices = ({ sales_invoices, loading, onDelete, currentPage, nu

الحالة

-

{ item.status }

+

{ formatSalesInvoiceStatus(item.status) }

-

الإجماليقبلالخصم

+

الإجمالي قبل الخصم

{ item.subtotal_amount }

@@ -104,7 +108,7 @@ const ListSales_invoices = ({ sales_invoices, loading, onDelete, currentPage, nu
-

الإجماليالنهائي

+

الإجمالي النهائي

{ item.total_amount }

@@ -112,7 +116,7 @@ const ListSales_invoices = ({ sales_invoices, loading, onDelete, currentPage, nu
-

إجماليالتكلفة

+

إجمالي التكلفة

{ item.total_cost_amount }

@@ -120,7 +124,7 @@ const ListSales_invoices = ({ sales_invoices, loading, onDelete, currentPage, nu
-

إجماليالربح

+

إجمالي الربح

{ item.total_profit_amount }

@@ -128,8 +132,8 @@ const ListSales_invoices = ({ sales_invoices, loading, onDelete, currentPage, nu
-

طريقةالدفع

-

{ item.payment_method }

+

طريقة الدفع

+

{ formatSalesInvoicePaymentMethod(item.payment_method) }

@@ -144,7 +148,7 @@ const ListSales_invoices = ({ sales_invoices, loading, onDelete, currentPage, nu
-

بنودالفاتورة

+

بنود الفاتورة

{ dataFormatter.sales_invoice_itemsManyListFormatter(item.items).join(', ')}

@@ -166,7 +170,7 @@ const ListSales_invoices = ({ sales_invoices, loading, onDelete, currentPage, nu ))} {!loading && sales_invoices.length === 0 && (
-

No data to display

+

لا توجد بيانات للعرض

)}
diff --git a/frontend/src/components/Sales_invoices/TableSales_invoices.tsx b/frontend/src/components/Sales_invoices/TableSales_invoices.tsx index 2ee4051..d6e7616 100644 --- a/frontend/src/components/Sales_invoices/TableSales_invoices.tsx +++ b/frontend/src/components/Sales_invoices/TableSales_invoices.tsx @@ -20,10 +20,20 @@ import {dataGridStyles} from "../../styles"; import KanbanBoard from '../KanbanBoard/KanbanBoard'; import axios from 'axios'; - +import { + formatSalesInvoicePaymentMethod, + formatSalesInvoiceStatus, +} from '../../helpers/salesInvoiceLabels'; const perPage = 10 + +const getEnumOptionLabel = (fieldName: string, value: string) => { + if (fieldName === 'status') return formatSalesInvoiceStatus(value); + if (fieldName === 'payment_method') return formatSalesInvoicePaymentMethod(value); + return value; +} + const TableSampleSales_invoices = ({ filterItems, setFilterItems, filters, showGrid }) => { const notify = (type, msg) => toast( msg, {type, position: "bottom-center"}); @@ -98,13 +108,13 @@ const TableSampleSales_invoices = ({ filterItems, setFilterItems, filters, showG setKanbanColumns([ - { id: "draft", label: "draft" }, + { id: "draft", label: "مسودة" }, - { id: "paid", label: "paid" }, + { id: "paid", label: "مدفوعة" }, - { id: "voided", label: "voided" }, + { id: "voided", label: "ملغاة" }, - { id: "refunded", label: "refunded" }, + { id: "refunded", label: "مسترجعة" }, ]); @@ -295,7 +305,7 @@ const TableSampleSales_invoices = ({ filterItems, setFilterItems, filters, showG {filterItems && Array.isArray( filterItems ) && filterItems.length ?
-
Filter
+
التصفية
- Value + القيمة
- + {filters.find((filter) => filter.title === filterItem?.fields?.selectedField )?.options?.map((option) => ( ))} @@ -357,22 +367,22 @@ const TableSampleSales_invoices = ({ filterItems, setFilterItems, filters, showG )?.number ? (
-
From
+
من
-
To
+
إلى
- From + من
-
To
+
إلى
) : (
-
Contains
+
يحتوي على
)}
-
Action
+
الإجراء
{ deleteFilter(filterItem.id) }} @@ -444,13 +454,13 @@ const TableSampleSales_invoices = ({ filterItems, setFilterItems, filters, showG
@@ -460,14 +470,14 @@ const TableSampleSales_invoices = ({ filterItems, setFilterItems, filters, showG : null } -

Are you sure you want to delete this item?

+

هل أنت متأكد أنك تريد حذف هذا العنصر؟

@@ -494,7 +504,7 @@ const TableSampleSales_invoices = ({ filterItems, setFilterItems, filters, showG onDeleteRows(selectedRows)} />, document.getElementById('delete-rows-button'), diff --git a/frontend/src/components/Sales_invoices/configureSales_invoicesCols.tsx b/frontend/src/components/Sales_invoices/configureSales_invoicesCols.tsx index 9947b94..85997c5 100644 --- a/frontend/src/components/Sales_invoices/configureSales_invoicesCols.tsx +++ b/frontend/src/components/Sales_invoices/configureSales_invoicesCols.tsx @@ -12,6 +12,10 @@ import {saveFile} from "../../helpers/fileSaver"; import dataFormatter from '../../helpers/dataFormatter' import DataGridMultiSelect from "../DataGridMultiSelect"; import ListActionsPopover from '../ListActionsPopover'; +import { + formatSalesInvoicePaymentMethod, + formatSalesInvoiceStatus, +} from '../../helpers/salesInvoiceLabels'; import {hasPermission} from "../../helpers/userPermissions"; @@ -87,7 +91,7 @@ export const loadColumns = async ( { field: 'invoice_number', - headerName: 'رقمالفاتورة', + headerName: 'رقم الفاتورة', flex: 1, minWidth: 120, filterable: false, @@ -102,7 +106,7 @@ export const loadColumns = async ( { field: 'sold_at', - headerName: 'تاريخووقتالبيع', + headerName: 'تاريخ ووقت البيع', flex: 1, minWidth: 120, filterable: false, @@ -129,13 +133,13 @@ export const loadColumns = async ( editable: hasUpdatePermission, - + valueFormatter: ({ value }) => formatSalesInvoiceStatus(value), }, { field: 'subtotal_amount', - headerName: 'الإجماليقبلالخصم', + headerName: 'الإجمالي قبل الخصم', flex: 1, minWidth: 120, filterable: false, @@ -167,7 +171,7 @@ export const loadColumns = async ( { field: 'total_amount', - headerName: 'الإجماليالنهائي', + headerName: 'الإجمالي النهائي', flex: 1, minWidth: 120, filterable: false, @@ -183,7 +187,7 @@ export const loadColumns = async ( { field: 'total_cost_amount', - headerName: 'إجماليالتكلفة', + headerName: 'إجمالي التكلفة', flex: 1, minWidth: 120, filterable: false, @@ -199,7 +203,7 @@ export const loadColumns = async ( { field: 'total_profit_amount', - headerName: 'إجماليالربح', + headerName: 'إجمالي الربح', flex: 1, minWidth: 120, filterable: false, @@ -215,7 +219,7 @@ export const loadColumns = async ( { field: 'payment_method', - headerName: 'طريقةالدفع', + headerName: 'طريقة الدفع', flex: 1, minWidth: 120, filterable: false, @@ -224,7 +228,7 @@ export const loadColumns = async ( editable: hasUpdatePermission, - + valueFormatter: ({ value }) => formatSalesInvoicePaymentMethod(value), }, @@ -245,7 +249,7 @@ export const loadColumns = async ( { field: 'items', - headerName: 'بنودالفاتورة', + headerName: 'بنود الفاتورة', flex: 1, minWidth: 120, filterable: false, diff --git a/frontend/src/components/Search.tsx b/frontend/src/components/Search.tsx index b7beb98..5499d42 100644 --- a/frontend/src/components/Search.tsx +++ b/frontend/src/components/Search.tsx @@ -11,9 +11,9 @@ const Search = () => { const validateSearch = (value) => { let error; if (!value) { - error = 'Required'; + error = 'الرجاء كتابة كلمة للبحث'; } else if (value.length < 2) { - error = 'Minimum length: 2 characters'; + error = 'الحد الأدنى حرفان'; } return error; }; @@ -31,12 +31,12 @@ const Search = () => { validateOnChange={false} > {({ errors, touched, values }) => ( -
+ {errors.search && touched.search && values.search.length < 2 ? ( diff --git a/frontend/src/components/Shops/CardShops.tsx b/frontend/src/components/Shops/CardShops.tsx index cc7b869..dccce5e 100644 --- a/frontend/src/components/Shops/CardShops.tsx +++ b/frontend/src/components/Shops/CardShops.tsx @@ -78,7 +78,7 @@ const CardShops = ({
-
اسمالمتجر
+
اسم المحل
{ item.shop_name } @@ -90,7 +90,7 @@ const CardShops = ({
-
اسمالمالك
+
اسم المالك
{ item.owner_name } @@ -102,7 +102,7 @@ const CardShops = ({
-
هاتفالمتجر
+
هاتف المحل
{ item.phone } @@ -126,7 +126,7 @@ const CardShops = ({
-
اسمالعملةالمحلية
+
اسم العملة المحلية
{ item.currency_name } @@ -138,7 +138,7 @@ const CardShops = ({
-
سعرالدولاراليومي
+
سعر الدولار اليومي
{ item.usd_rate } @@ -150,7 +150,7 @@ const CardShops = ({
-
السماحبمخزونسالب
+
السماح بمخزون سالب
{ dataFormatter.booleanFormatter(item.allow_negative_stock) } @@ -177,7 +177,7 @@ const CardShops = ({ ))} {!loading && shops.length === 0 && (
-

No data to display

+

لا توجد بيانات للعرض

)} diff --git a/frontend/src/components/Shops/ListShops.tsx b/frontend/src/components/Shops/ListShops.tsx index 286ef21..83a6dbe 100644 --- a/frontend/src/components/Shops/ListShops.tsx +++ b/frontend/src/components/Shops/ListShops.tsx @@ -48,7 +48,7 @@ const ListShops = ({ shops, loading, onDelete, currentPage, numPages, onPageChan
-

اسمالمتجر

+

اسم المحل

{ item.shop_name }

@@ -56,7 +56,7 @@ const ListShops = ({ shops, loading, onDelete, currentPage, numPages, onPageChan
-

اسمالمالك

+

اسم المالك

{ item.owner_name }

@@ -64,7 +64,7 @@ const ListShops = ({ shops, loading, onDelete, currentPage, numPages, onPageChan
-

هاتفالمتجر

+

هاتف المحل

{ item.phone }

@@ -80,7 +80,7 @@ const ListShops = ({ shops, loading, onDelete, currentPage, numPages, onPageChan
-

اسمالعملةالمحلية

+

اسم العملة المحلية

{ item.currency_name }

@@ -88,7 +88,7 @@ const ListShops = ({ shops, loading, onDelete, currentPage, numPages, onPageChan
-

سعرالدولاراليومي

+

سعر الدولار اليومي

{ item.usd_rate }

@@ -96,7 +96,7 @@ const ListShops = ({ shops, loading, onDelete, currentPage, numPages, onPageChan
-

السماحبمخزونسالب

+

السماح بمخزون سالب

{ dataFormatter.booleanFormatter(item.allow_negative_stock) }

@@ -126,7 +126,7 @@ const ListShops = ({ shops, loading, onDelete, currentPage, numPages, onPageChan ))} {!loading && shops.length === 0 && (
-

No data to display

+

لا توجد بيانات للعرض

)}
diff --git a/frontend/src/components/Shops/TableShops.tsx b/frontend/src/components/Shops/TableShops.tsx index 4541e19..fac702e 100644 --- a/frontend/src/components/Shops/TableShops.tsx +++ b/frontend/src/components/Shops/TableShops.tsx @@ -279,7 +279,7 @@ const TableSampleShops = ({ filterItems, setFilterItems, filters, showGrid }) => return (
-
Filter
+
التصفية
value={filterItem?.fields?.filterValue || ''} onChange={handleChange(filterItem.id)} > - + {filters.find((filter) => filter.title === filterItem?.fields?.selectedField )?.options?.map((option) => ( @@ -328,22 +328,22 @@ const TableSampleShops = ({ filterItems, setFilterItems, filters, showGrid }) => )?.number ? (
-
From
+
من
-
To
+
إلى
/>
-
To
+
إلى
) : (
-
Contains
+
يحتوي على
)}
-
Action
+
الإجراء
{ deleteFilter(filterItem.id) }} @@ -415,13 +415,13 @@ const TableSampleShops = ({ filterItems, setFilterItems, filters, showGrid }) =>
@@ -431,14 +431,14 @@ const TableSampleShops = ({ filterItems, setFilterItems, filters, showGrid }) => : null } -

Are you sure you want to delete this item?

+

هل أنت متأكد أنك تريد حذف هذا العنصر؟

@@ -463,7 +463,7 @@ const TableSampleShops = ({ filterItems, setFilterItems, filters, showGrid }) => onDeleteRows(selectedRows)} />, document.getElementById('delete-rows-button'), diff --git a/frontend/src/components/Shops/configureShopsCols.tsx b/frontend/src/components/Shops/configureShopsCols.tsx index d53206d..f40de11 100644 --- a/frontend/src/components/Shops/configureShopsCols.tsx +++ b/frontend/src/components/Shops/configureShopsCols.tsx @@ -43,7 +43,7 @@ export const loadColumns = async ( { field: 'shop_name', - headerName: 'اسمالمتجر', + headerName: 'اسم المحل', flex: 1, minWidth: 120, filterable: false, @@ -58,7 +58,7 @@ export const loadColumns = async ( { field: 'owner_name', - headerName: 'اسمالمالك', + headerName: 'اسم المالك', flex: 1, minWidth: 120, filterable: false, @@ -73,7 +73,7 @@ export const loadColumns = async ( { field: 'phone', - headerName: 'هاتفالمتجر', + headerName: 'هاتف المحل', flex: 1, minWidth: 120, filterable: false, @@ -103,7 +103,7 @@ export const loadColumns = async ( { field: 'currency_name', - headerName: 'اسمالعملةالمحلية', + headerName: 'اسم العملة المحلية', flex: 1, minWidth: 120, filterable: false, @@ -118,7 +118,7 @@ export const loadColumns = async ( { field: 'usd_rate', - headerName: 'سعرالدولاراليومي', + headerName: 'سعر الدولار اليومي', flex: 1, minWidth: 120, filterable: false, @@ -134,7 +134,7 @@ export const loadColumns = async ( { field: 'allow_negative_stock', - headerName: 'السماحبمخزونسالب', + headerName: 'السماح بمخزون سالب', flex: 1, minWidth: 120, filterable: false, diff --git a/frontend/src/helpers/salesInvoiceLabels.ts b/frontend/src/helpers/salesInvoiceLabels.ts new file mode 100644 index 0000000..612b4ee --- /dev/null +++ b/frontend/src/helpers/salesInvoiceLabels.ts @@ -0,0 +1,23 @@ +export const SALES_INVOICE_STATUS_LABELS: Record = { + draft: 'مسودة', + paid: 'مدفوعة', + voided: 'ملغاة', + refunded: 'مسترجعة', +}; + +export const SALES_INVOICE_PAYMENT_METHOD_LABELS: Record = { + cash: 'نقداً', + card: 'بطاقة', + transfer: 'تحويل', + mixed: 'مختلط', +}; + +export const formatSalesInvoiceStatus = (value?: string | null) => { + if (!value) return 'لا توجد بيانات'; + return SALES_INVOICE_STATUS_LABELS[value] ?? value; +}; + +export const formatSalesInvoicePaymentMethod = (value?: string | null) => { + if (!value) return 'لا توجد بيانات'; + return SALES_INVOICE_PAYMENT_METHOD_LABELS[value] ?? value; +}; diff --git a/frontend/src/layouts/Authenticated.tsx b/frontend/src/layouts/Authenticated.tsx index 3076bdf..c6e9f4e 100644 --- a/frontend/src/layouts/Authenticated.tsx +++ b/frontend/src/layouts/Authenticated.tsx @@ -121,7 +121,7 @@ export default function LayoutAuthenticated({ onAsideLgClose={() => setIsAsideLgActive(false)} /> {children} - Hand-crafted & Made with ❤️ + واجهة مبسطة لإدارة المحل
) diff --git a/frontend/src/menuAside.ts b/frontend/src/menuAside.ts index ea9983a..22d1030 100644 --- a/frontend/src/menuAside.ts +++ b/frontend/src/menuAside.ts @@ -5,110 +5,53 @@ const menuAside: MenuAsideItem[] = [ { href: '/dashboard', icon: icon.mdiViewDashboardOutline, - label: 'لوحة التحكم', - }, - - { - href: '/users/users-list', - label: 'المستخدمون', - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - icon: icon.mdiAccountGroup ?? icon.mdiTable, - permissions: 'READ_USERS' - }, - { - href: '/roles/roles-list', - label: 'الأدوار', - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - icon: icon.mdiShieldAccountVariantOutline ?? icon.mdiTable, - permissions: 'READ_ROLES' - }, - { - href: '/permissions/permissions-list', - label: 'الصلاحيات', - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - icon: icon.mdiShieldAccountOutline ?? icon.mdiTable, - permissions: 'READ_PERMISSIONS' - }, - { - href: '/organizations/organizations-list', - label: 'المنظمات', - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - icon: icon.mdiTable ?? icon.mdiTable, - permissions: 'READ_ORGANIZATIONS' - }, - { - href: '/shops/shops-list', - label: 'المحلات', - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - icon: 'mdiStorefront' in icon ? icon['mdiStorefront' as keyof typeof icon] : icon.mdiTable ?? icon.mdiTable, - permissions: 'READ_SHOPS' - }, - { - href: '/categories/categories-list', - label: 'الأقسام', - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - icon: 'mdiShape' in icon ? icon['mdiShape' as keyof typeof icon] : icon.mdiTable ?? icon.mdiTable, - permissions: 'READ_CATEGORIES' + label: 'الصفحة الرئيسية', }, { href: '/cashier', label: 'الكاشير', // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore - icon: 'mdiCashRegister' in icon ? icon['mdiCashRegister' as keyof typeof icon] : ('mdiReceipt' in icon ? icon['mdiReceipt' as keyof typeof icon] : icon.mdiTable ?? icon.mdiTable), - permissions: 'READ_PRODUCTS' + icon: 'mdiCashRegister' in icon ? icon['mdiCashRegister' as keyof typeof icon] : ('mdiReceipt' in icon ? icon['mdiReceipt' as keyof typeof icon] : icon.mdiTable), + permissions: 'READ_PRODUCTS', }, { href: '/products/products-list', label: 'المنتجات', // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore - icon: 'mdiSprayBottle' in icon ? icon['mdiSprayBottle' as keyof typeof icon] : icon.mdiTable ?? icon.mdiTable, - permissions: 'READ_PRODUCTS' + icon: 'mdiSprayBottle' in icon ? icon['mdiSprayBottle' as keyof typeof icon] : icon.mdiTable, + permissions: 'READ_PRODUCTS', + }, + { + href: '/categories/categories-list', + label: 'الأقسام', + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + icon: 'mdiShape' in icon ? icon['mdiShape' as keyof typeof icon] : icon.mdiTable, + permissions: 'READ_CATEGORIES', }, { href: '/sales_invoices/sales_invoices-list', label: 'الفواتير', // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore - icon: 'mdiReceipt' in icon ? icon['mdiReceipt' as keyof typeof icon] : icon.mdiTable ?? icon.mdiTable, - permissions: 'READ_SALES_INVOICES' + icon: 'mdiReceipt' in icon ? icon['mdiReceipt' as keyof typeof icon] : icon.mdiTable, + permissions: 'READ_SALES_INVOICES', }, { - href: '/sales_invoice_items/sales_invoice_items-list', - label: 'عناصر الفواتير', + href: '/shops/shops-list', + label: 'المحل', // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore - icon: 'mdiFormatListBulleted' in icon ? icon['mdiFormatListBulleted' as keyof typeof icon] : icon.mdiTable ?? icon.mdiTable, - permissions: 'READ_SALES_INVOICE_ITEMS' - }, - { - href: '/price_change_logs/price_change_logs-list', - label: 'سجل الأسعار', - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - icon: 'mdiCurrencyUsd' in icon ? icon['mdiCurrencyUsd' as keyof typeof icon] : icon.mdiTable ?? icon.mdiTable, - permissions: 'READ_PRICE_CHANGE_LOGS' + icon: 'mdiStorefront' in icon ? icon['mdiStorefront' as keyof typeof icon] : icon.mdiTable, + permissions: 'READ_SHOPS', }, { href: '/profile', label: 'الملف الشخصي', icon: icon.mdiAccountCircle, - }, - - - { - href: '/api-docs', - target: '_blank', - label: 'توثيق API', - icon: icon.mdiFileCode, - permissions: 'READ_API_DOCS' + withDevider: true, }, ] diff --git a/frontend/src/pages/cashier.tsx b/frontend/src/pages/cashier.tsx index 22913cd..dd45fb5 100644 --- a/frontend/src/pages/cashier.tsx +++ b/frontend/src/pages/cashier.tsx @@ -10,6 +10,7 @@ import LoadingSpinner from '../components/LoadingSpinner'; import SectionMain from '../components/SectionMain'; import SectionTitleLineWithButton from '../components/SectionTitleLineWithButton'; import { getPageTitle } from '../config'; +import { formatSalesInvoicePaymentMethod } from '../helpers/salesInvoiceLabels'; import { hasPermission } from '../helpers/userPermissions'; import LayoutAuthenticated from '../layouts/Authenticated'; import { useAppSelector } from '../stores/hooks'; @@ -410,7 +411,7 @@ const CashierPage = () => {

بحث سريع عن المنتجات

-

اكتب أول حرف من اسم المنتج أو الباركود أو SKU وستظهر النتائج فوراً بدون إعادة تحميل.

+

اكتب اسم المنتج أو الباركود أو رمز المنتج، وستظهر النتائج فوراً بدون إعادة تحميل.

@@ -704,7 +705,7 @@ const CashierPage = () => {
{formatDateTime(invoice.sold_at)}
- {invoice.payment_method} + {formatSalesInvoicePaymentMethod(invoice.payment_method)}
diff --git a/frontend/src/pages/categories/[categoriesId].tsx b/frontend/src/pages/categories/[categoriesId].tsx index d8ed8a4..7f11d20 100644 --- a/frontend/src/pages/categories/[categoriesId].tsx +++ b/frontend/src/pages/categories/[categoriesId].tsx @@ -249,10 +249,10 @@ const EditCategories = () => { return ( <> - {getPageTitle('Edit categories')} + {getPageTitle('تعديل القسم')} - + {''} @@ -330,11 +330,11 @@ const EditCategories = () => { @@ -405,12 +405,12 @@ const EditCategories = () => { @@ -491,7 +491,7 @@ const EditCategories = () => { - + { - - - router.push('/categories/categories-list')}/> + + + router.push('/categories/categories-list')}/> diff --git a/frontend/src/pages/categories/categories-edit.tsx b/frontend/src/pages/categories/categories-edit.tsx index d85e4c1..84083c0 100644 --- a/frontend/src/pages/categories/categories-edit.tsx +++ b/frontend/src/pages/categories/categories-edit.tsx @@ -246,10 +246,10 @@ const EditCategoriesPage = () => { return ( <> - {getPageTitle('Edit categories')} + {getPageTitle('تعديل القسم')} - + {''} @@ -327,11 +327,11 @@ const EditCategoriesPage = () => { @@ -402,12 +402,12 @@ const EditCategoriesPage = () => { @@ -488,7 +488,7 @@ const EditCategoriesPage = () => { - + { - - - router.push('/categories/categories-list')}/> + + + router.push('/categories/categories-list')}/> diff --git a/frontend/src/pages/categories/categories-list.tsx b/frontend/src/pages/categories/categories-list.tsx index 03f126b..16cda55 100644 --- a/frontend/src/pages/categories/categories-list.tsx +++ b/frontend/src/pages/categories/categories-list.tsx @@ -34,8 +34,8 @@ const CategoriesTablesPage = () => { const dispatch = useAppDispatch(); - const [filters] = useState([{label: 'اسمالقسم', title: 'category_name'},{label: 'الوصف', title: 'description'}, - {label: 'ترتيبالعرض', title: 'sort_order', number: 'true'}, + const [filters] = useState([{label: 'اسم القسم', title: 'category_name'},{label: 'الوصف', title: 'description'}, + {label: 'ترتيب العرض', title: 'sort_order', number: 'true'}, @@ -90,28 +90,28 @@ const CategoriesTablesPage = () => { return ( <> - {getPageTitle('Categories')} + {getPageTitle('الأقسام')} - + {''} - {hasCreatePermission && } + {hasCreatePermission && } - + {hasCreatePermission && ( setIsModalActive(true)} /> )} @@ -133,9 +133,9 @@ const CategoriesTablesPage = () => { { return ( <> - {getPageTitle('New Item')} + {getPageTitle('إضافة قسم')} - + {''} @@ -192,11 +192,11 @@ const CategoriesNew = () => { @@ -263,12 +263,12 @@ const CategoriesNew = () => { @@ -344,7 +344,7 @@ const CategoriesNew = () => { - + @@ -356,9 +356,9 @@ const CategoriesNew = () => { - - - router.push('/categories/categories-list')}/> + + + router.push('/categories/categories-list')}/> diff --git a/frontend/src/pages/categories/categories-table.tsx b/frontend/src/pages/categories/categories-table.tsx index 0b4110a..538e3ca 100644 --- a/frontend/src/pages/categories/categories-table.tsx +++ b/frontend/src/pages/categories/categories-table.tsx @@ -34,8 +34,8 @@ const CategoriesTablesPage = () => { const dispatch = useAppDispatch(); - const [filters] = useState([{label: 'اسمالقسم', title: 'category_name'},{label: 'الوصف', title: 'description'}, - {label: 'ترتيبالعرض', title: 'sort_order', number: 'true'}, + const [filters] = useState([{label: 'اسم القسم', title: 'category_name'},{label: 'الوصف', title: 'description'}, + {label: 'ترتيب العرض', title: 'sort_order', number: 'true'}, @@ -90,28 +90,28 @@ const CategoriesTablesPage = () => { return ( <> - {getPageTitle('Categories')} + {getPageTitle('الأقسام')} - + {''} - {hasCreatePermission && } + {hasCreatePermission && } - + {hasCreatePermission && ( setIsModalActive(true)} /> )} @@ -120,7 +120,7 @@ const CategoriesTablesPage = () => {
- Back to table + العودة إلى الجدول
@@ -135,9 +135,9 @@ const CategoriesTablesPage = () => { { const { id } = router.query; - function removeLastCharacter(str) { - console.log(str,`str`) - return str.slice(0, -1); - } useEffect(() => { dispatch(fetch({ id })); @@ -46,13 +42,13 @@ const CategoriesView = () => { return ( <> - {getPageTitle('View categories')} + {getPageTitle('تفاصيل القسم')} - + @@ -91,7 +87,7 @@ const CategoriesView = () => { -

{categories?.shop?.shop_name ?? 'No data'}

+

{categories?.shop?.shop_name ?? 'لا توجد بيانات'}

@@ -117,7 +113,7 @@ const CategoriesView = () => {
-

اسمالقسم

+

اسم القسم

{categories?.category_name}

@@ -150,7 +146,7 @@ const CategoriesView = () => { - +