From 614be0c9160c4c027834f594b085f4499db4bf92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sedat=20=C3=96ZT=C3=9CRK?= <76204082+iamsedatozturk@users.noreply.github.com> Date: Thu, 21 Aug 2025 17:57:00 +0300 Subject: [PATCH] =?UTF-8?q?Routes=20g=C3=BCncellemeleri?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../developerKit/ComponentEditor.tsx | 6 +- .../developerKit/ComponentManager.tsx | 8 +- ui/src/components/developerKit/Dashboard.tsx | 275 +++++++++--------- .../components/developerKit/EntityEditor.tsx | 68 +++-- .../components/developerKit/EntityManager.tsx | 218 ++++++++------ .../developerKit/MigrationManager.tsx | 56 +++- ui/src/components/layouts/DeveloperLayout.tsx | 10 +- ui/src/components/reports/ReportGenerator.tsx | 3 +- ui/src/routes/route.constant.ts | 34 ++- ui/src/views/admin/listForm/edit/FormEdit.tsx | 3 +- .../organization-unit/OrganizationUnits.tsx | 6 +- ui/src/views/admin/user-management/Users.tsx | 6 +- ui/src/views/auth/VerifyConfirmationCode.tsx | 7 +- ui/src/views/form/useGridData.tsx | 7 +- ui/src/views/list/useFilters.tsx | 11 +- 15 files changed, 423 insertions(+), 295 deletions(-) diff --git a/ui/src/components/developerKit/ComponentEditor.tsx b/ui/src/components/developerKit/ComponentEditor.tsx index 42a771fc..a577e32c 100644 --- a/ui/src/components/developerKit/ComponentEditor.tsx +++ b/ui/src/components/developerKit/ComponentEditor.tsx @@ -1,7 +1,7 @@ import React, { useState, useEffect, useCallback } from 'react' import { useParams, useNavigate } from 'react-router-dom' import { useComponents } from '../../contexts/ComponentContext' -import { FaRegSave, FaArrowLeft, FaExclamationCircle, FaSync } from 'react-icons/fa'; +import { FaRegSave, FaArrowLeft, FaExclamationCircle, FaSync } from 'react-icons/fa' import { parseReactCode } from '../../utils/codeParser' import ComponentPreview from '../../components/componentEditor/ComponentPreview' import { EditorState } from '../../@types/componentInfo' @@ -129,7 +129,7 @@ const ComponentEditor: React.FC = () => { addComponent(componentData) } - navigate(ROUTES_ENUM.protected.saas.developerKitComponents) + navigate(ROUTES_ENUM.protected.saas.developerKit.components) } catch (error) { console.error('Error saving component:', error) alert('Failed to save component. Please try again.') @@ -159,7 +159,7 @@ const ComponentEditor: React.FC = () => {
@@ -245,7 +245,7 @@ const ComponentManager: React.FC = () => {
{ {

{!searchTerm && filterActive === 'all' && ( diff --git a/ui/src/components/developerKit/Dashboard.tsx b/ui/src/components/developerKit/Dashboard.tsx index 4c5b848c..c95f751b 100644 --- a/ui/src/components/developerKit/Dashboard.tsx +++ b/ui/src/components/developerKit/Dashboard.tsx @@ -1,8 +1,8 @@ -import React from "react"; -import { Link } from "react-router-dom"; -import { useComponents } from "../../contexts/ComponentContext"; -import { useEntities } from "../../contexts/EntityContext"; -import { useSystemHealth } from "../../utils/hooks/useDeveloperKit"; +import React from 'react' +import { Link } from 'react-router-dom' +import { useComponents } from '../../contexts/ComponentContext' +import { useEntities } from '../../contexts/EntityContext' +import { useSystemHealth } from '../../utils/hooks/useDeveloperKit' import { FaDatabase, FaBolt, @@ -15,15 +15,15 @@ import { FaArrowRight, FaExclamationCircle, FaWifi, - FaWindowClose -} from 'react-icons/fa'; -import { ROUTES_ENUM } from "@/routes/route.constant"; -import { useLocalization } from "@/utils/hooks/useLocalization"; + FaWindowClose, +} from 'react-icons/fa' +import { ROUTES_ENUM } from '@/routes/route.constant' +import { useLocalization } from '@/utils/hooks/useLocalization' const Dashboard: React.FC = () => { - const { components } = useComponents(); - const { entities, migrations, generatedEndpoints } = useEntities(); - const { isOnline, lastCheck, recheckHealth } = useSystemHealth(); + const { components } = useComponents() + const { entities, migrations, generatedEndpoints } = useEntities() + const { isOnline, lastCheck, recheckHealth } = useSystemHealth() const { translate } = useLocalization() const stats = [ @@ -32,38 +32,38 @@ const Dashboard: React.FC = () => { value: entities.filter((e) => e.isActive).length, total: entities.length, icon: FaDatabase, - color: "text-blue-600", - bgColor: "bg-blue-100", - href: ROUTES_ENUM.protected.saas.developerKitEntities, + color: 'text-blue-600', + bgColor: 'bg-blue-100', + href: ROUTES_ENUM.protected.saas.developerKit.entities, }, { name: translate('::App.DeveloperKit.Dashboard.Stats.Migrations'), - value: migrations.filter((m) => m.status === "pending").length, + value: migrations.filter((m) => m.status === 'pending').length, total: migrations.length, icon: FaBolt, - color: "text-yellow-600", - bgColor: "bg-yellow-100", - href: ROUTES_ENUM.protected.saas.developerKitMigrations, + color: 'text-yellow-600', + bgColor: 'bg-yellow-100', + href: ROUTES_ENUM.protected.saas.developerKit.migrations, }, { name: translate('::App.DeveloperKit.Dashboard.Stats.APIs'), value: generatedEndpoints.filter((e) => e.isActive).length, total: generatedEndpoints.length, icon: FaServer, - color: "text-emerald-600", - bgColor: "bg-emerald-100", - href: ROUTES_ENUM.protected.saas.developerKitEndpoints, + color: 'text-emerald-600', + bgColor: 'bg-emerald-100', + href: ROUTES_ENUM.protected.saas.developerKit.endpoints, }, { name: translate('::App.DeveloperKit.Dashboard.Stats.Components'), value: components?.filter((c) => c.isActive).length, total: components?.length, icon: FaPuzzlePiece, - color: "text-purple-600", - bgColor: "bg-purple-100", - href: ROUTES_ENUM.protected.saas.developerKitComponents, + color: 'text-purple-600', + bgColor: 'bg-purple-100', + href: ROUTES_ENUM.protected.saas.developerKit.components, }, - ]; + ] const developmentFlow = [ { @@ -71,54 +71,50 @@ const Dashboard: React.FC = () => { title: translate('::App.DeveloperKit.Dashboard.Flow.CreateEntity'), description: translate('::App.DeveloperKit.Dashboard.Flow.CreateEntity.Desc'), icon: FaDatabase, - color: "bg-blue-600", - href: ROUTES_ENUM.protected.saas.developerKitEntitiesNew, - status: "ready", + color: 'bg-blue-600', + href: ROUTES_ENUM.protected.saas.developerKit.entitiesNew, + status: 'ready', }, { step: 2, title: translate('::App.DeveloperKit.Dashboard.Flow.GenerateMigration'), description: translate('::App.DeveloperKit.Dashboard.Flow.GenerateMigration.Desc'), icon: FaBolt, - color: "bg-yellow-600", - href: ROUTES_ENUM.protected.saas.developerKitMigrations, - status: entities.some((e) => e.migrationStatus === "pending") - ? "action-needed" - : "ready", + color: 'bg-yellow-600', + href: ROUTES_ENUM.protected.saas.developerKit.migrations, + status: entities.some((e) => e.migrationStatus === 'pending') ? 'action-needed' : 'ready', }, { step: 3, title: translate('::App.DeveloperKit.Dashboard.Flow.ApplyMigration'), description: translate('::App.DeveloperKit.Dashboard.Flow.ApplyMigration.Desc'), icon: FaCheckCircle, - color: "bg-green-600", - href: ROUTES_ENUM.protected.saas.developerKitMigrations, - status: migrations.some((m) => m.status === "pending") - ? "action-needed" - : "ready", + color: 'bg-green-600', + href: ROUTES_ENUM.protected.saas.developerKit.migrations, + status: migrations.some((m) => m.status === 'pending') ? 'action-needed' : 'ready', }, { step: 4, title: translate('::App.DeveloperKit.Dashboard.Flow.GenerateAPI'), description: translate('::App.DeveloperKit.Dashboard.Flow.GenerateAPI.Desc'), icon: FaServer, - color: "bg-emerald-600", - href: ROUTES_ENUM.protected.saas.developerKitEndpoints, - status: "ready", + color: 'bg-emerald-600', + href: ROUTES_ENUM.protected.saas.developerKit.endpoints, + status: 'ready', }, { step: 5, title: translate('::App.DeveloperKit.Dashboard.Flow.BuildComponent'), description: translate('::App.DeveloperKit.Dashboard.Flow.BuildComponent.Desc'), icon: FaPuzzlePiece, - color: "bg-purple-600", - href: ROUTES_ENUM.protected.saas.developerKitComponentsNew, - status: "ready", + color: 'bg-purple-600', + href: ROUTES_ENUM.protected.saas.developerKit.componentsNew, + status: 'ready', }, - ]; + ] - const recentEntities = entities.slice(0, 3); - const recentMigrations = migrations.slice(0, 3); + const recentEntities = entities.slice(0, 3) + const recentMigrations = migrations.slice(0, 3) const recentEndpoints = [ ...generatedEndpoints.map((e) => ({ id: e.id, @@ -130,28 +126,36 @@ const Dashboard: React.FC = () => { lastModificationTime: e.lastModificationTime, creationTime: e.creationTime, })), - ].slice(0, 3); + ].slice(0, 3) const systemHealth = [ - { name: translate('::App.DeveloperKit.Dashboard.SystemHealth.Frontend'), status: translate('::App.DeveloperKit.Dashboard.SystemHealth.Healthy'), icon: FaCode }, + { + name: translate('::App.DeveloperKit.Dashboard.SystemHealth.Frontend'), + status: translate('::App.DeveloperKit.Dashboard.SystemHealth.Healthy'), + icon: FaCode, + }, { name: translate('::App.DeveloperKit.Dashboard.SystemHealth.Backend'), - status: isOnline ? translate('::App.DeveloperKit.Dashboard.SystemHealth.Healthy') : translate('::App.DeveloperKit.Dashboard.SystemHealth.Offline'), + status: isOnline + ? translate('::App.DeveloperKit.Dashboard.SystemHealth.Healthy') + : translate('::App.DeveloperKit.Dashboard.SystemHealth.Offline'), icon: FaServer, }, { name: translate('::App.DeveloperKit.Dashboard.SystemHealth.Database'), - status: isOnline ? translate('::App.DeveloperKit.Dashboard.SystemHealth.Healthy') : translate('::App.DeveloperKit.Dashboard.SystemHealth.Unknown'), + status: isOnline + ? translate('::App.DeveloperKit.Dashboard.SystemHealth.Healthy') + : translate('::App.DeveloperKit.Dashboard.SystemHealth.Unknown'), icon: FaDatabase, }, { name: translate('::App.DeveloperKit.Dashboard.SystemHealth.Migrations'), - status: migrations.some((m) => m.status === "failed") + status: migrations.some((m) => m.status === 'failed') ? translate('::App.DeveloperKit.Dashboard.SystemHealth.Warning') : translate('::App.DeveloperKit.Dashboard.SystemHealth.Healthy'), icon: FaBolt, }, - ]; + ] return (
@@ -161,25 +165,21 @@ const Dashboard: React.FC = () => {

{translate('::App.DeveloperKit.Dashboard.Title')}

-

- {translate('::App.DeveloperKit.Dashboard.Description')} -

+

{translate('::App.DeveloperKit.Dashboard.Description')}

{developmentFlow.map((flow, index) => { - const Icon = flow.icon; + const Icon = flow.icon return (
{

{flow.title}

{flow.description}

- {flow.status === "action-needed" && ( + {flow.status === 'action-needed' && (
@@ -273,7 +269,7 @@ const Dashboard: React.FC = () => {
)} - ); + ) })}
@@ -284,12 +280,12 @@ const Dashboard: React.FC = () => {

- {translate('::App.DeveloperKit.Dashboard.SystemHealth.Title') } + {translate('::App.DeveloperKit.Dashboard.SystemHealth.Title')}

{systemHealth.map((system) => { - const Icon = system.icon; + const Icon = system.icon return (
{ >
- - {system.name} - + {system.name}
- {system.status === "offline" ? "Offline" : system.status} + {system.status === 'offline' ? 'Offline' : system.status}
- ); + ) })}
@@ -340,7 +334,7 @@ const Dashboard: React.FC = () => { {translate('::App.DeveloperKit.Dashboard.RecentEntities.Title')} {translate('::App.DeveloperKit.Dashboard.ViewAll')} @@ -354,9 +348,7 @@ const Dashboard: React.FC = () => { className="flex items-center justify-between p-3 bg-slate-50 rounded-lg hover:bg-slate-100 transition-colors" >
-

- {entity.displayName} -

+

{entity.displayName}

{entity.fields.length} fields • {entity.migrationStatus}

@@ -364,15 +356,18 @@ const Dashboard: React.FC = () => {
@@ -383,9 +378,11 @@ const Dashboard: React.FC = () => { ) : (
-

{translate('::App.DeveloperKit.Dashboard.Empty.Entity')}

+

+ {translate('::App.DeveloperKit.Dashboard.Empty.Entity')} +

Create your first entity @@ -402,7 +399,7 @@ const Dashboard: React.FC = () => { {translate('::App.DeveloperKit.Dashboard.RecentMigrations.Title')} {translate('::App.DeveloperKit.Dashboard.ViewAll')} @@ -416,26 +413,23 @@ const Dashboard: React.FC = () => { className="flex items-center justify-between p-3 bg-slate-50 rounded-lg hover:bg-slate-100 transition-colors" >
-

- {migration.entityName} -

+

{migration.entityName}

- {migration.status} •{" "} - {new Date(migration.creationTime).toLocaleDateString()} + {migration.status} • {new Date(migration.creationTime).toLocaleDateString()}

@@ -446,9 +440,11 @@ const Dashboard: React.FC = () => { ) : (
-

{translate('::App.DeveloperKit.Dashboard.Empty.Migration')}

+

+ {translate('::App.DeveloperKit.Dashboard.Empty.Migration')} +

{translate('::App.DeveloperKit.Dashboard.Action.GenerateMigrations')} @@ -465,7 +461,7 @@ const Dashboard: React.FC = () => { {translate('::App.DeveloperKit.Dashboard.RecentEndpoints.Title')} {translate('::App.DeveloperKit.Dashboard.ViewAll')} @@ -482,33 +478,28 @@ const Dashboard: React.FC = () => {
{endpoint.method} -

- {endpoint.name} -

+

{endpoint.name}

{endpoint.path}

- +
@@ -517,9 +508,11 @@ const Dashboard: React.FC = () => { ) : (
-

{translate('::App.DeveloperKit.Dashboard.Empty.Endpoint')}

+

+ {translate('::App.DeveloperKit.Dashboard.Empty.Endpoint')} +

{translate('::App.DeveloperKit.Dashboard.Action.CreateEntity')} @@ -530,7 +523,7 @@ const Dashboard: React.FC = () => {
- ); -}; + ) +} -export default Dashboard; +export default Dashboard diff --git a/ui/src/components/developerKit/EntityEditor.tsx b/ui/src/components/developerKit/EntityEditor.tsx index ccc22d09..a7056450 100644 --- a/ui/src/components/developerKit/EntityEditor.tsx +++ b/ui/src/components/developerKit/EntityEditor.tsx @@ -7,8 +7,8 @@ import { FaPlus, FaTrashAlt, FaDatabase, - FaQuestionCircle -} from 'react-icons/fa'; + FaQuestionCircle, +} from 'react-icons/fa' import { CreateUpdateCustomEntityFieldDto, CustomEntityField } from '@/proxy/developerKit/models' import { ROUTES_ENUM } from '@/routes/route.constant' import { useLocalization } from '@/utils/hooks/useLocalization' @@ -150,7 +150,7 @@ const EntityEditor: React.FC = () => { addEntity(entityData) } - navigate(ROUTES_ENUM.protected.saas.developerKitEntities) + navigate(ROUTES_ENUM.protected.saas.developerKit.entities) } catch (error) { console.error('Error saving entity:', error) alert('Failed to save entity. Please try again.') @@ -176,7 +176,7 @@ const EntityEditor: React.FC = () => {
@@ -224,10 +228,14 @@ const EntityEditor: React.FC = () => { {/* Entity Basic Info */}
-

{translate('::App.DeveloperKit.EntityEditor.BasicInfo')}

+

+ {translate('::App.DeveloperKit.EntityEditor.BasicInfo')} +

- + { />
- + { )}
- + { {isEditing && (
-

{translate('::App.DeveloperKit.EntityEditor.Status')}

+

+ {translate('::App.DeveloperKit.EntityEditor.Status')} +

- {translate('::App.DeveloperKit.EntityEditor.Status.Migration')} + + {translate('::App.DeveloperKit.EntityEditor.Status.Migration')} + {
- {translate('::App.DeveloperKit.EntityEditor.Status.Endpoint')} + + {translate('::App.DeveloperKit.EntityEditor.Status.Endpoint')} + { onChange={(e) => setIsActive(e.target.checked)} className="rounded border-slate-300 text-emerald-600 focus:ring-emerald-500" /> - {translate('::App.DeveloperKit.EntityEditor.Active')} + + {translate('::App.DeveloperKit.EntityEditor.Active')} +