@backstage-community/plugin-xcmetrics 0.6.1 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/components/Accordion/Accordion.esm.js +19 -15
  3. package/dist/components/Accordion/Accordion.esm.js.map +1 -1
  4. package/dist/components/BuildDetails/BuildDetails.esm.js +93 -62
  5. package/dist/components/BuildDetails/BuildDetails.esm.js.map +1 -1
  6. package/dist/components/BuildList/BuildList.esm.js +40 -36
  7. package/dist/components/BuildList/BuildList.esm.js.map +1 -1
  8. package/dist/components/BuildListFilter/BuildListFilter.esm.js +73 -64
  9. package/dist/components/BuildListFilter/BuildListFilter.esm.js.map +1 -1
  10. package/dist/components/BuildTableColumns.esm.js +4 -4
  11. package/dist/components/BuildTableColumns.esm.js.map +1 -1
  12. package/dist/components/BuildTimeline/BuildTimeline.esm.js +26 -14
  13. package/dist/components/BuildTimeline/BuildTimeline.esm.js.map +1 -1
  14. package/dist/components/DataValue/DataValue.esm.js +6 -3
  15. package/dist/components/DataValue/DataValue.esm.js.map +1 -1
  16. package/dist/components/DatePicker/DatePicker.esm.js +14 -11
  17. package/dist/components/DatePicker/DatePicker.esm.js.map +1 -1
  18. package/dist/components/Overview/Overview.esm.js +27 -18
  19. package/dist/components/Overview/Overview.esm.js.map +1 -1
  20. package/dist/components/OverviewTrends/OverviewTrends.esm.js +86 -67
  21. package/dist/components/OverviewTrends/OverviewTrends.esm.js.map +1 -1
  22. package/dist/components/PreformattedText/PreformattedText.esm.js +43 -31
  23. package/dist/components/PreformattedText/PreformattedText.esm.js.map +1 -1
  24. package/dist/components/StatusCell/StatusCell.esm.js +29 -16
  25. package/dist/components/StatusCell/StatusCell.esm.js.map +1 -1
  26. package/dist/components/StatusIcon/StatusIcon.esm.js +5 -5
  27. package/dist/components/StatusIcon/StatusIcon.esm.js.map +1 -1
  28. package/dist/components/StatusMatrix/StatusMatrix.esm.js +19 -17
  29. package/dist/components/StatusMatrix/StatusMatrix.esm.js.map +1 -1
  30. package/dist/components/Trend/Trend.esm.js +13 -10
  31. package/dist/components/Trend/Trend.esm.js.map +1 -1
  32. package/dist/components/XcmetricsLayout/XcmetricsLayout.esm.js +10 -4
  33. package/dist/components/XcmetricsLayout/XcmetricsLayout.esm.js.map +1 -1
  34. package/dist/index.d.ts +2 -3
  35. package/package.json +13 -6
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @backstage-community/plugin-xcmetrics
2
2
 
3
+ ## 0.8.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 2ce0f11: Backstage version bump to v1.39.0
8
+
9
+ ## 0.7.0
10
+
11
+ ### Minor Changes
12
+
13
+ - 00180f7: Backstage version bump to v1.38.1
14
+
3
15
  ## 0.6.1
4
16
 
5
17
  ### Patch Changes
@@ -1,9 +1,9 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
1
2
  import MuiAccordion from '@material-ui/core/Accordion';
2
3
  import MuiAccordionSummary from '@material-ui/core/AccordionSummary';
3
4
  import Typography from '@material-ui/core/Typography';
4
5
  import AccordionDetails from '@material-ui/core/AccordionDetails';
5
6
  import { makeStyles, createStyles } from '@material-ui/core/styles';
6
- import React from 'react';
7
7
  import ExpandMoreIcon from '@material-ui/icons/ExpandMore';
8
8
 
