feat: the orders' files in Dropstar's three folders: Arte recebida, Arte conferida, Finalizado
All checks were successful
Build and deploy / Validate source (push) Successful in 11s
Build and deploy / Integration suite on a real stack (push) Successful in 4m27s
Build and deploy / Secret scan and release gate (push) Successful in 8s
Build and deploy / Publish images (push) Successful in 1m19s
All checks were successful
Build and deploy / Validate source (push) Successful in 11s
Build and deploy / Integration suite on a real stack (push) Successful in 4m27s
Build and deploy / Secret scan and release gate (push) Successful in 8s
Build and deploy / Publish images (push) Successful in 1m19s
Asked by Dropstar on 2026-10-23 and agreed on 2026-10-26. The automatic folder becomes "Pastas dos pedidos": one main folder is chosen once, in Chrome or Edge on a factory computer that reaches the server, and the Kanban keeps three folders inside it, moved with the card. - Arte recebida: the order's file as soon as the order arrives - Arte conferida: the queue; the file moves there with the card and stays while it prints and is checked in Revisão - Finalizado: when the order is released, kept 30 days - Correção, a cancellation or a deletion takes the file out; a replaced final is swapped - orders already printing when the folder is chosen are not downloaded; a file someone took out comes back only when its order moves on, so the server now returns the files of orders the folders hold while they print, are checked and finish - Firefox, which cannot write into folders, still only downloads the files entering Arte conferida Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -183,7 +183,7 @@ try{
|
||||
assert.equal(await kanban.eval(`board.orders.find(o=>o.id===${JSON.stringify(oid)}).snapshot.customer.name`),'Maria da Silva');
|
||||
assert.deepEqual(await kanban.eval(`(()=>{const spec=board.orders.find(o=>o.id===${JSON.stringify(oid)}).snapshot.items[0].production;const source=spec.sources[0];return {kind:source.kind,copies:source.copies,length:Number(source.length_cm),height:Number(spec.height_cm),placed:spec.placements.length}})()`),
|
||||
{kind:'sheet',copies:1,length:101,height:101,placed:1});
|
||||
// The print queue's folder, switched on in Integrações. The native picker
|
||||
// The orders' three folders, switched on in Integrações. The native picker
|
||||
// cannot be driven headless: it answers with a folder in the browser's own
|
||||
// storage, which has the same file API.
|
||||
await kanban.click('[data-tab="integrations"]');
|
||||
@@ -193,11 +193,10 @@ try{
|
||||
window.showDirectoryPicker=async()=>window.picked;FOLDER.mode='folder';renderIntegrations();
|
||||
[...document.querySelectorAll('#folder-card button')].find(b=>b.textContent==='Escolher pasta').click();})()`);
|
||||
await waitFor(()=>kanban.eval('folderActive()&&!FOLDER.busy'),'folder chosen');
|
||||
// Downloaded as the order arrives, into Recebidos; up to the folder at the queue.
|
||||
await waitFor(()=>kanban.eval(`!!document.querySelector('#folder-card select')`),'download timing choice');
|
||||
await kanban.eval(`(()=>{const s=document.querySelector('#folder-card select');s.value='rec';s.dispatchEvent(new Event('change'));})()`);
|
||||
await waitFor(()=>kanban.eval(`FOLDER.when==='rec'&&!FOLDER.busy`),'download on arrival');
|
||||
const savedFiles=(sub)=>kanban.eval(`(async()=>{const dir=${sub?`await window.picked.getDirectoryHandle(${JSON.stringify(sub)},{create:true})`:'window.picked'};
|
||||
// Dropstar's three folders (2026-10-26): the file arrives in Arte recebida,
|
||||
// goes to Arte conferida with the card and to Finalizado at the end.
|
||||
await waitFor(()=>kanban.eval(`!FOLDER.busy`),'folder idle');
|
||||
const savedFiles=(sub)=>kanban.eval(`(async()=>{const dir=await window.picked.getDirectoryHandle(${JSON.stringify(sub)},{create:true});
|
||||
const out=[];for await(const [name,h] of dir.entries())if(h.kind==='file')out.push(name);return out;})()`);
|
||||
// Open the order's panel from its card, then click the real transition
|
||||
// buttons there, including the rerender after each move.
|
||||
@@ -220,31 +219,40 @@ try{
|
||||
await kanban.fill(`[data-order="${oid}"] input[placeholder="Nota da revisão"]`,'Browser test final file');
|
||||
await kanban.eval(`(()=>{const check=document.querySelector('[data-order="${oid}"] [data-confirm]');check.click();check.closest('form').requestSubmit();})()`);
|
||||
await waitFor(()=>kanban.eval(`board.orders.find(o=>o.id==='${oid}').version===1`),'final file approval');
|
||||
// Approved before the queue: already on this computer, in Recebidos.
|
||||
// Approved before the queue: already on this computer, in Arte recebida.
|
||||
const early='DTF-'+await kanban.eval(`board.orders.find(o=>o.id==='${oid}').number`)+'-item-1';
|
||||
await kanban.eval('syncFolder(true)');
|
||||
await waitFor(async()=>(await savedFiles('Recebidos')).some(n=>n.startsWith(early)&&!n.endsWith('.baixando')),'final file saved in Recebidos',45000);
|
||||
assert.equal((await savedFiles()).some(n=>n.startsWith(early)),false);
|
||||
await waitFor(async()=>(await savedFiles('Arte recebida')).some(n=>n.startsWith(early)&&!n.endsWith('.baixando')),'final file saved in Arte recebida',45000);
|
||||
assert.equal((await savedFiles('Arte conferida')).some(n=>n.startsWith(early)),false);
|
||||
}
|
||||
await waitFor(()=>kanban.eval(`!!document.querySelector('[data-order="${oid}"] [data-move="${state}"]')`),'move to '+title);
|
||||
await kanban.click(`[data-order="${oid}"] [data-move="${state}"]`);
|
||||
await waitFor(()=>kanban.eval(`board.orders.find(o=>o.id==='${oid}').state==='${state}'`),'transition '+state);
|
||||
if(state==='tra'){
|
||||
// Entering the queue saves its final file there, whole and named after the order.
|
||||
// Entering the queue moves its file to Arte conferida, whole and named after the order.
|
||||
const prefix='DTF-'+await kanban.eval(`board.orders.find(o=>o.id==='${oid}').number`)+'-item-1';
|
||||
await waitFor(async()=>(await savedFiles()).some(n=>n.startsWith(prefix)&&!n.endsWith('.baixando')),'final file saved in the folder',45000);
|
||||
await waitFor(async()=>(await savedFiles('Arte conferida')).some(n=>n.startsWith(prefix)&&!n.endsWith('.baixando')),'final file in Arte conferida',45000);
|
||||
// Other orders the earlier suites left in the queue may still be coming
|
||||
// down: only once the round ends must no half-written file be left.
|
||||
await waitFor(()=>kanban.eval('!FOLDER.busy'),'folder round finished',60000);
|
||||
assert.equal((await savedFiles()).some(n=>n.endsWith('.baixando')),false);
|
||||
assert.equal((await savedFiles('Recebidos')).some(n=>n.startsWith(prefix)),false);
|
||||
assert.equal((await savedFiles('Arte conferida')).some(n=>n.endsWith('.baixando')),false);
|
||||
assert.equal((await savedFiles('Arte recebida')).some(n=>n.startsWith(prefix)),false);
|
||||
// A file whose order was deleted leaves the folder.
|
||||
await kanban.eval(`(async()=>{const f=await window.picked.getFileHandle('pedido-0-item-1-excluido.png',{create:true});
|
||||
await kanban.eval(`(async()=>{const dir=await window.picked.getDirectoryHandle('Arte conferida',{create:true});
|
||||
const f=await dir.getFileHandle('pedido-0-item-1-excluido.png',{create:true});
|
||||
const w=await f.createWritable();await w.write('x');await w.close();
|
||||
FOLDER.saved.set(crypto.randomUUID(),{order:crypto.randomUUID(),item:1,name:'pedido-0-item-1-excluido.png',place:'queue'});})()`);
|
||||
FOLDER.saved.set(crypto.randomUUID(),{order:crypto.randomUUID(),item:1,name:'pedido-0-item-1-excluido.png',folder:'Arte conferida'});})()`);
|
||||
await waitFor(()=>kanban.eval('!FOLDER.busy'),'folder idle',60000);
|
||||
await kanban.eval('syncFolder(true)');
|
||||
await waitFor(async()=>!(await savedFiles()).includes('pedido-0-item-1-excluido.png'),'deleted order file removed',30000);
|
||||
await waitFor(async()=>!(await savedFiles('Arte conferida')).includes('pedido-0-item-1-excluido.png'),'deleted order file removed',30000);
|
||||
}
|
||||
if(state==='fin'){
|
||||
// Finalized: the file goes to Finalizado, out of the queue.
|
||||
const prefix='DTF-'+await kanban.eval(`board.orders.find(o=>o.id==='${oid}').number`)+'-item-1';
|
||||
await waitFor(()=>kanban.eval('!FOLDER.busy'),'folder idle',60000);
|
||||
await kanban.eval('syncFolder(true)');
|
||||
await waitFor(async()=>(await savedFiles('Finalizado')).some(n=>n.startsWith(prefix)),'final file in Finalizado',30000);
|
||||
assert.equal((await savedFiles('Arte conferida')).some(n=>n.startsWith(prefix)),false);
|
||||
}
|
||||
}
|
||||
// Undo a mistaken move from the panel: one stage back with an internal reason.
|
||||
|
||||
Reference in New Issue
Block a user