@perses-dev/dashboards 0.0.0-snapshot-embed-import-errors-8906900 → 0.0.0-snapshot-test-internal-dep-dd238ac

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 (335) 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 +49 -22
  8. package/dist/cjs/components/DashboardToolbar/index.js +1 -1
  9. package/dist/cjs/components/DeletePanelDialog/DeletePanelDialog.js +9 -31
  10. package/dist/cjs/components/DeletePanelDialog/index.js +1 -1
  11. package/dist/cjs/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js +2 -1
  12. package/dist/cjs/components/DeletePanelGroupDialog/index.js +1 -1
  13. package/dist/cjs/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.js +2 -1
  14. package/dist/cjs/components/DiscardChangesConfirmationDialog/index.js +1 -1
  15. package/dist/cjs/components/DownloadButton/DownloadButton.js +16 -46
  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 +3 -2
  19. package/dist/cjs/components/GridLayout/GridLayout.js +6 -8
  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 +6 -6
  23. package/dist/cjs/components/Panel/PanelContent.js +3 -2
  24. package/dist/cjs/components/Panel/PanelHeader.js +26 -8
  25. package/dist/cjs/components/Panel/index.js +1 -1
  26. package/dist/cjs/components/PanelDrawer/PanelDrawer.js +2 -1
  27. package/dist/cjs/components/PanelDrawer/PanelEditorForm.js +1 -1
  28. package/dist/cjs/components/PanelDrawer/PanelPreview.js +1 -1
  29. package/dist/cjs/components/PanelDrawer/index.js +1 -1
  30. package/dist/cjs/components/PanelGroupDialog/PanelGroupDialog.js +4 -1
  31. package/dist/cjs/components/PanelGroupDialog/PanelGroupEditorForm.js +1 -1
  32. package/dist/cjs/components/PanelGroupDialog/index.js +1 -1
  33. package/dist/cjs/components/TimeRangeControls/TimeRangeControls.js +19 -11
  34. package/dist/cjs/components/TimeRangeControls/index.js +1 -1
  35. package/dist/cjs/components/ToolbarIconButton/ToolbarIconButton.js +1 -1
  36. package/dist/cjs/components/ToolbarIconButton/index.js +1 -1
  37. package/dist/cjs/components/Variables/EditVariablesButton.js +75 -0
  38. package/dist/cjs/components/Variables/Variable.js +1 -1
  39. package/dist/cjs/components/Variables/VariableEditor.js +10 -6
  40. package/dist/cjs/components/Variables/VariableEditorForm/VariableEditorForm.js +6 -7
  41. package/dist/cjs/components/Variables/VariableEditorForm/index.js +1 -1
  42. package/dist/cjs/components/Variables/VariableEditorForm/variable-editor-form-model.js +1 -1
  43. package/dist/cjs/components/Variables/VariableList.js +45 -111
  44. package/dist/cjs/components/Variables/index.js +4 -2
  45. package/dist/cjs/components/Variables/variable-model.js +1 -1
  46. package/dist/cjs/components/index.js +3 -1
  47. package/dist/cjs/{utils/functions.js → constants/grid-layout-config.js} +14 -6
  48. package/dist/cjs/constants/index.js +29 -0
  49. package/dist/cjs/constants/user-interface-text.js +61 -0
  50. package/dist/cjs/context/DashboardProvider/DashboardProvider.js +38 -14
  51. package/dist/cjs/context/DashboardProvider/common.js +1 -1
  52. package/dist/cjs/context/DashboardProvider/dashboard-provider-api.js +7 -5
  53. package/dist/cjs/context/DashboardProvider/delete-panel-group-slice.js +1 -1
  54. package/dist/cjs/context/DashboardProvider/delete-panel-slice.js +1 -1
  55. package/dist/cjs/context/DashboardProvider/discard-changes-dialog-slice.js +1 -1
  56. package/dist/cjs/context/DashboardProvider/duplicate-panel-slice.js +62 -0
  57. package/dist/cjs/context/DashboardProvider/index.js +1 -1
  58. package/dist/cjs/context/DashboardProvider/panel-editor-slice.js +9 -38
  59. package/dist/cjs/context/DashboardProvider/panel-group-editor-slice.js +1 -1
  60. package/dist/cjs/context/DashboardProvider/panel-group-slice.js +1 -1
  61. package/dist/cjs/context/DashboardProvider/panel-slice.js +1 -1
  62. package/dist/cjs/context/DatasourceStoreProvider.js +1 -1
  63. package/dist/cjs/context/TemplateVariableProvider/TemplateVariableProvider.js +1 -1
  64. package/dist/cjs/context/TemplateVariableProvider/index.js +1 -1
  65. package/dist/cjs/context/TemplateVariableProvider/query-params.js +1 -1
  66. package/dist/cjs/context/index.js +1 -1
  67. package/dist/cjs/context/useDashboard.js +5 -3
  68. package/dist/cjs/index.js +1 -1
  69. package/dist/cjs/test/dashboard-provider.js +1 -1
  70. package/dist/cjs/test/index.js +1 -1
  71. package/dist/cjs/test/plugin-registry.js +1 -1
  72. package/dist/cjs/test/render.js +1 -1
  73. package/dist/cjs/test/setup-tests.js +1 -1
  74. package/dist/cjs/test/testDashboard.js +1 -1
  75. package/dist/cjs/utils/index.js +28 -0
  76. package/dist/cjs/utils/panelUtils.js +168 -0
  77. package/dist/cjs/views/ViewDashboard/DashboardApp.js +5 -2
  78. package/dist/cjs/views/ViewDashboard/ViewDashboard.js +5 -3
  79. package/dist/cjs/views/ViewDashboard/index.js +1 -1
  80. package/dist/cjs/views/index.js +1 -1
  81. package/dist/components/AddGroupButton/AddGroupButton.d.ts +3 -0
  82. package/dist/components/AddGroupButton/AddGroupButton.d.ts.map +1 -0
  83. package/dist/components/AddGroupButton/AddGroupButton.js +32 -0
  84. package/dist/components/AddGroupButton/AddGroupButton.js.map +1 -0
  85. package/dist/components/AddGroupButton/index.d.ts +2 -0
  86. package/dist/components/AddGroupButton/index.d.ts.map +1 -0
  87. package/dist/{utils/functions.js → components/AddGroupButton/index.js} +3 -5
  88. package/dist/components/AddGroupButton/index.js.map +1 -0
  89. package/dist/components/AddPanelButton/AddPanelButton.d.ts +3 -0
  90. package/dist/components/AddPanelButton/AddPanelButton.d.ts.map +1 -0
  91. package/dist/components/AddPanelButton/AddPanelButton.js +32 -0
  92. package/dist/components/AddPanelButton/AddPanelButton.js.map +1 -0
  93. package/dist/components/AddPanelButton/index.d.ts +2 -0
  94. package/dist/components/AddPanelButton/index.d.ts.map +1 -0
  95. package/dist/components/AddPanelButton/index.js +15 -0
  96. package/dist/components/AddPanelButton/index.js.map +1 -0
  97. package/dist/components/Dashboard/Dashboard.js +1 -1
  98. package/dist/components/Dashboard/Dashboard.js.map +1 -1
  99. package/dist/components/Dashboard/index.js +1 -1
  100. package/dist/components/Dashboard/index.js.map +1 -1
  101. package/dist/components/DashboardToolbar/DashboardToolbar.d.ts.map +1 -1
  102. package/dist/components/DashboardToolbar/DashboardToolbar.js +50 -23
  103. package/dist/components/DashboardToolbar/DashboardToolbar.js.map +1 -1
  104. package/dist/components/DashboardToolbar/index.js +1 -1
  105. package/dist/components/DashboardToolbar/index.js.map +1 -1
  106. package/dist/components/DeletePanelDialog/DeletePanelDialog.d.ts.map +1 -1
  107. package/dist/components/DeletePanelDialog/DeletePanelDialog.js +8 -25
  108. package/dist/components/DeletePanelDialog/DeletePanelDialog.js.map +1 -1
  109. package/dist/components/DeletePanelDialog/index.js +1 -1
  110. package/dist/components/DeletePanelDialog/index.js.map +1 -1
  111. package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js +2 -1
  112. package/dist/components/DeletePanelGroupDialog/DeletePanelGroupDialog.js.map +1 -1
  113. package/dist/components/DeletePanelGroupDialog/index.js +1 -1
  114. package/dist/components/DeletePanelGroupDialog/index.js.map +1 -1
  115. package/dist/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.js +2 -1
  116. package/dist/components/DiscardChangesConfirmationDialog/DiscardChangesConfirmationDialog.js.map +1 -1
  117. package/dist/components/DiscardChangesConfirmationDialog/index.js +1 -1
  118. package/dist/components/DiscardChangesConfirmationDialog/index.js.map +1 -1
  119. package/dist/components/DownloadButton/DownloadButton.d.ts +5 -1
  120. package/dist/components/DownloadButton/DownloadButton.d.ts.map +1 -1
  121. package/dist/components/DownloadButton/DownloadButton.js +17 -8
  122. package/dist/components/DownloadButton/DownloadButton.js.map +1 -1
  123. package/dist/components/DownloadButton/index.js +1 -1
  124. package/dist/components/DownloadButton/index.js.map +1 -1
  125. package/dist/components/GridLayout/GridContainer.d.ts.map +1 -1
  126. package/dist/components/GridLayout/GridContainer.js +2 -1
  127. package/dist/components/GridLayout/GridContainer.js.map +1 -1
  128. package/dist/components/GridLayout/GridItemContent.d.ts.map +1 -1
  129. package/dist/components/GridLayout/GridItemContent.js +3 -2
  130. package/dist/components/GridLayout/GridItemContent.js.map +1 -1
  131. package/dist/components/GridLayout/GridLayout.d.ts.map +1 -1
  132. package/dist/components/GridLayout/GridLayout.js +6 -8
  133. package/dist/components/GridLayout/GridLayout.js.map +1 -1
  134. package/dist/components/GridLayout/GridTitle.d.ts.map +1 -1
  135. package/dist/components/GridLayout/GridTitle.js +14 -11
  136. package/dist/components/GridLayout/GridTitle.js.map +1 -1
  137. package/dist/components/GridLayout/index.js +1 -1
  138. package/dist/components/GridLayout/index.js.map +1 -1
  139. package/dist/components/Panel/Panel.js +7 -7
  140. package/dist/components/Panel/Panel.js.map +1 -1
  141. package/dist/components/Panel/PanelContent.d.ts.map +1 -1
  142. package/dist/components/Panel/PanelContent.js +3 -2
  143. package/dist/components/Panel/PanelContent.js.map +1 -1
  144. package/dist/components/Panel/PanelHeader.d.ts +1 -0
  145. package/dist/components/Panel/PanelHeader.d.ts.map +1 -1
  146. package/dist/components/Panel/PanelHeader.js +26 -8
  147. package/dist/components/Panel/PanelHeader.js.map +1 -1
  148. package/dist/components/Panel/index.js +1 -1
  149. package/dist/components/Panel/index.js.map +1 -1
  150. package/dist/components/PanelDrawer/PanelDrawer.js +2 -1
  151. package/dist/components/PanelDrawer/PanelDrawer.js.map +1 -1
  152. package/dist/components/PanelDrawer/PanelEditorForm.js +1 -1
  153. package/dist/components/PanelDrawer/PanelEditorForm.js.map +1 -1
  154. package/dist/components/PanelDrawer/PanelPreview.js +1 -1
  155. package/dist/components/PanelDrawer/PanelPreview.js.map +1 -1
  156. package/dist/components/PanelDrawer/index.js +1 -1
  157. package/dist/components/PanelDrawer/index.js.map +1 -1
  158. package/dist/components/PanelGroupDialog/PanelGroupDialog.d.ts.map +1 -1
  159. package/dist/components/PanelGroupDialog/PanelGroupDialog.js +4 -1
  160. package/dist/components/PanelGroupDialog/PanelGroupDialog.js.map +1 -1
  161. package/dist/components/PanelGroupDialog/PanelGroupEditorForm.js +1 -1
  162. package/dist/components/PanelGroupDialog/PanelGroupEditorForm.js.map +1 -1
  163. package/dist/components/PanelGroupDialog/index.js +1 -1
  164. package/dist/components/PanelGroupDialog/index.js.map +1 -1
  165. package/dist/components/TimeRangeControls/TimeRangeControls.d.ts +2 -1
  166. package/dist/components/TimeRangeControls/TimeRangeControls.d.ts.map +1 -1
  167. package/dist/components/TimeRangeControls/TimeRangeControls.js +21 -13
  168. package/dist/components/TimeRangeControls/TimeRangeControls.js.map +1 -1
  169. package/dist/components/TimeRangeControls/index.js +1 -1
  170. package/dist/components/TimeRangeControls/index.js.map +1 -1
  171. package/dist/components/ToolbarIconButton/ToolbarIconButton.js +1 -1
  172. package/dist/components/ToolbarIconButton/ToolbarIconButton.js.map +1 -1
  173. package/dist/components/ToolbarIconButton/index.js +1 -1
  174. package/dist/components/ToolbarIconButton/index.js.map +1 -1
  175. package/dist/components/Variables/EditVariablesButton.d.ts +3 -0
  176. package/dist/components/Variables/EditVariablesButton.d.ts.map +1 -0
  177. package/dist/components/Variables/EditVariablesButton.js +64 -0
  178. package/dist/components/Variables/EditVariablesButton.js.map +1 -0
  179. package/dist/components/Variables/Variable.js +1 -1
  180. package/dist/components/Variables/Variable.js.map +1 -1
  181. package/dist/components/Variables/VariableEditor.d.ts.map +1 -1
  182. package/dist/components/Variables/VariableEditor.js +10 -6
  183. package/dist/components/Variables/VariableEditor.js.map +1 -1
  184. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts.map +1 -1
  185. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js +8 -9
  186. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js.map +1 -1
  187. package/dist/components/Variables/VariableEditorForm/index.js +1 -1
  188. package/dist/components/Variables/VariableEditorForm/index.js.map +1 -1
  189. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js +1 -1
  190. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js.map +1 -1
  191. package/dist/components/Variables/VariableList.d.ts.map +1 -1
  192. package/dist/components/Variables/VariableList.js +47 -74
  193. package/dist/components/Variables/VariableList.js.map +1 -1
  194. package/dist/components/Variables/index.d.ts +3 -1
  195. package/dist/components/Variables/index.d.ts.map +1 -1
  196. package/dist/components/Variables/index.js +4 -2
  197. package/dist/components/Variables/index.js.map +1 -1
  198. package/dist/components/Variables/variable-model.js +1 -1
  199. package/dist/components/Variables/variable-model.js.map +1 -1
  200. package/dist/components/index.d.ts +2 -0
  201. package/dist/components/index.d.ts.map +1 -1
  202. package/dist/components/index.js +3 -1
  203. package/dist/components/index.js.map +1 -1
  204. package/dist/constants/grid-layout-config.d.ts +6 -0
  205. package/dist/constants/grid-layout-config.d.ts.map +1 -0
  206. package/dist/constants/grid-layout-config.js +19 -0
  207. package/dist/constants/grid-layout-config.js.map +1 -0
  208. package/dist/constants/index.d.ts +3 -0
  209. package/dist/constants/index.d.ts.map +1 -0
  210. package/dist/constants/index.js +16 -0
  211. package/dist/constants/index.js.map +1 -0
  212. package/dist/constants/user-interface-text.d.ts +30 -0
  213. package/dist/constants/user-interface-text.d.ts.map +1 -0
  214. package/dist/constants/user-interface-text.js +49 -0
  215. package/dist/constants/user-interface-text.js.map +1 -0
  216. package/dist/context/DashboardProvider/DashboardProvider.d.ts +6 -4
  217. package/dist/context/DashboardProvider/DashboardProvider.d.ts.map +1 -1
  218. package/dist/context/DashboardProvider/DashboardProvider.js +38 -9
  219. package/dist/context/DashboardProvider/DashboardProvider.js.map +1 -1
  220. package/dist/context/DashboardProvider/common.js +1 -1
  221. package/dist/context/DashboardProvider/common.js.map +1 -1
  222. package/dist/context/DashboardProvider/dashboard-provider-api.d.ts +1 -0
  223. package/dist/context/DashboardProvider/dashboard-provider-api.d.ts.map +1 -1
  224. package/dist/context/DashboardProvider/dashboard-provider-api.js +7 -5
  225. package/dist/context/DashboardProvider/dashboard-provider-api.js.map +1 -1
  226. package/dist/context/DashboardProvider/delete-panel-group-slice.js +1 -1
  227. package/dist/context/DashboardProvider/delete-panel-group-slice.js.map +1 -1
  228. package/dist/context/DashboardProvider/delete-panel-slice.js +1 -1
  229. package/dist/context/DashboardProvider/delete-panel-slice.js.map +1 -1
  230. package/dist/context/DashboardProvider/discard-changes-dialog-slice.js +1 -1
  231. package/dist/context/DashboardProvider/discard-changes-dialog-slice.js.map +1 -1
  232. package/dist/context/DashboardProvider/duplicate-panel-slice.d.ts +19 -0
  233. package/dist/context/DashboardProvider/duplicate-panel-slice.d.ts.map +1 -0
  234. package/dist/context/DashboardProvider/duplicate-panel-slice.js +58 -0
  235. package/dist/context/DashboardProvider/duplicate-panel-slice.js.map +1 -0
  236. package/dist/context/DashboardProvider/index.d.ts +1 -1
  237. package/dist/context/DashboardProvider/index.d.ts.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.d.ts +4 -0
  241. package/dist/context/DashboardProvider/panel-editor-slice.d.ts.map +1 -1
  242. package/dist/context/DashboardProvider/panel-editor-slice.js +7 -36
  243. package/dist/context/DashboardProvider/panel-editor-slice.js.map +1 -1
  244. package/dist/context/DashboardProvider/panel-group-editor-slice.js +1 -1
  245. package/dist/context/DashboardProvider/panel-group-editor-slice.js.map +1 -1
  246. package/dist/context/DashboardProvider/panel-group-slice.js +1 -1
  247. package/dist/context/DashboardProvider/panel-group-slice.js.map +1 -1
  248. package/dist/context/DashboardProvider/panel-slice.js +1 -1
  249. package/dist/context/DashboardProvider/panel-slice.js.map +1 -1
  250. package/dist/context/DatasourceStoreProvider.js +1 -1
  251. package/dist/context/DatasourceStoreProvider.js.map +1 -1
  252. package/dist/context/TemplateVariableProvider/TemplateVariableProvider.js +1 -1
  253. package/dist/context/TemplateVariableProvider/TemplateVariableProvider.js.map +1 -1
  254. package/dist/context/TemplateVariableProvider/index.js +1 -1
  255. package/dist/context/TemplateVariableProvider/index.js.map +1 -1
  256. package/dist/context/TemplateVariableProvider/query-params.js +1 -1
  257. package/dist/context/TemplateVariableProvider/query-params.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.d.ts.map +1 -1
  261. package/dist/context/useDashboard.js +5 -3
  262. package/dist/context/useDashboard.js.map +1 -1
  263. package/dist/index.js +1 -1
  264. package/dist/index.js.map +1 -1
  265. package/dist/test/dashboard-provider.js +1 -1
  266. package/dist/test/dashboard-provider.js.map +1 -1
  267. package/dist/test/index.js +1 -1
  268. package/dist/test/index.js.map +1 -1
  269. package/dist/test/plugin-registry.js +1 -1
  270. package/dist/test/plugin-registry.js.map +1 -1
  271. package/dist/test/render.js +1 -1
  272. package/dist/test/render.js.map +1 -1
  273. package/dist/test/setup-tests.js +1 -1
  274. package/dist/test/setup-tests.js.map +1 -1
  275. package/dist/test/testDashboard.js +1 -1
  276. package/dist/test/testDashboard.js.map +1 -1
  277. package/dist/utils/index.d.ts +2 -0
  278. package/dist/utils/index.d.ts.map +1 -0
  279. package/dist/utils/index.js +15 -0
  280. package/dist/utils/index.js.map +1 -0
  281. package/dist/utils/panelUtils.d.ts +27 -0
  282. package/dist/utils/panelUtils.d.ts.map +1 -0
  283. package/dist/utils/panelUtils.js +174 -0
  284. package/dist/utils/panelUtils.js.map +1 -0
  285. package/dist/views/ViewDashboard/DashboardApp.d.ts +1 -0
  286. package/dist/views/ViewDashboard/DashboardApp.d.ts.map +1 -1
  287. package/dist/views/ViewDashboard/DashboardApp.js +5 -2
  288. package/dist/views/ViewDashboard/DashboardApp.js.map +1 -1
  289. package/dist/views/ViewDashboard/ViewDashboard.d.ts +2 -0
  290. package/dist/views/ViewDashboard/ViewDashboard.d.ts.map +1 -1
  291. package/dist/views/ViewDashboard/ViewDashboard.js +5 -3
  292. package/dist/views/ViewDashboard/ViewDashboard.js.map +1 -1
  293. package/dist/views/ViewDashboard/index.js +1 -1
  294. package/dist/views/ViewDashboard/index.js.map +1 -1
  295. package/dist/views/index.js +1 -1
  296. package/dist/views/index.js.map +1 -1
  297. package/package.json +7 -6
  298. package/dist/cjs/components/Panel/Panel.test.js +0 -129
  299. package/dist/cjs/components/PanelDrawer/PanelDrawer.test.js +0 -131
  300. package/dist/cjs/components/PanelGroupDialog/PanelGroupDialog.test.js +0 -87
  301. package/dist/cjs/components/TimeRangeControls/TimeRangeControls.test.js +0 -95
  302. package/dist/cjs/components/Variables/variable-model.test.js +0 -106
  303. package/dist/cjs/context/TemplateVariableProvider/query-params.test.js +0 -82
  304. package/dist/cjs/views/ViewDashboard/tests/panelGroups.test.js +0 -110
  305. package/dist/components/Panel/Panel.test.d.ts +0 -2
  306. package/dist/components/Panel/Panel.test.d.ts.map +0 -1
  307. package/dist/components/Panel/Panel.test.js +0 -122
  308. package/dist/components/Panel/Panel.test.js.map +0 -1
  309. package/dist/components/PanelDrawer/PanelDrawer.test.d.ts +0 -2
  310. package/dist/components/PanelDrawer/PanelDrawer.test.d.ts.map +0 -1
  311. package/dist/components/PanelDrawer/PanelDrawer.test.js +0 -124
  312. package/dist/components/PanelDrawer/PanelDrawer.test.js.map +0 -1
  313. package/dist/components/PanelGroupDialog/PanelGroupDialog.test.d.ts +0 -2
  314. package/dist/components/PanelGroupDialog/PanelGroupDialog.test.d.ts.map +0 -1
  315. package/dist/components/PanelGroupDialog/PanelGroupDialog.test.js +0 -80
  316. package/dist/components/PanelGroupDialog/PanelGroupDialog.test.js.map +0 -1
  317. package/dist/components/TimeRangeControls/TimeRangeControls.test.d.ts +0 -2
  318. package/dist/components/TimeRangeControls/TimeRangeControls.test.d.ts.map +0 -1
  319. package/dist/components/TimeRangeControls/TimeRangeControls.test.js +0 -88
  320. package/dist/components/TimeRangeControls/TimeRangeControls.test.js.map +0 -1
  321. package/dist/components/Variables/variable-model.test.d.ts +0 -2
  322. package/dist/components/Variables/variable-model.test.d.ts.map +0 -1
  323. package/dist/components/Variables/variable-model.test.js +0 -104
  324. package/dist/components/Variables/variable-model.test.js.map +0 -1
  325. package/dist/context/TemplateVariableProvider/query-params.test.d.ts +0 -2
  326. package/dist/context/TemplateVariableProvider/query-params.test.d.ts.map +0 -1
  327. package/dist/context/TemplateVariableProvider/query-params.test.js +0 -80
  328. package/dist/context/TemplateVariableProvider/query-params.test.js.map +0 -1
  329. package/dist/utils/functions.d.ts +0 -2
  330. package/dist/utils/functions.d.ts.map +0 -1
  331. package/dist/utils/functions.js.map +0 -1
  332. package/dist/views/ViewDashboard/tests/panelGroups.test.d.ts +0 -2
  333. package/dist/views/ViewDashboard/tests/panelGroups.test.d.ts.map +0 -1
  334. package/dist/views/ViewDashboard/tests/panelGroups.test.js +0 -103
  335. package/dist/views/ViewDashboard/tests/panelGroups.test.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ViewDashboard.d.ts","sourceRoot":"","sources":["../../../src/views/ViewDashboard/ViewDashboard.tsx"],"names":[],"mappings":";AAaA,OAAO,EAAO,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAGrD,OAAO,EAGL,4BAA4B,EAE7B,MAAM,eAAe,CAAC;AAGvB,MAAM,WAAW,kBAAmB,SAAQ,IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC;IACpE,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,aAAa,EAAE,4BAA4B,CAAC,eAAe,CAAC,CAAC;IAC7D,uBAAuB,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IACtC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,OAAO,CAAC,iBAAiB,CAAC,CAAC;IACnE,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,UAAU,EAAE,OAAO,CAAC;CACrB;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,eAgDtD"}
