@grafana/plugin-ui 0.11.1 → 0.12.1

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/README.md CHANGED
@@ -2,6 +2,25 @@
2
2
 
3
3
  React components for Grafana plugins
4
4
 
5
+ ## Development
6
+ Requires running a local version of Grafana from source.
7
+ ### Setting up local version of @grafana/plugin-ui with app plugin
8
+
9
+ 1. Run `yarn install && yarn dev`
10
+ 1. Run `yarn link ../path/to/plugin-ui` from app plugin directory. Make sure not to commit the changes to grafana/grafana that are introduced to the package.json.
11
+ 1. Start app plugin development server.
12
+
13
+ To avoid needing to manually rebuild core grafana on every change you make in this repo while developing, instead of running `yarn dev`, run
14
+ ```bash
15
+ yarn tsc -p ./tsconfig.build.json && yarn rollup -c rollup.config.ts --configPlugin esbuild -w --watch.onEnd="cd ../grafana/public/app/plugins/datasource/loki && yarn build
16
+ ```
17
+ Replacing the --watch.onEnd command with whatever you are targeting.
18
+
19
+ There is a better way of doing this, when you find it, please add it here so it's not so painful working with this repo.
20
+
21
+ ## Deploying
22
+ Increment the version in the package.json and make sure the [CHANGELOG.md](CHANGELOG.md) includes a message for each merged PR. The `publish-npm` workflow should trigger on version changes, which will publish the release on npm.
23
+
5
24
  ## Grafana compatibility
6
25
 
7
26
  Plugin-ui@0.9.0 is compatible with Grafana versions 10.4.0 and higher. If the `grafanaDependency` field in your plugin.json file is set to an earlier version, you should amend it to `>=10.4.0`
@@ -9,6 +28,7 @@ When you do that, consider also incrementing your plugin's major version to make
9
28
 
10
29
  ## Storybook
11
30
 
31
+ Storybook is pretty broken, components link to assets that only exist within Grafana, as such most components haven't bothered to add support for storybook.
12
32
  ```
13
33
  yarn storybook
14
34
  ```
@@ -2920,7 +2920,7 @@ function useLatestCallback(callback) {
2920
2920
  });
2921
2921
  const hasCallback = Boolean(callback);
2922
2922
  return React.useMemo(
2923
- () => hasCallback ? (...args) => ref.current(...args) : undefined,
2923
+ () => hasCallback ? ((...args) => ref.current(...args)) : undefined,
2924
2924
  [hasCallback]
2925
2925
  );
2926
2926
  }
@@ -10106,8 +10106,10 @@ function QueryOptionGroup({ title, children, collapsedInfo, queryStats }) {
10106
10106
  children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.body, children })
10107
10107
  }
10108
10108
  ),
10109
- queryStats && runtime.config.featureToggles.lokiQuerySplitting && /* @__PURE__ */ jsxRuntime.jsx(ui.Tooltip, { content: "Note: the query will be split into multiple parts and executed in sequence. Query limits will only apply each individual part.", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Icon, { tabIndex: 0, name: "info-circle", className: styles.tooltip, size: "sm" }) }),
10110
- queryStats && /* @__PURE__ */ jsxRuntime.jsx("p", { className: styles.stats, children: generateQueryStats(queryStats) })
10109
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.queryStatsWrap, children: [
10110
+ queryStats && runtime.config.featureToggles.lokiQuerySplitting && /* @__PURE__ */ jsxRuntime.jsx(ui.Tooltip, { content: "Note: the query will be split into multiple parts and executed in sequence. Query limits will only apply each individual part.", children: /* @__PURE__ */ jsxRuntime.jsx(ui.Icon, { tabIndex: 0, name: "info-circle", className: styles.tooltip, size: "sm" }) }),
10111
+ queryStats && /* @__PURE__ */ jsxRuntime.jsx("p", { className: styles.stats, children: generateQueryStats(queryStats) })
10112
+ ] })
10111
10113
  ] });
10112
10114
  }
10113
10115
  const getStyles = (theme) => {
@@ -10146,6 +10148,13 @@ const getStyles = (theme) => {
10146
10148
  gap: theme.spacing(2),
10147
10149
  flexWrap: "wrap"
10148
10150
  }),
10151
+ queryStatsWrap: css.css({
10152
+ display: "flex",
10153
+ alignItems: "center",
10154
+ alignSelf: "flex-start",
10155
+ label: "query-stats-wrap",
10156
+ padding: theme.spacing(1)
10157
+ }),
10149
10158
  stats: css.css({
10150
10159
  margin: "0px",
10151
10160
  color: theme.colors.text.secondary,