Files
inter-hub/Web/View/HubCapabilityManifests/New.hs
Bernd Worsch b5d73aa18b
Some checks failed
Test / test (push) Has been cancelled
feat(WP-0009): IHF GAAF Compliance Foundation — type registries, extension manifests, architectural contracts
Implements IHUB-WP-0009: closes four GAAF-2026 gaps before domain hub work begins.
- TypeRegistry helper + controllers/views (hub_kind, hub_capability_manifest)
- HubCapabilityManifest entity with validation and registry linkage
- ARCHITECTURE-LAYERS.md + CI-enforced boundary contracts
- Alembic migration 1743724800, fitness tests (Test/Architecture/)
- GAAF spec, Operational Architecture spec, domain hub extension guide
- Updates to CLAUDE.md, SCOPE.md, Schema.sql, Routes, FrontController, Types

state_hub_sync: pending (tunnel was STALE at completion time; run fix-consistency)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-31 21:17:39 +00:00

56 lines
2.4 KiB
Haskell

module Web.View.HubCapabilityManifests.New where
import Web.Types
import Generated.Types
import IHP.Prelude
import IHP.ViewPrelude
data NewView = NewView
{ manifest :: !HubCapabilityManifest
, hubs :: ![Hub]
}
instance View NewView where
html NewView { .. } = [hsx|
<div class="mb-4">
<a href={HubCapabilityManifestsAction} class="text-sm text-gray-500 hover:text-gray-700">
Capability Manifests
</a>
</div>
<h1 class="text-xl font-semibold mb-6">New Capability Manifest</h1>
<div class="bg-amber-50 border border-amber-200 rounded p-4 mb-6 text-sm text-amber-800">
A capability manifest lets a domain or shared hub declare the widget types, event types,
annotation categories, and policy scopes it owns. Create a draft, declare your types,
then activate to register them with the framework.
</div>
<form method="POST" action={CreateHubCapabilityManifestAction}>
<div class="bg-white rounded-lg border border-gray-200 p-6 max-w-lg space-y-4">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Hub</label>
{selectField #hubId (hubOptions hubs)}
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">
Capability Description <span class="text-gray-400 text-xs">(optional)</span>
</label>
{(textareaField #capabilityDescription) { fieldClass = "w-full border border-gray-300 rounded px-3 py-2 text-sm" }}
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">
Contact <span class="text-gray-400 text-xs">(team or person)</span>
</label>
{(textField #contact) { fieldClass = "w-full border border-gray-300 rounded px-3 py-2 text-sm" }}
</div>
<div class="pt-2">
<button type="submit"
class="bg-indigo-600 text-white text-sm px-4 py-2 rounded hover:bg-indigo-700">
Create Draft
</button>
</div>
</div>
</form>
|]
hubOptions :: [Hub] -> [(Text, Id Hub)]
hubOptions hubs = map (\h -> (h.name <> " (" <> h.hubKind <> ")", h.id)) hubs