9
9
  const useStyles = makeStyles(
@@ -19,23 +19,27 @@ const useStyles = makeStyles(
19
19
  );
20
20
  const Accordion = (props) => {
21
21
  const classes = useStyles();
22
- return /* @__PURE__ */ React.createElement(
22
+ return /* @__PURE__ */ jsxs(
23
23
  MuiAccordion,
24
24
  {
25
25
  disabled: props.disabled,
26
- TransitionProps: { unmountOnExit: props.unmountOnExit ?? false }
27
- },
28
- /* @__PURE__ */ React.createElement(
29
- MuiAccordionSummary,
30
- {
31
- expandIcon: /* @__PURE__ */ React.createElement(ExpandMoreIcon, null),
32
- "aria-controls": `${props.id}-content`,
33
- id: `${props.id}-header`
34
- },
35
- /* @__PURE__ */ React.createElement(Typography, { className: classes.heading }, props.heading),
36
- /* @__PURE__ */ React.createElement(Typography, { className: classes.secondaryHeading }, props.secondaryHeading)
37
- ),
38
- /* @__PURE__ */ React.createElement(AccordionDetails, null, props.children)
26
+ TransitionProps: { unmountOnExit: props.unmountOnExit ?? false },
27
+ children: [
28
+ /* @__PURE__ */ jsxs(
29
+ MuiAccordionSummary,
30
+ {
31
+ expandIcon: /* @__PURE__ */ jsx(ExpandMoreIcon, {}),
32
+ "aria-controls": `${props.id}-content`,
33
+ id: `${props.id}-header`,
34
+ children: [
35
+ /* @__PURE__ */ jsx(Typography, { className: classes.heading, children: props.heading }),
36
+ /* @__PURE__ */ jsx(Typography, { className: classes.secondaryHeading, children: props.secondaryHeading })
37
+ ]
38
+ }
39
+ ),
40
+ /* @__PURE__ */ jsx(AccordionDetails, { children: props.children })
41
+ ]
42
+ }
39
43
  );
40
44
  };
41
45
 
@@ -1 +1 @@
1
- {"version":3,"file":"Accordion.esm.js","sources":["../../../src/components/Accordion/Accordion.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\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 */\n\nimport MuiAccordion from '@material-ui/core/Accordion';\nimport MuiAccordionSummary from '@material-ui/core/AccordionSummary';\nimport Typography from '@material-ui/core/Typography';\nimport AccordionDetails from '@material-ui/core/AccordionDetails';\nimport { makeStyles, createStyles } from '@material-ui/core/styles';\nimport React, { PropsWithChildren } from 'react';\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\n\nconst useStyles = makeStyles(theme =>\n createStyles({\n heading: {\n flexBasis: '33.33%',\n flexShrink: 0,\n },\n secondaryHeading: {\n color: theme.palette.text.secondary,\n },\n }),\n);\n\ninterface AccordionProps {\n id: string;\n heading: string;\n secondaryHeading?: string | number;\n disabled?: boolean;\n unmountOnExit?: boolean;\n}\n\nexport const Accordion = (props: PropsWithChildren<AccordionProps>) => {\n const classes = useStyles();\n\n return (\n <MuiAccordion\n disabled={props.disabled}\n TransitionProps={{ unmountOnExit: props.unmountOnExit ?? false }}\n >\n <MuiAccordionSummary\n expandIcon={<ExpandMoreIcon />}\n aria-controls={`${props.id}-content`}\n id={`${props.id}-header`}\n >\n <Typography className={classes.heading}>{props.heading}</Typography>\n <Typography className={classes.secondaryHeading}>\n {props.secondaryHeading}\n </Typography>\n </MuiAccordionSummary>\n <AccordionDetails>{props.children}</AccordionDetails>\n </MuiAccordion>\n );\n};\n"],"names":[],"mappings":";;;;;;;;AAwBA,MAAM,SAAY,GAAA,UAAA;AAAA,EAAW,WAC3B,YAAa,CAAA;AAAA,IACX,OAAS,EAAA;AAAA,MACP,SAAW,EAAA,QAAA;AAAA,MACX,UAAY,EAAA;AAAA,KACd;AAAA,IACA,gBAAkB,EAAA;AAAA,MAChB,KAAA,EAAO,KAAM,CAAA,OAAA,CAAQ,IAAK,CAAA;AAAA;AAC5B,GACD;AACH,CAAA;AAUa,MAAA,SAAA,GAAY,CAAC,KAA6C,KAAA;AACrE,EAAA,MAAM,UAAU,SAAU,EAAA;AAE1B,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,YAAA;AAAA,IAAA;AAAA,MACC,UAAU,KAAM,CAAA,QAAA;AAAA,MAChB,eAAiB,EAAA,EAAE,aAAe,EAAA,KAAA,CAAM,iBAAiB,KAAM;AAAA,KAAA;AAAA,oBAE/D,KAAA,CAAA,aAAA;AAAA,MAAC,mBAAA;AAAA,MAAA;AAAA,QACC,UAAA,sCAAa,cAAe,EAAA,IAAA,CAAA;AAAA,QAC5B,eAAA,EAAe,CAAG,EAAA,KAAA,CAAM,EAAE,CAAA,QAAA,CAAA;AAAA,QAC1B,EAAA,EAAI,CAAG,EAAA,KAAA,CAAM,EAAE,CAAA,OAAA;AAAA,OAAA;AAAA,0CAEd,UAAW,EAAA,EAAA,SAAA,EAAW,OAAQ,CAAA,OAAA,EAAA,EAAU,MAAM,OAAQ,CAAA;AAAA,0CACtD,UAAW,EAAA,EAAA,SAAA,EAAW,OAAQ,CAAA,gBAAA,EAAA,EAC5B,MAAM,gBACT;AAAA,KACF;AAAA,oBACA,KAAA,CAAA,aAAA,CAAC,gBAAkB,EAAA,IAAA,EAAA,KAAA,CAAM,QAAS;AAAA,GACpC;AAEJ;;;;"}
1
+ {"version":3,"file":"Accordion.esm.js","sources":["../../../src/components/Accordion/Accordion.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\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 */\n\nimport MuiAccordion from '@material-ui/core/Accordion';\nimport MuiAccordionSummary from '@material-ui/core/AccordionSummary';\nimport Typography from '@material-ui/core/Typography';\nimport AccordionDetails from '@material-ui/core/AccordionDetails';\nimport { makeStyles, createStyles } from '@material-ui/core/styles';\nimport { PropsWithChildren } from 'react';\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\n\nconst useStyles = makeStyles(theme =>\n createStyles({\n heading: {\n flexBasis: '33.33%',\n flexShrink: 0,\n },\n secondaryHeading: {\n color: theme.palette.text.secondary,\n },\n }),\n);\n\ninterface AccordionProps {\n id: string;\n heading: string;\n secondaryHeading?: string | number;\n disabled?: boolean;\n unmountOnExit?: boolean;\n}\n\nexport const Accordion = (props: PropsWithChildren<AccordionProps>) => {\n const classes = useStyles();\n\n return (\n <MuiAccordion\n disabled={props.disabled}\n TransitionProps={{ unmountOnExit: props.unmountOnExit ?? false }}\n >\n <MuiAccordionSummary\n expandIcon={<ExpandMoreIcon />}\n aria-controls={`${props.id}-content`}\n id={`${props.id}-header`}\n >\n <Typography className={classes.heading}>{props.heading}</Typography>\n <Typography className={classes.secondaryHeading}>\n {props.secondaryHeading}\n </Typography>\n </MuiAccordionSummary>\n <AccordionDetails>{props.children}</AccordionDetails>\n </MuiAccordion>\n );\n};\n"],"names":[],"mappings":";;;;;;;;AAwBA,MAAM,SAAY,GAAA,UAAA;AAAA,EAAW,WAC3B,YAAa,CAAA;AAAA,IACX,OAAS,EAAA;AAAA,MACP,SAAW,EAAA,QAAA;AAAA,MACX,UAAY,EAAA;AAAA,KACd;AAAA,IACA,gBAAkB,EAAA;AAAA,MAChB,KAAA,EAAO,KAAM,CAAA,OAAA,CAAQ,IAAK,CAAA;AAAA;AAC5B,GACD;AACH,CAAA;AAUa,MAAA,SAAA,GAAY,CAAC,KAA6C,KAAA;AACrE,EAAA,MAAM,UAAU,SAAU,EAAA;AAE1B,EACE,uBAAA,IAAA;AAAA,IAAC,YAAA;AAAA,IAAA;AAAA,MACC,UAAU,KAAM,CAAA,QAAA;AAAA,MAChB,eAAiB,EAAA,EAAE,aAAe,EAAA,KAAA,CAAM,iBAAiB,KAAM,EAAA;AAAA,MAE/D,QAAA,EAAA;AAAA,wBAAA,IAAA;AAAA,UAAC,mBAAA;AAAA,UAAA;AAAA,YACC,UAAA,sBAAa,cAAe,EAAA,EAAA,CAAA;AAAA,YAC5B,eAAA,EAAe,CAAG,EAAA,KAAA,CAAM,EAAE,CAAA,QAAA,CAAA;AAAA,YAC1B,EAAA,EAAI,CAAG,EAAA,KAAA,CAAM,EAAE,CAAA,OAAA,CAAA;AAAA,YAEf,QAAA,EAAA;AAAA,8BAAA,GAAA,CAAC,UAAW,EAAA,EAAA,SAAA,EAAW,OAAQ,CAAA,OAAA,EAAU,gBAAM,OAAQ,EAAA,CAAA;AAAA,kCACtD,UAAW,EAAA,EAAA,SAAA,EAAW,OAAQ,CAAA,gBAAA,EAC5B,gBAAM,gBACT,EAAA;AAAA;AAAA;AAAA,SACF;AAAA,wBACA,GAAA,CAAC,gBAAkB,EAAA,EAAA,QAAA,EAAA,KAAA,CAAM,QAAS,EAAA;AAAA;AAAA;AAAA,GACpC;AAEJ;;;;"}
@@ -1,7 +1,7 @@
1
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
1
2
  import Divider from '@material-ui/core/Divider';
2
3
  import Grid from '@material-ui/core/Grid';
3
4
  import { makeStyles, createStyles } from '@material-ui/core/styles';
4
- import React from 'react';
5
5
  import { xcmetricsApiRef } from '../../api/types.esm.js';
6
6
  import '@backstage/errors';
7
7
  import 'luxon';
@@ -53,68 +53,96 @@ const BuildDetails = ({
53
53
  "started at": formatTime(build.startTimestamp),
54
54
  "ended at": formatTime(build.endTimestamp),
55
55
  duration: formatDuration(build.duration),
56
- status: /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(StatusIcon, { buildStatus: build.buildStatus }), formatStatus(build.buildStatus)),
56
+ status: /* @__PURE__ */ jsxs(Fragment, { children: [
57
+ /* @__PURE__ */ jsx(StatusIcon, { buildStatus: build.buildStatus }),
58
+ formatStatus(build.buildStatus)
59
+ ] }),
57
60
  xcode: xcode ? `${xcode.version} (${xcode.buildNumber})` : "Unknown",
58
61
  CI: build.isCi
59
62
  };
60
- return /* @__PURE__ */ React.createElement(Grid, { container: true, item: true, direction: "row" }, /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 4 }, /* @__PURE__ */ React.createElement(
61
- StructuredMetadataTable,
62
- {
63
- metadata: showId === false ? buildDetails : { id: build.id, ...buildDetails }
64
- }
65
- )), /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 8 }, /* @__PURE__ */ React.createElement(
66
- Accordion,
67
- {
68
- id: "buildHost",
69
- heading: "Host",
70
- secondaryHeading: build.machineName
71
- },
72
- hostResult.loading && /* @__PURE__ */ React.createElement(Progress, null),
73
- !hostResult.loading && hostResult.value && /* @__PURE__ */ React.createElement(StructuredMetadataTable, { metadata: hostResult.value })
74
- ), /* @__PURE__ */ React.createElement(
75
- Accordion,
76
- {
77
- id: "buildErrors",
78
- heading: "Errors",
79
- secondaryHeading: build.errorCount,
80
- disabled: build.errorCount === 0
81
- },
82
- /* @__PURE__ */ React.createElement("div", null, errorsResult.loading && /* @__PURE__ */ React.createElement(Progress, null), !errorsResult.loading && errorsResult.value?.map((error, idx) => /* @__PURE__ */ React.createElement("div", { key: error.id }, /* @__PURE__ */ React.createElement(
83
- PreformattedText,
84
- {
85
- title: "Error Details",
86
- text: error.detail,
87
- maxChars: 190,
88
- expandable: true
89
- }
90
- ), idx !== errorsResult.value.length - 1 && /* @__PURE__ */ React.createElement(Divider, { className: classes.divider }))))
91
- ), /* @__PURE__ */ React.createElement(
92
- Accordion,
93
- {
94
- id: "buildWarnings",
95
- heading: "Warnings",
96
- secondaryHeading: build.warningCount,
97
- disabled: build.warningCount === 0
98
- },
99
- /* @__PURE__ */ React.createElement("div", null, warningsResult.loading && /* @__PURE__ */ React.createElement(Progress, null), !warningsResult.loading && warningsResult.value?.map((warning, idx) => /* @__PURE__ */ React.createElement("div", { key: warning.id }, /* @__PURE__ */ React.createElement(
100
- PreformattedText,
63
+ return /* @__PURE__ */ jsxs(Grid, { container: true, item: true, direction: "row", children: [
64
+ /* @__PURE__ */ jsx(Grid, { item: true, xs: 4, children: /* @__PURE__ */ jsx(
65
+ StructuredMetadataTable,
101
66
  {
102
- title: "Warning Details",
103
- text: warning.detail ?? warning.title,
104
- maxChars: 190,
105
- expandable: true
67
+ metadata: showId === false ? buildDetails : { id: build.id, ...buildDetails }
106
68
  }
107
- ), idx !== warningsResult.value.length - 1 && /* @__PURE__ */ React.createElement(Divider, { className: classes.divider }))))
108
- ), /* @__PURE__ */ React.createElement(
109
- Accordion,
110
- {
111
- id: "buildMetadata",
112
- heading: "Metadata",
113
- disabled: !metadataResult.loading && !metadataResult.value
114
- },
115
- metadataResult.loading && /* @__PURE__ */ React.createElement(Progress, null),
116
- !metadataResult.loading && metadataResult.value && /* @__PURE__ */ React.createElement(StructuredMetadataTable, { metadata: metadataResult.value })
117
- ), /* @__PURE__ */ React.createElement(Accordion, { id: "buildTimeline", heading: "Timeline", unmountOnExit: true }, /* @__PURE__ */ React.createElement(BuildTimeline, { targets }))));
69
+ ) }),
70
+ /* @__PURE__ */ jsxs(Grid, { item: true, xs: 8, children: [
71
+ /* @__PURE__ */ jsxs(
72
+ Accordion,
73
+ {
74
+ id: "buildHost",
75
+ heading: "Host",
76
+ secondaryHeading: build.machineName,
77
+ children: [
78
+ hostResult.loading && /* @__PURE__ */ jsx(Progress, {}),
79
+ !hostResult.loading && hostResult.value && /* @__PURE__ */ jsx(StructuredMetadataTable, { metadata: hostResult.value })
80
+ ]
81
+ }
82
+ ),
83
+ /* @__PURE__ */ jsx(
84
+ Accordion,
85
+ {
86
+ id: "buildErrors",
87
+ heading: "Errors",
88
+ secondaryHeading: build.errorCount,
89
+ disabled: build.errorCount === 0,
90
+ children: /* @__PURE__ */ jsxs("div", { children: [
91
+ errorsResult.loading && /* @__PURE__ */ jsx(Progress, {}),
92
+ !errorsResult.loading && errorsResult.value?.map((error, idx) => /* @__PURE__ */ jsxs("div", { children: [
93
+ /* @__PURE__ */ jsx(
94
+ PreformattedText,
95
+ {
96
+ title: "Error Details",
97
+ text: error.detail,
98
+ maxChars: 190,
99
+ expandable: true
100
+ }
101
+ ),
102
+ idx !== errorsResult.value.length - 1 && /* @__PURE__ */ jsx(Divider, { className: classes.divider })
103
+ ] }, error.id))
104
+ ] })
105
+ }
106
+ ),
107
+ /* @__PURE__ */ jsx(
108
+ Accordion,
109
+ {
110
+ id: "buildWarnings",
111
+ heading: "Warnings",
112
+ secondaryHeading: build.warningCount,
113
+ disabled: build.warningCount === 0,
114
+ children: /* @__PURE__ */ jsxs("div", { children: [
115
+ warningsResult.loading && /* @__PURE__ */ jsx(Progress, {}),
116
+ !warningsResult.loading && warningsResult.value?.map((warning, idx) => /* @__PURE__ */ jsxs("div", { children: [
117
+ /* @__PURE__ */ jsx(
118
+ PreformattedText,
119
+ {
120
+ title: "Warning Details",
121
+ text: warning.detail ?? warning.title,
122
+ maxChars: 190,
123
+ expandable: true
124
+ }
125
+ ),
126
+ idx !== warningsResult.value.length - 1 && /* @__PURE__ */ jsx(Divider, { className: classes.divider })
127
+ ] }, warning.id))
128
+ ] })
129
+ }
130
+ ),
131
+ /* @__PURE__ */ jsxs(
132
+ Accordion,
133
+ {
134
+ id: "buildMetadata",
135
+ heading: "Metadata",
136
+ disabled: !metadataResult.loading && !metadataResult.value,
137
+ children: [
138
+ metadataResult.loading && /* @__PURE__ */ jsx(Progress, {}),
139
+ !metadataResult.loading && metadataResult.value && /* @__PURE__ */ jsx(StructuredMetadataTable, { metadata: metadataResult.value })
140
+ ]
141
+ }
142
+ ),
143
+ /* @__PURE__ */ jsx(Accordion, { id: "buildTimeline", heading: "Timeline", unmountOnExit: true, children: /* @__PURE__ */ jsx(BuildTimeline, { targets }) })
144
+ ] })
145
+ ] });
118
146
  };
