Merge pull request #185 from stephb9959/main

[WIFI-12603] Fallback if country code is contained in device type
This commit is contained in:
Charles Bourque
2023-05-15 19:27:27 +02:00
committed by GitHub
5 changed files with 17 additions and 4 deletions

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "ucentral-client",
"version": "2.10.0(39)",
"version": "2.10.0(40)",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "ucentral-client",
"version": "2.10.0(39)",
"version": "2.10.0(40)",
"license": "ISC",
"dependencies": {
"@chakra-ui/icons": "^2.0.18",

View File

@@ -1,6 +1,6 @@
{
"name": "ucentral-client",
"version": "2.10.0(39)",
"version": "2.10.0(40)",
"description": "",
"private": true,
"main": "index.tsx",

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

@@ -61,6 +61,19 @@ const DeviceSummary = ({ serialNumber }: Props) => {
return '-';
};
const getDeviceCompatible = () => {
if (!getDevice.data?.compatible) return undefined;
if (!getDevice.data?.compatible.includes('-')) return getDevice.data?.compatible;
const split = getDevice.data?.compatible.split('-');
if (split[split.length - 1]?.length === 2) return split[0]?.trim();
return getDevice.data?.compatible;
};
return (
<Card mb={4}>
<CardHeader
@@ -74,7 +87,7 @@ const DeviceSummary = ({ serialNumber }: Props) => {
<CardBody>
<Flex w="100%" alignItems="center">
<Image
src={`devices/${getDevice.data?.compatible}.png`}
src={`devices/${getDeviceCompatible()}.png`}
alt={getDevice?.data?.compatible}
fallback={
<Box minW="220px" w="220px" h="220px" mr={4} display="flex">