Merge remote-tracking branch 'origin/feature/custom-part-status' into feature/all-features

# Conflicts:
#	docs/configuration.md
#	migrations/Version20250321141740.php
#	src/Entity/Attachments/Attachment.php
#	src/Entity/Base/AbstractDBElement.php
#	src/Entity/LogSystem/CollectionElementDeleted.php
#	src/Entity/LogSystem/LogTargetType.php
#	src/Entity/Parameters/AbstractParameter.php
#	src/Entity/Parts/PartCustomState.php
#	src/Security/Voter/AttachmentVoter.php
#	templates/parts/edit/_advanced.html.twig
#	tests/Controller/AdminPages/PartCustomStateControllerTest.php
#	translations/messages.cs.xlf
#	translations/messages.el.xlf
#	translations/messages.fr.xlf
#	translations/messages.ja.xlf
#	translations/messages.nl.xlf
This commit is contained in:
Marcel Diegelmann 2025-10-01 09:15:53 +02:00
commit 73a2b16332
7 changed files with 170 additions and 176 deletions

View file

@ -43,10 +43,10 @@ final class Version20250321141740 extends AbstractMultiPlatformMigration
public function sqLiteUp(Schema $schema): void public function sqLiteUp(Schema $schema): void
{ {
$this->addSql(<<<'SQL' $this->addSql(<<<'SQL'
CREATE TEMPORARY TABLE __temp__parts AS CREATE TEMPORARY TABLE __temp__parts AS
SELECT SELECT
id, id,
id_preview_attachment, id_preview_attachment,
id_category, id_category,
id_footprint, id_footprint,
id_part_unit, id_part_unit,
@ -82,7 +82,7 @@ final class Version20250321141740 extends AbstractMultiPlatformMigration
eda_info_exclude_from_board, eda_info_exclude_from_board,
eda_info_exclude_from_sim, eda_info_exclude_from_sim,
eda_info_kicad_symbol, eda_info_kicad_symbol,
eda_info_kicad_footprint eda_info_kicad_footprint
FROM parts FROM parts
SQL); SQL);
@ -181,8 +181,8 @@ final class Version20250321141740 extends AbstractMultiPlatformMigration
eda_info_exclude_from_board, eda_info_exclude_from_board,
eda_info_exclude_from_sim, eda_info_exclude_from_sim,
eda_info_kicad_symbol, eda_info_kicad_symbol,
eda_info_kicad_footprint) eda_info_kicad_footprint)
SELECT SELECT
id, id,
id_preview_attachment, id_preview_attachment,
id_category, id_category,
@ -219,7 +219,7 @@ final class Version20250321141740 extends AbstractMultiPlatformMigration
eda_info_exclude_from_board, eda_info_exclude_from_board,
eda_info_exclude_from_sim, eda_info_exclude_from_sim,
eda_info_kicad_symbol, eda_info_kicad_symbol,
eda_info_kicad_footprint eda_info_kicad_footprint
FROM __temp__parts FROM __temp__parts
SQL); SQL);
@ -271,45 +271,45 @@ final class Version20250321141740 extends AbstractMultiPlatformMigration
public function sqLiteDown(Schema $schema): void public function sqLiteDown(Schema $schema): void
{ {
$this->addSql(<<<'SQL' $this->addSql(<<<'SQL'
CREATE TEMPORARY TABLE __temp__parts AS CREATE TEMPORARY TABLE __temp__parts AS
SELECT SELECT
id, id,
id_preview_attachment, id_preview_attachment,
id_category, id_category,
id_footprint, id_footprint,
id_part_unit, id_part_unit,
id_manufacturer, id_manufacturer,
order_orderdetails_id, order_orderdetails_id,
built_project_id, built_project_id,
built_assembly_id, built_assembly_id,
datetime_added, datetime_added,
name, name,
last_modified, last_modified,
needs_review, needs_review,
tags, tags,
mass, mass,
description, description,
comment, comment,
visible, visible,
favorite, favorite,
minamount, minamount,
manufacturer_product_url, manufacturer_product_url,
manufacturer_product_number, manufacturer_product_number,
manufacturing_status, manufacturing_status,
order_quantity, order_quantity,
manual_order, manual_order,
ipn, ipn,
provider_reference_provider_key, provider_reference_provider_key,
provider_reference_provider_id, provider_reference_provider_id,
provider_reference_provider_url, provider_reference_provider_url,
provider_reference_last_updated, provider_reference_last_updated,
eda_info_reference_prefix, eda_info_reference_prefix,
eda_info_value, eda_info_value,
eda_info_invisible, eda_info_invisible,
eda_info_exclude_from_bom, eda_info_exclude_from_bom,
eda_info_exclude_from_board, eda_info_exclude_from_board,
eda_info_exclude_from_sim, eda_info_exclude_from_sim,
eda_info_kicad_symbol, eda_info_kicad_symbol,
eda_info_kicad_footprint eda_info_kicad_footprint
FROM "parts" FROM "parts"
SQL); SQL);
@ -318,132 +318,132 @@ final class Version20250321141740 extends AbstractMultiPlatformMigration
SQL); SQL);
$this->addSql(<<<'SQL' $this->addSql(<<<'SQL'
CREATE TABLE "parts" ( CREATE TABLE "parts" (
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
id_preview_attachment INTEGER DEFAULT NULL, id_preview_attachment INTEGER DEFAULT NULL,
id_category INTEGER NOT NULL, id_category INTEGER NOT NULL,
id_footprint INTEGER DEFAULT NULL, id_footprint INTEGER DEFAULT NULL,
id_part_unit INTEGER DEFAULT NULL, id_part_unit INTEGER DEFAULT NULL,
id_manufacturer INTEGER DEFAULT NULL, id_manufacturer INTEGER DEFAULT NULL,
order_orderdetails_id INTEGER DEFAULT NULL, order_orderdetails_id INTEGER DEFAULT NULL,
built_project_id INTEGER DEFAULT NULL, built_project_id INTEGER DEFAULT NULL,
built_assembly_id INTEGER DEFAULT NULL, built_assembly_id INTEGER DEFAULT NULL,
datetime_added DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, datetime_added DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL,
name VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL,
last_modified DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, last_modified DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL,
needs_review BOOLEAN NOT NULL, needs_review BOOLEAN NOT NULL,
tags CLOB NOT NULL, tags CLOB NOT NULL,
mass DOUBLE PRECISION DEFAULT NULL, mass DOUBLE PRECISION DEFAULT NULL,
description CLOB NOT NULL, description CLOB NOT NULL,
comment CLOB NOT NULL, comment CLOB NOT NULL,
visible BOOLEAN NOT NULL, visible BOOLEAN NOT NULL,
favorite BOOLEAN NOT NULL, favorite BOOLEAN NOT NULL,
minamount DOUBLE PRECISION NOT NULL, minamount DOUBLE PRECISION NOT NULL,
manufacturer_product_url CLOB NOT NULL, manufacturer_product_url CLOB NOT NULL,
manufacturer_product_number VARCHAR(255) NOT NULL, manufacturer_product_number VARCHAR(255) NOT NULL,
manufacturing_status VARCHAR(255) DEFAULT NULL, manufacturing_status VARCHAR(255) DEFAULT NULL,
order_quantity INTEGER NOT NULL, order_quantity INTEGER NOT NULL,
manual_order BOOLEAN NOT NULL, manual_order BOOLEAN NOT NULL,
ipn VARCHAR(100) DEFAULT NULL, ipn VARCHAR(100) DEFAULT NULL,
provider_reference_provider_key VARCHAR(255) DEFAULT NULL, provider_reference_provider_key VARCHAR(255) DEFAULT NULL,
provider_reference_provider_id VARCHAR(255) DEFAULT NULL, provider_reference_provider_id VARCHAR(255) DEFAULT NULL,
provider_reference_provider_url VARCHAR(255) DEFAULT NULL, provider_reference_provider_url VARCHAR(255) DEFAULT NULL,
provider_reference_last_updated DATETIME DEFAULT NULL, provider_reference_last_updated DATETIME DEFAULT NULL,
eda_info_reference_prefix VARCHAR(255) DEFAULT NULL, eda_info_reference_prefix VARCHAR(255) DEFAULT NULL,
eda_info_value VARCHAR(255) DEFAULT NULL, eda_info_value VARCHAR(255) DEFAULT NULL,
eda_info_invisible BOOLEAN DEFAULT NULL, eda_info_invisible BOOLEAN DEFAULT NULL,
eda_info_exclude_from_bom BOOLEAN DEFAULT NULL, eda_info_exclude_from_bom BOOLEAN DEFAULT NULL,
eda_info_exclude_from_board BOOLEAN DEFAULT NULL, eda_info_exclude_from_board BOOLEAN DEFAULT NULL,
eda_info_exclude_from_sim BOOLEAN DEFAULT NULL, eda_info_exclude_from_sim BOOLEAN DEFAULT NULL,
eda_info_kicad_symbol VARCHAR(255) DEFAULT NULL, eda_info_kicad_symbol VARCHAR(255) DEFAULT NULL,
eda_info_kicad_footprint VARCHAR(255) DEFAULT NULL, eda_info_kicad_footprint VARCHAR(255) DEFAULT NULL,
CONSTRAINT FK_6940A7FEEA7100A1 FOREIGN KEY (id_preview_attachment) REFERENCES "attachments" (id) ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_6940A7FEEA7100A1 FOREIGN KEY (id_preview_attachment) REFERENCES "attachments" (id) ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE,
CONSTRAINT FK_6940A7FE5697F554 FOREIGN KEY (id_category) REFERENCES "categories" (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_6940A7FE5697F554 FOREIGN KEY (id_category) REFERENCES "categories" (id) NOT DEFERRABLE INITIALLY IMMEDIATE,
CONSTRAINT FK_6940A7FE7E371A10 FOREIGN KEY (id_footprint) REFERENCES "footprints" (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_6940A7FE7E371A10 FOREIGN KEY (id_footprint) REFERENCES "footprints" (id) NOT DEFERRABLE INITIALLY IMMEDIATE,
CONSTRAINT FK_6940A7FE2626CEF9 FOREIGN KEY (id_part_unit) REFERENCES "measurement_units" (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_6940A7FE2626CEF9 FOREIGN KEY (id_part_unit) REFERENCES "measurement_units" (id) NOT DEFERRABLE INITIALLY IMMEDIATE,
CONSTRAINT FK_6940A7FE1ECB93AE FOREIGN KEY (id_manufacturer) REFERENCES "manufacturers" (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_6940A7FE1ECB93AE FOREIGN KEY (id_manufacturer) REFERENCES "manufacturers" (id) NOT DEFERRABLE INITIALLY IMMEDIATE,
CONSTRAINT FK_6940A7FE81081E9B FOREIGN KEY (order_orderdetails_id) REFERENCES "orderdetails" (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_6940A7FE81081E9B FOREIGN KEY (order_orderdetails_id) REFERENCES "orderdetails" (id) NOT DEFERRABLE INITIALLY IMMEDIATE,
CONSTRAINT FK_6940A7FEE8AE70D9 FOREIGN KEY (built_project_id) REFERENCES projects (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_6940A7FEE8AE70D9 FOREIGN KEY (built_project_id) REFERENCES projects (id) NOT DEFERRABLE INITIALLY IMMEDIATE,
CONSTRAINT FK_6940A7FECC660B3C FOREIGN KEY (built_assembly_id) REFERENCES assemblies (id) NOT DEFERRABLE INITIALLY IMMEDIATE CONSTRAINT FK_6940A7FECC660B3C FOREIGN KEY (built_assembly_id) REFERENCES assemblies (id) NOT DEFERRABLE INITIALLY IMMEDIATE
) )
SQL); SQL);
$this->addSql(<<<'SQL' $this->addSql(<<<'SQL'
INSERT INTO "parts" ( INSERT INTO "parts" (
id, id,
id_preview_attachment, id_preview_attachment,
id_category, id_category,
id_footprint, id_footprint,
id_part_unit, id_part_unit,
id_manufacturer, id_manufacturer,
order_orderdetails_id, order_orderdetails_id,
built_project_id,
built_assembly_id,
datetime_added,
name,
last_modified,
needs_review,
tags,
mass,
description,
comment,
visible,
favorite,
minamount,
manufacturer_product_url,
manufacturer_product_number,
manufacturing_status,
order_quantity,
manual_order,
ipn,
provider_reference_provider_key,
provider_reference_provider_id,
provider_reference_provider_url,
provider_reference_last_updated,
eda_info_reference_prefix,
eda_info_value,
eda_info_invisible,
eda_info_exclude_from_bom,
eda_info_exclude_from_board,
eda_info_exclude_from_sim,
eda_info_kicad_symbol,
eda_info_kicad_footprint
) SELECT
id,
id_preview_attachment,
id_category,
id_footprint,
id_part_unit,
id_manufacturer,
order_orderdetails_id,
built_project_id, built_project_id,
built_assembly_id, built_assembly_id,
datetime_added, datetime_added,
name, name,
last_modified, last_modified,
needs_review, needs_review,
tags, tags,
mass, mass,
description, description,
comment, comment,
visible, visible,
favorite, favorite,
minamount, minamount,
manufacturer_product_url, manufacturer_product_url,
manufacturer_product_number, manufacturer_product_number,
manufacturing_status, manufacturing_status,
order_quantity, order_quantity,
manual_order, manual_order,
ipn, ipn,
provider_reference_provider_key, provider_reference_provider_key,
provider_reference_provider_id, provider_reference_provider_id,
provider_reference_provider_url, provider_reference_provider_url,
provider_reference_last_updated, provider_reference_last_updated,
eda_info_reference_prefix, eda_info_reference_prefix,
eda_info_value, eda_info_value,
eda_info_invisible, eda_info_invisible,
eda_info_exclude_from_bom, eda_info_exclude_from_bom,
eda_info_exclude_from_board, eda_info_exclude_from_board,
eda_info_exclude_from_sim, eda_info_exclude_from_sim,
eda_info_kicad_symbol, eda_info_kicad_symbol,
eda_info_kicad_footprint
) SELECT
id,
id_preview_attachment,
id_category,
id_footprint,
id_part_unit,
id_manufacturer,
order_orderdetails_id,
built_project_id,
built_assembly_id,
datetime_added,
name,
last_modified,
needs_review,
tags,
mass,
description,
comment,
visible,
favorite,
minamount,
manufacturer_product_url,
manufacturer_product_number,
manufacturing_status,
order_quantity,
manual_order,
ipn,
provider_reference_provider_key,
provider_reference_provider_id,
provider_reference_provider_url,
provider_reference_last_updated,
eda_info_reference_prefix,
eda_info_value,
eda_info_invisible,
eda_info_exclude_from_bom,
eda_info_exclude_from_board,
eda_info_exclude_from_sim,
eda_info_kicad_symbol,
eda_info_kicad_footprint eda_info_kicad_footprint
FROM __temp__parts FROM __temp__parts
SQL); SQL);

View file

@ -107,7 +107,7 @@ class PartCustomState extends AbstractPartsContainingDBElement
/** @var Collection<int, PartCustomStateAttachment> /** @var Collection<int, PartCustomStateAttachment>
*/ */
#[Assert\Valid] #[Assert\Valid]
#[ORM\OneToMany(mappedBy: 'element', targetEntity: PartCustomStateAttachment::class, cascade: ['persist', 'remove'], orphanRemoval: true)] #[ORM\OneToMany(mappedBy: 'element', targetEntity: PartCustomStateParameter::class, cascade: ['persist', 'remove'], orphanRemoval: true)]
#[ORM\OrderBy(['name' => 'ASC'])] #[ORM\OrderBy(['name' => 'ASC'])]
#[Groups(['part_custom_state:read', 'part_custom_state:write'])] #[Groups(['part_custom_state:read', 'part_custom_state:write'])]
protected Collection $parameters; protected Collection $parameters;

View file

@ -46,6 +46,7 @@ enum PartTableColumns : string implements TranslatableInterface
case FAVORITE = "favorite"; case FAVORITE = "favorite";
case MANUFACTURING_STATUS = "manufacturing_status"; case MANUFACTURING_STATUS = "manufacturing_status";
case MPN = "manufacturer_product_number"; case MPN = "manufacturer_product_number";
case CUSTOM_PART_STATE = 'partCustomState';
case MASS = "mass"; case MASS = "mass";
case TAGS = "tags"; case TAGS = "tags";
case ATTACHMENTS = "attachments"; case ATTACHMENTS = "attachments";
@ -63,4 +64,4 @@ enum PartTableColumns : string implements TranslatableInterface
return $translator->trans($key, locale: $locale); return $translator->trans($key, locale: $locale);
} }
} }

View file

@ -67,7 +67,7 @@ class TableSettings
#[Assert\All([new Assert\Type(PartTableColumns::class)])] #[Assert\All([new Assert\Type(PartTableColumns::class)])]
public array $partsDefaultColumns = [PartTableColumns::NAME, PartTableColumns::DESCRIPTION, public array $partsDefaultColumns = [PartTableColumns::NAME, PartTableColumns::DESCRIPTION,
PartTableColumns::CATEGORY, PartTableColumns::FOOTPRINT, PartTableColumns::MANUFACTURER, PartTableColumns::CATEGORY, PartTableColumns::FOOTPRINT, PartTableColumns::MANUFACTURER,
PartTableColumns::LOCATION, PartTableColumns::AMOUNT]; PartTableColumns::LOCATION, PartTableColumns::AMOUNT, PartTableColumns::CUSTOM_PART_STATE];
/** @var AssemblyTableColumns[] */ /** @var AssemblyTableColumns[] */
#[SettingsParameter(ArrayType::class, #[SettingsParameter(ArrayType::class,

View file

@ -23,12 +23,11 @@ declare(strict_types=1);
namespace App\Tests\Controller\AdminPages; namespace App\Tests\Controller\AdminPages;
use App\Entity\Parts\PartCustomState; use App\Entity\Parts\PartCustomState;
use PHPUnit\Framework\Attributes\Group;
/** #[Group('slow')]
* @group slow #[Group('DB')]
* @group DB class PartCustomStateControllerTest extends AbstractAdminController
*/
class PartCustomStateControllerTest extends AbstractAdminControllerTest
{ {
protected static string $base_path = '/en/part_custom_state'; protected static string $base_path = '/en/part_custom_state';
protected static string $entity_class = PartCustomState::class; protected static string $entity_class = PartCustomState::class;

View file

@ -10374,7 +10374,7 @@ Element 3</target>
<target>Cílový inventář</target> <target>Cílový inventář</target>
</segment> </segment>
</unit> </unit>
<unit id="pyv0k6b" name="project.builds.number_of_builds"> <unit id="5DTAvWG" name="project.builds.number_of_builds">
<segment state="translated"> <segment state="translated">
<source>project.builds.number_of_builds</source> <source>project.builds.number_of_builds</source>
<target>Množství sestavy</target> <target>Množství sestavy</target>

View file

@ -1601,12 +1601,6 @@
<target>Προσαρμοσμένη κατάσταση εξαρτήματος</target> <target>Προσαρμοσμένη κατάσταση εξαρτήματος</target>
</segment> </segment>
</unit> </unit>
<unit id="G1hmQdb" name="part.table.partCustomState">
<segment state="translated">
<source>part.table.partCustomState</source>
<target>Προσαρμοσμένη κατάσταση μέρους</target>
</segment>
</unit>
<unit id="FV7YOW6" name="part.table.name.value.for_part"> <unit id="FV7YOW6" name="part.table.name.value.for_part">
<segment state="translated"> <segment state="translated">
<source>part.table.name.value.for_part</source> <source>part.table.name.value.for_part</source>