@backstage-community/plugin-azure-devops 0.13.2 → 0.15.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 (50) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/alpha/plugin.esm.js +6 -6
  3. package/dist/alpha/plugin.esm.js.map +1 -1
  4. package/dist/alpha.d.ts +13 -12
  5. package/dist/components/AzureGitTagsIcon/AzureGitTagsIcon.esm.js +2 -2
  6. package/dist/components/AzureGitTagsIcon/AzureGitTagsIcon.esm.js.map +1 -1
  7. package/dist/components/AzurePipelinesIcon/AzurePipelinesIcon.esm.js +25 -22
  8. package/dist/components/AzurePipelinesIcon/AzurePipelinesIcon.esm.js.map +1 -1
  9. package/dist/components/AzurePullRequestsIcon/AzurePullRequestsIcon.esm.js +64 -58
  10. package/dist/components/AzurePullRequestsIcon/AzurePullRequestsIcon.esm.js.map +1 -1
  11. package/dist/components/BuildTable/BuildTable.esm.js +91 -44
  12. package/dist/components/BuildTable/BuildTable.esm.js.map +1 -1
  13. package/dist/components/BuildTable/lib/BuildLogDrawer/BuildLogDrawer.esm.js +21 -5
  14. package/dist/components/BuildTable/lib/BuildLogDrawer/BuildLogDrawer.esm.js.map +1 -1
  15. package/dist/components/BuildTable/lib/EmptyBuildResults/EmptyBuildResults.esm.js +27 -0
  16. package/dist/components/BuildTable/lib/EmptyBuildResults/EmptyBuildResults.esm.js.map +1 -0
  17. package/dist/components/EntityPageAzureGitTags/EntityPageAzureGitTags.esm.js +5 -5
  18. package/dist/components/EntityPageAzureGitTags/EntityPageAzureGitTags.esm.js.map +1 -1
  19. package/dist/components/EntityPageAzurePipelines/EntityPageAzurePipelines.esm.js +14 -5
  20. package/dist/components/EntityPageAzurePipelines/EntityPageAzurePipelines.esm.js.map +1 -1
  21. package/dist/components/EntityPageAzurePullRequests/EntityPageAzurePullRequests.esm.js +5 -5
  22. package/dist/components/EntityPageAzurePullRequests/EntityPageAzurePullRequests.esm.js.map +1 -1
  23. package/dist/components/GitTagTable/GitTagTable.esm.js +12 -6
  24. package/dist/components/GitTagTable/GitTagTable.esm.js.map +1 -1
  25. package/dist/components/PullRequestStatusButtonGroup/PullRequestStatusButtonGroup.esm.js +30 -26
  26. package/dist/components/PullRequestStatusButtonGroup/PullRequestStatusButtonGroup.esm.js.map +1 -1
  27. package/dist/components/PullRequestTable/PullRequestTable.esm.js +30 -19
  28. package/dist/components/PullRequestTable/PullRequestTable.esm.js.map +1 -1
  29. package/dist/components/PullRequestsPage/PullRequestsPage.esm.js +20 -16
  30. package/dist/components/PullRequestsPage/PullRequestsPage.esm.js.map +1 -1
  31. package/dist/components/PullRequestsPage/lib/AutoCompleteIcon/AutoCompleteIcon.esm.js +2 -2
  32. package/dist/components/PullRequestsPage/lib/AutoCompleteIcon/AutoCompleteIcon.esm.js.map +1 -1
  33. package/dist/components/PullRequestsPage/lib/PullRequestCard/PullRequestCard.esm.js +37 -28
  34. package/dist/components/PullRequestsPage/lib/PullRequestCard/PullRequestCard.esm.js.map +1 -1
  35. package/dist/components/PullRequestsPage/lib/PullRequestCard/PullRequestCardPolicies.esm.js +2 -2
  36. package/dist/components/PullRequestsPage/lib/PullRequestCard/PullRequestCardPolicies.esm.js.map +1 -1
  37. package/dist/components/PullRequestsPage/lib/PullRequestCard/PullRequestCardPolicy.esm.js +11 -7
  38. package/dist/components/PullRequestsPage/lib/PullRequestCard/PullRequestCardPolicy.esm.js.map +1 -1
  39. package/dist/components/PullRequestsPage/lib/PullRequestCard/PullRequestCardReviewer.esm.js +2 -2
  40. package/dist/components/PullRequestsPage/lib/PullRequestCard/PullRequestCardReviewer.esm.js.map +1 -1
  41. package/dist/components/PullRequestsPage/lib/PullRequestCard/PullRequestCardReviewers.esm.js +2 -2
  42. package/dist/components/PullRequestsPage/lib/PullRequestCard/PullRequestCardReviewers.esm.js.map +1 -1
  43. package/dist/components/PullRequestsPage/lib/PullRequestGrid/PullRequestGrid.esm.js +5 -5
  44. package/dist/components/PullRequestsPage/lib/PullRequestGrid/PullRequestGrid.esm.js.map +1 -1
  45. package/dist/components/PullRequestsPage/lib/PullRequestGridColumn/PullRequestGridColumn.esm.js +10 -7
  46. package/dist/components/PullRequestsPage/lib/PullRequestGridColumn/PullRequestGridColumn.esm.js.map +1 -1
  47. package/dist/components/ReadmeCard/ReadmeCard.esm.js +14 -13
  48. package/dist/components/ReadmeCard/ReadmeCard.esm.js.map +1 -1
  49. package/dist/index.d.ts +7 -9
  50. package/package.json +14 -14
@@ -1,4 +1,5 @@
1
- import React, { useState } from 'react';
1
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
+ import { useState } from 'react';
2
3
  import Box from '@material-ui/core/Box';
3
4
  import Button from '@material-ui/core/Button';
4
5
  import Typography from '@material-ui/core/Typography';
@@ -8,40 +9,76 @@ import { AzurePipelinesIcon } from '../AzurePipelinesIcon/AzurePipelinesIcon.esm
8
9
  import { DateTime } from 'luxon';
9
10
  import { getDurationFromDates } from '../../utils/getDurationFromDates.esm.js';
10
11
  import { BuildLogDrawer } from './lib/BuildLogDrawer/BuildLogDrawer.esm.js';
12
+ import { EmptyBuildResults } from './lib/EmptyBuildResults/EmptyBuildResults.esm.js';
11
13
 
12
14
  const getBuildResultComponent = (result) => {
13
15
  switch (result) {
14
16
  case BuildResult.Succeeded:
15
- return /* @__PURE__ */ React.createElement(Typography, { component: "span" }, /* @__PURE__ */ React.createElement(StatusOK, null), " Succeeded");
17
+ return /* @__PURE__ */ jsxs(Typography, { component: "span", children: [
18
+ /* @__PURE__ */ jsx(StatusOK, {}),
19
+ " Succeeded"
20
+ ] });
16
21
  case BuildResult.PartiallySucceeded:
17
- return /* @__PURE__ */ React.createElement(Typography, { component: "span" }, /* @__PURE__ */ React.createElement(StatusWarning, null), " Partially Succeeded");
22
+ return /* @__PURE__ */ jsxs(Typography, { component: "span", children: [
23
+ /* @__PURE__ */ jsx(StatusWarning, {}),
24
+ " Partially Succeeded"
25
+ ] });
18
26
  case BuildResult.Failed:
19
- return /* @__PURE__ */ React.createElement(Typography, { component: "span" }, /* @__PURE__ */ React.createElement(StatusError, null), " Failed");
27
+ return /* @__PURE__ */ jsxs(Typography, { component: "span", children: [
28
+ /* @__PURE__ */ jsx(StatusError, {}),
29
+ " Failed"
30
+ ] });
20
31
  case BuildResult.Canceled:
21
- return /* @__PURE__ */ React.createElement(Typography, { component: "span" }, /* @__PURE__ */ React.createElement(StatusAborted, null), " Canceled");
32
+ return /* @__PURE__ */ jsxs(Typography, { component: "span", children: [
33
+ /* @__PURE__ */ jsx(StatusAborted, {}),
34
+ " Canceled"
35
+ ] });
22
36
  case BuildResult.None:
23
37
  default:
24
- return /* @__PURE__ */ React.createElement(Typography, { component: "span" }, /* @__PURE__ */ React.createElement(StatusWarning, null), " Unknown");
38
+ return /* @__PURE__ */ jsxs(Typography, { component: "span", children: [
39
+ /* @__PURE__ */ jsx(StatusWarning, {}),
40
+ " Unknown"
41
+ ] });
25
42
  }
26
43
  };
27
44
  const getBuildStateComponent = (status, result) => {
28
45
  switch (status) {
29
46
  case BuildStatus.InProgress:
30
- return /* @__PURE__ */ React.createElement(Typography, { component: "span" }, /* @__PURE__ */ React.createElement(StatusRunning, null), " In Progress");
47
+ return /* @__PURE__ */ jsxs(Typography, { component: "span", children: [
48
+ /* @__PURE__ */ jsx(StatusRunning, {}),
49
+ " In Progress"
50
+ ] });
31
51
  case BuildStatus.Completed:
32
52
  return getBuildResultComponent(result);
33
53
  case BuildStatus.Cancelling:
34
- return /* @__PURE__ */ React.createElement(Typography, { component: "span" }, /* @__PURE__ */ React.createElement(StatusAborted, null), " Cancelling");
54
+ return /* @__PURE__ */ jsxs(Typography, { component: "span", children: [
55
+ /* @__PURE__ */ jsx(StatusAborted, {}),
56
+ " Cancelling"
57
+ ] });
35
58
  case BuildStatus.Postponed:
36
- return /* @__PURE__ */ React.createElement(Typography, { component: "span" }, /* @__PURE__ */ React.createElement(StatusPending, null), " Postponed");
59
+ return /* @__PURE__ */ jsxs(Typography, { component: "span", children: [
60
+ /* @__PURE__ */ jsx(StatusPending, {}),
61
+ " Postponed"
62
+ ] });
37
63
  case BuildStatus.NotStarted:
38
- return /* @__PURE__ */ React.createElement(Typography, { component: "span" }, /* @__PURE__ */ React.createElement(StatusAborted, null), " Not Started");
64
+ return /* @__PURE__ */ jsxs(Typography, { component: "span", children: [
65
+ /* @__PURE__ */ jsx(StatusAborted, {}),
66
+ " Not Started"
67
+ ] });
39
68
  case BuildStatus.None:
40
69
  default:
41
- return /* @__PURE__ */ React.createElement(Typography, { component: "span" }, /* @__PURE__ */ React.createElement(StatusWarning, null), " Unknown");
70
+ return /* @__PURE__ */ jsxs(Typography, { component: "span", children: [
71
+ /* @__PURE__ */ jsx(StatusWarning, {}),
72
+ " Unknown"
73
+ ] });
42
74
  }
43
75
  };