119
147
  const withRequest = (Component) => ({ buildId, ...props }) => {
120
148
  const client = useApi(xcmetricsApiRef);
@@ -124,15 +152,18 @@ const withRequest = (Component) => ({ buildId, ...props }) => {
124
152
  error
125
153
  } = useAsync(async () => client.getBuild(buildId), []);
126
154
  if (loading) {
127
- return /* @__PURE__ */ React.createElement(Progress, null);
155
+ return /* @__PURE__ */ jsx(Progress, {});
128
156
  }
129
157
  if (error) {
130
- return /* @__PURE__ */ React.createElement(Alert, { severity: "error" }, error.message);
158
+ return /* @__PURE__ */ jsx(Alert, { severity: "error", children: error.message });
131
159
  }
132
160
  if (!buildResponse) {
133
- return /* @__PURE__ */ React.createElement(Alert, { severity: "error" }, "Could not load build ", buildId);
161
+ return /* @__PURE__ */ jsxs(Alert, { severity: "error", children: [
162
+ "Could not load build ",
163
+ buildId
164
+ ] });
134
165
  }
135
- return /* @__PURE__ */ React.createElement(Component, { ...props, buildData: buildResponse });
166
+ return /* @__PURE__ */ jsx(Component, { ...props, buildData: buildResponse });
136
167
  };
