Skip to content

Commit e75e0c4

Browse files
committed
Add a link to the category part info as category description in KiCAD.
This also fixes issue #878
1 parent e94d4a7 commit e75e0c4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Services/EDA/KiCadHelper.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
use App\Entity\Parts\Footprint;
2828
use App\Entity\Parts\Part;
2929
use App\Services\Cache\ElementCacheTagGenerator;
30+
use App\Services\EntityURLGenerator;
3031
use App\Services\Trees\NodesListBuilder;
3132
use Doctrine\ORM\EntityManagerInterface;
3233
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
@@ -44,6 +45,7 @@ public function __construct(
4445
private readonly EntityManagerInterface $em,
4546
private readonly ElementCacheTagGenerator $tagGenerator,
4647
private readonly UrlGeneratorInterface $urlGenerator,
48+
private readonly EntityURLGenerator $entityURLGenerator,
4749
private readonly TranslatorInterface $translator,
4850
/** The maximum level of the shown categories. 0 Means only the top level categories are shown. -1 means only a single one containing */
4951
private readonly int $category_depth,
@@ -108,6 +110,8 @@ public function getCategories(): array
108110
$result[] = [
109111
'id' => (string)$category->getId(),
110112
'name' => $category->getFullPath('/'),
113+
//Show the category link as the category description, this also fixes an segfault in KiCad see issue #878
114+
'description' => $this->entityURLGenerator->listPartsURL($category),
111115
];
112116
}
113117

0 commit comments

Comments
 (0)