44
- const BuildTable = ({ items, loading, error }) => {
76
+ const BuildTable = ({
77
+ items,
78
+ loading,
79
+ error,
80
+ entity
81
+ }) => {
45
82
  const [selectedBuildId, setSelectedBuildId] = useState(
46
83
  void 0
47
84
  );
@@ -61,7 +98,7 @@ const BuildTable = ({ items, loading, error }) => {
61
98
  }));
62
99
  };
63
100
  if (error) {
64
- return /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(ResponseErrorPanel, { error }));
101
+ return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(ResponseErrorPanel, { error }) });
65
102
  }
66
103
  const columns = [
67
104
  {
@@ -74,7 +111,7 @@ const BuildTable = ({ items, loading, error }) => {
74
111
  title: "Build",
75
112
  field: "title",
76
113
  width: "auto",
77
- render: (row) => /* @__PURE__ */ React.createElement(Link, { to: row.link || "" }, row.title)
114
+ render: (row) => /* @__PURE__ */ jsx(Link, { to: row.link || "", children: row.title })
78
115
  },
79
116
  {
80
117
  title: "Source",
@@ -84,13 +121,13 @@ const BuildTable = ({ items, loading, error }) => {
84
121
  {
85
122
  title: "State",
86
123
  width: "auto",
87
- render: (row) => /* @__PURE__ */ React.createElement(Box, { display: "flex", alignItems: "center" }, /* @__PURE__ */ React.createElement(Typography, { variant: "button" }, getBuildStateComponent(row.status, row.result)))
124
+ render: (row) => /* @__PURE__ */ jsx(Box, { display: "flex", alignItems: "center", children: /* @__PURE__ */ jsx(Typography, { variant: "button", children: getBuildStateComponent(row.status, row.result) }) })
88
125
  },
89
126
  {
90
127
  title: "Duration",
91
128
  field: "queueTime",
92
129
  width: "auto",
93
- render: (row) => /* @__PURE__ */ React.createElement(Box, { display: "flex", alignItems: "center" }, /* @__PURE__ */ React.createElement(Typography, null, getDurationFromDates(row.startTime, row.finishTime)))
130
+ render: (row) => /* @__PURE__ */ jsx(Box, { display: "flex", alignItems: "center", children: /* @__PURE__ */ jsx(Typography, { children: getDurationFromDates(row.startTime, row.finishTime) }) })
94
131
  },
95
132
  {
96
133
  title: "Age",
@@ -101,43 +138,53 @@ const BuildTable = ({ items, loading, error }) => {
101
138
  {
102
139
  title: "Logs",
103
140
  width: "auto",
104
- render: (row) => /* @__PURE__ */ React.createElement(
141
+ render: (row) => /* @__PURE__ */ jsx(
105
142
  Button,
106
143
  {
107
144
  variant: "contained",
108
145
  color: "primary",
109
146
  size: "small",
110
147
  onClick: () => handleOpenDrawer(row.id),
111
- disabled: !row.id
112
- },
113
- "View Logs"
148
+ disabled: !row.id,
149
+ children: "View Logs"
150
+ }
114
151
  )
115
152
  }
116
153
  ];
117
- return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
118
- Table,
119
- {
120
- isLoading: loading,
121
- columns,
122
- options: {
123
- search: true,
124
- paging: true,
125
- pageSize: 5,
126
- showEmptyDataSourceMessage: !loading
127
- },
128
- title: /* @__PURE__ */ React.createElement(Box, { display: "flex", alignItems: "center" }, /* @__PURE__ */ React.createElement(AzurePipelinesIcon, { style: { fontSize: 30 } }), /* @__PURE__ */ React.createElement(Box, { mr: 1 }), "Azure Pipelines - Builds (", items ? items.length : 0, ")"),
129
- data: items ?? []
130
- }
131
- ), /* @__PURE__ */ React.createElement(
132
- BuildLogDrawer,
133
- {
134
- buildId: selectedBuildId,
135
- open: isDrawerOpen,
136
- onClose: handleCloseDrawer,
137
- logsCache,
138
- updateCache: updateLogsCache
139
- }
140
- ));
154
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
155
+ /* @__PURE__ */ jsx(
156
+ Table,
157
+ {
158
+ isLoading: loading,
159
+ columns,
160
+ options: {
161
+ search: true,
162
+ paging: true,
163
+ pageSize: 5,
164
+ showEmptyDataSourceMessage: !loading
165
+ },
166
+ title: /* @__PURE__ */ jsxs(Box, { display: "flex", alignItems: "center", children: [
167
+ /* @__PURE__ */ jsx(AzurePipelinesIcon, { style: { fontSize: 30 } }),
168
+ /* @__PURE__ */ jsx(Box, { mr: 1 }),
169
+ "Azure Pipelines - Builds (",
170
+ items ? items.length : 0,
171
+ ")"
172
+ ] }),
173
+ data: items ?? [],
174
+ emptyContent: /* @__PURE__ */ jsx(EmptyBuildResults, { entity })
175
+ }
176
+ ),
177
+ /* @__PURE__ */ jsx(
178
+ BuildLogDrawer,
179
+ {
180
+ buildId: selectedBuildId,
181
+ open: isDrawerOpen,
182
+ onClose: handleCloseDrawer,
183
+ logsCache,
184
+ updateCache: updateLogsCache
185
+ }
186
+ )
187
+ ] });
141
188
  };
142
189
 
143
190
  export { BuildTable, getBuildResultComponent, getBuildStateComponent };
