Compare commits

...

20 commits

Author SHA1 Message Date
Jan Böhmer
c1d4ce77db Fixed exception when digikey has no media available for a part
Some checks are pending
Build assets artifact / Build assets artifact (push) Waiting to run
Docker Image Build / docker (push) Waiting to run
Docker Image Build (FrankenPHP) / docker (push) Waiting to run
Static analysis / Static analysis (push) Waiting to run
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.2, mysql) (push) Waiting to run
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.3, mysql) (push) Waiting to run
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.4, mysql) (push) Waiting to run
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.5, mysql) (push) Waiting to run
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.2, postgres) (push) Waiting to run
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.3, postgres) (push) Waiting to run
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.4, postgres) (push) Waiting to run
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.5, postgres) (push) Waiting to run
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.2, sqlite) (push) Waiting to run
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.3, sqlite) (push) Waiting to run
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.4, sqlite) (push) Waiting to run
PHPUnit Tests / PHPUnit and coverage Test (PHP 8.5, sqlite) (push) Waiting to run
Makes PR #1154 obsolete
2026-01-04 17:50:24 +01:00
Jan Böhmer
bba3bd90a9 Merge remote-tracking branch 'origin/master' 2026-01-04 17:36:57 +01:00
Jan Böhmer
eaaf3ac75c Bring provider capabilities into a fixed order for better comparison
Fixes #1166 and made PR #1167 obsolete
2026-01-04 17:36:53 +01:00
Marc
8957e55a9e
Increase default height of the PDF preview container from 250px to 280px and so Chromium-based browsers display the PDF toolbar by default. Fixes #1165. (#1171) 2026-01-04 17:14:27 +01:00
dependabot[bot]
a232671302
Bump actions/upload-artifact from 5 to 6 (#1162)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 5 to 6.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-01-04 17:05:03 +01:00
Jan Böhmer
5a53423594 Merge remote-tracking branch 'origin/master' 2026-01-04 17:04:50 +01:00
Jan Böhmer
390206f529 Merge remote-tracking branch 'origin/l10n_master' 2026-01-04 17:04:44 +01:00
dependabot[bot]
74862c7bb8
Bump actions/cache from 4 to 5 (#1163)
Bumps [actions/cache](https://github.com/actions/cache) from 4 to 5.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-01-04 17:02:23 +01:00
fsbrc
0e61a84ea6
Allow to view part ID in project BOM
* added feature of part-id in project bom view

* Made part id column label translatable

---------

Co-authored-by: Jan Böhmer <mail@jan-boehmer.de>
2026-01-04 17:01:06 +01:00
Jan Böhmer
6fcdc0b0c3 New translations messages.en.xlf (English) 2025-12-07 14:12:08 +01:00
Jan Böhmer
225e347c24 New translations messages.en.xlf (English) 2025-12-06 23:32:23 +01:00
Jan Böhmer
fb805e2e0a New translations validators.en.xlf (English) 2025-12-05 00:40:29 +01:00
Jan Böhmer
8548237522 New translations messages.en.xlf (English) 2025-12-05 00:40:28 +01:00
Jan Böhmer
77819af9a8 New translations security.en.xlf (German) 2025-12-05 00:40:26 +01:00
Jan Böhmer
68217f50c4 New translations messages.en.xlf (English) 2025-12-03 22:01:49 +01:00
Jan Böhmer
d42f728fad New translations messages.en.xlf (English) 2025-12-02 00:13:06 +01:00
Jan Böhmer
b1210bc3b5 New translations messages.en.xlf (English) 2025-11-30 15:57:13 +01:00
Jan Böhmer
045362de0e New translations messages.en.xlf (English) 2025-11-30 14:53:03 +01:00
Jan Böhmer
6a5039326c New translations validators.en.xlf (English) 2025-11-12 22:31:26 +01:00
Jan Böhmer
bee1542cce New translations messages.en.xlf (English) 2025-11-12 22:31:25 +01:00
10 changed files with 83 additions and 45 deletions

View file

@ -37,7 +37,7 @@ jobs:
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v4
- uses: actions/cache@v5
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
@ -51,7 +51,7 @@ jobs:
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v4
- uses: actions/cache@v5
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
@ -80,13 +80,13 @@ jobs:
run: zip -r /tmp/partdb_assets.zip public/build/ vendor/
- name: Upload assets artifact
uses: actions/upload-artifact@v5
uses: actions/upload-artifact@v6
with:
name: Only dependencies and built assets
path: /tmp/partdb_assets.zip
- name: Upload full artifact
uses: actions/upload-artifact@v5
uses: actions/upload-artifact@v6
with:
name: Full Part-DB including dependencies and built assets
path: /tmp/partdb_with_assets.zip

View file

@ -34,7 +34,7 @@ jobs:
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v4
- uses: actions/cache@v5
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}

View file

@ -81,7 +81,7 @@ jobs:
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v4
- uses: actions/cache@v5
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
@ -92,7 +92,7 @@ jobs:
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v4
- uses: actions/cache@v5
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}

View file

@ -29,6 +29,7 @@ use App\DataTables\Helpers\PartDataTableHelper;
use App\Entity\Attachments\Attachment;
use App\Entity\Parts\Part;
use App\Entity\ProjectSystem\ProjectBOMEntry;
use App\Services\ElementTypeNameGenerator;
use App\Services\EntityURLGenerator;
use App\Services\Formatters\AmountFormatter;
use Doctrine\ORM\QueryBuilder;
@ -41,7 +42,8 @@ use Symfony\Contracts\Translation\TranslatorInterface;
class ProjectBomEntriesDataTable implements DataTableTypeInterface
{
public function __construct(protected TranslatorInterface $translator, protected PartDataTableHelper $partDataTableHelper, protected EntityURLGenerator $entityURLGenerator, protected AmountFormatter $amountFormatter)
public function __construct(protected TranslatorInterface $translator, protected PartDataTableHelper $partDataTableHelper,
protected EntityURLGenerator $entityURLGenerator, protected AmountFormatter $amountFormatter, private readonly ElementTypeNameGenerator $elementTypeNameGenerator)
{
}
@ -79,7 +81,14 @@ class ProjectBomEntriesDataTable implements DataTableTypeInterface
return htmlspecialchars($this->amountFormatter->format($context->getQuantity(), $context->getPart()->getPartUnit()));
},
])
->add('partId', TextColumn::class, [
'label' => $this->translator->trans('project.bom.part_id'),
'visible' => true,
'orderField' => 'part.id',
'render' => function ($value, ProjectBOMEntry $context) {
return $context->getPart() instanceof Part ? (string) $context->getPart()->getId() : '';
},
])
->add('name', TextColumn::class, [
'label' => $this->translator->trans('part.table.name'),
'orderField' => 'NATSORT(part.name)',

View file

@ -311,6 +311,14 @@ class DigikeyProvider implements InfoProviderInterface
'auth_bearer' => $this->authTokenManager->getAlwaysValidTokenString(self::OAUTH_APP_NAME)
]);
if ($response->getStatusCode() === 404) {
//No media found
return [
'datasheets' => [],
'images' => [],
];
}
$media_array = $response->toArray();
foreach ($media_array['MediaLinks'] as $media_link) {

View file

@ -31,9 +31,6 @@ enum ProviderCapabilities
/** Basic information about a part, like the name, description, part number, manufacturer etc */
case BASIC;
/** Information about the footprint of a part */
case FOOTPRINT;
/** Provider can provide a picture for a part */
case PICTURE;
@ -43,6 +40,24 @@ enum ProviderCapabilities
/** Provider can provide prices for a part */
case PRICE;
/** Information about the footprint of a part */
case FOOTPRINT;
/**
* Get the order index for displaying capabilities in a stable order.
* @return int
*/
public function getOrderIndex(): int
{
return match($this) {
self::BASIC => 1,
self::PICTURE => 2,
self::DATASHEET => 3,
self::PRICE => 4,
self::FOOTPRINT => 5,
};
}
public function getTranslationKey(): string
{
return 'info_providers.capabilities.' . match($this) {

View file

@ -27,7 +27,7 @@
title="{% trans %}info_providers.settings.title{% endtrans %}"
><i class="fa-solid fa-cog"></i></a>
{% endif %}
{% for capability in provider.capabilities %}
{% for capability in provider.capabilities|sort((a, b) => a.orderIndex <=> b.orderIndex) %}
{# @var capability \App\Services\InfoProviderSystem\Providers\ProviderCapabilities #}
<span class="badge text-bg-secondary">
<i class="{{ capability.fAIconClass }} fa-fw"></i>

View file

@ -135,8 +135,8 @@
{% block additional_content %}
{% if pdf_data %}
<div class="card mt-2 p-1 border-secondary" style="resize: vertical; overflow: scroll; height: 250px">
<object id="pdf_preview" data="{{ pdf_data | data_uri(mime='application/pdf') }}"style="height: inherit">
<div class="card mt-2 p-1 border-secondary" style="resize: vertical; overflow: scroll; height: 280px">
<object id="pdf_preview" data="{{ pdf_data | data_uri(mime='application/pdf') }}" style="height: inherit">
</object>
</div>
{% endif %}

View file

@ -1,4 +1,4 @@
<?xml version='1.0' encoding='utf-8'?>
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:2.0" version="2.0" srcLang="en" trgLang="en">
<file id="messages.en">
<unit id="x_wTSQS" name="attachment_type.caption">
@ -14032,128 +14032,128 @@ You can do this in the provider info list.</target>
</segment>
</unit>
<unit id="L4nq52R" name="settings.misc.ipn_suggest.useDuplicateDescription.help">
<segment>
<segment state="translated">
<source>settings.misc.ipn_suggest.useDuplicateDescription.help</source>
<target>When enabled, the parts description is used to find existing parts with the same description and to determine the next available IPN by incrementing their numeric suffix for the suggestion list.</target>
</segment>
</unit>
<unit id="NIw6dtz" name="settings.misc.ipn_suggest.regex.help">
<segment>
<segment state="translated">
<source>settings.misc.ipn_suggest.regex.help</source>
<target>A PCRE-compatible regular expression every IPN has to fulfill. Leave empty to allow everything as IPN.</target>
</segment>
</unit>
<unit id="MoHHSNT" name="user.labelp">
<segment>
<segment state="translated">
<source>user.labelp</source>
<target>Users</target>
</segment>
</unit>
<unit id="5.oI1XD" name="currency.labelp">
<segment>
<segment state="translated">
<source>currency.labelp</source>
<target>Currencies</target>
</segment>
</unit>
<unit id="8F2EwVK" name="measurement_unit.labelp">
<segment>
<segment state="translated">
<source>measurement_unit.labelp</source>
<target>Measurement units</target>
</segment>
</unit>
<unit id="hYrcka2" name="attachment_type.labelp">
<segment>
<segment state="translated">
<source>attachment_type.labelp</source>
<target>Attachment types</target>
</segment>
</unit>
<unit id="p.Sjja3" name="label_profile.labelp">
<segment>
<segment state="translated">
<source>label_profile.labelp</source>
<target>Label profiles</target>
</segment>
</unit>
<unit id="Y_ISV0y" name="part_custom_state.labelp">
<segment>
<segment state="translated">
<source>part_custom_state.labelp</source>
<target>Custom part states</target>
</segment>
</unit>
<unit id="aXr7mN." name="group.labelp">
<segment>
<segment state="translated">
<source>group.labelp</source>
<target>Groups</target>
</segment>
</unit>
<unit id="O10voez" name="settings.synonyms.type_synonym.type">
<segment>
<segment state="translated">
<source>settings.synonyms.type_synonym.type</source>
<target>Type</target>
</segment>
</unit>
<unit id="1BDQVEp" name="settings.synonyms.type_synonym.language">
<segment>
<segment state="translated">
<source>settings.synonyms.type_synonym.language</source>
<target>Language</target>
</segment>
</unit>
<unit id="2.g2ewQ" name="settings.synonyms.type_synonym.translation_singular">
<segment>
<segment state="translated">
<source>settings.synonyms.type_synonym.translation_singular</source>
<target>Translation Singular</target>
</segment>
</unit>
<unit id="Up9ZhvR" name="settings.synonyms.type_synonym.translation_plural">
<segment>
<segment state="translated">
<source>settings.synonyms.type_synonym.translation_plural</source>
<target>Translation Plural</target>
</segment>
</unit>
<unit id="BHoS230" name="settings.synonyms.type_synonym.add_entry">
<segment>
<segment state="translated">
<source>settings.synonyms.type_synonym.add_entry</source>
<target>Add entry</target>
</segment>
</unit>
<unit id="wvtOEBn" name="settings.synonyms.type_synonym.remove_entry">
<segment>
<segment state="translated">
<source>settings.synonyms.type_synonym.remove_entry</source>
<target>Remove entry</target>
</segment>
</unit>
<unit id="mLu.2F2" name="settings.synonyms">
<segment>
<segment state="translated">
<source>settings.synonyms</source>
<target>Synonyms</target>
</segment>
</unit>
<unit id="SHgc9i." name="settings.synonyms.help">
<segment>
<segment state="translated">
<source>settings.synonyms.help</source>
<target>The synonyms systems allow overriding how Part-DB call certain things. This can be useful, especially if Part-DB is used in a different context than electronics.
Please note that this system is currently experimental, and the synonyms defined here might not show up at all places.</target>
</segment>
</unit>
<unit id="piB78W5" name="settings.synonyms.type_synonyms">
<segment>
<segment state="translated">
<source>settings.synonyms.type_synonyms</source>
<target>Type synonyms</target>
</segment>
</unit>
<unit id="J8T2HuD" name="settings.synonyms.type_synonyms.help">
<segment>
<segment state="translated">
<source>settings.synonyms.type_synonyms.help</source>
<target>Type synonyms allow you to replace the labels of built-in data types. For example, you can rename "Footprint" to something else.</target>
</segment>
</unit>
<unit id="wjcsjzT" name="log.element_edited.changed_fields.part_ipn_prefix">
<segment>
<segment state="translated">
<source>log.element_edited.changed_fields.part_ipn_prefix</source>
<target>IPN prefix</target>
</segment>
</unit>
<unit id="R4hoCqe" name="part.labelp">
<segment>
<segment state="translated">
<source>part.labelp</source>
<target>Parts</target>
</segment>
@ -14279,13 +14279,19 @@ Please note that this system is currently experimental, and the synonyms defined
</segment>
</unit>
<unit id="MxKRRx_" name="datatable.datatable.lengthMenu">
<notes>
<note priority="1">Do not remove! Used for datatables rendering.</note>
</notes>
<segment state="translated">
<source>datatable.datatable.lengthMenu</source>
<target>_MENU_</target>
</segment>
<notes>
<note priority="1">Do not remove! Used for datatables rendering.</note>
</notes>
<segment state="translated">
<source>datatable.datatable.lengthMenu</source>
<target>_MENU_</target>
</segment>
</unit>
<unit id="8BkjGyq" name="project.bom.part_id">
<segment>
<source>project.bom.part_id</source>
<target>[Part] ID</target>
</segment>
</unit>
</file>
</xliff>

View file

@ -366,7 +366,7 @@
</segment>
</unit>
<unit id="I330cr5" name="settings.synonyms.type_synonyms.collection_type.duplicate">
<segment>
<segment state="translated">
<source>settings.synonyms.type_synonyms.collection_type.duplicate</source>
<target>There is already a translation defined for this type and language!</target>
</segment>