fix: "Criar pedido de teste" works again, and the quote list is wider
All checks were successful
Build and deploy / Validate source (push) Successful in 12s
Build and deploy / Integration suite on a real stack (push) Successful in 3m22s
Build and deploy / Secret scan and release gate (push) Successful in 7s
Build and deploy / Publish images (push) Successful in 1m8s

A checkbox label named `confirm` in the quote panel hid window.confirm from
the test-order button, which failed with "can't access lexical declaration
'confirm' before initialization". The quote list takes about a third of the
screen (up to 640 px) and cuts long e-mails with an ellipsis.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Cauê Faleiros
2026-10-01 15:43:55 -03:00
parent 2c664a1cc8
commit b9ebdc0fdb
2 changed files with 9 additions and 5 deletions

View File

@@ -490,7 +490,8 @@ function renderQuotes(){
else currentQuote=quoteRows.find(q=>q.id===currentQuote.id)||currentQuote;
const list=quoteRows.map(q=>{
const b=node('button',undefined,'qitem');b.type='button';b.dataset.quotePick=q.id;b.setAttribute('aria-current',String(q.id===currentQuote?.id));
const left=node('div',undefined,'qmain');left.append(node('b',q.draft.customer.mail),
const mail=node('b',q.draft.customer.mail);mail.title=q.draft.customer.mail;
const left=node('div',undefined,'qmain');left.append(mail,
node('span',q.draft.items.map(i=>SHORT[i.mode]).join(' + ')+' · '+metres(quoteMetres(q))));
if(q.draft.items.some(i=>i.production?.version!==2))left.append(node('span','Montagem antiga: peça nova cotação','flag'));
else if(q.draft.items.some(i=>i.quality_status==='warning'))left.append(node('span','Ressalva de resolução aceita pelo cliente','flag'));
@@ -541,9 +542,11 @@ function review(quote){
const edits=quote.draft.items.map(item=>{const fields={};content.append(quoteItem(item,fields));
return ()=>({...item,metres:fields.metres.value,grade:Number(fields.grade.value)});});
const check=node('input');check.type='checkbox';check.required=true;
const confirm=node('label',undefined,'check');confirm.append(check,'Arquivos, metragem e nota conferidos');
// Not "confirm": that name in this function hid window.confirm from the
// test-order button above, which then failed before asking anything.
const checked=node('label',undefined,'check');checked.append(check,'Arquivos, metragem e nota conferidos');
const submit=node('button','Aprovar cotação','btn primary');
foot.append(confirm,submit);
foot.append(checked,submit);
form.append(content,foot);
form.onsubmit=async e=>{e.preventDefault();submit.disabled=true;
try{const approved=await api('/quotes/'+quote.id+'/approve',{items:edits.map(fn=>fn())});