mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-03-04 14:29:35 +00:00
Compare commits
20 commits
3e380f82d2
...
c1d4ce77db
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c1d4ce77db | ||
|
|
bba3bd90a9 | ||
|
|
eaaf3ac75c | ||
|
|
8957e55a9e | ||
|
|
a232671302 | ||
|
|
5a53423594 | ||
|
|
390206f529 | ||
|
|
74862c7bb8 | ||
|
|
0e61a84ea6 | ||
|
|
6fcdc0b0c3 | ||
|
|
225e347c24 | ||
|
|
fb805e2e0a | ||
|
|
8548237522 | ||
|
|
77819af9a8 | ||
|
|
68217f50c4 | ||
|
|
d42f728fad | ||
|
|
b1210bc3b5 | ||
|
|
045362de0e | ||
|
|
6a5039326c | ||
|
|
bee1542cce |
10 changed files with 83 additions and 45 deletions
8
.github/workflows/assets_artifact_build.yml
vendored
8
.github/workflows/assets_artifact_build.yml
vendored
|
|
@ -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
|
||||
|
|
|
|||
2
.github/workflows/static_analysis.yml
vendored
2
.github/workflows/static_analysis.yml
vendored
|
|
@ -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') }}
|
||||
|
|
|
|||
4
.github/workflows/tests.yml
vendored
4
.github/workflows/tests.yml
vendored
|
|
@ -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 }}
|
||||
|
|
|
|||
|
|
@ -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)',
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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 %}
|
||||
|
|
|
|||
|
|
@ -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 part’s 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>
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue