Merge #59: Go there opens the first city still missing a POP
This commit is contained in:
commit
ef3dc0e8f8
3 changed files with 17 additions and 1 deletions
|
|
@ -8,6 +8,7 @@ All notable changes to this project are documented here. The project follows
|
|||
|
||||
- DKNOG in Copenhagen joins the conference calendar every March.
|
||||
- A PNI in the customer’s city now meets their local-breakout requirement while your network is Tier 1 (#20).
|
||||
- A deal’s “Go there” button takes you to a required city without a POP, instead of returning to a city you already serve.
|
||||
|
||||
## [1.26.1] — 2026-10-25
|
||||
|
||||
|
|
|
|||
|
|
@ -2918,7 +2918,7 @@ function renderLeft(){checkLayer();
|
|||
if(!S.offers.length)h+=`<p class="empty">${tr('No open offers right now. Businesses look for networks with POPs in their city. New ones pop up every few weeks.')}</p>`;
|
||||
for(const o of S.offers.slice().sort((a,b)=>a.exp-b.exp)){const has=bHas(o);
|
||||
h+=`<div class="row"><div class="grow"><div class="nm">${esc(o.name)}</div><div class="meta">${esc(BIZ_T[o.type].l)} · ${CITY[o.city].name}${o.city2?' ⇄ '+CITY[o.city2].name:''} · <b>${bTerms(o)}</b> · ${tr('{n}d left',{n:o.exp-S.day})}${(o.reqs||[]).length?` · ${trn('{n} special requirement','{n} special requirements',o.reqs.length)}`:''}</div>${reqList(o)}
|
||||
<div class="btns">${has?btn(tr('Accept'),'accept',{id:o.id},'green sm'):btn(tr('Go there'),'focusCity',{city:o.city},'ghost sm')}${btn(tr('Decline'),'decline',{id:o.id},'ghost sm')}</div>${has?'':`<div class="why">${tr('Needs a POP in {cities}',{cities:bCities(o).filter(x=>!S.pops[x]).map(x=>CITY[x].name).join(', ')})}</div>`}</div></div>`;}
|
||||
<div class="btns">${has?btn(tr('Accept'),'accept',{id:o.id},'green sm'):btn(tr('Go there'),'focusCity',{city:bCities(o).find(c=>!S.pops[c])},'ghost sm')}${btn(tr('Decline'),'decline',{id:o.id},'ghost sm')}</div>${has?'':`<div class="why">${tr('Needs a POP in {cities}',{cities:bCities(o).filter(x=>!S.pops[x]).map(x=>CITY[x].name).join(', ')})}</div>`}</div></div>`;}
|
||||
}else if(UI.left==='noc'){
|
||||
h+=`<div class="btns" style="margin-bottom:8px">${btn(tr('Open NOC dashboard'),'dash',{},'pink')}${btn(tr('Connections'),'connOpen',{},'')}${btn(tr('Traceroute'),'trace',{},'')}</div>`;
|
||||
h+=`<p class="lead">${tr('Your Network Operations Center. Every notification also lands here. Things fail all the time on the internet. Redundant links and multiple upstreams let traffic reroute by itself.')}</p>`;
|
||||
|
|
|
|||
|
|
@ -655,3 +655,18 @@ test('#20 local PNIs satisfy local breakout only while Tier 1, without changing
|
|||
ev("S.transit=[];S.ixp.fra=0");assert.equal(ev("REQS.local.ok({city:'fra'})"),true);
|
||||
assert.deepEqual(errors,[]);
|
||||
});
|
||||
|
||||
test('deal navigation visits the first missing POP, including second endpoints and multi-site offers',()=>{
|
||||
const {ev,dom,errors}=load();ev("ACT.start({});S.cash=1e8;UI.speed=0;UI.left='deals';UI.leftOpen=true;S.offers=[{id:'route',type:'l2vpn',name:'Missing POP circuit',city:'fra',city2:'bde',bw:10,rate:1000,reqs:[],exp:30}];renderLeft()");
|
||||
const go=()=>dom.window.document.querySelector('#leftBody [data-act="focusCity"]');
|
||||
assert.equal(JSON.parse(go().dataset.args).city,'bde');
|
||||
ev(`ACT.focusCity(${go().dataset.args})`);assert.equal(ev('UI.sel.id'),'bde');assert.equal(ev('!!S.pops.bde'),false,'navigation does not buy a POP');
|
||||
ev("S.pops.bde={routers:1,rgen:0};delete S.pops.fra;renderLeft()");assert.equal(JSON.parse(go().dataset.args).city,'fra','the first endpoint can also be missing');
|
||||
ev("delete S.pops.bde;renderLeft()");assert.equal(JSON.parse(go().dataset.args).city,'fra','both missing uses the first required city');
|
||||
ev("S.pops.fra={routers:1,rgen:0};S.offers[0].type='sdwan';S.offers[0].city2=null;S.offers[0].sites=['fra','ams','par'];window.innerWidth=360;renderLeft()");
|
||||
assert.equal(JSON.parse(go().dataset.args).city,'ams');
|
||||
ev("S.pops.ams={routers:1,rgen:0};renderLeft()");assert.equal(JSON.parse(go().dataset.args).city,'par');
|
||||
ev("S.pops.par={routers:1,rgen:0};renderLeft()");assert.equal(go(),null);assert.ok(dom.window.document.querySelector('#leftBody [data-act="accept"]'));
|
||||
ev("S.offers[0].type='l2vpn';delete S.offers[0].sites;S.offers[0].city='bde';renderLeft()");assert.equal(JSON.parse(go().dataset.args).city,'bde','single-site offers still work');
|
||||
assert.deepEqual(errors,[]);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue