mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-06-30 06:21:33 +00:00
Compare commits
6 commits
ae08d9539d
...
eaaf44b391
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eaaf44b391 | ||
|
|
a48490ac1a | ||
|
|
cb63b3bde7 | ||
|
|
f48791e961 | ||
|
|
a75a60fecd | ||
|
|
ac89489202 |
33 changed files with 261 additions and 69 deletions
4
.env
4
.env
|
|
@ -129,10 +129,6 @@ NO_URL_REWRITE_AVAILABLE=0
|
|||
# Set to 1, if Part-DB should redirect all HTTP requests to HTTPS. You dont need to configure this, if your webserver already does this.
|
||||
REDIRECT_TO_HTTPS=0
|
||||
|
||||
# Override value if you want to show to show a given text on homepage.
|
||||
# When this is empty the content of config/banner.md is used as banner
|
||||
BANNER=""
|
||||
|
||||
# Set this to zero, if you want to disable the year 2038 bug check on 32-bit systems (it will cause errors with current 32-bit PHP versions)
|
||||
DISABLE_YEAR2038_BUG_CHECK=0
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,14 @@
|
|||
{
|
||||
"controllers": {
|
||||
"@symfony/ux-toggle-password": {
|
||||
"toggle-password": {
|
||||
"enabled": true,
|
||||
"fetch": "eager",
|
||||
"autoimport": {
|
||||
"@symfony/ux-toggle-password/dist/style.min.css": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"@symfony/ux-turbo": {
|
||||
"turbo-core": {
|
||||
"enabled": true,
|
||||
|
|
|
|||
|
|
@ -120,4 +120,11 @@ ins {
|
|||
del {
|
||||
background-color: #f09595;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
/****************************************
|
||||
* Password toggle
|
||||
****************************************/
|
||||
.toggle-password-button {
|
||||
top: 0.7rem !important;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
"hshn/base64-encoded-file": "^5.0",
|
||||
"jbtronics/2fa-webauthn": "^3.0.0",
|
||||
"jbtronics/dompdf-font-loader-bundle": "^1.0.0",
|
||||
"jbtronics/settings-bundle": "^v2.7.0",
|
||||
"jbtronics/settings-bundle": "^3.0.0",
|
||||
"jfcherng/php-diff": "^6.14",
|
||||
"knpuniversity/oauth2-client-bundle": "^2.15",
|
||||
"league/commonmark": "^2.7",
|
||||
|
|
@ -80,6 +80,7 @@
|
|||
"symfony/string": "7.3.*",
|
||||
"symfony/translation": "7.3.*",
|
||||
"symfony/twig-bundle": "7.3.*",
|
||||
"symfony/ux-toggle-password": "^2.29",
|
||||
"symfony/ux-translator": "^2.10",
|
||||
"symfony/ux-turbo": "^2.0",
|
||||
"symfony/validator": "7.3.*",
|
||||
|
|
|
|||
98
composer.lock
generated
98
composer.lock
generated
|
|
@ -4,7 +4,7 @@
|
|||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "2b0f46c3211d452d6bbd71a38ece8cbd",
|
||||
"content-hash": "3b97b6338827ba56e0404860f3e98359",
|
||||
"packages": [
|
||||
{
|
||||
"name": "amphp/amp",
|
||||
|
|
@ -5090,16 +5090,16 @@
|
|||
},
|
||||
{
|
||||
"name": "jbtronics/settings-bundle",
|
||||
"version": "v2.7.0",
|
||||
"version": "v3.0.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/jbtronics/settings-bundle.git",
|
||||
"reference": "2f579554d52b3d5226b8569ccd13988f6403f6af"
|
||||
"reference": "34b9629af73c7ad8989d8284470e79f3f8d79712"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/jbtronics/settings-bundle/zipball/2f579554d52b3d5226b8569ccd13988f6403f6af",
|
||||
"reference": "2f579554d52b3d5226b8569ccd13988f6403f6af",
|
||||
"url": "https://api.github.com/repos/jbtronics/settings-bundle/zipball/34b9629af73c7ad8989d8284470e79f3f8d79712",
|
||||
"reference": "34b9629af73c7ad8989d8284470e79f3f8d79712",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
|
@ -5160,7 +5160,7 @@
|
|||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/jbtronics/settings-bundle/issues",
|
||||
"source": "https://github.com/jbtronics/settings-bundle/tree/v2.7.0"
|
||||
"source": "https://github.com/jbtronics/settings-bundle/tree/v3.0.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
|
|
@ -5172,7 +5172,7 @@
|
|||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2025-08-15T22:13:15+00:00"
|
||||
"time": "2025-08-24T17:17:43+00:00"
|
||||
},
|
||||
{
|
||||
"name": "jfcherng/php-color-output",
|
||||
|
|
@ -15188,6 +15188,90 @@
|
|||
],
|
||||
"time": "2025-06-27T19:55:54+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/ux-toggle-password",
|
||||
"version": "v2.29.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/ux-toggle-password.git",
|
||||
"reference": "ea74e8611e30979d9ec9b4c29d194f18a460a781"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/ux-toggle-password/zipball/ea74e8611e30979d9ec9b4c29d194f18a460a781",
|
||||
"reference": "ea74e8611e30979d9ec9b4c29d194f18a460a781",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=8.1",
|
||||
"symfony/config": "^5.4|^6.0|^7.0|^8.0",
|
||||
"symfony/dependency-injection": "^5.4|^6.0|^7.0|^8.0",
|
||||
"symfony/form": "^5.4|^6.0|^7.0|^8.0",
|
||||
"symfony/http-kernel": "^5.4|^6.0|^7.0|^8.0",
|
||||
"symfony/options-resolver": "^5.4|^6.0|^7.0|^8.0",
|
||||
"symfony/translation": "^5.4|^6.0|^7.0|^8.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/framework-bundle": "^5.4|^6.0|^7.0|^8.0",
|
||||
"symfony/phpunit-bridge": "^5.4|^6.0|^7.0|^8.0",
|
||||
"symfony/twig-bundle": "^5.4|^6.0|^7.0|^8.0",
|
||||
"symfony/var-dumper": "^5.4|^6.0|^7.0|^8.0",
|
||||
"twig/twig": "^2.14.7|^3.0.4"
|
||||
},
|
||||
"type": "symfony-bundle",
|
||||
"extra": {
|
||||
"thanks": {
|
||||
"url": "https://github.com/symfony/ux",
|
||||
"name": "symfony/ux"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Symfony\\UX\\TogglePassword\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Félix Eymonot",
|
||||
"email": "felix.eymonot@alximy.io"
|
||||
},
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "https://symfony.com/contributors"
|
||||
}
|
||||
],
|
||||
"description": "Toggle visibility of password inputs for Symfony Forms",
|
||||
"homepage": "https://symfony.com",
|
||||
"keywords": [
|
||||
"symfony-ux"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/ux-toggle-password/tree/v2.29.2"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://symfony.com/sponsor",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/fabpot",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/nicolas-grekas",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2025-08-18T09:13:24+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/ux-translator",
|
||||
"version": "v2.29.2",
|
||||
|
|
|
|||
|
|
@ -1,14 +1,4 @@
|
|||
Welcome to Part-DB.
|
||||
|
||||
<small>If you want to change this banner, edit `config/banner.md` file or set the `BANNER` environment variable.</small>
|
||||
**Attention**:
|
||||
Since Version 2.0.0 this file is no longer used.
|
||||
|
||||
<blockquote class="pb-0">
|
||||
<p style="font-size: 12px">
|
||||
And God said <br>
|
||||
$\nabla \cdot \vec{D} = \rho$,
|
||||
$\nabla \cdot \vec{B} = 0$,
|
||||
$\nabla \times \vec{E} = -\frac{\partial \vec{B}}{\partial t}$,
|
||||
$\nabla \times \vec{H} = \vec{j} + \frac{\partial \vec{D}}{\partial t}$, <br>
|
||||
and then there was light.
|
||||
</p>
|
||||
</blockquote>
|
||||
You can now set the banner text directly in the admin interface, or by setting the `BANNER` environment variable.
|
||||
|
|
|
|||
|
|
@ -33,4 +33,5 @@ return [
|
|||
Jbtronics\SettingsBundle\JbtronicsSettingsBundle::class => ['all' => true],
|
||||
Jbtronics\TranslationEditorBundle\JbtronicsTranslationEditorBundle::class => ['dev' => true],
|
||||
ApiPlatform\Symfony\Bundle\ApiPlatformBundle::class => ['all' => true],
|
||||
Symfony\UX\TogglePassword\TogglePasswordBundle::class => ['all' => true],
|
||||
];
|
||||
|
|
|
|||
|
|
@ -90,7 +90,6 @@ parameters:
|
|||
env(ERROR_PAGE_SHOW_HELP): 1
|
||||
|
||||
env(DEMO_MODE): 0
|
||||
env(BANNER): ''
|
||||
|
||||
|
||||
env(EMAIL_SENDER_EMAIL): 'noreply@partdb.changeme'
|
||||
|
|
|
|||
|
|
@ -24,4 +24,9 @@ easily upgrade your system to the new requirements. Otherwise, you can use the o
|
|||
ships all required dependencies and is always up to date with the latest requirements, so that you do not have to worry
|
||||
about the requirements at all.
|
||||
|
||||
|
||||
## Changes
|
||||
* The `config/banner.md` file that could been used to customize the banner text, was removed. You can now set the banner text
|
||||
directly in the admin interface, or by setting the `BANNER` environment variable. If you want to keep your existing
|
||||
banner text, you will have to copy it from the `config/banner.md` file to the admin interface or set the `BANNER`
|
||||
environment variable.
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
"@hotwired/turbo": "^8.0.1",
|
||||
"@popperjs/core": "^2.10.2",
|
||||
"@symfony/stimulus-bridge": "^4.0.0",
|
||||
"@symfony/ux-toggle-password": "file:vendor/symfony/ux-toggle-password/assets",
|
||||
"@symfony/ux-translator": "file:vendor/symfony/ux-translator/assets",
|
||||
"@symfony/ux-turbo": "file:vendor/symfony/ux-turbo/assets",
|
||||
"@symfony/webpack-encore": "^5.0.0",
|
||||
|
|
|
|||
|
|
@ -33,6 +33,8 @@ use Symfony\Component\HttpFoundation\Response;
|
|||
use Symfony\Component\Routing\Attribute\Route;
|
||||
use Symfony\Contracts\Cache\TagAwareCacheInterface;
|
||||
|
||||
use function Symfony\Component\Translation\t;
|
||||
|
||||
class SettingsController extends AbstractController
|
||||
{
|
||||
public function __construct(private readonly SettingsManagerInterface $settingsManager, private readonly SettingsFormFactoryInterface $settingsFormFactory)
|
||||
|
|
@ -63,6 +65,12 @@ class SettingsController extends AbstractController
|
|||
|
||||
//It might be possible, that the tree settings have changed, so clear the cache
|
||||
$cache->invalidateTags(['tree_treeview', 'sidebar_tree_update']);
|
||||
|
||||
$this->addFlash('success', t('settings.flash.saved'));
|
||||
}
|
||||
|
||||
if ($form->isSubmitted() && !$form->isValid()) {
|
||||
$this->addFlash('error', t('settings.flash.invalid'));
|
||||
}
|
||||
|
||||
//Render the form
|
||||
|
|
@ -70,4 +78,4 @@ class SettingsController extends AbstractController
|
|||
'form' => $form
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
54
src/Form/Type/APIKeyType.php
Normal file
54
src/Form/Type/APIKeyType.php
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
<?php
|
||||
/*
|
||||
* This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony).
|
||||
*
|
||||
* Copyright (C) 2019 - 2025 Jan Böhmer (https://github.com/jbtronics)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published
|
||||
* by the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
|
||||
namespace App\Form\Type;
|
||||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\PasswordType;
|
||||
use Symfony\Component\Form\FormInterface;
|
||||
use Symfony\Component\Form\FormView;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class APIKeyType extends AbstractType
|
||||
{
|
||||
public function getParent(): string
|
||||
{
|
||||
return PasswordType::class;
|
||||
}
|
||||
|
||||
public function buildView(FormView $view, FormInterface $form, array $options): void
|
||||
{
|
||||
//Ensure that the field is never empty
|
||||
$view->vars['value'] = $form->getViewData();
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'always_empty' => false,
|
||||
'toggle' => true,
|
||||
'empty_data' => null,
|
||||
'attr' => ['autocomplete' => 'off'],
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
@ -78,7 +78,7 @@ class DigikeyProvider implements InfoProviderInterface
|
|||
'description' => 'This provider uses the DigiKey API to search for parts.',
|
||||
'url' => 'https://www.digikey.com/',
|
||||
'oauth_app_name' => self::OAUTH_APP_NAME,
|
||||
'disabled_help' => 'Set the PROVIDER_DIGIKEY_CLIENT_ID and PROVIDER_DIGIKEY_SECRET env option and connect OAuth to enable.'
|
||||
'disabled_help' => 'Set the Client ID and Secret in provider settings and connect OAuth to enable.'
|
||||
];
|
||||
}
|
||||
|
||||
|
|
@ -101,7 +101,7 @@ class DigikeyProvider implements InfoProviderInterface
|
|||
public function isActive(): bool
|
||||
{
|
||||
//The client ID has to be set and a token has to be available (user clicked connect)
|
||||
return $this->settings->clientId !== '' && $this->authTokenManager->hasToken(self::OAUTH_APP_NAME);
|
||||
return $this->settings->clientId !== null && $this->settings->clientId !== '' && $this->authTokenManager->hasToken(self::OAUTH_APP_NAME);
|
||||
}
|
||||
|
||||
public function searchByKeyword(string $keyword): array
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ class Element14Provider implements InfoProviderInterface
|
|||
'name' => 'Farnell element14',
|
||||
'description' => 'This provider uses the Farnell element14 API to search for parts.',
|
||||
'url' => 'https://www.element14.com/',
|
||||
'disabled_help' => 'Configure the API key in the PROVIDER_ELEMENT14_KEY environment variable to enable.'
|
||||
'disabled_help' => 'Configure the API key in the provider settings to enable.'
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ class LCSCProvider implements InfoProviderInterface
|
|||
'name' => 'LCSC',
|
||||
'description' => 'This provider uses the (unofficial) LCSC API to search for parts.',
|
||||
'url' => 'https://www.lcsc.com/',
|
||||
'disabled_help' => 'Set PROVIDER_LCSC_ENABLED to 1 (or true) in your environment variable config.'
|
||||
'disabled_help' => 'Enable this provider in the provider settings.'
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ class MouserProvider implements InfoProviderInterface
|
|||
'name' => 'Mouser',
|
||||
'description' => 'This provider uses the Mouser API to search for parts.',
|
||||
'url' => 'https://www.mouser.com/',
|
||||
'disabled_help' => 'Configure the API key in the PROVIDER_MOUSER_KEY environment variable to enable.'
|
||||
'disabled_help' => 'Configure the API key in the provider settings to enable.'
|
||||
];
|
||||
}
|
||||
|
||||
|
|
@ -345,4 +345,4 @@ class MouserProvider implements InfoProviderInterface
|
|||
|
||||
return $tmp;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -246,7 +246,7 @@ class OEMSecretsProvider implements InfoProviderInterface
|
|||
'name' => 'OEMSecrets',
|
||||
'description' => 'This provider uses the OEMSecrets API to search for parts.',
|
||||
'url' => 'https://www.oemsecrets.com/',
|
||||
'disabled_help' => 'Configure the API key in the PROVIDER_OEMSECRETS_KEY environment variable to enable.'
|
||||
'disabled_help' => 'Configure the API key in the provider settings to enable.'
|
||||
];
|
||||
}
|
||||
/**
|
||||
|
|
@ -265,7 +265,7 @@ class OEMSecretsProvider implements InfoProviderInterface
|
|||
*/
|
||||
public function isActive(): bool
|
||||
{
|
||||
return $this->settings->apiKey !== '';
|
||||
return $this->settings->apiKey !== null && $this->settings->apiKey !== '';
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -285,18 +285,18 @@ class OEMSecretsProvider implements InfoProviderInterface
|
|||
public function searchByKeyword(string $keyword): array
|
||||
{
|
||||
/*
|
||||
oemsecrets Part Search API 3.0.1
|
||||
oemsecrets Part Search API 3.0.1
|
||||
|
||||
"https://oemsecretsapi.com/partsearch?
|
||||
searchTerm=BC547
|
||||
&apiKey=icawpb0bspoo2c6s64uv4vpdfp2vgr7e27bxw0yct2bzh87mpl027x353uelpq2x
|
||||
¤cy=EUR
|
||||
&countryCode=IT"
|
||||
|
||||
&countryCode=IT"
|
||||
|
||||
partsearch description:
|
||||
Use the Part Search API to find distributor data for a full or partial manufacturer
|
||||
Use the Part Search API to find distributor data for a full or partial manufacturer
|
||||
part number including part details, pricing, compliance and inventory.
|
||||
|
||||
|
||||
Required Parameter Format Description
|
||||
searchTerm string Part number you are searching for
|
||||
apiKey string Your unique API key provided to you by OEMsecrets
|
||||
|
|
@ -304,14 +304,14 @@ class OEMSecretsProvider implements InfoProviderInterface
|
|||
Additional Parameter Format Description
|
||||
countryCode string The country you want to output for
|
||||
currency string / array The currency you want the prices to be displayed as
|
||||
|
||||
|
||||
To display the output for GB and to view prices in USD, add [ countryCode=GB ] and [ currency=USD ]
|
||||
as seen below:
|
||||
oemsecretsapi.com/partsearch?apiKey=abcexampleapikey123&searchTerm=bd04&countryCode=GB¤cy=USD
|
||||
|
||||
|
||||
To view prices in both USD and GBP add [ currency[]=USD¤cy[]=GBP ]
|
||||
oemsecretsapi.com/partsearch?searchTerm=bd04&apiKey=abcexampleapikey123¤cy[]=USD¤cy[]=GBP
|
||||
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
|
@ -1465,4 +1465,4 @@ class OEMSecretsProvider implements InfoProviderInterface
|
|||
return $url;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -170,7 +170,7 @@ class OctopartProvider implements InfoProviderInterface
|
|||
'name' => 'Octopart',
|
||||
'description' => 'This provider uses the Nexar/Octopart API to search for parts on Octopart.',
|
||||
'url' => 'https://www.octopart.com/',
|
||||
'disabled_help' => 'Set the PROVIDER_OCTOPART_CLIENT_ID and PROVIDER_OCTOPART_SECRET env option.'
|
||||
'disabled_help' => 'Set the Client ID and Secret in provider settings.'
|
||||
];
|
||||
}
|
||||
|
||||
|
|
@ -183,7 +183,8 @@ class OctopartProvider implements InfoProviderInterface
|
|||
{
|
||||
//The client ID has to be set and a token has to be available (user clicked connect)
|
||||
//return /*!empty($this->clientId) && */ $this->authTokenManager->hasToken(self::OAUTH_APP_NAME);
|
||||
return $this->settings->clientId !== '' && $this->settings->secret !== '';
|
||||
return $this->settings->clientId !== null && $this->settings->clientId !== ''
|
||||
&& $this->settings->secret !== null && $this->settings->secret !== '';
|
||||
}
|
||||
|
||||
private function mapLifeCycleStatus(?string $value): ?ManufacturingStatus
|
||||
|
|
@ -337,7 +338,7 @@ class OctopartProvider implements InfoProviderInterface
|
|||
) {
|
||||
hits
|
||||
results {
|
||||
part
|
||||
part
|
||||
%s
|
||||
}
|
||||
}
|
||||
|
|
@ -403,4 +404,4 @@ class OctopartProvider implements InfoProviderInterface
|
|||
ProviderCapabilities::PRICE,
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ class PollinProvider implements InfoProviderInterface
|
|||
'name' => 'Pollin',
|
||||
'description' => 'Webscraping from pollin.de to get part information',
|
||||
'url' => 'https://www.pollin.de/',
|
||||
'disabled_help' => 'Set PROVIDER_POLLIN_ENABLED env to 1'
|
||||
'disabled_help' => 'Enable the provider in provider settings'
|
||||
];
|
||||
}
|
||||
|
||||
|
|
@ -246,4 +246,4 @@ class PollinProvider implements InfoProviderInterface
|
|||
ProviderCapabilities::DATASHEET
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ class ReicheltProvider implements InfoProviderInterface
|
|||
'name' => 'Reichelt',
|
||||
'description' => 'Webscraping from reichelt.com to get part information',
|
||||
'url' => 'https://www.reichelt.com/',
|
||||
'disabled_help' => 'Set PROVIDER_REICHELT_ENABLED env to 1'
|
||||
'disabled_help' => 'Enable provider in provider settings.'
|
||||
];
|
||||
}
|
||||
|
||||
|
|
@ -274,4 +274,4 @@ class ReicheltProvider implements InfoProviderInterface
|
|||
ProviderCapabilities::PRICE,
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ class TMEProvider implements InfoProviderInterface
|
|||
'name' => 'TME',
|
||||
'description' => 'This provider uses the API of TME (Transfer Multipart).',
|
||||
'url' => 'https://tme.eu/',
|
||||
'disabled_help' => 'Configure the PROVIDER_TME_KEY and PROVIDER_TME_SECRET environment variables to use this provider.'
|
||||
'disabled_help' => 'Configure the API Token and secret in provider settings to use this provider.'
|
||||
];
|
||||
}
|
||||
|
||||
|
|
@ -295,4 +295,4 @@ class TMEProvider implements InfoProviderInterface
|
|||
ProviderCapabilities::PRICE,
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ use App\Settings\SystemSettings\CustomizationSettings;
|
|||
*/
|
||||
class BannerHelper
|
||||
{
|
||||
public function __construct(private CustomizationSettings $customizationSettings)
|
||||
public function __construct(private readonly CustomizationSettings $customizationSettings)
|
||||
{
|
||||
|
||||
}
|
||||
|
|
@ -43,4 +43,4 @@ class BannerHelper
|
|||
{
|
||||
return $this->customizationSettings->banner ?? "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace App\Settings\InfoProviderSystem;
|
||||
|
||||
use App\Form\Type\APIKeyType;
|
||||
use App\Settings\SettingsIcon;
|
||||
use Jbtronics\SettingsBundle\Metadata\EnvVarMode;
|
||||
use Jbtronics\SettingsBundle\Settings\Settings;
|
||||
|
|
@ -42,12 +43,14 @@ class DigikeySettings
|
|||
|
||||
#[SettingsParameter(
|
||||
label: new TM("settings.ips.digikey.client_id"),
|
||||
formType: APIKeyType::class,
|
||||
envVar: "PROVIDER_DIGIKEY_CLIENT_ID", envVarMode: EnvVarMode::OVERWRITE
|
||||
)]
|
||||
public ?string $clientId = null;
|
||||
|
||||
#[SettingsParameter(
|
||||
label: new TM("settings.ips.digikey.secret"),
|
||||
formType: APIKeyType::class,
|
||||
envVar: "PROVIDER_DIGIKEY_SECRET", envVarMode: EnvVarMode::OVERWRITE
|
||||
)]
|
||||
public ?string $secret = null;
|
||||
|
|
@ -67,4 +70,4 @@ class DigikeySettings
|
|||
envVar: "PROVIDER_DIGIKEY_LANGUAGE", envVarMode: EnvVarMode::OVERWRITE)]
|
||||
#[Assert\Language]
|
||||
public string $language = "en";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace App\Settings\InfoProviderSystem;
|
||||
|
||||
use App\Form\Type\APIKeyType;
|
||||
use App\Settings\SettingsIcon;
|
||||
use Jbtronics\SettingsBundle\Metadata\EnvVarMode;
|
||||
use Jbtronics\SettingsBundle\Settings\Settings;
|
||||
|
|
@ -36,11 +37,12 @@ class Element14Settings
|
|||
{
|
||||
use SettingsTrait;
|
||||
|
||||
#[SettingsParameter(label: new TM("settings.ips.element14.apiKey"), description: new TM("settings.ips.element14.apiKey.help"),
|
||||
#[SettingsParameter(label: new TM("settings.ips.element14.apiKey"), description: new TM("settings.ips.element14.apiKey.help"),#
|
||||
formType: APIKeyType::class,
|
||||
formOptions: ["help_html" => true], envVar: "PROVIDER_ELEMENT14_KEY", envVarMode: EnvVarMode::OVERWRITE)]
|
||||
public ?string $apiKey = null;
|
||||
|
||||
#[SettingsParameter(label: new TM("settings.ips.element14.storeId"), description: new TM("settings.ips.element14.storeId.help"),
|
||||
formOptions: ["help_html" => true], envVar: "PROVIDER_ELEMENT14_STORE_ID", envVarMode: EnvVarMode::OVERWRITE)]
|
||||
public string $storeId = "de.farnell.com";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace App\Settings\InfoProviderSystem;
|
||||
|
||||
use App\Form\Type\APIKeyType;
|
||||
use App\Settings\SettingsIcon;
|
||||
use Jbtronics\SettingsBundle\Metadata\EnvVarMode;
|
||||
use Jbtronics\SettingsBundle\Settings\Settings;
|
||||
|
|
@ -35,6 +36,7 @@ use Symfony\Component\Translation\TranslatableMessage as TM;
|
|||
class MouserSettings
|
||||
{
|
||||
#[SettingsParameter(label: new TM("settings.ips.mouser.apiKey"), description: new TM("settings.ips.mouser.apiKey.help"),
|
||||
formType: APIKeyType::class,
|
||||
formOptions: ["help_html" => true], envVar: "PROVIDER_MOUSER_KEY", envVarMode: EnvVarMode::OVERWRITE)]
|
||||
public ?string $apiKey = null;
|
||||
|
||||
|
|
@ -64,4 +66,4 @@ class MouserSettings
|
|||
return MouserSearchOptions::tryFrom($value) ?? MouserSearchOptions::NONE;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace App\Settings\InfoProviderSystem;
|
||||
|
||||
use App\Form\Type\APIKeyType;
|
||||
use App\Settings\SettingsIcon;
|
||||
use Jbtronics\SettingsBundle\Metadata\EnvVarMode;
|
||||
use Jbtronics\SettingsBundle\Settings\Settings;
|
||||
|
|
@ -43,6 +44,7 @@ class OEMSecretsSettings
|
|||
"NZD", "RUB", "SEK", "SGD", "TWD", "USD"];
|
||||
|
||||
#[SettingsParameter(label: new TM("settings.ips.element14.apiKey"),
|
||||
formType: APIKeyType::class,
|
||||
envVar: "PROVIDER_OEMSECRETS_KEY", envVarMode: EnvVarMode::OVERWRITE)]
|
||||
public ?string $apiKey = null;
|
||||
|
||||
|
|
@ -85,4 +87,4 @@ class OEMSecretsSettings
|
|||
|
||||
return OEMSecretsSortMode::tryFrom($value) ?? OEMSecretsSortMode::NONE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace App\Settings\InfoProviderSystem;
|
||||
|
||||
use App\Form\Type\APIKeyType;
|
||||
use App\Settings\SettingsIcon;
|
||||
use Jbtronics\SettingsBundle\Metadata\EnvVarMode;
|
||||
use Jbtronics\SettingsBundle\Settings\Settings;
|
||||
|
|
@ -42,12 +43,14 @@ class OctopartSettings
|
|||
|
||||
#[SettingsParameter(
|
||||
label: new TM("settings.ips.digikey.client_id"),
|
||||
envVar: "PROVIDER_OCTOPART_CLIENT_ID", envVarMode: EnvVarMode::OVERWRITE
|
||||
formType: APIKeyType::class,
|
||||
envVar: "PROVIDER_OCTOPART_CLIENT_ID", envVarMode: EnvVarMode::OVERWRITE,
|
||||
)]
|
||||
public ?string $clientId = null;
|
||||
|
||||
#[SettingsParameter(
|
||||
label: new TM("settings.ips.digikey.secret"),
|
||||
formType: APIKeyType::class,
|
||||
envVar: "PROVIDER_OCTOPART_SECRET", envVarMode: EnvVarMode::OVERWRITE
|
||||
)]
|
||||
public ?string $secret = null;
|
||||
|
|
@ -75,4 +78,4 @@ class OctopartSettings
|
|||
)]
|
||||
public bool $onlyAuthorizedSellers = true;
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace App\Settings\InfoProviderSystem;
|
||||
|
||||
use App\Form\Type\APIKeyType;
|
||||
use App\Settings\SettingsIcon;
|
||||
use Jbtronics\SettingsBundle\Metadata\EnvVarMode;
|
||||
use Jbtronics\SettingsBundle\Settings\Settings;
|
||||
|
|
@ -43,11 +44,13 @@ class TMESettings
|
|||
private const SUPPORTED_CURRENCIES = ["EUR", "USD", "PLN", "GBP"];
|
||||
|
||||
#[SettingsParameter(label: new TM("settings.ips.tme.token"),
|
||||
description: new TM("settings.ips.tme.token.help"), formOptions: ["help_html" => true],
|
||||
description: new TM("settings.ips.tme.token.help"),
|
||||
formType: APIKeyType::class, formOptions: ["help_html" => true],
|
||||
envVar: "PROVIDER_TME_KEY", envVarMode: EnvVarMode::OVERWRITE)]
|
||||
public ?string $apiToken = null;
|
||||
|
||||
#[SettingsParameter(label: new TM("settings.ips.tme.secret"),
|
||||
formType: APIKeyType::class,
|
||||
envVar: "PROVIDER_TME_SECRET", envVarMode: EnvVarMode::OVERWRITE)]
|
||||
public ?string $apiSecret = null;
|
||||
|
||||
|
|
@ -69,4 +72,4 @@ class TMESettings
|
|||
#[SettingsParameter(label: new TM("settings.ips.tme.grossPrices"),
|
||||
envVar: "bool:PROVIDER_TME_GET_GROSS_PRICES", envVarMode: EnvVarMode::OVERWRITE)]
|
||||
public bool $grossPrices = true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace App\Settings\MiscSettings;
|
||||
|
||||
use App\Form\Type\APIKeyType;
|
||||
use App\Settings\SettingsIcon;
|
||||
use Jbtronics\SettingsBundle\Metadata\EnvVarMode;
|
||||
use Jbtronics\SettingsBundle\Settings\Settings;
|
||||
|
|
@ -35,7 +36,8 @@ class ExchangeRateSettings
|
|||
{
|
||||
#[SettingsParameter(label: new TM("settings.misc.exchange_rate.fixer_api_key"),
|
||||
description: new TM("settings.misc.exchange_rate.fixer_api_key.help"),
|
||||
formType: APIKeyType::class,
|
||||
envVar: "FIXER_API_KEY", envVarMode: EnvVarMode::OVERWRITE,
|
||||
)]
|
||||
public ?string $fixerApiKey = null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ class CustomizationSettings
|
|||
#[SettingsParameter(
|
||||
label: new TM("settings.system.customization.banner"),
|
||||
formType: RichTextEditorType::class, formOptions: ['mode' => 'markdown-full'],
|
||||
envVar: "BANNER", envVarMode: EnvVarMode::OVERWRITE,
|
||||
)]
|
||||
public ?string $banner = null;
|
||||
|
||||
|
|
@ -58,4 +59,4 @@ class CustomizationSettings
|
|||
)]
|
||||
#[ValidTheme]
|
||||
public string $theme = 'bootstrap';
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -729,6 +729,9 @@
|
|||
},
|
||||
"files": []
|
||||
},
|
||||
"symfony/ux-toggle-password": {
|
||||
"version": "v2.29.2"
|
||||
},
|
||||
"symfony/ux-translator": {
|
||||
"version": "2.9",
|
||||
"recipe": {
|
||||
|
|
|
|||
|
|
@ -13033,5 +13033,17 @@ Please note, that you can not impersonate a disabled user. If you try you will g
|
|||
<target>The value of this parameter can be overridden by setting the environment variable "%env%".</target>
|
||||
</segment>
|
||||
</unit>
|
||||
<unit id="boWkQh7" name="settings.flash.saved">
|
||||
<segment>
|
||||
<source>settings.flash.saved</source>
|
||||
<target>Settings saved successfully.</target>
|
||||
</segment>
|
||||
</unit>
|
||||
<unit id="tEYWrWD" name="settings.flash.invalid">
|
||||
<segment>
|
||||
<source>settings.flash.invalid</source>
|
||||
<target>Settings are invalid. Please check your input!</target>
|
||||
</segment>
|
||||
</unit>
|
||||
</file>
|
||||
</xliff>
|
||||
|
|
|
|||
|
|
@ -2023,6 +2023,9 @@
|
|||
loader-utils "^2.0.0 || ^3.0.0"
|
||||
schema-utils "^3.0.0 || ^4.0.0"
|
||||
|
||||
"@symfony/ux-toggle-password@file:vendor/symfony/ux-toggle-password/assets":
|
||||
version "2.29.1"
|
||||
|
||||
"@symfony/ux-translator@file:vendor/symfony/ux-translator/assets":
|
||||
version "2.29.1"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue