@perses-dev/dashboards 0.21.0 → 0.22.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.
Files changed (292) hide show
  1. package/dist/cjs/components/AddGroupButton/AddGroupButton.js +43 -0
  2. package/dist/cjs/components/AddGroupButton/index.js +28 -0
  3. package/dist/cjs/components/AddPanelButton/AddPanelButton.js +43 -0
  4. package/dist/cjs/components/AddPanelButton/index.js +28 -0
  5. package/dist/cjs/components/Dashboard/Dashboard.js +1 -1
  6. package/dist/cjs/components/Dashboard/index.js +1 -1
  7. package/dist/cjs/components/DashboardToolbar/DashboardToolbar.js +47 -22
  8. package/dist/cjs/components/DashboardToolbar/index.js +1 -1
  9. package/dist/cjs/components/DeletePanelDialog/DeletePanelDialog.js +1 -1
  10. package/dist/cjs/components/DeletePanelDialog/index.js +1 -1
  11. package/dist/cjs/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js +1 -1
  12. package/dist/cjs/components/DeletePanelGroupDialog/index.js +1 -1
  13. package/dist/cjs/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.js +1 -1
  14. package/dist/cjs/components/DiscardChangesConfirmationDialog/index.js +1 -1
  15. package/dist/cjs/components/DownloadButton/DownloadButton.js +17 -53
  16. package/dist/cjs/components/DownloadButton/index.js +1 -1
  17. package/dist/cjs/components/GridLayout/GridContainer.js +2 -1
  18. package/dist/cjs/components/GridLayout/GridItemContent.js +1 -1
  19. package/dist/cjs/components/GridLayout/GridLayout.js +2 -1
  20. package/dist/cjs/components/GridLayout/GridTitle.js +14 -11
  21. package/dist/cjs/components/GridLayout/index.js +1 -1
  22. package/dist/cjs/components/Panel/Panel.js +2 -1
  23. package/dist/cjs/components/Panel/Panel.test.js +1 -1
  24. package/dist/cjs/components/Panel/PanelContent.js +1 -1
  25. package/dist/cjs/components/Panel/PanelHeader.js +9 -8
  26. package/dist/cjs/components/Panel/index.js +1 -1
  27. package/dist/cjs/components/PanelDrawer/PanelDrawer.js +2 -1
  28. package/dist/cjs/components/PanelDrawer/PanelDrawer.test.js +1 -1
  29. package/dist/cjs/components/PanelDrawer/PanelEditorForm.js +1 -1
  30. package/dist/cjs/components/PanelDrawer/PanelPreview.js +1 -1
  31. package/dist/cjs/components/PanelDrawer/index.js +1 -1
  32. package/dist/cjs/components/PanelGroupDialog/PanelGroupDialog.js +3 -1
  33. package/dist/cjs/components/PanelGroupDialog/PanelGroupDialog.test.js +1 -1
  34. package/dist/cjs/components/PanelGroupDialog/PanelGroupEditorForm.js +1 -1
  35. package/dist/cjs/components/PanelGroupDialog/index.js +1 -1
  36. package/dist/cjs/components/TimeRangeControls/TimeRangeControls.js +14 -16
  37. package/dist/cjs/components/TimeRangeControls/TimeRangeControls.test.js +1 -1
  38. package/dist/cjs/components/TimeRangeControls/index.js +1 -1
  39. package/dist/cjs/components/ToolbarIconButton/ToolbarIconButton.js +35 -0
  40. package/dist/cjs/components/ToolbarIconButton/index.js +28 -0
  41. package/dist/cjs/components/Variables/EditVariablesButton.js +74 -0
  42. package/dist/cjs/components/Variables/Variable.js +1 -1
  43. package/dist/cjs/components/Variables/VariableEditor.js +9 -5
  44. package/dist/cjs/components/Variables/VariableEditorForm/VariableEditorForm.js +6 -7
  45. package/dist/cjs/components/Variables/VariableEditorForm/index.js +1 -1
  46. package/dist/cjs/components/Variables/VariableEditorForm/variable-editor-form-model.js +1 -1
  47. package/dist/cjs/components/Variables/VariableList.js +38 -110
  48. package/dist/cjs/components/Variables/index.js +4 -2
  49. package/dist/cjs/components/Variables/variable-model.js +1 -1
  50. package/dist/cjs/components/Variables/variable-model.test.js +1 -1
  51. package/dist/cjs/components/index.js +5 -2
  52. package/dist/cjs/constants/index.js +28 -0
  53. package/dist/cjs/constants/user-interface-text.js +59 -0
  54. package/dist/cjs/context/DashboardProvider/DashboardProvider.js +1 -1
  55. package/dist/cjs/context/DashboardProvider/common.js +1 -1
  56. package/dist/cjs/context/DashboardProvider/dashboard-provider-api.js +1 -1
  57. package/dist/cjs/context/DashboardProvider/delete-panel-group-slice.js +1 -1
  58. package/dist/cjs/context/DashboardProvider/delete-panel-slice.js +1 -1
  59. package/dist/cjs/context/DashboardProvider/discard-changes-dialog-slice.js +1 -1
  60. package/dist/cjs/context/DashboardProvider/index.js +1 -1
  61. package/dist/cjs/context/DashboardProvider/panel-editor-slice.js +1 -1
  62. package/dist/cjs/context/DashboardProvider/panel-group-editor-slice.js +1 -1
  63. package/dist/cjs/context/DashboardProvider/panel-group-slice.js +1 -1
  64. package/dist/cjs/context/DashboardProvider/panel-slice.js +1 -1
  65. package/dist/cjs/context/DatasourceStoreProvider.js +1 -1
  66. package/dist/cjs/context/TemplateVariableProvider/TemplateVariableProvider.js +8 -8
  67. package/dist/cjs/context/TemplateVariableProvider/index.js +1 -1
  68. package/dist/cjs/context/TemplateVariableProvider/query-params.js +1 -1
  69. package/dist/cjs/context/TemplateVariableProvider/query-params.test.js +1 -1
  70. package/dist/cjs/context/index.js +1 -1
  71. package/dist/cjs/context/useDashboard.js +1 -1
  72. package/dist/cjs/index.js +1 -1
  73. package/dist/cjs/test/dashboard-provider.js +1 -1
  74. package/dist/cjs/test/index.js +1 -1
  75. package/dist/cjs/test/plugin-registry.js +1 -1
  76. package/dist/cjs/test/render.js +1 -1
  77. package/dist/cjs/test/setup-tests.js +1 -1
  78. package/dist/cjs/test/testDashboard.js +1 -1
  79. package/dist/cjs/utils/functions.js +1 -1
  80. package/dist/cjs/utils/index.js +28 -0
  81. package/dist/cjs/views/ViewDashboard/DashboardApp.js +1 -1
  82. package/dist/cjs/views/ViewDashboard/ViewDashboard.js +1 -1
  83. package/dist/cjs/views/ViewDashboard/index.js +1 -1
  84. package/dist/cjs/views/ViewDashboard/tests/panelGroups.test.js +1 -1
  85. package/dist/cjs/views/index.js +1 -1
  86. package/dist/components/AddGroupButton/AddGroupButton.d.ts +3 -0
  87. package/dist/components/AddGroupButton/AddGroupButton.d.ts.map +1 -0
  88. package/dist/components/AddGroupButton/AddGroupButton.js +32 -0
  89. package/dist/components/AddGroupButton/AddGroupButton.js.map +1 -0
  90. package/dist/components/AddGroupButton/index.d.ts +2 -0
  91. package/dist/components/AddGroupButton/index.d.ts.map +1 -0
  92. package/dist/components/AddGroupButton/index.js +15 -0
  93. package/dist/components/AddGroupButton/index.js.map +1 -0
  94. package/dist/components/AddPanelButton/AddPanelButton.d.ts +3 -0
  95. package/dist/components/AddPanelButton/AddPanelButton.d.ts.map +1 -0
  96. package/dist/components/AddPanelButton/AddPanelButton.js +32 -0
  97. package/dist/components/AddPanelButton/AddPanelButton.js.map +1 -0
  98. package/dist/components/AddPanelButton/index.d.ts +2 -0
  99. package/dist/components/AddPanelButton/index.d.ts.map +1 -0
  100. package/dist/components/AddPanelButton/index.js +15 -0
  101. package/dist/components/AddPanelButton/index.js.map +1 -0
  102. package/dist/components/Dashboard/Dashboard.js +1 -1
  103. package/dist/components/Dashboard/Dashboard.js.map +1 -1
  104. package/dist/components/Dashboard/index.js +1 -1
  105. package/dist/components/Dashboard/index.js.map +1 -1
  106. package/dist/components/DashboardToolbar/DashboardToolbar.d.ts.map +1 -1
  107. package/dist/components/DashboardToolbar/DashboardToolbar.js +48 -23
  108. package/dist/components/DashboardToolbar/DashboardToolbar.js.map +1 -1
  109. package/dist/components/DashboardToolbar/index.js +1 -1
  110. package/dist/components/DashboardToolbar/index.js.map +1 -1
  111. package/dist/components/DeletePanelDialog/DeletePanelDialog.js +1 -1
  112. package/dist/components/DeletePanelDialog/DeletePanelDialog.js.map +1 -1
  113. package/dist/components/DeletePanelDialog/index.js +1 -1
  114. package/dist/components/DeletePanelDialog/index.js.map +1 -1
  115. package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js +1 -1
  116. package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js.map +1 -1
  117. package/dist/components/DeletePanelGroupDialog/index.js +1 -1
  118. package/dist/components/DeletePanelGroupDialog/index.js.map +1 -1
  119. package/dist/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.js +1 -1
  120. package/dist/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.js.map +1 -1
  121. package/dist/components/DiscardChangesConfirmationDialog/index.js +1 -1
  122. package/dist/components/DiscardChangesConfirmationDialog/index.js.map +1 -1
  123. package/dist/components/DownloadButton/DownloadButton.d.ts +5 -1
  124. package/dist/components/DownloadButton/DownloadButton.d.ts.map +1 -1
  125. package/dist/components/DownloadButton/DownloadButton.js +18 -15
  126. package/dist/components/DownloadButton/DownloadButton.js.map +1 -1
  127. package/dist/components/DownloadButton/index.js +1 -1
  128. package/dist/components/DownloadButton/index.js.map +1 -1
  129. package/dist/components/GridLayout/GridContainer.d.ts.map +1 -1
  130. package/dist/components/GridLayout/GridContainer.js +2 -1
  131. package/dist/components/GridLayout/GridContainer.js.map +1 -1
  132. package/dist/components/GridLayout/GridItemContent.js +1 -1
  133. package/dist/components/GridLayout/GridItemContent.js.map +1 -1
  134. package/dist/components/GridLayout/GridLayout.js +2 -1
  135. package/dist/components/GridLayout/GridLayout.js.map +1 -1
  136. package/dist/components/GridLayout/GridTitle.d.ts.map +1 -1
  137. package/dist/components/GridLayout/GridTitle.js +14 -11
  138. package/dist/components/GridLayout/GridTitle.js.map +1 -1
  139. package/dist/components/GridLayout/index.js +1 -1
  140. package/dist/components/GridLayout/index.js.map +1 -1
  141. package/dist/components/Panel/Panel.d.ts.map +1 -1
  142. package/dist/components/Panel/Panel.js +2 -1
  143. package/dist/components/Panel/Panel.js.map +1 -1
  144. package/dist/components/Panel/Panel.test.js +1 -1
  145. package/dist/components/Panel/Panel.test.js.map +1 -1
  146. package/dist/components/Panel/PanelContent.js +1 -1
  147. package/dist/components/Panel/PanelContent.js.map +1 -1
  148. package/dist/components/Panel/PanelHeader.d.ts.map +1 -1
  149. package/dist/components/Panel/PanelHeader.js +9 -8
  150. package/dist/components/Panel/PanelHeader.js.map +1 -1
  151. package/dist/components/Panel/index.js +1 -1
  152. package/dist/components/Panel/index.js.map +1 -1
  153. package/dist/components/PanelDrawer/PanelDrawer.js +2 -1
  154. package/dist/components/PanelDrawer/PanelDrawer.js.map +1 -1
  155. package/dist/components/PanelDrawer/PanelDrawer.test.js +1 -1
  156. package/dist/components/PanelDrawer/PanelDrawer.test.js.map +1 -1
  157. package/dist/components/PanelDrawer/PanelEditorForm.js +1 -1
  158. package/dist/components/PanelDrawer/PanelEditorForm.js.map +1 -1
  159. package/dist/components/PanelDrawer/PanelPreview.js +1 -1
  160. package/dist/components/PanelDrawer/PanelPreview.js.map +1 -1
  161. package/dist/components/PanelDrawer/index.js +1 -1
  162. package/dist/components/PanelDrawer/index.js.map +1 -1
  163. package/dist/components/PanelGroupDialog/PanelGroupDialog.d.ts.map +1 -1
  164. package/dist/components/PanelGroupDialog/PanelGroupDialog.js +3 -1
  165. package/dist/components/PanelGroupDialog/PanelGroupDialog.js.map +1 -1
  166. package/dist/components/PanelGroupDialog/PanelGroupDialog.test.js +1 -1
  167. package/dist/components/PanelGroupDialog/PanelGroupDialog.test.js.map +1 -1
  168. package/dist/components/PanelGroupDialog/PanelGroupEditorForm.js +1 -1
  169. package/dist/components/PanelGroupDialog/PanelGroupEditorForm.js.map +1 -1
  170. package/dist/components/PanelGroupDialog/index.js +1 -1
  171. package/dist/components/PanelGroupDialog/index.js.map +1 -1
  172. package/dist/components/TimeRangeControls/TimeRangeControls.d.ts.map +1 -1
  173. package/dist/components/TimeRangeControls/TimeRangeControls.js +15 -17
  174. package/dist/components/TimeRangeControls/TimeRangeControls.js.map +1 -1
  175. package/dist/components/TimeRangeControls/TimeRangeControls.test.js +1 -1
  176. package/dist/components/TimeRangeControls/TimeRangeControls.test.js.map +1 -1
  177. package/dist/components/TimeRangeControls/index.js +1 -1
  178. package/dist/components/TimeRangeControls/index.js.map +1 -1
  179. package/dist/components/ToolbarIconButton/ToolbarIconButton.d.ts +6 -0
  180. package/dist/components/ToolbarIconButton/ToolbarIconButton.d.ts.map +1 -0
  181. package/dist/components/ToolbarIconButton/ToolbarIconButton.js +29 -0
  182. package/dist/components/ToolbarIconButton/ToolbarIconButton.js.map +1 -0
  183. package/dist/components/ToolbarIconButton/index.d.ts +2 -0
  184. package/dist/components/ToolbarIconButton/index.d.ts.map +1 -0
  185. package/dist/components/ToolbarIconButton/index.js +15 -0
  186. package/dist/components/ToolbarIconButton/index.js.map +1 -0
  187. package/dist/components/Variables/EditVariablesButton.d.ts +3 -0
  188. package/dist/components/Variables/EditVariablesButton.d.ts.map +1 -0
  189. package/dist/components/Variables/EditVariablesButton.js +63 -0
  190. package/dist/components/Variables/EditVariablesButton.js.map +1 -0
  191. package/dist/components/Variables/Variable.js +1 -1
  192. package/dist/components/Variables/Variable.js.map +1 -1
  193. package/dist/components/Variables/VariableEditor.d.ts.map +1 -1
  194. package/dist/components/Variables/VariableEditor.js +9 -5
  195. package/dist/components/Variables/VariableEditor.js.map +1 -1
  196. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts.map +1 -1
  197. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js +8 -9
  198. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js.map +1 -1
  199. package/dist/components/Variables/VariableEditorForm/index.js +1 -1
  200. package/dist/components/Variables/VariableEditorForm/index.js.map +1 -1
  201. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js +1 -1
  202. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js.map +1 -1
  203. package/dist/components/Variables/VariableList.d.ts.map +1 -1
  204. package/dist/components/Variables/VariableList.js +40 -73
  205. package/dist/components/Variables/VariableList.js.map +1 -1
  206. package/dist/components/Variables/index.d.ts +3 -1
  207. package/dist/components/Variables/index.d.ts.map +1 -1
  208. package/dist/components/Variables/index.js +4 -2
  209. package/dist/components/Variables/index.js.map +1 -1
  210. package/dist/components/Variables/variable-model.js +1 -1
  211. package/dist/components/Variables/variable-model.js.map +1 -1
  212. package/dist/components/Variables/variable-model.test.js +1 -1
  213. package/dist/components/Variables/variable-model.test.js.map +1 -1
  214. package/dist/components/index.d.ts +4 -1
  215. package/dist/components/index.d.ts.map +1 -1
  216. package/dist/components/index.js +5 -2
  217. package/dist/components/index.js.map +1 -1
  218. package/dist/constants/index.d.ts +2 -0
  219. package/dist/constants/index.d.ts.map +1 -0
  220. package/dist/constants/index.js +15 -0
  221. package/dist/constants/index.js.map +1 -0
  222. package/dist/constants/user-interface-text.d.ts +28 -0
  223. package/dist/constants/user-interface-text.d.ts.map +1 -0
  224. package/dist/constants/user-interface-text.js +47 -0
  225. package/dist/constants/user-interface-text.js.map +1 -0
  226. package/dist/context/DashboardProvider/DashboardProvider.js +1 -1
  227. package/dist/context/DashboardProvider/DashboardProvider.js.map +1 -1
  228. package/dist/context/DashboardProvider/common.js +1 -1
  229. package/dist/context/DashboardProvider/common.js.map +1 -1
  230. package/dist/context/DashboardProvider/dashboard-provider-api.js +1 -1
  231. package/dist/context/DashboardProvider/dashboard-provider-api.js.map +1 -1
  232. package/dist/context/DashboardProvider/delete-panel-group-slice.js +1 -1
  233. package/dist/context/DashboardProvider/delete-panel-group-slice.js.map +1 -1
  234. package/dist/context/DashboardProvider/delete-panel-slice.js +1 -1
  235. package/dist/context/DashboardProvider/delete-panel-slice.js.map +1 -1
  236. package/dist/context/DashboardProvider/discard-changes-dialog-slice.js +1 -1
  237. package/dist/context/DashboardProvider/discard-changes-dialog-slice.js.map +1 -1
  238. package/dist/context/DashboardProvider/index.js +1 -1
  239. package/dist/context/DashboardProvider/index.js.map +1 -1
  240. package/dist/context/DashboardProvider/panel-editor-slice.js +1 -1
  241. package/dist/context/DashboardProvider/panel-editor-slice.js.map +1 -1
  242. package/dist/context/DashboardProvider/panel-group-editor-slice.js +1 -1
  243. package/dist/context/DashboardProvider/panel-group-editor-slice.js.map +1 -1
  244. package/dist/context/DashboardProvider/panel-group-slice.js +1 -1
  245. package/dist/context/DashboardProvider/panel-group-slice.js.map +1 -1
  246. package/dist/context/DashboardProvider/panel-slice.js +1 -1
  247. package/dist/context/DashboardProvider/panel-slice.js.map +1 -1
  248. package/dist/context/DatasourceStoreProvider.js +1 -1
  249. package/dist/context/DatasourceStoreProvider.js.map +1 -1
  250. package/dist/context/TemplateVariableProvider/TemplateVariableProvider.js +8 -8
  251. package/dist/context/TemplateVariableProvider/TemplateVariableProvider.js.map +1 -1
  252. package/dist/context/TemplateVariableProvider/index.js +1 -1
  253. package/dist/context/TemplateVariableProvider/index.js.map +1 -1
  254. package/dist/context/TemplateVariableProvider/query-params.js +1 -1
  255. package/dist/context/TemplateVariableProvider/query-params.js.map +1 -1
  256. package/dist/context/TemplateVariableProvider/query-params.test.js +1 -1
  257. package/dist/context/TemplateVariableProvider/query-params.test.js.map +1 -1
  258. package/dist/context/index.js +1 -1
  259. package/dist/context/index.js.map +1 -1
  260. package/dist/context/useDashboard.js +1 -1
  261. package/dist/context/useDashboard.js.map +1 -1
  262. package/dist/index.js +1 -1
  263. package/dist/index.js.map +1 -1
  264. package/dist/test/dashboard-provider.js +1 -1
  265. package/dist/test/dashboard-provider.js.map +1 -1
  266. package/dist/test/index.js +1 -1
  267. package/dist/test/index.js.map +1 -1
  268. package/dist/test/plugin-registry.js +1 -1
  269. package/dist/test/plugin-registry.js.map +1 -1
  270. package/dist/test/render.js +1 -1
  271. package/dist/test/render.js.map +1 -1
  272. package/dist/test/setup-tests.js +1 -1
  273. package/dist/test/setup-tests.js.map +1 -1
  274. package/dist/test/testDashboard.js +1 -1
  275. package/dist/test/testDashboard.js.map +1 -1
  276. package/dist/utils/functions.js +1 -1
  277. package/dist/utils/functions.js.map +1 -1
  278. package/dist/utils/index.d.ts +2 -0
  279. package/dist/utils/index.d.ts.map +1 -0
  280. package/dist/utils/index.js +15 -0
  281. package/dist/utils/index.js.map +1 -0
  282. package/dist/views/ViewDashboard/DashboardApp.js +1 -1
  283. package/dist/views/ViewDashboard/DashboardApp.js.map +1 -1
  284. package/dist/views/ViewDashboard/ViewDashboard.js +1 -1
  285. package/dist/views/ViewDashboard/ViewDashboard.js.map +1 -1
  286. package/dist/views/ViewDashboard/index.js +1 -1
  287. package/dist/views/ViewDashboard/index.js.map +1 -1
  288. package/dist/views/ViewDashboard/tests/panelGroups.test.js +1 -1
  289. package/dist/views/ViewDashboard/tests/panelGroups.test.js.map +1 -1
  290. package/dist/views/index.js +1 -1
  291. package/dist/views/index.js.map +1 -1
  292. package/package.json +4 -4