137
168
 
138
169
  export { BuildDetails, withRequest };
@@ -1 +1 @@
1
- {"version":3,"file":"BuildDetails.esm.js","sources":["../../../src/components/BuildDetails/BuildDetails.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\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 */\n\nimport Divider from '@material-ui/core/Divider';\nimport Grid from '@material-ui/core/Grid';\nimport { createStyles, makeStyles } from '@material-ui/core/styles';\nimport React from 'react';\nimport { BuildResponse, xcmetricsApiRef } from '../../api';\nimport { Progress, StructuredMetadataTable } from '@backstage/core-components';\nimport Alert from '@material-ui/lab/Alert';\nimport useAsync from 'react-use/esm/useAsync';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { formatDuration, formatStatus, formatTime } from '../../utils';\nimport { StatusIcon } from '../StatusIcon';\nimport { Accordion } from '../Accordion';\nimport { BuildTimeline } from '../BuildTimeline';\nimport { PreformattedText } from '../PreformattedText';\n\nconst useStyles = makeStyles(theme =>\n createStyles({\n divider: {\n marginTop: theme.spacing(2),\n marginBottom: theme.spacing(2),\n },\n }),\n);\n\ninterface BuildDetailsProps {\n buildData: BuildResponse;\n showId?: boolean;\n}\n\nexport const BuildDetails = ({\n buildData: { build, targets, xcode },\n showId,\n}: BuildDetailsProps) => {\n const classes = useStyles();\n const client = useApi(xcmetricsApiRef);\n const hostResult = useAsync(\n async () => client.getBuildHost(build.id),\n [build.id],\n );\n const errorsResult = useAsync(\n async () => client.getBuildErrors(build.id),\n [build.id],\n );\n const warningsResult = useAsync(\n async () => client.getBuildWarnings(build.id),\n [build.id],\n );\n const metadataResult = useAsync(\n async () => client.getBuildMetadata(build.id),\n [build.id],\n );\n\n const buildDetails = {\n project: build.projectName,\n schema: build.schema,\n category: build.category,\n userId: build.userid,\n 'started at': formatTime(build.startTimestamp),\n 'ended at': formatTime(build.endTimestamp),\n duration: formatDuration(build.duration),\n status: (\n <>\n <StatusIcon buildStatus={build.buildStatus} />\n {formatStatus(build.buildStatus)}\n </>\n ),\n xcode: xcode ? `${xcode.version} (${xcode.buildNumber})` : 'Unknown',\n CI: build.isCi,\n };\n\n return (\n <Grid container item direction=\"row\">\n <Grid item xs={4}>\n <StructuredMetadataTable\n metadata={\n showId === false ? buildDetails : { id: build.id, ...buildDetails }\n }\n />\n </Grid>\n <Grid item xs={8}>\n <Accordion\n id=\"buildHost\"\n heading=\"Host\"\n secondaryHeading={build.machineName}\n >\n {hostResult.loading && <Progress />}\n {!hostResult.loading && hostResult.value && (\n <StructuredMetadataTable metadata={hostResult.value} />\n )}\n </Accordion>\n\n <Accordion\n id=\"buildErrors\"\n heading=\"Errors\"\n secondaryHeading={build.errorCount}\n disabled={build.errorCount === 0}\n >\n <div>\n {errorsResult.loading && <Progress />}\n {!errorsResult.loading &&\n errorsResult.value?.map((error, idx) => (\n <div key={error.id}>\n <PreformattedText\n title=\"Error Details\"\n text={error.detail}\n maxChars={190}\n expandable\n />\n {idx !== errorsResult.value.length - 1 && (\n <Divider className={classes.divider} />\n )}\n </div>\n ))}\n </div>\n </Accordion>\n\n <Accordion\n id=\"buildWarnings\"\n heading=\"Warnings\"\n secondaryHeading={build.warningCount}\n disabled={build.warningCount === 0}\n >\n <div>\n {warningsResult.loading && <Progress />}\n {!warningsResult.loading &&\n warningsResult.value?.map((warning, idx) => (\n <div key={warning.id}>\n <PreformattedText\n title=\"Warning Details\"\n text={warning.detail ?? warning.title}\n maxChars={190}\n expandable\n />\n {idx !== warningsResult.value.length - 1 && (\n <Divider className={classes.divider} />\n )}\n </div>\n ))}\n </div>\n </Accordion>\n\n <Accordion\n id=\"buildMetadata\"\n heading=\"Metadata\"\n disabled={!metadataResult.loading && !metadataResult.value}\n >\n {metadataResult.loading && <Progress />}\n {!metadataResult.loading && metadataResult.value && (\n <StructuredMetadataTable metadata={metadataResult.value} />\n )}\n </Accordion>\n\n <Accordion id=\"buildTimeline\" heading=\"Timeline\" unmountOnExit>\n <BuildTimeline targets={targets} />\n </Accordion>\n </Grid>\n </Grid>\n );\n};\n\ntype WithRequestProps = Omit<BuildDetailsProps, 'buildData'> & {\n buildId: string;\n};\n\nexport const withRequest =\n (Component: typeof BuildDetails) =>\n ({ buildId, ...props }: WithRequestProps) => {\n const client = useApi(xcmetricsApiRef);\n const {\n value: buildResponse,\n loading,\n error,\n } = useAsync(async () => client.getBuild(buildId), []);\n\n if (loading) {\n return <Progress />;\n }\n\n if (error) {\n return <Alert severity=\"error\">{error.message}</Alert>;\n }\n\n if (!buildResponse) {\n return <Alert severity=\"error\">Could not load build {buildId}</Alert>;\n }\n\n return <Component {...props} buildData={buildResponse} />;\n };\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AA+BA,MAAM,SAAY,GAAA,UAAA;AAAA,EAAW,WAC3B,YAAa,CAAA;AAAA,IACX,OAAS,EAAA;AAAA,MACP,SAAA,EAAW,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,MAC1B,YAAA,EAAc,KAAM,CAAA,OAAA,CAAQ,CAAC;AAAA;AAC/B,GACD;AACH,CAAA;AAOO,MAAM,eAAe,CAAC;AAAA,EAC3B,SAAW,EAAA,EAAE,KAAO,EAAA,OAAA,EAAS,KAAM,EAAA;AAAA,EACnC;AACF,CAAyB,KAAA;AACvB,EAAA,MAAM,UAAU,SAAU,EAAA;AAC1B,EAAM,MAAA,MAAA,GAAS,OAAO,eAAe,CAAA;AACrC,EAAA,MAAM,UAAa,G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,KAAA,EAAA,EAAM,QAAS,EAAA,OAAA,EAAA,EAAS,MAAM,OAAQ,CAAA;AAAA;AAGhD,EAAA,IAAI,CAAC,aAAe,EAAA;AAClB,IAAA,uBAAQ,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAM,QAAS,EAAA,OAAA,EAAA,EAAQ,yBAAsB,OAAQ,CAAA;AAAA;AAG/D,EAAA,uBAAQ,KAAA,CAAA,aAAA,CAAA,SAAA,EAAA,EAAW,GAAG,KAAA,EAAO,WAAW,aAAe,EAAA,CAAA;AACzD;;;;"}
1
+ {"version":3,"file":"BuildDetails.esm.js","sources":["../../../src/components/BuildDetails/BuildDetails.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\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 */\n\nimport Divider from '@material-ui/core/Divider';\nimport Grid from '@material-ui/core/Grid';\nimport { createStyles, makeStyles } from '@material-ui/core/styles';\nimport { BuildResponse, xcmetricsApiRef } from '../../api';\nimport { Progress, StructuredMetadataTable } from '@backstage/core-components';\nimport Alert from '@material-ui/lab/Alert';\nimport useAsync from 'react-use/esm/useAsync';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { formatDuration, formatStatus, formatTime } from '../../utils';\nimport { StatusIcon } from '../StatusIcon';\nimport { Accordion } from '../Accordion';\nimport { BuildTimeline } from '../BuildTimeline';\nimport { PreformattedText } from '../PreformattedText';\n\nconst useStyles = makeStyles(theme =>\n createStyles({\n divider: {\n marginTop: theme.spacing(2),\n marginBottom: theme.spacing(2),\n },\n }),\n);\n\ninterface BuildDetailsProps {\n buildData: BuildResponse;\n showId?: boolean;\n}\n\nexport const BuildDetails = ({\n buildData: { build, targets, xcode },\n showId,\n}: BuildDetailsProps) => {\n const classes = useStyles();\n const client = useApi(xcmetricsApiRef);\n const hostResult = useAsync(\n async () => client.getBuildHost(build.id),\n [build.id],\n );\n const errorsResult = useAsync(\n async () => client.getBuildErrors(build.id),\n [build.id],\n );\n const warningsResult = useAsync(\n async () => client.getBuildWarnings(build.id),\n [build.id],\n );\n const metadataResult = useAsync(\n async () => client.getBuildMetadata(build.id),\n [build.id],\n );\n\n const buildDetails = {\n project: build.projectName,\n schema: build.schema,\n category: build.category,\n userId: build.userid,\n 'started at': formatTime(build.startTimestamp),\n 'ended at': formatTime(build.endTimestamp),\n duration: formatDuration(build.duration),\n status: (\n <>\n <StatusIcon buildStatus={build.buildStatus} />\n {formatStatus(build.buildStatus)}\n </>\n ),\n xcode: xcode ? `${xcode.version} (${xcode.buildNumber})` : 'Unknown',\n CI: build.isCi,\n };\n\n return (\n <Grid container item direction=\"row\">\n <Grid item xs={4}>\n <StructuredMetadataTable\n metadata={\n showId === false ? buildDetails : { id: build.id, ...buildDetails }\n }\n />\n </Grid>\n <Grid item xs={8}>\n <Accordion\n id=\"buildHost\"\n heading=\"Host\"\n secondaryHeading={build.machineName}\n >\n {hostResult.loading && <Progress />}\n {!hostResult.loading && hostResult.value && (\n <StructuredMetadataTable metadata={hostResult.value} />\n )}\n </Accordion>\n\n <Accordion\n id=\"buildErrors\"\n heading=\"Errors\"\n secondaryHeading={build.errorCount}\n disabled={build.errorCount === 0}\n >\n <div>\n {errorsResult.loading && <Progress />}\n {!errorsResult.loading &&\n errorsResult.value?.map((error, idx) => (\n <div key={error.id}>\n <PreformattedText\n title=\"Error Details\"\n text={error.detail}\n maxChars={190}\n expandable\n />\n {idx !== errorsResult.value.length - 1 && (\n <Divider className={classes.divider} />\n )}\n </div>\n ))}\n </div>\n </Accordion>\n\n <Accordion\n id=\"buildWarnings\"\n heading=\"Warnings\"\n secondaryHeading={build.warningCount}\n disabled={build.warningCount === 0}\n >\n <div>\n {warningsResult.loading && <Progress />}\n {!warningsResult.loading &&\n warningsResult.value?.map((warning, idx) => (\n <div key={warning.id}>\n <PreformattedText\n title=\"Warning Details\"\n text={warning.detail ?? warning.title}\n maxChars={190}\n expandable\n />\n {idx !== warningsResult.value.length - 1 && (\n <Divider className={classes.divider} />\n )}\n </div>\n ))}\n </div>\n </Accordion>\n\n <Accordion\n id=\"buildMetadata\"\n heading=\"Metadata\"\n disabled={!metadataResult.loading && !metadataResult.value}\n >\n {metadataResult.loading && <Progress />}\n {!metadataResult.loading && metadataResult.value && (\n <StructuredMetadataTable metadata={metadataResult.value} />\n )}\n </Accordion>\n\n <Accordion id=\"buildTimeline\" heading=\"Timeline\" unmountOnExit>\n <BuildTimeline targets={targets} />\n </Accordion>\n </Grid>\n </Grid>\n );\n};\n\ntype WithRequestProps = Omit<BuildDetailsProps, 'buildData'> & {\n buildId: string;\n};\n\nexport const withRequest =\n (Component: typeof BuildDetails) =>\n ({ buildId, ...props }: WithRequestProps) => {\n const client = useApi(xcmetricsApiRef);\n const {\n value: buildResponse,\n loading,\n error,\n } = useAsync(async () => client.getBuild(buildId), []);\n\n if (loading) {\n return <Progress />;\n }\n\n if (error) {\n return <Alert severity=\"error\">{error.message}</Alert>;\n }\n\n if (!buildResponse) {\n return <Alert severity=\"error\">Could not load build {buildId}</Alert>;\n }\n\n return <Component {...props} buildData={buildResponse} />;\n };\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AA8BA,MAAM,SAAY,GAAA,UAAA;AAAA,EAAW,WAC3B,YAAa,CAAA;AAAA,IACX,OAAS,EAAA;AAAA,MACP,SAAA,EAAW,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,MAC1B,YAAA,EAAc,KAAM,CAAA,OAAA,CAAQ,CAAC;AAAA;AAC/B,GACD;AACH,CAAA;AAOO,MAAM,eAAe,CAAC;AAAA,EAC3B,SAAW,EAAA,EAAE,KAAO,EAAA,OAAA,EAAS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AAI,SAAS,YAAY,MAAA,CAAO,SAAS,OAAO,CAAA,EAAG,EAAE,CAAA;AAErD,EAAA,IAAI,OAAS,EAAA;AACX,IAAA,2BAAQ,QAAS,EAAA,EAAA,CAAA;AAAA;AAGnB,EAAA,IAAI,KAAO,EAAA;AACT,IAAA,uBAAQ,GAAA,CAAA,KAAA,EAAA,EAAM,QAAS,EAAA,OAAA,EAAS,gBAAM,OAAQ,EAAA,CAAA;AAAA;AAGhD,EAAA,IAAI,CAAC,aAAe,EAAA;AAClB,IAAO,uBAAA,IAAA,CAAC,KAAM,EAAA,EAAA,QAAA,EAAS,OAAQ,EAAA,QAAA,EAAA;AAAA,MAAA,uBAAA;AAAA,MAAsB;AAAA,KAAQ,EAAA,CAAA;AAAA;AAG/D,EAAA,uBAAQ,GAAA,CAAA,SAAA,EAAA,EAAW,GAAG,KAAA,EAAO,WAAW,aAAe,EAAA,CAAA;AACzD;;;;"}
@@ -1,4 +1,5 @@
1
- import React, { useRef, useState } from 'react';
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { useRef, useState } from 'react';
2
3
  import { Table } from '@backstage/core-components';
3
4
  import { useApi } from '@backstage/core-plugin-api';
4
5
  import { xcmetricsApiRef } from '../../api/types.esm.js';
@@ -31,42 +32,45 @@ const BuildList = () => {
31
32
  setFilters(values);
32
33
  tableRef.current?.onQueryChange();
33
34
  };
34
- return /* @__PURE__ */ React.createElement(Grid, { container: true, spacing: 3, direction: "column" }, /* @__PURE__ */ React.createElement(
35
- BuildListFilter,
36
- {
37
- onFilterChange: handleFilterChange,
38
- initialValues: initialFilters
39
- }
40
- ), /* @__PURE__ */ React.createElement(
41
- Table,
42
- {
43
- title: "Builds",
44
- columns: buildPageColumns,
45
- options: { paging: true, sorting: false, search: false, pageSize: 10 },
46
- tableRef,
47
- data: (query) => {
48
- return new Promise((resolve, reject) => {
49
- if (!query) return;
50
- client.getFilteredBuilds(
51
- filters,
52
- query.page + 1,
53
- // Page is 0-indexed in Table
54
- query.pageSize
55
- ).then((result) => {
56
- resolve({
57
- data: result.items,
58
- page: result.metadata.page - 1,
59
- totalCount: result.metadata.total
60
- });
61
- }).catch((reason) => reject(reason));
62
- });
63
- },
64
- detailPanel: (rowData) => {
65
- const BuildDetailsWithRequest = withRequest(BuildDetails);
66
- return /* @__PURE__ */ React.createElement("div", { className: classes.detailPanel }, /* @__PURE__ */ React.createElement(BuildDetailsWithRequest, { buildId: rowData.rowData.id }));
35
+ return /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 3, direction: "column", children: [
36
+ /* @__PURE__ */ jsx(
37
+ BuildListFilter,
38
+ {
39
+ onFilterChange: handleFilterChange,
40
+ initialValues: initialFilters
67
41
  }
68
- }
69
- ));
42
+ ),
43
+ /* @__PURE__ */ jsx(
44
+ Table,
45
+ {
46
+ title: "Builds",
47
+ columns: buildPageColumns,
48
+ options: { paging: true, sorting: false, search: false, pageSize: 10 },
49
+ tableRef,
50
+ data: (query) => {
51
+ return new Promise((resolve, reject) => {
52
+ if (!query) return;
53
+ client.getFilteredBuilds(
54
+ filters,
55
+ query.page + 1,
56
+ // Page is 0-indexed in Table
57
+ query.pageSize
58
+ ).then((result) => {
59
+ resolve({
60
+ data: result.items,
61
+ page: result.metadata.page - 1,
62
+ totalCount: result.metadata.total
63
+ });
64
+ }).catch((reason) => reject(reason));
65
+ });
66
+ },
67
+ detailPanel: (rowData) => {
68
+ const BuildDetailsWithRequest = withRequest(BuildDetails);
69
+ return /* @__PURE__ */ jsx("div", { className: classes.detailPanel, children: /* @__PURE__ */ jsx(BuildDetailsWithRequest, { buildId: rowData.rowData.id }) });
70
+ }
71
+ }
72
+ )
73
+ ] });
70
74
  };
