@perses-dev/dashboards 0.24.0 → 0.26.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 +128 -0
- package/dist/cjs/components/EmptyDashboard/index.js +28 -0
- package/dist/cjs/components/Panel/Panel.js +0 -4
- package/dist/cjs/components/Panel/PanelHeader.js +2 -2
- package/dist/cjs/components/QuerySummaryTable/QuerySummaryTable.js +185 -0
- package/dist/cjs/components/QuerySummaryTable/index.js +28 -0
- 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/context/TemplateVariableProvider/TemplateVariableProvider.js +3 -41
- package/dist/cjs/context/TemplateVariableProvider/hydrationUtils.js +68 -0
- package/dist/cjs/stories/decorators/WithDashboard.js +39 -0
- package/dist/cjs/stories/decorators/WithDatasourceStore.js +82 -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 +35 -0
- package/dist/cjs/stories/decorators/WithTimeRange.js +38 -0
- package/dist/cjs/stories/decorators/constants.js +36 -0
- package/dist/cjs/stories/decorators/index.js +35 -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 +37 -0
- package/dist/components/EmptyDashboard/EmptyDashboard.d.ts.map +1 -0
- package/dist/components/EmptyDashboard/EmptyDashboard.js +124 -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/Panel/Panel.d.ts.map +1 -1
- package/dist/components/Panel/Panel.js +0 -4
- package/dist/components/Panel/Panel.js.map +1 -1
- package/dist/components/Panel/PanelHeader.d.ts +1 -2
- package/dist/components/Panel/PanelHeader.d.ts.map +1 -1
- package/dist/components/Panel/PanelHeader.js +2 -2
- package/dist/components/Panel/PanelHeader.js.map +1 -1
- 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/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/context/TemplateVariableProvider/TemplateVariableProvider.d.ts +3 -2
- package/dist/context/TemplateVariableProvider/TemplateVariableProvider.d.ts.map +1 -1
- package/dist/context/TemplateVariableProvider/TemplateVariableProvider.js +1 -39
- package/dist/context/TemplateVariableProvider/TemplateVariableProvider.js.map +1 -1
- package/dist/context/TemplateVariableProvider/hydrationUtils.d.ts +4 -0
- package/dist/context/TemplateVariableProvider/hydrationUtils.d.ts.map +1 -0
- package/dist/context/TemplateVariableProvider/hydrationUtils.js +62 -0
- package/dist/context/TemplateVariableProvider/hydrationUtils.js.map +1 -0
- package/dist/stories/decorators/WithDashboard.js +33 -0
- package/dist/stories/decorators/WithDashboard.js.map +1 -0
- package/dist/stories/decorators/WithDatasourceStore.js +76 -0
- package/dist/stories/decorators/WithDatasourceStore.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 +29 -0
- package/dist/stories/decorators/WithTemplateVariables.js.map +1 -0
- package/dist/stories/decorators/WithTimeRange.js +32 -0
- package/dist/stories/decorators/WithTimeRange.js.map +1 -0
- package/dist/stories/decorators/constants.js +30 -0
- package/dist/stories/decorators/constants.js.map +1 -0
- package/dist/stories/decorators/index.js +22 -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 +4 -4
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
14
14
|
import { useState } from 'react';
|
|
15
15
|
import { Typography, Stack, Button, Box, useTheme, useMediaQuery, Alert } from '@mui/material';
|
|
16
|
-
import PencilIcon from 'mdi-material-ui/PencilOutline';
|
|
17
16
|
import { ErrorBoundary, ErrorAlert } from '@perses-dev/components';
|
|
18
17
|
import { useDashboard, useEditMode } from '../../context';
|
|
19
18
|
import { AddPanelButton } from '../AddPanelButton';
|
|
@@ -21,6 +20,8 @@ import { AddGroupButton } from '../AddGroupButton';
|
|
|
21
20
|
import { DownloadButton } from '../DownloadButton';
|
|
22
21
|
import { TimeRangeControls } from '../TimeRangeControls';
|
|
23
22
|
import { TemplateVariableList, EditVariablesButton } from '../Variables';
|
|
23
|
+
import { EditButton } from '../EditButton';
|
|
24
|
+
import { EditJsonButton } from '../EditJsonButton';
|
|
24
25
|
export const DashboardToolbar = (props)=>{
|
|
25
26
|
const { dashboardName , dashboardTitleComponent , initialVariableIsSticky , isReadonly , onEditButtonClick , onCancelButtonClick , onSave , } = props;
|
|
26
27
|
const dashboard = useDashboard();
|
|
@@ -117,7 +118,8 @@ export const DashboardToolbar = (props)=>{
|
|
|
117
118
|
/*#__PURE__*/ _jsx(AddPanelButton, {}),
|
|
118
119
|
/*#__PURE__*/ _jsx(AddGroupButton, {}),
|
|
119
120
|
/*#__PURE__*/ _jsx(TimeRangeControls, {}),
|
|
120
|
-
/*#__PURE__*/ _jsx(DownloadButton, {})
|
|
121
|
+
/*#__PURE__*/ _jsx(DownloadButton, {}),
|
|
122
|
+
/*#__PURE__*/ _jsx(EditJsonButton, {})
|
|
121
123
|
]
|
|
122
124
|
}) : // On smaller screens, make it two rows
|
|
123
125
|
/*#__PURE__*/ _jsxs(Stack, {
|
|
@@ -132,7 +134,8 @@ export const DashboardToolbar = (props)=>{
|
|
|
132
134
|
},
|
|
133
135
|
children: [
|
|
134
136
|
/*#__PURE__*/ _jsx(TimeRangeControls, {}),
|
|
135
|
-
/*#__PURE__*/ _jsx(DownloadButton, {})
|
|
137
|
+
/*#__PURE__*/ _jsx(DownloadButton, {}),
|
|
138
|
+
/*#__PURE__*/ _jsx(EditJsonButton, {})
|
|
136
139
|
]
|
|
137
140
|
}),
|
|
138
141
|
/*#__PURE__*/ _jsxs(Stack, {
|
|
@@ -172,15 +175,8 @@ export const DashboardToolbar = (props)=>{
|
|
|
172
175
|
children: [
|
|
173
176
|
/*#__PURE__*/ _jsx(TimeRangeControls, {}),
|
|
174
177
|
/*#__PURE__*/ _jsx(DownloadButton, {}),
|
|
175
|
-
isBiggerThanSm && /*#__PURE__*/ _jsx(
|
|
176
|
-
|
|
177
|
-
color: "secondary",
|
|
178
|
-
startIcon: /*#__PURE__*/ _jsx(PencilIcon, {}),
|
|
179
|
-
onClick: onEditButtonClick,
|
|
180
|
-
sx: {
|
|
181
|
-
marginLeft: 'auto'
|
|
182
|
-
},
|
|
183
|
-
children: "Edit"
|
|
178
|
+
isBiggerThanSm && /*#__PURE__*/ _jsx(EditButton, {
|
|
179
|
+
onClick: onEditButtonClick
|
|
184
180
|
})
|
|
185
181
|
]
|
|
186
182
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/DashboardToolbar/DashboardToolbar.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { useState } from 'react';\nimport { Typography, Stack, Button, Box, useTheme, useMediaQuery, Alert } from '@mui/material';\nimport PencilIcon from 'mdi-material-ui/PencilOutline';\nimport { ErrorBoundary, ErrorAlert } from '@perses-dev/components';\nimport { DashboardResource } from '@perses-dev/core';\nimport { useDashboard, useEditMode } from '../../context';\nimport { AddPanelButton } from '../AddPanelButton';\nimport { AddGroupButton } from '../AddGroupButton';\nimport { DownloadButton } from '../DownloadButton';\nimport { TimeRangeControls } from '../TimeRangeControls';\nimport { TemplateVariableList, EditVariablesButton } from '../Variables';\n\nexport interface DashboardToolbarProps {\n dashboardName: string;\n dashboardTitleComponent?: JSX.Element;\n initialVariableIsSticky?: boolean;\n isReadonly: boolean;\n onEditButtonClick: () => void;\n onCancelButtonClick: () => void;\n onSave?: (entity: DashboardResource) => Promise<DashboardResource>;\n}\n\nexport const DashboardToolbar = (props: DashboardToolbarProps) => {\n const {\n dashboardName,\n dashboardTitleComponent,\n initialVariableIsSticky,\n isReadonly,\n onEditButtonClick,\n onCancelButtonClick,\n onSave,\n } = props;\n\n const dashboard = useDashboard();\n const { isEditMode, setEditMode } = useEditMode();\n\n const isBiggerThanMd = useMediaQuery(useTheme().breakpoints.up('md'));\n const isBiggerThanSm = useMediaQuery(useTheme().breakpoints.up('sm'));\n\n const [isSavingDashboard, setSavingDashboard] = useState<boolean>(false);\n\n const dashboardTitle = dashboardTitleComponent ? (\n dashboardTitleComponent\n ) : (\n <Typography variant=\"h2\">{dashboardName}</Typography>\n );\n\n const onSaveButtonClick = () => {\n if (onSave !== undefined) {\n setSavingDashboard(true);\n onSave(dashboard.dashboard)\n .then(() => {\n setSavingDashboard(false);\n setEditMode(false);\n })\n .catch(() => {\n setSavingDashboard(false);\n });\n } else {\n setEditMode(false);\n }\n };\n\n const testId = 'dashboard-toolbar';\n\n return (\n <>\n {isEditMode ? (\n <Stack spacing={1} data-testid={testId}>\n <Box p={2} display=\"flex\" sx={{ backgroundColor: (theme) => theme.palette.primary.main + '30' }}>\n {dashboardTitle}\n <Stack direction=\"row\" spacing={1} marginLeft=\"auto\">\n {isReadonly && (\n <Alert severity={'warning'} sx={{ backgroundColor: 'transparent', padding: 0 }}>\n Dashboard managed via code only. Download JSON and commit changes to save.\n </Alert>\n )}\n <Button variant=\"contained\" onClick={onSaveButtonClick} disabled={isReadonly || isSavingDashboard}>\n Save\n </Button>\n <Button variant=\"outlined\" onClick={onCancelButtonClick}>\n Cancel\n </Button>\n </Stack>\n </Box>\n <Box\n sx={{\n display: 'flex',\n width: '100%',\n alignItems: 'start',\n padding: (theme) => theme.spacing(1, 2, 2, 2),\n }}\n >\n <ErrorBoundary FallbackComponent={ErrorAlert}>\n <TemplateVariableList\n initialVariableIsSticky={initialVariableIsSticky}\n sx={{\n backgroundColor: ({ palette }) =>\n palette.mode === 'dark' ? palette.background.default : palette.background.paper,\n }}\n />\n </ErrorBoundary>\n {isBiggerThanMd ? (\n // On bigger screens, make it one row\n <Stack direction=\"row\" spacing={1} marginLeft=\"auto\" sx={{ whiteSpace: 'nowrap' }}>\n <EditVariablesButton />\n <AddPanelButton />\n <AddGroupButton />\n <TimeRangeControls />\n <DownloadButton />\n </Stack>\n ) : (\n // On smaller screens, make it two rows\n <Stack spacing={1}>\n <Stack direction=\"row\" spacing={1} marginLeft=\"auto\" sx={{ whiteSpace: 'nowrap' }}>\n <TimeRangeControls />\n <DownloadButton />\n </Stack>\n <Stack direction=\"row\" spacing={1} marginLeft=\"auto\" sx={{ whiteSpace: 'nowrap' }}>\n <EditVariablesButton />\n <AddPanelButton />\n <AddGroupButton />\n </Stack>\n </Stack>\n )}\n </Box>\n </Stack>\n ) : (\n <Stack spacing={1} padding={2} data-testid={testId}>\n <Box sx={{ display: 'flex', width: '100%' }}>\n {dashboardTitle}\n <Stack direction=\"row\" spacing={1} marginLeft=\"auto\">\n <TimeRangeControls />\n <DownloadButton />\n {isBiggerThanSm && (\n <Button\n variant=\"outlined\"\n color=\"secondary\"\n startIcon={<PencilIcon />}\n onClick={onEditButtonClick}\n sx={{ marginLeft: 'auto' }}\n >\n Edit\n </Button>\n )}\n </Stack>\n </Box>\n <Box paddingY={2}>\n <ErrorBoundary FallbackComponent={ErrorAlert}>\n <TemplateVariableList\n initialVariableIsSticky={initialVariableIsSticky}\n sx={{\n backgroundColor: ({ palette }) =>\n palette.mode === 'dark' ? palette.background.default : palette.background.paper,\n }}\n />\n </ErrorBoundary>\n </Box>\n </Stack>\n )}\n </>\n );\n};\n"],"names":["useState","Typography","Stack","Button","Box","useTheme","useMediaQuery","Alert","PencilIcon","ErrorBoundary","ErrorAlert","useDashboard","useEditMode","AddPanelButton","AddGroupButton","DownloadButton","TimeRangeControls","TemplateVariableList","EditVariablesButton","DashboardToolbar","props","dashboardName","dashboardTitleComponent","initialVariableIsSticky","isReadonly","onEditButtonClick","onCancelButtonClick","onSave","dashboard","isEditMode","setEditMode","isBiggerThanMd","breakpoints","up","isBiggerThanSm","isSavingDashboard","setSavingDashboard","dashboardTitle","variant","onSaveButtonClick","undefined","then","catch","testId","spacing","data-testid","p","display","sx","backgroundColor","theme","palette","primary","main","direction","marginLeft","severity","padding","onClick","disabled","width","alignItems","FallbackComponent","mode","background","default","paper","whiteSpace","color","startIcon","paddingY"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC;AAAA,SAASA,QAAQ,QAAQ,OAAO,CAAC;AACjC,SAASC,UAAU,EAAEC,KAAK,EAAEC,MAAM,EAAEC,GAAG,EAAEC,QAAQ,EAAEC,aAAa,EAAEC,KAAK,QAAQ,eAAe,CAAC;AAC/F,OAAOC,UAAU,MAAM,+BAA+B,CAAC;AACvD,SAASC,aAAa,EAAEC,UAAU,QAAQ,wBAAwB,CAAC;AAEnE,SAASC,YAAY,EAAEC,WAAW,QAAQ,eAAe,CAAC;AAC1D,SAASC,cAAc,QAAQ,mBAAmB,CAAC;AACnD,SAASC,cAAc,QAAQ,m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ACF,AACT;;kBACG;;UACA,iBAER,MAACZ,KAAK;YAAC0C,OAAO,EAAE,CAAC;YAAEa,OAAO,EAAE,CAAC;YAAEZ,aAAW,EAAEF,MAAM;;8BAChD,MAACvC,GAAG;oBAAC4C,EAAE,EAAE;wBAAED,OAAO,EAAE,MAAM;wBAAEa,KAAK,EAAE,MAAM;qBAAE;;wBACxCvB,cAAc;sCACf,MAACnC,KAAK;4BAACoD,SAAS,EAAC,KAAK;4BAACV,OAAO,EAAE,CAAC;4BAAEW,UAAU,EAAC,MAAM;;8CAClD,KAACvC,iBAAiB,KAAG;8CACrB,KAACD,cAAc,KAAG;gCACjBmB,cAAc,kBACb,KAAC/B,MAAM;oCACLmC,OAAO,EAAC,UAAU;oCAClB8B,KAAK,EAAC,WAAW;oCACjBC,SAAS,gBAAE,KAAC7D,UAAU,KAAG;oCACzBkD,OAAO,EAAEjC,iBAAiB;oCAC1BuB,EAAE,EAAE;wCAAEO,UAAU,EAAE,MAAM;qCAAE;8CAC3B,MAED;kCAAS,AACV;;0BACK;;kBACJ;8BACN,KAACnD,GAAG;oBAACkE,QAAQ,EAAE,CAAC;8BACd,cAAA,KAAC7D,aAAa;wBAACqD,iBAAiB,EAAEpD,UAAU;kCAC1C,cAAA,KAACO,oBAAoB;4BACnBM,uBAAuB,EAAEA,uBAAuB;4BAChDyB,EAAE,EAAE;gCACFC,eAAe,EAAE,CAAC,EAAEE,OAAO,CAAA,EAAE,GAC3BA,OAAO,CAACY,IAAI,KAAK,MAAM,GAAGZ,OAAO,CAACa,UAAU,CAACC,OAAO,GAAGd,OAAO,CAACa,UAAU,CAACE,KAAK;6BAClF;0BACD;sBACY;kBACZ;;UACA,AACT;MACA,CACH;AACJ,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/DashboardToolbar/DashboardToolbar.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { useState } from 'react';\nimport { Typography, Stack, Button, Box, useTheme, useMediaQuery, Alert } from '@mui/material';\nimport { ErrorBoundary, ErrorAlert } from '@perses-dev/components';\nimport { DashboardResource } from '@perses-dev/core';\nimport { useDashboard, useEditMode } from '../../context';\nimport { AddPanelButton } from '../AddPanelButton';\nimport { AddGroupButton } from '../AddGroupButton';\nimport { DownloadButton } from '../DownloadButton';\nimport { TimeRangeControls } from '../TimeRangeControls';\nimport { TemplateVariableList, EditVariablesButton } from '../Variables';\nimport { EditButton } from '../EditButton';\nimport { EditJsonButton } from '../EditJsonButton';\n\nexport interface DashboardToolbarProps {\n dashboardName: string;\n dashboardTitleComponent?: JSX.Element;\n initialVariableIsSticky?: boolean;\n isReadonly: boolean;\n onEditButtonClick: () => void;\n onCancelButtonClick: () => void;\n onSave?: (entity: DashboardResource) => Promise<DashboardResource>;\n}\n\nexport const DashboardToolbar = (props: DashboardToolbarProps) => {\n const {\n dashboardName,\n dashboardTitleComponent,\n initialVariableIsSticky,\n isReadonly,\n onEditButtonClick,\n onCancelButtonClick,\n onSave,\n } = props;\n\n const dashboard = useDashboard();\n const { isEditMode, setEditMode } = useEditMode();\n\n const isBiggerThanMd = useMediaQuery(useTheme().breakpoints.up('md'));\n const isBiggerThanSm = useMediaQuery(useTheme().breakpoints.up('sm'));\n\n const [isSavingDashboard, setSavingDashboard] = useState<boolean>(false);\n\n const dashboardTitle = dashboardTitleComponent ? (\n dashboardTitleComponent\n ) : (\n <Typography variant=\"h2\">{dashboardName}</Typography>\n );\n\n const onSaveButtonClick = () => {\n if (onSave !== undefined) {\n setSavingDashboard(true);\n onSave(dashboard.dashboard)\n .then(() => {\n setSavingDashboard(false);\n setEditMode(false);\n })\n .catch(() => {\n setSavingDashboard(false);\n });\n } else {\n setEditMode(false);\n }\n };\n\n const testId = 'dashboard-toolbar';\n\n return (\n <>\n {isEditMode ? (\n <Stack spacing={1} data-testid={testId}>\n <Box p={2} display=\"flex\" sx={{ backgroundColor: (theme) => theme.palette.primary.main + '30' }}>\n {dashboardTitle}\n <Stack direction=\"row\" spacing={1} marginLeft=\"auto\">\n {isReadonly && (\n <Alert severity={'warning'} sx={{ backgroundColor: 'transparent', padding: 0 }}>\n Dashboard managed via code only. Download JSON and commit changes to save.\n </Alert>\n )}\n <Button variant=\"contained\" onClick={onSaveButtonClick} disabled={isReadonly || isSavingDashboard}>\n Save\n </Button>\n <Button variant=\"outlined\" onClick={onCancelButtonClick}>\n Cancel\n </Button>\n </Stack>\n </Box>\n <Box\n sx={{\n display: 'flex',\n width: '100%',\n alignItems: 'start',\n padding: (theme) => theme.spacing(1, 2, 2, 2),\n }}\n >\n <ErrorBoundary FallbackComponent={ErrorAlert}>\n <TemplateVariableList\n initialVariableIsSticky={initialVariableIsSticky}\n sx={{\n backgroundColor: ({ palette }) =>\n palette.mode === 'dark' ? palette.background.default : palette.background.paper,\n }}\n />\n </ErrorBoundary>\n {isBiggerThanMd ? (\n // On bigger screens, make it one row\n <Stack direction=\"row\" spacing={1} marginLeft=\"auto\" sx={{ whiteSpace: 'nowrap' }}>\n <EditVariablesButton />\n <AddPanelButton />\n <AddGroupButton />\n <TimeRangeControls />\n <DownloadButton />\n <EditJsonButton />\n </Stack>\n ) : (\n // On smaller screens, make it two rows\n <Stack spacing={1}>\n <Stack direction=\"row\" spacing={1} marginLeft=\"auto\" sx={{ whiteSpace: 'nowrap' }}>\n <TimeRangeControls />\n <DownloadButton />\n <EditJsonButton />\n </Stack>\n <Stack direction=\"row\" spacing={1} marginLeft=\"auto\" sx={{ whiteSpace: 'nowrap' }}>\n <EditVariablesButton />\n <AddPanelButton />\n <AddGroupButton />\n </Stack>\n </Stack>\n )}\n </Box>\n </Stack>\n ) : (\n <Stack spacing={1} padding={2} data-testid={testId}>\n <Box sx={{ display: 'flex', width: '100%' }}>\n {dashboardTitle}\n <Stack direction=\"row\" spacing={1} marginLeft=\"auto\">\n <TimeRangeControls />\n <DownloadButton />\n {isBiggerThanSm && <EditButton onClick={onEditButtonClick} />}\n </Stack>\n </Box>\n <Box paddingY={2}>\n <ErrorBoundary FallbackComponent={ErrorAlert}>\n <TemplateVariableList\n initialVariableIsSticky={initialVariableIsSticky}\n sx={{\n backgroundColor: ({ palette }) =>\n palette.mode === 'dark' ? palette.background.default : palette.background.paper,\n }}\n />\n </ErrorBoundary>\n </Box>\n </Stack>\n )}\n </>\n );\n};\n"],"names":["useState","Typography","Stack","Button","Box","useTheme","useMediaQuery","Alert","ErrorBoundary","ErrorAlert","useDashboard","useEditMode","AddPanelButton","AddGroupButton","DownloadButton","TimeRangeControls","TemplateVariableList","EditVariablesButton","EditButton","EditJsonButton","DashboardToolbar","props","dashboardName","dashboardTitleComponent","initialVariableIsSticky","isReadonly","onEditButtonClick","onCancelButtonClick","onSave","dashboard","isEditMode","setEditMode","isBiggerThanMd","breakpoints","up","isBiggerThanSm","isSavingDashboard","setSavingDashboard","dashboardTitle","variant","onSaveButtonClick","undefined","then","catch","testId","spacing","data-testid","p","display","sx","backgroundColor","theme","palette","primary","main","direction","marginLeft","severity","padding","onClick","disabled","width","alignItems","FallbackComponent","mode","background","default","paper","whiteSpace","paddingY"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC;AAAA,SAASA,QAAQ,QAAQ,OAAO,CAAC;AACjC,SAASC,UAAU,EAAEC,KAAK,EAAEC,MAAM,EAAEC,GAAG,EAAEC,QAAQ,EAAEC,aAAa,EAAEC,KAAK,QAAQ,eAAe,C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13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface EditButtonProps {
|
|
3
|
+
/**
|
|
4
|
+
* The label used inside the button.
|
|
5
|
+
*/
|
|
6
|
+
label?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Handler that puts the dashboard into editing mode.
|
|
9
|
+
*/
|
|
10
|
+
onClick: () => void;
|
|
11
|
+
}
|
|
12
|
+
export declare const EditButton: ({ label, onClick }: EditButtonProps) => JSX.Element;
|
|
13
|
+
//# sourceMappingURL=EditButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EditButton.d.ts","sourceRoot":"","sources":["../../../src/components/EditButton/EditButton.tsx"],"names":[],"mappings":";AAgBA,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,eAAO,MAAM,UAAU,uBAAiC,eAAe,gBAYtE,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
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 { Button } from '@mui/material';
|
|
15
|
+
import PencilIcon from 'mdi-material-ui/PencilOutline';
|
|
16
|
+
export const EditButton = ({ label ='Edit' , onClick })=>{
|
|
17
|
+
return /*#__PURE__*/ _jsx(Button, {
|
|
18
|
+
onClick: onClick,
|
|
19
|
+
startIcon: /*#__PURE__*/ _jsx(PencilIcon, {}),
|
|
20
|
+
variant: "outlined",
|
|
21
|
+
color: "secondary",
|
|
22
|
+
sx: {
|
|
23
|
+
whiteSpace: 'nowrap',
|
|
24
|
+
minWidth: 'auto'
|
|
25
|
+
},
|
|
26
|
+
children: label
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=EditButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/EditButton/EditButton.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 { Button } from '@mui/material';\nimport PencilIcon from 'mdi-material-ui/PencilOutline';\n\nexport interface EditButtonProps {\n /**\n * The label used inside the button.\n */\n label?: string;\n\n /**\n * Handler that puts the dashboard into editing mode.\n */\n onClick: () => void;\n}\n\nexport const EditButton = ({ label = 'Edit', onClick }: EditButtonProps) => {\n return (\n <Button\n onClick={onClick}\n startIcon={<PencilIcon />}\n variant=\"outlined\"\n color=\"secondary\"\n sx={{ whiteSpace: 'nowrap', minWidth: 'auto' }}\n >\n {label}\n </Button>\n );\n};\n"],"names":["Button","PencilIcon","EditButton","label","onClick","startIcon","variant","color","sx","whiteSpace","minWidth"],"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,eAAe,CAAC;AACvC,OAAOC,UAAU,MAAM,+BAA+B,CAAC;AAcvD,OAAO,MAAMC,UAAU,GAAG,CAAC,EAAEC,KAAK,EAAG,MAAM,CAAA,EAAEC,OAAO,CAAA,EAAmB,GAAK;IAC1E,qBACE,KAACJ,MAAM;QACLI,OAAO,EAAEA,OAAO;QAChBC,SAAS,gBAAE,KAACJ,UAAU,KAAG;QACzBK,OAAO,EAAC,UAAU;QAClBC,KAAK,EAAC,WAAW;QACjBC,EAAE,EAAE;YAAEC,UAAU,EAAE,QAAQ;YAAEC,QAAQ,EAAE,MAAM;SAAE;kBAE7CP,KAAK;MACC,CACT;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/EditButton/index.ts"],"names":[],"mappings":"AAaA,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Copyright 2023 The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
export * from './EditButton';
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/EditButton/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 './EditButton';\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,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EditJsonButton.d.ts","sourceRoot":"","sources":["../../../src/components/EditJsonButton/EditJsonButton.tsx"],"names":[],"mappings":";AAmBA,eAAO,MAAM,cAAc,mBAS1B,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
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 CodeIcon from 'mdi-material-ui/CodeBraces';
|
|
15
|
+
import { InfoTooltip } from '@perses-dev/components';
|
|
16
|
+
import { TOOLTIP_TEXT } from '../../constants';
|
|
17
|
+
import { ToolbarIconButton } from '../ToolbarIconButton';
|
|
18
|
+
import { useEditJsonDialog } from '../../context';
|
|
19
|
+
export const EditJsonButton = ()=>{
|
|
20
|
+
const { openEditJsonDialog } = useEditJsonDialog();
|
|
21
|
+
return /*#__PURE__*/ _jsx(InfoTooltip, {
|
|
22
|
+
description: TOOLTIP_TEXT.editJson,
|
|
23
|
+
children: /*#__PURE__*/ _jsx(ToolbarIconButton, {
|
|
24
|
+
variant: "outlined",
|
|
25
|
+
onClick: ()=>openEditJsonDialog(),
|
|
26
|
+
children: /*#__PURE__*/ _jsx(CodeIcon, {})
|
|
27
|
+
})
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=EditJsonButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/EditJsonButton/EditJsonButton.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 CodeIcon from 'mdi-material-ui/CodeBraces';\nimport { InfoTooltip } from '@perses-dev/components';\nimport { TOOLTIP_TEXT } from '../../constants';\nimport { ToolbarIconButton } from '../ToolbarIconButton';\nimport { useEditJsonDialog } from '../../context';\n\nexport const EditJsonButton = () => {\n const { openEditJsonDialog } = useEditJsonDialog();\n return (\n <InfoTooltip description={TOOLTIP_TEXT.editJson}>\n <ToolbarIconButton variant=\"outlined\" onClick={() => openEditJsonDialog()}>\n <CodeIcon />\n </ToolbarIconButton>\n </InfoTooltip>\n );\n};\n"],"names":["CodeIcon","InfoTooltip","TOOLTIP_TEXT","ToolbarIconButton","useEditJsonDialog","EditJsonButton","openEditJsonDialog","description","editJson","variant","onClick"],"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,OAAOA,QAAQ,MAAM,4BAA4B,CAAC;AAClD,SAASC,WAAW,QAAQ,wBAAwB,CAAC;AACrD,SAASC,YAAY,QAAQ,iBAAiB,CAAC;AAC/C,SAASC,iBAAiB,QAAQ,sBAAsB,CAAC;AACzD,SAASC,iBAAiB,QAAQ,eAAe,CAAC;AAElD,OAAO,MAAMC,cAAc,GAAG,IAAM;IAClC,MAAM,EAAEC,kBAAkB,CAAA,EAAE,GAAGF,iBAAiB,EAAE,AAAC;IACnD,qBACE,KAACH,WAAW;QAACM,WAAW,EAAEL,YAAY,CAACM,QAAQ;kBAC7C,cAAA,KAACL,iBAAiB;YAACM,OAAO,EAAC,UAAU;YAACC,OAAO,EAAE,IAAMJ,kBAAkB,EAAE;sBACvE,cAAA,KAACN,QAAQ,KAAG;UACM;MACR,CACd;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/EditJsonButton/index.ts"],"names":[],"mappings":"AAaA,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Copyright 2023 The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
export * from './EditJsonButton';
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/EditJsonButton/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 './EditJsonButton';\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,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EditJsonDialog.d.ts","sourceRoot":"","sources":["../../../src/components/EditJsonDialog/EditJsonDialog.tsx"],"names":[],"mappings":";AAmBA,eAAO,MAAM,cAAc,mBAS1B,CAAC"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
// Copyright 2023 The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
import { useState } from 'react';
|
|
15
|
+
import { Alert, FormControl } from '@mui/material';
|
|
16
|
+
import { Dialog, JSONEditor } from '@perses-dev/components';
|
|
17
|
+
import { useEditJsonDialog } from '../../context/DashboardProvider';
|
|
18
|
+
import { useDashboard } from '../../context/useDashboard';
|
|
19
|
+
export const EditJsonDialog = ()=>{
|
|
20
|
+
const { editJsonDialog , closeEditJsonDialog } = useEditJsonDialog();
|
|
21
|
+
return /*#__PURE__*/ _jsxs(Dialog, {
|
|
22
|
+
open: !!(editJsonDialog === null || editJsonDialog === void 0 ? void 0 : editJsonDialog.isOpen),
|
|
23
|
+
scroll: "paper",
|
|
24
|
+
fullWidth: true,
|
|
25
|
+
maxWidth: "lg",
|
|
26
|
+
children: [
|
|
27
|
+
/*#__PURE__*/ _jsx(Dialog.Header, {
|
|
28
|
+
onClose: ()=>closeEditJsonDialog(),
|
|
29
|
+
children: "Edit Dashboard"
|
|
30
|
+
}),
|
|
31
|
+
(editJsonDialog === null || editJsonDialog === void 0 ? void 0 : editJsonDialog.isOpen) && /*#__PURE__*/ _jsx(EditJsonDialogForm, {})
|
|
32
|
+
]
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
const EditJsonDialogForm = ()=>{
|
|
36
|
+
const { closeEditJsonDialog } = useEditJsonDialog();
|
|
37
|
+
const { dashboard , setDashboard } = useDashboard();
|
|
38
|
+
const [draftDashboard, setDraftDashboard] = useState(dashboard);
|
|
39
|
+
const handleApply = (e)=>{
|
|
40
|
+
e.preventDefault();
|
|
41
|
+
setDashboard(draftDashboard);
|
|
42
|
+
closeEditJsonDialog();
|
|
43
|
+
};
|
|
44
|
+
return /*#__PURE__*/ _jsxs(Dialog.Form, {
|
|
45
|
+
onSubmit: handleApply,
|
|
46
|
+
children: [
|
|
47
|
+
/*#__PURE__*/ _jsxs(Dialog.Content, {
|
|
48
|
+
sx: {
|
|
49
|
+
width: '100%'
|
|
50
|
+
},
|
|
51
|
+
children: [
|
|
52
|
+
/*#__PURE__*/ _jsx(Alert, {
|
|
53
|
+
sx: {
|
|
54
|
+
marginBottom: (theme)=>theme.spacing(1)
|
|
55
|
+
},
|
|
56
|
+
severity: "warning",
|
|
57
|
+
children: "Metadata cannot be modified or saved."
|
|
58
|
+
}),
|
|
59
|
+
/*#__PURE__*/ _jsx(FormControl, {
|
|
60
|
+
fullWidth: true,
|
|
61
|
+
children: /*#__PURE__*/ _jsx(JSONEditor, {
|
|
62
|
+
minHeight: "300px",
|
|
63
|
+
maxHeight: "700px",
|
|
64
|
+
value: draftDashboard,
|
|
65
|
+
onChange: (value)=>setDraftDashboard(value)
|
|
66
|
+
})
|
|
67
|
+
})
|
|
68
|
+
]
|
|
69
|
+
}),
|
|
70
|
+
/*#__PURE__*/ _jsx(Dialog.Actions, {
|
|
71
|
+
children: /*#__PURE__*/ _jsx(Dialog.PrimaryButton, {
|
|
72
|
+
onClick: handleApply,
|
|
73
|
+
children: "Apply"
|
|
74
|
+
})
|
|
75
|
+
})
|
|
76
|
+
]
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
//# sourceMappingURL=EditJsonDialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/EditJsonDialog/EditJsonDialog.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 { FormEvent, useState } from 'react';\nimport { Alert, FormControl } from '@mui/material';\nimport { Dialog, JSONEditor } from '@perses-dev/components';\nimport { useEditJsonDialog } from '../../context/DashboardProvider';\nimport { useDashboard } from '../../context/useDashboard';\n\nexport const EditJsonDialog = () => {\n const { editJsonDialog, closeEditJsonDialog } = useEditJsonDialog();\n\n return (\n <Dialog open={!!editJsonDialog?.isOpen} scroll=\"paper\" fullWidth maxWidth=\"lg\">\n <Dialog.Header onClose={() => closeEditJsonDialog()}>Edit Dashboard</Dialog.Header>\n {editJsonDialog?.isOpen && <EditJsonDialogForm />}\n </Dialog>\n );\n};\n\nconst EditJsonDialogForm = () => {\n const { closeEditJsonDialog } = useEditJsonDialog();\n const { dashboard, setDashboard } = useDashboard();\n const [draftDashboard, setDraftDashboard] = useState(dashboard);\n\n const handleApply = (e: FormEvent) => {\n e.preventDefault();\n setDashboard(draftDashboard);\n closeEditJsonDialog();\n };\n\n return (\n <Dialog.Form onSubmit={handleApply}>\n <Dialog.Content sx={{ width: '100%' }}>\n <Alert sx={{ marginBottom: (theme) => theme.spacing(1) }} severity=\"warning\">\n Metadata cannot be modified or saved.\n </Alert>\n <FormControl fullWidth>\n <JSONEditor\n minHeight=\"300px\"\n maxHeight=\"700px\"\n value={draftDashboard}\n onChange={(value) => setDraftDashboard(value)}\n />\n </FormControl>\n </Dialog.Content>\n <Dialog.Actions>\n <Dialog.PrimaryButton onClick={handleApply}>Apply</Dialog.PrimaryButton>\n </Dialog.Actions>\n </Dialog.Form>\n );\n};\n"],"names":["useState","Alert","FormControl","Dialog","JSONEditor","useEditJsonDialog","useDashboard","EditJsonDialog","editJsonDialog","closeEditJsonDialog","open","isOpen","scroll","fullWidth","maxWidth","Header","onClose","EditJsonDialogForm","dashboard","setDashboard","draftDashboard","setDraftDashboard","handleApply","e","preventDefault","Form","onSubmit","Content","sx","width","marginBottom","theme","spacing","severity","minHeight","maxHeight","value","onChange","Actions","PrimaryBut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CAAC,GAAGrB,QAAQ,CAACkB,SAAS,CAAC,AAAC;IAEhE,MAAMI,WAAW,GAAG,CAACC,CAAY,GAAK;QACpCA,CAAC,CAACC,cAAc,EAAE,CAAC;QACnBL,YAAY,CAACC,cAAc,CAAC,CAAC;QAC7BX,mBAAmB,EAAE,CAAC;IACxB,CAAC,AAAC;IAEF,qBACE,MAACN,MAAM,CAACsB,IAAI;QAACC,QAAQ,EAAEJ,WAAW;;0BAChC,MAACnB,MAAM,CAACwB,OAAO;gBAACC,EAAE,EAAE;oBAAEC,KAAK,EAAE,MAAM;iBAAE;;kCACnC,KAAC5B,KAAK;wBAAC2B,EAAE,EAAE;4BAAEE,YAAY,EAAE,CAACC,KAAK,GAAKA,KAAK,CAACC,OAAO,CAAC,CAAC,CAAC;yBAAE;wBAAEC,QAAQ,EAAC,SAAS;kCAAC,uCAE7E;sBAAQ;kCACR,KAAC/B,WAAW;wBAACW,SAAS;kCACpB,cAAA,KAACT,UAAU;4BACT8B,SAAS,EAAC,OAAO;4BACjBC,SAAS,EAAC,OAAO;4BACjBC,KAAK,EAAEhB,cAAc;4BACrBiB,QAAQ,EAAE,CAACD,KAAK,GAAKf,iBAAiB,CAACe,KAAK,CAAC;0BAC7C;sBACU;;cACC;0BACjB,KAACjC,MAAM,CAACmC,OAAO;0BACb,cAAA,KAACnC,MAAM,CAACoC,aAAa;oBAACC,OAAO,EAAElB,WAAW;8BAAE,OAAK;kBAAuB;cACzD;;MACL,CACd;AACJ,CAAC,AAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/EditJsonDialog/index.ts"],"names":[],"mappings":"AAaA,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Copyright 2023 The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
export * from './EditJsonDialog';
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/EditJsonDialog/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 './EditJsonDialog';\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,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface EmptyDashboardProps {
|
|
3
|
+
/**
|
|
4
|
+
* The title, which should be relatively short text.
|
|
5
|
+
*/
|
|
6
|
+
title?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Imagery to display above the title.
|
|
9
|
+
*/
|
|
10
|
+
image?: React.ReactNode;
|
|
11
|
+
/**
|
|
12
|
+
* Descriptive text, which can be a bit longer.
|
|
13
|
+
*/
|
|
14
|
+
description?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Additional text that will be displayed at the bottom of the empty state.
|
|
17
|
+
* If not specified, no additional text is shown.
|
|
18
|
+
*/
|
|
19
|
+
additionalText?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Components that are placed below the title and description that include
|
|
22
|
+
* actions for the user to take (e.g. buttons or links). If not specified,
|
|
23
|
+
* the default buttons will be displayed. Set to `false` to disable the default
|
|
24
|
+
* buttons.
|
|
25
|
+
*/
|
|
26
|
+
actions?: JSX.Element | boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Handler for clicking the edit button when the dashboard is in "view" mode.
|
|
29
|
+
* Required when using the default empty state.
|
|
30
|
+
*/
|
|
31
|
+
onEditButtonClick?: () => void;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Communicate that a dashboard is empty and prompt the user to get started.
|
|
35
|
+
*/
|
|
36
|
+
export declare const EmptyDashboard: ({ title, image, description, additionalText, actions, onEditButtonClick, }: EmptyDashboardProps) => JSX.Element;
|
|
37
|
+
//# sourceMappingURL=EmptyDashboard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmptyDashboard.d.ts","sourceRoot":"","sources":["../../../src/components/EmptyDashboard/EmptyDashboard.tsx"],"names":[],"mappings":";AAmBA,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAExB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,GAAG,CAAC,OAAO,GAAG,OAAO,CAAC;IAEhC;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;CAChC;AAmDD;;GAEG;AACH,eAAO,MAAM,cAAc,+EAOxB,mBAAmB,gBA2BrB,CAAC"}
|
|
@@ -0,0 +1,124 @@
|
|
|
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, Fragment as _Fragment } from "react/jsx-runtime";
|
|
14
|
+
import { Typography, Box } from '@mui/material';
|
|
15
|
+
import { useEditMode } from '../../context';
|
|
16
|
+
import { AddPanelButton } from '../AddPanelButton';
|
|
17
|
+
import { EditVariablesButton } from '../Variables';
|
|
18
|
+
import { EditButton } from '../EditButton';
|
|
19
|
+
const DEFAULT_TITLE = "Let's get started";
|
|
20
|
+
const DEFAULT_DESCRIPTION = {
|
|
21
|
+
edit: 'We currently support time series charts, gauge charts, stat charts and more!',
|
|
22
|
+
view: 'This dashboard is currently empty. Get started by clicking the edit button.'
|
|
23
|
+
};
|
|
24
|
+
// Constants from specifics in designs to make the default messaging look good.
|
|
25
|
+
const CONTAINER_WIDTH = '450px';
|
|
26
|
+
const PRIMARY_CONTENT_WIDTH = '289px';
|
|
27
|
+
const COMMON_BUTTON_PROPS = {
|
|
28
|
+
variant: 'outlined',
|
|
29
|
+
color: 'secondary'
|
|
30
|
+
};
|
|
31
|
+
const EmptyDashboardActions = ({ actions , isEditMode , onEditButtonClick })=>{
|
|
32
|
+
if (actions && typeof actions !== 'boolean') {
|
|
33
|
+
// Custom actions
|
|
34
|
+
return actions;
|
|
35
|
+
}
|
|
36
|
+
if (actions === false) {
|
|
37
|
+
// Disable default actions
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
if (isEditMode) {
|
|
41
|
+
// Default edit mode actions
|
|
42
|
+
return /*#__PURE__*/ _jsxs(_Fragment, {
|
|
43
|
+
children: [
|
|
44
|
+
/*#__PURE__*/ _jsx(AddPanelButton, {
|
|
45
|
+
variant: "outlined",
|
|
46
|
+
color: "secondary",
|
|
47
|
+
label: "Add Panel",
|
|
48
|
+
fullWidth: true
|
|
49
|
+
}),
|
|
50
|
+
/*#__PURE__*/ _jsx(EditVariablesButton, {
|
|
51
|
+
variant: "outlined",
|
|
52
|
+
color: "secondary",
|
|
53
|
+
label: "Add Variables",
|
|
54
|
+
fullWidth: true
|
|
55
|
+
})
|
|
56
|
+
]
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
if (onEditButtonClick) {
|
|
60
|
+
// Default view mode actions
|
|
61
|
+
return /*#__PURE__*/ _jsx(EditButton, {
|
|
62
|
+
...COMMON_BUTTON_PROPS,
|
|
63
|
+
label: "Edit Dashboard",
|
|
64
|
+
onClick: onEditButtonClick
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
return null;
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* Communicate that a dashboard is empty and prompt the user to get started.
|
|
71
|
+
*/ export const EmptyDashboard = ({ title =DEFAULT_TITLE , image , description , additionalText , actions , onEditButtonClick })=>{
|
|
72
|
+
const { isEditMode } = useEditMode();
|
|
73
|
+
const defaultDescription = isEditMode ? DEFAULT_DESCRIPTION.edit : DEFAULT_DESCRIPTION.view;
|
|
74
|
+
const actionsContent = /*#__PURE__*/ _jsx(EmptyDashboardActions, {
|
|
75
|
+
actions: actions,
|
|
76
|
+
onEditButtonClick: onEditButtonClick,
|
|
77
|
+
isEditMode: isEditMode
|
|
78
|
+
});
|
|
79
|
+
return /*#__PURE__*/ _jsxs(Box, {
|
|
80
|
+
sx: {
|
|
81
|
+
width: CONTAINER_WIDTH,
|
|
82
|
+
textAlign: 'center',
|
|
83
|
+
margin: '0 auto'
|
|
84
|
+
},
|
|
85
|
+
children: [
|
|
86
|
+
/*#__PURE__*/ _jsxs(Box, {
|
|
87
|
+
sx: {
|
|
88
|
+
width: PRIMARY_CONTENT_WIDTH,
|
|
89
|
+
margin: '0 auto'
|
|
90
|
+
},
|
|
91
|
+
children: [
|
|
92
|
+
!!image && image,
|
|
93
|
+
/*#__PURE__*/ _jsx(Typography, {
|
|
94
|
+
variant: "h2",
|
|
95
|
+
gutterBottom: true,
|
|
96
|
+
children: title
|
|
97
|
+
}),
|
|
98
|
+
/*#__PURE__*/ _jsx(Typography, {
|
|
99
|
+
variant: "body1",
|
|
100
|
+
children: description !== null && description !== void 0 ? description : defaultDescription
|
|
101
|
+
}),
|
|
102
|
+
actionsContent && /*#__PURE__*/ _jsx(Box, {
|
|
103
|
+
sx: {
|
|
104
|
+
display: 'flex',
|
|
105
|
+
gap: 2,
|
|
106
|
+
marginTop: 1,
|
|
107
|
+
justifyContent: 'center'
|
|
108
|
+
},
|
|
109
|
+
children: actionsContent
|
|
110
|
+
})
|
|
111
|
+
]
|
|
112
|
+
}),
|
|
113
|
+
additionalText && /*#__PURE__*/ _jsx(Typography, {
|
|
114
|
+
variant: "subtitle1",
|
|
115
|
+
sx: {
|
|
116
|
+
marginTop: 12
|
|
117
|
+
},
|
|
118
|
+
children: additionalText
|
|
119
|
+
})
|
|
120
|
+
]
|
|
121
|
+
});
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
//# sourceMappingURL=EmptyDashboard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/EmptyDashboard/EmptyDashboard.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 { Typography, Box } from '@mui/material';\nimport { useEditMode } from '../../context';\nimport { AddPanelButton } from '../AddPanelButton';\nimport { EditVariablesButton } from '../Variables';\nimport { EditButton } from '../EditButton';\n\nexport interface EmptyDashboardProps {\n /**\n * The title, which should be relatively short text.\n */\n title?: string;\n\n /**\n * Imagery to display above the title.\n */\n image?: React.ReactNode;\n\n /**\n * Descriptive text, which can be a bit longer.\n */\n description?: string;\n\n /**\n * Additional text that will be displayed at the bottom of the empty state.\n * If not specified, no additional text is shown.\n */\n additionalText?: string;\n\n /**\n * Components that are placed below the title and description that include\n * actions for the user to take (e.g. buttons or links). If not specified,\n * the default buttons will be displayed. Set to `false` to disable the default\n * buttons.\n */\n actions?: JSX.Element | boolean;\n\n /**\n * Handler for clicking the edit button when the dashboard is in \"view\" mode.\n * Required when using the default empty state.\n */\n onEditButtonClick?: () => void;\n}\n\nconst DEFAULT_TITLE = \"Let's get started\";\n\nconst DEFAULT_DESCRIPTION = {\n edit: 'We currently support time series charts, gauge charts, stat charts and more!',\n view: 'This dashboard is currently empty. Get started by clicking the edit button.',\n};\n\n// Constants from specifics in designs to make the default messaging look good.\nconst CONTAINER_WIDTH = '450px';\nconst PRIMARY_CONTENT_WIDTH = '289px';\n\nconst COMMON_BUTTON_PROPS = {\n variant: 'outlined',\n color: 'secondary',\n} as const;\n\ntype EmptyDashboardActionsProps = Pick<EmptyDashboardProps, 'actions' | 'onEditButtonClick'> & {\n isEditMode: boolean;\n};\n\nconst EmptyDashboardActions = ({ actions, isEditMode, onEditButtonClick }: EmptyDashboardActionsProps) => {\n if (actions && typeof actions !== 'boolean') {\n // Custom actions\n return actions;\n }\n\n if (actions === false) {\n // Disable default actions\n return null;\n }\n\n if (isEditMode) {\n // Default edit mode actions\n return (\n <>\n <AddPanelButton variant=\"outlined\" color=\"secondary\" label=\"Add Panel\" fullWidth />\n <EditVariablesButton variant=\"outlined\" color=\"secondary\" label=\"Add Variables\" fullWidth />\n </>\n );\n }\n\n if (onEditButtonClick) {\n // Default view mode actions\n return <EditButton {...COMMON_BUTTON_PROPS} label=\"Edit Dashboard\" onClick={onEditButtonClick} />;\n }\n\n return null;\n};\n\n/**\n * Communicate that a dashboard is empty and prompt the user to get started.\n */\nexport const EmptyDashboard = ({\n title = DEFAULT_TITLE,\n image,\n description,\n additionalText,\n actions,\n onEditButtonClick,\n}: EmptyDashboardProps) => {\n const { isEditMode } = useEditMode();\n\n const defaultDescription = isEditMode ? DEFAULT_DESCRIPTION.edit : DEFAULT_DESCRIPTION.view;\n const actionsContent = (\n <EmptyDashboardActions actions={actions} onEditButtonClick={onEditButtonClick} isEditMode={isEditMode} />\n );\n\n return (\n <Box sx={{ width: CONTAINER_WIDTH, textAlign: 'center', margin: '0 auto' }}>\n <Box sx={{ width: PRIMARY_CONTENT_WIDTH, margin: '0 auto' }}>\n {!!image && image}\n <Typography variant=\"h2\" gutterBottom>\n {title}\n </Typography>\n <Typography variant=\"body1\">{description ?? defaultDescription}</Typography>\n {actionsContent && (\n <Box sx={{ display: 'flex', gap: 2, marginTop: 1, justifyContent: 'center' }}>{actionsContent}</Box>\n )}\n </Box>\n {additionalText && (\n <Typography variant=\"subtitle1\" sx={{ marginTop: 12 }}>\n {additionalText}\n </Typography>\n )}\n </Box>\n );\n};\n"],"names":["Typography","Box","useEditMode","AddPanelButton","EditVariablesButton","EditButton","DEFAULT_TITLE","DEFAULT_DESCRIPTION","edit","view","CONTAINER_WIDTH","PRIMARY_CONTENT_WIDTH","COMMON_BUTTON_PROPS","variant","color","EmptyDashboardActions","actions","isEditMode","onEditButtonClick","label","fullWidth","onClick","EmptyDashboard","title","image","description","additionalText","defaultDescription","actionsContent","sx","width","textAlign","margin","gutterBottom","display","gap","marginTop","justifyContent"],"mappings":"AAAA,oCA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