Files
grafana/e2e/custom-plugins/app-with-extension-point/plugins/myorg-b-app/module.js
T
Erik Sundell 72241dbf5f Plugin extensions: Add e2e tests (#89048)
* add custom plugins

* update bundles

* provision app plugins and their dashboards

* add one more script that run e2e tests using e2e test server

* add e2e tests

* regenerate jsonnet dashboards

* ignore custom plugins and playwright report

* use minified

* cleanup tests

* update codeowners

* add leading slash

* document new script

* document custom-plugins

* cleanup

* twist modules

* add readme
2024-06-14 13:41:17 +02:00

28 lines
792 B
JavaScript

define(['react', '@grafana/data'], function (React, data) {
'use strict';
class RootComponent extends React.PureComponent {
render() {
return React.createElement('div', { className: 'page-container' }, 'Hello Grafana!');
}
}
const modalId = 'b-app-modal';
const plugin = new data.AppPlugin().setRootPage(RootComponent).configureExtensionLink({
title: 'Open from B',
description: 'Open a modal from plugin B',
extensionPointId: 'plugins/myorg-extensionpoint-app/actions',
onClick: function (e, { openModal }) {
openModal({
title: 'Modal from app B',
body: function () {
return React.createElement('div', { 'data-testid': modalId }, 'From plugin B');
},
});
},
});
return { plugin: plugin };
});