Skip to content

Commit

Permalink
Merge pull request #2518 from headlamp-k8s/crinstances-multi
Browse files Browse the repository at this point in the history
frontend: CustomResourceInstancesList: Fix to work with multi cluster
  • Loading branch information
illume authored Nov 22, 2024
2 parents ce1e2f3 + 4d192e6 commit ef7bee1
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions frontend/src/components/crd/CustomResourceInstancesList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,14 @@ import { ResourceListView } from '../common/Resource';
function CrInstancesView({ crds }: { crds: CRD[]; key: string }) {
const { t } = useTranslation(['glossary', 'translation']);

const crdInfo = useMemo(() => crds.map(crd => crd.makeCRClass()), [crds]);
const queries = crdInfo.map(cr => cr.useList());
const dataClassCrds = crds.map(crd => {
const crdClass = crd.makeCRClass();
const data = crdClass.useList({ cluster: crd.cluster });
return { data, crdClass, crd };
});

const queries = dataClassCrds.map(it => it.data);

const [isWarningClosed, setIsWarningClosed] = useState(false);

const { crInstancesList, getCRDForCR, isLoading, crdsFailedToLoad, allFailed } = useMemo(() => {
Expand Down Expand Up @@ -112,6 +118,7 @@ function CrInstancesView({ crds }: { crds: CRD[]; key: string }) {
);
},
},
'cluster',
{
label: 'Categories',
getValue: cr => {
Expand Down

0 comments on commit ef7bee1

Please sign in to comment.