mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-07-06 01:11:36 +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.
|
# 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
|
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)
|
# 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
|
DISABLE_YEAR2038_BUG_CHECK=0
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,14 @@
|
||||||
{
|
{
|
||||||
"controllers": {
|
"controllers": {
|
||||||
|
"@symfony/ux-toggle-password": {
|
||||||
|
"toggle-password": {
|
||||||
|
"enabled": true,
|
||||||
|
"fetch": "eager",
|
||||||
|
"autoimport": {
|
||||||
|
"@symfony/ux-toggle-password/dist/style.min.css": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"@symfony/ux-turbo": {
|
"@symfony/ux-turbo": {
|
||||||
"turbo-core": {
|
"turbo-core": {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
|
|
|
||||||
|
|
@ -121,3 +121,10 @@ del {
|
||||||
background-color: #f09595;
|
background-color: #f09595;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/****************************************
|
||||||
|
* Password toggle
|
||||||
|
****************************************/
|
||||||
|
.toggle-password-button {
|
||||||
|
top: 0.7rem !important;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@
|
||||||
"hshn/base64-encoded-file": "^5.0",
|
"hshn/base64-encoded-file": "^5.0",
|
||||||
"jbtronics/2fa-webauthn": "^3.0.0",
|
"jbtronics/2fa-webauthn": "^3.0.0",
|
||||||
"jbtronics/dompdf-font-loader-bundle": "^1.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",
|
"jfcherng/php-diff": "^6.14",
|
||||||
"knpuniversity/oauth2-client-bundle": "^2.15",
|
"knpuniversity/oauth2-client-bundle": "^2.15",
|
||||||
"league/commonmark": "^2.7",
|
"league/commonmark": "^2.7",
|
||||||
|
|
@ -80,6 +80,7 @@
|
||||||
"symfony/string": "7.3.*",
|
"symfony/string": "7.3.*",
|
||||||
"symfony/translation": "7.3.*",
|
"symfony/translation": "7.3.*",
|
||||||
"symfony/twig-bundle": "7.3.*",
|
"symfony/twig-bundle": "7.3.*",
|
||||||
|
"symfony/ux-toggle-password": "^2.29",
|
||||||
"symfony/ux-translator": "^2.10",
|
"symfony/ux-translator": "^2.10",
|
||||||
"symfony/ux-turbo": "^2.0",
|
"symfony/ux-turbo": "^2.0",
|
||||||
"symfony/validator": "7.3.*",
|
"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",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "2b0f46c3211d452d6bbd71a38ece8cbd",
|
"content-hash": "3b97b6338827ba56e0404860f3e98359",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "amphp/amp",
|
"name": "amphp/amp",
|
||||||
|
|
@ -5090,16 +5090,16 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "jbtronics/settings-bundle",
|
"name": "jbtronics/settings-bundle",
|
||||||
"version": "v2.7.0",
|
"version": "v3.0.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/jbtronics/settings-bundle.git",
|
"url": "https://github.com/jbtronics/settings-bundle.git",
|
||||||
"reference": "2f579554d52b3d5226b8569ccd13988f6403f6af"
|
"reference": "34b9629af73c7ad8989d8284470e79f3f8d79712"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/jbtronics/settings-bundle/zipball/2f579554d52b3d5226b8569ccd13988f6403f6af",
|
"url": "https://api.github.com/repos/jbtronics/settings-bundle/zipball/34b9629af73c7ad8989d8284470e79f3f8d79712",
|
||||||
"reference": "2f579554d52b3d5226b8569ccd13988f6403f6af",
|
"reference": "34b9629af73c7ad8989d8284470e79f3f8d79712",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
|
@ -5160,7 +5160,7 @@
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/jbtronics/settings-bundle/issues",
|
"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": [
|
"funding": [
|
||||||
{
|
{
|
||||||
|
|
@ -5172,7 +5172,7 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2025-08-15T22:13:15+00:00"
|
"time": "2025-08-24T17:17:43+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "jfcherng/php-color-output",
|
"name": "jfcherng/php-color-output",
|
||||||
|
|
@ -15188,6 +15188,90 @@
|
||||||
],
|
],
|
||||||
"time": "2025-06-27T19:55:54+00:00"
|
"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",
|
"name": "symfony/ux-translator",
|
||||||
"version": "v2.29.2",
|
"version": "v2.29.2",
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,4 @@
|
||||||
Welcome to Part-DB.
|
**Attention**:
|
||||||
|
Since Version 2.0.0 this file is no longer used.
|
||||||
|
|
||||||
<small>If you want to change this banner, edit `config/banner.md` file or set the `BANNER` environment variable.</small>
|
You can now set the banner text directly in the admin interface, or by setting the `BANNER` environment variable.
|
||||||
|
|
||||||
<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>
|
|
||||||
|
|
|
||||||
|
|
@ -33,4 +33,5 @@ return [
|
||||||
Jbtronics\SettingsBundle\JbtronicsSettingsBundle::class => ['all' => true],
|
Jbtronics\SettingsBundle\JbtronicsSettingsBundle::class => ['all' => true],
|
||||||
Jbtronics\TranslationEditorBundle\JbtronicsTranslationEditorBundle::class => ['dev' => true],
|
Jbtronics\TranslationEditorBundle\JbtronicsTranslationEditorBundle::class => ['dev' => true],
|
||||||
ApiPlatform\Symfony\Bundle\ApiPlatformBundle::class => ['all' => 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(ERROR_PAGE_SHOW_HELP): 1
|
||||||
|
|
||||||
env(DEMO_MODE): 0
|
env(DEMO_MODE): 0
|
||||||
env(BANNER): ''
|
|
||||||
|
|
||||||
|
|
||||||
env(EMAIL_SENDER_EMAIL): 'noreply@partdb.changeme'
|
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
|
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.
|
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",
|
"@hotwired/turbo": "^8.0.1",
|
||||||
"@popperjs/core": "^2.10.2",
|
"@popperjs/core": "^2.10.2",
|
||||||
"@symfony/stimulus-bridge": "^4.0.0",
|
"@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-translator": "file:vendor/symfony/ux-translator/assets",
|
||||||
"@symfony/ux-turbo": "file:vendor/symfony/ux-turbo/assets",
|
"@symfony/ux-turbo": "file:vendor/symfony/ux-turbo/assets",
|
||||||
"@symfony/webpack-encore": "^5.0.0",
|
"@symfony/webpack-encore": "^5.0.0",
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,8 @@ use Symfony\Component\HttpFoundation\Response;
|
||||||
use Symfony\Component\Routing\Attribute\Route;
|
use Symfony\Component\Routing\Attribute\Route;
|
||||||
use Symfony\Contracts\Cache\TagAwareCacheInterface;
|
use Symfony\Contracts\Cache\TagAwareCacheInterface;
|
||||||
|
|
||||||
|
use function Symfony\Component\Translation\t;
|
||||||
|
|
||||||
class SettingsController extends AbstractController
|
class SettingsController extends AbstractController
|
||||||
{
|
{
|
||||||
public function __construct(private readonly SettingsManagerInterface $settingsManager, private readonly SettingsFormFactoryInterface $settingsFormFactory)
|
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
|
//It might be possible, that the tree settings have changed, so clear the cache
|
||||||
$cache->invalidateTags(['tree_treeview', 'sidebar_tree_update']);
|
$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
|
//Render the 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.',
|
'description' => 'This provider uses the DigiKey API to search for parts.',
|
||||||
'url' => 'https://www.digikey.com/',
|
'url' => 'https://www.digikey.com/',
|
||||||
'oauth_app_name' => self::OAUTH_APP_NAME,
|
'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
|
public function isActive(): bool
|
||||||
{
|
{
|
||||||
//The client ID has to be set and a token has to be available (user clicked connect)
|
//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
|
public function searchByKeyword(string $keyword): array
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ class Element14Provider implements InfoProviderInterface
|
||||||
'name' => 'Farnell element14',
|
'name' => 'Farnell element14',
|
||||||
'description' => 'This provider uses the Farnell element14 API to search for parts.',
|
'description' => 'This provider uses the Farnell element14 API to search for parts.',
|
||||||
'url' => 'https://www.element14.com/',
|
'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',
|
'name' => 'LCSC',
|
||||||
'description' => 'This provider uses the (unofficial) LCSC API to search for parts.',
|
'description' => 'This provider uses the (unofficial) LCSC API to search for parts.',
|
||||||
'url' => 'https://www.lcsc.com/',
|
'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',
|
'name' => 'Mouser',
|
||||||
'description' => 'This provider uses the Mouser API to search for parts.',
|
'description' => 'This provider uses the Mouser API to search for parts.',
|
||||||
'url' => 'https://www.mouser.com/',
|
'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.'
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -246,7 +246,7 @@ class OEMSecretsProvider implements InfoProviderInterface
|
||||||
'name' => 'OEMSecrets',
|
'name' => 'OEMSecrets',
|
||||||
'description' => 'This provider uses the OEMSecrets API to search for parts.',
|
'description' => 'This provider uses the OEMSecrets API to search for parts.',
|
||||||
'url' => 'https://www.oemsecrets.com/',
|
'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
|
public function isActive(): bool
|
||||||
{
|
{
|
||||||
return $this->settings->apiKey !== '';
|
return $this->settings->apiKey !== null && $this->settings->apiKey !== '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -170,7 +170,7 @@ class OctopartProvider implements InfoProviderInterface
|
||||||
'name' => 'Octopart',
|
'name' => 'Octopart',
|
||||||
'description' => 'This provider uses the Nexar/Octopart API to search for parts on Octopart.',
|
'description' => 'This provider uses the Nexar/Octopart API to search for parts on Octopart.',
|
||||||
'url' => 'https://www.octopart.com/',
|
'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)
|
//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 /*!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
|
private function mapLifeCycleStatus(?string $value): ?ManufacturingStatus
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ class PollinProvider implements InfoProviderInterface
|
||||||
'name' => 'Pollin',
|
'name' => 'Pollin',
|
||||||
'description' => 'Webscraping from pollin.de to get part information',
|
'description' => 'Webscraping from pollin.de to get part information',
|
||||||
'url' => 'https://www.pollin.de/',
|
'url' => 'https://www.pollin.de/',
|
||||||
'disabled_help' => 'Set PROVIDER_POLLIN_ENABLED env to 1'
|
'disabled_help' => 'Enable the provider in provider settings'
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ class ReicheltProvider implements InfoProviderInterface
|
||||||
'name' => 'Reichelt',
|
'name' => 'Reichelt',
|
||||||
'description' => 'Webscraping from reichelt.com to get part information',
|
'description' => 'Webscraping from reichelt.com to get part information',
|
||||||
'url' => 'https://www.reichelt.com/',
|
'url' => 'https://www.reichelt.com/',
|
||||||
'disabled_help' => 'Set PROVIDER_REICHELT_ENABLED env to 1'
|
'disabled_help' => 'Enable provider in provider settings.'
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ class TMEProvider implements InfoProviderInterface
|
||||||
'name' => 'TME',
|
'name' => 'TME',
|
||||||
'description' => 'This provider uses the API of TME (Transfer Multipart).',
|
'description' => 'This provider uses the API of TME (Transfer Multipart).',
|
||||||
'url' => 'https://tme.eu/',
|
'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.'
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ use App\Settings\SystemSettings\CustomizationSettings;
|
||||||
*/
|
*/
|
||||||
class BannerHelper
|
class BannerHelper
|
||||||
{
|
{
|
||||||
public function __construct(private CustomizationSettings $customizationSettings)
|
public function __construct(private readonly CustomizationSettings $customizationSettings)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Settings\InfoProviderSystem;
|
namespace App\Settings\InfoProviderSystem;
|
||||||
|
|
||||||
|
use App\Form\Type\APIKeyType;
|
||||||
use App\Settings\SettingsIcon;
|
use App\Settings\SettingsIcon;
|
||||||
use Jbtronics\SettingsBundle\Metadata\EnvVarMode;
|
use Jbtronics\SettingsBundle\Metadata\EnvVarMode;
|
||||||
use Jbtronics\SettingsBundle\Settings\Settings;
|
use Jbtronics\SettingsBundle\Settings\Settings;
|
||||||
|
|
@ -42,12 +43,14 @@ class DigikeySettings
|
||||||
|
|
||||||
#[SettingsParameter(
|
#[SettingsParameter(
|
||||||
label: new TM("settings.ips.digikey.client_id"),
|
label: new TM("settings.ips.digikey.client_id"),
|
||||||
|
formType: APIKeyType::class,
|
||||||
envVar: "PROVIDER_DIGIKEY_CLIENT_ID", envVarMode: EnvVarMode::OVERWRITE
|
envVar: "PROVIDER_DIGIKEY_CLIENT_ID", envVarMode: EnvVarMode::OVERWRITE
|
||||||
)]
|
)]
|
||||||
public ?string $clientId = null;
|
public ?string $clientId = null;
|
||||||
|
|
||||||
#[SettingsParameter(
|
#[SettingsParameter(
|
||||||
label: new TM("settings.ips.digikey.secret"),
|
label: new TM("settings.ips.digikey.secret"),
|
||||||
|
formType: APIKeyType::class,
|
||||||
envVar: "PROVIDER_DIGIKEY_SECRET", envVarMode: EnvVarMode::OVERWRITE
|
envVar: "PROVIDER_DIGIKEY_SECRET", envVarMode: EnvVarMode::OVERWRITE
|
||||||
)]
|
)]
|
||||||
public ?string $secret = null;
|
public ?string $secret = null;
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Settings\InfoProviderSystem;
|
namespace App\Settings\InfoProviderSystem;
|
||||||
|
|
||||||
|
use App\Form\Type\APIKeyType;
|
||||||
use App\Settings\SettingsIcon;
|
use App\Settings\SettingsIcon;
|
||||||
use Jbtronics\SettingsBundle\Metadata\EnvVarMode;
|
use Jbtronics\SettingsBundle\Metadata\EnvVarMode;
|
||||||
use Jbtronics\SettingsBundle\Settings\Settings;
|
use Jbtronics\SettingsBundle\Settings\Settings;
|
||||||
|
|
@ -36,7 +37,8 @@ class Element14Settings
|
||||||
{
|
{
|
||||||
use SettingsTrait;
|
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)]
|
formOptions: ["help_html" => true], envVar: "PROVIDER_ELEMENT14_KEY", envVarMode: EnvVarMode::OVERWRITE)]
|
||||||
public ?string $apiKey = null;
|
public ?string $apiKey = null;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Settings\InfoProviderSystem;
|
namespace App\Settings\InfoProviderSystem;
|
||||||
|
|
||||||
|
use App\Form\Type\APIKeyType;
|
||||||
use App\Settings\SettingsIcon;
|
use App\Settings\SettingsIcon;
|
||||||
use Jbtronics\SettingsBundle\Metadata\EnvVarMode;
|
use Jbtronics\SettingsBundle\Metadata\EnvVarMode;
|
||||||
use Jbtronics\SettingsBundle\Settings\Settings;
|
use Jbtronics\SettingsBundle\Settings\Settings;
|
||||||
|
|
@ -35,6 +36,7 @@ use Symfony\Component\Translation\TranslatableMessage as TM;
|
||||||
class MouserSettings
|
class MouserSettings
|
||||||
{
|
{
|
||||||
#[SettingsParameter(label: new TM("settings.ips.mouser.apiKey"), description: new TM("settings.ips.mouser.apiKey.help"),
|
#[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)]
|
formOptions: ["help_html" => true], envVar: "PROVIDER_MOUSER_KEY", envVarMode: EnvVarMode::OVERWRITE)]
|
||||||
public ?string $apiKey = null;
|
public ?string $apiKey = null;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Settings\InfoProviderSystem;
|
namespace App\Settings\InfoProviderSystem;
|
||||||
|
|
||||||
|
use App\Form\Type\APIKeyType;
|
||||||
use App\Settings\SettingsIcon;
|
use App\Settings\SettingsIcon;
|
||||||
use Jbtronics\SettingsBundle\Metadata\EnvVarMode;
|
use Jbtronics\SettingsBundle\Metadata\EnvVarMode;
|
||||||
use Jbtronics\SettingsBundle\Settings\Settings;
|
use Jbtronics\SettingsBundle\Settings\Settings;
|
||||||
|
|
@ -43,6 +44,7 @@ class OEMSecretsSettings
|
||||||
"NZD", "RUB", "SEK", "SGD", "TWD", "USD"];
|
"NZD", "RUB", "SEK", "SGD", "TWD", "USD"];
|
||||||
|
|
||||||
#[SettingsParameter(label: new TM("settings.ips.element14.apiKey"),
|
#[SettingsParameter(label: new TM("settings.ips.element14.apiKey"),
|
||||||
|
formType: APIKeyType::class,
|
||||||
envVar: "PROVIDER_OEMSECRETS_KEY", envVarMode: EnvVarMode::OVERWRITE)]
|
envVar: "PROVIDER_OEMSECRETS_KEY", envVarMode: EnvVarMode::OVERWRITE)]
|
||||||
public ?string $apiKey = null;
|
public ?string $apiKey = null;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Settings\InfoProviderSystem;
|
namespace App\Settings\InfoProviderSystem;
|
||||||
|
|
||||||
|
use App\Form\Type\APIKeyType;
|
||||||
use App\Settings\SettingsIcon;
|
use App\Settings\SettingsIcon;
|
||||||
use Jbtronics\SettingsBundle\Metadata\EnvVarMode;
|
use Jbtronics\SettingsBundle\Metadata\EnvVarMode;
|
||||||
use Jbtronics\SettingsBundle\Settings\Settings;
|
use Jbtronics\SettingsBundle\Settings\Settings;
|
||||||
|
|
@ -42,12 +43,14 @@ class OctopartSettings
|
||||||
|
|
||||||
#[SettingsParameter(
|
#[SettingsParameter(
|
||||||
label: new TM("settings.ips.digikey.client_id"),
|
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;
|
public ?string $clientId = null;
|
||||||
|
|
||||||
#[SettingsParameter(
|
#[SettingsParameter(
|
||||||
label: new TM("settings.ips.digikey.secret"),
|
label: new TM("settings.ips.digikey.secret"),
|
||||||
|
formType: APIKeyType::class,
|
||||||
envVar: "PROVIDER_OCTOPART_SECRET", envVarMode: EnvVarMode::OVERWRITE
|
envVar: "PROVIDER_OCTOPART_SECRET", envVarMode: EnvVarMode::OVERWRITE
|
||||||
)]
|
)]
|
||||||
public ?string $secret = null;
|
public ?string $secret = null;
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Settings\InfoProviderSystem;
|
namespace App\Settings\InfoProviderSystem;
|
||||||
|
|
||||||
|
use App\Form\Type\APIKeyType;
|
||||||
use App\Settings\SettingsIcon;
|
use App\Settings\SettingsIcon;
|
||||||
use Jbtronics\SettingsBundle\Metadata\EnvVarMode;
|
use Jbtronics\SettingsBundle\Metadata\EnvVarMode;
|
||||||
use Jbtronics\SettingsBundle\Settings\Settings;
|
use Jbtronics\SettingsBundle\Settings\Settings;
|
||||||
|
|
@ -43,11 +44,13 @@ class TMESettings
|
||||||
private const SUPPORTED_CURRENCIES = ["EUR", "USD", "PLN", "GBP"];
|
private const SUPPORTED_CURRENCIES = ["EUR", "USD", "PLN", "GBP"];
|
||||||
|
|
||||||
#[SettingsParameter(label: new TM("settings.ips.tme.token"),
|
#[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)]
|
envVar: "PROVIDER_TME_KEY", envVarMode: EnvVarMode::OVERWRITE)]
|
||||||
public ?string $apiToken = null;
|
public ?string $apiToken = null;
|
||||||
|
|
||||||
#[SettingsParameter(label: new TM("settings.ips.tme.secret"),
|
#[SettingsParameter(label: new TM("settings.ips.tme.secret"),
|
||||||
|
formType: APIKeyType::class,
|
||||||
envVar: "PROVIDER_TME_SECRET", envVarMode: EnvVarMode::OVERWRITE)]
|
envVar: "PROVIDER_TME_SECRET", envVarMode: EnvVarMode::OVERWRITE)]
|
||||||
public ?string $apiSecret = null;
|
public ?string $apiSecret = null;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Settings\MiscSettings;
|
namespace App\Settings\MiscSettings;
|
||||||
|
|
||||||
|
use App\Form\Type\APIKeyType;
|
||||||
use App\Settings\SettingsIcon;
|
use App\Settings\SettingsIcon;
|
||||||
use Jbtronics\SettingsBundle\Metadata\EnvVarMode;
|
use Jbtronics\SettingsBundle\Metadata\EnvVarMode;
|
||||||
use Jbtronics\SettingsBundle\Settings\Settings;
|
use Jbtronics\SettingsBundle\Settings\Settings;
|
||||||
|
|
@ -35,6 +36,7 @@ class ExchangeRateSettings
|
||||||
{
|
{
|
||||||
#[SettingsParameter(label: new TM("settings.misc.exchange_rate.fixer_api_key"),
|
#[SettingsParameter(label: new TM("settings.misc.exchange_rate.fixer_api_key"),
|
||||||
description: new TM("settings.misc.exchange_rate.fixer_api_key.help"),
|
description: new TM("settings.misc.exchange_rate.fixer_api_key.help"),
|
||||||
|
formType: APIKeyType::class,
|
||||||
envVar: "FIXER_API_KEY", envVarMode: EnvVarMode::OVERWRITE,
|
envVar: "FIXER_API_KEY", envVarMode: EnvVarMode::OVERWRITE,
|
||||||
)]
|
)]
|
||||||
public ?string $fixerApiKey = null;
|
public ?string $fixerApiKey = null;
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,7 @@ class CustomizationSettings
|
||||||
#[SettingsParameter(
|
#[SettingsParameter(
|
||||||
label: new TM("settings.system.customization.banner"),
|
label: new TM("settings.system.customization.banner"),
|
||||||
formType: RichTextEditorType::class, formOptions: ['mode' => 'markdown-full'],
|
formType: RichTextEditorType::class, formOptions: ['mode' => 'markdown-full'],
|
||||||
|
envVar: "BANNER", envVarMode: EnvVarMode::OVERWRITE,
|
||||||
)]
|
)]
|
||||||
public ?string $banner = null;
|
public ?string $banner = null;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -729,6 +729,9 @@
|
||||||
},
|
},
|
||||||
"files": []
|
"files": []
|
||||||
},
|
},
|
||||||
|
"symfony/ux-toggle-password": {
|
||||||
|
"version": "v2.29.2"
|
||||||
|
},
|
||||||
"symfony/ux-translator": {
|
"symfony/ux-translator": {
|
||||||
"version": "2.9",
|
"version": "2.9",
|
||||||
"recipe": {
|
"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>
|
<target>The value of this parameter can be overridden by setting the environment variable "%env%".</target>
|
||||||
</segment>
|
</segment>
|
||||||
</unit>
|
</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>
|
</file>
|
||||||
</xliff>
|
</xliff>
|
||||||
|
|
|
||||||
|
|
@ -2023,6 +2023,9 @@
|
||||||
loader-utils "^2.0.0 || ^3.0.0"
|
loader-utils "^2.0.0 || ^3.0.0"
|
||||||
schema-utils "^3.0.0 || ^4.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":
|
"@symfony/ux-translator@file:vendor/symfony/ux-translator/assets":
|
||||||
version "2.29.1"
|
version "2.29.1"
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue