Adding migration guide for dashboard and fixing signing doc (#46238)

This commit is contained in:
Timur Olzhabayev
2022-03-07 13:12:13 +01:00
committed by GitHub
parent 6e96506c23
commit 00a8542ecf
2 changed files with 75 additions and 28 deletions

View File

@ -12,31 +12,42 @@ This guide helps you identify the steps you need to take based on the Grafana ve
## Table of contents ## Table of contents
- [From version 8.3.x to 8.4.x](#from-version-83x-to-84x) - [Plugin migration guide](#plugin-migration-guide)
- [Value Mapping Editor has been removed from @grafana-ui library](#value-mapping-editor-has-been-removed-from-grafana-ui-library) - [Introduction](#introduction)
- [Thresholds Editor has been removed from @grafana-ui library](#thresholds-editor-has-been-removed-from-grafana-ui-library) - [Table of contents](#table-of-contents)
- [8.4 Deprecations](#84-deprecations) - [From version 8.3.x to 8.4.x](#from-version-83x-to-84x)
- [LocationService replaces getLocationSrv](#locationservice-replaces-getlocationsrv) - [Value Mapping Editor has been removed from @grafana-ui library](#value-mapping-editor-has-been-removed-from-grafana-ui-library)
- [From version 7.x.x to 8.x.x](#from-version-7xx-to-8xx) - [Thresholds Editor has been removed from @grafana-ui library](#thresholds-editor-has-been-removed-from-grafana-ui-library)
- [Backend plugin v1 support has been dropped](#backend-plugin-v1-support-has-been-dropped) - [8.4 deprecations](#84-deprecations)
- [1. Add dependency on grafana-plugin-sdk-go](#1-add-dependency-on-grafana-plugin-sdk-go) - [LocationService replaces getLocationSrv](#locationservice-replaces-getlocationsrv)
- [2. Update the way you bootstrap your plugin](#2-update-the-way-you-bootstrap-your-plugin) - [From version 7.x.x to 8.x.x](#from-version-7xx-to-8xx)
- [3. Update the plugin package](#3-update-the-plugin-package) - [Backend plugin v1 support has been dropped](#backend-plugin-v1-support-has-been-dropped)
- [Sign and load backend plugins](#sign-and-load-backend-plugins) - [1. Add dependency on grafana-plugin-sdk-go](#1-add-dependency-on-grafana-plugin-sdk-go)
- [Update react-hook-form from v6 to v7](#update-react-hook-form-from-v6-to-v7) - [2. Update the way you bootstrap your plugin](#2-update-the-way-you-bootstrap-your-plugin)
- [Update the plugin.json](#update-the-pluginjson) - [3. Update the plugin package](#3-update-the-plugin-package)
- [Update imports to match emotion 11](#update-imports-to-match-emotion-11) - [Sign and load backend plugins](#sign-and-load-backend-plugins)
- [8.0 Deprecations](#80-deprecations) - [Update react-hook-form from v6 to v7](#update-react-hook-form-from-v6-to-v7)
- [Grafana theme v1](#grafana-theme-v1) - [Update the plugin.json](#update-the-pluginjson)
- [From version 6.2.x to 7.4.0](#from-version-62x-to-740) - [Update imports to match emotion 11](#update-imports-to-match-emotion-11)
- [Legend components](#legend-components) - [Update needed for app plugins using dashboards](#update-needed-for-app-plugins-using-dashboards)
- [From version 6.x.x to 7.0.0](#from-version-6xx-to-700) - [8.0 deprecations](#80-deprecations)
- [What's new in Grafana 7.0?](#whats-new-in-grafana-70) - [Grafana theme v1](#grafana-theme-v1)
- [Migrate a plugin from Angular to React](#migrate-a-plugin-from-angular-to-react) - [From version 6.2.x to 7.4.0](#from-version-62x-to-740)
- [Migrate a panel plugin](#migrate-a-panel-plugin) - [Legend components](#legend-components)
- [Migrate a data source plugin](#migrate-a-data-source-plugin) - [From version 6.5.x to 7.3.0](#from-version-65x-to-730)
- [Migrate to data frames](#migrate-to-data-frames) - [getColorForTheme changes](#getcolorfortheme-changes)
- [Troubleshoot plugin migration](#troubleshoot-plugin-migration) - [From version 6.x.x to 7.0.0](#from-version-6xx-to-700)
- [What's new in Grafana 7.0?](#whats-new-in-grafana-70)
- [New data format](#new-data-format)
- [Improved TypeScript support](#improved-typescript-support)
- [Grafana Toolkit](#grafana-toolkit)
- [Field options](#field-options)
- [Backend plugins](#backend-plugins)
- [Migrate a plugin from Angular to React](#migrate-a-plugin-from-angular-to-react)
- [Migrate a panel plugin](#migrate-a-panel-plugin)
- [Migrate a data source plugin](#migrate-a-data-source-plugin)
- [Migrate to data frames](#migrate-to-data-frames)
- [Troubleshoot plugin migration](#troubleshoot-plugin-migration)
## From version 8.3.x to 8.4.x ## From version 8.3.x to 8.4.x
@ -308,6 +319,42 @@ import { cx, css } from 'emotion';
import { cx, css } from '@emotion/css'; import { cx, css } from '@emotion/css';
``` ```
### Update needed for app plugins using dashboards
To make side navigation work properly - app plugins targeting Grafana `8.+` and integrating into the side menu via [addToNav]({{< relref "metadata.md#properties-4" >}}) property need to adjust their `plugin.json` and all dashboard json files to have a matching `uid`.
**`plugin.json`**
```json "linenos=inline,hl_lines=7,linenostart=1"
{
"id": "plugin-id",
// ...
"includes": [
{
"type": "dashboard",
"name": "(Team) Situation Overview",
"path": "dashboards/example-dashboard.json",
"addToNav": true,
"defaultNav": false,
"uid": "l3KqBxCMz"
}
]
// ...
}
```
**`dashboards/example-dashboard.json`**
```json
{
// ...
"title": "Example Dashboard",
"uid": "l3KqBxCMz",
"version": 1
// ...
}
```
### 8.0 deprecations ### 8.0 deprecations
#### Grafana theme v1 #### Grafana theme v1

View File

@ -32,9 +32,9 @@ To verify ownership of your plugin, you need to generate an API key that you'll
Public plugins need to be reviewed by the Grafana team before you can sign them. Public plugins need to be reviewed by the Grafana team before you can sign them.
1. Submit your plugin for review by creating a pull request in the [grafana-plugin-repository](https://github.com/grafana/grafana-plugin-repository). 1. Submit your plugin for [review]({{< relref "package-a-plugin.md#publishing-your-plugin-for-the-first-time" >}})
1. When your plugin is approved, you're granted a plugin signature level. **Without a plugin signature level, you won't be able to sign your plugin**. 2. When your plugin is approved, you're granted a plugin signature level. **Without a plugin signature level, you won't be able to sign your plugin**.
1. In your plugin directory, sign the plugin with the API key you just created. Grafana Toolkit creates a [MANIFEST.txt](#plugin-manifest) file in the `dist` directory of your plugin. 3. In your plugin directory, sign the plugin with the API key you just created. Grafana Toolkit creates a [MANIFEST.txt](#plugin-manifest) file in the `dist` directory of your plugin.
```bash ```bash
export GRAFANA_API_KEY=<YOUR_API_KEY> export GRAFANA_API_KEY=<YOUR_API_KEY>