@perses-dev/dashboards 0.0.0-snapshot-color-palette-gen-test-0ebddd6 → 0.0.0-snapshot-saving-defaults-refinements-1b25cec

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.
Files changed (212) hide show
  1. package/dist/cjs/components/DashboardStickyToolbar/DashboardStickyToolbar.js +79 -0
  2. package/dist/cjs/{stories/decorators/WithQueryParams.js → components/DashboardStickyToolbar/index.js} +11 -12
  3. package/dist/cjs/components/DashboardToolbar/DashboardToolbar.js +8 -24
  4. package/dist/cjs/components/EditJsonButton/EditJsonButton.js +1 -0
  5. package/dist/cjs/components/EditJsonDialog/EditJsonDialog.js +5 -0
  6. package/dist/cjs/components/GridLayout/GridItemContent.js +22 -4
  7. package/dist/cjs/components/GridLayout/GridLayout.js +31 -2
  8. package/dist/cjs/components/GridLayout/GridTitle.js +30 -9
  9. package/dist/cjs/components/Panel/Panel.js +2 -2
  10. package/dist/cjs/components/PanelDrawer/PanelEditorForm.js +41 -34
  11. package/dist/cjs/components/PanelDrawer/PanelPreview.js +32 -18
  12. package/dist/cjs/components/PanelDrawer/usePanelEditor.js +87 -0
  13. package/dist/cjs/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js +92 -0
  14. package/dist/cjs/components/SaveChangesConfirmationDialog/index.js +28 -0
  15. package/dist/cjs/components/SaveDashboardButton/SaveDashboardButton.js +81 -0
  16. package/dist/cjs/components/SaveDashboardButton/index.js +28 -0
  17. package/dist/cjs/components/TimeRangeControls/TimeRangeControls.js +5 -5
  18. package/dist/cjs/components/Variables/VariableEditorForm/VariableEditorForm.js +124 -198
  19. package/dist/cjs/components/Variables/VariableEditorForm/VariablePreview.js +178 -0
  20. package/dist/cjs/components/Variables/VariableEditorForm/index.js +1 -0
  21. package/dist/cjs/components/Variables/VariableEditorForm/variable-editor-form-model.js +7 -8
  22. package/dist/cjs/components/Variables/VariableList.js +16 -55
  23. package/dist/cjs/components/Variables/index.js +1 -0
  24. package/dist/cjs/components/index.js +3 -0
  25. package/dist/cjs/context/DashboardProvider/DashboardProvider.js +9 -8
  26. package/dist/cjs/context/DashboardProvider/common.js +26 -6
  27. package/dist/cjs/context/DashboardProvider/dashboard-provider-api.js +13 -4
  28. package/dist/cjs/context/DashboardProvider/index.js +1 -0
  29. package/dist/cjs/context/DashboardProvider/panel-editor-slice.js +8 -32
  30. package/dist/cjs/context/DashboardProvider/save-changes-dialog-slice.js +33 -0
  31. package/dist/cjs/context/TemplateVariableProvider/TemplateVariableProvider.js +56 -7
  32. package/dist/cjs/context/TemplateVariableProvider/hydrationUtils.js +2 -0
  33. package/dist/cjs/context/TemplateVariableProvider/utils.js +44 -0
  34. package/dist/cjs/context/useDashboard.js +4 -4
  35. package/dist/cjs/stories/decorators/WithDatasourceStore.js +2 -47
  36. package/dist/cjs/stories/decorators/index.js +0 -4
  37. package/dist/cjs/test/datasource-provider.js +70 -0
  38. package/dist/cjs/test/index.js +1 -0
  39. package/dist/cjs/test/plugin-registry.js +11 -5
  40. package/dist/cjs/test/render.js +35 -13
  41. package/dist/cjs/test/testDashboard.js +79 -79
  42. package/dist/cjs/utils/index.js +1 -0
  43. package/dist/cjs/{stories/decorators/WithQueryClient.js → utils/time.js} +9 -11
  44. package/dist/cjs/views/ViewDashboard/DashboardApp.js +2 -1
  45. package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.d.ts +9 -0
  46. package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.d.ts.map +1 -0
  47. package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.js +68 -0
  48. package/dist/components/DashboardStickyToolbar/DashboardStickyToolbar.js.map +1 -0
  49. package/dist/components/DashboardStickyToolbar/index.d.ts +2 -0
  50. package/dist/components/DashboardStickyToolbar/index.d.ts.map +1 -0
  51. package/dist/{stories/decorators/WithQueryClient.js → components/DashboardStickyToolbar/index.js} +2 -10
  52. package/dist/components/DashboardStickyToolbar/index.js.map +1 -0
  53. package/dist/components/DashboardToolbar/DashboardToolbar.d.ts +2 -2
  54. package/dist/components/DashboardToolbar/DashboardToolbar.d.ts.map +1 -1
  55. package/dist/components/DashboardToolbar/DashboardToolbar.js +10 -26
  56. package/dist/components/DashboardToolbar/DashboardToolbar.js.map +1 -1
  57. package/dist/components/EditJsonButton/EditJsonButton.js +1 -0
  58. package/dist/components/EditJsonButton/EditJsonButton.js.map +1 -1
  59. package/dist/components/EditJsonDialog/EditJsonDialog.d.ts.map +1 -1
  60. package/dist/components/EditJsonDialog/EditJsonDialog.js +5 -0
  61. package/dist/components/EditJsonDialog/EditJsonDialog.js.map +1 -1
  62. package/dist/components/GridLayout/GridItemContent.d.ts +1 -0
  63. package/dist/components/GridLayout/GridItemContent.d.ts.map +1 -1
  64. package/dist/components/GridLayout/GridItemContent.js +22 -4
  65. package/dist/components/GridLayout/GridItemContent.js.map +1 -1
  66. package/dist/components/GridLayout/GridLayout.d.ts.map +1 -1
  67. package/dist/components/GridLayout/GridLayout.js +31 -2
  68. package/dist/components/GridLayout/GridLayout.js.map +1 -1
  69. package/dist/components/GridLayout/GridTitle.d.ts.map +1 -1
  70. package/dist/components/GridLayout/GridTitle.js +30 -9
  71. package/dist/components/GridLayout/GridTitle.js.map +1 -1
  72. package/dist/components/Panel/Panel.d.ts +1 -1
  73. package/dist/components/Panel/Panel.d.ts.map +1 -1
  74. package/dist/components/Panel/Panel.js +3 -3
  75. package/dist/components/Panel/Panel.js.map +1 -1
  76. package/dist/components/PanelDrawer/PanelEditorForm.d.ts.map +1 -1
  77. package/dist/components/PanelDrawer/PanelEditorForm.js +42 -35
  78. package/dist/components/PanelDrawer/PanelEditorForm.js.map +1 -1
  79. package/dist/components/PanelDrawer/PanelPreview.d.ts +1 -1
  80. package/dist/components/PanelDrawer/PanelPreview.d.ts.map +1 -1
  81. package/dist/components/PanelDrawer/PanelPreview.js +32 -18
  82. package/dist/components/PanelDrawer/PanelPreview.js.map +1 -1
  83. package/dist/components/PanelDrawer/usePanelEditor.d.ts +15 -0
  84. package/dist/components/PanelDrawer/usePanelEditor.d.ts.map +1 -0
  85. package/dist/components/PanelDrawer/usePanelEditor.js +84 -0
  86. package/dist/components/PanelDrawer/usePanelEditor.js.map +1 -0
  87. package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.d.ts +3 -0
  88. package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.d.ts.map +1 -0
  89. package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js +86 -0
  90. package/dist/components/SaveChangesConfirmationDialog/SaveChangesConfirmationDialog.js.map +1 -0
  91. package/dist/components/SaveChangesConfirmationDialog/index.d.ts +2 -0
  92. package/dist/components/SaveChangesConfirmationDialog/index.d.ts.map +1 -0
  93. package/dist/{stories/decorators/WithQueryParams.js → components/SaveChangesConfirmationDialog/index.js} +2 -10
  94. package/dist/components/SaveChangesConfirmationDialog/index.js.map +1 -0
  95. package/dist/components/SaveDashboardButton/SaveDashboardButton.d.ts +10 -0
  96. package/dist/components/SaveDashboardButton/SaveDashboardButton.d.ts.map +1 -0
  97. package/dist/components/SaveDashboardButton/SaveDashboardButton.js +75 -0
  98. package/dist/components/SaveDashboardButton/SaveDashboardButton.js.map +1 -0
  99. package/dist/components/SaveDashboardButton/index.d.ts +2 -0
  100. package/dist/components/SaveDashboardButton/index.d.ts.map +1 -0
  101. package/dist/components/SaveDashboardButton/index.js +15 -0
  102. package/dist/components/SaveDashboardButton/index.js.map +1 -0
  103. package/dist/components/TimeRangeControls/TimeRangeControls.js +6 -6
  104. package/dist/components/TimeRangeControls/TimeRangeControls.js.map +1 -1
  105. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts +4 -2
  106. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts.map +1 -1
  107. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js +127 -196
  108. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js.map +1 -1
  109. package/dist/components/Variables/VariableEditorForm/VariablePreview.d.ts +16 -0
  110. package/dist/components/Variables/VariableEditorForm/VariablePreview.d.ts.map +1 -0
  111. package/dist/components/Variables/VariableEditorForm/VariablePreview.js +122 -0
  112. package/dist/components/Variables/VariableEditorForm/VariablePreview.js.map +1 -0
  113. package/dist/components/Variables/VariableEditorForm/index.d.ts +1 -0
  114. package/dist/components/Variables/VariableEditorForm/index.d.ts.map +1 -1
  115. package/dist/components/Variables/VariableEditorForm/index.js +1 -0
  116. package/dist/components/Variables/VariableEditorForm/index.js.map +1 -1
  117. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.d.ts.map +1 -1
  118. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js +7 -8
  119. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js.map +1 -1
  120. package/dist/components/Variables/VariableList.d.ts +1 -7
  121. package/dist/components/Variables/VariableList.d.ts.map +1 -1
  122. package/dist/components/Variables/VariableList.js +18 -52
  123. package/dist/components/Variables/VariableList.js.map +1 -1
  124. package/dist/components/Variables/index.d.ts +1 -0
  125. package/dist/components/Variables/index.d.ts.map +1 -1
  126. package/dist/components/Variables/index.js +1 -0
  127. package/dist/components/Variables/index.js.map +1 -1
  128. package/dist/components/index.d.ts +3 -0
  129. package/dist/components/index.d.ts.map +1 -1
  130. package/dist/components/index.js +3 -0
  131. package/dist/components/index.js.map +1 -1
  132. package/dist/context/DashboardProvider/DashboardProvider.d.ts +4 -3
  133. package/dist/context/DashboardProvider/DashboardProvider.d.ts.map +1 -1
  134. package/dist/context/DashboardProvider/DashboardProvider.js +9 -8
  135. package/dist/context/DashboardProvider/DashboardProvider.js.map +1 -1
  136. package/dist/context/DashboardProvider/common.d.ts +3 -0
  137. package/dist/context/DashboardProvider/common.d.ts.map +1 -1
  138. package/dist/context/DashboardProvider/common.js +17 -2
  139. package/dist/context/DashboardProvider/common.js.map +1 -1
  140. package/dist/context/DashboardProvider/dashboard-provider-api.d.ts +6 -1
  141. package/dist/context/DashboardProvider/dashboard-provider-api.d.ts.map +1 -1
  142. package/dist/context/DashboardProvider/dashboard-provider-api.js +11 -3
  143. package/dist/context/DashboardProvider/dashboard-provider-api.js.map +1 -1
  144. package/dist/context/DashboardProvider/index.d.ts +1 -0
  145. package/dist/context/DashboardProvider/index.d.ts.map +1 -1
  146. package/dist/context/DashboardProvider/index.js +1 -0
  147. package/dist/context/DashboardProvider/index.js.map +1 -1
  148. package/dist/context/DashboardProvider/panel-editor-slice.d.ts +3 -6
  149. package/dist/context/DashboardProvider/panel-editor-slice.d.ts.map +1 -1
  150. package/dist/context/DashboardProvider/panel-editor-slice.js +9 -33
  151. package/dist/context/DashboardProvider/panel-editor-slice.js.map +1 -1
  152. package/dist/context/DashboardProvider/save-changes-dialog-slice.d.ts +15 -0
  153. package/dist/context/DashboardProvider/save-changes-dialog-slice.d.ts.map +1 -0
  154. package/dist/context/DashboardProvider/save-changes-dialog-slice.js +27 -0
  155. package/dist/context/DashboardProvider/save-changes-dialog-slice.js.map +1 -0
  156. package/dist/context/TemplateVariableProvider/TemplateVariableProvider.d.ts +10 -0
  157. package/dist/context/TemplateVariableProvider/TemplateVariableProvider.d.ts.map +1 -1
  158. package/dist/context/TemplateVariableProvider/TemplateVariableProvider.js +51 -7
  159. package/dist/context/TemplateVariableProvider/TemplateVariableProvider.js.map +1 -1
  160. package/dist/context/TemplateVariableProvider/hydrationUtils.d.ts.map +1 -1
  161. package/dist/context/TemplateVariableProvider/hydrationUtils.js +2 -0
  162. package/dist/context/TemplateVariableProvider/hydrationUtils.js.map +1 -1
  163. package/dist/context/TemplateVariableProvider/utils.d.ts +7 -0
  164. package/dist/context/TemplateVariableProvider/utils.d.ts.map +1 -0
  165. package/dist/context/TemplateVariableProvider/utils.js +40 -0
  166. package/dist/context/TemplateVariableProvider/utils.js.map +1 -0
  167. package/dist/context/useDashboard.d.ts.map +1 -1
  168. package/dist/context/useDashboard.js +4 -4
  169. package/dist/context/useDashboard.js.map +1 -1
  170. package/dist/stories/decorators/WithDashboard.js.map +1 -1
  171. package/dist/stories/decorators/WithDatasourceStore.js +1 -46
  172. package/dist/stories/decorators/WithDatasourceStore.js.map +1 -1
  173. package/dist/stories/decorators/WithTemplateVariables.js.map +1 -1
  174. package/dist/stories/decorators/index.js +0 -4
  175. package/dist/stories/decorators/index.js.map +1 -1
  176. package/dist/test/datasource-provider.d.ts +6 -0
  177. package/dist/test/datasource-provider.d.ts.map +1 -0
  178. package/dist/test/datasource-provider.js +60 -0
  179. package/dist/test/datasource-provider.js.map +1 -0
  180. package/dist/test/index.d.ts +1 -0
  181. package/dist/test/index.d.ts.map +1 -1
  182. package/dist/test/index.js +1 -0
  183. package/dist/test/index.js.map +1 -1
  184. package/dist/test/plugin-registry.d.ts.map +1 -1
  185. package/dist/test/plugin-registry.js +11 -5
  186. package/dist/test/plugin-registry.js.map +1 -1
  187. package/dist/test/render.d.ts.map +1 -1
  188. package/dist/test/render.js +35 -13
  189. package/dist/test/render.js.map +1 -1
  190. package/dist/test/testDashboard.js +79 -79
  191. package/dist/test/testDashboard.js.map +1 -1
  192. package/dist/utils/index.d.ts +1 -0
  193. package/dist/utils/index.d.ts.map +1 -1
  194. package/dist/utils/index.js +1 -0
  195. package/dist/utils/index.js.map +1 -1
  196. package/dist/utils/time.d.ts +5 -0
  197. package/dist/utils/time.d.ts.map +1 -0
  198. package/dist/utils/time.js +23 -0
  199. package/dist/utils/time.js.map +1 -0
  200. package/dist/views/ViewDashboard/DashboardApp.d.ts +2 -1
  201. package/dist/views/ViewDashboard/DashboardApp.d.ts.map +1 -1
  202. package/dist/views/ViewDashboard/DashboardApp.js +3 -2
  203. package/dist/views/ViewDashboard/DashboardApp.js.map +1 -1
  204. package/package.json +7 -6
  205. package/dist/cjs/stories/decorators/WithPluginRegistry.js +0 -91
  206. package/dist/cjs/stories/decorators/WithTimeRange.js +0 -38
  207. package/dist/stories/decorators/WithPluginRegistry.js +0 -46
  208. package/dist/stories/decorators/WithPluginRegistry.js.map +0 -1
  209. package/dist/stories/decorators/WithQueryClient.js.map +0 -1
  210. package/dist/stories/decorators/WithQueryParams.js.map +0 -1
  211. package/dist/stories/decorators/WithTimeRange.js +0 -32
  212. package/dist/stories/decorators/WithTimeRange.js.map +0 -1
