diff --git a/.changeset/itchy-rockets-hide.md b/.changeset/itchy-rockets-hide.md
new file mode 100644
index 0000000000..ec6df7fa6d
--- /dev/null
+++ b/.changeset/itchy-rockets-hide.md
@@ -0,0 +1,5 @@
+---
+'@backstage/plugin-tech-insights': patch
+---
+
+Make sure to reload score card contents when props change
diff --git a/plugins/tech-insights/src/components/ScorecardsCard/ScorecardsCard.tsx b/plugins/tech-insights/src/components/ScorecardsCard/ScorecardsCard.tsx
index 52909acad9..4bbc283829 100644
--- a/plugins/tech-insights/src/components/ScorecardsCard/ScorecardsCard.tsx
+++ b/plugins/tech-insights/src/components/ScorecardsCard/ScorecardsCard.tsx
@@ -16,10 +16,9 @@
import React from 'react';
import useAsync from 'react-use/lib/useAsync';
-import { Progress } from '@backstage/core-components';
+import { ErrorPanel, Progress } from '@backstage/core-components';
import { useApi } from '@backstage/core-plugin-api';
import { ScorecardInfo } from '../ScorecardsInfo';
-import Alert from '@material-ui/lab/Alert';
import { techInsightsApiRef } from '../../api/TechInsightsApi';
import { useEntity } from '@backstage/plugin-catalog-react';
import { getCompoundEntityRef } from '@backstage/catalog-model';
@@ -31,15 +30,16 @@ export const ScorecardsCard = (props: {
}) => {
const { title, description, checksId } = props;
const api = useApi(techInsightsApiRef);
- const { namespace, kind, name } = getCompoundEntityRef(useEntity().entity);
+ const { entity } = useEntity();
const { value, loading, error } = useAsync(
- async () => await api.runChecks({ namespace, kind, name }, checksId),
+ async () => await api.runChecks(getCompoundEntityRef(entity), checksId),
+ [api, entity, JSON.stringify(checksId)],
);
if (loading) {
return ;
} else if (error) {
- return {error.message};
+ return ;
}
return (