71
75
 
72
76
  export { BuildList };
@@ -1 +1 @@
1
- {"version":3,"file":"BuildList.esm.js","sources":["../../../src/components/BuildList/BuildList.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\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 */\n\nimport React, { useRef, useState } from 'react';\nimport { Table } from '@backstage/core-components';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { BuildFilters, xcmetricsApiRef } from '../../api';\nimport Grid from '@material-ui/core/Grid';\nimport { createStyles, makeStyles } from '@material-ui/core/styles';\nimport { BuildListFilter as Filters } from '../BuildListFilter';\nimport { DateTime } from 'luxon';\nimport { buildPageColumns } from '../BuildTableColumns';\nimport { BuildDetails, withRequest } from '../BuildDetails';\n\nconst useStyles = makeStyles(theme =>\n createStyles({\n detailPanel: {\n padding: theme.spacing(2),\n backgroundColor: theme.palette.background.paper,\n },\n }),\n);\n\nexport const BuildList = () => {\n const classes = useStyles();\n const client = useApi(xcmetricsApiRef);\n const tableRef = useRef<any>();\n\n const initialFilters = {\n from: DateTime.now().minus({ years: 1 }).toISODate()!,\n to: DateTime.now().toISODate()!,\n };\n\n const [filters, setFilters] = useState<BuildFilters>(initialFilters);\n\n const handleFilterChange = (values: BuildFilters) => {\n setFilters(values);\n tableRef.current?.onQueryChange();\n };\n\n return (\n <Grid container spacing={3} direction=\"column\">\n <Filters\n onFilterChange={handleFilterChange}\n initialValues={initialFilters}\n />\n <Table\n title=\"Builds\"\n columns={buildPageColumns}\n options={{ paging: true, sorting: false, search: false, pageSize: 10 }}\n tableRef={tableRef}\n data={query => {\n return new Promise((resolve, reject) => {\n if (!query) return;\n client\n .getFilteredBuilds(\n filters,\n query.page + 1, // Page is 0-indexed in Table\n query.pageSize,\n )\n .then(result => {\n resolve({\n data: result.items,\n page: result.metadata.page - 1,\n totalCount: result.metadata.total,\n });\n })\n .catch(reason => reject(reason));\n });\n }}\n detailPanel={rowData => {\n const BuildDetailsWithRequest = withRequest(BuildDetails);\n return (\n <div className={classes.detailPanel}>\n <BuildDetailsWithRequest buildId={(rowData as any).rowData.id} />\n </div>\n );\n }}\n />\n </Grid>\n );\n};\n"],"names":["Filters"],"mappings":";;;;;;;;;;;;AA2BA,MAAM,SAAY,GAAA,UAAA;AAAA,EAAW,WAC3B,YAAa,CAAA;AAAA,IACX,WAAa,EAAA;AAAA,MACX,OAAA,EAAS,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,MACxB,eAAA,EAAiB,KAAM,CAAA,OAAA,CAAQ,UAAW,CAAA;AAAA;AAC5C,GACD;AACH,CAAA;AAEO,MAAM,YAAY,MAAM;AAC7B,EAAA,MAAM,UAAU,SAAU,EAAA;AAC1B,EAAM,MAAA,MAAA,GAAS,OAAO,eAAe,CAAA;AACrC,EAAA,MAAM,WAAW,MAAY,EAAA;AAE7B,EAAA,MAAM,cAAiB,GAAA;AAAA,IACrB,IAAA,EAAM,QAAS,CAAA,GAAA,EAAM,CAAA,KAAA,CAAM,EAAE,KAAO,EAAA,CAAA,EAAG,CAAA,CAAE,SAAU,EAAA;AAAA,IACnD,EAAI,EAAA,QAAA,CAAS,GAAI,EAAA,CAAE,SAAU;AAAA,GAC/B;AAEA,EAAA,MAAM,CAAC,OAAA,EAAS,UAAU,CAAA,GAAI,SAAuB,cAAc,CAAA;AAEnE,EAAM,MAAA,kBAAA,GAAqB,CAAC,MAAyB,KAAA;AACnD,IAAA,UAAA,CAAW,MAAM,CAAA;AACjB,IAAA,QAAA,CAAS,SAAS,aAAc,EAAA;AAAA,GAClC;AAEA,EAAA,2CACG,IAAK,EAAA,EAAA,SAAA,EAAS,MAAC,OAAS,EAAA,CAAA,EAAG,WAAU,QACpC,EAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAACA,eAAA;AAAA,IAAA;AAAA,MACC,cAAgB,EAAA,kBAAA;AAAA,MAChB,aAAe,EAAA;AAAA;AAAA,GAEjB,kBAAA,KAAA,CAAA,aAA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*\n * Copyright 2021 The Backstage Authors\n *\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 */\n\nimport { useRef, useState } from 'react';\nimport { Table } from '@backstage/core-components';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { BuildFilters, xcmetricsApiRef } from '../../api';\nimport Grid from '@material-ui/core/Grid';\nimport { createStyles, makeStyles } from '@material-ui/core/styles';\nimport { BuildListFilter as Filters } from '../BuildListFilter';\nimport { DateTime } from 'luxon';\nimport { buildPageColumns } from '../BuildTableColumns';\nimport { BuildDetails, withRequest } from '../BuildDetails';\n\nconst useStyles = makeStyles(theme =>\n createStyles({\n detailPanel: {\n padding: theme.spacing(2),\n backgroundColor: theme.palette.background.paper,\n },\n }),\n);\n\nexport const BuildList = () => {\n const classes = useStyles();\n const client = useApi(xcmetricsApiRef);\n const tableRef = useRef<any>();\n\n const initialFilters = {\n from: DateTime.now().minus({ years: 1 }).toISODate()!,\n to: DateTime.now().toISODate()!,\n };\n\n const [filters, setFilters] = useState<BuildFilters>(initialFilters);\n\n const handleFilterChange = (values: BuildFilters) => {\n setFilters(values);\n tableRef.current?.onQueryChange();\n };\n\n return (\n <Grid container spacing={3} direction=\"column\">\n <Filters\n onFilterChange={handleFilterChange}\n initialValues={initialFilters}\n />\n <Table\n title=\"Builds\"\n columns={buildPageColumns}\n options={{ paging: true, sorting: false, search: false, pageSize: 10 }}\n tableRef={tableRef}\n data={query => {\n return new Promise((resolve, reject) => {\n if (!query) return;\n client\n .getFilteredBuilds(\n filters,\n query.page + 1, // Page is 0-indexed in Table\n query.pageSize,\n )\n .then(result => {\n resolve({\n data: result.items,\n page: result.metadata.page - 1,\n totalCount: result.metadata.total,\n });\n })\n .catch(reason => reject(reason));\n });\n }}\n detailPanel={rowData => {\n const BuildDetailsWithRequest = withRequest(BuildDetails);\n return (\n <div className={classes.detailPanel}>\n <BuildDetailsWithRequest buildId={(rowData as any).rowData.id} />\n </div>\n );\n }}\n />\n </Grid>\n );\n};\n"],"names":["Filters"],"mappings":";;;;;;;;;;;;;AA2BA,MAAM,SAAY,GAAA,UAAA;AAAA,EAAW,WAC3B,YAAa,CAAA;AAAA,IACX,WAAa,EAAA;AAAA,MACX,OAAA,EAAS,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,MACxB,eAAA,EAAiB,KAAM,CAAA,OAAA,CAAQ,UAAW,CAAA;AAAA;AAC5C,GACD;AACH,CAAA;AAEO,MAAM,YAAY,MAAM;AAC7B,EAAA,MAAM,UAAU,SAAU,EAAA;AAC1B,EAAM,MAAA,MAAA,GAAS,OAAO,eAAe,CAAA;AACrC,EAAA,MAAM,WAAW,MAAY,EAAA;AAE7B,EAAA,MAAM,cAAiB,GAAA;AAAA,IACrB,IAAA,EAAM,QAAS,CAAA,GAAA,EAAM,CAAA,KAAA,CAAM,EAAE,KAAO,EAAA,CAAA,EAAG,CAAA,CAAE,SAAU,EAAA;AAAA,IACnD,EAAI,EAAA,QAAA,CAAS,GAAI,EAAA,CAAE,SAAU;AAAA,GAC/B;AAEA,EAAA,MAAM,CAAC,OAAA,EAAS,UAAU,CAAA,GAAI,SAAuB,cAAc,CAAA;AAEnE,EAAM,MAAA,kBAAA,GAAqB,CAAC,MAAyB,KAAA;AACnD,IAAA,UAAA,CAAW,MAAM,CAAA;AACjB,IAAA,QAAA,CAAS,SAAS,aAAc,EAAA;AAAA,GAClC;AAEA,EAAA,4BACG,IAAK,EAAA,EAAA,SAAA,EAAS,MAAC,OAAS,EAAA,CAAA,EAAG,WAAU,QACpC,EAAA,QAAA,EAAA;AAAA,oBAAA,GAAA;AAAA,MAACA,eAAA;AAAA,MAAA;AAAA,QACC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;;;"}
@@ -1,4 +1,5 @@
1
- import React, { useState, useEffect } from 'react';
1
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
2
+ import { useState, useEffect } from 'react';
2
3
  import IconButton from '@material-ui/core/IconButton';
