@perses-dev/dashboards 0.21.1 → 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 +1 @@
1
- {"version":3,"sources":["../../src/utils/functions.ts"],"sourcesContent":["// Copyright 2022 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 const removeWhiteSpacesAndSpecialCharacters = (str: string) => {\n return str.replace(/\\s+/g, '');\n};\n"],"names":["removeWhiteSpacesAndSpecialCharacters","str","replace"],"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,OAAO,MAAMA,qCAAqC,GAAG,CAACC,GAAW,GAAK;IACpE,OAAOA,GAAG,CAACC,OAAO,SAAS,EAAE,CAAC,CAAC;AACjC,CAAC,CAAC"}
1
+ {"version":3,"sources":["../../src/utils/functions.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 const removeWhiteSpacesAndSpecialCharacters = (str: string) => {\n return str.replace(/\\s+/g, '');\n};\n"],"names":["removeWhiteSpacesAndSpecialCharacters","str","replace"],"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,OAAO,MAAMA,qCAAqC,GAAG,CAACC,GAAW,GAAK;IACpE,OAAOA,GAAG,CAACC,OAAO,SAAS,EAAE,CAAC,CAAC;AACjC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './functions';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAaA,cAAc,aAAa,CAAC"}
@@ -0,0 +1,15 @@
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
+ export * from './functions';
14
+
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/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 './functions';\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,aAAa,CAAC"}
@@ -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 +1 @@
1
- {"version":3,"sources":["../../../src/views/ViewDashboard/DashboardApp.tsx"],"sourcesContent":["// Copyright 2022 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 { Box } from '@mui/material';\nimport { ErrorAlert, ErrorBoundary } from '@perses-dev/components';\nimport { DashboardResource } from '@perses-dev/core';\nimport {\n PanelDrawer,\n Dashboard,\n PanelGroupDialog,\n DeletePanelGroupDialog,\n DiscardChangesConfirmationDialog,\n DashboardToolbar,\n DeletePanelDialog,\n} from '../../components';\nimport { useDashboard, useDiscardChangesConfirmationDialog, useEditMode } from '../../context';\n\nexport interface DashboardAppProps {\n dashboardResource: DashboardResource;\n dashboardTitleComponent?: JSX.Element;\n onSave?: (entity: DashboardResource) => Promise<DashboardResource>;\n initialVariableIsSticky?: boolean;\n isReadonly: boolean;\n}\n\nexport const DashboardApp = (props: DashboardAppProps) => {\n const { dashboardResource, dashboardTitleComponent, onSave, initialVariableIsSticky, isReadonly } = props;\n const { setEditMode } = useEditMode();\n const { dashboard, setDashboard } = useDashboard();\n const [originalDashboard, setOriginalDashboard] = useState<DashboardResource | undefined>(undefined);\n\n const { openDiscardChangesConfirmationDialog, closeDiscardChangesConfirmationDialog } =\n useDiscardChangesConfirmationDialog();\n\n const handleDiscardChanges = () => {\n // Reset to the original spec and exit edit mode\n if (originalDashboard) {\n setDashboard(originalDashboard);\n }\n setEditMode(false);\n closeDiscardChangesConfirmationDialog();\n };\n\n const onEditButtonClick = () => {\n setEditMode(true);\n setOriginalDashboard(dashboard);\n };\n\n const onCancelButtonClick = () => {\n // check if dashboard has been modified\n if (JSON.stringify(dashboard) === JSON.stringify(originalDashboard)) {\n setEditMode(false);\n } else {\n openDiscardChangesConfirmationDialog({\n onDiscardChanges: () => {\n handleDiscardChanges();\n },\n onCancel: () => {\n closeDiscardChangesConfirmationDialog();\n },\n });\n }\n };\n\n return (\n <Box\n sx={{\n flexGrow: 1,\n overflowX: 'hidden',\n overflowY: 'auto',\n display: 'flex',\n flexDirection: 'column',\n }}\n >\n <DashboardToolbar\n dashboardName={dashboardResource.metadata.name}\n dashboardTitleComponent={dashboardTitleComponent}\n initialVariableIsSticky={initialVariableIsSticky}\n onSave={onSave}\n isReadonly={isReadonly}\n onEditButtonClick={onEditButtonClick}\n onCancelButtonClick={onCancelButtonClick}\n />\n <Box sx={{ padding: (theme) => theme.spacing(2) }}>\n <ErrorBoundary FallbackComponent={ErrorAlert}>\n <Dashboard />\n </ErrorBoundary>\n <PanelDrawer />\n <PanelGroupDialog />\n <DeletePanelGroupDialog />\n <DeletePanelDialog />\n <DiscardChangesConfirmationDialog />\n </Box>\n </Box>\n );\n};\n"],"names":["useState","Box","ErrorAlert","ErrorBoundary","PanelDrawer","Dashboard","PanelGroupDialog","DeletePanelGroupDialog","DiscardChangesConfirmationDialog","DashboardToolbar","DeletePanelDialog","useDashboard","useDiscardChangesConfirmationDialog","useEditMode","DashboardApp","props","dashboardResource","dashboardTitleComponent","onSave","initialVariableIsSticky","isReadonly","setEditMode","dashboard","setDashboard","originalDashboard","setOriginalDashboard","undefined","openDiscardChangesConfirmationDialog","closeDiscardChangesConfirmationDialog","handleDiscardChanges","onEditButtonClick","onCancelButtonClick","JSON","stringify","onDiscardChanges","onCancel","sx","flexGrow","overflowX","overflowY","display","flexDirection","dashboardName","metadata","name","padding","theme","spacing","FallbackComponent"],"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,GAAG,QAAQ,eAAe,CAAC;AACpC,SAASC,UAAU,EAAEC,aAAa,QAAQ,wBAAwB,CAAC;AAEnE,SACEC,WAAW,EACXC,SAAS,EACTC,gBAAgB,EAChBC,sBAAsB,EACtBC,gCAAgC,EAChCC,gBAAgB,EAChBC,iBAAiB,QACZ,kBAAkB,CAAC;AAC1B,SAASC,YAAY,EAAEC,mCAAmC,EAAEC,WAAW,QAAQ,eAAe,CAAC;AAU/F,OAAO,MAAMC,YAAY,GAAG,CAACC,KAAwB,GAAK;IACxD,MAAM,EAAEC,iBAAiB,CAAA,EAAEC,uBAAuB,CAAA,EAAEC,MAAM,CAAA,EAAEC,uBAAuB,CAAA,EAAEC,UAAU,CAAA,EAAE,GAAGL,KAAK,AAAC;IAC1G,MAAM,EAAEM,WAAW,CAAA,EAAE,GAAGR,WAAW,EAAE,AAAC;IACtC,MAAM,EAAES,SAAS,CAAA,EAAEC,YAAY,CAAA,EAAE,GAAGZ,YAAY,EAAE,AAAC;IACnD,MAAM,CAACa,iBAAiB,EAAEC,oBA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AEA,MAAM;gBACdE,UAAU,EAAEA,UAAU;gBACtBU,iBAAiB,EAAEA,iBAAiB;gBACpCC,mBAAmB,EAAEA,mBAAmB;cACxC;0BACF,MAAC9B,GAAG;gBAACmC,EAAE,EAAE;oBAAES,OAAO,EAAE,CAACC,KAAK,GAAKA,KAAK,CAACC,OAAO,CAAC,CAAC,CAAC;iBAAE;;kCAC/C,KAAC5C,aAAa;wBAAC6C,iBAAiB,EAAE9C,UAAU;kCAC1C,cAAA,KAACG,SAAS,KAAG;sBACC;kCAChB,KAACD,WAAW,KAAG;kCACf,KAACE,gBAAgB,KAAG;kCACpB,KAACC,sBAAsB,KAAG;kCAC1B,KAACG,iBAAiB,KAAG;kCACrB,KAACF,gCAAgC,KAAG;;cAChC;;MACF,CACN;AACJ,CAAC,CAAC"}
1
+ {"version":3,"sources":["../../../src/views/ViewDashboard/DashboardApp.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 { Box } from '@mui/material';\nimport { ErrorAlert, ErrorBoundary } from '@perses-dev/components';\nimport { DashboardResource } from '@perses-dev/core';\nimport {\n PanelDrawer,\n Dashboard,\n PanelGroupDialog,\n DeletePanelGroupDialog,\n DiscardChangesConfirmationDialog,\n DashboardToolbar,\n DeletePanelDialog,\n} from '../../components';\nimport { useDashboard, useDiscardChangesConfirmationDialog, useEditMode } from '../../context';\n\nexport interface DashboardAppProps {\n dashboardResource: DashboardResource;\n dashboardTitleComponent?: JSX.Element;\n onSave?: (entity: DashboardResource) => Promise<DashboardResource>;\n initialVariableIsSticky?: boolean;\n isReadonly: boolean;\n}\n\nexport const DashboardApp = (props: DashboardAppProps) => {\n const { dashboardResource, dashboardTitleComponent, onSave, initialVariableIsSticky, isReadonly } = props;\n const { setEditMode } = useEditMode();\n const { dashboard, setDashboard } = useDashboard();\n const [originalDashboard, setOriginalDashboard] = useState<DashboardResource | undefined>(undefined);\n\n const { openDiscardChangesConfirmationDialog, closeDiscardChangesConfirmationDialog } =\n useDiscardChangesConfirmationDialog();\n\n const handleDiscardChanges = () => {\n // Reset to the original spec and exit edit mode\n if (originalDashboard) {\n setDashboard(originalDashboard);\n }\n setEditMode(false);\n closeDiscardChangesConfirmationDialog();\n };\n\n const onEditButtonClick = () => {\n setEditMode(true);\n setOriginalDashboard(dashboard);\n };\n\n const onCancelButtonClick = () => {\n // check if dashboard has been modified\n if (JSON.stringify(dashboard) === JSON.stringify(originalDashboard)) {\n setEditMode(false);\n } else {\n openDiscardChangesConfirmationDialog({\n onDiscardChanges: () => {\n handleDiscardChanges();\n },\n onCancel: () => {\n closeDiscardChangesConfirmationDialog();\n },\n });\n }\n };\n\n return (\n <Box\n sx={{\n flexGrow: 1,\n overflowX: 'hidden',\n overflowY: 'auto',\n display: 'flex',\n flexDirection: 'column',\n }}\n >\n <DashboardToolbar\n dashboardName={dashboardResource.metadata.name}\n dashboardTitleComponent={dashboardTitleComponent}\n initialVariableIsSticky={initialVariableIsSticky}\n onSave={onSave}\n isReadonly={isReadonly}\n onEditButtonClick={onEditButtonClick}\n onCancelButtonClick={onCancelButtonClick}\n />\n <Box sx={{ padding: (theme) => theme.spacing(2) }}>\n <ErrorBoundary FallbackComponent={ErrorAlert}>\n <Dashboard />\n </ErrorBoundary>\n <PanelDrawer />\n <PanelGroupDialog />\n <DeletePanelGroupDialog />\n <DeletePanelDialog />\n <DiscardChangesConfirmationDialog />\n </Box>\n </Box>\n );\n};\n"],"names":["useState","Box","ErrorAlert","ErrorBoundary","PanelDrawer","Dashboard","PanelGroupDialog","DeletePanelGroupDialog","DiscardChangesConfirmationDialog","DashboardToolbar","DeletePanelDialog","useDashboard","useDiscardChangesConfirmationDialog","useEditMode","DashboardApp","props","dashboardResource","dashboardTitleComponent","onSave","initialVariableIsSticky","isReadonly","setEditMode","dashboard","setDashboard","originalDashboard","setOriginalDashboard","undefined","openDiscardChangesConfirmationDialog","closeDiscardChangesConfirmationDialog","handleDiscardChanges","onEditButtonClick","onCancelButtonClick","JSON","stringify","onDiscardChanges","onCancel","sx","flexGrow","overflowX","overflowY","display","flexDirection","dashboardName","metadata","name","padding","theme","spacing","FallbackComponent"],"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,GAAG,QAAQ,eAAe,CAAC;AACpC,SAASC,UAAU,EAAEC,aAAa,QAAQ,wBAAwB,CAAC;AAEnE,SACEC,WAAW,EACXC,SAAS,EACTC,gBAAgB,EAChBC,sBAAsB,EACtBC,gCAAgC,EAChCC,gBAAgB,EAChBC,iBAAiB,QACZ,kBAAkB,CAAC;AAC1B,SAASC,YAAY,EAAEC,mCAAmC,EAAEC,WAAW,QAAQ,eAAe,CAAC;AAU/F,OAAO,MAAMC,YAAY,GAAG,CAACC,KAAwB,GAAK;IACxD,MAAM,EAAEC,iBAAiB,CAAA,EAAEC,uBAAuB,CAAA,EAAEC,MAAM,CAAA,EAAEC,uBAAuB,CAAA,EAAEC,UAAU,CAAA,EAAE,GAAGL,KAAK,AAAC;IAC1G,MAAM,EAAEM,WAAW,CAAA,EAAE,GAAGR,WAAW,EAAE,AAAC;IACtC,MAAM,EAAES,SAAS,CAAA,EAAEC,YAAY,CAAA,EAAE,GAAGZ,YAAY,EAAE,AAAC;IACnD,MAAM,CAACa,iBAAiB,EAAEC,oBAAoB,CAA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M;gBACdE,UAAU,EAAEA,UAAU;gBACtBU,iBAAiB,EAAEA,iBAAiB;gBACpCC,mBAAmB,EAAEA,mBAAmB;cACxC;0BACF,MAAC9B,GAAG;gBAACmC,EAAE,EAAE;oBAAES,OAAO,EAAE,CAACC,KAAK,GAAKA,KAAK,CAACC,OAAO,CAAC,CAAC,CAAC;iBAAE;;kCAC/C,KAAC5C,aAAa;wBAAC6C,iBAAiB,EAAE9C,UAAU;kCAC1C,cAAA,KAACG,SAAS,KAAG;sBACC;kCAChB,KAACD,WAAW,KAAG;kCACf,KAACE,gBAAgB,KAAG;kCACpB,KAACC,sBAAsB,KAAG;kCAC1B,KAACG,iBAAiB,KAAG;kCACrB,KAACF,gCAAgC,KAAG;;cAChC;;MACF,CACN;AACJ,CAAC,CAAC"}
@@ -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 +1 @@
1
- {"version":3,"sources":["../../../src/views/ViewDashboard/ViewDashboard.tsx"],"sourcesContent":["// Copyright 2022 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 { Box, BoxProps } from '@mui/material';\nimport { DashboardResource } from '@perses-dev/core';\nimport { ErrorBoundary, ErrorAlert, combineSx } from '@perses-dev/components';\nimport { TimeRangeProvider, useInitialTimeRange } from '@perses-dev/plugin-system';\nimport {\n TemplateVariableProvider,\n DashboardProvider,\n DatasourceStoreProviderProps,\n DatasourceStoreProvider,\n} from '../../context';\nimport { DashboardApp } from './DashboardApp';\n\nexport interface ViewDashboardProps extends Omit<BoxProps, 'children'> {\n dashboardResource: DashboardResource;\n datasourceApi: DatasourceStoreProviderProps['datasourceApi'];\n dashboardTitleComponent?: JSX.Element;\n onSave?: (entity: DashboardResource) => Promise<DashboardResource>;\n initialVariableIsSticky?: boolean;\n isReadonly: boolean;\n}\n\n/**\n * The View for displaying a Dashboard, along with the UI for selecting variable values.\n */\nexport function ViewDashboard(props: ViewDashboardProps) {\n const {\n dashboardResource,\n datasourceApi,\n dashboardTitleComponent,\n onSave,\n initialVariableIsSticky,\n isReadonly,\n sx,\n ...others\n } = props;\n const { spec } = dashboardResource;\n const dashboardDuration = spec.duration ?? '1h';\n const initialTimeRange = useInitialTimeRange(dashboardDuration);\n\n return (\n <DatasourceStoreProvider dashboardResource={dashboardResource} datasourceApi={datasourceApi}>\n <DashboardProvider initialState={{ dashboardResource }}>\n <TimeRangeProvider initialTimeRange={initialTimeRange} enabledURLParams={true}>\n <TemplateVariableProvider initialVariableDefinitions={spec.variables}>\n <Box\n sx={combineSx(\n {\n display: 'flex',\n width: '100%',\n height: '100%',\n position: 'relative',\n overflow: 'hidden',\n },\n sx\n )}\n {...others}\n >\n <ErrorBoundary FallbackComponent={ErrorAlert}>\n <DashboardApp\n dashboardResource={dashboardResource}\n dashboardTitleComponent={dashboardTitleComponent}\n onSave={onSave}\n initialVariableIsSticky={initialVariableIsSticky}\n isReadonly={isReadonly}\n />\n </ErrorBoundary>\n </Box>\n </TemplateVariableProvider>\n </TimeRangeProvider>\n </DashboardProvider>\n </DatasourceStoreProvider>\n );\n}\n"],"names":["Box","ErrorBoundary","ErrorAlert","combineSx","TimeRangeProvider","useInitialTimeRange","TemplateVariableProvider","DashboardProvider","DatasourceStoreProvider","DashboardApp","ViewDashboard","props","dashboardResource","datasourceApi","dashboardTitleComponent","onSave","initialVariableIsSticky","isReadonly","sx","others","spec","dashboardDuration","duration","initialTimeRange","initialState","enabledURLParams","initialVariableDefinitions","variables","display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,cAAA,KAACnB,wBAAwB;oBAACoB,0BAA0B,EAAEN,IAAI,CAACO,SAAS;8BAClE,cAAA,KAAC3B,GAAG;wBACFkB,EAAE,EAAEf,SAAS,CACX;4BACEyB,OAAO,EAAE,MAAM;4BACfC,KAAK,EAAE,MAAM;4BACbC,MAAM,EAAE,MAAM;4BACdC,QAAQ,EAAE,UAAU;4BACpBC,QAAQ,EAAE,QAAQ;yBACnB,EACDd,EAAE,CACH;wBACA,GAAGC,MAAM;kCAEV,cAAA,KAAClB,aAAa;4BAACgC,iBAAiB,EAAE/B,UAAU;sCAC1C,cAAA,KAACO,YAAY;gCACXG,iBAAiB,EAAEA,iBAAiB;gCACpCE,uBAAuB,EAAEA,uBAAuB;gCAChDC,MAAM,EAAEA,MAAM;gCACdC,uBAAuB,EAAEA,uBAAuB;gCAChDC,UAAU,EAAEA,UAAU;8BACtB;0BACY;sBACZ;kBACmB;cACT;UACF;MACI,CAC1B;AACJ,CAAC"}
1
+ {"version":3,"sources":["../../../src/views/ViewDashboard/ViewDashboard.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 { Box, BoxProps } from '@mui/material';\nimport { DashboardResource } from '@perses-dev/core';\nimport { ErrorBoundary, ErrorAlert, combineSx } from '@perses-dev/components';\nimport { TimeRangeProvider, useInitialTimeRange } from '@perses-dev/plugin-system';\nimport {\n TemplateVariableProvider,\n DashboardProvider,\n DatasourceStoreProviderProps,\n DatasourceStoreProvider,\n} from '../../context';\nimport { DashboardApp } from './DashboardApp';\n\nexport interface ViewDashboardProps extends Omit<BoxProps, 'children'> {\n dashboardResource: DashboardResource;\n datasourceApi: DatasourceStoreProviderProps['datasourceApi'];\n dashboardTitleComponent?: JSX.Element;\n onSave?: (entity: DashboardResource) => Promise<DashboardResource>;\n initialVariableIsSticky?: boolean;\n isReadonly: boolean;\n}\n\n/**\n * The View for displaying a Dashboard, along with the UI for selecting variable values.\n */\nexport function ViewDashboard(props: ViewDashboardProps) {\n const {\n dashboardResource,\n datasourceApi,\n dashboardTitleComponent,\n onSave,\n initialVariableIsSticky,\n isReadonly,\n sx,\n ...others\n } = props;\n const { spec } = dashboardResource;\n const dashboardDuration = spec.duration ?? '1h';\n const initialTimeRange = useInitialTimeRange(dashboardDuration);\n\n return (\n <DatasourceStoreProvider dashboardResource={dashboardResource} datasourceApi={datasourceApi}>\n <DashboardProvider initialState={{ dashboardResource }}>\n <TimeRangeProvider initialTimeRange={initialTimeRange} enabledURLParams={true}>\n <TemplateVariableProvider initialVariableDefinitions={spec.variables}>\n <Box\n sx={combineSx(\n {\n display: 'flex',\n width: '100%',\n height: '100%',\n position: 'relative',\n overflow: 'hidden',\n },\n sx\n )}\n {...others}\n >\n <ErrorBoundary FallbackComponent={ErrorAlert}>\n <DashboardApp\n dashboardResource={dashboardResource}\n dashboardTitleComponent={dashboardTitleComponent}\n onSave={onSave}\n initialVariableIsSticky={initialVariableIsSticky}\n isReadonly={isReadonly}\n />\n </ErrorBoundary>\n </Box>\n </TemplateVariableProvider>\n </TimeRangeProvider>\n </DashboardProvider>\n </DatasourceStoreProvider>\n );\n}\n"],"names":["Box","ErrorBoundary","ErrorAlert","combineSx","TimeRangeProvider","useInitialTimeRange","TemplateVariableProvider","DashboardProvider","DatasourceStoreProvider","DashboardApp","ViewDashboard","props","dashboardResource","datasourceApi","dashboardTitleComponent","onSave","initialVariableIsSticky","isReadonly","sx","others","spec","dashboardDuration","duration","initialTimeRange","initialState","enabledURLParams","initialVariableDefinitions","variables","display","width","height","position","overflow","FallbackComponent"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;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AAS;8BAClE,cAAA,KAAC3B,GAAG;wBACFkB,EAAE,EAAEf,SAAS,CACX;4BACEyB,OAAO,EAAE,MAAM;4BACfC,KAAK,EAAE,MAAM;4BACbC,MAAM,EAAE,MAAM;4BACdC,QAAQ,EAAE,UAAU;4BACpBC,QAAQ,EAAE,QAAQ;yBACnB,EACDd,EAAE,CACH;wBACA,GAAGC,MAAM;kCAEV,cAAA,KAAClB,aAAa;4BAACgC,iBAAiB,EAAE/B,UAAU;sCAC1C,cAAA,KAACO,YAAY;gCACXG,iBAAiB,EAAEA,iBAAiB;gCACpCE,uBAAuB,EAAEA,uBAAuB;gCAChDC,MAAM,EAAEA,MAAM;gCACdC,uBAAuB,EAAEA,uBAAuB;gCAChDC,UAAU,EAAEA,UAAU;8BACtB;0BACY;sBACZ;kBACmB;cACT;UACF;MACI,CAC1B;AACJ,CAAC"}
@@ -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 +1 @@
1
- {"version":3,"sources":["../../../src/views/ViewDashboard/index.ts"],"sourcesContent":["// Copyright 2022 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 './ViewDashboard';\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,iBAAiB,CAAC"}
1
+ {"version":3,"sources":["../../../src/views/ViewDashboard/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 './ViewDashboard';\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,iBAAiB,CAAC"}
@@ -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 +1 @@
1
- {"version":3,"sources":["../../../../src/views/ViewDashboard/tests/panelGroups.test.tsx"],"sourcesContent":["// Copyright 2022 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 { screen } from '@testing-library/react';\nimport userEvent from '@testing-library/user-event';\nimport { TimeRangeProvider } from '@perses-dev/plugin-system';\nimport { DashboardProvider, TemplateVariableProvider } from '../../../context';\nimport { getTestDashboard, renderWithContext } from '../../../test';\nimport { DashboardApp } from '../DashboardApp';\n\ndescribe('Panel Groups', () => {\n const renderDashboard = () => {\n renderWithContext(\n <TimeRangeProvider initialTimeRange={{ pastDuration: '30m' }}>\n <TemplateVariableProvider>\n <DashboardProvider initialState={{ dashboardResource: getTestDashboard(), isEditMode: true }}>\n <DashboardApp dashboardResource={getTestDashboard()} isReadonly={false} />\n </DashboardProvider>\n </TemplateVariableProvider>\n </TimeRangeProvider>\n );\n };\n it('should delete panel', () => {\n renderDashboard();\n const panelTitle = 'CPU';\n const deletePanelButton = screen.getByLabelText(`delete panel ${panelTitle}`);\n userEvent.click(deletePanelButton);\n screen.getByText('Delete Panel');\n const deleteButton = screen.getByText('Delete');\n userEvent.click(deleteButton);\n\n // The panel should disappear\n const deletedPanel = screen.queryByText(panelTitle);\n expect(deletedPanel).not.toBeInTheDocument();\n });\n\n it('should only delete panel from panel group if panel is not referenced more than once', () => {\n renderDashboard();\n\n const panelTitle = 'Disk I/O Utilization';\n const panels = screen.getAllByText(panelTitle);\n expect(panels).toHaveLength(2);\n\n const deletePanelButton = screen.getAllByLabelText(`delete panel ${panelTitle}`)[0];\n if (deletePanelButton === undefined) throw new Error('Missing delete button');\n\n userEvent.click(deletePanelButton);\n screen.getByText('Delete Panel');\n const deleteButton = screen.getByText('Delete');\n userEvent.click(deleteButton);\n\n // The deleted panel should still be on screen in the other group\n const deletedPanel = screen.queryByText(panelTitle);\n expect(deletedPanel).toBeInTheDocument();\n });\n\n it('should swap panels', () => {\n renderDashboard();\n\n // should move panel down\n const groupTitle1 = 'CPU Stats';\n const moveGroupDownBtn = screen.getByLabelText(`move group ${groupTitle1} down`);\n userEvent.click(moveGroupDownBtn);\n\n // should move panel up\n const groupTitle2 = 'Disk Stats';\n const moveGroupUpBtn = screen.getByLabelText(`move group ${groupTitle2} up`);\n userEvent.click(moveGroupUpBtn);\n\n /* TODO: Figure out how to test this visually without coupling to the store\n const layouts = storeApi.getState().layouts;\n expect(layouts[0]?.title).toBe(undefined);\n expect(layouts[1]?.title).toBe('Disk Stats');\n expect(layouts[2]?.title).toBe('CPU Stats');\n */\n });\n\n it('should delete a panel group', () => {\n renderDashboard();\n const groupTitle = 'CPU Stats';\n const deleteGroupIcon = screen.getByLabelText(`delete group ${groupTitle}`);\n userEvent.click(deleteGroupIcon);\n screen.getByText('Delete Panel Group');\n const deleteButton = screen.getByText('Delete');\n userEvent.click(deleteButton);\n\n // should remove group\n const deletedGroup = screen.queryByText(groupTitle);\n expect(deletedGroup).not.toBeInTheDocument();\n\n // CPU panel should be completely gone since it wasn't in any other group\n let panel = screen.queryByText('CPU');\n expect(panel).not.toBeInTheDocument();\n\n // A DiskIO panel should still be present in the other group that wasn't deleted\n panel = screen.queryByText('Disk I/O Utilization');\n expect(panel).toBeInTheDocument();\n });\n});\n"],"names":["screen","userEvent","TimeRangeProvider","DashboardProvider","TemplateVariableProvider","getTestDashboard","renderWithContext","DashboardApp","describe","renderDashboard","initialTimeRange","pastDuration","initialState","dashboardResource","isEditMode","isReadonly","it","panelTitle","deletePanelButton","getByLabelText","click","getByText","deleteButton","deletedPanel","queryByText","expect","not","toBeInTheDocument","panels","getAllByText","toHaveLength","getAllByLabelText","undefined","Error","groupTitle1","moveGroupDownBtn","groupTitle2","moveGroupUpBtn","groupTitle","deleteGroupIcon","deletedGroup","panel"],"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,MAAM,QAAQ,wBAAwB,CAAC;AAChD,OAAOC,SAAS,MAAM,6BAA6B,CAAC;AACpD,SAASC,iBAAiB,QAAQ,2BAA2B,CAAC;AAC9D,SAASC,iBAAiB,EAAEC,wBAAwB,QAAQ,kBAAkB,CAAC;AAC/E,SAASC,gBAAgB,EAA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nC,SAAS,CAACmB,KAAK,CAACiB,cAAc,CAAC,CAAC;IAEhC;;;;;IAKA,GACF,CAAC,CAAC,CAAC;IAEHrB,EAAE,CAAC,6BAA6B,EAAE,IAAM;QACtCP,eAAe,EAAE,CAAC;QAClB,MAAM6B,UAAU,GAAG,WAAW,AAAC;QAC/B,MAAMC,eAAe,GAAGvC,MAAM,CAACmB,cAAc,CAAC,CAAC,aAAa,EAAEmB,UAAU,CAAC,CAAC,CAAC,AAAC;QAC5ErC,SAAS,CAACmB,KAAK,CAACmB,eAAe,CAAC,CAAC;QACjCvC,MAAM,CAACqB,SAAS,CAAC,oBAAoB,CAAC,CAAC;QACvC,MAAMC,YAAY,GAAGtB,MAAM,CAACqB,SAAS,CAAC,QAAQ,CAAC,AAAC;QAChDpB,SAAS,CAACmB,KAAK,CAACE,YAAY,CAAC,CAAC;QAE9B,sBAAsB;QACtB,MAAMkB,YAAY,GAAGxC,MAAM,CAACwB,WAAW,CAACc,UAAU,CAAC,AAAC;QACpDb,MAAM,CAACe,YAAY,CAAC,CAACd,GAAG,CAACC,iBAAiB,EAAE,CAAC;QAE7C,yEAAyE;QACzE,IAAIc,KAAK,GAAGzC,MAAM,CAACwB,WAAW,CAAC,KAAK,CAAC,AAAC;QACtCC,MAAM,CAACgB,KAAK,CAAC,CAACf,GAAG,CAACC,iBAAiB,EAAE,CAAC;QAEtC,gFAAgF;QAChFc,KAAK,GAAGzC,MAAM,CAACwB,WAAW,CAAC,sBAAsB,CAAC,CAAC;QACnDC,MAAM,CAACgB,KAAK,CAAC,CAACd,iBAAiB,EAAE,CAAC;IACpC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
1
+ {"version":3,"sources":["../../../../src/views/ViewDashboard/tests/panelGroups.test.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 { screen } from '@testing-library/react';\nimport userEvent from '@testing-library/user-event';\nimport { TimeRangeProvider } from '@perses-dev/plugin-system';\nimport { DashboardProvider, TemplateVariableProvider } from '../../../context';\nimport { getTestDashboard, renderWithContext } from '../../../test';\nimport { DashboardApp } from '../DashboardApp';\n\ndescribe('Panel Groups', () => {\n const renderDashboard = () => {\n renderWithContext(\n <TimeRangeProvider initialTimeRange={{ pastDuration: '30m' }}>\n <TemplateVariableProvider>\n <DashboardProvider initialState={{ dashboardResource: getTestDashboard(), isEditMode: true }}>\n <DashboardApp dashboardResource={getTestDashboard()} isReadonly={false} />\n </DashboardProvider>\n </TemplateVariableProvider>\n </TimeRangeProvider>\n );\n };\n it('should delete panel', () => {\n renderDashboard();\n const panelTitle = 'CPU';\n const deletePanelButton = screen.getByLabelText(`delete panel ${panelTitle}`);\n userEvent.click(deletePanelButton);\n screen.getByText('Delete Panel');\n const deleteButton = screen.getByText('Delete');\n userEvent.click(deleteButton);\n\n // The panel should disappear\n const deletedPanel = screen.queryByText(panelTitle);\n expect(deletedPanel).not.toBeInTheDocument();\n });\n\n it('should only delete panel from panel group if panel is not referenced more than once', () => {\n renderDashboard();\n\n const panelTitle = 'Disk I/O Utilization';\n const panels = screen.getAllByText(panelTitle);\n expect(panels).toHaveLength(2);\n\n const deletePanelButton = screen.getAllByLabelText(`delete panel ${panelTitle}`)[0];\n if (deletePanelButton === undefined) throw new Error('Missing delete button');\n\n userEvent.click(deletePanelButton);\n screen.getByText('Delete Panel');\n const deleteButton = screen.getByText('Delete');\n userEvent.click(deleteButton);\n\n // The deleted panel should still be on screen in the other group\n const deletedPanel = screen.queryByText(panelTitle);\n expect(deletedPanel).toBeInTheDocument();\n });\n\n it('should swap panels', () => {\n renderDashboard();\n\n // should move panel down\n const groupTitle1 = 'CPU Stats';\n const moveGroupDownBtn = screen.getByLabelText(`move group ${groupTitle1} down`);\n userEvent.click(moveGroupDownBtn);\n\n // should move panel up\n const groupTitle2 = 'Disk Stats';\n const moveGroupUpBtn = screen.getByLabelText(`move group ${groupTitle2} up`);\n userEvent.click(moveGroupUpBtn);\n\n /* TODO: Figure out how to test this visually without coupling to the store\n const layouts = storeApi.getState().layouts;\n expect(layouts[0]?.title).toBe(undefined);\n expect(layouts[1]?.title).toBe('Disk Stats');\n expect(layouts[2]?.title).toBe('CPU Stats');\n */\n });\n\n it('should delete a panel group', () => {\n renderDashboard();\n const groupTitle = 'CPU Stats';\n const deleteGroupIcon = screen.getByLabelText(`delete group ${groupTitle}`);\n userEvent.click(deleteGroupIcon);\n screen.getByText('Delete Panel Group');\n const deleteButton = screen.getByText('Delete');\n userEvent.click(deleteButton);\n\n // should remove group\n const deletedGroup = screen.queryByText(groupTitle);\n expect(deletedGroup).not.toBeInTheDocument();\n\n // CPU panel should be completely gone since it wasn't in any other group\n let panel = screen.queryByText('CPU');\n expect(panel).not.toBeInTheDocument();\n\n // A DiskIO panel should still be present in the other group that wasn't deleted\n panel = screen.queryByText('Disk I/O Utilization');\n expect(panel).toBeInTheDocument();\n });\n});\n"],"names":["screen","userEvent","TimeRangeProvider","DashboardProvider","TemplateVariableProvider","getTestDashboard","renderWithContext","DashboardApp","describe","renderDashboard","initialTimeRange","pastDuration","initialState","dashboardResource","isEditMode","isReadonly","it","panelTitle","deletePanelButton","getByLabelText","click","getByText","deleteButton","deletedPanel","queryByText","expect","not","toBeInTheDocument","panels","getAllByText","toHaveLength","getAllByLabelText","undefined","Error","groupTitle1","moveGroupDownBtn","groupTitle2","moveGroupUpBtn","groupTitle","deleteGroupIcon","deletedGroup","panel"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AAC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AACd,iBAAiB,EAAE,CAAC;IACpC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -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 +1 @@
1
- {"version":3,"sources":["../../src/views/index.ts"],"sourcesContent":["// Copyright 2022 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 './ViewDashboard';\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,iBAAiB,CAAC"}
1
+ {"version":3,"sources":["../../src/views/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 './ViewDashboard';\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,iBAAiB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@perses-dev/dashboards",
3
- "version": "0.21.1",
3
+ "version": "0.22.0",
4
4
  "description": "The dashboards feature in Perses",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://github.com/perses/perses/blob/main/README.md",
@@ -28,9 +28,9 @@
28
28
  "lint:fix": "eslint --fix src --ext .ts,.tsx"
29
29
  },
30
30
  "dependencies": {
31
- "@perses-dev/components": "0.21.1",
32
- "@perses-dev/core": "0.21.1",
33
- "@perses-dev/plugin-system": "0.21.1",
31
+ "@perses-dev/components": "0.22.0",
32
+ "@perses-dev/core": "0.22.0",
33
+ "@perses-dev/plugin-system": "0.22.0",
34
34
  "@types/react-grid-layout": "^1.3.2",
35
35
  "date-fns": "^2.28.0",
36
36
  "immer": "^9.0.15",