@@ -0,0 +1,70 @@
1
+ // Copyright 2023 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ "use strict";
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
17
+ function _export(target, all) {
18
+ for(var name in all)Object.defineProperty(target, name, {
19
+ enumerable: true,
20
+ get: all[name]
21
+ });
22
+ }
23
+ _export(exports, {
24
+ prometheusDemoUrl: ()=>prometheusDemoUrl,
25
+ prometheusDemo: ()=>prometheusDemo,
26
+ defaultDatasourceProps: ()=>defaultDatasourceProps
27
+ });
28
+ const _dashboardProvider = require("./dashboard-provider");
29
+ const prometheusDemoUrl = 'https://prometheus.demo.do.prometheus.io';
30
+ const prometheusDemo = {
31
+ kind: 'GlobalDatasource',
32
+ metadata: {
33
+ name: 'PrometheusDemo',
34
+ created_at: '0001-01-01T00:00:00Z',
35
+ updated_at: '0001-01-01T00:00:00Z',
36
+ version: 0
37
+ },
38
+ spec: {
39
+ default: true,
40
+ plugin: {
41
+ kind: 'PrometheusDatasource',
42
+ spec: {
43
+ direct_url: prometheusDemoUrl
44
+ }
45
+ }
46
+ }
47
+ };
48
+ const defaultDatasourceProps = {
49
+ dashboardResource: (0, _dashboardProvider.getTestDashboard)(),
50
+ datasourceApi: {
51
+ getDatasource: ()=>{
52
+ return Promise.resolve(undefined);
53
+ },
54
+ getGlobalDatasource: (selector)=>{
55
+ if (selector.kind === 'PrometheusDatasource') {
56
+ return Promise.resolve({
57
+ resource: prometheusDemo,
58
+ proxyUrl: prometheusDemoUrl
59
+ });
60
+ }
61
+ return Promise.resolve(undefined);
62
+ },
63
+ listDatasources: ()=>{
64
+ return Promise.resolve([]);
65
+ },
66
+ listGlobalDatasources: ()=>{
67
+ return Promise.resolve([]);
68
+ }
69
+ }
70
+ };
@@ -15,6 +15,7 @@ Object.defineProperty(exports, "__esModule", {
15
15
  value: true
16
16
  });