@@ -1 +1 @@
1
- {"version":3,"file":"BuildTable.esm.js","sources":["../../../src/components/BuildTable/BuildTable.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 */\nimport { useState } from 'react';\nimport Box from '@material-ui/core/Box';\nimport Button from '@material-ui/core/Button';\nimport Typography from '@material-ui/core/Typography';\nimport {\n BuildResult,\n BuildRun,\n BuildStatus,\n} from '@backstage-community/plugin-azure-devops-common';\nimport {\n Link,\n ResponseErrorPanel,\n StatusAborted,\n StatusError,\n StatusOK,\n StatusPending,\n StatusRunning,\n StatusWarning,\n Table,\n TableColumn,\n} from '@backstage/core-components';\n\nimport { AzurePipelinesIcon } from '../AzurePipelinesIcon';\nimport { DateTime } from 'luxon';\nimport React from 'react';\nimport { getDurationFromDates } from '../../utils/getDurationFromDates';\nimport { BuildLogDrawer } from './lib/BuildLogDrawer';\n\nexport const getBuildResultComponent = (result: number | undefined) => {\n switch (result) {\n case BuildResult.Succeeded:\n return (\n <Typography component=\"span\">\n <StatusOK /> Succeeded\n </Typography>\n );\n case BuildResult.PartiallySucceeded:\n return (\n <Typography component=\"span\">\n <StatusWarning /> Partially Succeeded\n </Typography>\n );\n case BuildResult.Failed:\n return (\n <Typography component=\"span\">\n <StatusError /> Failed\n </Typography>\n );\n case BuildResult.Canceled:\n return (\n <Typography component=\"span\">\n <StatusAborted /> Canceled\n </Typography>\n );\n case BuildResult.None:\n default:\n return (\n <Typography component=\"span\">\n <StatusWarning /> Unknown\n </Typography>\n );\n }\n};\n\nexport const getBuildStateComponent = (\n status: number | undefined,\n result: number | undefined,\n) => {\n switch (status) {\n case BuildStatus.InProgress:\n return (\n <Typography component=\"span\">\n <StatusRunning /> In Progress\n </Typography>\n );\n case BuildStatus.Completed:\n return getBuildResultComponent(result);\n case BuildStatus.Cancelling:\n return (\n <Typography component=\"span\">\n <StatusAborted /> Cancelling\n </Typography>\n );\n case BuildStatus.Postponed:\n return (\n <Typography component=\"span\">\n <StatusPending /> Postponed\n </Typography>\n );\n case BuildStatus.NotStarted:\n return (\n <Typography component=\"span\">\n <StatusAborted /> Not Started\n </Typography>\n );\n case BuildStatus.None:\n default:\n return (\n <Typography component=\"span\">\n <StatusWarning /> Unknown\n </Typography>\n );\n }\n};\n\ntype BuildTableProps = {\n items?: BuildRun[];\n loading: boolean;\n error?: Error;\n};\n\nexport const BuildTable = ({ items, loading, error }: BuildTableProps) => {\n // State for log drawer\n const [selectedBuildId, setSelectedBuildId] = useState<number | undefined>(\n undefined,\n );\n const [isDrawerOpen, setIsDrawerOpen] = useState(false);\n\n const handleOpenDrawer = (buildId?: number) => {\n setSelectedBuildId(buildId);\n setIsDrawerOpen(true);\n };\n\n const handleCloseDrawer = () => {\n setIsDrawerOpen(false);\n };\n\n // Cache build logs\n const [logsCache, setLogsCache] = useState<Record<number, string[]>>({});\n\n const updateLogsCache = (buildId: number, logs: string[]) => {\n setLogsCache(prev => ({\n ...prev,\n [buildId]: logs,\n }));\n };\n\n if (error) {\n return (\n <div>\n <ResponseErrorPanel error={error} />\n </div>\n );\n }\n\n const columns: TableColumn[] = [\n {\n title: 'ID',\n field: 'id',\n highlight: false,\n width: 'auto',\n },\n {\n title: 'Build',\n field: 'title',\n width: 'auto',\n render: (row: Partial<BuildRun>) => (\n <Link to={row.link || ''}>{row.title}</Link>\n ),\n },\n {\n title: 'Source',\n field: 'source',\n width: 'auto',\n },\n {\n title: 'State',\n width: 'auto',\n render: (row: Partial<BuildRun>) => (\n <Box display=\"flex\" alignItems=\"center\">\n <Typography variant=\"button\">\n {getBuildStateComponent(row.status, row.result)}\n </Typography>\n </Box>\n ),\n },\n {\n title: 'Duration',\n field: 'queueTime',\n width: 'auto',\n render: (row: Partial<BuildRun>) => (\n <Box display=\"flex\" alignItems=\"center\">\n <Typography>\n {getDurationFromDates(row.startTime, row.finishTime)}\n </Typography>\n </Box>\n ),\n },\n {\n title: 'Age',\n field: 'queueTime',\n width: 'auto',\n render: (row: Partial<BuildRun>) =>\n (row.queueTime\n ? DateTime.fromISO(row.queueTime)\n : DateTime.now()\n ).toRelative(),\n },\n {\n title: 'Logs',\n width: 'auto',\n render: (row: Partial<BuildRun>) => (\n <Button\n variant=\"contained\"\n color=\"primary\"\n size=\"small\"\n onClick={() => handleOpenDrawer(row.id)}\n disabled={!row.id}\n >\n View Logs\n </Button>\n ),\n },\n ];\n\n return (\n <>\n <Table\n isLoading={loading}\n columns={columns}\n options={{\n search: true,\n paging: true,\n pageSize: 5,\n showEmptyDataSourceMessage: !loading,\n }}\n title={\n <Box display=\"flex\" alignItems=\"center\">\n <AzurePipelinesIcon style={{ fontSize: 30 }} />\n <Box mr={1} />\n Azure Pipelines - Builds ({items ? items.length : 0})\n </Box>\n }\n data={items ?? []}\n />\n\n <BuildLogDrawer\n buildId={selectedBuildId}\n open={isDrawerOpen}\n onClose={handleCloseDrawer}\n logsCache={logsCache}\n updateCache={updateLogsCache}\n />\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;AA2Ca,MAAA,uBAAA,GAA0B,CAAC,MAA+B,KAAA;AACrE,EAAA,QAAQ,MAAQ;AAAA,IACd,KAAK,WAAY,CAAA,SAAA;AACf,MAAA,2CACG,UAAW,EAAA,EAAA,SAAA,EAAU,0BACnB,KAAA,CAAA,aAAA,CAAA,QAAA,EAAA,IAAS,GAAE,YACd,CAAA;AAAA,IAEJ,KAAK,WAAY,CAAA,kBAAA;AACf,MAAA,2CACG,UAAW,EAAA,EAAA,SAAA,EAAU,0BACnB,KAAA,CAAA,aAAA,CAAA,aAAA,EAAA,IAAc,GAAE,sBACnB,CAAA;AAAA,IAEJ,KAAK,WAAY,CAAA,MAAA;AACf,MAAA,2CACG,UAAW,EAAA,EAAA,SAAA,EAAU,0BACnB,KAAA,CAAA,aAAA,CAAA,WAAA,EAAA,IAAY,GAAE,SACjB,CAAA;AAAA,IAEJ,KAAK,WAAY,CAAA,QAAA;AACf,MAAA,2CACG,UAAW,EAAA,EAAA,SAAA,EAAU,0BACnB,KAAA,CAAA,aAAA,CAAA,aAAA,EAAA,IAAc,GAAE,WACnB,CAAA;AAAA,IAEJ,KAAK,WAAY,CAAA,IAAA;AAAA,IACjB;AACE,MAAA,2CACG,UAAW,EAAA,EAAA,SAAA,E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;AAAA,QAChB;AAAA;AAED;AAEJ,GACF;AAEA,EAAA,uBAEI,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,SAAW,EAAA,OAAA;AAAA,MACX,OAAA;AAAA,MACA,OAAS,EAAA;AAAA,QACP,MAAQ,EAAA,IAAA;AAAA,QACR,MAAQ,EAAA,IAAA;AAAA,QACR,QAAU,EAAA,CAAA;AAAA,QACV,4BAA4B,CAAC;AAAA,OAC/B;AAAA,MACA,KAAA,kBACG,KAAA,CAAA,aAAA,CAAA,GAAA,EAAA,EAAI,OAAQ,EAAA,MAAA,EAAO,YAAW,QAC7B,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,kBAAmB,EAAA,EAAA,KAAA,EAAO,EAAE,QAAA,EAAU,IAAM,EAAA,CAAA,kBAC5C,KAAA,CAAA,aAAA,CAAA,GAAA,EAAA,EAAI,EAAI,EAAA,CAAA,EAAG,CAAE,EAAA,4BAAA,EACa,KAAQ,GAAA,KAAA,CAAM,MAAS,GAAA,CAAA,EAAE,GACtD,CAAA;AAAA,MAEF,IAAA,EAAM,SAAS;AAAC;AAAA,GAGlB,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,cAAA;AAAA,IAAA;AAAA,MACC,OAAS,EAAA,eAAA;AAAA,MACT,IAAM,EAAA,YAAA;AAAA,MACN,OAAS,EAAA,iBAAA;AAAA,MACT,SAAA;AAAA,MACA,WAAa,EAAA;AAAA;AAAA,GAEjB,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"BuildTable.esm.js","sources":["../../../src/components/BuildTable/BuildTable.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 */\nimport { useState } from 'react';\nimport Box from '@material-ui/core/Box';\nimport Button from '@material-ui/core/Button';\nimport Typography from '@material-ui/core/Typography';\nimport {\n BuildResult,\n BuildRun,\n BuildStatus,\n} from '@backstage-community/plugin-azure-devops-common';\nimport {\n Link,\n ResponseErrorPanel,\n StatusAborted,\n StatusError,\n StatusOK,\n StatusPending,\n StatusRunning,\n StatusWarning,\n Table,\n TableColumn,\n} from '@backstage/core-components';\n\nimport { AzurePipelinesIcon } from '../AzurePipelinesIcon';\nimport { DateTime } from 'luxon';\nimport { getDurationFromDates } from '../../utils/getDurationFromDates';\nimport { BuildLogDrawer } from './lib/BuildLogDrawer';\nimport { EmptyBuildResults } from './lib/EmptyBuildResults';\nimport { Entity } from '@backstage/catalog-model';\n\nexport const getBuildResultComponent = (result: number | undefined) => {\n switch (result) {\n case BuildResult.Succeeded:\n return (\n <Typography component=\"span\">\n <StatusOK /> Succeeded\n </Typography>\n );\n case BuildResult.PartiallySucceeded:\n return (\n <Typography component=\"span\">\n <StatusWarning /> Partially Succeeded\n </Typography>\n );\n case BuildResult.Failed:\n return (\n <Typography component=\"span\">\n <StatusError /> Failed\n </Typography>\n );\n case BuildResult.Canceled:\n return (\n <Typography component=\"span\">\n <StatusAborted /> Canceled\n </Typography>\n );\n case BuildResult.None:\n default:\n return (\n <Typography component=\"span\">\n <StatusWarning /> Unknown\n </Typography>\n );\n }\n};\n\nexport const getBuildStateComponent = (\n status: number | undefined,\n result: number | undefined,\n) => {\n switch (status) {\n case BuildStatus.InProgress:\n return (\n <Typography component=\"span\">\n <StatusRunning /> In Progress\n </Typography>\n );\n case BuildStatus.Completed:\n return getBuildResultComponent(result);\n case BuildStatus.Cancelling:\n return (\n <Typography component=\"span\">\n <StatusAborted /> Cancelling\n </Typography>\n );\n case BuildStatus.Postponed:\n return (\n <Typography component=\"span\">\n <StatusPending /> Postponed\n </Typography>\n );\n case BuildStatus.NotStarted:\n return (\n <Typography component=\"span\">\n <StatusAborted /> Not Started\n </Typography>\n );\n case BuildStatus.None:\n default:\n return (\n <Typography component=\"span\">\n <StatusWarning /> Unknown\n </Typography>\n );\n }\n};\n\ntype BuildTableProps = {\n items?: BuildRun[];\n loading: boolean;\n error?: Error;\n entity?: Entity;\n};\n\nexport const BuildTable = ({\n items,\n loading,\n error,\n entity,\n}: BuildTableProps) => {\n // State for log drawer\n const [selectedBuildId, setSelectedBuildId] = useState<number | undefined>(\n undefined,\n );\n const [isDrawerOpen, setIsDrawerOpen] = useState(false);\n\n const handleOpenDrawer = (buildId?: number) => {\n setSelectedBuildId(buildId);\n setIsDrawerOpen(true);\n };\n\n const handleCloseDrawer = () => {\n setIsDrawerOpen(false);\n };\n\n // Cache build logs\n const [logsCache, setLogsCache] = useState<Record<number, string[]>>({});\n\n const updateLogsCache = (buildId: number, logs: string[]) => {\n setLogsCache(prev => ({\n ...prev,\n [buildId]: logs,\n }));\n };\n\n if (error) {\n return (\n <div>\n <ResponseErrorPanel error={error} />\n </div>\n );\n }\n\n const columns: TableColumn[] = [\n {\n title: 'ID',\n field: 'id',\n highlight: false,\n width: 'auto',\n },\n {\n title: 'Build',\n field: 'title',\n width: 'auto',\n render: (row: Partial<BuildRun>) => (\n <Link to={row.link || ''}>{row.title}</Link>\n ),\n },\n {\n title: 'Source',\n field: 'source',\n width: 'auto',\n },\n {\n title: 'State',\n width: 'auto',\n render: (row: Partial<BuildRun>) => (\n <Box display=\"flex\" alignItems=\"center\">\n <Typography variant=\"button\">\n {getBuildStateComponent(row.status, row.result)}\n </Typography>\n </Box>\n ),\n },\n {\n title: 'Duration',\n field: 'queueTime',\n width: 'auto',\n render: (row: Partial<BuildRun>) => (\n <Box display=\"flex\" alignItems=\"center\">\n <Typography>\n {getDurationFromDates(row.startTime, row.finishTime)}\n </Typography>\n </Box>\n ),\n },\n {\n title: 'Age',\n field: 'queueTime',\n width: 'auto',\n render: (row: Partial<BuildRun>) =>\n (row.queueTime\n ? DateTime.fromISO(row.queueTime)\n : DateTime.now()\n ).toRelative(),\n },\n {\n title: 'Logs',\n width: 'auto',\n render: (row: Partial<BuildRun>) => (\n <Button\n variant=\"contained\"\n color=\"primary\"\n size=\"small\"\n onClick={() => handleOpenDrawer(row.id)}\n disabled={!row.id}\n >\n View Logs\n </Button>\n ),\n },\n ];\n\n return (\n <>\n <Table\n isLoading={loading}\n columns={columns}\n options={{\n search: true,\n paging: true,\n pageSize: 5,\n showEmptyDataSourceMessage: !loading,\n }}\n title={\n <Box display=\"flex\" alignItems=\"center\">\n <AzurePipelinesIcon style={{ fontSize: 30 }} />\n <Box mr={1} />\n Azure Pipelines - Builds ({items ? items.length : 0})\n </Box>\n }\n data={items ?? []}\n emptyContent={<EmptyBuildResults entity={entity} />}\n />\n\n <BuildLogDrawer\n buildId={selectedBuildId}\n open={isDrawerOpen}\n onClose={handleCloseDrawer}\n logsCache={logsCache}\n updateCache={updateLogsCache}\n />\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;AA4Ca,MAAA,uBAAA,GAA0B,CAAC,MAA+B,KAAA;AACrE,EAAA,QAAQ,MAAQ;AAAA,IACd,KAAK,WAAY,CAAA,SAAA;AACf,MACE,uBAAA,IAAA,CAAC,UAAW,EAAA,EAAA,SAAA,EAAU,MACpB,EAAA,QAAA,EAAA;AAAA,wBAAA,GAAA,CAAC,QAAS,EAAA,EAAA,CAAA;AAAA,QAAE;AAAA,OACd,EAAA,CAAA;AAAA,IAEJ,KAAK,WAAY,CAAA,kBAAA;AACf,MACE,uBAAA,IAAA,CAAC,UAAW,EAAA,EAAA,SAAA,EAAU,MACpB,EAAA,QAAA,EAAA;AAAA,wBAAA,GAAA,CAAC,aAAc,EAAA,EAAA,CAAA;AAAA,QAAE;AAAA,OACnB,EAAA,CAAA;AAAA,IAEJ,KAAK,WAAY,CAA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AQ,EAAA,MAAA,EAAO,YAAW,QAC7B,EAAA,QAAA,EAAA;AAAA,0BAAA,GAAA,CAAC,kBAAmB,EAAA,EAAA,KAAA,EAAO,EAAE,QAAA,EAAU,IAAM,EAAA,CAAA;AAAA,0BAC7C,GAAA,CAAC,GAAI,EAAA,EAAA,EAAA,EAAI,CAAG,EAAA,CAAA;AAAA,UAAE,4BAAA;AAAA,UACa,KAAA,GAAQ,MAAM,MAAS,GAAA,CAAA;AAAA,UAAE;AAAA,SACtD,EAAA,CAAA;AAAA,QAEF,IAAA,EAAM,SAAS,EAAC;AAAA,QAChB,YAAA,kBAAe,GAAA,CAAA,iBAAA,EAAA,EAAkB,MAAgB,EAAA;AAAA;AAAA,KACnD;AAAA,oBAEA,GAAA;AAAA,MAAC,cAAA;AAAA,MAAA;AAAA,QACC,OAAS,EAAA,eAAA;AAAA,QACT,IAAM,EAAA,YAAA;AAAA,QACN,OAAS,EAAA,iBAAA;AAAA,QACT,SAAA;AAAA,QACA,WAAa,EAAA;AAAA;AAAA;AACf,GACF,EAAA,CAAA;AAEJ;;;;"}
@@ -1,4 +1,5 @@
1
- import React, { useState, useCallback, useEffect } from 'react';
1
+ import { jsx, jsxs } from 'react/jsx-runtime';
2
+ import { useState, useCallback, useEffect } from 'react';
2
3
  import Drawer from '@material-ui/core/Drawer';
3
4
  import Typography from '@material-ui/core/Typography';
4
5
  import LinearProgress from '@material-ui/core/LinearProgress';
@@ -92,7 +93,7 @@ const BuildLogDrawer = ({
92
93
  }
93
94
  }
94
95
  }, [buildId, open, fetchLogs, logsCache]);
95
- return /* @__PURE__ */ React.createElement(
96
+ return /* @__PURE__ */ jsx(
96
97
  Drawer,
97
98
  {
98
99
  anchor: "right",
@@ -100,9 +101,24 @@ const BuildLogDrawer = ({
100
101
  onClose,
101
102
  classes: {
102
103
  paper: classes.logDrawer
103
- }
104
- },
105
- /* @__PURE__ */ React.createElement("div", { className: classes.content }, /* @__PURE__ */ React.createElement("div", { className: classes.header }, /* @__PURE__ */ React.createElement(Typography, { variant: "h6" }, "Build Logs ", buildId ? `(Build #${buildId})` : ""), /* @__PURE__ */ React.createElement(IconButton, { onClick: onClose, "aria-label": "close" }, /* @__PURE__ */ React.createElement(CloseIcon, null))), loading && /* @__PURE__ */ React.createElement(LinearProgress, null), error && /* @__PURE__ */ React.createElement(Typography, { color: "error" }, "Error loading logs: ", error.message), !loading && !error && logs.length === 0 && /* @__PURE__ */ React.createElement(Typography, null, "No logs available"), !loading && !error && logs.length > 0 && /* @__PURE__ */ React.createElement(Box, { component: "pre", className: classes.logContainer }, logs.join("\n")))
104
+ },
105
+ children: /* @__PURE__ */ jsxs("div", { className: classes.content, children: [
106
+ /* @__PURE__ */ jsxs("div", { className: classes.header, children: [
107
+ /* @__PURE__ */ jsxs(Typography, { variant: "h6", children: [
108
+ "Build Logs ",
109
+ buildId ? `(Build #${buildId})` : ""
110
+ ] }),
111
+ /* @__PURE__ */ jsx(IconButton, { onClick: onClose, "aria-label": "close", children: /* @__PURE__ */ jsx(CloseIcon, {}) })
112
+ ] }),
113
+ loading && /* @__PURE__ */ jsx(LinearProgress, {}),
114
+ error && /* @__PURE__ */ jsxs(Typography, { color: "error", children: [
115
+ "Error loading logs: ",
116
+ error.message
117
+ ] }),
118
+ !loading && !error && logs.length === 0 && /* @__PURE__ */ jsx(Typography, { children: "No logs available" }),
119
+ !loading && !error && logs.length > 0 && /* @__PURE__ */ jsx(Box, { component: "pre", className: classes.logContainer, children: logs.join("\n") })
120
+ ] })
121
+ }
106
122
  );
107
123
  };
108
124
 
@@ -1 +1 @@
1
- {"version":3,"file":"BuildLogDrawer.esm.js","sources":["../../../../../src/components/BuildTable/lib/BuildLogDrawer/BuildLogDrawer.tsx"],"sourcesContent":["/*\n * Copyright 2025 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 */\nimport React, { useState, useEffect, useCallback } from 'react';\nimport Drawer from '@material-ui/core/Drawer';\nimport Typography from '@material-ui/core/Typography';\nimport LinearProgress from '@material-ui/core/LinearProgress';\nimport Box from '@material-ui/core/Box';\nimport IconButton from '@material-ui/core/IconButton';\nimport { makeStyles } from '@material-ui/core/styles';\nimport CloseIcon from '@material-ui/icons/Close';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { azureDevOpsApiRef } from '../../../../api';\nimport { getAnnotationValuesFromEntity } from '../../../../utils';\nimport { stringifyEntityRef } from '@backstage/catalog-model';\nimport { useEntity } from '@backstage/plugin-catalog-react';\n\nconst useDrawerStyles = makeStyles(theme => ({\n logDrawer: {\n width: '40%',\n minWidth: '500px',\n padding: theme.spacing(2),\n },\n header: {\n display: 'flex',\n justifyContent: 'space-between',\n alignItems: 'center',\n marginBottom: theme.spacing(2),\n borderBottom: `1px solid ${theme.palette.divider}`,\n paddingBottom: theme.spacing(1),\n },\n content: {\n height: '100%',\n display: 'flex',\n flexDirection: 'column',\n },\n logContainer: {\n flexGrow: 1,\n overflow: 'auto',\n backgroundColor: theme.palette.background.default,\n padding: theme.spacing(2),\n borderRadius: theme.shape.borderRadius,\n marginTop: theme.spacing(2),\n fontFamily: theme.typography.fontFamily,\n fontSize: theme.typography.fontSize,\n },\n}));\n\ntype BuildLogDrawerProps = {\n buildId?: number;\n open: boolean;\n onClose: () => void;\n logsCache: Record<number, string[]>;\n updateCache: (buildId: number, logs: string[]) => void;\n};\n\nexport const BuildLogDrawer = ({\n buildId,\n open,\n onClose,\n logsCache,\n updateCache,\n}: BuildLogDrawerProps) => {\n const [loading, setLoading] = useState(false);\n const [logs, setLogs] = useState<string[]>([]);\n const [error, setError] = useState<Error | undefined>();\n const { entity } = useEntity();\n const azureApi = useApi(azureDevOpsApiRef);\n const classes = useDrawerStyles();\n\n const fetchLogs = useCallback(async () => {\n if (!buildId) {\n setError(new Error('Missing ID for build'));\n return;\n }\n\n setLoading(true);\n setError(undefined);\n setLogs([]);\n\n try {\n const { project, host, org } = getAnnotationValuesFromEntity(entity);\n const response = await azureApi.getBuildRunLog(\n project,\n stringifyEntityRef(entity),\n buildId,\n host,\n org,\n );\n\n setLogs(response.log);\n updateCache(buildId, response.log);\n } catch (err) {\n setError(err as Error);\n } finally {\n setLoading(false);\n }\n }, [buildId, entity, azureApi, updateCache]);\n\n // Reset logs when a different build is selected\n useEffect(() => {\n if (buildId && open) {\n // Check logs in cache first\n if (logsCache[buildId]) {\n setLogs(logsCache[buildId]);\n } else {\n fetchLogs();\n }\n }\n }, [buildId, open, fetchLogs, logsCache]);\n\n return (\n <Drawer\n anchor=\"right\"\n open={open}\n onClose={onClose}\n classes={{\n paper: classes.logDrawer,\n }}\n >\n <div className={classes.content}>\n <div className={classes.header}>\n <Typography variant=\"h6\">\n Build Logs {buildId ? `(Build #${buildId})` : ''}\n </Typography>\n <IconButton onClick={onClose} aria-label=\"close\">\n <CloseIcon />\n </IconButton>\n </div>\n\n {loading && <LinearProgress />}\n\n {error && (\n <Typography color=\"error\">\n Error loading logs: {error.message}\n </Typography>\n )}\n\n {!loading && !error && logs.length === 0 && (\n <Typography>No logs available</Typography>\n )}\n\n {!loading && !error && logs.length > 0 && (\n <Box component=\"pre\" className={classes.logContainer}>\n {logs.join('\\n')}\n </Box>\n )}\n </div>\n </Drawer>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AA6BA,MAAM,eAAA,GAAkB,WAAW,CAAU,KAAA,MAAA;AAAA,EAC3C,SAAW,EAAA;AAAA,IACT,KAAO,EAAA,KAAA;AAAA,IACP,QAAU,EAAA,OAAA;AAAA,IACV,OAAA,EAAS,KAAM,CAAA,OAAA,CAAQ,CAAC;AAAA,GAC1B;AAAA,EACA,MAAQ,EAAA;AAAA,IAC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LogDrawer.esm.js","sources":["../../../../../src/components/BuildTable/lib/BuildLogDrawer/BuildLogDrawer.tsx"],"sourcesContent":["/*\n * Copyright 2025 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 */\nimport { useState, useEffect, useCallback } from 'react';\nimport Drawer from '@material-ui/core/Drawer';\nimport Typography from '@material-ui/core/Typography';\nimport LinearProgress from '@material-ui/core/LinearProgress';\nimport Box from '@material-ui/core/Box';\nimport IconButton from '@material-ui/core/IconButton';\nimport { makeStyles } from '@material-ui/core/styles';\nimport CloseIcon from '@material-ui/icons/Close';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { azureDevOpsApiRef } from '../../../../api';\nimport { getAnnotationValuesFromEntity } from '../../../../utils';\nimport { stringifyEntityRef } from '@backstage/catalog-model';\nimport { useEntity } from '@backstage/plugin-catalog-react';\n\nconst useDrawerStyles = makeStyles(theme => ({\n logDrawer: {\n width: '40%',\n minWidth: '500px',\n padding: theme.spacing(2),\n },\n header: {\n display: 'flex',\n justifyContent: 'space-between',\n alignItems: 'center',\n marginBottom: theme.spacing(2),\n borderBottom: `1px solid ${theme.palette.divider}`,\n paddingBottom: theme.spacing(1),\n },\n content: {\n height: '100%',\n display: 'flex',\n flexDirection: 'column',\n },\n logContainer: {\n flexGrow: 1,\n overflow: 'auto',\n backgroundColor: theme.palette.background.default,\n padding: theme.spacing(2),\n borderRadius: theme.shape.borderRadius,\n marginTop: theme.spacing(2),\n fontFamily: theme.typography.fontFamily,\n fontSize: theme.typography.fontSize,\n },\n}));\n\ntype BuildLogDrawerProps = {\n buildId?: number;\n open: boolean;\n onClose: () => void;\n logsCache: Record<number, string[]>;\n updateCache: (buildId: number, logs: string[]) => void;\n};\n\nexport const BuildLogDrawer = ({\n buildId,\n open,\n onClose,\n logsCache,\n updateCache,\n}: BuildLogDrawerProps) => {\n const [loading, setLoading] = useState(false);\n const [logs, setLogs] = useState<string[]>([]);\n const [error, setError] = useState<Error | undefined>();\n const { entity } = useEntity();\n const azureApi = useApi(azureDevOpsApiRef);\n const classes = useDrawerStyles();\n\n const fetchLogs = useCallback(async () => {\n if (!buildId) {\n setError(new Error('Missing ID for build'));\n return;\n }\n\n setLoading(true);\n setError(undefined);\n setLogs([]);\n\n try {\n const { project, host, org } = getAnnotationValuesFromEntity(entity);\n const response = await azureApi.getBuildRunLog(\n project,\n stringifyEntityRef(entity),\n buildId,\n host,\n org,\n );\n\n setLogs(response.log);\n updateCache(buildId, response.log);\n } catch (err) {\n setError(err as Error);\n } finally {\n setLoading(false);\n }\n }, [buildId, entity, azureApi, updateCache]);\n\n // Reset logs when a different build is selected\n useEffect(() => {\n if (buildId && open) {\n // Check logs in cache first\n if (logsCache[buildId]) {\n setLogs(logsCache[buildId]);\n } else {\n fetchLogs();\n }\n }\n }, [buildId, open, fetchLogs, logsCache]);\n\n return (\n <Drawer\n anchor=\"right\"\n open={open}\n onClose={onClose}\n classes={{\n paper: classes.logDrawer,\n }}\n >\n <div className={classes.content}>\n <div className={classes.header}>\n <Typography variant=\"h6\">\n Build Logs {buildId ? `(Build #${buildId})` : ''}\n </Typography>\n <IconButton onClick={onClose} aria-label=\"close\">\n <CloseIcon />\n </IconButton>\n </div>\n\n {loading && <LinearProgress />}\n\n {error && (\n <Typography color=\"error\">\n Error loading logs: {error.message}\n </Typography>\n )}\n\n {!loading && !error && logs.length === 0 && (\n <Typography>No logs available</Typography>\n )}\n\n {!loading && !error && logs.length > 0 && (\n <Box component=\"pre\" className={classes.logContainer}>\n {logs.join('\\n')}\n </Box>\n )}\n </div>\n </Drawer>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;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GAAA,CAAA,UAAA,EAAA,EAAW,QAAiB,EAAA,mBAAA,EAAA,CAAA;AAAA,QAG9B,CAAC,OAAW,IAAA,CAAC,KAAS,IAAA,IAAA,CAAK,SAAS,CACnC,oBAAA,GAAA,CAAC,GAAI,EAAA,EAAA,SAAA,EAAU,OAAM,SAAW,EAAA,OAAA,CAAQ,cACrC,QAAK,EAAA,IAAA,CAAA,IAAA,CAAK,IAAI,CACjB,EAAA;AAAA,OAEJ,EAAA;AAAA;AAAA,GACF;AAEJ;;;;"}
@@ -0,0 +1,27 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import Box from '@material-ui/core/Box';
3
+ import Typography from '@material-ui/core/Typography';
4
+ import 'luxon';
5
+ import 'humanize-duration';
6
+ import { getAnnotationValuesFromEntity } from '../../../../utils/getAnnotationValuesFromEntity.esm.js';
7
+
8
+ const EmptyBuildResults = ({ entity }) => {
9
+ const annotations = entity ? getAnnotationValuesFromEntity(entity) : void 0;
10
+ const repoName = annotations?.repo;
11
+ const buildDefinition = annotations?.definition;
12
+ return /* @__PURE__ */ jsxs(Box, { padding: 2, children: [
13
+ /* @__PURE__ */ jsx(Typography, { component: "p", align: "center", variant: "body1", children: "No records to display" }),
14
+ /* @__PURE__ */ jsxs(Typography, { component: "p", align: "center", variant: "body2", children: [
15
+ "No builds could be found with repository name",
16
+ " ",
17
+ repoName ?? "(no value provided)",
18
+ " or build definition",
19
+ " ",
20
+ buildDefinition ?? "(no value provided)",
21
+ "."
22
+ ] })
23
+ ] });
24
+ };
25
+
26
+ export { EmptyBuildResults };
27
+ //# sourceMappingURL=EmptyBuildResults.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EmptyBuildResults.esm.js","sources":["../../../../../src/components/BuildTable/lib/EmptyBuildResults/EmptyBuildResults.tsx"],"sourcesContent":["/*\n * Copyright 2025 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 */\nimport { Entity } from '@backstage/catalog-model';\nimport Box from '@material-ui/core/Box';\nimport Typography from '@material-ui/core/Typography';\nimport { getAnnotationValuesFromEntity } from '../../../../utils';\n\nexport const EmptyBuildResults = ({ entity }: { entity?: Entity }) => {\n const annotations = entity\n ? getAnnotationValuesFromEntity(entity)\n : undefined;\n const repoName = annotations?.repo;\n const buildDefinition = annotations?.definition;\n\n return (\n <Box padding={2}>\n <Typography component=\"p\" align=\"center\" variant=\"body1\">\n No records to display\n </Typography>\n <Typography component=\"p\" align=\"center\" variant=\"body2\">\n No builds could be found with repository name{' '}\n {repoName ?? '(no value provided)'} or build definition{' '}\n {buildDefinition ?? '(no value provided)'}.\n </Typography>\n </Box>\n );\n};\n"],"names":[],"mappings":";;;;;;;AAoBO,MAAM,iBAAoB,GAAA,CAAC,EAAE,MAAA,EAAkC,KAAA;AACpE,EAAA,MAAM,WAAc,GAAA,MAAA,GAChB,6BAA8B,CAAA,MAAM,CACpC,GAAA,KAAA,CAAA;AACJ,EAAA,MAAM,WAAW,WAAa,EAAA,IAAA;AAC9B,EAAA,MAAM,kBAAkB,WAAa,EAAA,UAAA;AAErC,EACE,uBAAA,IAAA,CAAC,GAAI,EAAA,EAAA,OAAA,EAAS,CACZ,EAAA,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,cAAW,SAAU,EAAA,GAAA,EAAI,OAAM,QAAS,EAAA,OAAA,EAAQ,SAAQ,QAEzD,EAAA,uBAAA,EAAA,CAAA;AAAA,yBACC,UAAW,EAAA,EAAA,SAAA,EAAU,KAAI,KAAM,EAAA,QAAA,EAAS,SAAQ,OAAQ,EAAA,QAAA,EAAA;AAAA,MAAA,+CAAA;AAAA,MACT,GAAA;AAAA,MAC7C,QAAY,IAAA,qBAAA;AAAA,MAAsB,sBAAA;AAAA,MAAqB,GAAA;AAAA,MACvD,eAAmB,IAAA,qBAAA;AAAA,MAAsB;AAAA,KAC5C,EAAA;AAAA,GACF,EAAA,CAAA;AAEJ;;;;"}
@@ -1,20 +1,20 @@
1
+ import { jsx } from 'react/jsx-runtime';
1
2
  import { azureDevOpsGitTagReadPermission } from '@backstage-community/plugin-azure-devops-common';
2
3
  import { GitTagTable } from '../GitTagTable/GitTagTable.esm.js';
3
- import React from 'react';
4
4
  import { stringifyEntityRef } from '@backstage/catalog-model';
5
5
  import { useEntity } from '@backstage/plugin-catalog-react';
6
6
  import { RequirePermission } from '@backstage/plugin-permission-react';
7
7
 
8
8
  const EntityPageAzureGitTags = () => {
9
9
  const { entity } = useEntity();
10
- return /* @__PURE__ */ React.createElement(
10
+ return /* @__PURE__ */ jsx(
11
11
  RequirePermission,
12
12
  {
13
13
  permission: azureDevOpsGitTagReadPermission,
14
14
  resourceRef: stringifyEntityRef(entity),
15
- errorPage: null
16
- },
17
- /* @__PURE__ */ React.createElement(GitTagTable, null)
15
+ errorPage: null,
16
+ children: /* @__PURE__ */ jsx(GitTagTable, {})
17
+ }
18
18
  );
19
19
  };
20
20
 
@@ -1 +1 @@
1
- {"version":3,"file":"EntityPageAzureGitTags.esm.js","sources":["../../../src/components/EntityPageAzureGitTags/EntityPageAzureGitTags.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 { azureDevOpsGitTagReadPermission } from '@backstage-community/plugin-azure-devops-common';\nimport { GitTagTable } from '../GitTagTable/GitTagTable';\nimport React from 'react';\nimport { stringifyEntityRef } from '@backstage/catalog-model';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport { RequirePermission } from '@backstage/plugin-permission-react';\n\nexport const EntityPageAzureGitTags = () => {\n const { entity } = useEntity();\n return (\n <RequirePermission\n permission={azureDevOpsGitTagReadPermission}\n resourceRef={stringifyEntityRef(entity)}\n errorPage={null}\n >\n <GitTagTable />\n </RequirePermission>\n );\n};\n"],"names":[],"mappings":";;;;;;;AAuBO,MAAM,yBAAyB,MAAM;AAC1C,EAAM,MAAA,EAAE,MAAO,EAAA,GAAI,SAAU,EAAA;AAC7B,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,iBAAA;AAAA,IAAA;AAAA,MACC,UAAY,EAAA,+BAAA;AAAA,MACZ,WAAA,EAAa,mBAAmB,MAAM,CAAA;AAAA,MACtC,SAAW,EAAA;AAAA,KAAA;AAAA,wCAEV,WAAY,EAAA,IAAA;AAAA,GACf;AAEJ;;;;"}
1
+ {"version":3,"file":"EntityPageAzureGitTags.esm.js","sources":["../../../src/components/EntityPageAzureGitTags/EntityPageAzureGitTags.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 { azureDevOpsGitTagReadPermission } from '@backstage-community/plugin-azure-devops-common';\nimport { GitTagTable } from '../GitTagTable/GitTagTable';\nimport { stringifyEntityRef } from '@backstage/catalog-model';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport { RequirePermission } from '@backstage/plugin-permission-react';\n\nexport const EntityPageAzureGitTags = () => {\n const { entity } = useEntity();\n return (\n <RequirePermission\n permission={azureDevOpsGitTagReadPermission}\n resourceRef={stringifyEntityRef(entity)}\n errorPage={null}\n >\n <GitTagTable />\n </RequirePermission>\n );\n};\n"],"names":[],"mappings":";;;;;;;AAsBO,MAAM,yBAAyB,MAAM;AAC1C,EAAM,MAAA,EAAE,MAAO,EAAA,GAAI,SAAU,EAAA;AAC7B,EACE,uBAAA,GAAA;AAAA,IAAC,iBAAA;AAAA,IAAA;AAAA,MACC,UAAY,EAAA,+BAAA;AAAA,MACZ,WAAA,EAAa,mBAAmB,MAAM,CAAA;AAAA,MACtC,SAAW,EAAA,IAAA;AAAA,MAEX,8BAAC,WAAY,EAAA,EAAA;AAAA;AAAA,GACf;AAEJ;;;;"}
@@ -1,11 +1,12 @@
1
+ import { jsx } from 'react/jsx-runtime';
1
2
  import { BuildTable } from '../BuildTable/BuildTable.esm.js';
2
- import React from 'react';
3
3
  import '../../api/AzureDevOpsApi.esm.js';
4
4
  import '@backstage/errors';
5
5
  import '@backstage/core-plugin-api';
6
6
  import 'react-use/esm/useAsync';
7
7
  import 'react-use/esm/useAsyncRetry';
8
8
  import 'react-use/esm/useInterval';
9
+ import 'react';
9
10
  import { azureDevOpsPipelineReadPermission } from '@backstage-community/plugin-azure-devops-common';
10
11
  import { stringifyEntityRef } from '@backstage/catalog-model';
11
12
  import 'luxon';
@@ -17,14 +18,22 @@ import { RequirePermission } from '@backstage/plugin-permission-react';
17
18
  const EntityPageAzurePipelines = (props) => {
18
19
  const { entity } = useEntity();
19
20
  const { items, loading, error } = useBuildRuns(entity, props.defaultLimit);
20
- return /* @__PURE__ */ React.createElement(
21
+ return /* @__PURE__ */ jsx(
21
22
  RequirePermission,
22
23
  {
23
24
  permission: azureDevOpsPipelineReadPermission,
24
25
  resourceRef: stringifyEntityRef(entity),
25
- errorPage: null
26
- },
27
- /* @__PURE__ */ React.createElement(BuildTable, { items, loading, error })
26
+ errorPage: null,
27
+ children: /* @__PURE__ */ jsx(
28
+ BuildTable,
29
+ {
30
+ items,
31
+ loading,
32
+ error,
33
+ entity
34
+ }
35
+ )
36
+ }
28
37
  );
29
38
  };
30
39
 
@@ -1 +1 @@
1
- {"version":3,"file":"EntityPageAzurePipelines.esm.js","sources":["../../../src/components/EntityPageAzurePipelines/EntityPageAzurePipelines.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 { BuildTable } from '../BuildTable/BuildTable';\nimport React from 'react';\nimport { useBuildRuns } from '../../hooks';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport { azureDevOpsPipelineReadPermission } from '@backstage-community/plugin-azure-devops-common';\nimport { stringifyEntityRef } from '@backstage/catalog-model';\nimport { RequirePermission } from '@backstage/plugin-permission-react';\n\nexport const EntityPageAzurePipelines = (props: { defaultLimit?: number }) => {\n const { entity } = useEntity();\n\n const { items, loading, error } = useBuildRuns(entity, props.defaultLimit);\n\n return (\n <RequirePermission\n permission={azureDevOpsPipelineReadPermission}\n resourceRef={stringifyEntityRef(entity)}\n errorPage={null}\n >\n <BuildTable items={items} loading={loading} error={error} />\n </RequirePermission>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAwBa,MAAA,wBAAA,GAA2B,CAAC,KAAqC,KAAA;AAC5E,EAAM,MAAA,EAAE,MAAO,EAAA,GAAI,SAAU,EAAA;AAE7B,EAAM,MAAA,EAAE,OAAO,OAAS,EAAA,KAAA,KAAU,YAAa,CAAA,MAAA,EAAQ,MAAM,YAAY,CAAA;AAEzE,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,iBAAA;AAAA,IAAA;AAAA,MACC,UAAY,EAAA,iCAAA;AAAA,MACZ,WAAA,EAAa,mBAAmB,MAAM,CAAA;AAAA,MACtC,SAAW,EAAA;AAAA,KAAA;AAAA,oBAEV,KAAA,CAAA,aAAA,CAAA,UAAA,EAAA,EAAW,KAAc,EAAA,OAAA,EAAkB,KAAc,EAAA;AAAA,GAC5D;AAEJ;;;;"}
1
+ {"version":3,"file":"EntityPageAzurePipelines.esm.js","sources":["../../../src/components/EntityPageAzurePipelines/EntityPageAzurePipelines.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 { BuildTable } from '../BuildTable/BuildTable';\nimport { useBuildRuns } from '../../hooks';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport { azureDevOpsPipelineReadPermission } from '@backstage-community/plugin-azure-devops-common';\nimport { stringifyEntityRef } from '@backstage/catalog-model';\nimport { RequirePermission } from '@backstage/plugin-permission-react';\n\nexport const EntityPageAzurePipelines = (props: { defaultLimit?: number }) => {\n const { entity } = useEntity();\n\n const { items, loading, error } = useBuildRuns(entity, props.defaultLimit);\n\n return (\n <RequirePermission\n permission={azureDevOpsPipelineReadPermission}\n resourceRef={stringifyEntityRef(entity)}\n errorPage={null}\n >\n <BuildTable\n items={items}\n loading={loading}\n error={error}\n entity={entity}\n />\n </RequirePermission>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAuBa,MAAA,wBAAA,GAA2B,CAAC,KAAqC,KAAA;AAC5E,EAAM,MAAA,EAAE,MAAO,EAAA,GAAI,SAAU,EAAA;AAE7B,EAAM,MAAA,EAAE,OAAO,OAAS,EAAA,KAAA,KAAU,YAAa,CAAA,MAAA,EAAQ,MAAM,YAAY,CAAA;AAEzE,EACE,uBAAA,GAAA;AAAA,IAAC,iBAAA;AAAA,IAAA;AAAA,MACC,UAAY,EAAA,iCAAA;AAAA,MACZ,WAAA,EAAa,mBAAmB,MAAM,CAAA;AAAA,MACtC,SAAW,EAAA,IAAA;AAAA,MAEX,QAAA,kBAAA,GAAA;AAAA,QAAC,UAAA;AAAA,QAAA;AAAA,UACC,KAAA;AAAA,UACA,OAAA;AAAA,UACA,KAAA;AAAA,UACA;AAAA;AAAA;AACF;AAAA,GACF;AAEJ;;;;"}
@@ -1,20 +1,20 @@
1
+ import { jsx } from 'react/jsx-runtime';
1
2
  import { azureDevOpsPullRequestReadPermission } from '@backstage-community/plugin-azure-devops-common';
2
3
  import { PullRequestTable } from '../PullRequestTable/PullRequestTable.esm.js';
3
- import React from 'react';
4
4
  import { RequirePermission } from '@backstage/plugin-permission-react';
5
5
  import { useEntity } from '@backstage/plugin-catalog-react';
6
6
  import { stringifyEntityRef } from '@backstage/catalog-model';
7
7
 
8
8
  const EntityPageAzurePullRequests = (props) => {
9
9
  const { entity } = useEntity();
10
- return /* @__PURE__ */ React.createElement(
10
+ return /* @__PURE__ */ jsx(
11
11
  RequirePermission,
12
12
  {
13
13
  permission: azureDevOpsPullRequestReadPermission,
14
14
  resourceRef: stringifyEntityRef(entity),
15
- errorPage: null
16
- },
17
- /* @__PURE__ */ React.createElement(PullRequestTable, { defaultLimit: props.defaultLimit })
15
+ errorPage: null,
16
+ children: /* @__PURE__ */ jsx(PullRequestTable, { defaultLimit: props.defaultLimit })
17
+ }
18
18
  );
19
19
  };
20
20
 
@@ -1 +1 @@
1
- {"version":3,"file":"EntityPageAzurePullRequests.esm.js","sources":["../../../src/components/EntityPageAzurePullRequests/EntityPageAzurePullRequests.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 { azureDevOpsPullRequestReadPermission } from '@backstage-community/plugin-azure-devops-common';\nimport { PullRequestTable } from '../PullRequestTable/PullRequestTable';\nimport React from 'react';\nimport { RequirePermission } from '@backstage/plugin-permission-react';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport { stringifyEntityRef } from '@backstage/catalog-model';\n\nexport const EntityPageAzurePullRequests = (props: {\n defaultLimit?: number;\n}) => {\n const { entity } = useEntity();\n return (\n <RequirePermission\n permission={azureDevOpsPullRequestReadPermission}\n resourceRef={stringifyEntityRef(entity)}\n errorPage={null}\n >\n <PullRequestTable defaultLimit={props.defaultLimit} />\n </RequirePermission>\n );\n};\n"],"names":[],"mappings":";;;;;;;AAuBa,MAAA,2BAAA,GAA8B,CAAC,KAEtC,KAAA;AACJ,EAAM,MAAA,EAAE,MAAO,EAAA,GAAI,SAAU,EAAA;AAC7B,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,iBAAA;AAAA,IAAA;AAAA,MACC,UAAY,EAAA,oCAAA;AAAA,MACZ,WAAA,EAAa,mBAAmB,MAAM,CAAA;AAAA,MACtC,SAAW,EAAA;AAAA,KAAA;AAAA,oBAEV,KAAA,CAAA,aAAA,CAAA,gBAAA,EAAA,EAAiB,YAAc,EAAA,KAAA,CAAM,YAAc,EAAA;AAAA,GACtD;AAEJ;;;;"}
1
+ {"version":3,"file":"EntityPageAzurePullRequests.esm.js","sources":["../../../src/components/EntityPageAzurePullRequests/EntityPageAzurePullRequests.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 { azureDevOpsPullRequestReadPermission } from '@backstage-community/plugin-azure-devops-common';\nimport { PullRequestTable } from '../PullRequestTable/PullRequestTable';\nimport { RequirePermission } from '@backstage/plugin-permission-react';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport { stringifyEntityRef } from '@backstage/catalog-model';\n\nexport const EntityPageAzurePullRequests = (props: {\n defaultLimit?: number;\n}) => {\n const { entity } = useEntity();\n return (\n <RequirePermission\n permission={azureDevOpsPullRequestReadPermission}\n resourceRef={stringifyEntityRef(entity)}\n errorPage={null}\n >\n <PullRequestTable defaultLimit={props.defaultLimit} />\n </RequirePermission>\n );\n};\n"],"names":[],"mappings":";;;;;;;AAsBa,MAAA,2BAAA,GAA8B,CAAC,KAEtC,KAAA;AACJ,EAAM,MAAA,EAAE,MAAO,EAAA,GAAI,SAAU,EAAA;AAC7B,EACE,uBAAA,GAAA;AAAA,IAAC,iBAAA;AAAA,IAAA;AAAA,MACC,UAAY,EAAA,oCAAA;AAAA,MACZ,WAAA,EAAa,mBAAmB,MAAM,CAAA;AAAA,MACtC,SAAW,EAAA,IAAA;AAAA,MAEX,QAAC,kBAAA,GAAA,CAAA,gBAAA,EAAA,EAAiB,YAAc,EAAA,KAAA,CAAM,YAAc,EAAA;AAAA;AAAA,GACtD;AAEJ;;;;"}
@@ -1,6 +1,6 @@
1
+ import { jsx, jsxs } from 'react/jsx-runtime';
1
2
  import Box from '@material-ui/core/Box';
2
3
  import { ResponseErrorPanel, Table, Link } from '@backstage/core-components';
3
- import React from 'react';
4
4
  import { AzureGitTagsIcon } from '../AzureGitTagsIcon/AzureGitTagsIcon.esm.js';
5
5
  import { useEntity } from '@backstage/plugin-catalog-react';
6
6
  import { useGitTags } from '../../hooks/useGitTags.esm.js';
@@ -12,13 +12,13 @@ const columns = [
12
12
  highlight: false,
13
13
  defaultSort: "desc",
14
14
  width: "auto",
15
- render: (row) => /* @__PURE__ */ React.createElement(Box, { display: "flex", alignItems: "center" }, /* @__PURE__ */ React.createElement(Link, { to: row.link ?? "" }, row.name))
15
+ render: (row) => /* @__PURE__ */ jsx(Box, { display: "flex", alignItems: "center", children: /* @__PURE__ */ jsx(Link, { to: row.link ?? "", children: row.name }) })
16
16
  },
17
17
  {
18
18
  title: "Commit",
19
19
  field: "peeledObjectId",
20
20
  width: "auto",
21
- render: (row) => /* @__PURE__ */ React.createElement(Box, { display: "flex", alignItems: "center" }, /* @__PURE__ */ React.createElement(Link, { to: row.commitLink ?? "" }, row.peeledObjectId))
21
+ render: (row) => /* @__PURE__ */ jsx(Box, { display: "flex", alignItems: "center", children: /* @__PURE__ */ jsx(Link, { to: row.commitLink ?? "", children: row.peeledObjectId }) })
22
22
  },
23
23
  {
24
24
  title: "Created By",
@@ -30,9 +30,9 @@ const GitTagTable = () => {
30
30
  const { entity } = useEntity();
31
31
  const { items, loading, error } = useGitTags(entity);
32
32
  if (error) {
33
- return /* @__PURE__ */ React.createElement(ResponseErrorPanel, { error });
33
+ return /* @__PURE__ */ jsx(ResponseErrorPanel, { error });
34
34
  }
35
- return /* @__PURE__ */ React.createElement(
35
+ return /* @__PURE__ */ jsx(
36
36
  Table,
37
37
  {
38
38
  isLoading: loading,
@@ -43,7 +43,13 @@ const GitTagTable = () => {
43
43
  pageSize: 5,
44
44
  showEmptyDataSourceMessage: !loading
45
45
  },
46
- title: /* @__PURE__ */ React.createElement(Box, { display: "flex", alignItems: "center" }, /* @__PURE__ */ React.createElement(AzureGitTagsIcon, { style: { fontSize: 30 } }), /* @__PURE__ */ React.createElement(Box, { mr: 1 }), "Azure Repos - Git Tags (", items ? items.length : 0, ")"),
46
+ title: /* @__PURE__ */ jsxs(Box, { display: "flex", alignItems: "center", children: [
47
+ /* @__PURE__ */ jsx(AzureGitTagsIcon, { style: { fontSize: 30 } }),
48
+ /* @__PURE__ */ jsx(Box, { mr: 1 }),
49
+ "Azure Repos - Git Tags (",
50
+ items ? items.length : 0,
51
+ ")"
52
+ ] }),
47
53
  data: items ?? []
48
54
  }
49
55
  );
@@ -1 +1 @@
1
- {"version":3,"file":"GitTagTable.esm.js","sources":["../../../src/components/GitTagTable/GitTagTable.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 Box from '@material-ui/core/Box';\nimport {\n Link,\n ResponseErrorPanel,\n Table,\n TableColumn,\n} from '@backstage/core-components';\nimport { GitTag } from '@backstage-community/plugin-azure-devops-common';\nimport React from 'react';\n\nimport { AzureGitTagsIcon } from '../AzureGitTagsIcon';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport { useGitTags } from '../../hooks/useGitTags';\n\nconst columns: TableColumn[] = [\n {\n title: 'Tag',\n field: 'name',\n highlight: false,\n defaultSort: 'desc',\n width: 'auto',\n render: (row: Partial<GitTag>) => (\n <Box display=\"flex\" alignItems=\"center\">\n <Link to={row.link ?? ''}>{row.name}</Link>\n </Box>\n ),\n },\n {\n title: 'Commit',\n field: 'peeledObjectId',\n width: 'auto',\n render: (row: Partial<GitTag>) => (\n <Box display=\"flex\" alignItems=\"center\">\n <Link to={row.commitLink ?? ''}>{row.peeledObjectId}</Link>\n </Box>\n ),\n },\n {\n title: 'Created By',\n field: 'createdBy',\n width: 'auto',\n },\n];\n\nexport const GitTagTable = () => {\n const { entity } = useEntity();\n\n const { items, loading, error } = useGitTags(entity);\n\n if (error) {\n return <ResponseErrorPanel error={error} />;\n }\n\n return (\n <Table\n isLoading={loading}\n columns={columns}\n options={{\n search: true,\n paging: true,\n pageSize: 5,\n showEmptyDataSourceMessage: !loading,\n }}\n title={\n <Box display=\"flex\" alignItems=\"center\">\n <AzureGitTagsIcon style={{ fontSize: 30 }} />\n <Box mr={1} />\n Azure Repos - Git Tags ({items ? items.length : 0})\n </Box>\n }\n data={items ?? []}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;;AA8BA,MAAM,OAAyB,GAAA;AAAA,EAC7B;AAAA,IACE,KAAO,EAAA,KAAA;AAAA,IACP,KAAO,EAAA,MAAA;AAAA,IACP,SAAW,EAAA,KAAA;AAAA,IACX,WAAa,EAAA,MAAA;AAAA,IACb,KAAO,EAAA,MAAA;AAAA,IACP,QAAQ,CAAC,GAAA,qBACN,KAAA,CAAA,aAAA,CAAA,GAAA,EAAA,EAAI,SAAQ,MAAO,EAAA,UAAA,EAAW,QAC7B,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,QAAK,EAAI,EAAA,GAAA,CAAI,QAAQ,EAAK,EAAA,EAAA,GAAA,CAAI,IAAK,CACtC;AAAA,GAEJ;AAAA,EACA;AAAA,IACE,KAAO,EAAA,QAAA;AAAA,IACP,KAAO,EAAA,gBAAA;AAAA,IACP,KAAO,EAAA,MAAA;AAAA,IACP,QAAQ,CAAC,GAAA,qBACN,KAAA,CAAA,aAAA,CAAA,GAAA,EAAA,EAAI,SAAQ,MAAO,EAAA,UAAA,EAAW,QAC7B,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,QAAK,EAAI,EAAA,GAAA,CAAI,cAAc,EAAK,EAAA,EAAA,GAAA,CAAI,cAAe,CACtD;AAAA,GAEJ;AAAA,EACA;AAAA,IACE,KAAO,EAAA,YAAA;AAAA,IACP,KAAO,EAAA,WAAA;AAAA,IACP,KAAO,EAAA;AAAA;AAEX,CAAA;AAEO,MAAM,cAAc,MAAM;AAC/B,EAAM,MAAA,EAAE,MAAO,EAAA,GAAI,SAAU,EAAA;AAE7B,EAAA,MAAM,EAAE,KAAO,EAAA,OAAA,EAAS,KAAM,EAAA,GAAI,WAAW,MAAM,CAAA;AAEnD,EAAA,IAAI,KAAO,EAAA;AACT,IAAO,uBAAA,KAAA,CAAA,aAAA,CAAC,sBAAmB,KAAc,EAAA,CAAA;AAAA;AAG3C,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,SAAW,EAAA,OAAA;AAAA,MACX,OAAA;AAAA,MACA,OAAS,EAAA;AAAA,QACP,MAAQ,EAAA,IAAA;AAAA,QACR,MAAQ,EAAA,IAAA;AAAA,QACR,QAAU,EAAA,CAAA;AAAA,QACV,4BAA4B,CAAC;AAAA,OAC/B;AAAA,MACA,KAAA,kBACG,KAAA,CAAA,aAAA,CAAA,GAAA,EAAA,EAAI,OAAQ,EAAA,MAAA,EAAO,YAAW,QAC7B,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,gBAAiB,EAAA,EAAA,KAAA,EAAO,EAAE,QAAA,EAAU,IAAM,EAAA,CAAA,kBAC1C,KAAA,CAAA,aAAA,CAAA,GAAA,EAAA,EAAI,EAAI,EAAA,CAAA,EAAG,CAAE,EAAA,0BAAA,EACW,KAAQ,GAAA,KAAA,CAAM,MAAS,GAAA,CAAA,EAAE,GACpD,CAAA;AAAA,MAEF,IAAA,EAAM,SAAS;AAAC;AAAA,GAClB;AAEJ;;;;"}
1
+ {"version":3,"file":"GitTagTable.esm.js","sources":["../../../src/components/GitTagTable/GitTagTable.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 Box from '@material-ui/core/Box';\nimport {\n Link,\n ResponseErrorPanel,\n Table,\n TableColumn,\n} from '@backstage/core-components';\nimport { GitTag } from '@backstage-community/plugin-azure-devops-common';\n\nimport { AzureGitTagsIcon } from '../AzureGitTagsIcon';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport { useGitTags } from '../../hooks/useGitTags';\n\nconst columns: TableColumn[] = [\n {\n title: 'Tag',\n field: 'name',\n highlight: false,\n defaultSort: 'desc',\n width: 'auto',\n render: (row: Partial<GitTag>) => (\n <Box display=\"flex\" alignItems=\"center\">\n <Link to={row.link ?? ''}>{row.name}</Link>\n </Box>\n ),\n },\n {\n title: 'Commit',\n field: 'peeledObjectId',\n width: 'auto',\n render: (row: Partial<GitTag>) => (\n <Box display=\"flex\" alignItems=\"center\">\n <Link to={row.commitLink ?? ''}>{row.peeledObjectId}</Link>\n </Box>\n ),\n },\n {\n title: 'Created By',\n field: 'createdBy',\n width: 'auto',\n },\n];\n\nexport const GitTagTable = () => {\n const { entity } = useEntity();\n\n const { items, loading, error } = useGitTags(entity);\n\n if (error) {\n return <ResponseErrorPanel error={error} />;\n }\n\n return (\n <Table\n isLoading={loading}\n columns={columns}\n options={{\n search: true,\n paging: true,\n pageSize: 5,\n showEmptyDataSourceMessage: !loading,\n }}\n title={\n <Box display=\"flex\" alignItems=\"center\">\n <AzureGitTagsIcon style={{ fontSize: 30 }} />\n <Box mr={1} />\n Azure Repos - Git Tags ({items ? items.length : 0})\n </Box>\n }\n data={items ?? []}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;;AA6BA,MAAM,OAAyB,GAAA;AAAA,EAC7B;AAAA,IACE,KAAO,EAAA,KAAA;AAAA,IACP,KAAO,EAAA,MAAA;AAAA,IAC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