1
+ {"version":3,"file":"ViewDashboard.d.ts","sourceRoot":"","sources":["../../../src/views/ViewDashboard/ViewDashboard.tsx"],"names":[],"mappings":";AAaA,OAAO,EAAO,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAGrD,OAAO,EAGL,4BAA4B,EAE7B,MAAM,eAAe,CAAC;AAGvB,MAAM,WAAW,kBAAmB,SAAQ,IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC;IACpE,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,aAAa,EAAE,4BAA4B,CAAC,eAAe,CAAC,CAAC;IAC7D,uBAAuB,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IACtC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,OAAO,CAAC,iBAAiB,CAAC,CAAC;IACnE,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAChD,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,eAmDtD"}
@@ -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
@@ -19,7 +19,7 @@ import { DashboardApp } from './DashboardApp';
19
19
  /**
20
20
  * The View for displaying a Dashboard, along with the UI for selecting variable values.
21
21
  */ export function ViewDashboard(props) {
22
- const { dashboardResource , datasourceApi , dashboardTitleComponent , onSave , initialVariableIsSticky , isReadonly , sx , ...others } = props;
22
+ const { dashboardResource , datasourceApi , dashboardTitleComponent , onSave , onDiscard , initialVariableIsSticky , isReadonly , isEditing , sx , ...others } = props;
23
23
  const { spec } = dashboardResource;
24
24
  var _duration;
25
25
  const dashboardDuration = (_duration = spec.duration) !== null && _duration !== void 0 ? _duration : '1h';
@@ -29,7 +29,8 @@ import { DashboardApp } from './DashboardApp';
29
29
  datasourceApi: datasourceApi,
30
30
  children: /*#__PURE__*/ _jsx(DashboardProvider, {
31
31
  initialState: {
32
- dashboardResource
32
+ dashboardResource,
33
+ isEditMode: !!isEditing
33
34
  },
34
35
  children: /*#__PURE__*/ _jsx(TimeRangeProvider, {
35
36
  initialTimeRange: initialTimeRange,
@@ -51,6 +52,7 @@ import { DashboardApp } from './DashboardApp';
51
52
  dashboardResource: dashboardResource,
52
53
  dashboardTitleComponent: dashboardTitleComponent,
53
54
  onSave: onSave,
55
+ onDiscard: onDiscard,
54
56
  initialVariableIsSticky: initialVariableIsSticky,
55
57
  isReadonly: isReadonly
56
58
  })
@@ -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","width","height","position","overflow","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,GAAG,QAAkB,eAAe,CAAC;AAE9C,SAASC,aAAa,EAAEC,UAAU,EAAEC,SAAS,QAAQ,wBAAwB,CAAC;AAC9E,SAASC,iBAAiB,EAAEC,mBAAmB,QAAQ,2BAA2B,CAAC;AACnF,SACEC,wBAAwB,EACxBC,iBAAiB,EAEjBC,uBAAuB,QAClB,eAAe,CAAC;AACvB,SAASC,YAAY,QAAQ,gBAAgB,CAAC;AAW9C;;CAEC,GACD,OAAO,SAASC,aAAa,CAACC,KAAyB,EAAE;IACvD,MAAM,EACJC,iBAAiB,CAAA,EACjBC,aAAa,CAAA,EACbC,uBAAuB,CAAA,EACvBC,MAAM,CAAA,EACNC,uBAAuB,CAAA,EACvBC,UAAU,CAAA,EACVC,EAAE,CAAA,EACF,GAAGC,MAAM,EACV,GAAGR,KAAK,AAAC;IACV,MAAM,EAAES,IAAI,CAAA,EAAE,GAAGR,iBAAiB,AAAC;QACTQ,SAAa;IAAvC,MAAMC,iBAAiB,GAAGD,CAAAA,SAAa,GAAbA,IAAI,CAACE,QAAQ,cAAbF,SAAa,cAAbA,SAAa,GAAI,IAAI,AAAC;IAChD,MAAMG,gBAAgB,GAAGlB,mBAAmB,CAACgB,iBAAiB,CAAC,AAAC;IAEhE,qBACE,KAACb,uBAAuB;QAACI,iBAAiB,EAAEA,iBAAiB;QAAEC,aAAa,EAAEA,aAAa;kBACzF,cAAA,KAACN,iBAAiB;YAACiB,YAAY,EAAE;gBAAEZ,iBAAiB;aAAE;sBACpD,cAAA,KAACR,iBAAiB;gBAACmB,gBAAgB,EAAEA,gBAAgB;gBAAEE,gBAAgB,EAAE,IAAI;0BAC3E,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 onDiscard?: (entity: DashboardResource) => void;\n initialVariableIsSticky?: boolean;\n isReadonly: boolean;\n isEditing?: 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 onDiscard,\n initialVariableIsSticky,\n isReadonly,\n isEditing,\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, isEditMode: !!isEditing }}>\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 onDiscard={onDiscard}\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","onDiscard","initialVariableIsSticky","isReadonly","isEditing","sx","others","spec","dashboardDuration","duration","initialTimeRange","initialState","isEditMode","enabledURLParams","initialVariableDefinitions","variables","display","width","height","position","overflow","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,GAAG,QAAkB,eAAe,CAAC;AAE9C,SAASC,aAAa,EAAEC,UAAU,EAAEC,SAAS,QAAQ,wBAAwB,CAAC;AAC9E,SAASC,iBAAiB,EAAEC,mBAAmB,QAAQ,2BAA2B,CAAC;AACnF,SACEC,wBAAwB,EACxBC,iBAAiB,EAEjBC,uBAAuB,QAClB,eAAe,CAAC;AACvB,SAASC,YAAY,QAAQ,gBAAgB,CAAC;AAa9C;;CAEC,GACD,OAAO,SAASC,aAAa,CAACC,KAAyB,EAAE;IACvD,MAAM,EACJC,iBAAiB,CAAA,EACjBC,aAAa,CAAA,EACbC,uBAAuB,CAAA,EACvBC,MAAM,CAAA,EACNC,SAAS,CAAA,EACTC,uBAAuB,CAAA,EACvBC,UAAU,CAAA,EACVC,SAAS,CAAA,EACTC,EAAE,CAAA,EACF,GAAGC,MAAM,EACV,GAAGV,KAAK,AAAC;IACV,MAAM,EAAEW,IAAI,CAAA,EAAE,GAAGV,iBAAiB,AAAC;QACTU,SAAa;IAAvC,MAAMC,iBAAiB,GAAGD,CAAAA,SAAa,GAAbA,IAAI,CAACE,QAAQ,cAAbF,SAAa,cAAbA,SAAa,GAAI,IAAI,AAAC;IAChD,MAAMG,gBAAgB,GAAGpB,mBAAmB,CAACkB,iBAAiB,CAAC,AAAC;IAEhE,qBACE,KAACf,uBAAuB;QAACI,iBAAiB,EAAEA,iBAAiB;QAAEC,aAAa,EAAEA,aAAa;kBACzF,cAAA,KAACN,iBAAiB;YAACmB,YAAY,EAAE;gBAAEd,iBAAiB;gBAAEe,UAAU,EAAE,CAAC,CAACR,SAAS;aAAE;sBAC7E,cAAA,KAACf,iBAAiB;gBAACqB,gBAAgB,EAAEA,gBAAgB;gBAAEG,gBAAgB,EAAE,IAAI;0BAC3E,cAAA,KAACtB,wBAAwB;oBAACuB,0BAA0B,EAAEP,IAAI,CAACQ,SAAS;8BAClE,cAAA,KAAC9B,GAAG;wBACFoB,EAAE,EAAEjB,SAAS,CACX;4BACE4B,OAAO,EAAE,MAAM;4BACfC,KAAK,EAAE,MAAM;4BACbC,MAAM,EAAE,MAAM;4BACdC,QAAQ,EAAE,UAAU;4BACpBC,QAAQ,EAAE,QAAQ;yBACnB,EACDf,EAAE,CACH;wBACA,GAAGC,MAAM;kCAEV,cAAA,KAACpB,aAAa;4BAACmC,iBAAiB,EAAElC,UAAU;sCAC1C,cAAA,KAACO,YAAY;gCACXG,iBAAiB,EAAEA,iBAAiB;gCACpCE,uBAAuB,EAAEA,uBAAuB;gCAChDC,MAAM,EAAEA,MAAM;gCACdC,SAAS,EAAEA,SAAS;gCACpBC,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/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.0.0-snapshot-embed-import-errors-8906900",
3
+ "version": "0.0.0-snapshot-test-internal-dep-dd238ac",
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",
@@ -20,7 +20,8 @@
20
20
  "build": "concurrently \"npm:build:*\"",
21
21
  "build:cjs": "swc ./src -d dist/cjs --config-file ../.cjs.swcrc",
22
22
  "build:esm": "swc ./src -d dist --config-file ../.swcrc",
23
- "build:types": "tsc --emitDeclarationOnly --declaration --preserveWatchOutput",
23
+ "build:types": "tsc --project tsconfig.build.json",
24
+ "type-check": "tsc --noEmit",
24
25
  "start": "concurrently -P \"npm:build:* -- {*}\" -- --watch",
25
26
  "test": "TZ=UTC jest",
26
27
  "test:watch": "npm run test -- --watch",
@@ -28,9 +29,9 @@
28
29
  "lint:fix": "eslint --fix src --ext .ts,.tsx"
29
30
  },
