From 47f3251d3e4dbe888abce7b207790f85db337b5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cau=C3=AA=20Faleiros?= Date: Fri, 27 Nov 2026 09:55:53 -0300 Subject: [PATCH] =?UTF-8?q?feat:=20"Enviar=20nova=20vers=C3=A3o"=20keeps?= =?UTF-8?q?=20each=20item's=20current=20final,=20ticked,=20so=20only=20the?= =?UTF-8?q?=20corrected=20file=20is=20sent=20(Marcus,=202026-11-26,=20#105?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 (1M context) --- web/kanban-order.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/web/kanban-order.js b/web/kanban-order.js index ac403dc..daec729 100644 --- a/web/kanban-order.js +++ b/web/kanban-order.js @@ -571,7 +571,7 @@ function finalDialog(order,ready,{replace=false}={}){ if(file){ const use=node('input');use.checked=true;use.dataset.useGenerated=index;input.required=false;drop.hidden=true; use.onchange=()=>{drop.hidden=use.checked;input.required=!use.checked;}; - slot.append(checkbox('Usar: '+file.label,use));input.generated=()=>use.checked?file.files.map(f=>f.upload_id):null; + slot.append(checkbox(file.text||'Usar: '+file.label,use));input.generated=()=>use.checked?file.files.map(f=>f.upload_id):null; } slot.append(drop);fields.push(slot);return input; }); @@ -1129,6 +1129,16 @@ function itemCard(order,item,index){ } // A disclosure's summary: the chevron turns when it opens. function discSummary(text){const s=node('summary');s.append(svgIcon(IC.right,'i s'),node('span',text));return s;} +// Each item's current final (one file, or a film's parts), to keep as it is. +function currentFinals(order,revisions){ + return order.snapshot.items.map((_,index)=>{ + const files=revisions.filter(f=>f.kind==='final'&&f.active&&!f.expired&&f.item_index===index) + .map(f=>({upload_id:f.upload_id,name:f.name})); + if(!files.length)return null; + const names=files.length>1?files.length+' partes':files[0].name; + return {files,name:files[0].name,source:'final',label:names,text:'Manter o arquivo atual ('+names+')'}; + }); +} // Arquivos: every final, current or replaced, and the way to send a new one. function filesView(order,revisions,view){ const out=[]; @@ -1158,7 +1168,9 @@ function filesView(order,revisions,view){ // Replacing an approved final, while the art is still in Arte recebida or Correção; // in Arte conferida, the queue, the order goes back to Arte recebida first. if(may('produce')&&['rec','cor'].includes(order.state)&&finalDone(order)&&!order.cancelled_at&&!order.proof_parent){ - const open=button('Enviar nova versão',async()=>finalDialog(order,readyFinals(order).map(()=>null),{replace:true}),'btn'); + // Only the item that changed is sent: each other item keeps its current + // final, ticked (Marcus, 2026-11-26, #105). + const open=button('Enviar nova versão',async()=>finalDialog(order,currentFinals(order,revisions),{replace:true}),'btn'); open.prepend(svgIcon(IC.upload,'i m'));open.classList.add('self-start');out.push(open); } view.replaceChildren(...out);