Files
grafana/e2e/test-plugins/grafana-extensionstest-app/pages/AddedComponents.tsx
Erik Sundell 1373b37166 Plugin Extensions: E2E test addLink and legacy APIs (#92394)
* cleanup tests

* more cleanup

* added links

* test legacy hooks

* test legacy hooks

* update codeowners

* revert package changes

* add project specfic example script

* remove console log

* Update .github/CODEOWNERS

Co-authored-by: Timur Olzhabayev <timur.olzhabayev@grafana.com>

* Update CODEOWNERS

* use correct file names

* cleanup tests

---------

Co-authored-by: Timur Olzhabayev <timur.olzhabayev@grafana.com>
2024-08-26 16:01:32 +02:00

28 lines
814 B
TypeScript

import { PluginPage, usePluginComponents } from '@grafana/runtime';
import { Stack } from '@grafana/ui';
import { testIds } from '../testIds';
type ReusableComponentProps = {
name: string;
};
export function AddedComponents() {
const { components } = usePluginComponents<ReusableComponentProps>({
extensionPointId: 'plugins/grafana-extensionexample2-app/addComponent/v1',
});
return (
<PluginPage>
<Stack direction={'column'} gap={4} data-testid={testIds.addedComponentsPage.container}>
<article>
<h3>Component extensions defined with addComponent and retrived with usePluginComponents hook</h3>
{components.map((Component, i) => {
return <Component key={i} name="World" />;
})}
</article>
</Stack>
</PluginPage>
);
}