Preparations for bulk editing of tags

Made "target" parameter of handleAction in parts table a string
Sanitize input for exisitng action which expect an int
Add tag (dummy) to SelectAPI
Add tag option to twig template
This commit is contained in:
d-buchmann 2025-05-22 14:43:05 +02:00
parent b8d5b83eee
commit 334a37a9d0
4 changed files with 40 additions and 2 deletions

View file

@ -33,6 +33,7 @@ use App\Entity\Parts\StorageLocation;
use App\Entity\ProjectSystem\Project;
use App\Form\Type\Helper\StructuralEntityChoiceHelper;
use App\Services\Trees\NodesListBuilder;
use App\ApiPlatform\Filter\TagFilter;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
@ -49,6 +50,20 @@ class SelectAPIController extends AbstractController
{
}
#[Route(path: '/tag', name: 'select_tag')]
public function tag(): Response
{
$tags = [
'text' => 'test',
'value' => 'test',
];
$this->addEmptyNode($tags);
// pseudocode:
// for each part in selection
// use TagFilter to find tags
// dedupe
return $this->json($tags);
#[Route(path: '/category', name: 'select_category')]
public function category(): Response
{