module Web.View.HubCapabilityManifests.Edit where import Web.Types import Generated.Types import IHP.Prelude import IHP.ViewPrelude import Web.Routes () import Data.Aeson (Value(..), encode, decode) import qualified Data.ByteString.Lazy.Char8 as BL data EditView = EditView { manifest :: !HubCapabilityManifest , hub :: !Hub , widgetTypeEntries :: ![WidgetTypeRegistry] , eventTypeEntries :: ![EventTypeRegistry] , categoryEntries :: ![AnnotationCategoryRegistry] , policyScopeEntries :: ![PolicyScopeRegistry] } instance View EditView where html EditView { .. } = [hsx|
Declare the type names this hub owns. After saving, activate the manifest to register them.
{renderReadOnlyWarning manifest} |] renderActivateLink :: Id HubCapabilityManifest -> Html renderActivateLink mid = [hsx| Save & Activate |] -- | Render a JSON array text area with available registry options shown below. typeArraySection :: Text -> Text -> Value -> [Text] -> Html typeArraySection title fieldName val names = [hsx|JSON array of type names to declare ownership of. Names that don't yet exist in the registry will be created on activation.
Registered: {joinNames names}