@perses-dev/dashboards 0.23.1 → 0.25.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.
- package/dist/cjs/components/AddPanelButton/AddPanelButton.js +9 -2
- package/dist/cjs/components/Dashboard/Dashboard.js +23 -6
- package/dist/cjs/components/DashboardToolbar/DashboardToolbar.js +8 -17
- package/dist/cjs/components/EditButton/EditButton.js +41 -0
- package/dist/cjs/components/EditButton/index.js +28 -0
- package/dist/cjs/components/EditJsonButton/EditJsonButton.js +42 -0
- package/dist/cjs/components/EditJsonButton/index.js +28 -0
- package/dist/cjs/components/EditJsonDialog/EditJsonDialog.js +86 -0
- package/dist/cjs/components/EditJsonDialog/index.js +28 -0
- package/dist/cjs/components/EmptyDashboard/EmptyDashboard.js +127 -0
- package/dist/cjs/components/EmptyDashboard/index.js +28 -0
- package/dist/cjs/components/QuerySummaryTable/QuerySummaryTable.js +185 -0
- package/dist/cjs/components/QuerySummaryTable/index.js +28 -0
- package/dist/cjs/components/TimeRangeControls/TimeRangeControls.js +7 -3
- package/dist/cjs/components/ToolbarIconButton/ToolbarIconButton.js +6 -3
- package/dist/cjs/components/Variables/EditVariablesButton.js +9 -2
- package/dist/cjs/components/index.js +4 -0
- package/dist/cjs/constants/user-interface-text.js +1 -0
- package/dist/cjs/context/DashboardProvider/DashboardProvider.js +12 -6
- package/dist/cjs/context/DashboardProvider/dashboard-provider-api.js +10 -1
- package/dist/cjs/context/DashboardProvider/edit-json-dialog-slice.js +36 -0
- package/dist/cjs/context/DatasourceStoreProvider.js +9 -3
- package/dist/cjs/stories/decorators/WithDashboard.js +60 -0
- package/dist/cjs/stories/decorators/WithPluginRegistry.js +91 -0
- package/dist/cjs/stories/decorators/WithQueryClient.js +29 -0
- package/dist/cjs/stories/decorators/WithQueryParams.js +29 -0
- package/dist/cjs/stories/decorators/WithTemplateVariables.js +27 -0
- package/dist/cjs/stories/decorators/index.js +32 -0
- package/dist/cjs/views/ViewDashboard/DashboardApp.js +11 -4
- package/dist/cjs/views/ViewDashboard/ViewDashboard.js +2 -1
- package/dist/components/AddPanelButton/AddPanelButton.d.ts +16 -1
- package/dist/components/AddPanelButton/AddPanelButton.d.ts.map +1 -1
- package/dist/components/AddPanelButton/AddPanelButton.js +9 -2
- package/dist/components/AddPanelButton/AddPanelButton.js.map +1 -1
- package/dist/components/Dashboard/Dashboard.d.ts +10 -2
- package/dist/components/Dashboard/Dashboard.d.ts.map +1 -1
- package/dist/components/Dashboard/Dashboard.js +24 -7
- package/dist/components/Dashboard/Dashboard.js.map +1 -1
- package/dist/components/DashboardToolbar/DashboardToolbar.d.ts.map +1 -1
- package/dist/components/DashboardToolbar/DashboardToolbar.js +8 -12
- package/dist/components/DashboardToolbar/DashboardToolbar.js.map +1 -1
- package/dist/components/EditButton/EditButton.d.ts +13 -0
- package/dist/components/EditButton/EditButton.d.ts.map +1 -0
- package/dist/components/EditButton/EditButton.js +30 -0
- package/dist/components/EditButton/EditButton.js.map +1 -0
- package/dist/components/EditButton/index.d.ts +2 -0
- package/dist/components/EditButton/index.d.ts.map +1 -0
- package/dist/components/EditButton/index.js +15 -0
- package/dist/components/EditButton/index.js.map +1 -0
- package/dist/components/EditJsonButton/EditJsonButton.d.ts +3 -0
- package/dist/components/EditJsonButton/EditJsonButton.d.ts.map +1 -0
- package/dist/components/EditJsonButton/EditJsonButton.js +31 -0
- package/dist/components/EditJsonButton/EditJsonButton.js.map +1 -0
- package/dist/components/EditJsonButton/index.d.ts +2 -0
- package/dist/components/EditJsonButton/index.d.ts.map +1 -0
- package/dist/components/EditJsonButton/index.js +15 -0
- package/dist/components/EditJsonButton/index.js.map +1 -0
- package/dist/components/EditJsonDialog/EditJsonDialog.d.ts +3 -0
- package/dist/components/EditJsonDialog/EditJsonDialog.d.ts.map +1 -0
- package/dist/components/EditJsonDialog/EditJsonDialog.js +80 -0
- package/dist/components/EditJsonDialog/EditJsonDialog.js.map +1 -0
- package/dist/components/EditJsonDialog/index.d.ts +2 -0
- package/dist/components/EditJsonDialog/index.d.ts.map +1 -0
- package/dist/components/EditJsonDialog/index.js +15 -0
- package/dist/components/EditJsonDialog/index.js.map +1 -0
- package/dist/components/EmptyDashboard/EmptyDashboard.d.ts +33 -0
- package/dist/components/EmptyDashboard/EmptyDashboard.d.ts.map +1 -0
- package/dist/components/EmptyDashboard/EmptyDashboard.js +123 -0
- package/dist/components/EmptyDashboard/EmptyDashboard.js.map +1 -0
- package/dist/components/EmptyDashboard/index.d.ts +2 -0
- package/dist/components/EmptyDashboard/index.d.ts.map +1 -0
- package/dist/components/EmptyDashboard/index.js +15 -0
- package/dist/components/EmptyDashboard/index.js.map +1 -0
- package/dist/components/QuerySummaryTable/QuerySummaryTable.d.ts +11 -0
- package/dist/components/QuerySummaryTable/QuerySummaryTable.d.ts.map +1 -0
- package/dist/components/QuerySummaryTable/QuerySummaryTable.js +179 -0
- package/dist/components/QuerySummaryTable/QuerySummaryTable.js.map +1 -0
- package/dist/components/QuerySummaryTable/index.d.ts +2 -0
- package/dist/components/QuerySummaryTable/index.d.ts.map +1 -0
- package/dist/components/QuerySummaryTable/index.js +15 -0
- package/dist/components/QuerySummaryTable/index.js.map +1 -0
- package/dist/components/TimeRangeControls/TimeRangeControls.d.ts +2 -1
- package/dist/components/TimeRangeControls/TimeRangeControls.d.ts.map +1 -1
- package/dist/components/TimeRangeControls/TimeRangeControls.js +8 -4
- package/dist/components/TimeRangeControls/TimeRangeControls.js.map +1 -1
- package/dist/components/ToolbarIconButton/ToolbarIconButton.d.ts +1 -1
- package/dist/components/ToolbarIconButton/ToolbarIconButton.d.ts.map +1 -1
- package/dist/components/ToolbarIconButton/ToolbarIconButton.js +6 -3
- package/dist/components/ToolbarIconButton/ToolbarIconButton.js.map +1 -1
- package/dist/components/Variables/EditVariablesButton.d.ts +16 -1
- package/dist/components/Variables/EditVariablesButton.d.ts.map +1 -1
- package/dist/components/Variables/EditVariablesButton.js +9 -2
- package/dist/components/Variables/EditVariablesButton.js.map +1 -1
- package/dist/components/index.d.ts +4 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +4 -0
- package/dist/components/index.js.map +1 -1
- package/dist/constants/user-interface-text.d.ts +1 -0
- package/dist/constants/user-interface-text.d.ts.map +1 -1
- package/dist/constants/user-interface-text.js +1 -0
- package/dist/constants/user-interface-text.js.map +1 -1
- package/dist/context/DashboardProvider/DashboardProvider.d.ts +2 -1
- package/dist/context/DashboardProvider/DashboardProvider.d.ts.map +1 -1
- package/dist/context/DashboardProvider/DashboardProvider.js +12 -6
- package/dist/context/DashboardProvider/DashboardProvider.js.map +1 -1
- package/dist/context/DashboardProvider/dashboard-provider-api.d.ts +8 -0
- package/dist/context/DashboardProvider/dashboard-provider-api.d.ts.map +1 -1
- package/dist/context/DashboardProvider/dashboard-provider-api.js +10 -0
- package/dist/context/DashboardProvider/dashboard-provider-api.js.map +1 -1
- package/dist/context/DashboardProvider/edit-json-dialog-slice.d.ts +12 -0
- package/dist/context/DashboardProvider/edit-json-dialog-slice.d.ts.map +1 -0
- package/dist/context/DashboardProvider/edit-json-dialog-slice.js +30 -0
- package/dist/context/DashboardProvider/edit-json-dialog-slice.js.map +1 -0
- package/dist/context/DatasourceStoreProvider.d.ts +2 -0
- package/dist/context/DatasourceStoreProvider.d.ts.map +1 -1
- package/dist/context/DatasourceStoreProvider.js +9 -3
- package/dist/context/DatasourceStoreProvider.js.map +1 -1
- package/dist/stories/decorators/WithDashboard.js +48 -0
- package/dist/stories/decorators/WithDashboard.js.map +1 -0
- package/dist/stories/decorators/WithPluginRegistry.js +46 -0
- package/dist/stories/decorators/WithPluginRegistry.js.map +1 -0
- package/dist/stories/decorators/WithQueryClient.js +23 -0
- package/dist/stories/decorators/WithQueryClient.js.map +1 -0
- package/dist/stories/decorators/WithQueryParams.js +23 -0
- package/dist/stories/decorators/WithQueryParams.js.map +1 -0
- package/dist/stories/decorators/WithTemplateVariables.js +21 -0
- package/dist/stories/decorators/WithTemplateVariables.js.map +1 -0
- package/dist/stories/decorators/index.js +19 -0
- package/dist/stories/decorators/index.js.map +1 -0
- package/dist/views/ViewDashboard/DashboardApp.d.ts +2 -0
- package/dist/views/ViewDashboard/DashboardApp.d.ts.map +1 -1
- package/dist/views/ViewDashboard/DashboardApp.js +12 -5
- package/dist/views/ViewDashboard/DashboardApp.js.map +1 -1
- package/dist/views/ViewDashboard/ViewDashboard.d.ts +2 -8
- package/dist/views/ViewDashboard/ViewDashboard.d.ts.map +1 -1
- package/dist/views/ViewDashboard/ViewDashboard.js +2 -1
- package/dist/views/ViewDashboard/ViewDashboard.js.map +1 -1
- package/package.json +6 -5
- package/dist/cjs/components/Panel/Panel.test.js +0 -137
- package/dist/cjs/components/PanelDrawer/PanelDrawer.test.js +0 -131
- package/dist/cjs/components/PanelGroupDialog/PanelGroupDialog.test.js +0 -87
- package/dist/cjs/components/TimeRangeControls/TimeRangeControls.test.js +0 -95
- package/dist/cjs/components/Variables/variable-model.test.js +0 -106
- package/dist/cjs/context/TemplateVariableProvider/query-params.test.js +0 -82
- package/dist/cjs/utils/panelUtils.test.js +0 -195
- package/dist/cjs/views/ViewDashboard/tests/panelGroups.test.js +0 -110
- package/dist/components/Panel/Panel.test.d.ts +0 -2
- package/dist/components/Panel/Panel.test.d.ts.map +0 -1
- package/dist/components/Panel/Panel.test.js +0 -130
- package/dist/components/Panel/Panel.test.js.map +0 -1
- package/dist/components/PanelDrawer/PanelDrawer.test.d.ts +0 -2
- package/dist/components/PanelDrawer/PanelDrawer.test.d.ts.map +0 -1
- package/dist/components/PanelDrawer/PanelDrawer.test.js +0 -124
- package/dist/components/PanelDrawer/PanelDrawer.test.js.map +0 -1
- package/dist/components/PanelGroupDialog/PanelGroupDialog.test.d.ts +0 -2
- package/dist/components/PanelGroupDialog/PanelGroupDialog.test.d.ts.map +0 -1
- package/dist/components/PanelGroupDialog/PanelGroupDialog.test.js +0 -80
- package/dist/components/PanelGroupDialog/PanelGroupDialog.test.js.map +0 -1
- package/dist/components/TimeRangeControls/TimeRangeControls.test.d.ts +0 -2
- package/dist/components/TimeRangeControls/TimeRangeControls.test.d.ts.map +0 -1
- package/dist/components/TimeRangeControls/TimeRangeControls.test.js +0 -88
- package/dist/components/TimeRangeControls/TimeRangeControls.test.js.map +0 -1
- package/dist/components/Variables/variable-model.test.d.ts +0 -2
- package/dist/components/Variables/variable-model.test.d.ts.map +0 -1
- package/dist/components/Variables/variable-model.test.js +0 -104
- package/dist/components/Variables/variable-model.test.js.map +0 -1
- package/dist/context/TemplateVariableProvider/query-params.test.d.ts +0 -2
- package/dist/context/TemplateVariableProvider/query-params.test.d.ts.map +0 -1
- package/dist/context/TemplateVariableProvider/query-params.test.js +0 -80
- package/dist/context/TemplateVariableProvider/query-params.test.js.map +0 -1
- package/dist/utils/panelUtils.test.d.ts +0 -2
- package/dist/utils/panelUtils.test.d.ts.map +0 -1
- package/dist/utils/panelUtils.test.js +0 -193
- package/dist/utils/panelUtils.test.js.map +0 -1
- package/dist/views/ViewDashboard/tests/panelGroups.test.d.ts +0 -2
- package/dist/views/ViewDashboard/tests/panelGroups.test.d.ts.map +0 -1
- package/dist/views/ViewDashboard/tests/panelGroups.test.js +0 -103
- package/dist/views/ViewDashboard/tests/panelGroups.test.js.map +0 -1
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
// Copyright 2023 The Perses Authors
|
|
2
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
-
// you may not use this file except in compliance with the License.
|
|
4
|
-
// You may obtain a copy of the License at
|
|
5
|
-
//
|
|
6
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
//
|
|
8
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
-
// See the License for the specific language governing permissions and
|
|
12
|
-
// limitations under the License.
|
|
13
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
-
import { screen } from '@testing-library/react';
|
|
15
|
-
import userEvent from '@testing-library/user-event';
|
|
16
|
-
import { act } from 'react-dom/test-utils';
|
|
17
|
-
import { DashboardProvider } from '../../context';
|
|
18
|
-
import { createDashboardProviderSpy, getTestDashboard, renderWithContext } from '../../test';
|
|
19
|
-
import { PanelGroupDialog } from './PanelGroupDialog';
|
|
20
|
-
describe('Add Panel Group', ()=>{
|
|
21
|
-
const renderDialog = ()=>{
|
|
22
|
-
const { store , DashboardProviderSpy } = createDashboardProviderSpy();
|
|
23
|
-
renderWithContext(/*#__PURE__*/ _jsxs(DashboardProvider, {
|
|
24
|
-
initialState: {
|
|
25
|
-
dashboardResource: getTestDashboard(),
|
|
26
|
-
isEditMode: true
|
|
27
|
-
},
|
|
28
|
-
children: [
|
|
29
|
-
/*#__PURE__*/ _jsx(DashboardProviderSpy, {}),
|
|
30
|
-
/*#__PURE__*/ _jsx(PanelGroupDialog, {})
|
|
31
|
-
]
|
|
32
|
-
}));
|
|
33
|
-
const { value: storeApi } = store;
|
|
34
|
-
if (storeApi === undefined) {
|
|
35
|
-
throw new Error('Expected dashboard store to be set after initial render');
|
|
36
|
-
}
|
|
37
|
-
return storeApi;
|
|
38
|
-
};
|
|
39
|
-
it('should add new panel group', async ()=>{
|
|
40
|
-
const storeApi = renderDialog();
|
|
41
|
-
// Open the dialog for a new panel group
|
|
42
|
-
act(()=>storeApi.getState().openAddPanelGroup());
|
|
43
|
-
const nameInput = await screen.findByLabelText(/Name/);
|
|
44
|
-
userEvent.type(nameInput, 'New Panel Group');
|
|
45
|
-
userEvent.click(screen.getByText('Add'));
|
|
46
|
-
// TODO: Figure out how to test this without coupling to the store state
|
|
47
|
-
const panelGroups = Object.values(storeApi.getState().panelGroups);
|
|
48
|
-
expect(panelGroups).toContainEqual({
|
|
49
|
-
id: expect.any(Number),
|
|
50
|
-
title: 'New Panel Group',
|
|
51
|
-
isCollapsed: false,
|
|
52
|
-
itemLayouts: expect.any(Array),
|
|
53
|
-
itemPanelKeys: expect.any(Object)
|
|
54
|
-
});
|
|
55
|
-
});
|
|
56
|
-
it('should edit existing panel group', async ()=>{
|
|
57
|
-
const storeApi = renderDialog();
|
|
58
|
-
// Open the dialog for an existing panel group
|
|
59
|
-
const group = Object.values(storeApi.getState().panelGroups).find((group)=>group.title === 'CPU Stats');
|
|
60
|
-
if (group === undefined) {
|
|
61
|
-
throw new Error('Missing test group');
|
|
62
|
-
}
|
|
63
|
-
act(()=>storeApi.getState().openEditPanelGroup(group.id));
|
|
64
|
-
const nameInput = await screen.findByLabelText(/Name/);
|
|
65
|
-
userEvent.clear(nameInput);
|
|
66
|
-
userEvent.type(nameInput, 'New Name');
|
|
67
|
-
userEvent.click(screen.getByText('Apply'));
|
|
68
|
-
// TODO: Figure out how to test this without coupling to the store state
|
|
69
|
-
const panelGroups = storeApi.getState().panelGroups;
|
|
70
|
-
expect(panelGroups).toMatchObject({
|
|
71
|
-
[group.id]: {
|
|
72
|
-
id: group.id,
|
|
73
|
-
title: 'New Name',
|
|
74
|
-
isCollapsed: false
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
});
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
//# sourceMappingURL=PanelGroupDialog.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/PanelGroupDialog/PanelGroupDialog.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 { act } from 'react-dom/test-utils';\nimport { DashboardProvider } from '../../context';\nimport { createDashboardProviderSpy, getTestDashboard, renderWithContext } from '../../test';\nimport { PanelGroupDialog } from './PanelGroupDialog';\n\ndescribe('Add Panel Group', () => {\n const renderDialog = () => {\n const { store, DashboardProviderSpy } = createDashboardProviderSpy();\n\n renderWithContext(\n <DashboardProvider initialState={{ dashboardResource: getTestDashboard(), isEditMode: true }}>\n <DashboardProviderSpy />\n <PanelGroupDialog />\n </DashboardProvider>\n );\n\n const { value: storeApi } = store;\n if (storeApi === undefined) {\n throw new Error('Expected dashboard store to be set after initial render');\n }\n\n return storeApi;\n };\n\n it('should add new panel group', async () => {\n const storeApi = renderDialog();\n\n // Open the dialog for a new panel group\n act(() => storeApi.getState().openAddPanelGroup());\n\n const nameInput = await screen.findByLabelText(/Name/);\n userEvent.type(nameInput, 'New Panel Group');\n userEvent.click(screen.getByText('Add'));\n\n // TODO: Figure out how to test this without coupling to the store state\n const panelGroups = Object.values(storeApi.getState().panelGroups);\n expect(panelGroups).toContainEqual({\n id: expect.any(Number),\n title: 'New Panel Group',\n isCollapsed: false,\n itemLayouts: expect.any(Array),\n itemPanelKeys: expect.any(Object),\n });\n });\n\n it('should edit existing panel group', async () => {\n const storeApi = renderDialog();\n\n // Open the dialog for an existing panel group\n const group = Object.values(storeApi.getState().panelGroups).find((group) => group.title === 'CPU Stats');\n if (group === undefined) {\n throw new Error('Missing test group');\n }\n act(() => storeApi.getState().openEditPanelGroup(group.id));\n\n const nameInput = await screen.findByLabelText(/Name/);\n userEvent.clear(nameInput);\n userEvent.type(nameInput, 'New Name');\n userEvent.click(screen.getByText('Apply'));\n\n // TODO: Figure out how to test this without coupling to the store state\n const panelGroups = storeApi.getState().panelGroups;\n expect(panelGroups).toMatchObject({\n [group.id]: {\n id: group.id,\n title: 'New Name',\n isCollapsed: false,\n },\n });\n });\n});\n"],"names":["screen","userEvent","act","DashboardProvider","createDashboardProviderSpy","getTestDashboard","renderWithContext","PanelGroupDialog","describe","renderDialog","store","DashboardProviderSpy","initialState","dashboardResource","isEditMode","value","storeApi","undefined","Error","it","getState","openAddPanelGroup","nameInput","findByLabelText","type","click","getByText","panelGroups","Object","values","expect","toContainEqual","id","any","Number","title","isCollapsed","itemLayouts","Array","itemPanelKeys","group","find","openEditPanelGroup","clear","toMatchObject"],"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,GAAG,QAAQ,sBAAsB,CAAC;AAC3C,SAASC,iBAAiB,QAAQ,eAAe,CAAC;AAClD,SAASC,0BAA0B,EAAEC,gBAAgB,EAAEC,iBAAiB,QAAQ,YAAY,CAAC;AAC7F,SAASC,gBAAgB,QAAQ,oBAAoB,CAAC;AAEtDC,QAAQ,CAAC,iBAAiB,EAAE,IAAM;IAChC,MAAMC,YAAY,GAAG,IAAM;QACzB,MAAM,EAAEC,KAAK,CAAA,EAAEC,oBAAoB,CAAA,EAAE,GAAGP,0BAA0B,EAAE,AAAC;QAErEE,iBAAiB,eACf,MAACH,iBAAiB;YAACS,YAAY,EAAE;gBAAEC,iBAAiB,EAAER,gBAAgB,EAAE;gBAAES,UAAU,EAAE,IAAI;aAAE;;8BAC1F,KAACH,oBAAoB,KAAG;8BACxB,KAACJ,gBAAgB,KAAG;;UACF,CACrB,CAAC;QAEF,MAAM,EAAEQ,KAAK,EAAEC,QAAQ,CAAA,EAAE,GAAGN,KAAK,AAAC;QAClC,IAAIM,QAAQ,KAAKC,SAAS,EAAE;YAC1B,MAAM,IAAIC,KAAK,CAAC,yDAAyD,CAAC,CAAC;QAC7E,CAAC;QAED,OAAOF,QAAQ,CAAC;IAClB,CAAC,AAAC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AG,CAAC,IAAMc,QAAQ,CAACI,QAAQ,EAAE,CAACsB,kBAAkB,CAACF,KAAK,CAACR,EAAE,CAAC,CAAC,CAAC;QAE5D,MAAMV,SAAS,GAAG,MAAMtB,MAAM,CAACuB,eAAe,QAAQ,AAAC;QACvDtB,SAAS,CAAC0C,KAAK,CAACrB,SAAS,CAAC,CAAC;QAC3BrB,SAAS,CAACuB,IAAI,CAACF,SAAS,EAAE,UAAU,CAAC,CAAC;QACtCrB,SAAS,CAACwB,KAAK,CAACzB,MAAM,CAAC0B,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC;QAE3C,wEAAwE;QACxE,MAAMC,WAAW,GAAGX,QAAQ,CAACI,QAAQ,EAAE,CAACO,WAAW,AAAC;QACpDG,MAAM,CAACH,WAAW,CAAC,CAACiB,aAAa,CAAC;YAChC,CAACJ,KAAK,CAACR,EAAE,CAAC,EAAE;gBACVA,EAAE,EAAEQ,KAAK,CAACR,EAAE;gBACZG,KAAK,EAAE,UAAU;gBACjBC,WAAW,EAAE,KAAK;aACnB;SACF,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TimeRangeControls.test.d.ts","sourceRoot":"","sources":["../../../src/components/TimeRangeControls/TimeRangeControls.test.tsx"],"names":[],"mappings":""}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
// Copyright 2023 The Perses Authors
|
|
2
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
-
// you may not use this file except in compliance with the License.
|
|
4
|
-
// You may obtain a copy of the License at
|
|
5
|
-
//
|
|
6
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
//
|
|
8
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
-
// See the License for the specific language governing permissions and
|
|
12
|
-
// limitations under the License.
|
|
13
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
-
import { generatePath } from 'react-router';
|
|
15
|
-
import { createMemoryHistory } from 'history';
|
|
16
|
-
import userEvent from '@testing-library/user-event';
|
|
17
|
-
import { screen, act } from '@testing-library/react';
|
|
18
|
-
import { TimeRangeProvider } from '@perses-dev/plugin-system';
|
|
19
|
-
import { renderWithContext } from '../../test';
|
|
20
|
-
import testDashboard from '../../test/testDashboard';
|
|
21
|
-
import { DashboardProvider } from '../../context';
|
|
22
|
-
import { TimeRangeControls } from './TimeRangeControls';
|
|
23
|
-
const history = createMemoryHistory({
|
|
24
|
-
initialEntries: [
|
|
25
|
-
generatePath('/home'),
|
|
26
|
-
generatePath('/dashboards/:id', {
|
|
27
|
-
id: 'test'
|
|
28
|
-
})
|
|
29
|
-
]
|
|
30
|
-
});
|
|
31
|
-
describe('TimeRangeControls', ()=>{
|
|
32
|
-
let initialState;
|
|
33
|
-
const testDefaultTimeRange = {
|
|
34
|
-
pastDuration: testDashboard.spec.duration
|
|
35
|
-
};
|
|
36
|
-
beforeEach(()=>{
|
|
37
|
-
initialState = {
|
|
38
|
-
dashboardResource: testDashboard
|
|
39
|
-
};
|
|
40
|
-
});
|
|
41
|
-
const renderTimeRangeControls = (testURLParams)=>{
|
|
42
|
-
renderWithContext(/*#__PURE__*/ _jsx(DashboardProvider, {
|
|
43
|
-
initialState: initialState,
|
|
44
|
-
children: /*#__PURE__*/ _jsx(TimeRangeProvider, {
|
|
45
|
-
initialTimeRange: testDefaultTimeRange,
|
|
46
|
-
enabledURLParams: testURLParams,
|
|
47
|
-
children: /*#__PURE__*/ _jsx(TimeRangeControls, {})
|
|
48
|
-
})
|
|
49
|
-
}), undefined, history);
|
|
50
|
-
};
|
|
51
|
-
it('should default to dashboard duration and update selected time option when clicked', async ()=>{
|
|
52
|
-
renderTimeRangeControls(false);
|
|
53
|
-
expect(screen.getByText('Last 30 minutes')).toBeInTheDocument();
|
|
54
|
-
const dateButton = screen.getByRole('button', {
|
|
55
|
-
name: /time range/i
|
|
56
|
-
});
|
|
57
|
-
userEvent.click(dateButton);
|
|
58
|
-
const firstSelected = screen.getByRole('option', {
|
|
59
|
-
name: 'Last 5 minutes'
|
|
60
|
-
});
|
|
61
|
-
userEvent.click(firstSelected);
|
|
62
|
-
expect(dateButton).toHaveTextContent(/5 minutes/i);
|
|
63
|
-
});
|
|
64
|
-
it('should update URL params with correct time range values', ()=>{
|
|
65
|
-
renderTimeRangeControls(true);
|
|
66
|
-
const dateButton = screen.getByRole('button', {
|
|
67
|
-
name: /time range/i
|
|
68
|
-
});
|
|
69
|
-
userEvent.click(dateButton);
|
|
70
|
-
const firstSelected = screen.getByRole('option', {
|
|
71
|
-
name: 'Last 5 minutes'
|
|
72
|
-
});
|
|
73
|
-
userEvent.click(firstSelected);
|
|
74
|
-
expect(history.location.search).toEqual('?start=5m');
|
|
75
|
-
// pick another option from TimeRangeSelector dropdown
|
|
76
|
-
const secondSelected = screen.getByText('Last 12 hours');
|
|
77
|
-
userEvent.click(secondSelected);
|
|
78
|
-
expect(history.location.search).toEqual('?start=12h');
|
|
79
|
-
// back button should return to previous page selected
|
|
80
|
-
act(()=>{
|
|
81
|
-
history.back();
|
|
82
|
-
});
|
|
83
|
-
expect(history.location.pathname).toEqual('/home');
|
|
84
|
-
});
|
|
85
|
-
// TODO: add additional tests for absolute time selection, other inputs, form validation, etc.
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
//# sourceMappingURL=TimeRangeControls.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/TimeRangeControls/TimeRangeControls.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 { generatePath } from 'react-router';\nimport { createMemoryHistory } from 'history';\nimport userEvent from '@testing-library/user-event';\nimport { screen, act } from '@testing-library/react';\nimport { TimeRangeProvider } from '@perses-dev/plugin-system';\nimport { renderWithContext } from '../../test';\nimport testDashboard from '../../test/testDashboard';\nimport { DashboardProvider, DashboardStoreProps } from '../../context';\nimport { TimeRangeControls } from './TimeRangeControls';\n\nconst history = createMemoryHistory({\n initialEntries: [generatePath('/home'), generatePath('/dashboards/:id', { id: 'test' })],\n});\n\ndescribe('TimeRangeControls', () => {\n let initialState: DashboardStoreProps;\n const testDefaultTimeRange = { pastDuration: testDashboard.spec.duration };\n\n beforeEach(() => {\n initialState = {\n dashboardResource: testDashboard,\n };\n });\n\n const renderTimeRangeControls = (testURLParams: boolean) => {\n renderWithContext(\n <DashboardProvider initialState={initialState}>\n <TimeRangeProvider initialTimeRange={testDefaultTimeRange} enabledURLParams={testURLParams}>\n <TimeRangeControls />\n </TimeRangeProvider>\n </DashboardProvider>,\n undefined,\n history\n );\n };\n\n it('should default to dashboard duration and update selected time option when clicked', async () => {\n renderTimeRangeControls(false);\n expect(screen.getByText('Last 30 minutes')).toBeInTheDocument();\n const dateButton = screen.getByRole('button', { name: /time range/i });\n userEvent.click(dateButton);\n const firstSelected = screen.getByRole('option', { name: 'Last 5 minutes' });\n userEvent.click(firstSelected);\n expect(dateButton).toHaveTextContent(/5 minutes/i);\n });\n\n it('should update URL params with correct time range values', () => {\n renderTimeRangeControls(true);\n const dateButton = screen.getByRole('button', { name: /time range/i });\n userEvent.click(dateButton);\n const firstSelected = screen.getByRole('option', { name: 'Last 5 minutes' });\n userEvent.click(firstSelected);\n expect(history.location.search).toEqual('?start=5m');\n\n // pick another option from TimeRangeSelector dropdown\n const secondSelected = screen.getByText('Last 12 hours');\n userEvent.click(secondSelected);\n expect(history.location.search).toEqual('?start=12h');\n\n // back button should return to previous page selected\n act(() => {\n history.back();\n });\n expect(history.location.pathname).toEqual('/home');\n });\n\n // TODO: add additional tests for absolute time selection, other inputs, form validation, etc.\n});\n"],"names":["generatePath","createMemoryHistory","userEvent","screen","act","TimeRangeProvider","renderWithContext","testDashboard","DashboardProvider","TimeRangeControls","history","initialEntries","id","describe","initialState","testDefaultTimeRange","pastDuration","spec","duration","beforeEach","dashboardResource","renderTimeRangeControls","testURLParams","initialTimeRange","enabledURLParams","undefined","it","expect","getByText","toBeInTheDocument","dateButton","getByRole","name","click","firstSelected","toHaveTextContent","location","search","toEqual","secondSelected","back","pathname"],"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,YAAY,QAAQ,cAAc,CAAC;AAC5C,SAASC,mBAAmB,QAAQ,SAAS,CAAC;AAC9C,OAAOC,SAAS,MAAM,6BAA6B,CAAC;AACpD,SAASC,MAAM,EAAEC,GAAG,QAAQ,wBAAwB,CAAC;AACrD,SAASC,iBAAiB,QAAQ,2BAA2B,CAAC;AAC9D,SAASC,iBAAiB,QAAQ,YAAY,CAAC;AAC/C,OAAOC,aAAa,MAAM,0BAA0B,CAAC;AACrD,SAASC,iBAAiB,QAA6B,eAAe,CAAC;AACvE,SAASC,iBAAiB,QAAQ,qBAAqB,CAAC;AAExD,MAAMC,OAAO,GAAGT,mBAAmB,CAAC;IAClCU,cAAc,EAAE;QAACX,YAAY,CAAC,OAAO,CAAC;QAAEA,YAAY,CAAC,iBAAiB,EAAE;YAAEY,EAAE,EAAE,MAAM;SAAE,CAAC;KAAC;CACzF,CAAC,AAAC;AAEHC,QAAQ,CAAC,mBAAmB,EAAE,IAAM;IAClC,IAAIC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C,QAAQ,EAAE;YAAEC,IAAI,eAAe;SAAE,CAAC,AAAC;QACvE9B,SAAS,CAAC+B,KAAK,CAACH,UAAU,CAAC,CAAC;QAC5B,MAAMI,aAAa,GAAG/B,MAAM,CAAC4B,SAAS,CAAC,QAAQ,EAAE;YAAEC,IAAI,EAAE,gBAAgB;SAAE,CAAC,AAAC;QAC7E9B,SAAS,CAAC+B,KAAK,CAACC,aAAa,CAAC,CAAC;QAC/BP,MAAM,CAACjB,OAAO,CAAC0B,QAAQ,CAACC,MAAM,CAAC,CAACC,OAAO,CAAC,WAAW,CAAC,CAAC;QAErD,sDAAsD;QACtD,MAAMC,cAAc,GAAGpC,MAAM,CAACyB,SAAS,CAAC,eAAe,CAAC,AAAC;QACzD1B,SAAS,CAAC+B,KAAK,CAACM,cAAc,CAAC,CAAC;QAChCZ,MAAM,CAACjB,OAAO,CAAC0B,QAAQ,CAACC,MAAM,CAAC,CAACC,OAAO,CAAC,YAAY,CAAC,CAAC;QAEtD,sDAAsD;QACtDlC,GAAG,CAAC,IAAM;YACRM,OAAO,CAAC8B,IAAI,EAAE,CAAC;QACjB,CAAC,CAAC,CAAC;QACHb,MAAM,CAACjB,OAAO,CAAC0B,QAAQ,CAACK,QAAQ,CAAC,CAACH,OAAO,CAAC,OAAO,CAAC,CAAC;IACrD,CAAC,CAAC,CAAC;AAEH,8FAA8F;AAChG,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"variable-model.test.d.ts","sourceRoot":"","sources":["../../../src/components/Variables/variable-model.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
// Copyright 2023 The Perses Authors
|
|
2
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
-
// you may not use this file except in compliance with the License.
|
|
4
|
-
// You may obtain a copy of the License at
|
|
5
|
-
//
|
|
6
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
//
|
|
8
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
-
// See the License for the specific language governing permissions and
|
|
12
|
-
// limitations under the License.
|
|
13
|
-
import { filterVariableList } from './variable-model';
|
|
14
|
-
describe('filterVariableList', ()=>{
|
|
15
|
-
const testSuite = [
|
|
16
|
-
{
|
|
17
|
-
title: 'basic case',
|
|
18
|
-
capturing_regexp: /([^-]*)-host-([^-]*)/g,
|
|
19
|
-
originalValues: [
|
|
20
|
-
{
|
|
21
|
-
label: 'l1',
|
|
22
|
-
value: 'us1-host-ahdix'
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
label: 'l2',
|
|
26
|
-
value: 'us1-host-diua'
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
label: 'l3',
|
|
30
|
-
value: 'eu1-host-adf'
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
label: 'l4',
|
|
34
|
-
value: 'bar'
|
|
35
|
-
}
|
|
36
|
-
],
|
|
37
|
-
result: [
|
|
38
|
-
{
|
|
39
|
-
label: 'l1',
|
|
40
|
-
value: 'us1ahdix'
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
label: 'l2',
|
|
44
|
-
value: 'us1diua'
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
label: 'l3',
|
|
48
|
-
value: 'eu1adf'
|
|
49
|
-
}
|
|
50
|
-
]
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
title: 'duplicate captured value',
|
|
54
|
-
capturing_regexp: /prometheus-(.+):\d+/g,
|
|
55
|
-
originalValues: [
|
|
56
|
-
{
|
|
57
|
-
label: 'l1',
|
|
58
|
-
value: 'prometheus-app:9090'
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
label: 'l2',
|
|
62
|
-
value: 'prometheus-app:9091'
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
label: 'l3',
|
|
66
|
-
value: 'prometheus-platform:9091'
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
label: 'l4',
|
|
70
|
-
value: 'prometheus-database:9091'
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
label: 'l5',
|
|
74
|
-
value: 'prometheus-perses:9091'
|
|
75
|
-
}
|
|
76
|
-
],
|
|
77
|
-
result: [
|
|
78
|
-
{
|
|
79
|
-
label: 'l1',
|
|
80
|
-
value: 'app'
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
label: 'l3',
|
|
84
|
-
value: 'platform'
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
label: 'l4',
|
|
88
|
-
value: 'database'
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
label: 'l5',
|
|
92
|
-
value: 'perses'
|
|
93
|
-
}
|
|
94
|
-
]
|
|
95
|
-
}
|
|
96
|
-
];
|
|
97
|
-
testSuite.forEach(({ title , capturing_regexp , originalValues , result })=>{
|
|
98
|
-
it(title, ()=>{
|
|
99
|
-
expect(filterVariableList(originalValues, capturing_regexp)).toEqual(result);
|
|
100
|
-
});
|
|
101
|
-
});
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
//# sourceMappingURL=variable-model.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/Variables/variable-model.test.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\nimport { VariableOption } from '@perses-dev/plugin-system';\nimport { filterVariableList } from './variable-model';\n\ndescribe('filterVariableList', () => {\n const testSuite = [\n {\n title: 'basic case',\n capturing_regexp: /([^-]*)-host-([^-]*)/g,\n originalValues: [\n { label: 'l1', value: 'us1-host-ahdix' },\n { label: 'l2', value: 'us1-host-diua' },\n { label: 'l3', value: 'eu1-host-adf' },\n { label: 'l4', value: 'bar' },\n ] as VariableOption[],\n result: [\n { label: 'l1', value: 'us1ahdix' },\n { label: 'l2', value: 'us1diua' },\n { label: 'l3', value: 'eu1adf' },\n ],\n },\n {\n title: 'duplicate captured value',\n capturing_regexp: /prometheus-(.+):\\d+/g,\n originalValues: [\n { label: 'l1', value: 'prometheus-app:9090' },\n { label: 'l2', value: 'prometheus-app:9091' },\n { label: 'l3', value: 'prometheus-platform:9091' },\n { label: 'l4', value: 'prometheus-database:9091' },\n { label: 'l5', value: 'prometheus-perses:9091' },\n ] as VariableOption[],\n result: [\n { label: 'l1', value: 'app' },\n { label: 'l3', value: 'platform' },\n { label: 'l4', value: 'database' },\n { label: 'l5', value: 'perses' },\n ],\n },\n ];\n testSuite.forEach(({ title, capturing_regexp, originalValues, result }) => {\n it(title, () => {\n expect(filterVariableList(originalValues, capturing_regexp)).toEqual(result);\n });\n });\n});\n"],"names":["filterVariableList","describe","testSuite","title","capturing_regexp","originalValues","label","value","result","forEach","it","expect","toEqual"],"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;AAGjC,SAASA,kBAAkB,QAAQ,kBAAkB,CAAC;AAEtDC,QAAQ,CAAC,oBAAoB,EAAE,IAAM;IACnC,MAAMC,SAAS,GAAG;QAChB;YACEC,KAAK,EAAE,YAAY;YACnBC,gBAAgB,yBAAyB;YACzCC,cAAc,EAAE;gBACd;oBAAEC,KAAK,EAAE,IAAI;oBAAEC,KAAK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N,KAAK,CAAA,EAAEC,gBAAgB,CAAA,EAAEC,cAAc,CAAA,EAAEG,MAAM,CAAA,EAAE,GAAK;QACzEE,EAAE,CAACP,KAAK,EAAE,IAAM;YACdQ,MAAM,CAACX,kBAAkB,CAACK,cAAc,EAAED,gBAAgB,CAAC,CAAC,CAACQ,OAAO,CAACJ,MAAM,CAAC,CAAC;QAC/E,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"query-params.test.d.ts","sourceRoot":"","sources":["../../../src/context/TemplateVariableProvider/query-params.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
// Copyright 2023 The Perses Authors
|
|
2
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
-
// you may not use this file except in compliance with the License.
|
|
4
|
-
// You may obtain a copy of the License at
|
|
5
|
-
//
|
|
6
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
//
|
|
8
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
-
// See the License for the specific language governing permissions and
|
|
12
|
-
// limitations under the License.
|
|
13
|
-
import { getInitalValuesFromQueryParameters, decodeVariableValue, encodeVariableValue } from './query-params';
|
|
14
|
-
describe('getInitalValuesFromQueryParameters', ()=>{
|
|
15
|
-
test('base case', ()=>{
|
|
16
|
-
expect(getInitalValuesFromQueryParameters({
|
|
17
|
-
'var-foo': 'bar',
|
|
18
|
-
'var-baz': [
|
|
19
|
-
'qux',
|
|
20
|
-
'quux'
|
|
21
|
-
]
|
|
22
|
-
})).toEqual({
|
|
23
|
-
foo: 'bar',
|
|
24
|
-
baz: [
|
|
25
|
-
'qux',
|
|
26
|
-
'quux'
|
|
27
|
-
]
|
|
28
|
-
});
|
|
29
|
-
});
|
|
30
|
-
});
|
|
31
|
-
describe('encodeVariableValue', ()=>{
|
|
32
|
-
const testCases = [
|
|
33
|
-
{
|
|
34
|
-
input: 'foo',
|
|
35
|
-
expected: 'foo'
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
input: [
|
|
39
|
-
'foo',
|
|
40
|
-
'bar'
|
|
41
|
-
],
|
|
42
|
-
expected: 'foo,bar'
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
input: '$__all',
|
|
46
|
-
expected: '$__all'
|
|
47
|
-
}
|
|
48
|
-
];
|
|
49
|
-
testCases.forEach(({ input , expected })=>{
|
|
50
|
-
test(`encodes ${input} as ${expected}`, ()=>{
|
|
51
|
-
expect(encodeVariableValue(input)).toEqual(expected);
|
|
52
|
-
});
|
|
53
|
-
});
|
|
54
|
-
});
|
|
55
|
-
describe('decodeVariableValue', ()=>{
|
|
56
|
-
const testCases = [
|
|
57
|
-
{
|
|
58
|
-
input: 'foo',
|
|
59
|
-
expected: 'foo'
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
input: 'foo,bar',
|
|
63
|
-
expected: [
|
|
64
|
-
'foo',
|
|
65
|
-
'bar'
|
|
66
|
-
]
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
input: '$__all',
|
|
70
|
-
expected: '$__all'
|
|
71
|
-
}
|
|
72
|
-
];
|
|
73
|
-
testCases.forEach(({ input , expected })=>{
|
|
74
|
-
test(`encodes ${input} as ${expected}`, ()=>{
|
|
75
|
-
expect(decodeVariableValue(input)).toEqual(expected);
|
|
76
|
-
});
|
|
77
|
-
});
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
//# sourceMappingURL=query-params.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/context/TemplateVariableProvider/query-params.test.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\nimport { VariableValue } from '@perses-dev/core';\nimport { getInitalValuesFromQueryParameters, decodeVariableValue, encodeVariableValue } from './query-params';\n\ndescribe('getInitalValuesFromQueryParameters', () => {\n test('base case', () => {\n expect(\n getInitalValuesFromQueryParameters({\n 'var-foo': 'bar',\n 'var-baz': ['qux', 'quux'],\n })\n ).toEqual({\n foo: 'bar',\n baz: ['qux', 'quux'],\n });\n });\n});\n\ndescribe('encodeVariableValue', () => {\n const testCases = [\n {\n input: 'foo',\n expected: 'foo',\n },\n {\n input: ['foo', 'bar'],\n expected: 'foo,bar',\n },\n {\n input: '$__all',\n expected: '$__all',\n },\n ];\n\n testCases.forEach(({ input, expected }) => {\n test(`encodes ${input} as ${expected}`, () => {\n expect(encodeVariableValue(input)).toEqual(expected);\n });\n });\n});\n\ndescribe('decodeVariableValue', () => {\n const testCases: Array<{ input: string; expected: VariableValue }> = [\n {\n input: 'foo',\n expected: 'foo',\n },\n {\n input: 'foo,bar',\n expected: ['foo', 'bar'],\n },\n {\n input: '$__all',\n expected: '$__all',\n },\n ];\n\n testCases.forEach(({ input, expected }) => {\n test(`encodes ${input} as ${expected}`, () => {\n expect(decodeVariableValue(input)).toEqual(expected);\n });\n });\n});\n"],"names":["getInitalValuesFromQueryParameters","decodeVariableValue","encodeVariableValue","describe","test","expect","toEqual","foo","baz","testCases","input","expected","forEach"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iC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;YAChBC,QAAQ,EAAE;gBAAC,KAAK;gBAAE,KAAK;aAAC;SACzB;QACD;YACED,KAAK,EAAE,QAAQ;YACfC,QAAQ,EAAE,QAAQ;SACnB;KACF,AAAC;IAEFF,SAAS,CAACG,OAAO,CAAC,CAAC,EAAEF,KAAK,CAAA,EAAEC,QAAQ,CAAA,EAAE,GAAK;QACzCP,IAAI,CAAC,CAAC,QAAQ,EAAEM,KAAK,CAAC,IAAI,EAAEC,QAAQ,CAAC,CAAC,EAAE,IAAM;YAC5CN,MAAM,CAACJ,mBAAmB,CAACS,KAAK,CAAC,CAAC,CAACJ,OAAO,CAACK,QAAQ,CAAC,CAAC;QACvD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"panelUtils.test.d.ts","sourceRoot":"","sources":["../../src/utils/panelUtils.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
// Copyright 2023 The Perses Authors
|
|
2
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
-
// you may not use this file except in compliance with the License.
|
|
4
|
-
// You may obtain a copy of the License at
|
|
5
|
-
//
|
|
6
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
//
|
|
8
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
-
// See the License for the specific language governing permissions and
|
|
12
|
-
// limitations under the License.
|
|
13
|
-
import { getValidPanelKey, insertPanelInLayout } from './panelUtils';
|
|
14
|
-
describe('insertPanelInLayout', ()=>{
|
|
15
|
-
describe('inserts the panel to the right when space is available', ()=>{
|
|
16
|
-
test('with a single panel in that row', ()=>{
|
|
17
|
-
const newLayout = {
|
|
18
|
-
i: 'abc',
|
|
19
|
-
w: 10,
|
|
20
|
-
h: 8
|
|
21
|
-
};
|
|
22
|
-
const referenceLayout = {
|
|
23
|
-
i: 'one',
|
|
24
|
-
x: 0,
|
|
25
|
-
y: 0,
|
|
26
|
-
w: 6,
|
|
27
|
-
h: 6
|
|
28
|
-
};
|
|
29
|
-
const layouts = [
|
|
30
|
-
referenceLayout
|
|
31
|
-
];
|
|
32
|
-
expect(insertPanelInLayout(newLayout, referenceLayout, layouts)).toEqual([
|
|
33
|
-
referenceLayout,
|
|
34
|
-
{
|
|
35
|
-
x: 6,
|
|
36
|
-
y: 0,
|
|
37
|
-
...newLayout
|
|
38
|
-
}
|
|
39
|
-
]);
|
|
40
|
-
});
|
|
41
|
-
test('with multiple panels in that row with space between them', ()=>{
|
|
42
|
-
const newLayout = {
|
|
43
|
-
i: 'abc',
|
|
44
|
-
w: 10,
|
|
45
|
-
h: 8
|
|
46
|
-
};
|
|
47
|
-
const referenceLayout = {
|
|
48
|
-
i: 'one',
|
|
49
|
-
x: 0,
|
|
50
|
-
y: 0,
|
|
51
|
-
w: 3,
|
|
52
|
-
h: 4
|
|
53
|
-
};
|
|
54
|
-
const otherPanelInRow = {
|
|
55
|
-
i: 'two',
|
|
56
|
-
x: 20,
|
|
57
|
-
y: 0,
|
|
58
|
-
w: 4,
|
|
59
|
-
h: 4
|
|
60
|
-
};
|
|
61
|
-
const layouts = [
|
|
62
|
-
referenceLayout,
|
|
63
|
-
otherPanelInRow
|
|
64
|
-
];
|
|
65
|
-
expect(insertPanelInLayout(newLayout, referenceLayout, layouts)).toEqual([
|
|
66
|
-
referenceLayout,
|
|
67
|
-
{
|
|
68
|
-
x: 3,
|
|
69
|
-
y: 0,
|
|
70
|
-
...newLayout
|
|
71
|
-
},
|
|
72
|
-
otherPanelInRow
|
|
73
|
-
]);
|
|
74
|
-
});
|
|
75
|
-
});
|
|
76
|
-
describe('inserts the panel below when space is not available to the right', ()=>{
|
|
77
|
-
test('with a single panel in the initial layout', ()=>{
|
|
78
|
-
const newLayout = {
|
|
79
|
-
i: 'abc',
|
|
80
|
-
w: 10,
|
|
81
|
-
h: 8
|
|
82
|
-
};
|
|
83
|
-
const referenceLayout = {
|
|
84
|
-
i: 'one',
|
|
85
|
-
x: 1,
|
|
86
|
-
y: 0,
|
|
87
|
-
w: 18,
|
|
88
|
-
h: 4
|
|
89
|
-
};
|
|
90
|
-
const layouts = [
|
|
91
|
-
referenceLayout
|
|
92
|
-
];
|
|
93
|
-
expect(insertPanelInLayout(newLayout, referenceLayout, layouts)).toEqual([
|
|
94
|
-
referenceLayout,
|
|
95
|
-
{
|
|
96
|
-
x: 1,
|
|
97
|
-
y: 4,
|
|
98
|
-
...newLayout
|
|
99
|
-
}
|
|
100
|
-
]);
|
|
101
|
-
});
|
|
102
|
-
test('with a single panel in the same row and additional panels below', ()=>{
|
|
103
|
-
const newLayout = {
|
|
104
|
-
i: 'abc',
|
|
105
|
-
w: 10,
|
|
106
|
-
h: 8
|
|
107
|
-
};
|
|
108
|
-
const referenceLayout = {
|
|
109
|
-
i: 'one',
|
|
110
|
-
x: 0,
|
|
111
|
-
y: 0,
|
|
112
|
-
w: 18,
|
|
113
|
-
h: 4
|
|
114
|
-
};
|
|
115
|
-
const nextRowItem = {
|
|
116
|
-
i: 'two',
|
|
117
|
-
x: 0,
|
|
118
|
-
y: 4,
|
|
119
|
-
w: 6,
|
|
120
|
-
h: 6
|
|
121
|
-
};
|
|
122
|
-
const layouts = [
|
|
123
|
-
referenceLayout,
|
|
124
|
-
nextRowItem
|
|
125
|
-
];
|
|
126
|
-
expect(insertPanelInLayout(newLayout, referenceLayout, layouts)).toEqual([
|
|
127
|
-
referenceLayout,
|
|
128
|
-
{
|
|
129
|
-
x: 0,
|
|
130
|
-
y: 4,
|
|
131
|
-
...newLayout
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
...nextRowItem,
|
|
135
|
-
y: nextRowItem.y + newLayout.h
|
|
136
|
-
}
|
|
137
|
-
]);
|
|
138
|
-
});
|
|
139
|
-
});
|
|
140
|
-
});
|
|
141
|
-
describe('getValidPanelKey', ()=>{
|
|
142
|
-
test('removes whitespace', ()=>{
|
|
143
|
-
expect(getValidPanelKey('my panel name', {})).toBe('mypanelname');
|
|
144
|
-
});
|
|
145
|
-
test('does not include a counter if the key is not in use', ()=>{
|
|
146
|
-
const mockPanelDefs = {
|
|
147
|
-
alreadyInUse: {
|
|
148
|
-
kind: 'Panel',
|
|
149
|
-
spec: {}
|
|
150
|
-
}
|
|
151
|
-
};
|
|
152
|
-
expect(getValidPanelKey('newPanelName', mockPanelDefs)).toBe('newPanelName');
|
|
153
|
-
});
|
|
154
|
-
test('includes a counter if the key is already in use', ()=>{
|
|
155
|
-
const mockPanelDefs = {
|
|
156
|
-
alreadyInUse: {
|
|
157
|
-
kind: 'Panel',
|
|
158
|
-
spec: {}
|
|
159
|
-
}
|
|
160
|
-
};
|
|
161
|
-
expect(getValidPanelKey('alreadyInUse', mockPanelDefs)).toBe('alreadyInUse-1');
|
|
162
|
-
});
|
|
163
|
-
test('includes an incremented counter if the key is already in use multiple times', ()=>{
|
|
164
|
-
const mockPanelDefs = {
|
|
165
|
-
popularKey: {
|
|
166
|
-
kind: 'Panel',
|
|
167
|
-
spec: {}
|
|
168
|
-
},
|
|
169
|
-
'popularKey-1': {
|
|
170
|
-
kind: 'Panel',
|
|
171
|
-
spec: {}
|
|
172
|
-
}
|
|
173
|
-
};
|
|
174
|
-
expect(getValidPanelKey('popularKey', mockPanelDefs)).toBe('popularKey-2');
|
|
175
|
-
expect(getValidPanelKey('popularKey-1', mockPanelDefs)).toBe('popularKey-2');
|
|
176
|
-
});
|
|
177
|
-
test('does not duplicate counters when they are out of order', ()=>{
|
|
178
|
-
const mockPanelDefs = {
|
|
179
|
-
outoforder: {
|
|
180
|
-
kind: 'Panel',
|
|
181
|
-
spec: {}
|
|
182
|
-
},
|
|
183
|
-
'outoforder-2': {
|
|
184
|
-
kind: 'Panel',
|
|
185
|
-
spec: {}
|
|
186
|
-
}
|
|
187
|
-
};
|
|
188
|
-
expect(getValidPanelKey('outoforder', mockPanelDefs)).toBe('outoforder-3');
|
|
189
|
-
expect(getValidPanelKey('outoforder-2', mockPanelDefs)).toBe('outoforder-3');
|
|
190
|
-
});
|
|
191
|
-
});
|
|
192
|
-
|
|
193
|
-
//# sourceMappingURL=panelUtils.test.js.map
|