module Web.View.HubCapabilityManifests.New where import Web.Types import Generated.Types import IHP.Prelude import IHP.ViewPrelude import Web.Routes () data NewView = NewView { manifest :: !HubCapabilityManifest , hubs :: ![Hub] } instance View NewView where html NewView { .. } = [hsx|
← Capability Manifests

New Capability Manifest

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.
{renderManifestForm manifest hubs}
|] renderManifestForm :: HubCapabilityManifest -> [Hub] -> Html renderManifestForm manifest hubs = formFor manifest [hsx| {selectField #hubId (hubOptions hubs)} {(textareaField #capabilityDescription) { fieldLabel = "Capability Description" }} {(textField #contact) { fieldLabel = "Contact (team or person)" }} {submitButton { label = "Create Draft" }} |] hubOptions :: [Hub] -> [(Text, Id Hub)] hubOptions hubs = map (\h -> (h.name <> " (" <> h.hubKind <> ")", h.id)) hubs