generated from coulomb/repo-seed
fix(WP-0014/A2): close remaining pure-param and structural compilation errors
Convert all remaining `<- paramOrNothing / param / paramOrDefault /
currentUserOrNothing` monadic binds to `let` — these functions are pure
(ImplicitParams-based) in IHP v1.5, so `<-` is a type error in an IO
do-block.
Controllers fixed:
AgentDelegations, AiGovernancePolicies, Annotations, ApiConsumers,
CollectiveProposals, DecisionRecords, DeploymentRecords,
HubCapabilityManifests, HubRoutingRules, InstitutionalKnowledge,
OutcomeCorrelations, RequirementCandidates, TypeRegistries,
WebhookSubscriptions, Widgets,
Api/V2/{Annotations,InteractionEvents,Token}
WebhookSubscriptions: remove orphaned `Right () ->` case arm that was
left inside a bare `unless` block (structural parse error).
Also carries forward all in-progress fixes from the working tree:
helpers (AgentBridge, ApiRateLimit, BottleneckDetector,
CrossHubPropagation, FrictionScore),
views (CanSelect instances, HSX lambda extraction, formFor wrappers),
env/build (envrc GHCi perms, flake.nix Tailwind + GHC resource limits,
static/app.css additional Tailwind output).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
module Web.View.ModelRoutingPolicies.Index where
|
||||
|
||||
import IHP.ViewPrelude
|
||||
import Web.View.Prelude
|
||||
|
||||
data IndexView = IndexView
|
||||
{ policies :: ![ModelRoutingPolicy]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module Web.View.ModelRoutingPolicies.New where
|
||||
|
||||
import IHP.ViewPrelude
|
||||
import Web.View.Prelude
|
||||
|
||||
data NewView = NewView
|
||||
{ policy :: !ModelRoutingPolicy
|
||||
@@ -21,37 +21,40 @@ instance View NewView where
|
||||
html NewView { .. } = [hsx|
|
||||
<div class="p-6 max-w-xl">
|
||||
<h1 class="text-2xl font-bold text-gray-900 mb-6">Add Routing Policy</h1>
|
||||
{formFor policy [hsx|
|
||||
<div class="space-y-4">
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 mb-1">Hub</label>
|
||||
<select name="hubId" class="block w-full border-gray-300 rounded-md shadow-sm text-sm">
|
||||
{forEach hubs renderHubOption}
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 mb-1">Task Type</label>
|
||||
<select name="taskType" class="block w-full border-gray-300 rounded-md shadow-sm text-sm">
|
||||
{forEach taskTypeOptions renderTaskTypeOption}
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 mb-1">Agent</label>
|
||||
<select name="agentRegistrationId" class="block w-full border-gray-300 rounded-md shadow-sm text-sm">
|
||||
{forEach agents renderAgentOption}
|
||||
</select>
|
||||
</div>
|
||||
<div>{(numberField #priority) { fieldLabel = "Priority (higher wins)", placeholder = "0" }}</div>
|
||||
<div class="flex gap-3 pt-2">
|
||||
{submitButton { label = "Create Policy" }}
|
||||
<a href={ModelRoutingPoliciesAction}
|
||||
class="px-4 py-2 bg-gray-100 hover:bg-gray-200 rounded-md text-sm">Cancel</a>
|
||||
</div>
|
||||
</div>
|
||||
|]}
|
||||
{renderForm policy hubs agents}
|
||||
</div>
|
||||
|]
|
||||
|
||||
renderForm :: ModelRoutingPolicy -> [Hub] -> [AgentRegistration] -> Html
|
||||
renderForm policy hubs agents = formFor policy [hsx|
|
||||
<div class="space-y-4">
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 mb-1">Hub</label>
|
||||
<select name="hubId" class="block w-full border-gray-300 rounded-md shadow-sm text-sm">
|
||||
{forEach hubs renderHubOption}
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 mb-1">Task Type</label>
|
||||
<select name="taskType" class="block w-full border-gray-300 rounded-md shadow-sm text-sm">
|
||||
{forEach taskTypeOptions renderTaskTypeOption}
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 mb-1">Agent</label>
|
||||
<select name="agentRegistrationId" class="block w-full border-gray-300 rounded-md shadow-sm text-sm">
|
||||
{forEach agents renderAgentOption}
|
||||
</select>
|
||||
</div>
|
||||
<div>{(numberField #priority) { fieldLabel = "Priority (higher wins)", placeholder = "0" }}</div>
|
||||
<div class="flex gap-3 pt-2">
|
||||
{submitButton { label = "Create Policy" }}
|
||||
<a href={ModelRoutingPoliciesAction}
|
||||
class="px-4 py-2 bg-gray-100 hover:bg-gray-200 rounded-md text-sm">Cancel</a>
|
||||
</div>
|
||||
</div>
|
||||
|]
|
||||
|
||||
renderHubOption :: Hub -> Html
|
||||
renderHubOption h = [hsx|<option value={show h.id}>{h.name}</option>|]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user