30
31
  "dependencies": {
31
- "@perses-dev/components": "0.0.0-snapshot-embed-import-errors-8906900",
32
- "@perses-dev/core": "0.0.0-snapshot-embed-import-errors-8906900",
33
- "@perses-dev/plugin-system": "0.0.0-snapshot-embed-import-errors-8906900",
32
+ "@perses-dev/components": "0.0.0-snapshot-test-internal-dep-dd238ac",
33
+ "@perses-dev/core": "0.0.0-snapshot-test-internal-dep-dd238ac",
34
+ "@perses-dev/plugin-system": "0.0.0-snapshot-test-internal-dep-dd238ac",
34
35
  "@types/react-grid-layout": "^1.3.2",
35
36
  "date-fns": "^2.28.0",
36
37
  "immer": "^9.0.15",
@@ -40,7 +41,7 @@
40
41
  "use-immer": "^0.7.0",
41
42
  "use-query-params": "^2.1.1",
42
43
  "use-resize-observer": "^9.0.0",
43
- "zustand": "^4.1.1"
44
+ "zustand": "^4.3.3"
44
45
  },
45
46
  "devDependencies": {
46
47
  "intersection-observer": "^0.12.2"
@@ -1,129 +0,0 @@
1
- // Copyright 2022 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
- const _jsxRuntime = require("react/jsx-runtime");
18
- const _react = require("@testing-library/react");
19
- const _userEvent = /*#__PURE__*/ _interopRequireDefault(require("@testing-library/user-event"));
20
- const _test = require("../../test");
21
- const _panel = require("./Panel");
22
- function _interopRequireDefault(obj) {
23
- return obj && obj.__esModule ? obj : {
24
- default: obj
25
- };
26
- }
27
- describe('Panel', ()=>{
28
- const createTestPanel = ()=>({
29
- kind: 'Panel',
30
- spec: {
31
- display: {
32
- name: 'Fake Panel Title',
33
- description: 'This is a fake panel'
34
- },
35
- plugin: {
36
- kind: 'TimeSeriesChart',
37
- spec: {}
38
- }
39
- }
40
- });
41
- // Helper to render the panel with some context set
42
- const renderPanel = (definition, editHandlers)=>{
43
- definition !== null && definition !== void 0 ? definition : definition = createTestPanel();
44
- (0, _test.renderWithContext)(/*#__PURE__*/ (0, _jsxRuntime.jsx)(_panel.Panel, {
45
- definition: definition,
46
- editHandlers: editHandlers
47
- }));
48
- };
49
- // Helper to get the panel once rendered
50
- const getPanel = ()=>_react.screen.getByRole('region', {
51
- name: 'Fake Panel Title'
52
- });
53
- it('should render panel', async ()=>{
54
- renderPanel();
55
- const panel = getPanel();
56
- expect(panel).toBeInTheDocument();
57
- // Should diplay header with panel's title
58
- const header = _react.screen.getByRole('banner');
59
- expect(header).toHaveTextContent('Fake Panel Title');
60
- // Should display chart's content from the fake panel plugin
61
- const content = _react.screen.getByRole('figure');
62
- await (0, _react.waitFor)(()=>{
63
- expect(content).toHaveTextContent('TimeSeriesChart panel');
64
- });
65
- expect(content);
66
- });
67
- it('shows panel description', async ()=>{
68
- renderPanel();
69
- const panel = getPanel();
70
- // Description button should not be visible until hover on panel
71
- const missingButton = _react.screen.queryByRole('button', {
72
- name: /description/i
73
- });
74
- expect(missingButton).not.toBeInTheDocument();
75
- _userEvent.default.hover(panel);
76
- const descriptionButton = _react.screen.getByRole('button', {
77
- name: /description/i
78
- });
79
- expect(descriptionButton).toBeInTheDocument();
80
- // Can hover to see panel description in tooltip
81
- _userEvent.default.hover(descriptionButton);
82
- const tooltip = await _react.screen.findByRole('tooltip');
83
- expect(tooltip).toHaveTextContent('This is a fake panel');
84
- });
85
- it('does not show description when panel does not have one', ()=>{
86
- // Render a panel without a description set
87
- const withoutDescription = createTestPanel();
88
- withoutDescription.spec.display.description = undefined;
89
- renderPanel(withoutDescription);
90
- const panel = getPanel();
91
- _userEvent.default.hover(panel);
92
- const descriptionButton = _react.screen.queryByRole('button', {
93
- name: /description/i
94
- });
95
- expect(descriptionButton).not.toBeInTheDocument();
96
- });
97
- it('does not show description in edit mode', ()=>{
98
- renderPanel(undefined, {
99
- onEditPanelClick: jest.fn(),
100
- onDeletePanelClick: jest.fn()
101
- });
102
- const panel = getPanel();
103
- _userEvent.default.hover(panel);
104
- const descriptionButton = _react.screen.queryByRole('button', {
105
- name: /description/i
106
- });
107
- expect(descriptionButton).not.toBeInTheDocument();
108
- });
109
- it('can trigger panel actions in edit mode', ()=>{
110
- const onEditPanelClick = jest.fn();
111
- const onDeletePanelClick = jest.fn();
112
- renderPanel(undefined, {
113
- onEditPanelClick,
114
- onDeletePanelClick
115
- });
116
- const panel = getPanel();
117
- _userEvent.default.hover(panel);
118
- const editButton = _react.screen.getByRole('button', {
119
- name: /edit/i
120
- });
121
- _userEvent.default.click(editButton);
122
- const deleteButton = _react.screen.getByRole('button', {
123
- name: /delete/i
124
- });
125
- _userEvent.default.click(deleteButton);
126
- expect(onEditPanelClick).toHaveBeenCalledTimes(1);
127
- expect(onDeletePanelClick).toHaveBeenCalledTimes(1);
128
- });
129
- });
@@ -1,131 +0,0 @@
1
- // Copyright 2022 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
- const _jsxRuntime = require("react/jsx-runtime");
18
- const _react = require("@testing-library/react");
19
- const _userEvent = /*#__PURE__*/ _interopRequireDefault(require("@testing-library/user-event"));
20
- const _testUtils = require("react-dom/test-utils");
21
- const _test = require("../../test");
22
- const _dashboardProvider = require("../../context/DashboardProvider");
23
- const _panelDrawer = require("./PanelDrawer");
24
- function _interopRequireDefault(obj) {
25
- return obj && obj.__esModule ? obj : {
26
- default: obj
27
- };
28
- }
29
- describe('Panel Drawer', ()=>{
30
- const renderPanelDrawer = ()=>{
31
- const { store , DashboardProviderSpy } = (0, _test.createDashboardProviderSpy)();
32
- (0, _test.renderWithContext)(/*#__PURE__*/ (0, _jsxRuntime.jsxs)(_dashboardProvider.DashboardProvider, {
33
- initialState: {
34
- dashboardResource: (0, _test.getTestDashboard)(),
35
- isEditMode: true
36
- },
37
- children: [
38
- /*#__PURE__*/ (0, _jsxRuntime.jsx)(DashboardProviderSpy, {}),
39
- /*#__PURE__*/ (0, _jsxRuntime.jsx)(_panelDrawer.PanelDrawer, {})
40
- ]
41
- }));
42
- const { value: storeApi } = store;
43
- if (storeApi === undefined) {
44
- throw new Error('Expected dashboard store to be set after initial render');
45
- }
46
- return storeApi;
47
- };
48
- it('should add new panel', async ()=>{
49
- const storeApi = renderPanelDrawer();
50
- // Open the drawer for a new panel
51
- (0, _testUtils.act)(()=>storeApi.getState().openAddPanel());
52
- const nameInput = await _react.screen.findByLabelText(/Name/);
53
- _userEvent.default.type(nameInput, 'New Panel');
54
- _userEvent.default.click(_react.screen.getByText('Add'));
55
- // TODO: Assert drawer is closed?
56
- const panels = storeApi.getState().panels;
57
- expect(panels).toMatchObject({
58
- // Should have the new panel in the store
59
- NewPanel: {
60
- kind: 'Panel',
61
- spec: {
62
- display: {
63
- name: 'New Panel'
64
- },
65
- plugin: {
66
- kind: '',
67
- spec: {}
68
- }
69
- }
70
- }
71
- });
72
- });
73
- it('should add panel with duplicate panel name', async ()=>{
74
- const storeApi = renderPanelDrawer();
75
- (0, _testUtils.act)(()=>storeApi.getState().openAddPanel());
76
- const nameInput = await _react.screen.findByLabelText(/Name/);
77
- _userEvent.default.type(nameInput, 'cpu');
78
- _userEvent.default.click(_react.screen.getByText('Add'));
79
- const panels = storeApi.getState().panels;
80
- expect(panels).toMatchObject({
81
- // make sure we don't have duplicate panel key by appending "-1"
82
- 'cpu-1': {
83
- kind: 'Panel',
84
- spec: {
85
- display: {
86
- name: 'cpu'
87
- },
88
- plugin: {
89
- kind: '',
90
- spec: {}
91
- }
92
- }
93
- }
94
- });
95
- });
96
- it('should edit an existing panel', async ()=>{
97
- const storeApi = renderPanelDrawer();
98
- // Open the drawer for an existing panel
99
- const group = Object.values(storeApi.getState().panelGroups).find((group)=>group.title === 'CPU Stats');
100
- if (group === undefined) {
101
- throw new Error('Test group not found');
102
- }
103
- const layout = Object.entries(group.itemPanelKeys).find(([, panelKey])=>panelKey === 'cpu');
104
- if (layout === undefined) {
105
- throw new Error('Test panel not found');
106
- }
107
- (0, _testUtils.act)(()=>storeApi.getState().openEditPanel({
108
- panelGroupId: group.id,
109
- panelGroupItemLayoutId: layout[0]
110
- }));
111
- const nameInput = await _react.screen.findByLabelText(/Name/);
112
- _userEvent.default.clear(nameInput);
113
- _userEvent.default.type(nameInput, 'cpu usage');
114
- _userEvent.default.click(_react.screen.getByText('Apply'));
115
- const panels = storeApi.getState().panels;
116
- expect(panels).toMatchObject({
117
- cpu: {
118
- kind: 'Panel',
119
- spec: {
120
- display: {
121
- name: 'cpu usage'
122
- },
123
- plugin: {
124
- kind: 'TimeSeriesChart',
125
- spec: {}
126
- }
127
- }
128
- }
129
- });
130
- });
131
- });
@@ -1,87 +0,0 @@
1
- // Copyright 2022 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
- const _jsxRuntime = require("react/jsx-runtime");
18
- const _react = require("@testing-library/react");
19
- const _userEvent = /*#__PURE__*/ _interopRequireDefault(require("@testing-library/user-event"));
20
- const _testUtils = require("react-dom/test-utils");
21
- const _context = require("../../context");
22
- const _test = require("../../test");
23
- const _panelGroupDialog = require("./PanelGroupDialog");
24
- function _interopRequireDefault(obj) {
25
- return obj && obj.__esModule ? obj : {
26
- default: obj
27
- };
28
- }
29
- describe('Add Panel Group', ()=>{
30
- const renderDialog = ()=>{
31
- const { store , DashboardProviderSpy } = (0, _test.createDashboardProviderSpy)();
32
- (0, _test.renderWithContext)(/*#__PURE__*/ (0, _jsxRuntime.jsxs)(_context.DashboardProvider, {
33
- initialState: {
34
- dashboardResource: (0, _test.getTestDashboard)(),
35
- isEditMode: true
36
- },
37
- children: [
38
- /*#__PURE__*/ (0, _jsxRuntime.jsx)(DashboardProviderSpy, {}),
39
- /*#__PURE__*/ (0, _jsxRuntime.jsx)(_panelGroupDialog.PanelGroupDialog, {})
40
- ]
41
- }));
42
- const { value: storeApi } = store;
43
- if (storeApi === undefined) {
44
- throw new Error('Expected dashboard store to be set after initial render');
45
- }
46
- return storeApi;
47
- };
48
- it('should add new panel group', async ()=>{
49
- const storeApi = renderDialog();
50
- // Open the dialog for a new panel group
51
- (0, _testUtils.act)(()=>storeApi.getState().openAddPanelGroup());
52
- const nameInput = await _react.screen.findByLabelText(/Name/);
53
- _userEvent.default.type(nameInput, 'New Panel Group');
54
- _userEvent.default.click(_react.screen.getByText('Add'));
55
- // TODO: Figure out how to test this without coupling to the store state
56
- const panelGroups = Object.values(storeApi.getState().panelGroups);
57
- expect(panelGroups).toContainEqual({
58
- id: expect.any(Number),
59
- title: 'New Panel Group',
60
- isCollapsed: false,
61
- itemLayouts: expect.any(Array),
62
- itemPanelKeys: expect.any(Object)
63
- });
64
- });
65
- it('should edit existing panel group', async ()=>{
66
- const storeApi = renderDialog();
67
- // Open the dialog for an existing panel group
68
- const group = Object.values(storeApi.getState().panelGroups).find((group)=>group.title === 'CPU Stats');
69
- if (group === undefined) {
70
- throw new Error('Missing test group');
71
- }
72
- (0, _testUtils.act)(()=>storeApi.getState().openEditPanelGroup(group.id));
73
- const nameInput = await _react.screen.findByLabelText(/Name/);
74
- _userEvent.default.clear(nameInput);
75
- _userEvent.default.type(nameInput, 'New Name');
76
- _userEvent.default.click(_react.screen.getByText('Apply'));
77
- // TODO: Figure out how to test this without coupling to the store state
78
- const panelGroups = storeApi.getState().panelGroups;
79
- expect(panelGroups).toMatchObject({
80
- [group.id]: {
81
- id: group.id,
82
- title: 'New Name',
83
- isCollapsed: false
84
- }
85
- });
86
- });
87
- });
@@ -1,95 +0,0 @@
1
- // Copyright 2022 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
- const _jsxRuntime = require("react/jsx-runtime");
18
- const _reactRouter = require("react-router");
19
- const _history = require("history");
20
- const _userEvent = /*#__PURE__*/ _interopRequireDefault(require("@testing-library/user-event"));
21
- const _react = require("@testing-library/react");
22
- const _pluginSystem = require("@perses-dev/plugin-system");
23
- const _test = require("../../test");
24
- const _testDashboard = /*#__PURE__*/ _interopRequireDefault(require("../../test/testDashboard"));
25
- const _context = require("../../context");
26
- const _timeRangeControls = require("./TimeRangeControls");
27
- function _interopRequireDefault(obj) {
28
- return obj && obj.__esModule ? obj : {
29
- default: obj
30
- };
31
- }
32
- const history = (0, _history.createMemoryHistory)({
33
- initialEntries: [
34
- (0, _reactRouter.generatePath)('/home'),
35
- (0, _reactRouter.generatePath)('/dashboards/:id', {
36
- id: 'test'
37
- })
38
- ]
39
- });
40
- describe('TimeRangeControls', ()=>{
41
- let initialState;
42
- const testDefaultTimeRange = {
43
- pastDuration: _testDashboard.default.spec.duration
44
- };
45
- beforeEach(()=>{
46
- initialState = {
47
- dashboardResource: _testDashboard.default
48
- };
49
- });
50
- const renderTimeRangeControls = (testURLParams)=>{
51
- (0, _test.renderWithContext)(/*#__PURE__*/ (0, _jsxRuntime.jsx)(_context.DashboardProvider, {
52
- initialState: initialState,
53
- children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_pluginSystem.TimeRangeProvider, {
54
- initialTimeRange: testDefaultTimeRange,
55
- enabledURLParams: testURLParams,
56
- children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_timeRangeControls.TimeRangeControls, {})
57
- })
58
- }), undefined, history);
59
- };
60
- it('should default to dashboard duration and update selected time option when clicked', async ()=>{
61
- renderTimeRangeControls(false);
62
- expect(_react.screen.getByText('Last 30 minutes')).toBeInTheDocument();
63
- const dateButton = _react.screen.getByRole('button', {
64
- name: /last/i
65
- });
66
- _userEvent.default.click(dateButton);
67
- const firstSelected = _react.screen.getByRole('option', {
68
- name: 'Last 5 minutes'
69
- });
70
- _userEvent.default.click(firstSelected);
71
- expect(dateButton).toHaveTextContent(/5 minutes/i);
72
- });
73
- it('should update URL params with correct time range values', ()=>{
74
- renderTimeRangeControls(true);
75
- const dateButton = _react.screen.getByRole('button', {
76
- name: /last/i
77
- });
78
- _userEvent.default.click(dateButton);
79
- const firstSelected = _react.screen.getByRole('option', {
80
- name: 'Last 5 minutes'
81
- });
82
- _userEvent.default.click(firstSelected);
83
- expect(history.location.search).toEqual('?start=5m');
84
- // pick another option from TimeRangeSelector dropdown
85
- const secondSelected = _react.screen.getByText('Last 12 hours');
86
- _userEvent.default.click(secondSelected);
87
- expect(history.location.search).toEqual('?start=12h');
88
- // back button should return to previous page selected
89
- (0, _react.act)(()=>{
90
- history.back();
91
- });
92
- expect(history.location.pathname).toEqual('/home');
93
- });
94
- // TODO: add additional tests for absolute time selection, other inputs, form validation, etc.
95
- });