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:
1 parent
97d125ca0a
commit
a104685daf
1 file changed
+4
-6
@@ -90,8 +90,10 @@
|
|||||||
(state.showReason ? " show" : "") + '">'
|
(state.showReason ? " show" : "") + '">'
|
||||||
+ "Floated: " + parts.join("; ") + "</div>";
|
+ "Floated: " + parts.join("; ") + "</div>";
|
||||||
}
|
}
|
||||||
var url = "https://leginfo.legislature.ca.gov/bill/" +
|
var url = ev.bill_id
|
||||||
(ev.session || "2025-2026") + "/AB" + billNum(ev);
|
? "https://leginfo.legislature.ca.gov/faces/billNavClient.xhtml?bill_id="
|
||||||
|
+ encodeURIComponent(ev.bill_id)
|
||||||
|
: "";
|
||||||
return '<div class="' + cls + '" data-bill="' +
|
return '<div class="' + cls + '" data-bill="' +
|
||||||
esc(ev.bill_id) + '">'
|
esc(ev.bill_id) + '">'
|
||||||
+ '<span class="num">' + chip(ev.chamber_origin) +
|
+ '<span class="num">' + chip(ev.chamber_origin) +
|
||||||
@@ -112,10 +114,6 @@
|
|||||||
+ "</div>";
|
+ "</div>";
|
||||||
}
|
}
|
||||||
|
|
||||||
function billNum(ev) {
|
|
||||||
var m = (ev.bill_number || "").match(/(\d+)/);
|
|
||||||
return m ? m[1] : "";
|
|
||||||
}
|
|
||||||
function esc(s) {
|
function esc(s) {
|
||||||
return String(s == null ? "" : s)
|
return String(s == null ? "" : s)
|
||||||
.replace(/&/g, "&").replace(/</g, "<")
|
.replace(/&/g, "&").replace(/</g, "<")
|
||||||
|
|||||||
Reference in new issue
Block a user