@grafana/create-plugin 2.8.1 → 2.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ # v2.9.0 (Fri Dec 08 2023)
2
+
3
+ #### 🚀 Enhancement
4
+
5
+ - Update the scenes-app template to use the latest scenes library and fix some template code style errors [#573](https://github.com/grafana/plugin-tools/pull/573) ([@academo](https://github.com/academo))
6
+
7
+ #### Authors: 1
8
+
9
+ - Esteban Beltran ([@academo](https://github.com/academo))
10
+
11
+ ---
12
+
1
13
  # v2.8.1 (Fri Dec 08 2023)
2
14
 
3
15
  :tada: This release contains work from a new contributor! :tada:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grafana/create-plugin",
3
- "version": "2.8.1",
3
+ "version": "2.9.0",
4
4
  "main": "index.js",
5
5
  "repository": {
6
6
  "directory": "packages/create-plugin",
@@ -66,5 +66,5 @@
66
66
  "engines": {
67
67
  "node": ">=20"
68
68
  },
69
- "gitHead": "0cbf426d3f62da57f9b65bf522aacc3235315466"
69
+ "gitHead": "c5ae1e2349446fc54508e9957dd943db1cc7806d"
70
70
  }
@@ -63,7 +63,7 @@
63
63
  "@grafana/runtime": "{{ grafanaVersion }}",
64
64
  "@grafana/ui": "{{ grafanaVersion }}",
65
65
  "@grafana/schema": "{{ grafanaVersion }}",{{#if_eq pluginType "scenesapp"}}
66
- "@grafana/scenes": "0.27.0",{{/if_eq}}
66
+ "@grafana/scenes": "^1.28.0",{{/if_eq}}
67
67
  "react": "17.0.2",
68
68
  "react-dom": "17.0.2",{{#if isAppType}}
69
69
  "react-router-dom": "^5.2.0",
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ import React from 'react';
2
2
  import { AppRootProps } from '@grafana/data';
3
3
  import { PluginPropsContext } from '../../utils/utils.plugin';
4
4
  import { Routes } from '../Routes';
@@ -4,6 +4,7 @@ import { PluginConfigPageProps, AppPluginMeta, PluginMeta, GrafanaTheme2 } from
4
4
  import { getBackendSrv, locationService } from '@grafana/runtime';
5
5
  import { css } from '@emotion/css';
6
6
  import { testIds } from '../testIds';
7
+ import { lastValueFrom } from 'rxjs';
7
8
 
8
9
  export type JsonData = {
9
10
  apiUrl?: string;
@@ -182,11 +183,13 @@ const updatePluginAndReload = async (pluginId: string, data: Partial<PluginMeta<
182
183
  };
183
184
 
184
185
  export const updatePlugin = async (pluginId: string, data: Partial<PluginMeta>) => {
185
- const response = await getBackendSrv().datasourceRequest({
186
+ const response = getBackendSrv().fetch({
186
187
  url: `/api/plugins/${pluginId}/settings`,
187
188
  method: 'POST',
188
189
  data,
189
190
  });
190
191
 
191
- return response?.data;
192
+ const dataResponse = await lastValueFrom(response);
193
+
194
+ return dataResponse.data;
192
195
  };
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ import React from 'react';
2
2
  import { Redirect, Route, Switch } from 'react-router-dom';
3
3
  import { HomePage } from '../../pages/Home';
4
4
  import { PageWithTabs } from '../../pages/WithTabs';