diff --git a/src/Services/InfoProviderSystem/Providers/DigikeyProvider.php b/src/Services/InfoProviderSystem/Providers/DigikeyProvider.php index c2113b4d..5596ea2b 100644 --- a/src/Services/InfoProviderSystem/Providers/DigikeyProvider.php +++ b/src/Services/InfoProviderSystem/Providers/DigikeyProvider.php @@ -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 diff --git a/src/Services/InfoProviderSystem/Providers/Element14Provider.php b/src/Services/InfoProviderSystem/Providers/Element14Provider.php index 91249156..9ba5330d 100644 --- a/src/Services/InfoProviderSystem/Providers/Element14Provider.php +++ b/src/Services/InfoProviderSystem/Providers/Element14Provider.php @@ -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.' ]; } diff --git a/src/Services/InfoProviderSystem/Providers/LCSCProvider.php b/src/Services/InfoProviderSystem/Providers/LCSCProvider.php index 193ca366..bfb6ad97 100755 --- a/src/Services/InfoProviderSystem/Providers/LCSCProvider.php +++ b/src/Services/InfoProviderSystem/Providers/LCSCProvider.php @@ -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.' ]; } diff --git a/src/Services/InfoProviderSystem/Providers/MouserProvider.php b/src/Services/InfoProviderSystem/Providers/MouserProvider.php index 0348ec74..8bbdcd9c 100644 --- a/src/Services/InfoProviderSystem/Providers/MouserProvider.php +++ b/src/Services/InfoProviderSystem/Providers/MouserProvider.php @@ -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; } -} \ No newline at end of file +} diff --git a/src/Services/InfoProviderSystem/Providers/OEMSecretsProvider.php b/src/Services/InfoProviderSystem/Providers/OEMSecretsProvider.php index bf97635f..ec035015 100644 --- a/src/Services/InfoProviderSystem/Providers/OEMSecretsProvider.php +++ b/src/Services/InfoProviderSystem/Providers/OEMSecretsProvider.php @@ -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; } -} \ No newline at end of file +} diff --git a/src/Services/InfoProviderSystem/Providers/OctopartProvider.php b/src/Services/InfoProviderSystem/Providers/OctopartProvider.php index ce1ec4a4..c05931d3 100644 --- a/src/Services/InfoProviderSystem/Providers/OctopartProvider.php +++ b/src/Services/InfoProviderSystem/Providers/OctopartProvider.php @@ -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, ]; } -} \ No newline at end of file +} diff --git a/src/Services/InfoProviderSystem/Providers/PollinProvider.php b/src/Services/InfoProviderSystem/Providers/PollinProvider.php index 864effd9..5f2268e0 100644 --- a/src/Services/InfoProviderSystem/Providers/PollinProvider.php +++ b/src/Services/InfoProviderSystem/Providers/PollinProvider.php @@ -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 ]; } -} \ No newline at end of file +} diff --git a/src/Services/InfoProviderSystem/Providers/ReicheltProvider.php b/src/Services/InfoProviderSystem/Providers/ReicheltProvider.php index ebc62dd5..e836937b 100644 --- a/src/Services/InfoProviderSystem/Providers/ReicheltProvider.php +++ b/src/Services/InfoProviderSystem/Providers/ReicheltProvider.php @@ -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, ]; } -} \ No newline at end of file +} diff --git a/src/Services/InfoProviderSystem/Providers/TMEProvider.php b/src/Services/InfoProviderSystem/Providers/TMEProvider.php index 81939a78..7c846a65 100644 --- a/src/Services/InfoProviderSystem/Providers/TMEProvider.php +++ b/src/Services/InfoProviderSystem/Providers/TMEProvider.php @@ -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, ]; } -} \ No newline at end of file +}