From 02bb117798b8c054048e480b2e6bb7d0ae0fe3e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sedat=20=C3=96ZT=C3=9CRK?= <76204082+iamsedatozturk@users.noreply.github.com> Date: Mon, 15 Sep 2025 13:52:02 +0300 Subject: [PATCH] =?UTF-8?q?erp=20mod=C3=BClleri=20route=20d=C3=BCzenlemesi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Seeds/SeederData.json | 767 ++++++++++++++++++ ui/dev-dist/sw.js | 2 +- .../maintenance/components/WorkCenterList.tsx | 188 ++--- .../{MaterialGroup.tsx => MaterialGroups.tsx} | 272 +++---- .../components/PurchaseRequests.tsx | 156 ++-- 5 files changed, 998 insertions(+), 387 deletions(-) rename ui/src/views/supplyChain/components/{MaterialGroup.tsx => MaterialGroups.tsx} (75%) diff --git a/api/src/Kurs.Platform.DbMigrator/Seeds/SeederData.json b/api/src/Kurs.Platform.DbMigrator/Seeds/SeederData.json index 643b83a8..4bdeb9df 100644 --- a/api/src/Kurs.Platform.DbMigrator/Seeds/SeederData.json +++ b/api/src/Kurs.Platform.DbMigrator/Seeds/SeederData.json @@ -4684,6 +4684,773 @@ "componentPath": "@/views/classroom/PlanningPage", "routeType": "protected", "authority": ["App.Classroom.Planning"] + }, + + { + "key": "admin.supplychain.materialTypes", + "path": "/admin/supplychain/materials/types", + "componentPath": "@/views/supplychain/components/MaterialTypes", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.supplychain.materialGroups", + "path": "/admin/supplychain/materials/groups", + "componentPath": "@/views/supplychain/components/MaterialGroups", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.supplychain.materials", + "path": "/admin/supplychain/materials", + "componentPath": "@/views/supplychain/components/MaterialList", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.supplychain.materialsNew", + "path": "/admin/supplychain/materials/new", + "componentPath": "@/views/supplychain/components/MaterialForm", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.supplychain.materialsEdit", + "path": "/admin/supplychain/materials/edit/:id", + "componentPath": "@/views/supplychain/components/MaterialForm", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.supplychain.materialsDetail", + "path": "/admin/supplychain/materials/detail/:id", + "componentPath": "@/views/supplychain/components/MaterialCard", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.supplychain.suppliers", + "path": "/admin/supplychain/suppliers", + "componentPath": "@/views/supplychain/components/SupplierCards", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.supplychain.requests", + "path": "/admin/supplychain/requests", + "componentPath": "@/views/supplychain/components/PurchaseRequests", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.supplychain.requestsNew", + "path": "/admin/supplychain/requests/new", + "componentPath": "@/views/supplychain/components/PurchaseRequestForm", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.supplychain.requestsEdit", + "path": "/admin/supplychain/requests/edit/:id", + "componentPath": "@/views/supplychain/components/PurchaseRequestForm", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.supplychain.requestsView", + "path": "/admin/supplychain/requests/view/:id", + "componentPath": "@/views/supplychain/components/PurchaseRequestForm", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.supplychain.quotations", + "path": "/admin/supplychain/quotations", + "componentPath": "@/views/supplychain/components/QuotationManagement", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.supplychain.quotationsNew", + "path": "/admin/supplychain/quotations/new", + "componentPath": "@/views/supplychain/components/QuotationForm", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.supplychain.quotationsEdit", + "path": "/admin/supplychain/quotations/edit/:id", + "componentPath": "@/views/supplychain/components/QuotationForm", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.supplychain.quotationsView", + "path": "/admin/supplychain/quotations/view/:id", + "componentPath": "@/views/supplychain/components/QuotationForm", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.supplychain.approvals", + "path": "/admin/supplychain/approvals", + "componentPath": "@/views/supplychain/components/ApprovalWorkflows", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.supplychain.orders", + "path": "/admin/supplychain/orders", + "componentPath": "@/views/supplychain/components/OrderManagement", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.supplychain.ordersNew", + "path": "/admin/supplychain/orders/new", + "componentPath": "@/views/supplychain/components/OrderManagementForm", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.supplychain.ordersEdit", + "path": "/admin/supplychain/orders/edit/:id", + "componentPath": "@/views/supplychain/components/OrderManagementForm", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.supplychain.ordersView", + "path": "/admin/supplychain/orders/view/:id", + "componentPath": "@/views/supplychain/components/OrderManagementForm", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.supplychain.delivery", + "path": "/admin/supplychain/delivery", + "componentPath": "@/views/supplychain/components/DeliveryTracking", + "routeType": "protected", + "authority": null + }, + + { + "key": "admin.maintenance.equipment", + "path": "/admin/maintenance/equipment", + "componentPath": "@/views/maintenance/components/WorkCenterCards", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.maintenance.equipmentNew", + "path": "/admin/maintenance/equipment/new", + "componentPath": "@/views/maintenance/components/WorkCenterCards", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.maintenance.equipmentEdit", + "path": "/admin/maintenance/equipment/edit/:id", + "componentPath": "@/views/maintenance/components/WorkCenterCards", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.maintenance.equipmentDetail", + "path": "/admin/maintenance/equipment/:id", + "componentPath": "@/views/maintenance/components/WorkCenterCards", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.maintenance.workcenters", + "path": "/admin/maintenance/workcenters", + "componentPath": "@/views/maintenance/components/WorkCenterCards", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.maintenance.plans", + "path": "/admin/maintenance/plans", + "componentPath": "@/views/maintenance/components/MaintenancePlans", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.maintenance.calendar", + "path": "/admin/maintenance/calendar", + "componentPath": "@/views/maintenance/components/MaintenanceCalendar", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.maintenance.teams", + "path": "/admin/maintenance/teams", + "componentPath": "@/views/maintenance/components/MaintenanceTeams", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.maintenance.faults", + "path": "/admin/maintenance/faults", + "componentPath": "@/views/maintenance/components/FaultNotifications", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.maintenance.workorders", + "path": "/admin/maintenance/workorders", + "componentPath": "@/views/maintenance/components/MaintenanceWorkOrders", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.maintenance.workordersNew", + "path": "/admin/maintenance/workorders/new", + "componentPath": "@/views/maintenance/components/MaintenanceWorkOrders", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.maintenance.workordersDetail", + "path": "/admin/maintenance/workorders/:id", + "componentPath": "@/views/maintenance/components/MaintenanceWorkOrders", + "routeType": "protected", + "authority": null + }, + + { + "key": "admin.warehouse.definitions", + "path": "/admin/warehouse/definitions", + "componentPath": "@/views/warehouse/components/WarehouseDefinitions", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.warehouse.tracking", + "path": "/admin/warehouse/tracking", + "componentPath": "@/views/warehouse/components/LocationTracking", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.warehouse.putaway", + "path": "/admin/warehouse/putaway", + "componentPath": "@/views/warehouse/components/PutawayRules", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.warehouse.receipt", + "path": "/admin/warehouse/receipt", + "componentPath": "@/views/warehouse/components/WarehouseReceipt", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.warehouse.issue", + "path": "/admin/warehouse/issue", + "componentPath": "@/views/warehouse/components/WarehouseIssue", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.warehouse.transfer", + "path": "/admin/warehouse/transfer", + "componentPath": "@/views/warehouse/components/WarehouseTransfer", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.warehouse.inventory", + "path": "/admin/warehouse/inventory", + "componentPath": "@/views/warehouse/components/StockLevelsInventory", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.warehouse.movements", + "path": "/admin/warehouse/movements", + "componentPath": "@/views/warehouse/components/MaterialMovements", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.warehouse.movementDetail", + "path": "/admin/warehouse/movements/:id", + "componentPath": "@/views/warehouse/components/MaterialMovements", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.warehouse.stocklevel", + "path": "/admin/warehouse/stocklevel", + "componentPath": "@/views/warehouse/components/InventoryTracking", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.warehouse.warehouses", + "path": "/admin/warehouse/warehouses", + "componentPath": "@/views/warehouse/components/WarehouseDefinitions", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.warehouse.warehouseNew", + "path": "/admin/warehouse/new", + "componentPath": "@/views/warehouse/components/WarehouseDefinitions", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.warehouse.warehouseEdit", + "path": "/admin/warehouse/edit/:id", + "componentPath": "@/views/warehouse/components/WarehouseDefinitions", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.warehouse.warehouseDetail", + "path": "/admin/warehouse/warehouses/:id", + "componentPath": "@/views/warehouse/components/WarehouseDefinitions", + "routeType": "protected", + "authority": null + }, + + { + "key": "admin.project.list", + "path": "/admin/project", + "componentPath": "@/views/project/components/ProjectList", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.project.new", + "path": "/admin/project/new", + "componentPath": "@/views/project/components/ProjectForm", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.project.edit", + "path": "/admin/project/edit/:id", + "componentPath": "@/views/project/components/ProjectForm", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.project.detail", + "path": "/admin/project/:id", + "componentPath": "@/views/project/components/ProjectView", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.project.tasks", + "path": "/admin/project/tasks", + "componentPath": "@/views/project/components/ProjectTasks", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.project.phases", + "path": "/admin/project/phases", + "componentPath": "@/views/project/components/ProjectPhases", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.project.activities", + "path": "/admin/project/activities", + "componentPath": "@/views/project/components/ActivityTypes", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.project.workload", + "path": "/admin/project/workload", + "componentPath": "@/views/project/components/ProjectGantt", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.project.costTracking", + "path": "/admin/project/cost-tracking", + "componentPath": "@/views/project/components/CostTimeTracking", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.project.dailyUpdates", + "path": "/admin/project/daily-updates", + "componentPath": "@/views/project/components/TaskDailyUpdates", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.hr.employees", + "path": "/admin/hr/employees", + "componentPath": "@/views/hr/components/EmployeeList", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.hr.employeesNew", + "path": "/admin/hr/employees/new", + "componentPath": "@/views/hr/components/EmployeeForm", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.hr.employeesEdit", + "path": "/admin/hr/employees/edit/:id", + "componentPath": "@/views/hr/components/EmployeeForm", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.hr.employeesDetail", + "path": "/admin/hr/employees/:id", + "componentPath": "@/views/hr/components/EmployeeView", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.hr.departments", + "path": "/admin/hr/departments", + "componentPath": "@/views/hr/components/DepartmentManagement", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.hr.jobPositions", + "path": "/admin/hr/job-positions", + "componentPath": "@/views/hr/components/JobPositions", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.hr.employmentTypes", + "path": "/admin/hr/employment-types", + "componentPath": "@/views/hr/components/EmploymentTypes", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.hr.organization", + "path": "/admin/hr/organization", + "componentPath": "@/views/hr/components/OrganizationChart", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.hr.badges", + "path": "/admin/hr/badges", + "componentPath": "@/views/hr/components/BadgeManagement", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.hr.leaveManagement", + "path": "/admin/hr/leave-management", + "componentPath": "@/views/hr/components/LeaveManagement", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.hr.overtimes", + "path": "/admin/hr/overtimes-management", + "componentPath": "@/views/hr/components/OvertimeManagement", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.hr.payroll", + "path": "/admin/hr/payroll", + "componentPath": "@/views/hr/components/PayrollManagement", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.hr.costCenters", + "path": "/admin/hr/cost-centers", + "componentPath": "@/views/hr/components/CostCenterManagement", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.hr.evaluationTemplates", + "path": "/admin/hr/360-templates", + "componentPath": "@/views/hr/components/Degree360Templates", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.hr.evaluation", + "path": "/admin/hr/360-evaluation", + "componentPath": "@/views/hr/components/Degree360Evaluation", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.crm.customers", + "path": "/admin/crm/customers", + "componentPath": "@/views/crm/components/CustomerListWithToggle", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.crm.customersNew", + "path": "/admin/crm/customers/new", + "componentPath": "@/views/crm/components/CustomerForm", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.crm.customersEdit", + "path": "/admin/crm/customers/edit/:id", + "componentPath": "@/views/crm/components/CustomerEdit", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.crm.customersDetail", + "path": "/admin/crm/customers/:id", + "componentPath": "@/views/crm/components/CustomerView", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.crm.salesTeams", + "path": "/admin/crm/sales-teams", + "componentPath": "@/views/crm/components/SalesTeams", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.crm.salesTeamsNew", + "path": "/admin/crm/sales-teams/new", + "componentPath": "@/views/crm/components/SalesTeamCreate", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.crm.salesTeamsEdit", + "path": "/admin/crm/sales-teams/edit/:id", + "componentPath": "@/views/crm/components/SalesTeamEdit", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.crm.salesTeamsDetail", + "path": "/admin/crm/sales-teams/:id", + "componentPath": "@/views/crm/components/SalesTeamView", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.crm.lossReasons", + "path": "/admin/crm/loss-reasons", + "componentPath": "@/views/crm/components/LossReasons", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.crm.opportunities", + "path": "/admin/crm/opportunities", + "componentPath": "@/views/crm/components/OpportunityManagement", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.crm.opportunitiesNew", + "path": "/admin/crm/opportunities/new", + "componentPath": "@/views/crm/components/OpportunityManagement", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.crm.opportunitiesEdit", + "path": "/admin/crm/opportunities/edit/:id", + "componentPath": "@/views/crm/components/OpportunityManagement", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.crm.opportunitiesDetail", + "path": "/admin/crm/opportunities/:id", + "componentPath": "@/views/crm/components/OpportunityManagement", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.crm.activities", + "path": "/admin/crm/activities", + "componentPath": "@/views/crm/components/ActivityRecords", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.crm.salesOrders", + "path": "/admin/crm/sales-orders", + "componentPath": "@/views/crm/components/SalesOrders", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.crm.salesOrdersNew", + "path": "/admin/crm/sales-orders/new", + "componentPath": "@/views/crm/components/SalesOrderForm", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.crm.salesOrdersEdit", + "path": "/admin/crm/sales-orders/edit/:id", + "componentPath": "@/views/crm/components/SalesOrderForm", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.crm.salesOrdersDetail", + "path": "/admin/crm/sales-orders/:id", + "componentPath": "@/views/crm/components/SalesOrderView", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.mrp.operationTypes", + "path": "/admin/mrp/operation-types", + "componentPath": "@/views/mrp/components/OperationTypes", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.mrp.workcenters", + "path": "/admin/mrp/workcenters", + "componentPath": "@/views/maintenance/components/WorkCenterCards", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.mrp.operations", + "path": "/admin/mrp/operations", + "componentPath": "@/views/mrp/components/OperationDefinitions", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.mrp.bom", + "path": "/admin/mrp/bom", + "componentPath": "@/views/mrp/components/BOMManagement", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.mrp.productionOrders", + "path": "/admin/mrp/production-orders", + "componentPath": "@/views/mrp/components/ProductionOrderList", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.mrp.productionOrderNew", + "path": "/admin/mrp/production-orders/new", + "componentPath": "@/views/mrp/components/ProductionOrderForm", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.mrp.productionOrderEdit", + "path": "/admin/mrp/production-orders/:id/edit", + "componentPath": "@/views/mrp/components/ProductionOrderForm", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.mrp.productionOrderDetail", + "path": "/admin/mrp/production-orders/:id", + "componentPath": "@/views/mrp/components/ProductionOrderView", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.mrp.workOrders", + "path": "/admin/mrp/work-orders", + "componentPath": "@/views/mrp/components/WorkOrders", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.mrp.demandPlanning", + "path": "/admin/mrp/demand-planning", + "componentPath": "@/views/mrp/components/DemandPlanning", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.mrp.materialRequirements", + "path": "/admin/mrp/material-requirements", + "componentPath": "@/views/mrp/components/Requirements", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.mrp.planningGantt", + "path": "/admin/mrp/planning-gantt", + "componentPath": "@/views/mrp/components/PlanningGantt", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.accounting.currentAccounts", + "path": "/admin/accounting/current-accounts", + "componentPath": "@/views/accounting/CurrentAccountPage", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.accounting.waybills", + "path": "/admin/accounting/waybills", + "componentPath": "@/views/accounting/WaybillPage", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.accounting.invoices", + "path": "/admin/accounting/invoices", + "componentPath": "@/views/accounting/InvoicePage", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.accounting.invoicesNew", + "path": "/admin/accounting/invoices/new", + "componentPath": "@/views/accounting/InvoicePage", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.accounting.cash", + "path": "/admin/accounting/cash", + "componentPath": "@/views/accounting/CashPage", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.accounting.bank", + "path": "/admin/accounting/bank", + "componentPath": "@/views/accounting/BankPage", + "routeType": "protected", + "authority": null + }, + { + "key": "admin.accounting.checkNote", + "path": "/admin/accounting/check-note", + "componentPath": "@/views/accounting/CheckNotePage", + "routeType": "protected", + "authority": null } ], "Languages": [ diff --git a/ui/dev-dist/sw.js b/ui/dev-dist/sw.js index df068850..fc7777c8 100644 --- a/ui/dev-dist/sw.js +++ b/ui/dev-dist/sw.js @@ -82,7 +82,7 @@ define(['./workbox-a959eb95'], (function (workbox) { 'use strict'; "revision": "3ca0b8505b4bec776b69afdba2768812" }, { "url": "/index.html", - "revision": "0.jnromdj77f8" + "revision": "0.3df79cnep3" }], {}); workbox.cleanupOutdatedCaches(); workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("/index.html"), { diff --git a/ui/src/views/maintenance/components/WorkCenterList.tsx b/ui/src/views/maintenance/components/WorkCenterList.tsx index da20eca8..83cf855f 100644 --- a/ui/src/views/maintenance/components/WorkCenterList.tsx +++ b/ui/src/views/maintenance/components/WorkCenterList.tsx @@ -1,6 +1,6 @@ -import React, { useState } from "react"; -import { Link } from "react-router-dom"; -import { useQuery } from "@tanstack/react-query"; +import React, { useState } from 'react' +import { Link } from 'react-router-dom' +import { useQuery } from '@tanstack/react-query' import { FaCog, FaPlus, @@ -15,45 +15,44 @@ import { FaChartLine, FaCalendar, FaArrowUp, -} from "react-icons/fa"; -import classNames from "classnames"; -import { WorkCenterStatusEnum, CriticalityLevelEnum } from "../../../types/pm"; -import dayjs from "dayjs"; -import { mockWorkCenters } from "../../../mocks/mockWorkCenters"; +} from 'react-icons/fa' +import classNames from 'classnames' +import { WorkCenterStatusEnum, CriticalityLevelEnum } from '../../../types/pm' +import dayjs from 'dayjs' +import { mockWorkCenters } from '../../../mocks/mockWorkCenters' import { getWorkCenterStatusColor, getWorkCenterStatusIcon, getWorkCenterStatusText, getCriticalityLevelColor, getCriticalityLevelText, -} from "../../../utils/erp"; +} from '../../../utils/erp' const WorkCenterList: React.FC = () => { - const [searchTerm, setSearchTerm] = useState(""); - const [filterStatus, setFilterStatus] = useState("all"); - const [filterCriticality, setFilterCriticality] = useState("all"); - const [showFilters, setShowFilters] = useState(false); + const [searchTerm, setSearchTerm] = useState('') + const [filterStatus, setFilterStatus] = useState('all') + const [filterCriticality, setFilterCriticality] = useState('all') + const [showFilters, setShowFilters] = useState(false) const { data: workCenter, isLoading, error, } = useQuery({ - queryKey: ["workCenter", searchTerm, filterStatus, filterCriticality], + queryKey: ['workCenter', searchTerm, filterStatus, filterCriticality], queryFn: async () => { - await new Promise((resolve) => setTimeout(resolve, 500)); + await new Promise((resolve) => setTimeout(resolve, 500)) return mockWorkCenters.filter((eq) => { const matchesSearch = eq.code.toLowerCase().includes(searchTerm.toLowerCase()) || - eq.name.toLowerCase().includes(searchTerm.toLowerCase()); - const matchesStatus = - filterStatus === "all" || eq.status === filterStatus; + eq.name.toLowerCase().includes(searchTerm.toLowerCase()) + const matchesStatus = filterStatus === 'all' || eq.status === filterStatus const matchesCriticality = - filterCriticality === "all" || eq.criticality === filterCriticality; - return matchesSearch && matchesStatus && matchesCriticality; - }); + filterCriticality === 'all' || eq.criticality === filterCriticality + return matchesSearch && matchesStatus && matchesCriticality + }) }, - }); + }) if (isLoading) { return ( @@ -61,7 +60,7 @@ const WorkCenterList: React.FC = () => {
İş Merkezleri yükleniyor... - ); + ) } if (error) { @@ -69,12 +68,10 @@ const WorkCenterList: React.FC = () => {
- - İş merkezleri yüklenirken hata oluştu. - + İş merkezleri yüklenirken hata oluştu.
- ); + ) } return ( @@ -99,10 +96,10 @@ const WorkCenterList: React.FC = () => {