fix(custom-fields) : context fields display, batch save, hierarchy propagation and UniqueEntity fix
- ComponentItem/PieceItem: DaisyUI divider, emit context-field-update for batch save - CustomFieldDisplay: support editable/emit-blur/title/show-header props - MachineComponentsCard/MachinePiecesCard: propagate custom-field-update events - useMachineDetailCustomFields: pendingContextFieldUpdates + saveAllContextCustomFields - useMachineDetailData: wire context field save into submitEdition - useMachineDetailUpdates: only PATCH changed machine fields - useMachineHierarchy: propagate contextCustomFields/Values from link to nodes - componentStructure: include machineContextOnly in normalizeStructureForEditor - Machine entity: convert empty reference to null, ignoreNull on UniqueEntity Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -53,6 +53,6 @@ final class MaintenanceController extends AbstractController
|
||||
|
||||
private function flagPath(): string
|
||||
{
|
||||
return $this->kernel->getProjectDir() . '/var/maintenance';
|
||||
return $this->kernel->getProjectDir().'/var/maintenance';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ use Symfony\Component\Validator\Constraints as Assert;
|
||||
#[ORM\Entity(repositoryClass: MachineRepository::class)]
|
||||
#[ORM\Table(name: 'machines')]
|
||||
#[ORM\HasLifecycleCallbacks]
|
||||
#[UniqueEntity(fields: ['reference'], message: 'Une machine avec cette référence existe déjà.')]
|
||||
#[UniqueEntity(fields: ['reference'], message: 'Une machine avec cette référence existe déjà.', ignoreNull: true)]
|
||||
#[ApiResource(
|
||||
description: 'Machines industrielles rattachées à un site. Chaque machine possède une structure hiérarchique de composants, pièces et produits, ainsi que des champs personnalisés et des documents.',
|
||||
operations: [
|
||||
@@ -150,7 +150,7 @@ class Machine
|
||||
|
||||
public function setReference(?string $reference): static
|
||||
{
|
||||
$this->reference = $reference;
|
||||
$this->reference = (null !== $reference && '' !== trim($reference)) ? $reference : null;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
@@ -24,14 +24,14 @@ final class MaintenanceModeListener
|
||||
return;
|
||||
}
|
||||
|
||||
$flagFile = $this->kernel->getProjectDir() . '/var/maintenance';
|
||||
$flagFile = $this->kernel->getProjectDir().'/var/maintenance';
|
||||
|
||||
if (!file_exists($flagFile)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$request = $event->getRequest();
|
||||
$path = $request->getPathInfo();
|
||||
$path = $request->getPathInfo();
|
||||
|
||||
// Always allow maintenance status endpoint and session endpoints
|
||||
if (str_starts_with($path, '/api/admin/maintenance')
|
||||
|
||||
Reference in New Issue
Block a user