3
4
  import Grid from '@material-ui/core/Grid';
4
5
  import Button from '@material-ui/core/Button';
@@ -33,14 +34,20 @@ const BuildListFilter = ({
33
34
  const filtersKey = key;
34
35
  return sum + Number(values[filtersKey] !== initialValues[filtersKey]);
35
36
  }, 0);
36
- const title = /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
37
- IconButton,
38
- {
39
- onClick: () => setOpen(!open),
40
- "aria-label": `${open ? "hide" : "show"} filters`
41
- },
42
- /* @__PURE__ */ React.createElement(FilterList, null)
43
- ), "Filters (", numFilters, ")", !!numFilters && /* @__PURE__ */ React.createElement(Button, { color: "primary", onClick: () => setValues(initialValues) }, "Clear all"));
37
+ const title = /* @__PURE__ */ jsxs(Fragment, { children: [
38
+ /* @__PURE__ */ jsx(
39
+ IconButton,
40
+ {
41
+ onClick: () => setOpen(!open),
42
+ "aria-label": `${open ? "hide" : "show"} filters`,
43
+ children: /* @__PURE__ */ jsx(FilterList, {})
44
+ }
45
+ ),
46
+ "Filters (",
47
+ numFilters,
48
+ ")",
49
+ !!numFilters && /* @__PURE__ */ jsx(Button, { color: "primary", onClick: () => setValues(initialValues), children: "Clear all" })
50
+ ] });
44
51
  const statusItems = [
45
52
  { label: "All", value: "all" },
46
53
  { label: "Succeeded", value: "succeeded" },
@@ -50,73 +57,75 @@ const BuildListFilter = ({
50
57
  const { value: projects, loading } = useAsync(async () => {
51
58
  return client.getProjects();
52
59
  }, []);
53
- const content = /* @__PURE__ */ React.createElement(
60
+ const content = /* @__PURE__ */ jsxs(
54
61
  Grid,
55
62
  {
56
63
  container: true,
57
64
  spacing: 3,
58
65
  direction: "row",
59
- className: classes.filtersContent
60
- },
61
- /* @__PURE__ */ React.createElement(Grid, { item: true, sm: 6, md: 4, lg: 2 }, /* @__PURE__ */ React.createElement(
62
- DatePicker,
63
- {
64
- label: "From",
65
- value: values.from,
66
- onDateChange: (date) => setValues({ ...values, from: date })
67
- }
68
- )),
69
- /* @__PURE__ */ React.createElement(Grid, { item: true, sm: 6, md: 4, lg: 2 }, /* @__PURE__ */ React.createElement(
70
- DatePicker,
71
- {
72
- label: "To",
73
- value: values.to,
74
- onDateChange: (date) => setValues({ ...values, to: date })
75
- }
76
- )),
77
- /* @__PURE__ */ React.createElement(Grid, { item: true, sm: 6, md: 4, lg: 2 }, /* @__PURE__ */ React.createElement(
78
- Select,
79
- {
80
- label: "Status",
81
- items: statusItems,
82
- selected: !values.buildStatus ? "all" : values.buildStatus,
83
- onChange: (selection) => {
84
- const buildStatus = selection === "all" ? void 0 : selection;
85
- setValues({ ...values, buildStatus });
86
- }
87
- }
88
- )),
89
- /* @__PURE__ */ React.createElement(Grid, { item: true, sm: 6, md: 4, lg: 2 }, loading ? /* @__PURE__ */ React.createElement(
90
- Select,
91
- {
92
- label: "Project",
93
- placeholder: "Loading..",
94
- items: [],
95
- onChange: () => void 0
96
- }
97
- ) : /* @__PURE__ */ React.createElement(
98
- Select,
99
- {
100
- label: "Project",
101
- items: toSelectItems(["All"].concat(projects ?? [])),
102
- selected: values.project ? values.project : "All",
103
- onChange: (selection) => setValues({
104
- ...values,
105
- project: selection === "All" ? void 0 : selection
106
- })
107
- }
108
- ))
66
+ className: classes.filtersContent,
67
+ children: [
68
+ /* @__PURE__ */ jsx(Grid, { item: true, sm: 6, md: 4, lg: 2, children: /* @__PURE__ */ jsx(
69
+ DatePicker,
70
+ {
71
+ label: "From",
72
+ value: values.from,
73
+ onDateChange: (date) => setValues({ ...values, from: date })
74
+ }
75
+ ) }),
76
+ /* @__PURE__ */ jsx(Grid, { item: true, sm: 6, md: 4, lg: 2, children: /* @__PURE__ */ jsx(
77
+ DatePicker,
78
+ {
79
+ label: "To",
80
+ value: values.to,
81
+ onDateChange: (date) => setValues({ ...values, to: date })
82
+ }
83
+ ) }),
84
+ /* @__PURE__ */ jsx(Grid, { item: true, sm: 6, md: 4, lg: 2, children: /* @__PURE__ */ jsx(
85
+ Select,
86
+ {
87
+ label: "Status",
88
+ items: statusItems,
89
+ selected: !values.buildStatus ? "all" : values.buildStatus,
90
+ onChange: (selection) => {
91
+ const buildStatus = selection === "all" ? void 0 : selection;
92
+ setValues({ ...values, buildStatus });
93
+ }
94
+ }
95
+ ) }),
96
+ /* @__PURE__ */ jsx(Grid, { item: true, sm: 6, md: 4, lg: 2, children: loading ? /* @__PURE__ */ jsx(
97
+ Select,
98
+ {
99
+ label: "Project",
100
+ placeholder: "Loading..",
101
+ items: [],
102
+ onChange: () => void 0
103
+ }
104
+ ) : /* @__PURE__ */ jsx(
105
+ Select,
106
+ {
107
+ label: "Project",
108
+ items: toSelectItems(["All"].concat(projects ?? [])),
109
+ selected: values.project ? values.project : "All",
110
+ onChange: (selection) => setValues({
111
+ ...values,
112
+ project: selection === "All" ? void 0 : selection
113
+ })
114
+ }
115
+ ) })
116
+ ]
117
+ }
109
118
  );
110
- return /* @__PURE__ */ React.createElement(
119
+ return /* @__PURE__ */ jsx(
111
120
  InfoCard,
112
121
  {
113
122
  title,
114
123
  titleTypographyProps: { variant: "h6" },
115
124
  divider: open,
116
125
  noPadding: true,
117
- variant: "gridItem"
118
- },
119
- open && content
126
+ variant: "gridItem",
127
+ children: open && content
128
+ }
120
129
  );
121
130
  };
122
131