generated from coulomb/repo-seed
fix(WP-0017/E3): Layer 3 error fixes — controllers and views
Fix compilation errors across 6 controllers and 29 views: import cleanup, ResponseException pattern for API auth, type fixes, unused import removal. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,9 +1,6 @@
|
||||
module Web.View.HubRoutingRules.New where
|
||||
|
||||
import Web.Types
|
||||
import Generated.Types
|
||||
import IHP.Prelude
|
||||
import IHP.ViewPrelude
|
||||
import Web.View.Prelude
|
||||
import Web.Routes ()
|
||||
|
||||
data NewView = NewView
|
||||
@@ -21,11 +18,14 @@ instance View NewView where
|
||||
|
||||
renderForm :: HubRoutingRule -> [Hub] -> Html
|
||||
renderForm rule hubs = formFor rule [hsx|
|
||||
{(selectField #sourceHubId hubs){ fieldLabel = "Source Hub" }}
|
||||
{(selectField #targetHubId hubs){ fieldLabel = "Target Hub" }}
|
||||
{(selectField #sourceHubId (hubOptions hubs)){ fieldLabel = "Source Hub" }}
|
||||
{(selectField #targetHubId (hubOptions hubs)){ fieldLabel = "Target Hub" }}
|
||||
{(textField #matchCategory){ helpText = "Leave blank to match any category" }}
|
||||
{(textField #matchWidgetType){ helpText = "Leave blank to match any widget type" }}
|
||||
{(numberField #priority){ helpText = "Higher priority rules are evaluated first" }}
|
||||
{textareaField #notes}
|
||||
{submitButton}
|
||||
|]
|
||||
|
||||
hubOptions :: [Hub] -> [(Text, Id Hub)]
|
||||
hubOptions = map (\h -> (h.name, h.id))
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
module Web.View.HubRoutingRules.RoutedCandidates where
|
||||
|
||||
import Web.Types
|
||||
import Generated.Types
|
||||
import IHP.Prelude
|
||||
import IHP.ViewPrelude
|
||||
import Web.View.Prelude
|
||||
import Web.Routes ()
|
||||
|
||||
data RoutedCandidatesView = RoutedCandidatesView
|
||||
@@ -49,7 +46,7 @@ renderRoutedCandidates candidates = [hsx|
|
||||
renderCandidateRow :: RequirementCandidate -> Html
|
||||
renderCandidateRow c = [hsx|
|
||||
<tr class="hover:bg-gray-50">
|
||||
<td class="px-4 py-3 text-gray-800">{c.summary}</td>
|
||||
<td class="px-4 py-3 text-gray-800">{c.title}</td>
|
||||
<td class="px-4 py-3 text-gray-500">{c.category}</td>
|
||||
<td class="px-4 py-3">
|
||||
<span class="text-xs bg-yellow-100 text-yellow-800 px-2 py-0.5 rounded font-medium">
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
module Web.View.HubRoutingRules.Show where
|
||||
|
||||
import Web.Types
|
||||
import Generated.Types
|
||||
import IHP.Prelude
|
||||
import IHP.ViewPrelude
|
||||
import Web.View.Prelude
|
||||
import Web.Routes ()
|
||||
import Web.View.HubRoutingRules.Index (statusBadge)
|
||||
|
||||
@@ -35,11 +32,11 @@ instance View ShowView where
|
||||
<dl class="grid grid-cols-2 gap-4 text-sm">
|
||||
<div>
|
||||
<dt class="text-gray-500">Match Category</dt>
|
||||
<dd class="font-medium">{maybe "any" id rule.matchCategory}</dd>
|
||||
<dd class="font-medium">{fromMaybe "any" rule.matchCategory}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt class="text-gray-500">Match Widget Type</dt>
|
||||
<dd class="font-medium">{maybe "any" id rule.matchWidgetType}</dd>
|
||||
<dd class="font-medium">{fromMaybe "any" rule.matchWidgetType}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt class="text-gray-500">Priority</dt>
|
||||
|
||||
Reference in New Issue
Block a user