17
17
  _exportStar(require("./dashboard-provider"), exports);
18
+ _exportStar(require("./datasource-provider"), exports);
18
19
  _exportStar(require("./plugin-registry"), exports);
19
20
  _exportStar(require("./render"), exports);
20
21
  function _exportStar(from, to) {
@@ -19,17 +19,23 @@ Object.defineProperty(exports, "MOCK_PLUGINS", {
19
19
  get: ()=>MOCK_PLUGINS
20
20
  });
21
21
  const _jsxRuntime = require("react/jsx-runtime");
22
+ const FakeTimeSeriesChartOptionEditor = ()=>{
23
+ return /*#__PURE__*/ (0, _jsxRuntime.jsx)("div", {
24
+ children: "TimeSeriesChart options"
25
+ });
26
+ };
22
27
  const FakeTimeSeriesPlugin = {
23
28
  PanelComponent: ()=>{
24
29
  return /*#__PURE__*/ (0, _jsxRuntime.jsx)("div", {
25
30
  children: "TimeSeriesChart panel"
26
31
  });
27
32
  },
28
- OptionsEditorComponent: ()=>{
29
- return /*#__PURE__*/ (0, _jsxRuntime.jsx)("div", {
30
- children: "TimeSeriesChart options"
31
- });
32
- },
33
+ panelOptionsEditorComponents: [
34
+ {
35
+ label: 'Settings',
36
+ content: FakeTimeSeriesChartOptionEditor
37
+ }
38
+ ],
33
39
  createInitialOptions: ()=>({})
34
40
  };
35
41
  const MOCK_TIME_SERIES_PANEL = {
@@ -19,7 +19,8 @@ Object.defineProperty(exports, "renderWithContext", {
19
19
  get: ()=>renderWithContext
20
20
  });
21
21
  const _jsxRuntime = require("react/jsx-runtime");
22
- const _react = require("@testing-library/react");
22
+ const _react = require("react");
23
+ const _react1 = require("@testing-library/react");
23
24
  const _reactRouterDom = require("react-router-dom");
24
25
  const _history = require("history");
25
26
  const _useQueryParams = require("use-query-params");
@@ -28,6 +29,24 @@ const _reactQuery = require("@tanstack/react-query");
28
29
  const _components = require("@perses-dev/components");
29
30
  const _pluginSystem = require("@perses-dev/plugin-system");
30
31
  const _pluginRegistry = require("./plugin-registry");
32
+ /*
33
+ * Workaround for React router upgrade type errors.
34
+ * More details: https://stackoverflow.com/a/69948457/17575201
35
+ */ const CustomRouter = ({ history , children })=>{
36
+ const [state, setState] = (0, _react.useState)({
37
+ action: history.action,
38
+ location: history.location
39
+ });
40
+ (0, _react.useLayoutEffect)(()=>history.listen(setState), [
41
+ history
42
+ ]);
43
+ return /*#__PURE__*/ (0, _jsxRuntime.jsx)(_reactRouterDom.Router, {
44
+ location: state.location,
45
+ navigationType: state.action,
46
+ navigator: history,
47
+ children: children
48
+ });
49
+ };
31
50
  function renderWithContext(ui, options, history) {
32
51
  // Create a new QueryClient for each test to avoid caching issues
33
52
  const queryClient = new _reactQuery.QueryClient({
@@ -38,25 +57,28 @@ function renderWithContext(ui, options, history) {
38
57
  }
39
58
  }
40
59
  });
41
- const BaseRender = ()=>{
42
- const HistoryRouter = _reactRouterDom.unstable_HistoryRouter;
43
- history = history !== null && history !== void 0 ? history : (0, _history.createMemoryHistory)();
44
- return /*#__PURE__*/ (0, _jsxRuntime.jsx)(HistoryRouter, {
45
- history: history,
60
+ const customHistory = history !== null && history !== void 0 ? history : (0, _history.createMemoryHistory)();
61
+ const BaseRender = ()=>/*#__PURE__*/ (0, _jsxRuntime.jsx)(CustomRouter, {
62
+ history: customHistory,
46
63
  children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_reactQuery.QueryClientProvider, {
47
64
  client: queryClient,
48
65
  children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_useQueryParams.QueryParamProvider, {
49
66
  adapter: _reactRouter6.ReactRouter6Adapter,
50
- children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_components.ChartsThemeProvider, {
51
- chartsTheme: _components.testChartsTheme,
52
- children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_pluginSystem.PluginRegistry, {
53
- ...(0, _pluginSystem.mockPluginRegistry)(..._pluginRegistry.MOCK_PLUGINS),
54
- children: ui
67
+ children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_components.SnackbarProvider, {
68
+ anchorOrigin: {
69
+ vertical: 'bottom',
70
+ horizontal: 'right'
71
+ },
72
+ children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_components.ChartsThemeProvider, {
73
+ chartsTheme: _components.testChartsTheme,
74
+ children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_pluginSystem.PluginRegistry, {
75
+ ...(0, _pluginSystem.mockPluginRegistry)(..._pluginRegistry.MOCK_PLUGINS),
76
+ children: ui
77
+ })
55
78
  })
56
79
  })
57
80
  })
58
81
  })
59
82
  });
60
- };
61
- return (0, _react.render)(/*#__PURE__*/ (0, _jsxRuntime.jsx)(BaseRender, {}), options);
83
+ return (0, _react1.render)(/*#__PURE__*/ (0, _jsxRuntime.jsx)(BaseRender, {}), options);
62
84
  }
