generated from coulomb/repo-seed
fix: resolve all GHC 9.10.3 / IHP 1.5 compile errors (all 616 modules load)
Some checks failed
Test / test (push) Has been cancelled
Some checks failed
Test / test (push) Has been cancelled
Fix 13 modules that blocked compilation on Alpine: - FrontController: remove annotationLauncherScript helper (IHP Html is a constrained type synonym); add (?context, ?request) constraint to defaultLayout matching what setLayout expects - HubCapabilityManifests: switch JSONB fill to paramList+toJSON; fix dynamic SQL Text→Query via fromString/cs; void sqlExec; add Control.Monad.void - Hubs: replace raw Array sqlQuery with filterWhereIn query builder; fix isInList validators - DecisionRecords: remove unregistered DistilDecisionAction; fix hub resolution chain via candidateId→sourceWidgetId; BridgeResponse(..) - RequirementCandidates: BridgeResponse(..); remove @Widget type apps from fetchOneOrNothing; void ConfidenceAnnotation createRecord - AdaptiveThresholds: fix sqlQuery tuple param (Only hubId) - AgentDelegations, AgentRegistrations, Widgets: BridgeResponse(..) - Annotations, DeploymentRecords, GovernanceTemplates: minor type fixes - DecisionRecords/Edit view: extract formAction before HSX block Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -8,9 +8,10 @@ import Web.View.HubCapabilityManifests.Edit
|
||||
import Generated.Types
|
||||
import IHP.Prelude
|
||||
import IHP.ControllerPrelude
|
||||
import Data.Aeson (Value, Array, decode, encode)
|
||||
import Data.Aeson (Value, Array, decode, encode, toJSON)
|
||||
import qualified Data.Vector as V
|
||||
import Data.Maybe (mapMaybe)
|
||||
import Control.Monad (void)
|
||||
|
||||
instance Controller HubCapabilityManifestsController where
|
||||
beforeAction = ensureIsUser
|
||||
@@ -76,9 +77,11 @@ instance Controller HubCapabilityManifestsController where
|
||||
setErrorMessage "Active manifests are read-only. Retire the current manifest and create a new draft to amend."
|
||||
redirectTo ShowHubCapabilityManifestAction { hubCapabilityManifestId }
|
||||
manifest
|
||||
|> fill @'["manifestVersion", "capabilityDescription", "contact",
|
||||
"declaredWidgetTypes", "declaredEventTypes",
|
||||
"declaredAnnotationCategories", "declaredPolicyScopes"]
|
||||
|> fill @'["manifestVersion", "capabilityDescription", "contact"]
|
||||
|> set #declaredWidgetTypes (toJSON (paramList @Text "declaredWidgetTypes"))
|
||||
|> set #declaredEventTypes (toJSON (paramList @Text "declaredEventTypes"))
|
||||
|> set #declaredAnnotationCategories (toJSON (paramList @Text "declaredAnnotationCategories"))
|
||||
|> set #declaredPolicyScopes (toJSON (paramList @Text "declaredPolicyScopes"))
|
||||
|> ifValid \case
|
||||
Left manifest -> render EditView { manifest, hub, widgetTypeEntries, eventTypeEntries, categoryEntries, policyScopeEntries }
|
||||
Right manifest -> do
|
||||
@@ -142,7 +145,7 @@ checkConflict ::
|
||||
Text -> Id Hub -> Text -> IO [Text]
|
||||
checkConflict tableName hubId name = do
|
||||
rows <- sqlQuery
|
||||
("SELECT owner_hub_id FROM " <> tableName <> " WHERE name = ?")
|
||||
(fromString $ cs ("SELECT owner_hub_id FROM " <> tableName <> " WHERE name = ?"))
|
||||
(Only name)
|
||||
case rows of
|
||||
[] -> pure []
|
||||
@@ -158,12 +161,8 @@ upsertType ::
|
||||
(?modelContext :: ModelContext) =>
|
||||
Text -> Id Hub -> Text -> IO ()
|
||||
upsertType tableName hubId name =
|
||||
sqlExec
|
||||
("INSERT INTO " <> tableName <> " (name, label, owner_hub_id, status) "
|
||||
<> "VALUES (?, ?, ?, 'active') ON CONFLICT (name) DO NOTHING")
|
||||
void $ sqlExec
|
||||
(fromString $ cs ("INSERT INTO " <> tableName <> " (name, label, owner_hub_id, status) "
|
||||
<> "VALUES (?, ?, ?, 'active') ON CONFLICT (name) DO NOTHING"))
|
||||
(name, name, hubId)
|
||||
|
||||
intercalate :: Text -> [Text] -> Text
|
||||
intercalate _ [] = ""
|
||||
intercalate _ [x] = x
|
||||
intercalate sep (x:xs) = x <> sep <> intercalate sep xs
|
||||
|
||||
Reference in New Issue
Block a user