@@ -15118,7 +15118,7 @@ exports[`GeneralInformation should render correctly 1`] = `
>
1 enabled
diff --git a/src/components/GeneralInfo/InfrastructureCard/__snapshots__/InfrastructureCard.test.js.snap b/src/components/GeneralInfo/InfrastructureCard/__snapshots__/InfrastructureCard.test.js.snap
index 975c823d3..a06db08fe 100644
--- a/src/components/GeneralInfo/InfrastructureCard/__snapshots__/InfrastructureCard.test.js.snap
+++ b/src/components/GeneralInfo/InfrastructureCard/__snapshots__/InfrastructureCard.test.js.snap
@@ -254,11 +254,10 @@ exports[`InfrastructureCard should not render hasIPv4 1`] = `
value={1}
>
1 address
@@ -294,11 +293,10 @@ exports[`InfrastructureCard should not render hasIPv4 1`] = `
value={1}
>
1 NIC
@@ -580,11 +578,10 @@ exports[`InfrastructureCard should not render hasIPv6 1`] = `
value={1}
>
1 address
@@ -620,11 +617,10 @@ exports[`InfrastructureCard should not render hasIPv6 1`] = `
value={1}
>
1 NIC
@@ -907,11 +903,10 @@ exports[`InfrastructureCard should not render hasInterfaces 1`] = `
value={1}
>
1 address
@@ -948,11 +943,10 @@ exports[`InfrastructureCard should not render hasInterfaces 1`] = `
value={1}
>
1 address
@@ -1216,11 +1210,10 @@ exports[`InfrastructureCard should not render hasType 1`] = `
value={1}
>
1 address
@@ -1257,11 +1250,10 @@ exports[`InfrastructureCard should not render hasType 1`] = `
value={1}
>
1 address
@@ -1297,11 +1289,10 @@ exports[`InfrastructureCard should not render hasType 1`] = `
value={1}
>
1 NIC
@@ -1565,11 +1556,10 @@ exports[`InfrastructureCard should not render hasVendor 1`] = `
value={1}
>
1 address
@@ -1606,11 +1596,10 @@ exports[`InfrastructureCard should not render hasVendor 1`] = `
value={1}
>
1 address
@@ -1646,11 +1635,10 @@ exports[`InfrastructureCard should not render hasVendor 1`] = `
value={1}
>
1 NIC
@@ -2323,11 +2311,10 @@ exports[`InfrastructureCard should render correctly with data 1`] = `
value={1}
>
1 address
@@ -2364,11 +2351,10 @@ exports[`InfrastructureCard should render correctly with data 1`] = `
value={1}
>
1 address
@@ -2404,11 +2390,10 @@ exports[`InfrastructureCard should render correctly with data 1`] = `
value={1}
>
1 NIC
@@ -3011,11 +2996,10 @@ exports[`InfrastructureCard should render enabled/disabled 1`] = `
value={1}
>
1 address
@@ -3052,11 +3036,10 @@ exports[`InfrastructureCard should render enabled/disabled 1`] = `
value={1}
>
1 address
@@ -3092,11 +3075,10 @@ exports[`InfrastructureCard should render enabled/disabled 1`] = `
value={1}
>
1 NIC
@@ -3419,11 +3401,10 @@ exports[`InfrastructureCard should render extra 1`] = `
value={1}
>
1 address
@@ -3460,11 +3441,10 @@ exports[`InfrastructureCard should render extra 1`] = `
value={1}
>
1 address
@@ -3500,11 +3480,10 @@ exports[`InfrastructureCard should render extra 1`] = `
value={1}
>
1 NIC
@@ -3560,11 +3539,10 @@ exports[`InfrastructureCard should render extra 1`] = `
value="1 tests"
>
1 tests
diff --git a/src/components/GeneralInfo/LoadingCard/LoadingCard.js b/src/components/GeneralInfo/LoadingCard/LoadingCard.js
index 9eba4fa2f..5803b10ab 100644
--- a/src/components/GeneralInfo/LoadingCard/LoadingCard.js
+++ b/src/components/GeneralInfo/LoadingCard/LoadingCard.js
@@ -17,7 +17,7 @@ import {
Skeleton,
SkeletonSize,
} from '@redhat-cloud-services/frontend-components/Skeleton';
-import { Link, useParams } from 'react-router-dom';
+import { Link, useLocation } from 'react-router-dom';
const valueToText = (value, singular, plural) => {
if ((value || value === 0) && singular) {
@@ -34,14 +34,20 @@ const valueToText = (value, singular, plural) => {
};
export const Clickable = ({ value, target, plural, singular, onClick }) => {
- const { modalId } = useParams();
+ const { pathname } = useLocation();
+ // const { modalId } = useParams(); is causing regression when using LoadingCard derived components in Federated mode
+ const modalId = pathname.split('/').pop();
useEffect(() => {
if (target === modalId) {
onClick({ value, target });
}
}, [modalId, target]);
- return
{valueToText(value, singular, plural)};
+ return (
+
+ {valueToText(value, singular, plural)}
+
+ );
};
Clickable.propTypes = {
diff --git a/src/components/GeneralInfo/LoadingCard/__snapshots__/LoadingCard.test.js.snap b/src/components/GeneralInfo/LoadingCard/__snapshots__/LoadingCard.test.js.snap
index ed96e6d38..0a488d4af 100644
--- a/src/components/GeneralInfo/LoadingCard/__snapshots__/LoadingCard.test.js.snap
+++ b/src/components/GeneralInfo/LoadingCard/__snapshots__/LoadingCard.test.js.snap
@@ -40,11 +40,10 @@ exports[`LoadingCard Clickable should render - 0 value 1`] = `
value={0}
>
None
@@ -92,11 +91,10 @@ exports[`LoadingCard Clickable should render - no data 1`] = `
onClick={[MockFunction]}
>
Not available
@@ -447,11 +445,10 @@ exports[`LoadingCard Loading card render 1`] = `
value="some value"
>
some value
diff --git a/src/components/GeneralInfo/OperatingSystemCard/__snapshots__/OperatingSystemCard.test.js.snap b/src/components/GeneralInfo/OperatingSystemCard/__snapshots__/OperatingSystemCard.test.js.snap
index 07652f687..582fdfb8c 100644
--- a/src/components/GeneralInfo/OperatingSystemCard/__snapshots__/OperatingSystemCard.test.js.snap
+++ b/src/components/GeneralInfo/OperatingSystemCard/__snapshots__/OperatingSystemCard.test.js.snap
@@ -3234,11 +3234,10 @@ exports[`OperatingSystemCard should render extra 1`] = `
value="1 tests"
>
1 tests
diff --git a/src/components/GeneralInfo/SystemCard/__snapshots__/SystemCard.test.js.snap b/src/components/GeneralInfo/SystemCard/__snapshots__/SystemCard.test.js.snap
index 47dcf199c..e8a30130a 100644
--- a/src/components/GeneralInfo/SystemCard/__snapshots__/SystemCard.test.js.snap
+++ b/src/components/GeneralInfo/SystemCard/__snapshots__/SystemCard.test.js.snap
@@ -4013,8 +4013,7 @@ Array [
>