From d406e6d8995cbdfbabebcef7b13e4c8145a4040c Mon Sep 17 00:00:00 2001 From: Marcus Andersson Date: Fri, 30 Sep 2022 13:17:11 +0200 Subject: [PATCH] Docs: Added icon type improvements to plugin migration guide (#56075) --- .../developers/plugins/migration-guide.md | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/docs/sources/developers/plugins/migration-guide.md b/docs/sources/developers/plugins/migration-guide.md index 8b525640f69..8269d182272 100644 --- a/docs/sources/developers/plugins/migration-guide.md +++ b/docs/sources/developers/plugins/migration-guide.md @@ -17,6 +17,8 @@ This guide helps you identify the steps required to update a plugin from the Gra - [Plugin migration guide](#plugin-migration-guide) - [Introduction](#introduction) - [Table of contents](#table-of-contents) + - [From version 9.1.x to 9.2.x](#from-version-91x-to-92x) + - [NavModelItem requires a valid icon name](#navmodelitem-requires-a-valid-icon-name) - [From version 8.x to 9.x](#from-version-8x-to-9x) - [9.0 breaking changes](#90-breaking-changes) - [theme.visualization.getColorByName replaces getColorForTheme](#themevisualizationgetcolorbyname-replaces-getcolorfortheme) @@ -60,6 +62,32 @@ This guide helps you identify the steps required to update a plugin from the Gra - [Migrate to data frames](#migrate-to-data-frames) - [Troubleshoot plugin migration](#troubleshoot-plugin-migration) +## From version 9.1.x to 9.2.x + +### NavModelItem requires a valid icon name + +The typings of the `NavModelItem` have improved to only allow a valid `IconName` for the icon property. You can find the complete list of valid icons [here](https://github.com/grafana/grafana/blob/v9.2.0-beta1/packages/grafana-data/src/types/icon.ts). The icons specified in the list will work for older versions of Grafana 9. + +Example: + +```ts +// before +const model: NavModelItem = { + id: 'settings', + text: 'Settings', + icon: 'fa fa-cog', + url: `${baseUrl}/settings`, +}; + +// after +const model: NavModelItem = { + id: 'settings', + text: 'Settings', + icon: 'cog', + url: `${baseUrl}/settings`, +}; +``` + ## From version 8.x to 9.x ### 9.0 breaking changes