From 73a881c9547bc75e9ea363d7dc68e9e100fbeb79 Mon Sep 17 00:00:00 2001 From: "Grot (@grafanabot)" <43478413+grafanabot@users.noreply.github.com> Date: Tue, 24 Jan 2023 16:05:19 +0000 Subject: [PATCH 01/14] [v9.3.x] Docs: prose and format updates (#61996) Docs: prose and format updates (#61720) * wording and format updates * corrects typo (cherry picked from commit 12a4a83c777675d8b01dd1ec4c3860e71ff797d7) Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> --- docs/sources/setup-grafana/upgrade-grafana.md | 163 ++++++++++++------ 1 file changed, 106 insertions(+), 57 deletions(-) diff --git a/docs/sources/setup-grafana/upgrade-grafana.md b/docs/sources/setup-grafana/upgrade-grafana.md index a379fd75a64..40297fc2d7e 100644 --- a/docs/sources/setup-grafana/upgrade-grafana.md +++ b/docs/sources/setup-grafana/upgrade-grafana.md @@ -13,33 +13,33 @@ weight: 500 # Upgrade Grafana -We recommend that you upgrade Grafana often to stay up to date with the latest fixes and enhancements. -In order to make this a reality, Grafana upgrades are backward compatible and the upgrade process is simple and quick. +We recommend that you upgrade Grafana often to stay current with the latest fixes and enhancements. +Because Grafana upgrades are backward compatible, the upgrade process is straightforward. Upgrading between many minor versions and one major version is generally safe, and dashboards and graphs will not change. -Upgrading between many minor versions and one major version is generally safe, and dashboards and graphs will look the same. -There might be minor breaking changes in some releases. -We outline these in the [What's New overviews]({{< relref "../whatsnew/" >}}) for each release. -For versions of Grafana prior to v9.2, we also published additional information in the [Release Notes]({{< relref "../release-notes/" >}}). -We also list all changes, with links to pull requests or issues when available, in the [Changelog](https://github.com/grafana/grafana/blob/main/CHANGELOG.md). +In addition to common tasks you should complete for all versions of Grafana, there might be additional upgrade tasks to complete for a version. -## Backup +> **Note:** There might be minor breaking changes in some releases. We outline these in the [What's New ]({{< relref "../whatsnew/" >}}) document for each release. -We recommend that you backup a few things in case you have to rollback the upgrade. +For versions of Grafana prior to v9.2, we published additional information in the [Release Notes]({{< relref "../release-notes/" >}}). -- Installed plugins - Back them up before you upgrade them in case you want to rollback the Grafana version and want to get the exact same versions you were running before the upgrade. -- Configuration files do not need to be backed up. However, you might want to in case you add new configuration options after upgrade and then rollback. +When available, we list all changes with links to pull requests or issues in the [Changelog](https://github.com/grafana/grafana/blob/main/CHANGELOG.md). -### Database backup +> **Note:** When possible, we recommend that you test the Grafana upgrade process in a test or development environment. -Before upgrading it can be a good idea to backup your Grafana database. This will ensure that you can always rollback to your previous version. During startup, Grafana will automatically migrate the database schema (if there are changes or new tables). Sometimes this can cause issues if you later want to downgrade. +## Back up the Grafana database -#### sqlite +Although Grafana automatically upgrades the database on startup, we recommend that you back up your Grafana database so that you can roll back to a previous version, if required. -If you use sqlite you only need to make a backup of your `grafana.db` file. This is usually located at `/var/lib/grafana/grafana.db` on Unix systems. -If you are unsure what database you use and where it is stored check you grafana configuration file. If you -installed grafana to custom location using a binary tar/zip it is usually in `/data`. +### sqlite -#### mysql +If you use sqlite, you only need to back up the `grafana.db` file. On Unix systems, the database file is usually located in `/var/lib/grafana/`. + +If you are unsure which database you use and where it is stored, check the Grafana configuration file. If you +installed Grafana to a custom location using a binary tar/zip, the database is usually located in `/data`. + +### mysql + +To back up or restore a mysql Grafana database, run the following commands: ```bash backup: @@ -49,7 +49,9 @@ restore: > mysql -u root -p grafana < grafana_backup.sql ``` -#### postgres +### postgres + +To back up or restore a postgres Grafana database, run the following commands: ```bash backup: @@ -59,70 +61,117 @@ restore: > psql grafana < grafana_backup ``` -### Ubuntu or Debian +## Backup plugins -You can upgrade Grafana by following the same procedure as when you installed it. +We recommend that you back up installed plugins before you upgrade Grafana so that you can roll back to a previous version of Grafana, if necessary. -#### Upgrade Debian package +## Upgrade Grafana -If you installed Grafana by downloading a Debian package (`.deb`), then you can execute the same `dpkg -i` command but with the new package. It will upgrade your Grafana installation. +The following sections provide instructions for how to upgrade Grafana based on your installation method. -Go to the [download page](https://grafana.com/grafana/download?platform=linux) for the latest download -links. +### Debian -```bash -wget -sudo apt-get install -y adduser -sudo dpkg -i grafana__amd64.deb -``` +To upgrade Grafana installed from a Debian package (`.deb`), complete the following steps: -#### Upgrade from APT repository +1. In your current installation of Grafana, save your custom configuration changes to a file named `/conf/custom.ini`. -If you installed Grafana from our APT repository, then Grafana will automatically update when you run apt-get upgrade to upgrade all system packages. + This enables you to upgrade Grafana without the risk of losing your configuration changes. -```bash -sudo apt-get update -sudo apt-get upgrade -``` +1. [Download](https://grafana.com/grafana/download?platform=linux) the latest version of Grafana. -#### Upgrade from binary .tar file +1. Execute the `dpkg -i` command. -If you downloaded the binary `.tar.gz` package, then you can just download and extract the new package and overwrite all your existing files. However, this might overwrite your config changes. + ```bash + wget + sudo apt-get install -y adduser + sudo dpkg -i grafana__amd64.deb + ``` -We recommend that you save your custom configuration changes in a file named `/conf/custom.ini`. -This allows you to upgrade Grafana without risking losing your configuration changes. +### APT repository -### Centos / RHEL +To upgrade Grafana installed from the Grafana Labs APT repository, complete the following steps: -If you installed Grafana by downloading an RPM package you can just follow the same installation guide and execute the same `yum install` or `rpm -i` command but with the new package. It will upgrade your Grafana installation. +1. In your current installation of Grafana, save your custom configuration changes to a file named `/conf/custom.ini`. -If you used our YUM repository: + This enables you to upgrade Grafana without the risk of losing your configuration changes. -```bash -sudo yum update grafana -``` +1. Run the following command. + + ```bash + sudo apt-get update + sudo apt-get upgrade + ``` + +Grafana automatically updates when you run `apt-get upgrade`. + +### Binary .tar file + +To upgrade Grafana installed from the binary `.tar.gz` package, complete the following steps: + +1. In your current installation of Grafana, save your custom configuration changes to a file named `/conf/custom.ini`. + + This enables you to upgrade Grafana without the risk of losing your configuration changes. + +1. [Download](https://grafana.com/grafana/download) the binary `.tar.gz` package. + +1. Extract the downloaded package and overwrite the existing files. + +### Centos or RHEL + +To upgrade Grafana running on Centos or RHEL, complete the following steps: + +1. In your current installation of Grafana, save your custom configuration changes to a file named `/conf/custom.ini`. + + This enables you to upgrade Grafana without the risk of losing your configuration changes. + +1. Perform one of the following steps based on your installation. + + - If you [downloaded an RPM package](https://grafana.com/grafana/download) to install Grafana, then complete the steps documented in [Install on RPM-based Linux]({{< relref "./installation/rpm" >}}) to upgrade Grafana. + - If you used the Grafana YUM repository, execute the following command: + + ```bash + sudo yum update grafana + ``` ### Docker -This just an example, details depend on how you configured your grafana container. +To upgrade Grafana running in a Docker container, complete the following steps: -```bash -docker pull grafana/grafana -docker stop my-grafana-container -docker rm my-grafana-container -docker run -d --name=my-grafana-container --restart=always -v /var/lib/grafana:/var/lib/grafana grafana/grafana -``` +1. In your current installation of Grafana, save your custom configuration changes to a file named `/conf/custom.ini`. + + This enables you to upgrade Grafana without the risk of losing your configuration changes. + +1. Run a command similar to the following command. + + > **Note:** This is an example. The parameters you enter depend on how you configured your Grafana container. + + ```bash + docker pull grafana/grafana + docker stop my-grafana-container + docker rm my-grafana-container + docker run -d --name=my-grafana-container --restart=always -v /var/lib/grafana:/var/lib/grafana grafana/grafana + ``` ### Windows -If you downloaded the Windows binary package you can just download a newer package and extract to the same location (and overwrite the existing files). This might overwrite your configuration changes. We recommend that you save your configuration changes in a file named `/conf/custom.ini` as this will make upgrades easier without risking losing your configuration changes. +To upgrade Grafana installed on Windows, complete the following steps: -## Update plugins +1. In your current installation of Grafana, save your custom configuration changes to a file named `/conf/custom.ini`. -After you have upgraded, we strongly recommend that you update all your plugins as a new version of Grafana + This enables you to upgrade Grafana without the risk of losing your configuration changes. + +1. [Download](https://grafana.com/grafana/download) the Windows binary package. + +1. Extract the contents of the package to the location in which you installed Grafana. + + You can overwrite existing files and folders, when prompted. + +## Update Grafana plugins + +After you upgrade Grafana, we recommend that you update all plugins because a new version of Grafana can make older plugins stop working properly. -You can update all plugins using +Run the following command to update plugins: ```bash grafana-cli plugins update-all From 47f924d915e981cfa7451bdedf04db2890a6cc6e Mon Sep 17 00:00:00 2001 From: "Grot (@grafanabot)" <43478413+grafanabot@users.noreply.github.com> Date: Tue, 24 Jan 2023 16:32:36 +0000 Subject: [PATCH 02/14] [v9.3.x] Datasources: Fix Proxy by UID Failing for UIDs with a Hyphen (#62011) Datasources: Fix Proxy by UID Failing for UIDs with a Hyphen (#61723) Fix Proxy by UID Failing for UIDs with a Hyphen Hyphens are allowed in short IDs but not picked up by the proxyPathRegexp. This caused the end of the uid to be proxied as part of the path to the backing datasource which would usually cause a 404. (cherry picked from commit f85d072c17383c938b61d997a8604d0bad103dfc) Co-authored-by: Chris Marchbanks --- pkg/services/datasourceproxy/datasourceproxy.go | 2 +- pkg/services/datasourceproxy/datasourceproxy_test.go | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/pkg/services/datasourceproxy/datasourceproxy.go b/pkg/services/datasourceproxy/datasourceproxy.go index 0590376c741..b6680121801 100644 --- a/pkg/services/datasourceproxy/datasourceproxy.go +++ b/pkg/services/datasourceproxy/datasourceproxy.go @@ -131,7 +131,7 @@ func (p *DataSourceProxyService) proxyDatasourceRequest(c *models.ReqContext, ds proxy.HandleRequest() } -var proxyPathRegexp = regexp.MustCompile(`^\/api\/datasources\/proxy\/([\d]+|uid\/[\w]+)\/?`) +var proxyPathRegexp = regexp.MustCompile(`^\/api\/datasources\/proxy\/([\d]+|uid\/[\w-]+)\/?`) func extractProxyPath(originalRawPath string) string { return proxyPathRegexp.ReplaceAllString(originalRawPath, "") diff --git a/pkg/services/datasourceproxy/datasourceproxy_test.go b/pkg/services/datasourceproxy/datasourceproxy_test.go index 6567ba579c5..57da4aa33c0 100644 --- a/pkg/services/datasourceproxy/datasourceproxy_test.go +++ b/pkg/services/datasourceproxy/datasourceproxy_test.go @@ -32,6 +32,14 @@ func TestDataProxy(t *testing.T) { "/api/datasources/proxy/uid/26MI0wZ7k/some/thing", "some/thing", }, + { + "/api/datasources/proxy/uid/pUWo-no4k/search", + "search", + }, + { + "/api/datasources/proxy/uid/pUWo_no4k/search", + "search", + }, { "/api/datasources/proxy/uid/26MI0wZ7k/api/services/afsd%2Fafsd/operations", "api/services/afsd%2Fafsd/operations", From 9d5b13b56513af28db8fa09e9e6b16f7571c6656 Mon Sep 17 00:00:00 2001 From: "Grot (@grafanabot)" <43478413+grafanabot@users.noreply.github.com> Date: Tue, 24 Jan 2023 17:33:45 +0000 Subject: [PATCH 03/14] [v9.3.x] Explore: Be sure time range key bindings are mounted after clear (#62020) Explore: Be sure time range key bindings are mounted after clear (#61892) * Add list of bindings for updating on change * Revert "Add list of bindings for updating on change" This reverts commit 092707371d0c387c3ee9522b77bef3a72c62797f. * Clear keybindings before component render (cherry picked from commit 6ab79c4fba115f24ac0fd398c2909e15a4367d33) Co-authored-by: Kristina --- public/app/core/navigation/GrafanaRoute.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/public/app/core/navigation/GrafanaRoute.tsx b/public/app/core/navigation/GrafanaRoute.tsx index 9cfa4f6e224..1bfe2765013 100644 --- a/public/app/core/navigation/GrafanaRoute.tsx +++ b/public/app/core/navigation/GrafanaRoute.tsx @@ -1,4 +1,4 @@ -import React, { Suspense, useEffect } from 'react'; +import React, { Suspense, useEffect, useLayoutEffect } from 'react'; // @ts-ignore import Drop from 'tether-drop'; @@ -18,9 +18,11 @@ export function GrafanaRoute(props: Props) { chrome.setMatchedRoute(props.route); - useEffect(() => { + useLayoutEffect(() => { keybindings.clearAndInitGlobalBindings(); + }, [keybindings]); + useEffect(() => { updateBodyClassNames(props.route); cleanupDOM(); navigationLogger('GrafanaRoute', false, 'Mounted', props.match); From 9be71e5175d90ec6bc6c0f7c5e96073dd3fadfb0 Mon Sep 17 00:00:00 2001 From: "Grot (@grafanabot)" <43478413+grafanabot@users.noreply.github.com> Date: Tue, 24 Jan 2023 20:37:09 +0000 Subject: [PATCH 04/14] [v9.3.x] Docs: corrects broken link to v9.0 docs (#62036) Docs: corrects broken link to v9.0 docs (#62035) corrects broken link to v9.0 docs (cherry picked from commit 0f93548ac4d3786df3871c2c57a3b5f647a0ad09) Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com> --- docs/sources/datasources/azure-monitor/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sources/datasources/azure-monitor/_index.md b/docs/sources/datasources/azure-monitor/_index.md index ea4ba6753f2..cc5a98c11d0 100644 --- a/docs/sources/datasources/azure-monitor/_index.md +++ b/docs/sources/datasources/azure-monitor/_index.md @@ -157,4 +157,4 @@ Until Grafana v8.0, you could query the same Azure Application Insights data usi These queries were deprecated in Grafana v7.5. In Grafana v8.0, Application Insights and Insights Analytics were made read-only in favor of querying this data through Metrics and Logs. These query methods were completely removed in Grafana v9.0. -If you're upgrading from a Grafana version prior to v9.0 and relied on Application Insights and Analytics queries, refer to the [Grafana v9.0 documentation](/v9.0/datasources/azuremonitor/deprecated-application-insights/) for help migrating these queries to Metrics and Logs queries. +If you're upgrading from a Grafana version prior to v9.0 and relied on Application Insights and Analytics queries, refer to the [Grafana v9.0 documentation](/docs/grafana/v9.0/datasources/azuremonitor/deprecated-application-insights/) for help migrating these queries to Metrics and Logs queries. From 594b5cdd95a4709861a0ffd7b3b4549b009b65a7 Mon Sep 17 00:00:00 2001 From: Esteban Beltran Date: Wed, 25 Jan 2023 09:04:22 +0000 Subject: [PATCH 05/14] =?UTF-8?q?Docs:=20Update=20publish=20a=20plugin=20F?= =?UTF-8?q?AQ=20to=20cover=20more=20common=20questions=20(#62=E2=80=A6=20(?= =?UTF-8?q?#62063)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../developers/plugins/package-a-plugin.md | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/docs/sources/developers/plugins/package-a-plugin.md b/docs/sources/developers/plugins/package-a-plugin.md index c37835d9943..885ed3fbd15 100644 --- a/docs/sources/developers/plugins/package-a-plugin.md +++ b/docs/sources/developers/plugins/package-a-plugin.md @@ -98,8 +98,28 @@ To speed up the time it takes to review your plugin: - We're not able to give an estimate at this time, though we're constantly working on improving the time it takes to review a plugin. +**Can I see metrics of my plugin installs, downloads or usage?** + +- No. We don't offer this information at the moment to plugin authors. + +**How can I update my plugin's catalog page?** + +- The plugin's catalog page content is extracted from the plugin README file. To update the plugin's catalog page, it is necessary to submit an updated plugin with the new content included in the README file. + +**Can I unlist my plugin from the Grafana Plugin's Catalog in case of a bug?** + +- In the event of a bug, unlisting the plugin from the Grafana Plugin's Catalog may be possible in exceptional cases, such as security concerns. However, we do not have control over the specific instances where the plugin is installed. + +**Can I distribute my plugin somewhere else than the Grafana Catalog?** + +- The official method for distributing Grafana plugins is through the Grafana Catalog. Alternative methods, such as installing private or development plugins on local Grafana instances, are available as per the guidelines provided in [this guide](https://grafana.com/docs/grafana/latest/administration/plugin-management/#install-plugin-on-local-grafana). + ## Publishing your plugin for the first time +**Do plugin signatures expire?** + +- Plugin signatures do not currently expire. + {{< figure src="/static/img/docs/plugins/plugins-submission-create2.png" class="docs-image--no-shadow" max-width="650px" >}} 1. [Sign in](https://grafana.com/auth/sign-in) to your Grafana Cloud account. From 57365697686c2c868049e0557ac491642fa221d6 Mon Sep 17 00:00:00 2001 From: "Grot (@grafanabot)" <43478413+grafanabot@users.noreply.github.com> Date: Wed, 25 Jan 2023 09:38:33 +0000 Subject: [PATCH 06/14] [v9.3.x] Changelog: Updated changelog for 9.3.4 (#62068) Changelog: Updated changelog for 9.3.4 (#62067) (cherry picked from commit 8c3e4487bac32c438c2a2723bb380022886183ba) --- CHANGELOG.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c3e61f94d8d..d3827883fca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,30 @@ + + +# 9.3.4 (2023-01-25) + +### Features and enhancements + +- **Prometheus:** Add default editor configuration. [#61510](https://github.com/grafana/grafana/pull/61510), [@itsmylife](https://github.com/itsmylife) +- **TextPanel:** Refactor to functional component (#60885). [#61937](https://github.com/grafana/grafana/pull/61937), [@ryantxu](https://github.com/ryantxu) + +### Bug fixes + +- **Alerting:** Fix webhook to use correct key for decrypting token. [#61717](https://github.com/grafana/grafana/pull/61717), [@yuri-tceretian](https://github.com/yuri-tceretian) +- **Alerting:** Set error annotation on EvaluationError regardless of underlying error type. [#61506](https://github.com/grafana/grafana/pull/61506), [@alexweav](https://github.com/alexweav) +- **Datasources:** Fix Proxy by UID Failing for UIDs with a Hyphen. [#61723](https://github.com/grafana/grafana/pull/61723), [@csmarchbanks](https://github.com/csmarchbanks) +- **Elasticsearch:** Fix creating of span link with no tags. [#61753](https://github.com/grafana/grafana/pull/61753), [@ivanahuckova](https://github.com/ivanahuckova) +- **Elasticsearch:** Fix failing requests when using SigV4. [#61923](https://github.com/grafana/grafana/pull/61923), [@svennergr](https://github.com/svennergr) +- **Elasticsearch:** Fix toggle-settings are not shown correctly. [#61751](https://github.com/grafana/grafana/pull/61751), [@svennergr](https://github.com/svennergr) +- **Explore:** Be sure time range key bindings are mounted after clear. [#61892](https://github.com/grafana/grafana/pull/61892), [@gelicia](https://github.com/gelicia) +- **Explore:** Unsync time ranges when a pane is closed. [#61369](https://github.com/grafana/grafana/pull/61369), [@Elfo404](https://github.com/Elfo404) +- **Logs:** Lines with long words do not break properly. [#61707](https://github.com/grafana/grafana/pull/61707), [@svennergr](https://github.com/svennergr) +- **Loki:** Fix misaligned derived fields settings. [#61475](https://github.com/grafana/grafana/pull/61475), [@svennergr](https://github.com/svennergr) +- **Query Builder:** Fix max width of input component to prevent overflows. [#61798](https://github.com/grafana/grafana/pull/61798), [@matyax](https://github.com/matyax) +- **Search:** Auto focus input elements. [#61443](https://github.com/grafana/grafana/pull/61443), [@ryantxu](https://github.com/ryantxu) +- **Search:** Fix empty folder message showing when by starred dashboards. [#61610](https://github.com/grafana/grafana/pull/61610), [@eledobleefe](https://github.com/eledobleefe) +- **Table Panel:** Fix image of image cell overflowing table cell and cells ignoring text alignment setting when a data link is added. [#59392](https://github.com/grafana/grafana/pull/59392), [@oscarkilhed](https://github.com/oscarkilhed) + + # 9.3.2 (unreleased) From 0d00936ba7cdf688bef9976e3770a56318f3832e Mon Sep 17 00:00:00 2001 From: "Grot (@grafanabot)" <43478413+grafanabot@users.noreply.github.com> Date: Wed, 25 Jan 2023 09:49:04 +0000 Subject: [PATCH 07/14] Release: Bump version to 9.3.5 (#62074) "Release: Updated versions in package to 9.3.5" --- lerna.json | 2 +- package.json | 2 +- packages/grafana-data/package.json | 4 +- packages/grafana-e2e-selectors/package.json | 2 +- packages/grafana-e2e/package.json | 4 +- packages/grafana-runtime/package.json | 8 ++-- packages/grafana-schema/package.json | 2 +- packages/grafana-toolkit/package.json | 6 +-- packages/grafana-ui/package.json | 8 ++-- packages/jaeger-ui-components/package.json | 10 ++-- .../internal/input-datasource/package.json | 8 ++-- yarn.lock | 46 +++++++++---------- 12 files changed, 51 insertions(+), 51 deletions(-) diff --git a/lerna.json b/lerna.json index f7084f331e1..1e2949d99c1 100644 --- a/lerna.json +++ b/lerna.json @@ -4,5 +4,5 @@ "packages": [ "packages/*" ], - "version": "9.3.3" + "version": "9.3.5" } diff --git a/package.json b/package.json index 9b26dd8b9c4..c7e8a32f903 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "license": "AGPL-3.0-only", "private": true, "name": "grafana", - "version": "9.3.3", + "version": "9.3.5", "repository": "github:grafana/grafana", "scripts": { "build": "yarn i18n:compile && NODE_ENV=production webpack --config scripts/webpack/webpack.prod.js", diff --git a/packages/grafana-data/package.json b/packages/grafana-data/package.json index 176be2390c1..17733a63823 100644 --- a/packages/grafana-data/package.json +++ b/packages/grafana-data/package.json @@ -2,7 +2,7 @@ "author": "Grafana Labs", "license": "Apache-2.0", "name": "@grafana/data", - "version": "9.3.3", + "version": "9.3.5", "description": "Grafana Data Library", "keywords": [ "typescript" @@ -36,7 +36,7 @@ }, "dependencies": { "@braintree/sanitize-url": "6.0.1", - "@grafana/schema": "9.3.3", + "@grafana/schema": "9.3.5", "@types/d3-interpolate": "^1.4.0", "d3-interpolate": "1.4.0", "date-fns": "2.29.3", diff --git a/packages/grafana-e2e-selectors/package.json b/packages/grafana-e2e-selectors/package.json index a14a4d3ec95..b7bc01f1493 100644 --- a/packages/grafana-e2e-selectors/package.json +++ b/packages/grafana-e2e-selectors/package.json @@ -2,7 +2,7 @@ "author": "Grafana Labs", "license": "Apache-2.0", "name": "@grafana/e2e-selectors", - "version": "9.3.3", + "version": "9.3.5", "description": "Grafana End-to-End Test Selectors Library", "keywords": [ "cli", diff --git a/packages/grafana-e2e/package.json b/packages/grafana-e2e/package.json index 72b50c0121f..f5ee02b97d2 100644 --- a/packages/grafana-e2e/package.json +++ b/packages/grafana-e2e/package.json @@ -2,7 +2,7 @@ "author": "Grafana Labs", "license": "Apache-2.0", "name": "@grafana/e2e", - "version": "9.3.3", + "version": "9.3.5", "description": "Grafana End-to-End Test Library", "keywords": [ "cli", @@ -63,7 +63,7 @@ "@babel/core": "7.19.6", "@babel/preset-env": "7.19.4", "@cypress/webpack-preprocessor": "5.15.2", - "@grafana/e2e-selectors": "9.3.3", + "@grafana/e2e-selectors": "9.3.5", "@grafana/tsconfig": "^1.2.0-rc1", "@mochajs/json-file-reporter": "^1.2.0", "babel-loader": "9.1.0", diff --git a/packages/grafana-runtime/package.json b/packages/grafana-runtime/package.json index 586d0ce3a28..6d489ace79e 100644 --- a/packages/grafana-runtime/package.json +++ b/packages/grafana-runtime/package.json @@ -2,7 +2,7 @@ "author": "Grafana Labs", "license": "Apache-2.0", "name": "@grafana/runtime", - "version": "9.3.3", + "version": "9.3.5", "description": "Grafana Runtime Library", "keywords": [ "grafana", @@ -37,10 +37,10 @@ "postpack": "mv package.json.bak package.json" }, "dependencies": { - "@grafana/data": "9.3.3", - "@grafana/e2e-selectors": "9.3.3", + "@grafana/data": "9.3.5", + "@grafana/e2e-selectors": "9.3.5", "@grafana/faro-web-sdk": "1.0.0-beta2", - "@grafana/ui": "9.3.3", + "@grafana/ui": "9.3.5", "@sentry/browser": "6.19.7", "history": "4.10.1", "lodash": "4.17.21", diff --git a/packages/grafana-schema/package.json b/packages/grafana-schema/package.json index 6f9ce57905e..e183d454cd7 100644 --- a/packages/grafana-schema/package.json +++ b/packages/grafana-schema/package.json @@ -2,7 +2,7 @@ "author": "Grafana Labs", "license": "Apache-2.0", "name": "@grafana/schema", - "version": "9.3.3", + "version": "9.3.5", "description": "Grafana Schema Library", "keywords": [ "typescript" diff --git a/packages/grafana-toolkit/package.json b/packages/grafana-toolkit/package.json index e8063589824..42de1ca8b44 100644 --- a/packages/grafana-toolkit/package.json +++ b/packages/grafana-toolkit/package.json @@ -2,7 +2,7 @@ "author": "Grafana Labs", "license": "Apache-2.0", "name": "@grafana/toolkit", - "version": "9.3.3", + "version": "9.3.5", "description": "Grafana Toolkit", "keywords": [ "grafana", @@ -51,10 +51,10 @@ "@babel/preset-env": "7.18.9", "@babel/preset-react": "7.18.6", "@babel/preset-typescript": "7.18.6", - "@grafana/data": "9.3.3", + "@grafana/data": "9.3.5", "@grafana/eslint-config": "5.0.0", "@grafana/tsconfig": "^1.2.0-rc1", - "@grafana/ui": "9.3.3", + "@grafana/ui": "9.3.5", "@jest/core": "27.5.1", "@types/command-exists": "^1.2.0", "@types/eslint": "8.4.1", diff --git a/packages/grafana-ui/package.json b/packages/grafana-ui/package.json index 6378951230d..d46ab40e65a 100644 --- a/packages/grafana-ui/package.json +++ b/packages/grafana-ui/package.json @@ -2,7 +2,7 @@ "author": "Grafana Labs", "license": "Apache-2.0", "name": "@grafana/ui", - "version": "9.3.3", + "version": "9.3.5", "description": "Grafana Components Library", "keywords": [ "grafana", @@ -49,9 +49,9 @@ "dependencies": { "@emotion/css": "11.10.5", "@emotion/react": "11.10.5", - "@grafana/data": "9.3.3", - "@grafana/e2e-selectors": "9.3.3", - "@grafana/schema": "9.3.3", + "@grafana/data": "9.3.5", + "@grafana/e2e-selectors": "9.3.5", + "@grafana/schema": "9.3.5", "@leeoniya/ufuzzy": "0.8.0", "@monaco-editor/react": "4.4.6", "@popperjs/core": "2.11.6", diff --git a/packages/jaeger-ui-components/package.json b/packages/jaeger-ui-components/package.json index 33d186cfdd4..610a9648120 100644 --- a/packages/jaeger-ui-components/package.json +++ b/packages/jaeger-ui-components/package.json @@ -1,6 +1,6 @@ { "name": "@jaegertracing/jaeger-ui-components", - "version": "9.3.3", + "version": "9.3.5", "main": "src/index.ts", "types": "src/index.ts", "license": "Apache-2.0", @@ -31,10 +31,10 @@ }, "dependencies": { "@emotion/css": "11.10.5", - "@grafana/data": "9.3.3", - "@grafana/e2e-selectors": "9.3.3", - "@grafana/runtime": "9.3.3", - "@grafana/ui": "9.3.3", + "@grafana/data": "9.3.5", + "@grafana/e2e-selectors": "9.3.5", + "@grafana/runtime": "9.3.5", + "@grafana/ui": "9.3.5", "chance": "^1.0.10", "classnames": "^2.2.5", "combokeys": "^3.0.0", diff --git a/plugins-bundled/internal/input-datasource/package.json b/plugins-bundled/internal/input-datasource/package.json index 2f3d82a13e3..5287d7eab22 100644 --- a/plugins-bundled/internal/input-datasource/package.json +++ b/plugins-bundled/internal/input-datasource/package.json @@ -1,6 +1,6 @@ { "name": "@grafana-plugins/input-datasource", - "version": "9.3.3", + "version": "9.3.5", "description": "Input Datasource", "private": true, "repository": { @@ -15,15 +15,15 @@ }, "author": "Grafana Labs", "devDependencies": { - "@grafana/toolkit": "9.3.3", + "@grafana/toolkit": "9.3.5", "@types/jest": "26.0.15", "@types/lodash": "4.14.149", "@types/react": "17.0.30", "lodash": "4.17.21" }, "dependencies": { - "@grafana/data": "9.3.3", - "@grafana/ui": "9.3.3", + "@grafana/data": "9.3.5", + "@grafana/ui": "9.3.5", "jquery": "3.5.1", "react": "17.0.1", "react-dom": "17.0.1", diff --git a/yarn.lock b/yarn.lock index 99071ae11d9..1099c25b5f4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4275,9 +4275,9 @@ __metadata: version: 0.0.0-use.local resolution: "@grafana-plugins/input-datasource@workspace:plugins-bundled/internal/input-datasource" dependencies: - "@grafana/data": 9.3.3 - "@grafana/toolkit": 9.3.3 - "@grafana/ui": 9.3.3 + "@grafana/data": 9.3.5 + "@grafana/toolkit": 9.3.5 + "@grafana/ui": 9.3.5 "@types/jest": 26.0.15 "@types/lodash": 4.14.149 "@types/react": 17.0.30 @@ -4298,12 +4298,12 @@ __metadata: languageName: node linkType: hard -"@grafana/data@9.3.3, @grafana/data@workspace:*, @grafana/data@workspace:packages/grafana-data": +"@grafana/data@9.3.5, @grafana/data@workspace:*, @grafana/data@workspace:packages/grafana-data": version: 0.0.0-use.local resolution: "@grafana/data@workspace:packages/grafana-data" dependencies: "@braintree/sanitize-url": 6.0.1 - "@grafana/schema": 9.3.3 + "@grafana/schema": 9.3.5 "@grafana/tsconfig": ^1.2.0-rc1 "@rollup/plugin-commonjs": 23.0.2 "@rollup/plugin-json": 5.0.1 @@ -4362,7 +4362,7 @@ __metadata: languageName: unknown linkType: soft -"@grafana/e2e-selectors@9.3.3, @grafana/e2e-selectors@workspace:*, @grafana/e2e-selectors@workspace:packages/grafana-e2e-selectors": +"@grafana/e2e-selectors@9.3.5, @grafana/e2e-selectors@workspace:*, @grafana/e2e-selectors@workspace:packages/grafana-e2e-selectors": version: 0.0.0-use.local resolution: "@grafana/e2e-selectors@workspace:packages/grafana-e2e-selectors" dependencies: @@ -4388,7 +4388,7 @@ __metadata: "@babel/core": 7.19.6 "@babel/preset-env": 7.19.4 "@cypress/webpack-preprocessor": 5.15.2 - "@grafana/e2e-selectors": 9.3.3 + "@grafana/e2e-selectors": 9.3.5 "@grafana/tsconfig": ^1.2.0-rc1 "@mochajs/json-file-reporter": ^1.2.0 "@rollup/plugin-node-resolve": 15.0.1 @@ -4507,15 +4507,15 @@ __metadata: languageName: node linkType: hard -"@grafana/runtime@9.3.3, @grafana/runtime@workspace:*, @grafana/runtime@workspace:packages/grafana-runtime": +"@grafana/runtime@9.3.5, @grafana/runtime@workspace:*, @grafana/runtime@workspace:packages/grafana-runtime": version: 0.0.0-use.local resolution: "@grafana/runtime@workspace:packages/grafana-runtime" dependencies: - "@grafana/data": 9.3.3 - "@grafana/e2e-selectors": 9.3.3 + "@grafana/data": 9.3.5 + "@grafana/e2e-selectors": 9.3.5 "@grafana/faro-web-sdk": 1.0.0-beta2 "@grafana/tsconfig": ^1.2.0-rc1 - "@grafana/ui": 9.3.3 + "@grafana/ui": 9.3.5 "@rollup/plugin-commonjs": 23.0.2 "@rollup/plugin-node-resolve": 15.0.1 "@sentry/browser": 6.19.7 @@ -4552,7 +4552,7 @@ __metadata: languageName: unknown linkType: soft -"@grafana/schema@9.3.3, @grafana/schema@workspace:*, @grafana/schema@workspace:packages/grafana-schema": +"@grafana/schema@9.3.5, @grafana/schema@workspace:*, @grafana/schema@workspace:packages/grafana-schema": version: 0.0.0-use.local resolution: "@grafana/schema@workspace:packages/grafana-schema" dependencies: @@ -4572,7 +4572,7 @@ __metadata: languageName: unknown linkType: soft -"@grafana/toolkit@9.3.3, @grafana/toolkit@workspace:*, @grafana/toolkit@workspace:packages/grafana-toolkit": +"@grafana/toolkit@9.3.5, @grafana/toolkit@workspace:*, @grafana/toolkit@workspace:packages/grafana-toolkit": version: 0.0.0-use.local resolution: "@grafana/toolkit@workspace:packages/grafana-toolkit" dependencies: @@ -4588,10 +4588,10 @@ __metadata: "@babel/preset-env": 7.18.9 "@babel/preset-react": 7.18.6 "@babel/preset-typescript": 7.18.6 - "@grafana/data": 9.3.3 + "@grafana/data": 9.3.5 "@grafana/eslint-config": 5.0.0 "@grafana/tsconfig": ^1.2.0-rc1 - "@grafana/ui": 9.3.3 + "@grafana/ui": 9.3.5 "@jest/core": 27.5.1 "@types/command-exists": ^1.2.0 "@types/eslint": 8.4.1 @@ -4672,16 +4672,16 @@ __metadata: languageName: node linkType: hard -"@grafana/ui@9.3.3, @grafana/ui@workspace:*, @grafana/ui@workspace:packages/grafana-ui": +"@grafana/ui@9.3.5, @grafana/ui@workspace:*, @grafana/ui@workspace:packages/grafana-ui": version: 0.0.0-use.local resolution: "@grafana/ui@workspace:packages/grafana-ui" dependencies: "@babel/core": 7.19.6 "@emotion/css": 11.10.5 "@emotion/react": 11.10.5 - "@grafana/data": 9.3.3 - "@grafana/e2e-selectors": 9.3.3 - "@grafana/schema": 9.3.3 + "@grafana/data": 9.3.5 + "@grafana/e2e-selectors": 9.3.5 + "@grafana/schema": 9.3.5 "@grafana/tsconfig": ^1.2.0-rc1 "@leeoniya/ufuzzy": 0.8.0 "@mdx-js/react": 1.6.22 @@ -4956,11 +4956,11 @@ __metadata: resolution: "@jaegertracing/jaeger-ui-components@workspace:packages/jaeger-ui-components" dependencies: "@emotion/css": 11.10.5 - "@grafana/data": 9.3.3 - "@grafana/e2e-selectors": 9.3.3 - "@grafana/runtime": 9.3.3 + "@grafana/data": 9.3.5 + "@grafana/e2e-selectors": 9.3.5 + "@grafana/runtime": 9.3.5 "@grafana/tsconfig": ^1.2.0-rc1 - "@grafana/ui": 9.3.3 + "@grafana/ui": 9.3.5 "@testing-library/jest-dom": 5.16.5 "@testing-library/react": 12.1.4 "@testing-library/user-event": 14.4.3 From f938fc9d0d095ed3d8af7cf70f19e4bb39cfc273 Mon Sep 17 00:00:00 2001 From: "Grot (@grafanabot)" <43478413+grafanabot@users.noreply.github.com> Date: Wed, 25 Jan 2023 10:12:13 +0000 Subject: [PATCH 08/14] [v9.3.x] Add reference to Google OAuth docs (#61067) Add reference to Google OAuth docs (#61048) (cherry picked from commit 7582e77d25a28c2c7d03bf5efe1371611835c6d8) Co-authored-by: linoman <2051016+linoman@users.noreply.github.com> --- .../configure-authentication/google/index.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/sources/setup-grafana/configure-security/configure-authentication/google/index.md b/docs/sources/setup-grafana/configure-security/configure-authentication/google/index.md index 60a4210c942..c14268ffcd8 100644 --- a/docs/sources/setup-grafana/configure-security/configure-authentication/google/index.md +++ b/docs/sources/setup-grafana/configure-security/configure-authentication/google/index.md @@ -39,6 +39,7 @@ auth_url = https://accounts.google.com/o/oauth2/auth token_url = https://accounts.google.com/o/oauth2/token allowed_domains = mycompany.com mycompany.org allow_sign_up = true +hosted_domain = mycompany.com ``` You may have to set the `root_url` option of `[server]` for the callback URL to be @@ -53,6 +54,9 @@ You may allow users to sign-up via Google authentication by setting the user successfully authenticating via Google authentication will be automatically signed up. +You may specify a domain to be passed as `hd` query parameter accepted by Google's +OAuth 2.0 authentication API. Refer to Google's OAuth [documentation](https://developers.google.com/identity/openid-connect/openid-connect#hd-param). + ### Configure refresh token > Available in Grafana v9.3 and later versions. From e7e110c1401135ee57cdbef5d62d826076d39961 Mon Sep 17 00:00:00 2001 From: "Grot (@grafanabot)" <43478413+grafanabot@users.noreply.github.com> Date: Wed, 25 Jan 2023 15:16:28 +0000 Subject: [PATCH 09/14] [v9.3.x] Oauth: Remove extra decoding of redirect url (#60878) Oauth: Remove extra decoding of redirect url (#60875) Oauth: remove extra decoding of redirect cookie url (cherry picked from commit 5b4e1ee6fc1b5f0acd1c4c5f92ed88111dcf5569) Co-authored-by: Karl Persson --- pkg/api/login_oauth.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/api/login_oauth.go b/pkg/api/login_oauth.go index 603f158611a..84bb08d7fe4 100644 --- a/pkg/api/login_oauth.go +++ b/pkg/api/login_oauth.go @@ -9,7 +9,6 @@ import ( "errors" "fmt" "net/http" - "net/url" "golang.org/x/oauth2" @@ -258,7 +257,7 @@ func (hs *HTTPServer) OAuthLogin(ctx *models.ReqContext) { hs.HooksService.RunLoginHook(&loginInfo, ctx) metrics.MApiLoginOAuth.Inc() - if redirectTo, err := url.QueryUnescape(ctx.GetCookie("redirect_to")); err == nil && len(redirectTo) > 0 { + if redirectTo := ctx.GetCookie("redirect_to"); len(redirectTo) > 0 { if err := hs.ValidateRedirectTo(redirectTo); err == nil { cookies.DeleteCookie(ctx.Resp, "redirect_to", hs.CookieOptionsFromCfg) ctx.Redirect(redirectTo) From c69fb85c7e6dcc228346d3d182ae0e11c14fe14e Mon Sep 17 00:00:00 2001 From: "Grot (@grafanabot)" <43478413+grafanabot@users.noreply.github.com> Date: Wed, 25 Jan 2023 19:03:43 +0000 Subject: [PATCH 10/14] [v9.3.x] add export customHeadersSettings component (#62141) add export customHeadersSettings component (#62131) (cherry picked from commit 069dc2d357b34aeb9f68d13a4e2aadfcd5ab68b0) Co-authored-by: Taewoo K --- packages/grafana-ui/src/components/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/grafana-ui/src/components/index.ts b/packages/grafana-ui/src/components/index.ts index be1987ed037..aae60abf206 100644 --- a/packages/grafana-ui/src/components/index.ts +++ b/packages/grafana-ui/src/components/index.ts @@ -176,6 +176,7 @@ export { } from './ErrorBoundary/ErrorBoundary'; export { ErrorWithStack } from './ErrorBoundary/ErrorWithStack'; export { DataSourceHttpSettings } from './DataSourceSettings/DataSourceHttpSettings'; +export { CustomHeadersSettings } from './DataSourceSettings/CustomHeadersSettings'; export { AlertingSettings } from './DataSourceSettings/AlertingSettings'; export { TLSAuthSettings } from './DataSourceSettings/TLSAuthSettings'; export { CertificationKey } from './DataSourceSettings/CertificationKey'; From 1c8a50b36973bd59a1cc5f34c30de8a9a6a431f0 Mon Sep 17 00:00:00 2001 From: Nathan Marrs Date: Wed, 25 Jan 2023 14:30:53 -0700 Subject: [PATCH 11/14] [v9.3.x] SVG: Add dompurify preprocessor step (#62157) Co-authored-by: Ryan McKinley (cherry picked from commit 8b574e22b53aa4c5a35032a58844fd4aaaa12f5f) --- package.json | 2 ++ .../grafana-ui/src/components/Icon/Icon.tsx | 6 ++++- .../app/core/components/SVG/SanitizedSVG.tsx | 18 +++++++++++++ public/app/features/canvas/elements/icon.tsx | 4 +-- .../dimensions/editors/FileUploader.tsx | 5 ++-- .../dimensions/editors/ResourceCards.tsx | 4 +-- .../dimensions/editors/ResourcePicker.tsx | 6 ++--- .../dimensions/editors/URLPickerTab.tsx | 4 +-- public/app/features/storage/FileView.tsx | 4 +-- .../panel/geomap/components/MarkersLegend.tsx | 4 +-- .../app/plugins/panel/geomap/style/markers.ts | 3 +++ yarn.lock | 25 +++++++++++++++++++ 12 files changed, 69 insertions(+), 16 deletions(-) create mode 100644 public/app/core/components/SVG/SanitizedSVG.tsx diff --git a/package.json b/package.json index c7e8a32f903..dc8598ffde4 100644 --- a/package.json +++ b/package.json @@ -117,6 +117,7 @@ "@types/d3-force": "^2.1.0", "@types/d3-scale-chromatic": "1.3.1", "@types/debounce-promise": "3.1.5", + "@types/dompurify": "^2", "@types/enzyme": "3.10.12", "@types/enzyme-adapter-react-16": "1.0.6", "@types/eslint": "8.4.9", @@ -313,6 +314,7 @@ "dangerously-set-html-content": "1.0.9", "date-fns": "2.29.3", "debounce-promise": "3.1.2", + "dompurify": "^2.4.1", "emotion": "11.0.0", "eventemitter3": "4.0.7", "fast-deep-equal": "^3.1.3", diff --git a/packages/grafana-ui/src/components/Icon/Icon.tsx b/packages/grafana-ui/src/components/Icon/Icon.tsx index c601c17adc1..a411c06a6a1 100644 --- a/packages/grafana-ui/src/components/Icon/Icon.tsx +++ b/packages/grafana-ui/src/components/Icon/Icon.tsx @@ -57,9 +57,13 @@ export const Icon = React.forwardRef( console.warn('Icon component passed an invalid icon name', name); } + if (!name || name.includes('..')) { + return
invalid icon name
; + } + const svgSize = getSvgSize(size); const svgHgt = svgSize; - const svgWid = name?.startsWith('gf-bar-align') ? 16 : name?.startsWith('gf-interp') ? 30 : svgSize; + const svgWid = name.startsWith('gf-bar-align') ? 16 : name.startsWith('gf-interp') ? 30 : svgSize; const subDir = getIconSubDir(name, type); const svgPath = `${iconRoot}${subDir}/${name}.svg`; diff --git a/public/app/core/components/SVG/SanitizedSVG.tsx b/public/app/core/components/SVG/SanitizedSVG.tsx new file mode 100644 index 00000000000..9a2628cd63d --- /dev/null +++ b/public/app/core/components/SVG/SanitizedSVG.tsx @@ -0,0 +1,18 @@ +import * as DOMPurify from 'dompurify'; +import React from 'react'; +import SVG, { Props } from 'react-inlinesvg'; + +export const SanitizedSVG = (props: Props) => { + return ; +}; + +let cache = new Map(); + +function getCleanSVG(code: string): string { + let clean = cache.get(code); + if (!clean) { + clean = DOMPurify.sanitize(code, { USE_PROFILES: { svg: true, svgFilters: true } }); + cache.set(code, clean); + } + return clean; +} diff --git a/public/app/features/canvas/elements/icon.tsx b/public/app/features/canvas/elements/icon.tsx index cb4920e8948..8d7c8a4c876 100644 --- a/public/app/features/canvas/elements/icon.tsx +++ b/public/app/features/canvas/elements/icon.tsx @@ -1,8 +1,8 @@ import { css } from '@emotion/css'; import { isString } from 'lodash'; import React, { CSSProperties } from 'react'; -import SVG from 'react-inlinesvg'; +import { SanitizedSVG } from 'app/core/components/SVG/SanitizedSVG'; import { ColorDimensionConfig, ResourceDimensionConfig, @@ -59,7 +59,7 @@ export function IconDisplay(props: CanvasElementProps) { }; return ( - >; mediaType: MediaType; @@ -36,7 +37,7 @@ export const FileUploader = ({ mediaType, setFormData, setUpload, error }: Props const Preview = () => (
- {mediaType === MediaType.Icon && } + {mediaType === MediaType.Icon && } {mediaType === MediaType.Image && Preview of the uploaded file}
diff --git a/public/app/features/dimensions/editors/ResourceCards.tsx b/public/app/features/dimensions/editors/ResourceCards.tsx index 49aa6ea804c..57d01604cda 100644 --- a/public/app/features/dimensions/editors/ResourceCards.tsx +++ b/public/app/features/dimensions/editors/ResourceCards.tsx @@ -1,11 +1,11 @@ import { css, cx } from '@emotion/css'; import React, { memo, CSSProperties } from 'react'; -import SVG from 'react-inlinesvg'; import AutoSizer from 'react-virtualized-auto-sizer'; import { areEqual, FixedSizeGrid as Grid } from 'react-window'; import { GrafanaTheme2 } from '@grafana/data'; import { useTheme2, stylesFactory } from '@grafana/ui'; +import { SanitizedSVG } from 'app/core/components/SVG/SanitizedSVG'; import { ResourceItem } from './FolderPickerTab'; @@ -38,7 +38,7 @@ function Cell(props: CellProps) { onClick={() => onChange(card.value)} > {card.imgUrl.endsWith('.svg') ? ( - + ) : ( )} diff --git a/public/app/features/dimensions/editors/ResourcePicker.tsx b/public/app/features/dimensions/editors/ResourcePicker.tsx index 30246d6aa0d..ecfb63f3ef4 100644 --- a/public/app/features/dimensions/editors/ResourcePicker.tsx +++ b/public/app/features/dimensions/editors/ResourcePicker.tsx @@ -1,6 +1,5 @@ import { css } from '@emotion/css'; import React, { createRef } from 'react'; -import SVG from 'react-inlinesvg'; import { GrafanaTheme2 } from '@grafana/data'; import { @@ -15,6 +14,7 @@ import { useTheme2, } from '@grafana/ui'; import { closePopover } from '@grafana/ui/src/utils/closePopover'; +import { SanitizedSVG } from 'app/core/components/SVG/SanitizedSVG'; import { getPublicOrAbsoluteUrl } from '../resource'; import { MediaType, ResourceFolderName, ResourcePickerSize } from '../types'; @@ -56,7 +56,7 @@ export const ResourcePicker = (props: Props) => { const renderSmallResourcePicker = () => { if (value && sanitizedSrc) { - return ; + return ; } else { return ( @@ -73,7 +73,7 @@ export const ResourcePicker = (props: Props) => { value={name} placeholder={placeholder} readOnly={true} - prefix={sanitizedSrc && } + prefix={sanitizedSrc && } suffix={