spine-framework 0.4.3 → 0.5.0-rc.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +13 -3
- package/.framework/cli/commands/bootstrap.ts +392 -0
- package/.framework/cli/commands/dev.ts +91 -218
- package/.framework/cli/commands/doctor.ts +132 -26
- package/.framework/cli/commands/generate.ts +38 -298
- package/.framework/cli/commands/init.ts +20 -1
- package/.framework/cli/commands/migrate.ts +36 -30
- package/.framework/cli/commands/migrations.ts +16 -56
- package/.framework/cli/commands/upgrade.ts +35 -0
- package/.framework/cli/commands/validate-schema.ts +147 -0
- package/.framework/cli/context.ts +223 -110
- package/.framework/cli/index.ts +6 -0
- package/.framework/cli/lib/project-files.ts +241 -1
- package/.framework/functions/_shared/agent-runner.ts +1000 -81
- package/.framework/functions/_shared/cil.ts +2 -1
- package/.framework/functions/_shared/db.ts +3 -6
- package/.framework/functions/_shared/hash-api-key.ts +183 -79
- package/.framework/functions/_shared/kb.ts +61 -7
- package/.framework/functions/_shared/logging.ts +562 -224
- package/.framework/functions/_shared/message-sequence.ts +53 -0
- package/.framework/functions/_shared/middleware.ts +47 -44
- package/.framework/functions/_shared/pipeline-runner.ts +150 -37
- package/.framework/functions/_shared/principal.ts +9 -6
- package/.framework/functions/_shared/trigger-engine.ts +149 -40
- package/.framework/functions/admin-data.ts +48 -31
- package/.framework/functions/ai-agents.ts +103 -33
- package/.framework/functions/api-keys.ts +301 -122
- package/.framework/functions/apps.ts +43 -26
- package/.framework/functions/cil-ingest.ts +48 -15
- package/.framework/functions/debug-auth.ts +14 -8
- package/.framework/functions/deliveries.ts +39 -12
- package/.framework/functions/embeddings.ts +145 -76
- package/.framework/functions/integration-outbound.ts +67 -27
- package/.framework/functions/integrations.ts +254 -127
- package/.framework/functions/logs.ts +273 -133
- package/.framework/functions/observability.ts +277 -147
- package/.framework/functions/pipeline-executions.ts +1 -1
- package/.framework/functions/pipeline-runner-background.ts +120 -0
- package/.framework/functions/pipelines.ts +14 -9
- package/.framework/functions/prompt-configs.ts +7 -4
- package/.framework/functions/roles.ts +8 -5
- package/.framework/functions/security.ts +30 -17
- package/.framework/functions/system-cron.ts +250 -128
- package/.framework/functions/tests.ts +7 -6
- package/.framework/functions/timers.ts +310 -107
- package/.framework/functions/trigger-scheduler.ts +65 -5
- package/.framework/functions/triggers.ts +28 -13
- package/.framework/functions/types.ts +13 -10
- package/.framework/migrations/064_episode_leases.sql +196 -0
- package/.framework/migrations/065_execution_tables_updated_at.sql +20 -0
- package/.framework/migrations/066_episode_steal_thread_merge.sql +148 -0
- package/.framework/migrations/067_episode_lease_stale_steal.sql +93 -0
- package/.framework/migrations/068_cron_schedule_timer_rpcs.sql +251 -0
- package/.framework/migrations/069_log_stats_window.sql +54 -0
- package/.framework/migrations/070_app_type_schema_rpcs.sql +166 -0
- package/.framework/migrations/071_timer_interval_keys.sql +96 -0
- package/.framework/migrations/072_slug_autofill.sql +77 -0
- package/.framework/migrations/073_seed_member_roles.sql +26 -0
- package/.framework/schemas/spine.config.schema.json +62 -0
- package/.framework/src/App.tsx +3 -1
- package/.framework/src/apps/admin/index.tsx +1141 -775
- package/.framework/src/components/ErrorBoundary.tsx +136 -0
- package/.framework/src/components/admin/AdminListPage.tsx +81 -73
- package/.framework/src/components/admin/AdminSidebar.tsx +92 -81
- package/.framework/src/components/admin/EntitySelect.tsx +181 -0
- package/.framework/src/components/admin/PageInstructions.tsx +86 -127
- package/.framework/src/components/app-shell/GenericAppShell.tsx +3 -1
- package/.framework/src/components/app-shell/GenericDetailPage.tsx +37 -13
- package/.framework/src/components/app-shell/GenericListPage.tsx +28 -32
- package/.framework/src/components/auth/TurnstileWidget.tsx +9 -6
- package/.framework/src/components/kb/KBArticleEditor.tsx +49 -6
- package/.framework/src/components/layout/Layout.tsx +4 -2
- package/.framework/src/components/layout/Sidebar.tsx +304 -179
- package/.framework/src/components/runtime/DataDetailPage.tsx +67 -35
- package/.framework/src/components/runtime/DataHeader.tsx +96 -48
- package/.framework/src/components/runtime/DataListPage.tsx +3 -26
- package/.framework/src/components/runtime/DataStats.tsx +10 -10
- package/.framework/src/components/runtime/DataTable.tsx +12 -10
- package/.framework/src/components/ui/sheet.tsx +24 -26
- package/.framework/src/components/ui/textarea.tsx +74 -48
- package/.framework/src/hooks/useBranding.ts +47 -0
- package/.framework/src/hooks/useEntityList.ts +12 -9
- package/.framework/src/hooks/useListSchema.ts +108 -58
- package/.framework/src/instructions/README.md +57 -0
- package/.framework/src/instructions/ai-agents.md +69 -0
- package/.framework/src/instructions/alerts.md +80 -0
- package/.framework/src/instructions/api-keys.md +87 -0
- package/.framework/src/instructions/apps.md +77 -0
- package/.framework/src/instructions/concepts/ai-and-prompts.md +150 -0
- package/.framework/src/instructions/concepts/apps-and-renderers.md +162 -0
- package/.framework/src/instructions/concepts/auth-and-api-keys.md +133 -0
- package/.framework/src/instructions/concepts/automation.md +186 -0
- package/.framework/src/instructions/concepts/concurrency-and-idempotency.md +125 -0
- package/.framework/src/instructions/concepts/core-vs-custom.md +124 -0
- package/.framework/src/instructions/concepts/design-schema.md +152 -0
- package/.framework/src/instructions/concepts/integrations-and-webhooks.md +127 -0
- package/.framework/src/instructions/concepts/observability.md +116 -0
- package/.framework/src/instructions/concepts/permissions.md +150 -0
- package/.framework/src/instructions/concepts/runtime-records.md +111 -0
- package/.framework/src/instructions/concepts/scope-and-accounts.md +112 -0
- package/.framework/src/instructions/concepts/spine-way.md +172 -0
- package/.framework/src/instructions/deliveries.md +59 -0
- package/.framework/src/instructions/guide/00-orientation.md +106 -0
- package/.framework/src/instructions/guide/01-install-and-first-run.md +253 -0
- package/.framework/src/instructions/guide/02-project-map.md +147 -0
- package/.framework/src/instructions/guide/03-domain-model.md +223 -0
- package/.framework/src/instructions/guide/04-first-app.md +227 -0
- package/.framework/src/instructions/guide/05-glossary.md +183 -0
- package/.framework/src/instructions/integrations.md +96 -0
- package/.framework/src/instructions/internal/cil-markers.md +83 -0
- package/.framework/src/instructions/invites.md +60 -0
- package/.framework/src/instructions/kb.md +80 -0
- package/.framework/src/instructions/logs.md +77 -0
- package/.framework/src/instructions/observability.md +61 -0
- package/.framework/src/instructions/operations/deployment.md +115 -0
- package/.framework/src/instructions/operations/migrations.md +125 -0
- package/.framework/src/instructions/operations/security-checklist.md +148 -0
- package/.framework/src/instructions/operations/troubleshooting.md +170 -0
- package/.framework/src/instructions/operations/upgrade.md +116 -0
- package/.framework/src/instructions/pipeline-executions.md +62 -0
- package/.framework/src/instructions/pipelines.md +78 -0
- package/.framework/src/instructions/prompts.md +95 -0
- package/.framework/src/instructions/reference/api/admin-data.md +162 -0
- package/.framework/src/instructions/reference/api/auth.md +113 -0
- package/.framework/src/instructions/reference/api/errors-and-envelopes.md +113 -0
- package/.framework/src/instructions/reference/app-manifest.md +150 -0
- package/.framework/src/instructions/reference/cli.md +124 -0
- package/.framework/src/instructions/reference/database.md +132 -0
- package/.framework/src/instructions/reference/design-schema.md +280 -0
- package/.framework/src/instructions/reference/env-vars.md +133 -0
- package/.framework/src/instructions/reference/functions/account-nodes.md +75 -0
- package/.framework/src/instructions/reference/functions/admin-data.md +195 -0
- package/.framework/src/instructions/reference/functions/admin-funnel.md +90 -0
- package/.framework/src/instructions/reference/functions/admin-install-funnel.md +107 -0
- package/.framework/src/instructions/reference/functions/admin-signals.md +102 -0
- package/.framework/src/instructions/reference/functions/ai-agents.md +148 -0
- package/.framework/src/instructions/reference/functions/ai-interactions.md +156 -0
- package/.framework/src/instructions/reference/functions/api-keys.md +130 -0
- package/.framework/src/instructions/reference/functions/apps.md +140 -0
- package/.framework/src/instructions/reference/functions/auth.md +99 -0
- package/.framework/src/instructions/reference/functions/debug-auth.md +91 -0
- package/.framework/src/instructions/reference/functions/deliveries.md +110 -0
- package/.framework/src/instructions/reference/functions/embeddings.md +166 -0
- package/.framework/src/instructions/reference/functions/eval-harness.md +149 -0
- package/.framework/src/instructions/reference/functions/index.md +103 -0
- package/.framework/src/instructions/reference/functions/integration-outbound.md +200 -0
- package/.framework/src/instructions/reference/functions/integration-routes.md +151 -0
- package/.framework/src/instructions/reference/functions/integrations.md +130 -0
- package/.framework/src/instructions/reference/functions/invites.md +182 -0
- package/.framework/src/instructions/reference/functions/item-progress.md +107 -0
- package/.framework/src/instructions/reference/functions/kb.md +166 -0
- package/.framework/src/instructions/reference/functions/logs.md +141 -0
- package/.framework/src/instructions/reference/functions/observability.md +105 -0
- package/.framework/src/instructions/reference/functions/pipeline-executions.md +132 -0
- package/.framework/src/instructions/reference/functions/pipeline-runner-background.md +121 -0
- package/.framework/src/instructions/reference/functions/pipelines.md +136 -0
- package/.framework/src/instructions/reference/functions/prompt-configs.md +121 -0
- package/.framework/src/instructions/reference/functions/roles.md +121 -0
- package/.framework/src/instructions/reference/functions/security.md +140 -0
- package/.framework/src/instructions/reference/functions/system-cron.md +136 -0
- package/.framework/src/instructions/reference/functions/system.md +106 -0
- package/.framework/src/instructions/reference/functions/tests.md +97 -0
- package/.framework/src/instructions/reference/functions/timers.md +117 -0
- package/.framework/src/instructions/reference/functions/trigger-scheduler.md +102 -0
- package/.framework/src/instructions/reference/functions/triggers.md +140 -0
- package/.framework/src/instructions/reference/functions/types.md +146 -0
- package/.framework/src/instructions/reference/seeds.md +126 -0
- package/.framework/src/instructions/reference/shared-modules.md +127 -0
- package/.framework/src/instructions/reference/spine-config.md +114 -0
- package/.framework/src/instructions/roles.md +80 -0
- package/.framework/src/instructions/runtime-detail.md +70 -0
- package/.framework/src/instructions/runtime-list.md +77 -0
- package/.framework/src/instructions/security.md +67 -0
- package/.framework/src/instructions/tasks/add-a-pipeline.md +110 -0
- package/.framework/src/instructions/tasks/add-a-role.md +96 -0
- package/.framework/src/instructions/tasks/add-a-timer.md +114 -0
- package/.framework/src/instructions/tasks/add-a-trigger.md +106 -0
- package/.framework/src/instructions/tasks/add-a-type.md +151 -0
- package/.framework/src/instructions/tasks/add-a-webhook.md +108 -0
- package/.framework/src/instructions/tasks/add-an-ai-agent.md +108 -0
- package/.framework/src/instructions/tasks/add-an-integration.md +124 -0
- package/.framework/src/instructions/tasks/build-a-custom-page.md +118 -0
- package/.framework/src/instructions/tasks/package-and-install-an-app.md +127 -0
- package/.framework/src/instructions/tasks/test-your-code.md +108 -0
- package/.framework/src/instructions/tasks/write-a-function.md +132 -0
- package/.framework/src/instructions/tasks/write-a-migration.md +110 -0
- package/.framework/src/instructions/testing.md +59 -0
- package/.framework/src/instructions/timers.md +82 -0
- package/.framework/src/instructions/triggers.md +69 -0
- package/.framework/src/instructions/types.md +93 -0
- package/.framework/src/lib/branding.ts +128 -0
- package/.framework/src/pages/NoAppPage.tsx +3 -1
- package/.framework/src/pages/NotFoundPage.tsx +62 -31
- package/.framework/src/pages/SetupPage.tsx +5 -2
- package/.framework/src/pages/admin/AIAgentDetailPage.tsx +117 -106
- package/.framework/src/pages/admin/AIAgentsPage.tsx +86 -48
- package/.framework/src/pages/admin/APIKeyDetailPage.tsx +153 -152
- package/.framework/src/pages/admin/APIKeysPage.tsx +91 -90
- package/.framework/src/pages/admin/AlertsConfigPage.tsx +29 -18
- package/.framework/src/pages/admin/AppDetailPage.tsx +6 -60
- package/.framework/src/pages/admin/AppsPage.tsx +104 -66
- package/.framework/src/pages/admin/DeliveriesPage.tsx +5 -5
- package/.framework/src/pages/admin/EmbeddingDetailPage.tsx +5 -23
- package/.framework/src/pages/admin/EmbeddingsPage.tsx +5 -26
- package/.framework/src/pages/admin/IntegrationDetailPage.tsx +7 -7
- package/.framework/src/pages/admin/IntegrationsPage.tsx +85 -43
- package/.framework/src/pages/admin/LogsPage.tsx +144 -76
- package/.framework/src/pages/admin/ObservabilityDashboard.tsx +223 -140
- package/.framework/src/pages/admin/PipelineDetailPage.tsx +134 -113
- package/.framework/src/pages/admin/PipelineExecutionsPage.tsx +108 -45
- package/.framework/src/pages/admin/PipelinesPage.tsx +160 -115
- package/.framework/src/pages/admin/PromptConfigDetailPage.tsx +96 -98
- package/.framework/src/pages/admin/PromptConfigsPage.tsx +101 -59
- package/.framework/src/pages/admin/RoleDetailPage.tsx +90 -79
- package/.framework/src/pages/admin/RolesPage.tsx +86 -43
- package/.framework/src/pages/admin/SecurityPage.tsx +1 -1
- package/.framework/src/pages/admin/TestingDashboard.tsx +16 -28
- package/.framework/src/pages/admin/TimerDetailPage.tsx +117 -100
- package/.framework/src/pages/admin/TimersPage.tsx +90 -62
- package/.framework/src/pages/admin/TriggerDetailPage.tsx +90 -83
- package/.framework/src/pages/admin/TriggersPage.tsx +124 -99
- package/.framework/src/pages/admin/TypeDetailPage.tsx +152 -138
- package/.framework/src/pages/admin/TypesPage.tsx +90 -48
- package/.framework/src/pages/admin/cil/CILAgentPage.tsx +17 -25
- package/.framework/src/pages/admin/cil/CILChunkDetailPage.tsx +17 -27
- package/.framework/src/pages/admin/cil/CILDashboardPage.tsx +72 -40
- package/.framework/src/pages/admin/cil/CILFileListPage.tsx +321 -129
- package/.framework/src/pages/admin/cil/CILFileSelectPage.tsx +18 -29
- package/.framework/src/pages/admin/cil/CILGraphPage.tsx +26 -38
- package/.framework/src/pages/admin/cil/CILIngestionPage.tsx +34 -46
- package/.framework/src/pages/admin/cil/CILProjectsPage.tsx +189 -103
- package/.framework/src/pages/admin/cil/CILSearchPage.tsx +246 -136
- package/.framework/src/pages/admin/cil/CILSuggestionsPage.tsx +11 -22
- package/.framework/src/pages/admin/cil/CILVersionsPage.tsx +9 -20
- package/.framework/src/pages/admin/cil/FlexiblePipelinePage.tsx +26 -38
- package/.framework/src/pages/admin/kb/KBAdminPage.tsx +7 -26
- package/.framework/src/pages/auth/AuthConfirmPage.tsx +3 -1
- package/.framework/src/pages/auth/ForgotPasswordPage.tsx +3 -1
- package/.framework/src/pages/auth/LoginPage.tsx +4 -2
- package/.framework/src/pages/auth/RegisterPage.tsx +3 -1
- package/.framework/templates/agent/AGENTS.md +150 -0
- package/.framework/templates/agent/skills/spine-add-ai-agent/SKILL.md +58 -0
- package/.framework/templates/agent/skills/spine-add-automation/SKILL.md +62 -0
- package/.framework/templates/agent/skills/spine-add-integration/SKILL.md +63 -0
- package/.framework/templates/agent/skills/spine-architect/SKILL.md +86 -0
- package/.framework/templates/agent/skills/spine-install-app/SKILL.md +72 -0
- package/.framework/templates/agent/skills/spine-migration/SKILL.md +75 -0
- package/.framework/templates/agent/skills/spine-new-app/SKILL.md +67 -0
- package/.framework/templates/agent/skills/spine-new-function/SKILL.md +65 -0
- package/.framework/templates/agent/skills/spine-new-type/SKILL.md +65 -0
- package/.framework/templates/agent/skills/spine-schema/SKILL.md +77 -0
- package/.framework/templates/agent/skills/spine-test/SKILL.md +67 -0
- package/.framework/templates/agent/skills/spine-troubleshoot/SKILL.md +74 -0
- package/.framework/templates/agent/skills/spine-upgrade/SKILL.md +69 -0
- package/.framework/templates/project.json +5 -1
- package/.framework/tests/unit/account-scoping-gates.test.ts +392 -0
- package/.framework/tests/unit/agent-files.test.ts +355 -0
- package/.framework/tests/unit/agent-runner.test.ts +496 -47
- package/.framework/tests/unit/api-keys-create-scope-gate.test.ts +160 -0
- package/.framework/tests/unit/api-keys-omit-secret-fields.test.ts +38 -0
- package/.framework/tests/unit/bootstrap.test.ts +242 -0
- package/.framework/tests/unit/cli-context-api-key.test.ts +114 -0
- package/.framework/tests/unit/debug-auth.test.ts +38 -0
- package/.framework/tests/unit/deliveries-account-scoping.test.ts +185 -0
- package/.framework/tests/unit/episode-lease.test.ts +695 -0
- package/.framework/tests/unit/integration-outbound-credentials.test.ts +167 -0
- package/.framework/tests/unit/integrations-audit-redaction.test.ts +130 -0
- package/.framework/tests/unit/kb-ingest-lease.test.ts +19 -0
- package/.framework/tests/unit/logging-app-id.test.ts +75 -0
- package/.framework/tests/unit/pipeline-runner-background.test.ts +120 -0
- package/.framework/tests/unit/pipeline-runner.test.ts +153 -1
- package/.framework/tests/unit/principal-cache.test.ts +15 -0
- package/.framework/tests/unit/system-context-denial.test.ts +145 -0
- package/.framework/tests/unit/system-cron.test.ts +240 -0
- package/.framework/tests/unit/timers.test.ts +159 -0
- package/.framework/tests/unit/trigger-engine.test.ts +278 -91
- package/.framework/tests/unit/trigger-scheduler.test.ts +78 -0
- package/README.md +125 -166
- package/config/tsconfig.cli.json +2 -2
- package/netlify.toml +5 -0
- package/package.json +15 -4
- package/templates/project/package-lock.json +2 -2
- package/.framework/docs/admin-routes.md +0 -76
- package/.framework/docs/api-docs-progress.md +0 -38
- package/.framework/docs/api-governance.md +0 -146
- package/.framework/docs/api-testing-results.md +0 -212
- package/.framework/docs/assembly-launch-guide.md +0 -138
- package/.framework/docs/audit-results.md +0 -590
- package/.framework/docs/db-api-inventory.md +0 -95
- package/.framework/docs/gap-remediation-backlog.md +0 -103
- package/.framework/docs/ui-adoption-verification.md +0 -111
- package/.framework/docs/ui-api-coverage.md +0 -84
- package/.framework/docs/v2-compatibility-audit.md +0 -228
- package/.framework/mcp/index.ts +0 -133
- package/.framework/mcp/load-env.ts +0 -60
- package/.framework/mcp/shared/app-manifest.ts +0 -275
- package/.framework/mcp/shared/db.ts +0 -477
- package/.framework/mcp/shared/kb.ts +0 -118
- package/.framework/mcp/tools/architect.ts +0 -431
- package/.framework/mcp/tools/cil/context.ts +0 -345
- package/.framework/mcp/tools/cil/graph.ts +0 -242
- package/.framework/mcp/tools/cil/ingest.ts +0 -1217
- package/.framework/mcp/tools/cil/pipeline-orchestrator.ts +0 -693
- package/.framework/mcp/tools/cil/pipeline.ts +0 -767
- package/.framework/mcp/tools/cil/project.ts +0 -791
- package/.framework/mcp/tools/cil/retrieval.ts +0 -336
- package/.framework/mcp/tools/cil/search-core.ts +0 -454
- package/.framework/mcp/tools/cil/search.ts +0 -97
- package/.framework/mcp/tools/cil/suggest.ts +0 -186
- package/.framework/mcp/tools/cil/validate.ts +0 -1369
- package/.framework/mcp/tools/kb/delete.ts +0 -139
- package/.framework/mcp/tools/kb/index.ts +0 -52
- package/.framework/mcp/tools/kb/ingest.ts +0 -84
- package/.framework/mcp/tools/kb/list-types.ts +0 -102
- package/.framework/mcp/tools/kb/publish.ts +0 -100
- package/.framework/mcp/tools/kb/reindex.ts +0 -86
- package/.framework/mcp/tools/kb/revoke.ts +0 -85
- package/.framework/mcp/tools/kb/search.ts +0 -101
- package/.framework/mcp/tools/kb/upsert.ts +0 -125
- package/.framework/mcp/tools/observability.ts +0 -510
|
@@ -1,40 +1,71 @@
|
|
|
1
|
-
// CIL[BEGIN stable_id="~/.framework/src/components/runtime/DataDetailPage.tsx:module_header:module_header"]
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
// CIL[BEGIN stable_id="~/.framework/src/components/runtime/DataDetailPage.tsx:module_header:module_header" type="module_header" identity="module_header" parent="~/.framework/src/components/runtime/DataDetailPage.tsx"]
|
|
2
|
+
/**
|
|
3
|
+
* @module DataDetailPage
|
|
4
|
+
* @audience both
|
|
5
|
+
* @layer shared-core
|
|
6
|
+
* @stability stable
|
|
7
|
+
*
|
|
8
|
+
* This module provides the DataDetailPage component, which displays detailed information about a specific entity record. It integrates various UI components and hooks to fetch and manage the entity's data, allowing users to view and edit details seamlessly.
|
|
9
|
+
* INVARIANT: The entity record must exist for the page to render correctly.
|
|
10
|
+
*
|
|
11
|
+
* @seeAlso useEntityRecord (fetches the entity data needed for display).
|
|
12
|
+
* @seeAlso DataDetailHeader (renders the header for the detail page).
|
|
13
|
+
* @seeAlso SchemaDetailForm (provides the form for editing entity details).
|
|
14
|
+
*
|
|
15
|
+
* @cil-generated
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
10
26
|
|
|
11
27
|
|
|
12
28
|
|
|
13
29
|
import { useState, useEffect } from 'react'
|
|
14
|
-
import { useParams, useSearchParams } from 'react-router-dom'
|
|
30
|
+
import { useNavigate, useParams, useSearchParams } from 'react-router-dom'
|
|
15
31
|
import { useEntityRecord } from '../../hooks/useEntityRecord'
|
|
16
32
|
import { DataDetailHeader } from './DataDetailHeader'
|
|
17
33
|
import { SchemaDetailForm } from './SchemaDetailForm'
|
|
18
34
|
import { Button } from '../ui/button'
|
|
19
35
|
import { Card, CardContent } from '../ui/card'
|
|
20
36
|
import { Skeleton } from '../ui/skeleton'
|
|
21
|
-
|
|
22
|
-
// CIL[DOC-VECTOR type="context" content="purpose='Module-level imports and component entry point for the runtime data detail page.'; No verified external callers; imports: .framework/src/hooks/useEntityRecord.ts,.framework/src/components/runtime/DataDetailHeader.tsx,.framework/src/components/runtime/SchemaDetailForm.tsx"]
|
|
23
|
-
// CIL[DOC-VECTOR type="blast_radius" content="No direct caller data from CIL graph; local impact only"]
|
|
24
|
-
// CIL[DOC-VECTOR type="configuration" content="No environment or build configuration dependencies identified"]
|
|
25
|
-
// CIL[DOC-VECTOR type="constraint" content="Standard runtime; no special invariants documented"]
|
|
26
|
-
// CIL[DOC-VECTOR type="implementation_pattern" content="" status="pending_human_input"]
|
|
27
|
-
// CIL[DOC-VECTOR type="user_journey" content="" status="pending_human_input"]
|
|
28
37
|
// CIL[END stable_id="~/.framework/src/components/runtime/DataDetailPage.tsx:module_header:module_header"]
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
// CIL[BEGIN stable_id="~/.framework/src/components/runtime/DataDetailPage.tsx:DataDetailPage:component" type="component" identity="DataDetailPage" parent="~/.framework/src/components/runtime/DataDetailPage.tsx"]
|
|
56
|
+
/**
|
|
57
|
+
* The DataDetailPage component manages the display and editing of detailed records for various entities in the application. It handles navigation, data fetching, and form state management based on the entity type and record ID.
|
|
58
|
+
*
|
|
59
|
+
* @macro Component responsible for rendering and managing entity detail views.
|
|
60
|
+
* @micro Utilizes React hooks for state management and side effects, and dynamically configures based on entity parameters.
|
|
61
|
+
* @outputSpec JSX.Element
|
|
62
|
+
* @sideEffects Fetches data from the API, updates URL search parameters, and navigates to different routes.
|
|
63
|
+
* @stability internal
|
|
64
|
+
* @calls useNavigate, useParams, useSearchParams, useEntityRecord
|
|
65
|
+
* @cil-generated
|
|
66
|
+
*/
|
|
37
67
|
export function DataDetailPage() {
|
|
68
|
+
const navigate = useNavigate()
|
|
38
69
|
const { entity, id, typeSlug } = useParams<{ entity: string; id: string; typeSlug?: string }>()
|
|
39
70
|
const [searchParams, setSearchParams] = useSearchParams()
|
|
40
71
|
|
|
@@ -120,7 +151,7 @@ export function DataDetailPage() {
|
|
|
120
151
|
|
|
121
152
|
const handleCancel = () => {
|
|
122
153
|
if (isCreating) {
|
|
123
|
-
|
|
154
|
+
navigate(`/spine-framework/admin/runtime/${entity}`)
|
|
124
155
|
} else {
|
|
125
156
|
setSearchParams({})
|
|
126
157
|
if (record && view) {
|
|
@@ -146,14 +177,14 @@ export function DataDetailPage() {
|
|
|
146
177
|
if (!isCreating) {
|
|
147
178
|
setSearchParams({})
|
|
148
179
|
} else {
|
|
149
|
-
|
|
180
|
+
navigate(`/spine-framework/admin/runtime/${entity}`)
|
|
150
181
|
}
|
|
151
182
|
}
|
|
152
183
|
|
|
153
184
|
const handleDelete = async () => {
|
|
154
185
|
if (confirm(`Are you sure you want to delete this ${config?.entity?.slice(0, -1) || 'record'}?`)) {
|
|
155
186
|
await deleteRecord()
|
|
156
|
-
|
|
187
|
+
navigate(`/spine-framework/admin/runtime/${entity}`)
|
|
157
188
|
}
|
|
158
189
|
}
|
|
159
190
|
|
|
@@ -186,6 +217,8 @@ export function DataDetailPage() {
|
|
|
186
217
|
entity={config.entity}
|
|
187
218
|
icon={config.icon}
|
|
188
219
|
title={isCreating ? `New ${config.entity.slice(0, -1)}` : recordTitle}
|
|
220
|
+
// CIL[END stable_id="~/.framework/src/components/runtime/DataDetailPage.tsx:DataDetailPage:component"]
|
|
221
|
+
|
|
189
222
|
isEditing={isEditing}
|
|
190
223
|
isCreating={isCreating}
|
|
191
224
|
onEdit={handleEdit}
|
|
@@ -209,10 +242,9 @@ export function DataDetailPage() {
|
|
|
209
242
|
</div>
|
|
210
243
|
)
|
|
211
244
|
}
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
// CIL[END stable_id="~/.framework/src/components/runtime/DataDetailPage.tsx:datadetailpage:function"]
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
|
|
@@ -1,61 +1,108 @@
|
|
|
1
|
-
// CIL[BEGIN stable_id="~/.framework/src/components/runtime/DataHeader.tsx:module_header:module_header" type="module_header" identity="module_header" parent="
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
// CIL[BEGIN stable_id="~/.framework/src/components/runtime/DataHeader.tsx:module_header:module_header" type="module_header" identity="module_header" parent="~/.framework/src/components/runtime/DataHeader.tsx"]
|
|
2
|
+
/**
|
|
3
|
+
* @module DataHeader
|
|
4
|
+
* @audience both
|
|
5
|
+
* @layer shared-core
|
|
6
|
+
* @stability stable
|
|
7
|
+
*
|
|
8
|
+
* This module defines the DataHeader component, which is responsible for rendering the header section of the data display interface in the application. It leverages React for UI rendering and integrates with React Router for navigation. INVARIANT: The component must always receive valid data props to render correctly.
|
|
9
|
+
*
|
|
10
|
+
* @seeAlso button.tsx (provides UI button functionality).
|
|
11
|
+
* @seeAlso react-router-dom (enables navigation within the app).
|
|
12
|
+
* @seeAlso lucide-react (provides iconography used in the component).
|
|
13
|
+
*
|
|
14
|
+
* @cil-generated
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
10
25
|
|
|
11
26
|
|
|
12
27
|
|
|
13
28
|
import React from 'react'
|
|
29
|
+
import { useNavigate } from 'react-router-dom'
|
|
14
30
|
import { Button } from '../ui/button'
|
|
15
31
|
import * as Icons from 'lucide-react'
|
|
32
|
+
// CIL[END stable_id="~/.framework/src/components/runtime/DataHeader.tsx:module_header:module_header"]
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
16
48
|
|
|
17
49
|
|
|
18
|
-
// CIL[DOC-VECTOR type="context" content="purpose='Provide the module-level imports and dependencies for the DataHeader runtime component.'; No verified external callers; imports: .framework/src/components/ui/button.tsx"]
|
|
19
|
-
// CIL[DOC-VECTOR type="blast_radius" content="No direct caller data from CIL graph; local impact only"]
|
|
20
|
-
// CIL[DOC-VECTOR type="configuration" content="No environment or build configuration dependencies identified"]
|
|
21
|
-
// CIL[DOC-VECTOR type="constraint" content="Standard runtime; no special invariants documented"]
|
|
22
|
-
// CIL[DOC-VECTOR type="implementation_pattern" content="" status="pending_human_input"]
|
|
23
|
-
// CIL[DOC-VECTOR type="user_journey" content="" status="pending_human_input"]
|
|
24
|
-
// CIL[END stable_id="~/.framework/src/components/runtime/DataHeader.tsx:module_header:module_header"]
|
|
25
50
|
|
|
26
|
-
// CIL[BEGIN stable_id="~/.framework/src/components/runtime/DataHeader.tsx:dataheaderprops:interface" type="interface" identity="DataHeaderProps" parent="none"]
|
|
27
|
-
// CIL[DOC-MACRO purpose="Define the prop contract for the DataHeader component."]
|
|
28
|
-
// CIL[DOC-RESPONSIBILITY responsibility="Describe the expected properties for rendering a DataHeader: title, icon, description, and newButtonHref."]
|
|
29
|
-
// CIL[DOC-CONTEXT module="runtime-data-header" layer="ui" related_files=".framework/src/components/runtime/DataHeader.tsx,.framework/src/components/ui/button.tsx"]
|
|
30
|
-
// CIL[DOC-CONTRACT inputs="none" outputs="DataHeaderProps TypeScript interface" errors="none" side_effects="none"]
|
|
31
|
-
// CIL[DOC-MICRO logic_summary="Declares a TypeScript interface with title, icon, description, and newButtonHref fields." notable_decisions="[]"]
|
|
32
|
-
// CIL[DOC-CONFIDENCE pass="second" score="0.90" flags="none"]
|
|
33
|
-
// CIL[DOC-STABILITY stability="stable"]
|
|
34
51
|
|
|
52
|
+
|
|
53
|
+
// CIL[BEGIN stable_id="~/.framework/src/components/runtime/DataHeader.tsx:DataHeaderProps:interface" type="interface" identity="DataHeaderProps" parent="~/.framework/src/components/runtime/DataHeader.tsx"]
|
|
54
|
+
/**
|
|
55
|
+
* DataHeaderProps defines the properties required for rendering a data header component, providing essential metadata such as title, icon, description, and a link for a new button.
|
|
56
|
+
*
|
|
57
|
+
* @sideEffects none
|
|
58
|
+
* @stability internal
|
|
59
|
+
* @cil-generated
|
|
60
|
+
*/
|
|
35
61
|
interface DataHeaderProps {
|
|
36
62
|
title: string
|
|
37
63
|
icon: string
|
|
38
64
|
description: string
|
|
39
65
|
newButtonHref: string
|
|
40
66
|
}
|
|
41
|
-
// CIL[
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
// CIL[DOC-MICRO logic_summary="Resolves a dynamic lucide-react icon component, renders a title, description, and a button labeled with the singular title." notable_decisions="[]"]
|
|
55
|
-
// CIL[DOC-CONFIDENCE pass="second" score="0.90" flags="none"]
|
|
56
|
-
// CIL[DOC-STABILITY stability="stable"]
|
|
67
|
+
// CIL[END stable_id="~/.framework/src/components/runtime/DataHeader.tsx:DataHeaderProps:interface"]
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
57
80
|
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
// CIL[BEGIN stable_id="~/.framework/src/components/runtime/DataHeader.tsx:DataHeader:component" type="component" identity="DataHeader" parent="~/.framework/src/components/runtime/DataHeader.tsx"]
|
|
88
|
+
/**
|
|
89
|
+
* DataHeader is a React component that displays a header with a title, icon, and description, along with a button to create a new item. It facilitates navigation to a specified URL when the button is clicked.
|
|
90
|
+
*
|
|
91
|
+
* @macro Header component for displaying metadata and navigation options.
|
|
92
|
+
* @micro Dynamically selects an icon component based on the provided icon name.
|
|
93
|
+
* @inputSpec
|
|
94
|
+
* title: string (required) — the title to display in the header.
|
|
95
|
+
* icon: string (required) — the name of the icon to display.
|
|
96
|
+
* description: string (optional) — a brief description displayed under the title.
|
|
97
|
+
* newButtonHref: string (required) — the URL to navigate to when the button is clicked.
|
|
98
|
+
* @outputSpec JSX.Element — renders a header with title, icon, description, and a button.
|
|
99
|
+
* @sideEffects navigates to a new URL when the button is clicked.
|
|
100
|
+
* @stability internal
|
|
101
|
+
* @calls useNavigate
|
|
102
|
+
* @cil-generated
|
|
103
|
+
*/
|
|
58
104
|
export function DataHeader({ title, icon, description, newButtonHref }: DataHeaderProps) {
|
|
105
|
+
const navigate = useNavigate()
|
|
59
106
|
// Dynamically get the icon component
|
|
60
107
|
const IconComponent = (Icons as Record<string, React.ComponentType<{ className?: string }>>)[icon] || Icons.Box
|
|
61
108
|
|
|
@@ -74,7 +121,9 @@ export function DataHeader({ title, icon, description, newButtonHref }: DataHead
|
|
|
74
121
|
</div>
|
|
75
122
|
|
|
76
123
|
<Button
|
|
77
|
-
onClick={() =>
|
|
124
|
+
onClick={() => navigate(newButtonHref)}
|
|
125
|
+
// CIL[END stable_id="~/.framework/src/components/runtime/DataHeader.tsx:DataHeader:component"]
|
|
126
|
+
|
|
78
127
|
className="flex items-center gap-2"
|
|
79
128
|
>
|
|
80
129
|
<Icons.Plus className="h-4 w-4" />
|
|
@@ -83,10 +132,9 @@ export function DataHeader({ title, icon, description, newButtonHref }: DataHead
|
|
|
83
132
|
</div>
|
|
84
133
|
)
|
|
85
134
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
// CIL[END stable_id="~/.framework/src/components/runtime/DataHeader.tsx:dataheader:function"]
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
|
|
@@ -15,18 +15,16 @@ import { DataHeader } from './DataHeader'
|
|
|
15
15
|
import { DataStats } from './DataStats'
|
|
16
16
|
import { DataFilters } from './DataFilters'
|
|
17
17
|
import { DataTable } from './DataTable'
|
|
18
|
-
import { PageInstructions } from '../admin/PageInstructions'
|
|
19
18
|
import { Card, CardContent } from '../ui/card'
|
|
20
19
|
import { Skeleton } from '../ui/skeleton'
|
|
20
|
+
// CIL[END stable_id="~/.framework/src/components/runtime/DataListPage.tsx:module_header:module_header"]
|
|
21
21
|
// CIL[DOC-VECTOR type="context" content="purpose='Import the hooks and child components used by the DataListPage runtime list view'; No verified external callers; imports: .framework/src/hooks/useListSchema.ts,.framework/src/hooks/useEntityList.ts,.framework/src/components/runtime/DataHeader.tsx"]
|
|
22
22
|
// CIL[DOC-VECTOR type="blast_radius" content="No direct caller data from CIL graph; local impact only"]
|
|
23
23
|
// CIL[DOC-VECTOR type="configuration" content="No environment or build configuration dependencies identified"]
|
|
24
24
|
// CIL[DOC-VECTOR type="constraint" content="Standard runtime; no special invariants documented"]
|
|
25
25
|
// CIL[DOC-VECTOR type="implementation_pattern" content="" status="pending_human_input"]
|
|
26
26
|
// CIL[DOC-VECTOR type="user_journey" content="" status="pending_human_input"]
|
|
27
|
-
// CIL[END stable_id="~/.framework/src/components/runtime/DataListPage.tsx:module_header:module_header"]
|
|
28
27
|
|
|
29
|
-
// CIL[BEGIN stable_id="~/.framework/src/components/runtime/DataListPage.tsx:DataListPage:component" type="component" identity="DataListPage" parent="~/.framework/src/components/runtime/DataListPage.tsx"]
|
|
30
28
|
// CIL[DOC-MACRO purpose="Render a schema-driven list page for runtime entity records with stats, filters, and a sortable data table"]
|
|
31
29
|
// CIL[DOC-RESPONSIBILITY responsibility="Fetch the list schema, build the column/filter configuration, load entity list data, and render header/stats/filters/table with loading and error states"]
|
|
32
30
|
// CIL[DOC-CONTEXT module="components/runtime" layer="runtime" related_files=".framework/src/components/admin/PageInstructions.tsx,.framework/src/components/runtime/DataFilters.tsx,.framework/src/components/runtime/DataHeader.tsx,.framework/src/components/runtime/DataListPage.tsx,.framework/src/components/runtime/DataStats.tsx,.framework/src/components/runtime/DataTable.tsx,.framework/src/components/ui/card.tsx,.framework/src/components/ui/skeleton.tsx,.framework/src/hooks/useEntityList.ts,.framework/src/hooks/useListSchema.ts"]
|
|
@@ -35,6 +33,7 @@ import { Skeleton } from '../ui/skeleton'
|
|
|
35
33
|
// CIL[DOC-CONFIDENCE pass="second" score="0.90" flags="none"]
|
|
36
34
|
// CIL[DOC-STABILITY stability="stable"]
|
|
37
35
|
|
|
36
|
+
// CIL[BEGIN stable_id="~/.framework/src/components/runtime/DataListPage.tsx:DataListPage:component" type="component" identity="DataListPage" parent="~/.framework/src/components/runtime/DataListPage.tsx"]
|
|
38
37
|
export function DataListPage() {
|
|
39
38
|
const { entity, typeSlug } = useParams<{ entity: string; typeSlug?: string }>()
|
|
40
39
|
|
|
@@ -120,28 +119,6 @@ export function DataListPage() {
|
|
|
120
119
|
description={`Manage ${config.entity}`}
|
|
121
120
|
newButtonHref={`/spine-framework/admin/runtime/${entity}/new`}
|
|
122
121
|
/>
|
|
123
|
-
|
|
124
|
-
<PageInstructions
|
|
125
|
-
sections={[
|
|
126
|
-
{
|
|
127
|
-
title: 'What this page is for',
|
|
128
|
-
content: `This page is a schema-driven list for ${config.entity} records. It displays the records stored in the system, their field values, and current status based on the type definition.`,
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
title: 'How to find records',
|
|
132
|
-
content: `Use the filters above the table to narrow results. Click any column header to sort ascending or descending. The available columns and filters are defined by the type schema.`,
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
title: 'How to create, view, and edit records',
|
|
136
|
-
content: `Click the New button in the top-right to create a new ${config.entity}. Click any row to open its detail view. From the detail view you can edit field values or delete the record. Some records may have restricted permissions based on your role.`,
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
title: 'Understanding the stats',
|
|
140
|
-
content: `The cards above the table show summary counts and key metrics for this record type. Use them to quickly assess volume and status before drilling into the list.`,
|
|
141
|
-
},
|
|
142
|
-
]}
|
|
143
|
-
/>
|
|
144
|
-
|
|
145
122
|
<DataStats
|
|
146
123
|
stats={config.list.stats}
|
|
147
124
|
data={data}
|
|
@@ -170,10 +147,10 @@ export function DataListPage() {
|
|
|
170
147
|
</div>
|
|
171
148
|
)
|
|
172
149
|
}
|
|
150
|
+
// CIL[END stable_id="~/.framework/src/components/runtime/DataListPage.tsx:DataListPage:component"]
|
|
173
151
|
// CIL[DOC-VECTOR type="context" content="purpose='Render a schema-driven list page for runtime entity records with stats, filters, and a sortable data table'; No verified external callers; imports: .framework/src/hooks/useListSchema.ts,.framework/src/hooks/useEntityList.ts,.framework/src/components/runtime/DataHeader.tsx"]
|
|
174
152
|
// CIL[DOC-VECTOR type="blast_radius" content="No direct caller data from CIL graph; local impact only"]
|
|
175
153
|
// CIL[DOC-VECTOR type="configuration" content="No environment or build configuration dependencies identified"]
|
|
176
154
|
// CIL[DOC-VECTOR type="constraint" content="Standard runtime; no special invariants documented"]
|
|
177
155
|
// CIL[DOC-VECTOR type="implementation_pattern" content="" status="pending_human_input"]
|
|
178
156
|
// CIL[DOC-VECTOR type="user_journey" content="" status="pending_human_input"]
|
|
179
|
-
// CIL[END stable_id="~/.framework/src/components/runtime/DataListPage.tsx:DataListPage:component"]
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// CIL[BEGIN stable_id="~/.framework/src/components/runtime/DataStats.tsx:module_header:module_header"]
|
|
1
|
+
// CIL[BEGIN stable_id="~/.framework/src/components/runtime/DataStats.tsx:module_header:module_header" type="module_header" identity="module_header" parent="~/.framework/src/components/runtime/DataStats.tsx"]
|
|
2
2
|
// CIL[DOC-MACRO purpose="Module header for the DataStats runtime component"]
|
|
3
3
|
// CIL[DOC-RESPONSIBILITY responsibility="Declare imports and dependencies for the DataStats component"]
|
|
4
4
|
// CIL[DOC-CONTEXT module="DataStats" layer="runtime" related_files=".framework/src/components/ui/card.tsx,.framework/src/types/types.ts"]
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
import { EntityStat } from '../../types/types'
|
|
14
14
|
import { Card, CardContent } from '../ui/card'
|
|
15
15
|
import * as Icons from 'lucide-react'
|
|
16
|
+
// CIL[END stable_id="~/.framework/src/components/runtime/DataStats.tsx:module_header:module_header"]
|
|
16
17
|
|
|
17
18
|
// CIL[DOC-VECTOR type="context" content="purpose='Module header for the DataStats runtime component'; No verified external callers; imports: .framework/src/types/types.ts,.framework/src/components/ui/card.tsx"]
|
|
18
19
|
// CIL[DOC-VECTOR type="blast_radius" content="No direct caller data from CIL graph; local impact only"]
|
|
@@ -20,9 +21,7 @@ import * as Icons from 'lucide-react'
|
|
|
20
21
|
// CIL[DOC-VECTOR type="constraint" content="Standard runtime; no special invariants documented"]
|
|
21
22
|
// CIL[DOC-VECTOR type="implementation_pattern" content="" status="pending_human_input"]
|
|
22
23
|
// CIL[DOC-VECTOR type="user_journey" content="" status="pending_human_input"]
|
|
23
|
-
// CIL[END stable_id="~/.framework/src/components/runtime/DataStats.tsx:module_header:module_header"]
|
|
24
24
|
|
|
25
|
-
// CIL[BEGIN stable_id="~/.framework/src/components/runtime/DataStats.tsx:datastatsprops:interface"]
|
|
26
25
|
// CIL[DOC-MACRO purpose="DataStats component prop type"]
|
|
27
26
|
// CIL[DOC-RESPONSIBILITY responsibility="Define the shape of props accepted by DataStats"]
|
|
28
27
|
// CIL[DOC-CONTEXT module="DataStats" layer="runtime" related_files=".framework/src/components/runtime/DataStats.tsx,.framework/src/components/ui/card.tsx,.framework/src/types/types.ts"]
|
|
@@ -30,22 +29,22 @@ import * as Icons from 'lucide-react'
|
|
|
30
29
|
// CIL[DOC-MICRO logic_summary="Type-only interface for DataStats props." notable_decisions="[]"]
|
|
31
30
|
// CIL[DOC-CONFIDENCE pass="second" score="0.90" flags="none"]
|
|
32
31
|
// CIL[DOC-STABILITY stability="stable"]
|
|
32
|
+
// CIL[BEGIN stable_id="~/.framework/src/components/runtime/DataStats.tsx:DataStatsProps:interface" type="interface" identity="DataStatsProps" parent="~/.framework/src/components/runtime/DataStats.tsx"]
|
|
33
33
|
interface DataStatsProps {
|
|
34
34
|
stats: EntityStat[]
|
|
35
35
|
data: any[]
|
|
36
36
|
loading?: boolean
|
|
37
37
|
}
|
|
38
|
+
// CIL[END stable_id="~/.framework/src/components/runtime/DataStats.tsx:DataStatsProps:interface"]
|
|
38
39
|
// CIL[DOC-VECTOR type="context" content="purpose='DataStats component prop type'; No verified external callers; imports: .framework/src/types/types.ts,.framework/src/components/ui/card.tsx"]
|
|
39
40
|
// CIL[DOC-VECTOR type="blast_radius" content="No direct caller data from CIL graph; local impact only"]
|
|
40
41
|
// CIL[DOC-VECTOR type="configuration" content="No environment or build configuration dependencies identified"]
|
|
41
42
|
// CIL[DOC-VECTOR type="constraint" content="Standard runtime; no special invariants documented"]
|
|
42
43
|
// CIL[DOC-VECTOR type="implementation_pattern" content="" status="pending_human_input"]
|
|
43
44
|
// CIL[DOC-VECTOR type="user_journey" content="" status="pending_human_input"]
|
|
44
|
-
// CIL[END stable_id="~/.framework/src/components/runtime/DataStats.tsx:datastatsprops:interface"]
|
|
45
45
|
|
|
46
46
|
|
|
47
47
|
|
|
48
|
-
// CIL[BEGIN stable_id="~/.framework/src/components/runtime/DataStats.tsx:colormap:constant"]
|
|
49
48
|
// CIL[DOC-MACRO purpose="Color style mapping for stat cards"]
|
|
50
49
|
// CIL[DOC-RESPONSIBILITY responsibility="Provide Tailwind CSS class combinations for color themes"]
|
|
51
50
|
// CIL[DOC-CONTEXT module="DataStats" layer="runtime" related_files=".framework/src/components/runtime/DataStats.tsx,.framework/src/components/ui/card.tsx,.framework/src/types/types.ts"]
|
|
@@ -53,6 +52,7 @@ interface DataStatsProps {
|
|
|
53
52
|
// CIL[DOC-MICRO logic_summary="Record mapping semantic color names to background/text utility classes." notable_decisions="[]"]
|
|
54
53
|
// CIL[DOC-CONFIDENCE pass="second" score="0.90" flags="none"]
|
|
55
54
|
// CIL[DOC-STABILITY stability="stable"]
|
|
55
|
+
// CIL[BEGIN stable_id="~/.framework/src/components/runtime/DataStats.tsx:colorMap:constant" type="constant" identity="colorMap" parent="~/.framework/src/components/runtime/DataStats.tsx"]
|
|
56
56
|
const colorMap: Record<string, string> = {
|
|
57
57
|
blue: 'bg-blue-500/10 text-blue-500',
|
|
58
58
|
green: 'bg-green-500/10 text-green-500',
|
|
@@ -61,17 +61,16 @@ const colorMap: Record<string, string> = {
|
|
|
61
61
|
purple: 'bg-purple-500/10 text-purple-500',
|
|
62
62
|
gray: 'bg-muted text-muted-foreground'
|
|
63
63
|
}
|
|
64
|
+
// CIL[END stable_id="~/.framework/src/components/runtime/DataStats.tsx:colorMap:constant"]
|
|
64
65
|
// CIL[DOC-VECTOR type="context" content="purpose='Color style mapping for stat cards'; No verified external callers; imports: .framework/src/types/types.ts,.framework/src/components/ui/card.tsx"]
|
|
65
66
|
// CIL[DOC-VECTOR type="blast_radius" content="No direct caller data from CIL graph; local impact only"]
|
|
66
67
|
// CIL[DOC-VECTOR type="configuration" content="No environment or build configuration dependencies identified"]
|
|
67
68
|
// CIL[DOC-VECTOR type="constraint" content="Standard runtime; no special invariants documented"]
|
|
68
69
|
// CIL[DOC-VECTOR type="implementation_pattern" content="" status="pending_human_input"]
|
|
69
70
|
// CIL[DOC-VECTOR type="user_journey" content="" status="pending_human_input"]
|
|
70
|
-
// CIL[END stable_id="~/.framework/src/components/runtime/DataStats.tsx:colormap:constant"]
|
|
71
71
|
|
|
72
72
|
|
|
73
73
|
|
|
74
|
-
// CIL[BEGIN stable_id="~/.framework/src/components/runtime/DataStats.tsx:datastats:function"]
|
|
75
74
|
// CIL[DOC-MACRO purpose="Render data statistics cards"]
|
|
76
75
|
// CIL[DOC-RESPONSIBILITY responsibility="Calculate and display entity statistics as a responsive grid of cards"]
|
|
77
76
|
// CIL[DOC-CONTEXT module="DataStats" layer="runtime" related_files=".framework/src/components/runtime/DataStats.tsx,.framework/src/components/ui/card.tsx,.framework/src/types/types.ts"]
|
|
@@ -79,6 +78,7 @@ const colorMap: Record<string, string> = {
|
|
|
79
78
|
// CIL[DOC-MICRO logic_summary="Maps stats to calculated values; uses colorMap and dynamic icon for each card." notable_decisions="[]"]
|
|
80
79
|
// CIL[DOC-CONFIDENCE pass="second" score="0.90" flags="none"]
|
|
81
80
|
// CIL[DOC-STABILITY stability="stable"]
|
|
81
|
+
// CIL[BEGIN stable_id="~/.framework/src/components/runtime/DataStats.tsx:DataStats:component" type="component" identity="DataStats" parent="~/.framework/src/components/runtime/DataStats.tsx"]
|
|
82
82
|
export function DataStats({ stats, data, loading }: DataStatsProps) {
|
|
83
83
|
const calculateStat = (stat: EntityStat): number => {
|
|
84
84
|
if (!data) return 0
|
|
@@ -90,9 +90,9 @@ export function DataStats({ stats, data, loading }: DataStatsProps) {
|
|
|
90
90
|
return data.filter(item => {
|
|
91
91
|
if (!stat.filter) return true
|
|
92
92
|
return Object.entries(stat.filter).every(([key, value]) => {
|
|
93
|
-
const itemValue = key.includes('.')
|
|
93
|
+
const itemValue = key.includes('.')
|
|
94
94
|
? key.split('.').reduce((obj, k) => obj?.[k], item)
|
|
95
|
-
: item[key]
|
|
95
|
+
: (item[key] ?? item.data?.[key])
|
|
96
96
|
return itemValue === value
|
|
97
97
|
})
|
|
98
98
|
}).length
|
|
@@ -130,10 +130,10 @@ export function DataStats({ stats, data, loading }: DataStatsProps) {
|
|
|
130
130
|
</div>
|
|
131
131
|
)
|
|
132
132
|
}
|
|
133
|
+
// CIL[END stable_id="~/.framework/src/components/runtime/DataStats.tsx:DataStats:component"]
|
|
133
134
|
// CIL[DOC-VECTOR type="context" content="purpose='Render data statistics cards'; No verified external callers; imports: .framework/src/types/types.ts,.framework/src/components/ui/card.tsx"]
|
|
134
135
|
// CIL[DOC-VECTOR type="blast_radius" content="No direct caller data from CIL graph; local impact only"]
|
|
135
136
|
// CIL[DOC-VECTOR type="configuration" content="No environment or build configuration dependencies identified"]
|
|
136
137
|
// CIL[DOC-VECTOR type="constraint" content="Standard runtime; no special invariants documented"]
|
|
137
138
|
// CIL[DOC-VECTOR type="implementation_pattern" content="" status="pending_human_input"]
|
|
138
139
|
// CIL[DOC-VECTOR type="user_journey" content="" status="pending_human_input"]
|
|
139
|
-
// CIL[END stable_id="~/.framework/src/components/runtime/DataStats.tsx:datastats:function"]
|
|
@@ -15,6 +15,7 @@ import { useNavigate } from 'react-router-dom'
|
|
|
15
15
|
import { EntityColumn } from '../../types/types'
|
|
16
16
|
import { formatDateTime } from '../../lib/utils'
|
|
17
17
|
import {
|
|
18
|
+
// CIL[END stable_id="~/.framework/src/components/runtime/DataTable.tsx:module_header:module_header"]
|
|
18
19
|
Table,
|
|
19
20
|
TableBody,
|
|
20
21
|
TableCell,
|
|
@@ -34,10 +35,8 @@ import * as Icons from 'lucide-react'
|
|
|
34
35
|
// CIL[DOC-VECTOR type="constraint" content="Standard runtime; no special invariants documented"]
|
|
35
36
|
// CIL[DOC-VECTOR type="implementation_pattern" content="" status="pending_human_input"]
|
|
36
37
|
// CIL[DOC-VECTOR type="user_journey" content="" status="pending_human_input"]
|
|
37
|
-
// CIL[END stable_id="~/.framework/src/components/runtime/DataTable.tsx:module_header:module_header"]
|
|
38
38
|
|
|
39
39
|
|
|
40
|
-
// CIL[BEGIN stable_id="~/.framework/src/components/runtime/DataTable.tsx:DataTableProps:interface" type="interface" identity="DataTableProps" parent="~/.framework/src/components/runtime/DataTable.tsx"]
|
|
41
40
|
// CIL[DOC-MACRO purpose="TypeScript props contract for the DataTable component"]
|
|
42
41
|
// CIL[DOC-RESPONSIBILITY responsibility="Defines the expected properties passed to DataTable, including columns, data, sort handlers, and state flags."]
|
|
43
42
|
// CIL[DOC-CONTEXT module="components/runtime" layer="component" related_files=".framework/src/components/runtime/DataTable.tsx,.framework/src/components/ui/badge.tsx,.framework/src/components/ui/button.tsx,.framework/src/components/ui/card.tsx,.framework/src/components/ui/skeleton.tsx,.framework/src/components/ui/table.tsx,.framework/src/lib/utils.ts,.framework/src/types/types.ts"]
|
|
@@ -45,6 +44,7 @@ import * as Icons from 'lucide-react'
|
|
|
45
44
|
// CIL[DOC-MICRO logic_summary="Declares the DataTableProps interface consumed by the DataTable React component." notable_decisions="[]"]
|
|
46
45
|
// CIL[DOC-CONFIDENCE pass="second" score="0.90" flags="none"]
|
|
47
46
|
// CIL[DOC-STABILITY stability="stable"]
|
|
47
|
+
// CIL[BEGIN stable_id="~/.framework/src/components/runtime/DataTable.tsx:DataTableProps:interface" type="interface" identity="DataTableProps" parent="~/.framework/src/components/runtime/DataTable.tsx"]
|
|
48
48
|
interface DataTableProps {
|
|
49
49
|
columns: EntityColumn[]
|
|
50
50
|
data: any[]
|
|
@@ -57,16 +57,15 @@ interface DataTableProps {
|
|
|
57
57
|
emptyMessage: string
|
|
58
58
|
emptyIcon: string
|
|
59
59
|
}
|
|
60
|
+
// CIL[END stable_id="~/.framework/src/components/runtime/DataTable.tsx:DataTableProps:interface"]
|
|
60
61
|
// CIL[DOC-VECTOR type="context" content="purpose='TypeScript props contract for the DataTable component'; No verified external callers; imports: .framework/src/types/types.ts,.framework/src/lib/utils.ts,.framework/src/components/ui/table.tsx"]
|
|
61
62
|
// CIL[DOC-VECTOR type="blast_radius" content="No direct caller data from CIL graph; local impact only"]
|
|
62
63
|
// CIL[DOC-VECTOR type="configuration" content="No environment or build configuration dependencies identified"]
|
|
63
64
|
// CIL[DOC-VECTOR type="constraint" content="Standard runtime; no special invariants documented"]
|
|
64
65
|
// CIL[DOC-VECTOR type="implementation_pattern" content="" status="pending_human_input"]
|
|
65
66
|
// CIL[DOC-VECTOR type="user_journey" content="" status="pending_human_input"]
|
|
66
|
-
// CIL[END stable_id="~/.framework/src/components/runtime/DataTable.tsx:DataTableProps:interface"]
|
|
67
67
|
|
|
68
68
|
|
|
69
|
-
// CIL[BEGIN stable_id="~/.framework/src/components/runtime/DataTable.tsx:DataTable:component" type="component" identity="DataTable" parent="~/.framework/src/components/runtime/DataTable.tsx"]
|
|
70
69
|
// CIL[DOC-MACRO purpose="Renders a sortable, clickable data table for runtime records with loading, error, and empty states"]
|
|
71
70
|
// CIL[DOC-RESPONSIBILITY responsibility="Displays tabular data, handles sorting, row navigation, and loading/error/empty UI states."]
|
|
72
71
|
// CIL[DOC-CONTEXT module="components/runtime" layer="component" related_files=".framework/src/components/runtime/DataTable.tsx,.framework/src/components/ui/badge.tsx,.framework/src/components/ui/button.tsx,.framework/src/components/ui/card.tsx,.framework/src/components/ui/skeleton.tsx,.framework/src/components/ui/table.tsx,.framework/src/lib/utils.ts,.framework/src/types/types.ts"]
|
|
@@ -74,6 +73,7 @@ interface DataTableProps {
|
|
|
74
73
|
// CIL[DOC-MICRO logic_summary="Renders skeleton, error, empty, or table views; uses renderCell to format timestamp, badge, and truncated text; handles ascending/descending sort and row navigation." notable_decisions="[]"]
|
|
75
74
|
// CIL[DOC-CONFIDENCE pass="second" score="0.90" flags="none"]
|
|
76
75
|
// CIL[DOC-STABILITY stability="stable"]
|
|
76
|
+
// CIL[BEGIN stable_id="~/.framework/src/components/runtime/DataTable.tsx:DataTable:component" type="component" identity="DataTable" parent="~/.framework/src/components/runtime/DataTable.tsx"]
|
|
77
77
|
export function DataTable({
|
|
78
78
|
columns,
|
|
79
79
|
data,
|
|
@@ -112,13 +112,15 @@ export function DataTable({
|
|
|
112
112
|
const renderCell = (column: EntityColumn, row: any) => {
|
|
113
113
|
const value = column.key.includes('.')
|
|
114
114
|
? column.key.split('.').reduce((obj, k) => obj?.[k], row)
|
|
115
|
-
: row[column.key]
|
|
116
|
-
|
|
117
|
-
|
|
115
|
+
: (row[column.key] ?? row.data?.[column.key])
|
|
116
|
+
|
|
117
|
+
const displayType = column.display_type || column.type
|
|
118
|
+
|
|
119
|
+
if (displayType === 'timestamp' && value) {
|
|
118
120
|
return formatDateTime(value)
|
|
119
121
|
}
|
|
120
|
-
|
|
121
|
-
if (
|
|
122
|
+
|
|
123
|
+
if (displayType === 'badge' && column.badgeColors) {
|
|
122
124
|
const colorClass = column.badgeColors[value?.toString()] || 'bg-muted text-muted-foreground'
|
|
123
125
|
return (
|
|
124
126
|
<Badge variant="secondary" className={colorClass}>
|
|
@@ -217,10 +219,10 @@ export function DataTable({
|
|
|
217
219
|
</Card>
|
|
218
220
|
)
|
|
219
221
|
}
|
|
222
|
+
// CIL[END stable_id="~/.framework/src/components/runtime/DataTable.tsx:DataTable:component"]
|
|
220
223
|
// CIL[DOC-VECTOR type="context" content="purpose='Renders a sortable, clickable data table for runtime records with loading, error, and empty states'; No verified external callers; imports: .framework/src/types/types.ts,.framework/src/lib/utils.ts,.framework/src/components/ui/table.tsx"]
|
|
221
224
|
// CIL[DOC-VECTOR type="blast_radius" content="No direct caller data from CIL graph; local impact only"]
|
|
222
225
|
// CIL[DOC-VECTOR type="configuration" content="No environment or build configuration dependencies identified"]
|
|
223
226
|
// CIL[DOC-VECTOR type="constraint" content="Standard runtime; no special invariants documented"]
|
|
224
227
|
// CIL[DOC-VECTOR type="implementation_pattern" content="" status="pending_human_input"]
|
|
225
228
|
// CIL[DOC-VECTOR type="user_journey" content="" status="pending_human_input"]
|
|
226
|
-
// CIL[END stable_id="~/.framework/src/components/runtime/DataTable.tsx:DataTable:component"]
|