Files
grafana/e2e/test-plugins/grafana-extensionstest-app/pages/AddedLinks.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

26 lines
711 B
TypeScript

import { PluginPage, usePluginLinks } from '@grafana/runtime';
import { testIds } from '../testIds';
export const LINKS_EXTENSION_POINT_ID = 'plugins/grafana-extensionstest-app/use-plugin-links/v1';
export function AddedLinks() {
const { links, isLoading } = usePluginLinks({ extensionPointId: LINKS_EXTENSION_POINT_ID });
return (
<PluginPage>
<div data-testid={testIds.addedLinksPage.container}>
{isLoading ? (
<div>Loading...</div>
) : (
links.map(({ id, title, path, onClick }) => (
<a href={path} title={title} key={id} onClick={onClick}>
{title}
</a>
))
)}
</div>
</PluginPage>
);
}