@burdenoff/microfe-govcitizenhub 2026.720.7 → 2026.730.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/govcitizenhub/GovCitizenHubRoot.d.ts.map +1 -1
- package/dist/govcitizenhub/GovCitizenHubRoot.js +44 -36
- package/dist/govcitizenhub/GovCitizenHubRoot.js.map +1 -1
- package/dist/govcitizenhub/GovCitizenHubRoutes.d.ts.map +1 -1
- package/dist/govcitizenhub/GovCitizenHubRoutes.js +134 -6
- package/dist/govcitizenhub/GovCitizenHubRoutes.js.map +1 -1
- package/dist/govcitizenhub/components/DocumentUploadField.d.ts +17 -11
- package/dist/govcitizenhub/components/DocumentUploadField.d.ts.map +1 -1
- package/dist/govcitizenhub/components/DocumentUploadField.js +45 -42
- package/dist/govcitizenhub/components/DocumentUploadField.js.map +1 -1
- package/dist/govcitizenhub/components/GovCharts.js +127 -51
- package/dist/govcitizenhub/components/GovCharts.js.map +1 -1
- package/dist/govcitizenhub/hooks/index.d.ts +1 -0
- package/dist/govcitizenhub/hooks/index.d.ts.map +1 -1
- package/dist/govcitizenhub/hooks/index.js +1 -0
- package/dist/govcitizenhub/hooks/useGovApi.d.ts +3 -0
- package/dist/govcitizenhub/hooks/useGovApi.d.ts.map +1 -1
- package/dist/govcitizenhub/hooks/useGovApi.js +1 -1
- package/dist/govcitizenhub/hooks/useGovApi.js.map +1 -1
- package/dist/govcitizenhub/hooks/useIntelligenceApi.d.ts +214 -0
- package/dist/govcitizenhub/hooks/useIntelligenceApi.d.ts.map +1 -0
- package/dist/govcitizenhub/hooks/useIntelligenceApi.js +1140 -0
- package/dist/govcitizenhub/hooks/useIntelligenceApi.js.map +1 -0
- package/dist/govcitizenhub/index.d.ts +1 -0
- package/dist/govcitizenhub/index.d.ts.map +1 -1
- package/dist/govcitizenhub/index.js +18 -0
- package/dist/govcitizenhub/pages/agencies/AgenciesPage.js +7 -7
- package/dist/govcitizenhub/pages/agencies/AgencyFormDialog.js +6 -6
- package/dist/govcitizenhub/pages/applications/ApplicationDetailPage.js +16 -16
- package/dist/govcitizenhub/pages/applications/ApplicationsPage.js +35 -35
- package/dist/govcitizenhub/pages/applications/ApplicationsPage.js.map +1 -1
- package/dist/govcitizenhub/pages/applications/NewApplicationPage.js +1 -1
- package/dist/govcitizenhub/pages/documents/DocumentsPage.js +5 -5
- package/dist/govcitizenhub/pages/grievances/GrievanceDetailPage.js +30 -30
- package/dist/govcitizenhub/pages/grievances/GrievanceDetailPage.js.map +1 -1
- package/dist/govcitizenhub/pages/grievances/GrievancesPage.js +15 -15
- package/dist/govcitizenhub/pages/intelligence/AdminLevelsPage.d.ts +4 -0
- package/dist/govcitizenhub/pages/intelligence/AdminLevelsPage.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/AdminLevelsPage.js +634 -0
- package/dist/govcitizenhub/pages/intelligence/AdminLevelsPage.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/AssetFormDialog.d.ts +20 -0
- package/dist/govcitizenhub/pages/intelligence/AssetFormDialog.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/AssetFormDialog.js +537 -0
- package/dist/govcitizenhub/pages/intelligence/AssetFormDialog.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/AssetImage.d.ts +11 -0
- package/dist/govcitizenhub/pages/intelligence/AssetImage.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/AssetImage.js +25 -0
- package/dist/govcitizenhub/pages/intelligence/AssetImage.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/AssetMapPanel.d.ts +15 -0
- package/dist/govcitizenhub/pages/intelligence/AssetMapPanel.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/AssetMapPanel.js +203 -0
- package/dist/govcitizenhub/pages/intelligence/AssetMapPanel.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/BenchmarkPage.d.ts +4 -0
- package/dist/govcitizenhub/pages/intelligence/BenchmarkPage.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/BenchmarkPage.js +497 -0
- package/dist/govcitizenhub/pages/intelligence/BenchmarkPage.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/BudgetPage.d.ts +4 -0
- package/dist/govcitizenhub/pages/intelligence/BudgetPage.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/BudgetPage.js +1084 -0
- package/dist/govcitizenhub/pages/intelligence/BudgetPage.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/ConsultationFormDialog.d.ts +13 -0
- package/dist/govcitizenhub/pages/intelligence/ConsultationFormDialog.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/ConsultationFormDialog.js +581 -0
- package/dist/govcitizenhub/pages/intelligence/ConsultationFormDialog.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/ConsultationParticipateDialog.d.ts +11 -0
- package/dist/govcitizenhub/pages/intelligence/ConsultationParticipateDialog.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/ConsultationParticipateDialog.js +429 -0
- package/dist/govcitizenhub/pages/intelligence/ConsultationParticipateDialog.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/ConsultationResultsPanel.d.ts +8 -0
- package/dist/govcitizenhub/pages/intelligence/ConsultationResultsPanel.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/ConsultationResultsPanel.js +235 -0
- package/dist/govcitizenhub/pages/intelligence/ConsultationResultsPanel.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/ConsultationsPage.d.ts +4 -0
- package/dist/govcitizenhub/pages/intelligence/ConsultationsPage.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/ConsultationsPage.js +534 -0
- package/dist/govcitizenhub/pages/intelligence/ConsultationsPage.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/CorrectionsPage.d.ts +4 -0
- package/dist/govcitizenhub/pages/intelligence/CorrectionsPage.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/CorrectionsPage.js +723 -0
- package/dist/govcitizenhub/pages/intelligence/CorrectionsPage.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/ElectionsPage.d.ts +5 -0
- package/dist/govcitizenhub/pages/intelligence/ElectionsPage.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/ElectionsPage.js +1029 -0
- package/dist/govcitizenhub/pages/intelligence/ElectionsPage.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/GovernancePage.d.ts +5 -0
- package/dist/govcitizenhub/pages/intelligence/GovernancePage.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/GovernancePage.js +1545 -0
- package/dist/govcitizenhub/pages/intelligence/GovernancePage.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/IndicatorCatalogPage.d.ts +4 -0
- package/dist/govcitizenhub/pages/intelligence/IndicatorCatalogPage.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/IndicatorCatalogPage.js +960 -0
- package/dist/govcitizenhub/pages/intelligence/IndicatorCatalogPage.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/IndicatorsPage.d.ts +13 -0
- package/dist/govcitizenhub/pages/intelligence/IndicatorsPage.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/IndicatorsPage.js +927 -0
- package/dist/govcitizenhub/pages/intelligence/IndicatorsPage.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/JurisdictionDirectoryPage.d.ts +4 -0
- package/dist/govcitizenhub/pages/intelligence/JurisdictionDirectoryPage.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/JurisdictionDirectoryPage.js +620 -0
- package/dist/govcitizenhub/pages/intelligence/JurisdictionDirectoryPage.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/JurisdictionLayout.d.ts +20 -0
- package/dist/govcitizenhub/pages/intelligence/JurisdictionLayout.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/JurisdictionLayout.js +183 -0
- package/dist/govcitizenhub/pages/intelligence/JurisdictionLayout.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/JurisdictionProfilePage.d.ts +4 -0
- package/dist/govcitizenhub/pages/intelligence/JurisdictionProfilePage.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/JurisdictionProfilePage.js +629 -0
- package/dist/govcitizenhub/pages/intelligence/JurisdictionProfilePage.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/OpenDataPage.d.ts +4 -0
- package/dist/govcitizenhub/pages/intelligence/OpenDataPage.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/OpenDataPage.js +1125 -0
- package/dist/govcitizenhub/pages/intelligence/OpenDataPage.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/ProjectsPage.d.ts +4 -0
- package/dist/govcitizenhub/pages/intelligence/ProjectsPage.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/ProjectsPage.js +1518 -0
- package/dist/govcitizenhub/pages/intelligence/ProjectsPage.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/PublicAssetsPage.d.ts +4 -0
- package/dist/govcitizenhub/pages/intelligence/PublicAssetsPage.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/PublicAssetsPage.js +577 -0
- package/dist/govcitizenhub/pages/intelligence/PublicAssetsPage.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/ServicePerformancePage.d.ts +4 -0
- package/dist/govcitizenhub/pages/intelligence/ServicePerformancePage.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/ServicePerformancePage.js +534 -0
- package/dist/govcitizenhub/pages/intelligence/ServicePerformancePage.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/TimelinePage.d.ts +5 -0
- package/dist/govcitizenhub/pages/intelligence/TimelinePage.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/TimelinePage.js +538 -0
- package/dist/govcitizenhub/pages/intelligence/TimelinePage.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/consultationQuestions.d.ts +53 -0
- package/dist/govcitizenhub/pages/intelligence/consultationQuestions.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/consultationQuestions.js +138 -0
- package/dist/govcitizenhub/pages/intelligence/consultationQuestions.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/index.d.ts +27 -0
- package/dist/govcitizenhub/pages/intelligence/index.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/index.js +17 -0
- package/dist/govcitizenhub/pages/payments/PaymentsPage.js +11 -11
- package/dist/govcitizenhub/pages/payments/PaymentsPage.js.map +1 -1
- package/dist/govcitizenhub/pages/permits/PermitsPage.js +6 -6
- package/dist/govcitizenhub/pages/services/ServiceDetailPage.js +8 -8
- package/dist/govcitizenhub/pages/services/ServiceFormDialog.js +98 -98
- package/dist/govcitizenhub/pages/services/ServiceFormDialog.js.map +1 -1
- package/dist/govcitizenhub/types/index.d.ts +1 -0
- package/dist/govcitizenhub/types/index.d.ts.map +1 -1
- package/dist/govcitizenhub/types/intelligence.d.ts +1559 -0
- package/dist/govcitizenhub/types/intelligence.d.ts.map +1 -0
- package/dist/govcitizenhub/types/intelligence.js +125 -0
- package/dist/govcitizenhub/types/intelligence.js.map +1 -0
- package/dist/index.js +19 -2
- package/dist/node_modules/recharts/es6/chart/BarChart.js +24 -0
- package/dist/node_modules/recharts/es6/chart/BarChart.js.map +1 -0
- package/dist/utils/pageContext.d.ts +1 -0
- package/dist/utils/pageContext.d.ts.map +1 -1
- package/dist/utils/pageContext.js +44 -17
- package/dist/utils/pageContext.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,723 @@
|
|
|
1
|
+
import { cn as e } from "../../utils/cn.js";
|
|
2
|
+
import { formatDateTime as t, formatRelativeTime as n } from "../../utils/formatters.js";
|
|
3
|
+
import { StatusBadge as r } from "../../components/StatusBadge.js";
|
|
4
|
+
import { EmptyState as i } from "../../components/EmptyState.js";
|
|
5
|
+
import { useGovDataChangeProposals as a, useGovMyDataChangeProposals as o, useGovReviewDataChangeProposal as s, useGovSubmitDataChangeProposal as c, useGovWithdrawDataChangeProposal as l } from "../../hooks/useIntelligenceApi.js";
|
|
6
|
+
import { useCursorPager as u } from "../../hooks/useCursorPager.js";
|
|
7
|
+
import { useFileUrl as d } from "../../hooks/useFiles.js";
|
|
8
|
+
import "../../hooks/index.js";
|
|
9
|
+
import { ErrorView as f } from "../../components/StateViews.js";
|
|
10
|
+
import { FilterTabs as p } from "../../components/FilterTabs.js";
|
|
11
|
+
import { SectionCard as m } from "../../components/SectionCard.js";
|
|
12
|
+
import { Pagination as h } from "../../components/Pagination.js";
|
|
13
|
+
import { describeError as g, notify as _ } from "../../lib/toast.js";
|
|
14
|
+
import { JurisdictionLayout as v } from "./JurisdictionLayout.js";
|
|
15
|
+
import { ConfirmDialog as y } from "../../components/ConfirmDialog.js";
|
|
16
|
+
import { DocumentUploadField as b } from "../../components/DocumentUploadField.js";
|
|
17
|
+
import { Fragment as x, useState as S } from "react";
|
|
18
|
+
import { AlertTriangle as C, Check as w, ChevronDown as T, ChevronRight as E, ExternalLink as D, FileText as O, Info as k, Paperclip as A, Pencil as j, Send as M, ShieldCheck as N, Undo2 as P, X as F } from "lucide-react";
|
|
19
|
+
import { useParams as I } from "react-router-dom";
|
|
20
|
+
import { Fragment as L, jsx as R, jsxs as z } from "react/jsx-runtime";
|
|
21
|
+
import { Button as B, Input as V, Label as H, Select as ee, SelectContent as te, SelectItem as ne, SelectTrigger as re, SelectValue as ie, Skeleton as U, Textarea as W } from "@burdenoff/fe-libs/ui";
|
|
22
|
+
//#region src/govcitizenhub/pages/intelligence/CorrectionsPage.tsx
|
|
23
|
+
var G = 20, ae = "/GovCitizenHub/Corrections", oe = [
|
|
24
|
+
"JURISDICTION",
|
|
25
|
+
"OFFICIAL",
|
|
26
|
+
"OFFICIAL_COMMITMENT",
|
|
27
|
+
"BUDGET",
|
|
28
|
+
"BUDGET_LINE",
|
|
29
|
+
"PROJECT",
|
|
30
|
+
"PROJECT_MILESTONE",
|
|
31
|
+
"INDICATOR_VALUE",
|
|
32
|
+
"PUBLIC_ASSET",
|
|
33
|
+
"ELECTION",
|
|
34
|
+
"ELECTION_RESULT",
|
|
35
|
+
"DATASET",
|
|
36
|
+
"EVENT"
|
|
37
|
+
], K = {
|
|
38
|
+
JURISDICTION: "Jurisdiction profile",
|
|
39
|
+
OFFICIAL: "Office holder",
|
|
40
|
+
OFFICIAL_COMMITMENT: "Commitment",
|
|
41
|
+
BUDGET: "Budget",
|
|
42
|
+
BUDGET_LINE: "Budget line",
|
|
43
|
+
PROJECT: "Project",
|
|
44
|
+
PROJECT_MILESTONE: "Project milestone",
|
|
45
|
+
INDICATOR_VALUE: "Indicator value",
|
|
46
|
+
PUBLIC_ASSET: "Public asset",
|
|
47
|
+
ELECTION: "Election",
|
|
48
|
+
ELECTION_RESULT: "Election result",
|
|
49
|
+
DATASET: "Dataset",
|
|
50
|
+
EVENT: "Timeline event"
|
|
51
|
+
}, q = "ALL", J = [
|
|
52
|
+
{
|
|
53
|
+
value: "SUBMITTED",
|
|
54
|
+
label: "Submitted"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
value: "UNDER_REVIEW",
|
|
58
|
+
label: "Under review"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
value: "ACCEPTED",
|
|
62
|
+
label: "Accepted"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
value: "REJECTED",
|
|
66
|
+
label: "Rejected"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
value: "WITHDRAWN",
|
|
70
|
+
label: "Withdrawn"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
value: q,
|
|
74
|
+
label: "All"
|
|
75
|
+
}
|
|
76
|
+
], se = ["SUBMITTED", "UNDER_REVIEW"];
|
|
77
|
+
function Y() {
|
|
78
|
+
let { jurisdictionId: e } = I();
|
|
79
|
+
return /* @__PURE__ */ R(v, { children: /* @__PURE__ */ z("div", {
|
|
80
|
+
className: "grid gap-4 xl:grid-cols-3",
|
|
81
|
+
children: [/* @__PURE__ */ R("div", {
|
|
82
|
+
className: "min-w-0 xl:col-span-1",
|
|
83
|
+
children: /* @__PURE__ */ R(X, { jurisdictionId: e })
|
|
84
|
+
}), /* @__PURE__ */ R("div", {
|
|
85
|
+
className: "min-w-0 xl:col-span-2",
|
|
86
|
+
children: /* @__PURE__ */ R(Q, { jurisdictionId: e })
|
|
87
|
+
})]
|
|
88
|
+
}) });
|
|
89
|
+
}
|
|
90
|
+
var X = ({ jurisdictionId: e }) => {
|
|
91
|
+
let t = c(), i = l(), a = o({ limit: G }), [s, u] = S("JURISDICTION"), [d, p] = S(""), [h, v] = S(""), [x, C] = S(""), [w, T] = S(""), [E, D] = S(""), [N, I] = S([]), [L, q] = S(null), [J, Y] = S(null), X = !!e && !!d.trim() && !!h.trim() && !!x.trim() && !!w.trim(), Z = async () => {
|
|
92
|
+
if (!(!e || !X)) {
|
|
93
|
+
q(null);
|
|
94
|
+
try {
|
|
95
|
+
await t.mutateAsync({
|
|
96
|
+
jurisdictionId: e,
|
|
97
|
+
entityType: s,
|
|
98
|
+
entityId: d.trim(),
|
|
99
|
+
fieldPath: h.trim(),
|
|
100
|
+
proposedValue: x.trim(),
|
|
101
|
+
rationale: w.trim(),
|
|
102
|
+
evidenceUrl: E.trim() || null,
|
|
103
|
+
evidenceFileIds: N.map((e) => e.id)
|
|
104
|
+
}), _.success("Correction submitted", "An official will review it and record a decision."), p(""), v(""), C(""), T(""), D(""), I([]);
|
|
105
|
+
} catch (e) {
|
|
106
|
+
q(g(e));
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}, Q = async () => {
|
|
110
|
+
if (J) try {
|
|
111
|
+
await i.mutateAsync(J.id), _.success("Correction withdrawn"), Y(null);
|
|
112
|
+
} catch (e) {
|
|
113
|
+
_.error("Could not withdraw the correction", g(e));
|
|
114
|
+
}
|
|
115
|
+
}, $ = a.data?.items ?? [];
|
|
116
|
+
return /* @__PURE__ */ z("div", {
|
|
117
|
+
className: "space-y-4",
|
|
118
|
+
children: [
|
|
119
|
+
/* @__PURE__ */ z(m, {
|
|
120
|
+
title: "Suggest a correction",
|
|
121
|
+
icon: /* @__PURE__ */ R(j, {}),
|
|
122
|
+
className: "border-border-seam",
|
|
123
|
+
children: [/* @__PURE__ */ z("div", {
|
|
124
|
+
className: "mb-4 flex items-start gap-2.5 rounded-lg bg-bg-sunken px-3 py-2.5",
|
|
125
|
+
children: [/* @__PURE__ */ R(k, {
|
|
126
|
+
className: "mt-0.5 size-4 shrink-0 text-text-muted",
|
|
127
|
+
"aria-hidden": "true"
|
|
128
|
+
}), /* @__PURE__ */ R("p", {
|
|
129
|
+
className: "text-xs text-text-secondary",
|
|
130
|
+
children: "Point at the exact record and field that is wrong, say what it should be, and show your evidence. A reviewer records a decision on your proposal — the published figure itself is only changed by an official through that record’s own edit form."
|
|
131
|
+
})]
|
|
132
|
+
}), /* @__PURE__ */ z("div", {
|
|
133
|
+
className: "grid gap-3",
|
|
134
|
+
children: [
|
|
135
|
+
/* @__PURE__ */ z("div", {
|
|
136
|
+
className: "grid gap-1.5",
|
|
137
|
+
children: [/* @__PURE__ */ R(H, {
|
|
138
|
+
htmlFor: "correction-entity-type",
|
|
139
|
+
children: "What kind of record?"
|
|
140
|
+
}), /* @__PURE__ */ z(ee, {
|
|
141
|
+
value: s,
|
|
142
|
+
onValueChange: (e) => u(e),
|
|
143
|
+
children: [/* @__PURE__ */ R(re, {
|
|
144
|
+
id: "correction-entity-type",
|
|
145
|
+
children: /* @__PURE__ */ R(ie, {})
|
|
146
|
+
}), /* @__PURE__ */ R(te, { children: oe.map((e) => /* @__PURE__ */ R(ne, {
|
|
147
|
+
value: e,
|
|
148
|
+
children: K[e]
|
|
149
|
+
}, e)) })]
|
|
150
|
+
})]
|
|
151
|
+
}),
|
|
152
|
+
/* @__PURE__ */ z("div", {
|
|
153
|
+
className: "grid gap-1.5",
|
|
154
|
+
children: [/* @__PURE__ */ R(H, {
|
|
155
|
+
htmlFor: "correction-entity-id",
|
|
156
|
+
children: "Record id"
|
|
157
|
+
}), /* @__PURE__ */ R(V, {
|
|
158
|
+
id: "correction-entity-id",
|
|
159
|
+
value: d,
|
|
160
|
+
onChange: (e) => p(e.target.value),
|
|
161
|
+
placeholder: "Copy it from the record you are correcting"
|
|
162
|
+
})]
|
|
163
|
+
}),
|
|
164
|
+
/* @__PURE__ */ z("div", {
|
|
165
|
+
className: "grid gap-1.5",
|
|
166
|
+
children: [/* @__PURE__ */ R(H, {
|
|
167
|
+
htmlFor: "correction-field-path",
|
|
168
|
+
children: "Field"
|
|
169
|
+
}), /* @__PURE__ */ R(V, {
|
|
170
|
+
id: "correction-field-path",
|
|
171
|
+
value: h,
|
|
172
|
+
onChange: (e) => v(e.target.value),
|
|
173
|
+
placeholder: "e.g. population, contactPhone, budgetAmount"
|
|
174
|
+
})]
|
|
175
|
+
}),
|
|
176
|
+
/* @__PURE__ */ z("div", {
|
|
177
|
+
className: "grid gap-1.5",
|
|
178
|
+
children: [/* @__PURE__ */ R(H, {
|
|
179
|
+
htmlFor: "correction-proposed",
|
|
180
|
+
children: "Proposed value"
|
|
181
|
+
}), /* @__PURE__ */ R(W, {
|
|
182
|
+
id: "correction-proposed",
|
|
183
|
+
value: x,
|
|
184
|
+
onChange: (e) => C(e.target.value),
|
|
185
|
+
rows: 2,
|
|
186
|
+
placeholder: "What the field should say"
|
|
187
|
+
})]
|
|
188
|
+
}),
|
|
189
|
+
/* @__PURE__ */ z("div", {
|
|
190
|
+
className: "grid gap-1.5",
|
|
191
|
+
children: [/* @__PURE__ */ R(H, {
|
|
192
|
+
htmlFor: "correction-rationale",
|
|
193
|
+
children: "Why is the current value wrong?"
|
|
194
|
+
}), /* @__PURE__ */ R(W, {
|
|
195
|
+
id: "correction-rationale",
|
|
196
|
+
value: w,
|
|
197
|
+
onChange: (e) => T(e.target.value),
|
|
198
|
+
rows: 4,
|
|
199
|
+
placeholder: "Explain the discrepancy and where your figure comes from"
|
|
200
|
+
})]
|
|
201
|
+
}),
|
|
202
|
+
/* @__PURE__ */ z("div", {
|
|
203
|
+
className: "grid gap-1.5",
|
|
204
|
+
children: [/* @__PURE__ */ R(H, {
|
|
205
|
+
htmlFor: "correction-evidence-url",
|
|
206
|
+
children: "Evidence URL (optional)"
|
|
207
|
+
}), /* @__PURE__ */ R(V, {
|
|
208
|
+
id: "correction-evidence-url",
|
|
209
|
+
value: E,
|
|
210
|
+
onChange: (e) => D(e.target.value),
|
|
211
|
+
placeholder: "https://… a gazette notice, report or official page"
|
|
212
|
+
})]
|
|
213
|
+
}),
|
|
214
|
+
/* @__PURE__ */ z("div", {
|
|
215
|
+
className: "grid gap-2",
|
|
216
|
+
children: [
|
|
217
|
+
/* @__PURE__ */ R(H, { children: "Evidence files (optional)" }),
|
|
218
|
+
N.length > 0 && /* @__PURE__ */ R("ul", {
|
|
219
|
+
className: "space-y-1.5",
|
|
220
|
+
children: N.map((e) => /* @__PURE__ */ z("li", {
|
|
221
|
+
className: "flex items-center justify-between gap-2 rounded-lg border border-border-seam bg-bg-surface px-3 py-2",
|
|
222
|
+
children: [/* @__PURE__ */ z("span", {
|
|
223
|
+
className: "flex min-w-0 items-center gap-2",
|
|
224
|
+
children: [/* @__PURE__ */ R(A, {
|
|
225
|
+
className: "size-3.5 shrink-0 text-text-muted",
|
|
226
|
+
"aria-hidden": "true"
|
|
227
|
+
}), /* @__PURE__ */ R("span", {
|
|
228
|
+
className: "truncate text-sm text-text-primary",
|
|
229
|
+
children: e.name
|
|
230
|
+
})]
|
|
231
|
+
}), /* @__PURE__ */ R("button", {
|
|
232
|
+
type: "button",
|
|
233
|
+
"aria-label": `Remove ${e.name}`,
|
|
234
|
+
onClick: () => I((t) => t.filter((t) => t.id !== e.id)),
|
|
235
|
+
className: "text-text-muted transition-colors hover:text-text-primary",
|
|
236
|
+
children: /* @__PURE__ */ R(F, {
|
|
237
|
+
className: "size-4",
|
|
238
|
+
"aria-hidden": "true"
|
|
239
|
+
})
|
|
240
|
+
})]
|
|
241
|
+
}, e.id))
|
|
242
|
+
}),
|
|
243
|
+
/* @__PURE__ */ R(b, {
|
|
244
|
+
folder: ae,
|
|
245
|
+
hint: "Attach a scan, notice or screenshot that backs up your correction",
|
|
246
|
+
onUploaded: (e) => I((t) => [...t, {
|
|
247
|
+
id: e.id,
|
|
248
|
+
name: e.name
|
|
249
|
+
}])
|
|
250
|
+
})
|
|
251
|
+
]
|
|
252
|
+
}),
|
|
253
|
+
L && /* @__PURE__ */ R("p", {
|
|
254
|
+
className: "rounded-lg bg-status-error-bg-subtle px-3 py-2 text-sm text-status-error-text",
|
|
255
|
+
children: L
|
|
256
|
+
}),
|
|
257
|
+
/* @__PURE__ */ z(B, {
|
|
258
|
+
onClick: () => {
|
|
259
|
+
Z();
|
|
260
|
+
},
|
|
261
|
+
disabled: !X || t.isPending,
|
|
262
|
+
children: [/* @__PURE__ */ R(M, {
|
|
263
|
+
className: "mr-1.5 h-4 w-4",
|
|
264
|
+
"aria-hidden": "true"
|
|
265
|
+
}), t.isPending ? "Submitting…" : "Submit correction"]
|
|
266
|
+
})
|
|
267
|
+
]
|
|
268
|
+
})]
|
|
269
|
+
}),
|
|
270
|
+
/* @__PURE__ */ z(m, {
|
|
271
|
+
title: "Your corrections",
|
|
272
|
+
icon: /* @__PURE__ */ R(O, {}),
|
|
273
|
+
className: "border-border-seam",
|
|
274
|
+
actions: a.isFetching ? /* @__PURE__ */ R("span", {
|
|
275
|
+
className: "text-xs text-text-muted",
|
|
276
|
+
children: "Refreshing…"
|
|
277
|
+
}) : null,
|
|
278
|
+
children: [/* @__PURE__ */ R("p", {
|
|
279
|
+
className: "mb-3 text-xs text-text-muted",
|
|
280
|
+
children: "Everything you have submitted in this workspace, newest first."
|
|
281
|
+
}), a.isLoading ? /* @__PURE__ */ R("div", {
|
|
282
|
+
className: "space-y-2",
|
|
283
|
+
children: Array.from({ length: 3 }, (e, t) => /* @__PURE__ */ R(U, { className: "h-16 w-full rounded-lg" }, t))
|
|
284
|
+
}) : a.isError ? /* @__PURE__ */ R(f, {
|
|
285
|
+
message: "We couldn't load your corrections.",
|
|
286
|
+
onRetry: () => {
|
|
287
|
+
a.refetch();
|
|
288
|
+
}
|
|
289
|
+
}) : $.length === 0 ? /* @__PURE__ */ R("p", {
|
|
290
|
+
className: "text-sm text-text-secondary",
|
|
291
|
+
children: "You have not submitted a correction yet. Use the form above when you spot a figure that does not match the official record."
|
|
292
|
+
}) : /* @__PURE__ */ R("ul", {
|
|
293
|
+
className: "space-y-2",
|
|
294
|
+
children: $.map((t) => /* @__PURE__ */ z("li", {
|
|
295
|
+
className: "rounded-lg border border-border-seam bg-bg-surface px-3 py-2.5",
|
|
296
|
+
children: [
|
|
297
|
+
/* @__PURE__ */ z("div", {
|
|
298
|
+
className: "flex flex-wrap items-start justify-between gap-2",
|
|
299
|
+
children: [/* @__PURE__ */ z("div", {
|
|
300
|
+
className: "min-w-0",
|
|
301
|
+
children: [/* @__PURE__ */ z("p", {
|
|
302
|
+
className: "truncate text-sm font-medium text-text-primary",
|
|
303
|
+
children: [
|
|
304
|
+
K[t.entityType],
|
|
305
|
+
" · ",
|
|
306
|
+
t.fieldPath
|
|
307
|
+
]
|
|
308
|
+
}), /* @__PURE__ */ z("p", {
|
|
309
|
+
className: "mt-0.5 truncate text-xs text-text-muted",
|
|
310
|
+
children: ["Proposed: ", t.proposedValue]
|
|
311
|
+
})]
|
|
312
|
+
}), /* @__PURE__ */ R(r, { status: t.status })]
|
|
313
|
+
}),
|
|
314
|
+
/* @__PURE__ */ z("div", {
|
|
315
|
+
className: "mt-2 flex flex-wrap items-center justify-between gap-2",
|
|
316
|
+
children: [/* @__PURE__ */ z("span", {
|
|
317
|
+
className: "text-xs text-text-muted",
|
|
318
|
+
children: [
|
|
319
|
+
"Submitted ",
|
|
320
|
+
n(t.submittedAt),
|
|
321
|
+
!!e && t.jurisdictionId !== e && /* @__PURE__ */ R("span", {
|
|
322
|
+
className: "ml-1.5 rounded-full bg-bg-sunken px-2 py-0.5",
|
|
323
|
+
children: "Another region"
|
|
324
|
+
})
|
|
325
|
+
]
|
|
326
|
+
}), se.includes(t.status) && /* @__PURE__ */ z(B, {
|
|
327
|
+
variant: "outline",
|
|
328
|
+
size: "sm",
|
|
329
|
+
onClick: () => Y(t),
|
|
330
|
+
disabled: i.isPending,
|
|
331
|
+
children: [/* @__PURE__ */ R(P, {
|
|
332
|
+
className: "mr-1.5 h-3.5 w-3.5",
|
|
333
|
+
"aria-hidden": "true"
|
|
334
|
+
}), " Withdraw"]
|
|
335
|
+
})]
|
|
336
|
+
}),
|
|
337
|
+
t.reviewNote && /* @__PURE__ */ z("p", {
|
|
338
|
+
className: "mt-2 rounded-md bg-bg-sunken px-2.5 py-1.5 text-xs text-text-secondary",
|
|
339
|
+
children: [/* @__PURE__ */ R("span", {
|
|
340
|
+
className: "font-medium text-text-primary",
|
|
341
|
+
children: "Reviewer note: "
|
|
342
|
+
}), t.reviewNote]
|
|
343
|
+
})
|
|
344
|
+
]
|
|
345
|
+
}, t.id))
|
|
346
|
+
})]
|
|
347
|
+
}),
|
|
348
|
+
J && /* @__PURE__ */ R(y, {
|
|
349
|
+
open: !0,
|
|
350
|
+
onOpenChange: (e) => {
|
|
351
|
+
e || Y(null);
|
|
352
|
+
},
|
|
353
|
+
title: "Withdraw this correction?",
|
|
354
|
+
description: "It leaves the review queue. You can submit a fresh correction at any time.",
|
|
355
|
+
confirmLabel: "Withdraw",
|
|
356
|
+
destructive: !0,
|
|
357
|
+
onConfirm: Q
|
|
358
|
+
})
|
|
359
|
+
]
|
|
360
|
+
});
|
|
361
|
+
}, Z = {
|
|
362
|
+
ACCEPTED: {
|
|
363
|
+
title: "Accept this correction?",
|
|
364
|
+
description: "This RECORDS your decision on the proposal. It does not change the published figure — apply the corrected value through that record’s own edit form so the change stays attributable and appears in its history.",
|
|
365
|
+
label: "Record acceptance"
|
|
366
|
+
},
|
|
367
|
+
REJECTED: {
|
|
368
|
+
title: "Reject this correction?",
|
|
369
|
+
description: "The submitter sees your note, so explain what the evidence did not establish.",
|
|
370
|
+
label: "Record rejection"
|
|
371
|
+
},
|
|
372
|
+
UNDER_REVIEW: {
|
|
373
|
+
title: "Mark as under review?",
|
|
374
|
+
description: "Signals to the submitter that someone has picked this up. It stays withdrawable while under review.",
|
|
375
|
+
label: "Mark under review"
|
|
376
|
+
}
|
|
377
|
+
}, Q = ({ jurisdictionId: o }) => {
|
|
378
|
+
let c = u(), [l, d] = S("SUBMITTED"), [v, b] = S(null), [D, O] = S(null), { data: k, isLoading: A, isError: j, refetch: M } = a({
|
|
379
|
+
jurisdictionId: o,
|
|
380
|
+
status: l === q ? void 0 : l
|
|
381
|
+
}, {
|
|
382
|
+
limit: G,
|
|
383
|
+
cursor: c.cursor
|
|
384
|
+
}), P = s(), I = k?.items ?? [];
|
|
385
|
+
return /* @__PURE__ */ z(m, {
|
|
386
|
+
title: "Review queue",
|
|
387
|
+
icon: /* @__PURE__ */ R(N, {}),
|
|
388
|
+
className: "border-border-seam",
|
|
389
|
+
flush: !0,
|
|
390
|
+
children: [
|
|
391
|
+
/* @__PURE__ */ z("div", {
|
|
392
|
+
className: "border-b border-border-seam px-5 py-4",
|
|
393
|
+
children: [/* @__PURE__ */ z("div", {
|
|
394
|
+
className: "mb-3 flex items-start gap-2.5 rounded-lg bg-status-warning-bg-subtle px-3 py-2.5",
|
|
395
|
+
children: [/* @__PURE__ */ R(C, {
|
|
396
|
+
className: "mt-0.5 size-4 shrink-0 text-status-warning-text",
|
|
397
|
+
"aria-hidden": "true"
|
|
398
|
+
}), /* @__PURE__ */ z("p", {
|
|
399
|
+
className: "text-xs text-status-warning-text",
|
|
400
|
+
children: [
|
|
401
|
+
"Accepting a correction ",
|
|
402
|
+
/* @__PURE__ */ R("span", {
|
|
403
|
+
className: "font-semibold",
|
|
404
|
+
children: "records the decision only"
|
|
405
|
+
}),
|
|
406
|
+
". The published value is not touched — an official must apply it through the record’s own edit form so the change is attributable and shows up in that record’s history."
|
|
407
|
+
]
|
|
408
|
+
})]
|
|
409
|
+
}), /* @__PURE__ */ R("div", {
|
|
410
|
+
className: "overflow-x-auto pb-1",
|
|
411
|
+
children: /* @__PURE__ */ R(p, {
|
|
412
|
+
options: J,
|
|
413
|
+
value: l,
|
|
414
|
+
onChange: (e) => {
|
|
415
|
+
d(e), b(null), c.reset();
|
|
416
|
+
}
|
|
417
|
+
})
|
|
418
|
+
})]
|
|
419
|
+
}),
|
|
420
|
+
A ? /* @__PURE__ */ R("div", {
|
|
421
|
+
className: "space-y-2 p-5",
|
|
422
|
+
children: Array.from({ length: 5 }, (e, t) => /* @__PURE__ */ R(U, { className: "h-12 w-full rounded-lg" }, t))
|
|
423
|
+
}) : j ? /* @__PURE__ */ R("div", {
|
|
424
|
+
className: "p-5",
|
|
425
|
+
children: /* @__PURE__ */ R(f, {
|
|
426
|
+
message: "We couldn't load the review queue.",
|
|
427
|
+
onRetry: () => {
|
|
428
|
+
M();
|
|
429
|
+
}
|
|
430
|
+
})
|
|
431
|
+
}) : I.length === 0 && c.page === 0 ? /* @__PURE__ */ R("div", {
|
|
432
|
+
className: "p-5",
|
|
433
|
+
children: /* @__PURE__ */ R(i, {
|
|
434
|
+
illustration: "empty-data",
|
|
435
|
+
title: l === q ? "No corrections yet" : "Nothing in this state",
|
|
436
|
+
description: l === q ? "When residents or researchers propose a correction for this region it lands here." : "Switch state to see corrections at another point in the review workflow."
|
|
437
|
+
})
|
|
438
|
+
}) : /* @__PURE__ */ z(L, { children: [/* @__PURE__ */ R("div", {
|
|
439
|
+
className: "overflow-x-auto",
|
|
440
|
+
children: /* @__PURE__ */ z("table", {
|
|
441
|
+
className: "w-full text-left text-sm",
|
|
442
|
+
children: [/* @__PURE__ */ R("thead", { children: /* @__PURE__ */ z("tr", {
|
|
443
|
+
className: "border-b border-border-seam text-xs uppercase tracking-wide text-text-muted",
|
|
444
|
+
children: [
|
|
445
|
+
/* @__PURE__ */ R("th", {
|
|
446
|
+
className: "w-10 px-3 py-3",
|
|
447
|
+
"aria-label": "Expand"
|
|
448
|
+
}),
|
|
449
|
+
/* @__PURE__ */ R("th", {
|
|
450
|
+
className: "px-4 py-3 font-medium",
|
|
451
|
+
children: "Record"
|
|
452
|
+
}),
|
|
453
|
+
/* @__PURE__ */ R("th", {
|
|
454
|
+
className: "px-4 py-3 font-medium",
|
|
455
|
+
children: "Field"
|
|
456
|
+
}),
|
|
457
|
+
/* @__PURE__ */ R("th", {
|
|
458
|
+
className: "px-4 py-3 font-medium",
|
|
459
|
+
children: "Current"
|
|
460
|
+
}),
|
|
461
|
+
/* @__PURE__ */ R("th", {
|
|
462
|
+
className: "px-4 py-3 font-medium",
|
|
463
|
+
children: "Proposed"
|
|
464
|
+
}),
|
|
465
|
+
/* @__PURE__ */ R("th", {
|
|
466
|
+
className: "px-4 py-3 font-medium",
|
|
467
|
+
children: "Submitted"
|
|
468
|
+
}),
|
|
469
|
+
/* @__PURE__ */ R("th", {
|
|
470
|
+
className: "px-4 py-3 font-medium",
|
|
471
|
+
children: "Status"
|
|
472
|
+
}),
|
|
473
|
+
/* @__PURE__ */ R("th", {
|
|
474
|
+
className: "px-4 py-3 text-right font-medium",
|
|
475
|
+
children: "Decision"
|
|
476
|
+
})
|
|
477
|
+
]
|
|
478
|
+
}) }), /* @__PURE__ */ R("tbody", {
|
|
479
|
+
className: "divide-y divide-border-subtle",
|
|
480
|
+
children: I.map((i) => {
|
|
481
|
+
let a = v === i.id, o = i.status === "SUBMITTED" || i.status === "UNDER_REVIEW";
|
|
482
|
+
return /* @__PURE__ */ z(x, { children: [/* @__PURE__ */ z("tr", {
|
|
483
|
+
className: e("transition-colors", a && "bg-bg-sunken"),
|
|
484
|
+
children: [
|
|
485
|
+
/* @__PURE__ */ R("td", {
|
|
486
|
+
className: "px-3 py-3 align-top",
|
|
487
|
+
children: /* @__PURE__ */ R("button", {
|
|
488
|
+
type: "button",
|
|
489
|
+
"aria-expanded": a,
|
|
490
|
+
"aria-label": a ? "Collapse details" : "Expand details",
|
|
491
|
+
onClick: () => b(a ? null : i.id),
|
|
492
|
+
className: "inline-flex size-7 items-center justify-center rounded-lg text-text-muted transition-colors hover:bg-bg-sunken hover:text-text-primary",
|
|
493
|
+
children: R(a ? T : E, {
|
|
494
|
+
className: "size-4",
|
|
495
|
+
"aria-hidden": "true"
|
|
496
|
+
})
|
|
497
|
+
})
|
|
498
|
+
}),
|
|
499
|
+
/* @__PURE__ */ z("td", {
|
|
500
|
+
className: "px-4 py-3 align-top",
|
|
501
|
+
children: [/* @__PURE__ */ R("p", {
|
|
502
|
+
className: "whitespace-nowrap font-medium text-text-primary",
|
|
503
|
+
children: K[i.entityType]
|
|
504
|
+
}), /* @__PURE__ */ R("p", {
|
|
505
|
+
className: "font-mono text-xs text-text-muted",
|
|
506
|
+
children: i.entityId
|
|
507
|
+
})]
|
|
508
|
+
}),
|
|
509
|
+
/* @__PURE__ */ R("td", {
|
|
510
|
+
className: "whitespace-nowrap px-4 py-3 align-top font-mono text-xs text-text-secondary",
|
|
511
|
+
children: i.fieldPath
|
|
512
|
+
}),
|
|
513
|
+
/* @__PURE__ */ R("td", {
|
|
514
|
+
className: "max-w-[14rem] break-words px-4 py-3 align-top text-text-secondary",
|
|
515
|
+
children: i.currentValue ?? /* @__PURE__ */ R("span", {
|
|
516
|
+
className: "text-text-muted",
|
|
517
|
+
children: "Not recorded"
|
|
518
|
+
})
|
|
519
|
+
}),
|
|
520
|
+
/* @__PURE__ */ R("td", {
|
|
521
|
+
className: "max-w-[14rem] break-words px-4 py-3 align-top font-medium text-text-primary",
|
|
522
|
+
children: i.proposedValue
|
|
523
|
+
}),
|
|
524
|
+
/* @__PURE__ */ R("td", {
|
|
525
|
+
className: "whitespace-nowrap px-4 py-3 align-top text-text-secondary",
|
|
526
|
+
children: t(i.submittedAt)
|
|
527
|
+
}),
|
|
528
|
+
/* @__PURE__ */ R("td", {
|
|
529
|
+
className: "px-4 py-3 align-top",
|
|
530
|
+
children: /* @__PURE__ */ R(r, { status: i.status })
|
|
531
|
+
}),
|
|
532
|
+
/* @__PURE__ */ R("td", {
|
|
533
|
+
className: "px-4 py-3 align-top",
|
|
534
|
+
children: /* @__PURE__ */ R("div", {
|
|
535
|
+
className: "flex flex-wrap justify-end gap-1.5",
|
|
536
|
+
children: o ? /* @__PURE__ */ z(L, { children: [
|
|
537
|
+
i.status === "SUBMITTED" && /* @__PURE__ */ R(B, {
|
|
538
|
+
variant: "outline",
|
|
539
|
+
size: "sm",
|
|
540
|
+
onClick: () => O({
|
|
541
|
+
proposal: i,
|
|
542
|
+
decision: "UNDER_REVIEW"
|
|
543
|
+
}),
|
|
544
|
+
disabled: P.isPending,
|
|
545
|
+
children: "Review"
|
|
546
|
+
}),
|
|
547
|
+
/* @__PURE__ */ R(B, {
|
|
548
|
+
variant: "outline",
|
|
549
|
+
size: "sm",
|
|
550
|
+
"aria-label": "Accept correction",
|
|
551
|
+
onClick: () => O({
|
|
552
|
+
proposal: i,
|
|
553
|
+
decision: "ACCEPTED"
|
|
554
|
+
}),
|
|
555
|
+
disabled: P.isPending,
|
|
556
|
+
children: /* @__PURE__ */ R(w, {
|
|
557
|
+
className: "h-4 w-4",
|
|
558
|
+
"aria-hidden": "true"
|
|
559
|
+
})
|
|
560
|
+
}),
|
|
561
|
+
/* @__PURE__ */ R(B, {
|
|
562
|
+
variant: "outline",
|
|
563
|
+
size: "sm",
|
|
564
|
+
"aria-label": "Reject correction",
|
|
565
|
+
onClick: () => O({
|
|
566
|
+
proposal: i,
|
|
567
|
+
decision: "REJECTED"
|
|
568
|
+
}),
|
|
569
|
+
disabled: P.isPending,
|
|
570
|
+
children: /* @__PURE__ */ R(F, {
|
|
571
|
+
className: "h-4 w-4",
|
|
572
|
+
"aria-hidden": "true"
|
|
573
|
+
})
|
|
574
|
+
})
|
|
575
|
+
] }) : /* @__PURE__ */ R("span", {
|
|
576
|
+
className: "whitespace-nowrap text-xs text-text-muted",
|
|
577
|
+
children: i.reviewedAt ? `Decided ${n(i.reviewedAt)}` : "—"
|
|
578
|
+
})
|
|
579
|
+
})
|
|
580
|
+
})
|
|
581
|
+
]
|
|
582
|
+
}), a && /* @__PURE__ */ R("tr", {
|
|
583
|
+
className: "bg-bg-sunken",
|
|
584
|
+
children: /* @__PURE__ */ R("td", {
|
|
585
|
+
colSpan: 8,
|
|
586
|
+
className: "px-4 py-4",
|
|
587
|
+
children: /* @__PURE__ */ R($, { proposal: i })
|
|
588
|
+
})
|
|
589
|
+
})] }, i.id);
|
|
590
|
+
})
|
|
591
|
+
})]
|
|
592
|
+
})
|
|
593
|
+
}), /* @__PURE__ */ R("div", {
|
|
594
|
+
className: "px-5 pb-4",
|
|
595
|
+
children: /* @__PURE__ */ R(h, {
|
|
596
|
+
page: c.page,
|
|
597
|
+
pageSize: G,
|
|
598
|
+
itemCount: I.length,
|
|
599
|
+
hasMore: k?.pageInfo.hasMore ?? !1,
|
|
600
|
+
onPageChange: (e) => {
|
|
601
|
+
c.onPageChange(e, k?.pageInfo.cursor), b(null);
|
|
602
|
+
}
|
|
603
|
+
})
|
|
604
|
+
})] }),
|
|
605
|
+
D && /* @__PURE__ */ R(y, {
|
|
606
|
+
open: !0,
|
|
607
|
+
onOpenChange: (e) => {
|
|
608
|
+
e || O(null);
|
|
609
|
+
},
|
|
610
|
+
title: Z[D.decision].title,
|
|
611
|
+
description: Z[D.decision].description,
|
|
612
|
+
confirmLabel: Z[D.decision].label,
|
|
613
|
+
destructive: D.decision === "REJECTED",
|
|
614
|
+
reason: {
|
|
615
|
+
label: "Review note",
|
|
616
|
+
placeholder: D.decision === "REJECTED" ? "Explain what the evidence did not establish…" : "Optional note recorded against the proposal…",
|
|
617
|
+
required: D.decision === "REJECTED"
|
|
618
|
+
},
|
|
619
|
+
onConfirm: async (e) => {
|
|
620
|
+
if (D) try {
|
|
621
|
+
await P.mutateAsync({
|
|
622
|
+
id: D.proposal.id,
|
|
623
|
+
decision: D.decision,
|
|
624
|
+
reviewNote: e.trim() || null
|
|
625
|
+
}), _.success(D.decision === "ACCEPTED" ? "Acceptance recorded" : D.decision === "REJECTED" ? "Rejection recorded" : "Marked as under review", D.decision === "ACCEPTED" ? "Now apply the value through the record’s own edit form." : void 0), O(null);
|
|
626
|
+
} catch (e) {
|
|
627
|
+
_.error("Could not record the decision", g(e));
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
})
|
|
631
|
+
]
|
|
632
|
+
});
|
|
633
|
+
}, $ = ({ proposal: e }) => /* @__PURE__ */ z("div", {
|
|
634
|
+
className: "grid gap-4 md:grid-cols-2",
|
|
635
|
+
children: [/* @__PURE__ */ z("div", { children: [/* @__PURE__ */ R("p", {
|
|
636
|
+
className: "mb-1 text-xs font-medium uppercase tracking-wide text-text-muted",
|
|
637
|
+
children: "Rationale"
|
|
638
|
+
}), /* @__PURE__ */ R("p", {
|
|
639
|
+
className: "whitespace-pre-wrap text-sm text-text-primary",
|
|
640
|
+
children: e.rationale
|
|
641
|
+
})] }), /* @__PURE__ */ z("div", {
|
|
642
|
+
className: "space-y-3",
|
|
643
|
+
children: [/* @__PURE__ */ z("div", { children: [
|
|
644
|
+
/* @__PURE__ */ R("p", {
|
|
645
|
+
className: "mb-1 text-xs font-medium uppercase tracking-wide text-text-muted",
|
|
646
|
+
children: "Evidence"
|
|
647
|
+
}),
|
|
648
|
+
e.evidenceUrl ? /* @__PURE__ */ z("a", {
|
|
649
|
+
href: e.evidenceUrl,
|
|
650
|
+
target: "_blank",
|
|
651
|
+
rel: "noopener noreferrer",
|
|
652
|
+
className: "inline-flex items-center gap-1.5 break-all text-sm text-action-primary-text hover:underline",
|
|
653
|
+
children: [/* @__PURE__ */ R(D, {
|
|
654
|
+
className: "size-3.5 shrink-0",
|
|
655
|
+
"aria-hidden": "true"
|
|
656
|
+
}), e.evidenceUrl]
|
|
657
|
+
}) : /* @__PURE__ */ R("p", {
|
|
658
|
+
className: "text-sm text-text-muted",
|
|
659
|
+
children: "No evidence link supplied."
|
|
660
|
+
}),
|
|
661
|
+
e.evidenceFileIds.length > 0 && /* @__PURE__ */ R("ul", {
|
|
662
|
+
className: "mt-2 space-y-1.5",
|
|
663
|
+
children: e.evidenceFileIds.map((e) => /* @__PURE__ */ R("li", { children: /* @__PURE__ */ R(ce, { fileId: e }) }, e))
|
|
664
|
+
})
|
|
665
|
+
] }), (e.reviewNote || e.reviewedAt) && /* @__PURE__ */ z("div", { children: [
|
|
666
|
+
/* @__PURE__ */ R("p", {
|
|
667
|
+
className: "mb-1 text-xs font-medium uppercase tracking-wide text-text-muted",
|
|
668
|
+
children: "Recorded decision"
|
|
669
|
+
}),
|
|
670
|
+
/* @__PURE__ */ z("p", {
|
|
671
|
+
className: "text-sm text-text-secondary",
|
|
672
|
+
children: [
|
|
673
|
+
e.status === "ACCEPTED" ? "Accepted" : "Reviewed",
|
|
674
|
+
e.reviewedAt ? ` on ${t(e.reviewedAt)}` : "",
|
|
675
|
+
e.appliedAt ? " · acceptance stamped — the value is applied separately through the record’s own edit form" : ""
|
|
676
|
+
]
|
|
677
|
+
}),
|
|
678
|
+
e.reviewNote && /* @__PURE__ */ R("p", {
|
|
679
|
+
className: "mt-1 whitespace-pre-wrap text-sm text-text-primary",
|
|
680
|
+
children: e.reviewNote
|
|
681
|
+
})
|
|
682
|
+
] })]
|
|
683
|
+
})]
|
|
684
|
+
}), ce = ({ fileId: e }) => {
|
|
685
|
+
let { data: t, isLoading: n, isError: r } = d(e);
|
|
686
|
+
return n ? /* @__PURE__ */ R(U, { className: "h-4 w-40 rounded" }) : r || !t ? /* @__PURE__ */ z("span", {
|
|
687
|
+
className: "inline-flex items-center gap-1.5 text-sm text-text-muted",
|
|
688
|
+
children: [
|
|
689
|
+
/* @__PURE__ */ R(A, {
|
|
690
|
+
className: "size-3.5",
|
|
691
|
+
"aria-hidden": "true"
|
|
692
|
+
}),
|
|
693
|
+
/* @__PURE__ */ R("span", {
|
|
694
|
+
className: "font-mono text-xs",
|
|
695
|
+
children: e
|
|
696
|
+
}),
|
|
697
|
+
/* @__PURE__ */ R("span", {
|
|
698
|
+
className: "text-status-error-text",
|
|
699
|
+
children: "(link unavailable)"
|
|
700
|
+
})
|
|
701
|
+
]
|
|
702
|
+
}) : /* @__PURE__ */ z("a", {
|
|
703
|
+
href: t,
|
|
704
|
+
target: "_blank",
|
|
705
|
+
rel: "noopener noreferrer",
|
|
706
|
+
className: "inline-flex items-center gap-1.5 text-sm text-action-primary-text hover:underline",
|
|
707
|
+
children: [
|
|
708
|
+
/* @__PURE__ */ R(A, {
|
|
709
|
+
className: "size-3.5 shrink-0",
|
|
710
|
+
"aria-hidden": "true"
|
|
711
|
+
}),
|
|
712
|
+
"Attached evidence",
|
|
713
|
+
/* @__PURE__ */ R("span", {
|
|
714
|
+
className: "font-mono text-xs text-text-muted",
|
|
715
|
+
children: e.slice(0, 8)
|
|
716
|
+
})
|
|
717
|
+
]
|
|
718
|
+
});
|
|
719
|
+
};
|
|
720
|
+
//#endregion
|
|
721
|
+
export { Y as CorrectionsPage };
|
|
722
|
+
|
|
723
|
+
//# sourceMappingURL=CorrectionsPage.js.map
|