Allow to set basic data via import

This commit is contained in:
Jan Böhmer 2023-03-12 20:01:29 +01:00
parent 7a9b7c87a4
commit 85ae862381
5 changed files with 12 additions and 12 deletions

View file

@ -35,14 +35,14 @@ trait AdvancedPropertyTrait
/**
* @var bool Determines if this part entry needs review (for example, because it is work in progress)
* @ORM\Column(type="boolean")
* @Groups({"extended", "full"})
* @Groups({"extended", "full", "import"})
*/
protected bool $needs_review = false;
/**
* @var string a comma separated list of tags, associated with the part
* @ORM\Column(type="text")
* @Groups({"extended", "full"})
* @Groups({"extended", "full", "import"})
*/
protected string $tags = '';
@ -50,7 +50,7 @@ trait AdvancedPropertyTrait
* @var float|null how much a single part unit weighs in grams
* @ORM\Column(type="float", nullable=true)
* @Assert\PositiveOrZero()
* @Groups({"extended", "full"})
* @Groups({"extended", "full", "import"})
*/
protected ?float $mass = null;
@ -58,7 +58,7 @@ trait AdvancedPropertyTrait
* @var string The internal part number of the part
* @ORM\Column(type="string", length=100, nullable=true, unique=true)
* @Assert\Length(max="100")
* @Groups({"extended", "full"})
* @Groups({"extended", "full", "ipn"})
*/
protected ?string $ipn = null;

View file

@ -34,14 +34,14 @@ trait BasicPropertyTrait
/**
* @var string A text describing what this part does
* @ORM\Column(type="text")
* @Groups({"simple", "extended", "full"})
* @Groups({"simple", "extended", "full", "import"})
*/
protected string $description = '';
/**
* @var string A comment/note related to this part
* @ORM\Column(type="text")
* @Groups({"extended", "full"})
* @Groups({"extended", "full", "import"})
*/
protected string $comment = '';
@ -54,7 +54,7 @@ trait BasicPropertyTrait
/**
* @var bool true, if the part is marked as favorite
* @ORM\Column(type="boolean")
* @Groups({"extended", "full"})
* @Groups({"extended", "full", "import"})
*/
protected bool $favorite = false;

View file

@ -48,7 +48,7 @@ trait InstockTrait
* Given in the partUnit.
* @ORM\Column(type="float")
* @Assert\PositiveOrZero()
* @Groups({"extended", "full"})
* @Groups({"extended", "full", "import"})
*/
protected float $minamount = 0;

View file

@ -47,14 +47,14 @@ trait ManufacturerTrait
* @var string the url to the part on the manufacturer's homepage
* @ORM\Column(type="string")
* @Assert\Url()
* @Groups({"full"})
* @Groups({"full", "import"})
*/
protected string $manufacturer_product_url = '';
/**
* @var string The product number used by the manufacturer. If this is set to "", the name field is used.
* @ORM\Column(type="string")
* @Groups({"extended", "full"})
* @Groups({"extended", "full", "import"})
*/
protected string $manufacturer_product_number = '';
@ -62,7 +62,7 @@ trait ManufacturerTrait
* @var string The production status of this part. Can be one of the specified ones.
* @ORM\Column(type="string", length=255, nullable=true)
* @Assert\Choice({"announced", "active", "nrfnd", "eol", "discontinued", ""})
* @Groups({"extended", "full"})
* @Groups({"extended", "full", "import"})
*/
protected ?string $manufacturing_status = '';

View file

@ -28,7 +28,7 @@
<ul>
{% for entity in imported_entities %}
{# @var \App\Entity\Parts\Part entity #}
<li><a href="{{ entity_url(entity) }}">{{ entity.name }}</a></li>
<li><a href="{{ entity_url(entity) }}">{{ entity.name }}</a> (ID: {{ entity.iD }})</li>
{% endfor %}
{% endif %}
{% endblock %}