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

This commit is contained in:
2026-11-30 23:04:25 +02:00
parent 318b62f458
commit c9bd6db90b
39 changed files with 2235 additions and 42 deletions
@@ -5,17 +5,24 @@ namespace Tempo\Purchasing\Delivery;
/** Native administration consumes the server catalogue; no second authority list. */
final class AdminUiOverlay
{
public static function prepare(string $host, array $files): array
public static function catalogue(array $files): array
{
$workflow = 'app/Modules/Identity/Services/IdentityWorkflow.php';
$old = "'catalogue' => ['company' => Permissions::COMPANY, 'unit' => Permissions::UNIT]];";
$old = "'catalogue' => ['company' => Permissions::companyCatalogue(), 'unit' => Permissions::UNIT]];";
$contents = $files[$workflow]['contents'];
if (substr_count($contents, $old) !== 1) {
throw new \RuntimeException('Catálogo administrativo do host divergiu.');
}
$contents = str_replace($old, "'catalogue' => ['company' => Permissions::COMPANY, 'unit' => Permissions::UNIT], 'catalogue_labels' => \\Tempo\\Purchasing\\Delivery\\AccessOverlay::LABELS];", $contents);
$contents = str_replace($old, "'catalogue' => ['company' => Permissions::companyCatalogue(), 'unit' => Permissions::UNIT], 'catalogue_labels' => \\Tempo\\Purchasing\\Delivery\\AccessOverlay::labels()];", $contents);
$files[$workflow]['contents'] = $contents;
$files[$workflow]['after_sha256'] = hash('sha256', $contents);
return $files;
}
public static function prepare(string $host, array $files): array
{
$files = self::catalogue($files);
$node = getenv('SGF_NODE_BINARY') ?: 'node';
$process = proc_open([$node, dirname(__DIR__, 3).'/scripts/sgf-admin-ui-build.mjs', $host], [0 => ['pipe', 'r'], 1 => ['pipe', 'w'], 2 => ['pipe', 'w']], $pipes);
if (! is_resource($process)) {