Skip to content

Commit 2e10f77

Browse files
authored
fix: sort supply chain chokepoints by disruption score descending (#399)
* fix: sort tariff datapoints newest-first in trade policy panel * fix: update tests broken by cachedFetchJson migration - Restore "Strip unterminated" comment in summarize-article.ts that tests use to locate the unterminated tag stripping section - Update ACLED tests to check for cachedFetchJson instead of removed getCachedJson/setCachedJson patterns * fix: sort supply chain chokepoints by disruption score descending
1 parent feaf371 commit 2e10f77

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/components/SupplyChainPanel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export class SupplyChainPanel extends Panel {
9090
}
9191

9292
return `<div class="trade-restrictions-list">
93-
${this.chokepointData.chokepoints.map(cp => {
93+
${[...this.chokepointData.chokepoints].sort((a, b) => b.disruptionScore - a.disruptionScore).map(cp => {
9494
const statusClass = cp.status === 'red' ? 'status-active' : cp.status === 'yellow' ? 'status-notified' : 'status-terminated';
9595
const statusDot = cp.status === 'red' ? 'sc-dot-red' : cp.status === 'yellow' ? 'sc-dot-yellow' : 'sc-dot-green';
9696
return `<div class="trade-restriction-card">

0 commit comments

Comments
 (0)