Skip to content

Commit

Permalink
add dev graph card
Browse files Browse the repository at this point in the history
  • Loading branch information
leandroberetta committed Jul 12, 2024
1 parent bc7f90b commit 4e067ed
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion plugins/kiali/dev/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { EntityKialiResourcesCard, kialiPlugin } from '../src';
import { KialiHelper } from '../src/pages/Kiali/KialiHelper';
import { KialiNoAnnotation } from '../src/pages/Kiali/KialiNoAnnotation';
import { KialiNoResources } from '../src/pages/Kiali/KialiNoResources';
import { pluginName } from '../src/plugin';
import { EntityKialiGraphCard, pluginName } from '../src/plugin';
import { rootRouteRef } from '../src/routes';
import { kialiApiRef } from '../src/services/Api';
import { KialiChecker, ValidationCategory } from '../src/store/KialiProvider';
Expand Down Expand Up @@ -50,6 +50,28 @@ const MockEntityCard = () => {
);
};

const MockEntityGraphCard = () => {
const content = (
<EntityProvider entity={mockEntity}>
<div style={{ padding: '20px' }}>
<TestApiProvider apis={[[kialiApiRef, new MockKialiClient()]]}>
<Grid container spacing={3} alignItems="stretch">
<Grid item md={8} xs={12}>
<EntityKialiGraphCard />
</Grid>
</Grid>
</TestApiProvider>
</div>
</EntityProvider>
);

return (
<TestApiProvider apis={[[kialiApiRef, new MockKialiClient()]]}>
{content}
</TestApiProvider>
);
};

const MockKialiError = () => {
const errorsTypes: KialiChecker[] = [
{
Expand Down Expand Up @@ -145,4 +167,9 @@ createDevApp()
title: 'Resources card',
path: '/kiali-entity-card',
})
.addPage({
element: <MockEntityGraphCard />,
title: 'Graph card',
path: '/kiali-graph-card',
})
.render();

0 comments on commit 4e067ed

Please sign in to comment.