@@ -1,4 +1,4 @@
1
- // Copyright 2022 The Perses Authors
1
+ // Copyright 2023 The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -25,6 +25,7 @@ const _informationOutline = /*#__PURE__*/ _interopRequireDefault(require("mdi-ma
25
25
  const _pencilOutline = /*#__PURE__*/ _interopRequireDefault(require("mdi-material-ui/PencilOutline"));
26
26
  const _deleteOutline = /*#__PURE__*/ _interopRequireDefault(require("mdi-material-ui/DeleteOutline"));
27
27
  const _dragVertical = /*#__PURE__*/ _interopRequireDefault(require("mdi-material-ui/DragVertical"));
28
+ const _constants = require("../../constants");
28
29
  function _interopRequireDefault(obj) {
29
30
  return obj && obj.__esModule ? obj : {
30
31
  default: obj
@@ -39,9 +40,9 @@ function PanelHeader({ id , title , description , editHandlers , isHovered , sx
39
40
  actions = /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
40
41
  children: [
41
42
  /*#__PURE__*/ (0, _jsxRuntime.jsx)(_components.InfoTooltip, {
42
- description: "Edit",
43
+ description: _constants.TOOLTIP_TEXT.editPanel,
43
44
  children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(HeaderIconButton, {
44
- "aria-label": `edit panel ${title}`,
45
+ "aria-label": _constants.ARIA_LABEL_TEXT.editPanel(title),
45
46
  size: "small",
46
47
  onClick: editHandlers.onEditPanelClick,
47
48
  children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_pencilOutline.default, {
@@ -50,9 +51,9 @@ function PanelHeader({ id , title , description , editHandlers , isHovered , sx
50
51
  })
51
52
  }),
52
53
  /*#__PURE__*/ (0, _jsxRuntime.jsx)(_components.InfoTooltip, {
53
- description: "Delete",
54
+ description: _constants.TOOLTIP_TEXT.deletePanel,
54
55
  children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(HeaderIconButton, {
55
- "aria-label": `delete panel ${title}`,
56
+ "aria-label": _constants.ARIA_LABEL_TEXT.deletePanel(title),
56
57
  size: "small",
57
58
  onClick: editHandlers.onDeletePanelClick,
58
59
  children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_deleteOutline.default, {
@@ -61,9 +62,9 @@ function PanelHeader({ id , title , description , editHandlers , isHovered , sx
61
62
  })
62
63
  }),
63
64
  /*#__PURE__*/ (0, _jsxRuntime.jsx)(_components.InfoTooltip, {
64
- description: "Drag and drop panel to reorganize",
65
+ description: _constants.TOOLTIP_TEXT.movePanel,
65
66
  children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(HeaderIconButton, {
66
- "aria-label": `move panel ${title}`,
67
+ "aria-label": _constants.ARIA_LABEL_TEXT.movePanel(title),
67
68
  size: "small",
68
69
  children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_dragVertical.default, {
69
70
  className: "drag-handle",
@@ -83,7 +84,7 @@ function PanelHeader({ id , title , description , editHandlers , isHovered , sx
83
84
  description: description,
84
85
  enterDelay: 100,
85
86
  children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(HeaderIconButton, {
86
- "aria-label": "Panel Description",
87
+ "aria-label": "panel description",
87
88
  size: "small",
88
89
  children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_informationOutline.default, {
89
90
  "aria-describedby": "info-tooltip",
@@ -1,4 +1,4 @@
1
- // Copyright 2022 The Perses Authors
1
+ // Copyright 2023 The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1,4 +1,4 @@
1
- /* eslint-disable @typescript-eslint/no-empty-function */ // Copyright 2022 The Perses Authors
1
+ /* eslint-disable @typescript-eslint/no-empty-function */ // Copyright 2023 The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -71,6 +71,7 @@ const PanelDrawer = ()=>{
71
71
  SlideProps: {
72
72
  onExited: handleExited
73
73
  },
74
+ "data-testid": "panel-editor",
74
75
  children: panelEditor !== undefined && /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
75
76
  children: [
76
77
  /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_material.Box, {
@@ -1,4 +1,4 @@
1
- // Copyright 2022 The Perses Authors
1
+ // Copyright 2023 The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1,4 +1,4 @@
1
- // Copyright 2022 The Perses Authors
1
+ // Copyright 2023 The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1,4 +1,4 @@
1
- // Copyright 2022 The Perses Authors
1
+ // Copyright 2023 The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1,4 +1,4 @@
1
- // Copyright 2022 The Perses Authors
1
+ // Copyright 2023 The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1,4 +1,4 @@
1
- // Copyright 2022 The Perses Authors
1
+ // Copyright 2023 The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -73,6 +73,7 @@ function PanelGroupDialog() {
73
73
  children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_close.default, {})
74
74
  }),
75
75
  /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.DialogContent, {
76
+ dividers: true,
76
77
  sx: {
77
78
  width: '500px'
78
79
  },
@@ -90,6 +91,7 @@ function PanelGroupDialog() {
90
91
  children: panelGroupEditor.mode === 'Edit' ? 'Apply' : 'Add'
91
92
  }),
92
93
  /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Button, {
94
+ variant: "outlined",
93
95
  onClick: panelGroupEditor.close,
94
96
  children: "Cancel"
95
97
  })
@@ -1,4 +1,4 @@
1
- // Copyright 2022 The Perses Authors
1
+ // Copyright 2023 The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1,4 +1,4 @@
1
- // Copyright 2022 The Perses Authors
1
+ // Copyright 2023 The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1,4 +1,4 @@
1
- // Copyright 2022 The Perses Authors
1
+ // Copyright 2023 The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1,4 +1,4 @@
1
- // Copyright 2022 The Perses Authors
1
+ // Copyright 2023 The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -26,11 +26,12 @@ _export(exports, {
26
26
  });
27
27
  const _jsxRuntime = require("react/jsx-runtime");
28
28
  const _refresh = /*#__PURE__*/ _interopRequireDefault(require("mdi-material-ui/Refresh"));
29
- const _material = require("@mui/material");
30
29
  const _components = require("@perses-dev/components");
31
30
  const _pluginSystem = require("@perses-dev/plugin-system");
32
31
  const _core = require("@perses-dev/core");
32
+ const _constants = require("../../constants");
33
33
  const _context = require("../../context");
34
+ const _toolbarIconButton = require("../ToolbarIconButton");
34
35
  function _interopRequireDefault(obj) {
35
36
  return obj && obj.__esModule ? obj : {
36
37
  default: obj
@@ -96,7 +97,7 @@ const DEFAULT_HEIGHT = '34px';
96
97
  function TimeRangeControls({ heightPx }) {
97
98
  const { timeRange , setTimeRange , refresh } = (0, _pluginSystem.useTimeRange)();
98
99
  const defaultTimeRange = (0, _context.useDefaultTimeRange)();
99
- // Convert height as a number to height as a string, then use this value for styling
100
+ // Convert height to a string, then use the string for styling
100
101
  const height = heightPx === undefined ? DEFAULT_HEIGHT : `${heightPx}px`;
101
102
  // add time shortcut if one does not match duration from dashboard JSON
102
103
  if (!TIME_OPTIONS.some((option)=>option.value.pastDuration === defaultTimeRange.pastDuration)) {
@@ -117,20 +118,17 @@ function TimeRangeControls({ heightPx }) {
117
118
  onChange: setTimeRange,
118
119
  height: height
119
120
  }),
120
- /*#__PURE__*/ (0, _jsxRuntime.jsx)(RefreshIconButton, {
121
- "aria-label": "Refresh Dashboard",
122
- onClick: refresh,
123
- sx: {
124
- height
125
- },
126
- children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_refresh.default, {})
121
+ /*#__PURE__*/ (0, _jsxRuntime.jsx)(_components.InfoTooltip, {
122
+ description: _constants.TOOLTIP_TEXT.refreshDashboard,
123
+ children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_toolbarIconButton.ToolbarIconButton, {
124
+ "aria-label": _constants.TOOLTIP_TEXT.refreshDashboard,
125
+ onClick: refresh,
126
+ sx: {
127
+ height
128
+ },
129
+ children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_refresh.default, {})
130
+ })
127
131
  })
128
132
  ]
129
133
  });
130
134
  }
131
- const RefreshIconButton = (0, _material.styled)(_material.IconButton)(({ theme })=>({
132
- border: `1px solid ${theme.palette.grey[300]}`,
133
- borderRadius: theme.shape.borderRadius,
134
- padding: theme.spacing(0.5),
135
- color: theme.palette.grey[900]
136
- }));
@@ -1,4 +1,4 @@
1
- // Copyright 2022 The Perses Authors
1
+ // Copyright 2023 The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1,4 +1,4 @@
1
- // Copyright 2022 The Perses Authors
1
+ // Copyright 2023 The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -0,0 +1,35 @@
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
+ Object.defineProperty(exports, "ToolbarIconButton", {
18
+ enumerable: true,
19
+ get: ()=>ToolbarIconButton
20
+ });
21
+ const _jsxRuntime = require("react/jsx-runtime");
22
+ const _material = require("@mui/material");
23
+ function ToolbarIconButton(props) {
24
+ return /*#__PURE__*/ (0, _jsxRuntime.jsx)(IconButton, {
25
+ variant: "outlined",
26
+ color: "secondary",
27
+ ...props
28
+ });
29
+ }
30
+ const IconButton = (0, _material.styled)(_material.Button)(({ theme })=>({
31
+ // Using a button with some adjusted styles because it is easier to inherit
32
+ // styling and variants from themes than with an IconButton.
33
+ padding: theme.spacing(0.5),
34
+ minWidth: 'auto'
35
+ }));
@@ -0,0 +1,28 @@
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
+ _exportStar(require("./ToolbarIconButton"), exports);
18
+ function _exportStar(from, to) {
19
+ Object.keys(from).forEach(function(k) {
20
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) Object.defineProperty(to, k, {
21
+ enumerable: true,
22
+ get: function() {
23
+ return from[k];
24
+ }
25
+ });
26
+ });
27
+ return from;
28
+ }
@@ -0,0 +1,74 @@
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
+ Object.defineProperty(exports, "EditVariablesButton", {
18
+ enumerable: true,
19
+ get: ()=>EditVariablesButton
20
+ });
21
+ const _jsxRuntime = require("react/jsx-runtime");
22
+ const _react = require("react");
23
+ const _material = require("@mui/material");
24
+ const _pencilOutline = /*#__PURE__*/ _interopRequireDefault(require("mdi-material-ui/PencilOutline"));
25
+ const _components = require("@perses-dev/components");
26
+ const _constants = require("../../constants");
27
+ const _context = require("../../context");
28
+ const _variableEditor = require("./VariableEditor");
29
+ function _interopRequireDefault(obj) {
30
+ return obj && obj.__esModule ? obj : {
31
+ default: obj
32
+ };
33
+ }
34
+ function EditVariablesButton() {
35
+ const [isVariableEditorOpen, setIsVariableEditorOpen] = (0, _react.useState)(false);
36
+ const variableDefinitions = (0, _context.useTemplateVariableDefinitions)();
37
+ const { setVariableDefinitions } = (0, _context.useTemplateVariableActions)();
38
+ const openVariableEditor = ()=>{
39
+ setIsVariableEditorOpen(true);
40
+ };
41
+ const closeVariableEditor = ()=>{
42
+ setIsVariableEditorOpen(false);
43
+ };
44
+ return /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
45
+ children: [
46
+ /*#__PURE__*/ (0, _jsxRuntime.jsx)(_components.InfoTooltip, {
47
+ description: _constants.TOOLTIP_TEXT.editVariables,
48
+ children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Button, {
49
+ startIcon: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_pencilOutline.default, {}),
50
+ onClick: openVariableEditor,
51
+ "aria-label": _constants.TOOLTIP_TEXT.editVariables,
52
+ children: "Variables"
53
+ })
54
+ }),
55
+ /*#__PURE__*/ (0, _jsxRuntime.jsx)(_components.Drawer, {
56
+ isOpen: isVariableEditorOpen,
57
+ onClose: closeVariableEditor,
58
+ PaperProps: {
59
+ sx: {
60
+ width: '50%'
61
+ }
62
+ },
63
+ children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_variableEditor.VariableEditor, {
64
+ variableDefinitions: variableDefinitions,
65
+ onCancel: closeVariableEditor,
66
+ onChange: (variables)=>{
67
+ setVariableDefinitions(variables);
68
+ setIsVariableEditorOpen(false);
69
+ }
70
+ })
71
+ })
72
+ ]
73
+ });
74
+ }
@@ -1,4 +1,4 @@
1
- // Copyright 2022 The Perses Authors
1
+ // Copyright 2023 The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1,4 +1,4 @@
1
- // Copyright 2022 The Perses Authors
1
+ // Copyright 2023 The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -21,6 +21,7 @@ Object.defineProperty(exports, "VariableEditor", {
21
21
  const _jsxRuntime = require("react/jsx-runtime");
22
22
  const _react = require("react");
23
23
  const _material = require("@mui/material");
24
+ const _plus = /*#__PURE__*/ _interopRequireDefault(require("mdi-material-ui/Plus"));
24
25
  const _useImmer = require("use-immer");
25
26
  const _pencil = /*#__PURE__*/ _interopRequireDefault(require("mdi-material-ui/Pencil"));
26
27
  const _trashCan = /*#__PURE__*/ _interopRequireDefault(require("mdi-material-ui/TrashCan"));
@@ -209,8 +210,7 @@ function VariableEditor(props) {
209
210
  children: "Type"
210
211
  }),
211
212
  /*#__PURE__*/ (0, _jsxRuntime.jsx)(TableCell, {
212
- align: "right",
213
- children: "Action"
213
+ align: "right"
214
214
  })
215
215
  ]
216
216
  })
@@ -274,9 +274,13 @@ function VariableEditor(props) {
274
274
  /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Box, {
275
275
  display: "flex",
276
276
  children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Button, {
277
- onClick: addVariable,
278
277
  variant: "contained",
279
- children: "Add New"
278
+ startIcon: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_plus.default, {}),
279
+ sx: {
280
+ marginLeft: 'auto'
281
+ },
282
+ onClick: addVariable,
283
+ children: "Add Variable"
280
284
  })
281
285
  })
282
286
  ]
@@ -1,4 +1,4 @@
1
- // Copyright 2022 The Perses Authors
1
+ // Copyright 2023 The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -26,6 +26,7 @@ const _pluginSystem = require("@perses-dev/plugin-system");
26
26
  const _components = require("@perses-dev/components");
27
27
  const _refresh = /*#__PURE__*/ _interopRequireDefault(require("mdi-material-ui/Refresh"));
28
28
  const _clipboardOutline = /*#__PURE__*/ _interopRequireDefault(require("mdi-material-ui/ClipboardOutline"));
29
+ const _constants = require("../../../constants");
29
30
  const _variableModel = require("../variable-model");
30
31
  const _variableEditorFormModel = require("./variable-editor-form-model");
31
32
  function _interopRequireDefault(obj) {
@@ -115,18 +116,16 @@ function VariableListPreview({ definition , onRefresh }) {
115
116
  variant: "caption",
116
117
  children: "Preview Values"
117
118
  }),
118
- /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Tooltip, {
119
- title: "Refresh Values",
120
- placement: "right",
119
+ /*#__PURE__*/ (0, _jsxRuntime.jsx)(_components.InfoTooltip, {
120
+ description: _constants.TOOLTIP_TEXT.refreshVariableValues,
121
121
  children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.IconButton, {
122
122
  onClick: onRefresh,
123
123
  size: "small",
124
124
  children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_refresh.default, {})
125
125
  })
126
126
  }),
127
- /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Tooltip, {
128
- title: "Copy Values to Clipboard",
129
- placement: "right",
127
+ /*#__PURE__*/ (0, _jsxRuntime.jsx)(_components.InfoTooltip, {
128
+ description: _constants.TOOLTIP_TEXT.copyVariableValues,
130
129
  children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.IconButton, {
131
130
  onClick: async ()=>{
132
131
  if (data === null || data === void 0 ? void 0 : data.length) {
@@ -1,4 +1,4 @@
1
- // Copyright 2022 The Perses Authors
1
+ // Copyright 2023 The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1,4 +1,4 @@
1
- // Copyright 2022 The Perses Authors
1
+ // Copyright 2023 The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at