fix(dashboard): point View link at the live leginfo bill page

The /bill/<session>/<ABn> path now 404s for every bill and hardcoded
'AB', so Senate bills were broken too. Build the link from the canonical
bill_id via the working faces/billNavClient.xhtml?bill_id= endpoint,
which returns 200 for both Assembly and Senate bills. Drop the now-dead
billNum() helper it was the only caller of.
This commit is contained in:
kfj001 committed 2026-09-06 12:31:49 -07:00
1 parent 97d125ca0a
commit a104685daf
1 file changed
+4 -6
+4 -6
View File
@@ -90,8 +90,10 @@
(state.showReason ? " show" : "") + '">'
+ "Floated: " + parts.join("; ") + "</div>";
}
var url = "https://leginfo.legislature.ca.gov/bill/" +
(ev.session || "2025-2026") + "/AB" + billNum(ev);
var url = ev.bill_id
? "https://leginfo.legislature.ca.gov/faces/billNavClient.xhtml?bill_id="
+ encodeURIComponent(ev.bill_id)
: "";
return '<div class="' + cls + '" data-bill="' +
esc(ev.bill_id) + '">'
+ '<span class="num">' + chip(ev.chamber_origin) +
@@ -112,10 +114,6 @@
+ "</div>";
}
function billNum(ev) {
var m = (ev.bill_number || "").match(/(\d+)/);
return m ? m[1] : "";
}
function esc(s) {
return String(s == null ? "" : s)
.replace(/&/g, "&amp;").replace(/</g, "&lt;")