@perses-dev/explore 0.48.0-rc0 → 0.49.0-rc.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.
@@ -67,7 +67,7 @@ function MetricRow({ metricName, datasource, filters, isMetadataEnabled, onExplo
67
67
  }),
68
68
  /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TableCell, {
69
69
  style: {
70
- minWidth: 'fit-content',
70
+ width: 115,
71
71
  textAlign: 'center'
72
72
  },
73
73
  children: isMetadataEnabled && isLoading ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Skeleton, {
@@ -86,14 +86,15 @@ function MetricRow({ metricName, datasource, filters, isMetadataEnabled, onExplo
86
86
  width: 180
87
87
  }) : /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
88
88
  sx: {
89
- fontStyle: (metadata === null || metadata === void 0 ? void 0 : metadata.help) ? 'initial' : 'italic'
89
+ fontStyle: (metadata === null || metadata === void 0 ? void 0 : metadata.help) ? 'initial' : 'italic',
90
+ minWidth: '30vw'
90
91
  },
91
92
  children: metadata ? metadata.help : 'unknown'
92
93
  })
93
94
  }),
94
95
  /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TableCell, {
95
96
  style: {
96
- minWidth: 'fit-content'
97
+ width: 140
97
98
  },
98
99
  children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Button, {
99
100
  "aria-label": `explore metric ${metricName}`,
@@ -44,7 +44,7 @@ export function MetricRow({ metricName, datasource, filters, isMetadataEnabled,
44
44
  }),
45
45
  /*#__PURE__*/ _jsx(TableCell, {
46
46
  style: {
47
- minWidth: 'fit-content',
47
+ width: 115,
48
48
  textAlign: 'center'
49
49
  },
50
50
  children: isMetadataEnabled && isLoading ? /*#__PURE__*/ _jsx(Skeleton, {
@@ -63,14 +63,15 @@ export function MetricRow({ metricName, datasource, filters, isMetadataEnabled,
63
63
  width: 180
64
64
  }) : /*#__PURE__*/ _jsx(Typography, {
65
65
  sx: {
66
- fontStyle: (metadata === null || metadata === void 0 ? void 0 : metadata.help) ? 'initial' : 'italic'
66
+ fontStyle: (metadata === null || metadata === void 0 ? void 0 : metadata.help) ? 'initial' : 'italic',
67
+ minWidth: '30vw'
67
68
  },
68
69
  children: metadata ? metadata.help : 'unknown'
69
70
  })
70
71
  }),
71
72
  /*#__PURE__*/ _jsx(TableCell, {
72
73
  style: {
73
- minWidth: 'fit-content'
74
+ width: 140
74
75
  },
75
76
  children: /*#__PURE__*/ _jsx(Button, {
76
77
  "aria-label": `explore metric ${metricName}`,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/components/PrometheusMetricsFinder/display/list/MetricList.tsx"],"sourcesContent":["// Copyright 2024 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 { DatasourceSelector } from '@perses-dev/core';\nimport { Button, Divider, Skeleton, Stack, StackProps, TableCell, Typography } from '@mui/material';\nimport { TableVirtuoso } from 'react-virtuoso';\nimport { Link as RouterLink } from 'react-router-dom';\nimport CompassIcon from 'mdi-material-ui/Compass';\nimport { LabelFilter } from '../../types';\nimport { useMetricMetadata } from '../../utils';\nimport { useExplorerQueryParams } from '../../../ExploreManager/query-params';\nimport { MetricChip } from '../MetricChip';\n\nexport interface MetricRowProps {\n metricName: string;\n datasource: DatasourceSelector;\n filters: LabelFilter[];\n isMetadataEnabled?: boolean;\n onExplore?: (metricName: string) => void;\n}\n\nexport function MetricRow({ metricName, datasource, filters, isMetadataEnabled, onExplore }: MetricRowProps) {\n const { metadata, isLoading } = useMetricMetadata(metricName, datasource, isMetadataEnabled);\n\n const searchParams = useExplorerQueryParams({\n data: { tab: 'finder', datasource, filters, exploredMetric: metricName },\n });\n\n return (\n <>\n <TableCell style={{ width: '300px' }}>\n <Typography sx={{ fontFamily: 'monospace' }}>{metricName}</Typography>\n </TableCell>\n\n <TableCell style={{ minWidth: 'fit-content', textAlign: 'center' }}>\n {isMetadataEnabled && isLoading ? (\n <Skeleton variant=\"rounded\" width={75} />\n ) : (\n <MetricChip label={metadata?.type ?? 'unknown'} />\n )}\n </TableCell>\n <TableCell style={{ width: '100%' }}>\n {isMetadataEnabled && isLoading ? (\n <Skeleton variant=\"text\" width={180} />\n ) : (\n <Typography sx={{ fontStyle: metadata?.help ? 'initial' : 'italic' }}>\n {metadata ? metadata.help : 'unknown'}\n </Typography>\n )}\n </TableCell>\n <TableCell style={{ minWidth: 'fit-content' }}>\n <Button\n aria-label={`explore metric ${metricName}`}\n variant=\"contained\"\n startIcon={<CompassIcon />}\n style={{ textWrap: 'nowrap' }}\n onClick={() => onExplore?.(metricName)}\n component={RouterLink}\n to={`?${searchParams}`}\n >\n Explore\n </Button>\n </TableCell>\n </>\n );\n}\n\nexport interface MetricListProps extends StackProps {\n metricNames: string[];\n datasource: DatasourceSelector;\n filters: LabelFilter[];\n isMetadataEnabled?: boolean;\n onExplore?: (metricName: string) => void;\n}\n\nexport function MetricList({\n metricNames,\n datasource,\n filters,\n isMetadataEnabled,\n onExplore,\n ...props\n}: MetricListProps) {\n return (\n <Stack gap={2} width=\"100%\" divider={<Divider orientation=\"horizontal\" flexItem />} {...props}>\n <TableVirtuoso\n style={{ height: '70vh', width: '100%' }}\n data={metricNames}\n itemContent={(_, metricName) => (\n <MetricRow\n metricName={metricName}\n datasource={datasource}\n filters={filters}\n isMetadataEnabled={isMetadataEnabled}\n onExplore={onExplore}\n />\n )}\n />\n <Stack sx={{ width: '100%' }} textAlign=\"end\">\n <Typography data-testid=\"finder-total\">\n Total: <strong>{metricNames.length}</strong> metrics\n </Typography>\n </Stack>\n </Stack>\n );\n}\n"],"names":["Button","Divider","Skeleton","Stack","TableCell","Typography","TableVirtuoso","Link","RouterLink","CompassIcon","useMetricMetadata","useExplorerQueryParams","MetricChip","MetricRow","metricName","datasource","filters","isMetadataEnabled","onExplore","metadata","isLoading","searchParams","data","tab","exploredMetric","style","width","sx","fontFamily","minWidth","textAlign","variant","label","type","fontStyle","help","aria-label","startIcon","textWrap","onClick","component","to","MetricList","metricNames","props","gap","divider","orientation","flexItem","height","itemContent","_","data-testid","strong","length"],"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,MAAM,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,KAAK,EAAcC,SAAS,EAAEC,UAAU,QAAQ,gBAAgB;AACpG,SAASC,aAAa,QAAQ,iBAAiB;AAC/C,SAASC,QAAQC,UAAU,QAAQ,mBAAmB;AACtD,OAAOC,iBAAiB,0BAA0B;AAElD,SAASC,iBAAiB,QAAQ,cAAc;AAChD,SAASC,sBAAsB,QAAQ,uCAAuC;AAC9E,SAASC,UAAU,QAAQ,gBAAgB;AAU3C,OAAO,SAASC,UAAU,EAAEC,UAAU,EAAEC,UAAU,EAAEC,OAAO,EAAEC,iBAAiB,EAAEC,SAAS,EAAkB;IACzG,MAAM,EAAEC,QAAQ,EAAEC,SAAS,EAAE,GAAGV,kBAAkBI,YAAYC,YAAYE;IAE1E,MAAMI,eAAeV,uBAAuB;QAC1CW,MAAM;YAAEC,KAAK;YAAUR;YAAYC;YAASQ,gBAAgBV;QAAW;IACzE;QAY2BK;IAV3B,qBACE;;0BACE,KAACf;gBAAUqB,OAAO;oBAAEC,OAAO;gBAAQ;0BACjC,cAAA,KAACrB;oBAAWsB,IAAI;wBAAEC,YAAY;oBAAY;8BAAId;;;0BAGhD,KAACV;gBAAUqB,OAAO;oBA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;;0BAIjB,KAACf;gBAAMwB,IAAI;oBAAED,OAAO;gBAAO;gBAAGI,WAAU;0BACtC,cAAA,MAACzB;oBAAW+C,eAAY;;wBAAe;sCAC9B,KAACC;sCAAQV,YAAYW,MAAM;;wBAAU;;;;;;AAKtD"}
1
+ {"version":3,"sources":["../../../../../src/components/PrometheusMetricsFinder/display/list/MetricList.tsx"],"sourcesContent":["// Copyright 2024 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 { DatasourceSelector } from '@perses-dev/core';\nimport { Button, Divider, Skeleton, Stack, StackProps, TableCell, Typography } from '@mui/material';\nimport { TableVirtuoso } from 'react-virtuoso';\nimport { Link as RouterLink } from 'react-router-dom';\nimport CompassIcon from 'mdi-material-ui/Compass';\nimport { LabelFilter } from '../../types';\nimport { useMetricMetadata } from '../../utils';\nimport { useExplorerQueryParams } from '../../../ExploreManager/query-params';\nimport { MetricChip } from '../MetricChip';\n\nexport interface MetricRowProps {\n metricName: string;\n datasource: DatasourceSelector;\n filters: LabelFilter[];\n isMetadataEnabled?: boolean;\n onExplore?: (metricName: string) => void;\n}\n\nexport function MetricRow({ metricName, datasource, filters, isMetadataEnabled, onExplore }: MetricRowProps) {\n const { metadata, isLoading } = useMetricMetadata(metricName, datasource, isMetadataEnabled);\n\n const searchParams = useExplorerQueryParams({\n data: { tab: 'finder', datasource, filters, exploredMetric: metricName },\n });\n\n return (\n <>\n <TableCell style={{ width: '300px' }}>\n <Typography sx={{ fontFamily: 'monospace' }}>{metricName}</Typography>\n </TableCell>\n\n <TableCell style={{ width: 115, textAlign: 'center' }}>\n {isMetadataEnabled && isLoading ? (\n <Skeleton variant=\"rounded\" width={75} />\n ) : (\n <MetricChip label={metadata?.type ?? 'unknown'} />\n )}\n </TableCell>\n <TableCell style={{ width: '100%' }}>\n {isMetadataEnabled && isLoading ? (\n <Skeleton variant=\"text\" width={180} />\n ) : (\n <Typography sx={{ fontStyle: metadata?.help ? 'initial' : 'italic', minWidth: '30vw' }}>\n {metadata ? metadata.help : 'unknown'}\n </Typography>\n )}\n </TableCell>\n <TableCell style={{ width: 140 }}>\n <Button\n aria-label={`explore metric ${metricName}`}\n variant=\"contained\"\n startIcon={<CompassIcon />}\n style={{ textWrap: 'nowrap' }}\n onClick={() => onExplore?.(metricName)}\n component={RouterLink}\n to={`?${searchParams}`}\n >\n Explore\n </Button>\n </TableCell>\n </>\n );\n}\n\nexport interface MetricListProps extends StackProps {\n metricNames: string[];\n datasource: DatasourceSelector;\n filters: LabelFilter[];\n isMetadataEnabled?: boolean;\n onExplore?: (metricName: string) => void;\n}\n\nexport function MetricList({\n metricNames,\n datasource,\n filters,\n isMetadataEnabled,\n onExplore,\n ...props\n}: MetricListProps) {\n return (\n <Stack gap={2} width=\"100%\" divider={<Divider orientation=\"horizontal\" flexItem />} {...props}>\n <TableVirtuoso\n style={{ height: '70vh', width: '100%' }}\n data={metricNames}\n itemContent={(_, metricName) => (\n <MetricRow\n metricName={metricName}\n datasource={datasource}\n filters={filters}\n isMetadataEnabled={isMetadataEnabled}\n onExplore={onExplore}\n />\n )}\n />\n <Stack sx={{ width: '100%' }} textAlign=\"end\">\n <Typography data-testid=\"finder-total\">\n Total: <strong>{metricNames.length}</strong> metrics\n </Typography>\n </Stack>\n </Stack>\n );\n}\n"],"names":["Button","Divider","Skeleton","Stack","TableCell","Typography","TableVirtuoso","Link","RouterLink","CompassIcon","useMetricMetadata","useExplorerQueryParams","MetricChip","MetricRow","metricName","datasource","filters","isMetadataEnabled","onExplore","metadata","isLoading","searchParams","data","tab","exploredMetric","style","width","sx","fontFamily","textAlign","variant","label","type","fontStyle","help","minWidth","aria-label","startIcon","textWrap","onClick","component","to","MetricList","metricNames","props","gap","divider","orientation","flexItem","height","itemContent","_","data-testid","strong","length"],"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,MAAM,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,KAAK,EAAcC,SAAS,EAAEC,UAAU,QAAQ,gBAAgB;AACpG,SAASC,aAAa,QAAQ,iBAAiB;AAC/C,SAASC,QAAQC,UAAU,QAAQ,mBAAmB;AACtD,OAAOC,iBAAiB,0BAA0B;AAElD,SAASC,iBAAiB,QAAQ,cAAc;AAChD,SAASC,sBAAsB,QAAQ,uCAAuC;AAC9E,SAASC,UAAU,QAAQ,gBAAgB;AAU3C,OAAO,SAASC,UAAU,EAAEC,UAAU,EAAEC,UAAU,EAAEC,OAAO,EAAEC,iBAAiB,EAAEC,SAAS,EAAkB;IACzG,MAAM,EAAEC,QAAQ,EAAEC,SAAS,EAAE,GAAGV,kBAAkBI,YAAYC,YAAYE;IAE1E,MAAMI,eAAeV,uBAAuB;QAC1CW,MAAM;YAAEC,KAAK;YAAUR;YAAYC;YAASQ,gBAAgBV;QAAW;IACzE;QAY2BK;IAV3B,qBACE;;0BACE,KAACf;gBAAUqB,OAAO;oBAAEC,OAAO;gBAAQ;0BACjC,cAAA,KAACrB;oBAAWsB,IAAI;wBAAEC,YAAY;oBAAY;8BAAId;;;0BAGhD,KAACV;gBAAUqB,OAAO;oBAAEC,OAAO;oBAAKG,WAAW;gBAAS;0BACjDZ,qBAAqBG,0BACpB,KAAClB;oBAAS4B,SAAQ;oBAAUJ,OAAO;mCAEnC,KAACd;oBAAWmB,OAAOZ,CAAAA,iBAAAA,qBAAAA,+BAAAA,SAAUa,IAAI,cAAdb,4BAAAA,iBAAkB;;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@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@perses-dev/explore",
3
- "version": "0.48.0-rc0",
3
+ "version": "0.49.0-rc.0",
4
4
  "description": "The explore feature in Perses",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://github.com/perses/perses/blob/main/README.md",
@@ -27,12 +27,12 @@
27
27
  "lint:fix": "eslint --fix src --ext .ts,.tsx"
28
28
  },
29
29
  "dependencies": {
30
- "@perses-dev/components": "0.48.0-rc0",
31
- "@perses-dev/core": "0.48.0-rc0",
32
- "@perses-dev/dashboards": "0.48.0-rc0",
33
- "@perses-dev/panels-plugin": "0.48.0-rc0",
34
- "@perses-dev/plugin-system": "0.48.0-rc0",
35
- "@perses-dev/prometheus-plugin": "0.48.0-rc0",
30
+ "@perses-dev/components": "0.49.0-rc.0",
31
+ "@perses-dev/core": "0.49.0-rc.0",
32
+ "@perses-dev/dashboards": "0.49.0-rc.0",
33
+ "@perses-dev/panels-plugin": "0.49.0-rc.0",
34
+ "@perses-dev/plugin-system": "0.49.0-rc.0",
35
+ "@perses-dev/prometheus-plugin": "0.49.0-rc.0",
36
36
  "@types/react-grid-layout": "^1.3.2",
37
37
  "date-fns": "^2.28.0",
38
38
  "immer": "^9.0.15",
@@ -48,8 +48,8 @@
48
48
  "zustand": "^4.3.3"
49
49
  },
50
50
  "devDependencies": {
51
- "@perses-dev/internal-utils": "0.48.0-rc0",
52
- "@perses-dev/storybook": "0.48.0-rc0",
51
+ "@perses-dev/internal-utils": "0.49.0-rc.0",
52
+ "@perses-dev/storybook": "0.49.0-rc.0",
53
53
  "history": "^5.3.0",
54
54
  "intersection-observer": "^0.12.2",
55
55
  "react-router-dom": "^6.11.0"