commit compras1 3011
tests / ci (push) Canceled after 0s

This commit is contained in:
2026-11-30 09:33:36 +02:00
parent 96b30368bc
commit 47649bd46c
163 changed files with 9419 additions and 145 deletions
+2 -3
View File
@@ -3,6 +3,7 @@ import fs from 'node:fs';
import path from 'node:path';
import crypto from 'node:crypto';
import {spawnSync} from 'node:child_process';
import { purchasingHomeOverlay } from './lib/sgf-purchasing-home-overlay.mjs';
const host=fs.realpathSync(process.argv[2]||'');
if(fs.existsSync(path.join(host,'public/hot')))throw Error('Stop the source frontend watcher before freezing a candidate.');
@@ -19,9 +20,7 @@ app=replace(app,'{labels[p]}','{list?.catalogue_labels?.[p] ?? labels[p] ?? p}')
app=replace(app,'{labels[g.permission]}','{list?.catalogue_labels?.[g.permission] ?? labels[g.permission] ?? g.permission}');
fs.writeFileSync(path.join(work,'resources/js/app.jsx'),app);
let home=fs.readFileSync(path.join(work,'resources/js/PurchasingHome.jsx'),'utf8');
home=replace(home,"const payables=unit!==null&&can('supplier_payables.view',unit);", "const payables=unit!==null&&can('supplier_payables.view',unit);\n const requisitions=unit!==null&&can('purchasing_requisitions.view',unit);");
home=replace(home,'<div className="actions">','<div className="actions">{requisitions&&<a href="/purchasing/internal-requisitions">Requisições internas</a>}{budget&&<a href="/purchasing/internal-requisitions/budget-setup">Preparação de centros e dotações</a>}');
home=replace(home,'!budget&&!payables&&','!budget&&!payables&&!requisitions&&');
home=purchasingHomeOverlay(home);
fs.writeFileSync(path.join(work,'resources/js/PurchasingHome.jsx'),home);
let config=fs.readFileSync(path.join(work,'vite.config.js'),'utf8');
config=replace(config,'defineConfig({',`defineConfig({\n cacheDir: ${JSON.stringify(path.join(work,'vite-cache'))},`);