@@ -62,24 +62,24 @@ const testDashboard = {
62
62
  plugin: {
63
63
  kind: 'TimeSeriesChart',
64
64
  spec: {
65
- queries: [
66
- {
67
- kind: 'TimeSeriesQuery',
65
+ unit: {
66
+ kind: '%'
67
+ }
68
+ }
69
+ },
70
+ queries: [
71
+ {
72
+ kind: 'TimeSeriesQuery',
73
+ spec: {
74
+ plugin: {
75
+ kind: 'PrometheusTimeSeriesQuery',
68
76
  spec: {
69
- plugin: {
70
- kind: 'PrometheusTimeSeriesQuery',
71
- spec: {
72
- query: 'avg without (cpu)(rate(node_cpu_seconds_total{job="node",instance="$instance",mode!="idle"}[$interval]))'
73
- }
74
- }
77
+ query: 'avg without (cpu)(rate(node_cpu_seconds_total{job="node",instance="$instance",mode!="idle"}[$interval]))'
75
78
  }
76
79
  }
77
- ],
78
- unit: {
79
- kind: '%'
80
80
  }
81
81
  }
82
- }
82
+ ]
83
83
  }
84
84
  },
85
85
  memory: {
@@ -91,57 +91,57 @@ const testDashboard = {
91
91
  plugin: {
92
92
  kind: 'TimeSeriesChart',
93
93
  spec: {
94
- queries: [
95
- {
96
- kind: 'TimeSeriesQuery',
94
+ unit: {
95
+ kind: 'Bytes'
96
+ }
97
+ }
98
+ },
99
+ queries: [
100
+ {
101
+ kind: 'TimeSeriesQuery',
102
+ spec: {
103
+ plugin: {
104
+ kind: 'PrometheusTimeSeriesQuery',
97
105
  spec: {
98
- plugin: {
99
- kind: 'PrometheusTimeSeriesQuery',
100
- spec: {
101
- query: 'node_memory_MemTotal_bytes{job="node",instance="$instance"} - node_memory_MemFree_bytes{job="node",instance="$instance"} - node_memory_Buffers_bytes{job="node",instance="$instance"} - node_memory_Cached_bytes{job="node",instance="$instance"}'
102
- }
103
- }
106
+ query: 'node_memory_MemTotal_bytes{job="node",instance="$instance"} - node_memory_MemFree_bytes{job="node",instance="$instance"} - node_memory_Buffers_bytes{job="node",instance="$instance"} - node_memory_Cached_bytes{job="node",instance="$instance"}'
104
107
  }
105
- },
106
- {
107
- kind: 'TimeSeriesQuery',
108
+ }
109
+ }
110
+ },
111
+ {
112
+ kind: 'TimeSeriesQuery',
113
+ spec: {
114
+ plugin: {
115
+ kind: 'PrometheusTimeSeriesQuery',
108
116
  spec: {
109
- plugin: {
110
- kind: 'PrometheusTimeSeriesQuery',
111
- spec: {
112
- query: 'node_memory_Buffers_bytes{job="node",instance="$instance"}'
113
- }
114
- }
117
+ query: 'node_memory_Buffers_bytes{job="node",instance="$instance"}'
115
118
  }
116
- },
117
- {
118
- kind: 'TimeSeriesQuery',
119
+ }
120
+ }
121
+ },
122
+ {
123
+ kind: 'TimeSeriesQuery',
124
+ spec: {
125
+ plugin: {
126
+ kind: 'PrometheusTimeSeriesQuery',
119
127
  spec: {
120
- plugin: {
121
- kind: 'PrometheusTimeSeriesQuery',
122
- spec: {
123
- query: 'node_memory_Cached_bytes{job="node",instance="$instance"}'
124
- }
125
- }
128
+ query: 'node_memory_Cached_bytes{job="node",instance="$instance"}'
126
129
  }
127
- },
128
- {
129
- kind: 'TimeSeriesQuery',
130
+ }
131
+ }
132
+ },
133
+ {
134
+ kind: 'TimeSeriesQuery',
135
+ spec: {
136
+ plugin: {
137
+ kind: 'PrometheusTimeSeriesQuery',
130
138
  spec: {
131
- plugin: {
132
- kind: 'PrometheusTimeSeriesQuery',
133
- spec: {
134
- query: 'node_memory_MemFree_bytes{job="node",instance="$instance"}'
135
- }
136
- }
139
+ query: 'node_memory_MemFree_bytes{job="node",instance="$instance"}'
137
140
  }
138
141
  }
139
- ],
140
- unit: {
141
- kind: 'Bytes'
142
142
  }
143
143
  }
144
- }
144
+ ]
145
145
  }
146
146
  },
147
147
  // This panel is referenced in more than one layout below
@@ -154,24 +154,24 @@ const testDashboard = {
154
154
  plugin: {
155
155
  kind: 'TimeSeriesChart',
156
156
  spec: {
157
- queries: [
158
- {
159
- kind: 'TimeSeriesQuery',
157
+ unit: {
158
+ kind: 'Percent'
159
+ }
160
+ }
161
+ },
162
+ queries: [
163
+ {
164
+ kind: 'TimeSeriesQuery',
165
+ spec: {
166
+ plugin: {
167
+ kind: 'PrometheusTimeSeriesQuery',
160
168
  spec: {
161
- plugin: {
162
- kind: 'PrometheusTimeSeriesQuery',
163
- spec: {
164
- query: 'rate(node_disk_io_time_seconds_total{job="node",instance="$instance",device!~"^(md\\\\d+$|dm-)"}[$interval])'
165
- }
166
- }
169
+ query: 'rate(node_disk_io_time_seconds_total{job="node",instance="$instance",device!~"^(md\\\\d+$|dm-)"}[$interval])'
167
170
  }
168
171
  }
169
- ],
170
- unit: {
171
- kind: 'Percent'
172
172
  }
173
173
  }
174
- }
174
+ ]
175
175
  }
176
176
  },
177
177
  filesystemFullness: {
@@ -183,24 +183,24 @@ const testDashboard = {
183
183
  plugin: {
184
184
  kind: 'TimeSeriesChart',
185
185
  spec: {
186
- queries: [
187
- {
188
- kind: 'TimeSeriesQuery',
186
+ unit: {
187
+ kind: 'Percent'
188
+ }
189
+ }
190
+ },
191
+ queries: [
192
+ {
193
+ kind: 'TimeSeriesQuery',
194
+ spec: {
195
+ plugin: {
196
+ kind: 'PrometheusTimeSeriesQuery',
189
197
  spec: {
190
- plugin: {
191
- kind: 'PrometheusTimeSeriesQuery',
192
- spec: {
193
- query: '1 - node_filesystem_free_bytes{job="node",instance="$instance",fstype!="rootfs",mountpoint!~"/(run|var).*",mountpoint!=""} / node_filesystem_size_bytes{job="node",instance="$instance"}'
194
- }
195
- }
198
+ query: '1 - node_filesystem_free_bytes{job="node",instance="$instance",fstype!="rootfs",mountpoint!~"/(run|var).*",mountpoint!=""} / node_filesystem_size_bytes{job="node",instance="$instance"}'
196
199
  }
197
200
  }
198
- ],
199
- unit: {
200
- kind: 'Percent'
201
201
  }
202
202
  }
203
- }
203
+ ]
204
204
  }
205
205
  }
206
206
  },
@@ -15,6 +15,7 @@ Object.defineProperty(exports, "__esModule", {
15
15
  value: true
16
16
  });
17
17
  _exportStar(require("./panelUtils"), exports);
18
+ _exportStar(require("./time"), exports);
18
19
  function _exportStar(from, to) {
19
20
  Object.keys(from).forEach(function(k) {
20
21
  if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) Object.defineProperty(to, k, {
@@ -14,16 +14,14 @@
14
14
  Object.defineProperty(exports, "__esModule", {
15
15
  value: true
16
16
  });
17
- Object.defineProperty(exports, "WithQueryClient", {
17
+ Object.defineProperty(exports, "useSuggestedStepMs", {
18
18
  enumerable: true,
19
- get: ()=>WithQueryClient
19
+ get: ()=>useSuggestedStepMs
20
20
  });
21
- const _jsxRuntime = require("react/jsx-runtime");
22
- const _reactQuery = require("@tanstack/react-query");
23
- const WithQueryClient = (Story)=>{
24
- const queryClient = new _reactQuery.QueryClient({});
25
- return /*#__PURE__*/ (0, _jsxRuntime.jsx)(_reactQuery.QueryClientProvider, {
26
- client: queryClient,
27
- children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(Story, {})
28
- });
29
- };
21
+ const _core = require("@perses-dev/core");
22
+ const _pluginSystem = require("@perses-dev/plugin-system");
23
+ function useSuggestedStepMs(width) {
24
+ const { absoluteTimeRange } = (0, _pluginSystem.useTimeRange)();
25
+ if (width === undefined) return 0;
26
+ return (0, _core.getSuggestedStepMs)(absoluteTimeRange, width);
27
+ }
@@ -98,7 +98,8 @@ const DashboardApp = (props)=>{
98
98
  /*#__PURE__*/ (0, _jsxRuntime.jsx)(_components1.DeletePanelGroupDialog, {}),
99
99
  /*#__PURE__*/ (0, _jsxRuntime.jsx)(_components1.DeletePanelDialog, {}),
100
100
  /*#__PURE__*/ (0, _jsxRuntime.jsx)(_components1.DiscardChangesConfirmationDialog, {}),
101
- /*#__PURE__*/ (0, _jsxRuntime.jsx)(_components1.EditJsonDialog, {})
101
+ /*#__PURE__*/ (0, _jsxRuntime.jsx)(_components1.EditJsonDialog, {}),
102
+ /*#__PURE__*/ (0, _jsxRuntime.jsx)(_components1.SaveChangesConfirmationDialog, {})
102
103
  ]
103
104
  })
104
105
  ]
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ import { SxProps, Theme } from '@mui/material';
3
+ interface DashboardStickyToolbarProps {
4
+ initialVariableIsSticky?: boolean;
5
+ sx?: SxProps<Theme>;
6
+ }
7
+ export declare function DashboardStickyToolbar(props: DashboardStickyToolbarProps): JSX.Element;
8
+ export {};
9
+ //# sourceMappingURL=DashboardStickyToolbar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DashboardStickyToolbar.d.ts","sourceRoot":"","sources":["../../../src/components/DashboardStickyToolbar/DashboardStickyToolbar.tsx"],"names":[],"mappings":";AAcA,OAAO,EAA2B,OAAO,EAAE,KAAK,EAAoB,MAAM,eAAe,CAAC;AAM1F,UAAU,2BAA2B;IACnC,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,EAAE,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;CACrB;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,2BAA2B,eAgCxE"}
@@ -0,0 +1,68 @@
1
+ // Copyright 2023 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
+ import { useState } from 'react';
15
+ import { AppBar, Box, IconButton, useScrollTrigger } from '@mui/material';
16
+ import PinOutline from 'mdi-material-ui/PinOutline';
17
+ import PinOffOutline from 'mdi-material-ui/PinOffOutline';
18
+ import { TemplateVariableList } from '../Variables';
19
+ import { TimeRangeControls } from '../TimeRangeControls';
20
+ export function DashboardStickyToolbar(props) {
21
+ const [isPin, setIsPin] = useState(props.initialVariableIsSticky);
22
+ const scrollTrigger = useScrollTrigger({
23
+ disableHysteresis: true
24
+ });
25
+ const isSticky = scrollTrigger && props.initialVariableIsSticky && isPin;
26
+ return(// marginBottom={-1} counteracts the marginBottom={1} on every variable input.
27
+ // The margin on the inputs is for spacing between inputs, but is not meant to add space to bottom of the container.
28
+ /*#__PURE__*/ _jsx(Box, {
29
+ marginBottom: -1,
30
+ "data-testid": "variable-list",
31
+ children: /*#__PURE__*/ _jsx(AppBar, {
32
+ color: "inherit",
33
+ position: isSticky ? 'fixed' : 'static',
34
+ elevation: isSticky ? 4 : 0,
35
+ sx: {
36
+ backgroundColor: 'inherit',
37
+ ...props.sx
38
+ },
39
+ children: /*#__PURE__*/ _jsxs(Box, {
40
+ display: "flex",
41
+ justifyContent: "space-between",
42
+ children: [
43
+ /*#__PURE__*/ _jsxs(Box, {
44
+ display: "flex",
45
+ flexWrap: "wrap",
46
+ alignItems: "start",
47
+ my: isSticky ? 2 : 0,
48
+ ml: isSticky ? 2 : 0,
49
+ children: [
50
+ /*#__PURE__*/ _jsx(TemplateVariableList, {}),
51
+ props.initialVariableIsSticky && /*#__PURE__*/ _jsx(IconButton, {
52
+ onClick: ()=>setIsPin(!isPin),
53
+ children: isPin ? /*#__PURE__*/ _jsx(PinOutline, {}) : /*#__PURE__*/ _jsx(PinOffOutline, {})
54
+ })
55
+ ]
56
+ }),
57
+ isSticky && /*#__PURE__*/ _jsx(Box, {
58
+ my: 2,
59
+ mr: 2,
60
+ children: /*#__PURE__*/ _jsx(TimeRangeControls, {})
61
+ })
62
+ ]
63
+ })
64
+ })
65
+ }));
66
+ }
67
+
68
+ //# sourceMappingURL=DashboardStickyToolbar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/DashboardStickyToolbar/DashboardStickyToolbar.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { useState } from 'react';\nimport { AppBar, Box, IconButton, SxProps, Theme, useScrollTrigger } from '@mui/material';\nimport PinOutline from 'mdi-material-ui/PinOutline';\nimport PinOffOutline from 'mdi-material-ui/PinOffOutline';\nimport { TemplateVariableList } from '../Variables';\nimport { TimeRangeControls } from '../TimeRangeControls';\n\ninterface DashboardStickyToolbarProps {\n initialVariableIsSticky?: boolean;\n sx?: SxProps<Theme>;\n}\n\nexport function DashboardStickyToolbar(props: DashboardStickyToolbarProps) {\n const [isPin, setIsPin] = useState(props.initialVariableIsSticky);\n\n const scrollTrigger = useScrollTrigger({ disableHysteresis: true });\n const isSticky = scrollTrigger && props.initialVariableIsSticky && isPin;\n\n return (\n // marginBottom={-1} counteracts the marginBottom={1} on every variable input.\n // The margin on the inputs is for spacing between inputs, but is not meant to add space to bottom of the container.\n <Box marginBottom={-1} data-testid=\"variable-list\">\n <AppBar\n color=\"inherit\"\n position={isSticky ? 'fixed' : 'static'}\n elevation={isSticky ? 4 : 0}\n sx={{ backgroundColor: 'inherit', ...props.sx }}\n >\n <Box display=\"flex\" justifyContent=\"space-between\">\n <Box display=\"flex\" flexWrap=\"wrap\" alignItems=\"start\" my={isSticky ? 2 : 0} ml={isSticky ? 2 : 0}>\n <TemplateVariableList></TemplateVariableList>\n {props.initialVariableIsSticky && (\n <IconButton onClick={() => setIsPin(!isPin)}>{isPin ? <PinOutline /> : <PinOffOutline />}</IconButton>\n )}\n </Box>\n {isSticky && (\n <Box my={2} mr={2}>\n <TimeRangeControls></TimeRangeControls>\n </Box>\n )}\n </Box>\n </AppBar>\n </Box>\n );\n}\n"],"names":["useState","AppBar","Box","IconButton","useScrollTrigger","PinOutline","PinOffOutline","TemplateVariableList","TimeRangeControls","DashboardStickyToolbar","props","isPin","setIsPin","initialVariableIsSticky","scrollTrigger","disableHysteresis","isSticky","marginBottom","data-testid","color","position","elevation","sx","backgroundColor","display","justifyContent","flexWrap","alignItems","my","ml","onClick","mr"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC;AAAA,SAASA,QAAQ,QAAQ,OAAO,CAAC;AACjC,SAASC,MAAM,EAAEC,GAAG,EAAEC,UAAU,EAAkBC,gBAAgB,QAAQ,eAAe,CAAC;AAC1F,OAAOC,UAAU,MAAM,4BAA4B,CAAC;AACpD,OAAOC,aAAa,MAAM,+BAA+B,CAAC;AAC1D,SAASC,oBAAoB,QAAQ,cAAc,CAAC;AACpD,SAASC,iBAAiB,QAAQ,sBAAsB,CAAC;AAOzD,OAAO,SAASC,sBAAsB,CAACC,KAAkC,EAAE;IACzE,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGZ,QAAQ,CAACU,KAAK,CAACG,uBAAuB,CAAC,AAAC;IAElE,MAAMC,aAAa,GAAGV,gBAAgB,CAAC;QAAEW,iBAAiB,EAAE,IAAI;KAAE,CAAC,AAAC;IACpE,MAAMC,QAAQ,GAAGF,aAAa,IAAIJ,KAAK,CAACG,uBAAuB,IAAIF,KAAK,AAAC;IAEzE,OACE,8EAA8E;IAC9E,oHAAoH;kBACpH,KAACT,GAAG;QAACe,YAAY,EAAE,CAAC,CAAC;QAAEC,aAAW,EAAC,eAAe;kBAChD,cAAA,KAACjB,MAAM;YACLkB,KAAK,EAAC,SAAS;YACfC,QAAQ,EAAEJ,QAAQ,GAAG,OAAO,GAAG,QAAQ;YACvCK,SAAS,EAAEL,QAAQ,GAAG,CAAC,GAAG,CAAC;YAC3BM,EAAE,EAAE;gBAAEC,eAAe,EAAE,SAAS;gBAAE,GAAGb,KAAK,CAACY,EAAE;aAAE;sBAE/C,cAAA,MAACpB,GAAG;gBAACsB,OAAO,EAAC,MAAM;gBAACC,cAAc,EAAC,eAAe;;kCAChD,MAACvB,GAAG;wBAACsB,OAAO,EAAC,MAAM;wBAACE,QAAQ,EAAC,MAAM;wBAACC,UAAU,EAAC,OAAO;wBAACC,EAAE,EAAEZ,QAAQ,GAAG,CAAC,GAAG,CAAC;wBAAEa,EAAE,EAAEb,QAAQ,GAAG,CAAC,GAAG,CAAC;;0CAC/F,KAACT,oBAAoB,KAAwB;4BAC5CG,KAAK,CAACG,uBAAuB,kBAC5B,KAACV,UAAU;gCAAC2B,OAAO,EAAE,IAAMlB,QAAQ,CAAC,CAACD,KAAK,CAAC;0CAAGA,KAAK,iBAAG,KAACN,UAAU,KAAG,iBAAG,KAACC,aAAa,KAAG;8BAAc,AACvG;;sBACG;oBACLU,QAAQ,kBACP,KAACd,GAAG;wBAAC0B,EAAE,EAAE,CAAC;wBAAEG,EAAE,EAAE,CAAC;kCACf,cAAA,KAACvB,iBAAiB,KAAqB;sBACnC,AACP;;cACG;UACC;MACL,EACN;AACJ,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './DashboardStickyToolbar';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/DashboardStickyToolbar/index.ts"],"names":[],"mappings":"AAaA,cAAc,0BAA0B,CAAC"}
@@ -10,14 +10,6 @@
10
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
- import { jsx as _jsx } from "react/jsx-runtime";
14
- import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
15
- export const WithQueryClient = (Story)=>{
16
- const queryClient = new QueryClient({});
17
- return /*#__PURE__*/ _jsx(QueryClientProvider, {
18
- client: queryClient,
19
- children: /*#__PURE__*/ _jsx(Story, {})
20
- });
21
- };
13
+ export * from './DashboardStickyToolbar';
22
14
 
23
- //# sourceMappingURL=WithQueryClient.js.map
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/DashboardStickyToolbar/index.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './DashboardStickyToolbar';\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,0BAA0B,CAAC"}
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { DashboardResource } from '@perses-dev/core';
2
+ import { OnSaveDashboard } from '../../context';
3
3
  export interface DashboardToolbarProps {
4
4
  dashboardName: string;
5
5
  dashboardTitleComponent?: JSX.Element;
@@ -7,7 +7,7 @@ export interface DashboardToolbarProps {
7
7
  isReadonly: boolean;
8
8
  onEditButtonClick: () => void;
9
9
  onCancelButtonClick: () => void;
10
- onSave?: (entity: DashboardResource) => Promise<DashboardResource>;
10
+ onSave?: OnSaveDashboard;
11
11
  }
12
12
  export declare const DashboardToolbar: (props: DashboardToolbarProps) => JSX.Element;
13
13
  //# sourceMappingURL=DashboardToolbar.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DashboardToolbar.d.ts","sourceRoot":"","sources":["../../../src/components/DashboardToolbar/DashboardToolbar.tsx"],"names":[],"mappings":";AAgBA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAUrD,MAAM,WAAW,qBAAqB;IACpC,aAAa,EAAE,MAAM,CAAC;IACtB,uBAAuB,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IACtC,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,UAAU,EAAE,OAAO,CAAC;IACpB,iBAAiB,EAAE,MAAM,IAAI,CAAC;IAC9B,mBAAmB,EAAE,MAAM,IAAI,CAAC;IAChC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,OAAO,CAAC,iBAAiB,CAAC,CAAC;CACpE;AAED,eAAO,MAAM,gBAAgB,UAAW,qBAAqB,gBAoI5D,CAAC"}
1
+ {"version":3,"file":"DashboardToolbar.d.ts","sourceRoot":"","sources":["../../../src/components/DashboardToolbar/DashboardToolbar.tsx"],"names":[],"mappings":";AAeA,OAAO,EAAE,eAAe,EAAe,MAAM,eAAe,CAAC;AAW7D,MAAM,WAAW,qBAAqB;IACpC,aAAa,EAAE,MAAM,CAAC;IACtB,uBAAuB,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IACtC,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,UAAU,EAAE,OAAO,CAAC;IACpB,iBAAiB,EAAE,MAAM,IAAI,CAAC;IAC9B,mBAAmB,EAAE,MAAM,IAAI,CAAC;IAChC,MAAM,CAAC,EAAE,eAAe,CAAC;CAC1B;AAED,eAAO,MAAM,gBAAgB,UAAW,qBAAqB,gBA+G5D,CAAC"}