@backstage-community/plugin-azure-devops 0.13.2 → 0.14.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 (48) hide show
  1. package/CHANGELOG.md +11 -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 +83 -43
  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/EntityPageAzureGitTags/EntityPageAzureGitTags.esm.js +5 -5
  16. package/dist/components/EntityPageAzureGitTags/EntityPageAzureGitTags.esm.js.map +1 -1
  17. package/dist/components/EntityPageAzurePipelines/EntityPageAzurePipelines.esm.js +6 -5
  18. package/dist/components/EntityPageAzurePipelines/EntityPageAzurePipelines.esm.js.map +1 -1
  19. package/dist/components/EntityPageAzurePullRequests/EntityPageAzurePullRequests.esm.js +5 -5
  20. package/dist/components/EntityPageAzurePullRequests/EntityPageAzurePullRequests.esm.js.map +1 -1
  21. package/dist/components/GitTagTable/GitTagTable.esm.js +12 -6
  22. package/dist/components/GitTagTable/GitTagTable.esm.js.map +1 -1
  23. package/dist/components/PullRequestStatusButtonGroup/PullRequestStatusButtonGroup.esm.js +30 -26
  24. package/dist/components/PullRequestStatusButtonGroup/PullRequestStatusButtonGroup.esm.js.map +1 -1
  25. package/dist/components/PullRequestTable/PullRequestTable.esm.js +30 -19
  26. package/dist/components/PullRequestTable/PullRequestTable.esm.js.map +1 -1
  27. package/dist/components/PullRequestsPage/PullRequestsPage.esm.js +20 -16
  28. package/dist/components/PullRequestsPage/PullRequestsPage.esm.js.map +1 -1
  29. package/dist/components/PullRequestsPage/lib/AutoCompleteIcon/AutoCompleteIcon.esm.js +2 -2
  30. package/dist/components/PullRequestsPage/lib/AutoCompleteIcon/AutoCompleteIcon.esm.js.map +1 -1
  31. package/dist/components/PullRequestsPage/lib/PullRequestCard/PullRequestCard.esm.js +37 -28
  32. package/dist/components/PullRequestsPage/lib/PullRequestCard/PullRequestCard.esm.js.map +1 -1
  33. package/dist/components/PullRequestsPage/lib/PullRequestCard/PullRequestCardPolicies.esm.js +2 -2
  34. package/dist/components/PullRequestsPage/lib/PullRequestCard/PullRequestCardPolicies.esm.js.map +1 -1
  35. package/dist/components/PullRequestsPage/lib/PullRequestCard/PullRequestCardPolicy.esm.js +11 -7
  36. package/dist/components/PullRequestsPage/lib/PullRequestCard/PullRequestCardPolicy.esm.js.map +1 -1
  37. package/dist/components/PullRequestsPage/lib/PullRequestCard/PullRequestCardReviewer.esm.js +2 -2
  38. package/dist/components/PullRequestsPage/lib/PullRequestCard/PullRequestCardReviewer.esm.js.map +1 -1
  39. package/dist/components/PullRequestsPage/lib/PullRequestCard/PullRequestCardReviewers.esm.js +2 -2
  40. package/dist/components/PullRequestsPage/lib/PullRequestCard/PullRequestCardReviewers.esm.js.map +1 -1
  41. package/dist/components/PullRequestsPage/lib/PullRequestGrid/PullRequestGrid.esm.js +5 -5
  42. package/dist/components/PullRequestsPage/lib/PullRequestGrid/PullRequestGrid.esm.js.map +1 -1
  43. package/dist/components/PullRequestsPage/lib/PullRequestGridColumn/PullRequestGridColumn.esm.js +10 -7
  44. package/dist/components/PullRequestsPage/lib/PullRequestGridColumn/PullRequestGridColumn.esm.js.map +1 -1
  45. package/dist/components/ReadmeCard/ReadmeCard.esm.js +14 -13
  46. package/dist/components/ReadmeCard/ReadmeCard.esm.js.map +1 -1
  47. package/dist/index.d.ts +7 -9
  48. package/package.json +14 -14
@@ -1,40 +1,44 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
1
2
  import Button from '@material-ui/core/Button';
2
3
  import ButtonGroup from '@material-ui/core/ButtonGroup';
3
4
  import { PullRequestStatus } from '@backstage-community/plugin-azure-devops-common';
4
- import React from 'react';
5
5
 
6
6
  const PullRequestStatusButtonGroup = ({
7
7
  status,
8
8
  setStatus
9
9
  }) => {
10
- return /* @__PURE__ */ React.createElement(ButtonGroup, { "aria-label": "outlined button group" }, /* @__PURE__ */ React.createElement(
11
- Button,
12
- {
13
- color: status === PullRequestStatus.Active ? "primary" : "default",
14
- onClick: () => {
15
- setStatus(PullRequestStatus.Active);
10
+ return /* @__PURE__ */ jsxs(ButtonGroup, { "aria-label": "outlined button group", children: [
11
+ /* @__PURE__ */ jsx(
12
+ Button,
13
+ {
14
+ color: status === PullRequestStatus.Active ? "primary" : "default",
15
+ onClick: () => {
16
+ setStatus(PullRequestStatus.Active);
17
+ },
18
+ children: "Active"
16
19
  }
17
- },
18
- "Active"
19
- ), /* @__PURE__ */ React.createElement(
20
- Button,
21
- {
22
- color: status === PullRequestStatus.Completed ? "primary" : "default",
23
- onClick: () => {
24
- setStatus(PullRequestStatus.Completed);
20
+ ),
21
+ /* @__PURE__ */ jsx(
22
+ Button,
23
+ {
24
+ color: status === PullRequestStatus.Completed ? "primary" : "default",
25
+ onClick: () => {
26
+ setStatus(PullRequestStatus.Completed);
27
+ },
28
+ children: "Completed"
25
29
  }
26
- },
27
- "Completed"
28
- ), /* @__PURE__ */ React.createElement(
29
- Button,
30
- {
31
- color: status === PullRequestStatus.Abandoned ? "primary" : "default",
32
- onClick: () => {
33
- setStatus(PullRequestStatus.Abandoned);
30
+ ),
31
+ /* @__PURE__ */ jsx(
32
+ Button,
33
+ {
34
+ color: status === PullRequestStatus.Abandoned ? "primary" : "default",
35
+ onClick: () => {
36
+ setStatus(PullRequestStatus.Abandoned);
37
+ },
38
+ children: "Abandoned"
34
39
  }
35
- },
36
- "Abandoned"
37
- ));
40
+ )
41
+ ] });
38
42
  };
39
43
 
40
44
  export { PullRequestStatusButtonGroup };
@@ -1 +1 @@
1
- {"version":3,"file":"PullRequestStatusButtonGroup.esm.js","sources":["../../../src/components/PullRequestStatusButtonGroup/PullRequestStatusButtonGroup.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 Button from '@material-ui/core/Button';\nimport ButtonGroup from '@material-ui/core/ButtonGroup';\n\nimport { PullRequestStatus } from '@backstage-community/plugin-azure-devops-common';\nimport React from 'react';\n\nexport const PullRequestStatusButtonGroup = ({\n status,\n setStatus,\n}: {\n status: PullRequestStatus;\n setStatus: (pullRequestStatus: PullRequestStatus) => void;\n}) => {\n return (\n <ButtonGroup aria-label=\"outlined button group\">\n <Button\n color={status === PullRequestStatus.Active ? 'primary' : 'default'}\n onClick={() => {\n setStatus(PullRequestStatus.Active);\n }}\n >\n Active\n </Button>\n <Button\n color={status === PullRequestStatus.Completed ? 'primary' : 'default'}\n onClick={() => {\n setStatus(PullRequestStatus.Completed);\n }}\n >\n Completed\n </Button>\n <Button\n color={status === PullRequestStatus.Abandoned ? 'primary' : 'default'}\n onClick={() => {\n setStatus(PullRequestStatus.Abandoned);\n }}\n >\n Abandoned\n </Button>\n </ButtonGroup>\n );\n};\n"],"names":[],"mappings":";;;;;AAsBO,MAAM,+BAA+B,CAAC;AAAA,EAC3C,MAAA;AAAA,EACA;AACF,CAGM,KAAA;AACJ,EACE,uBAAA,KAAA,CAAA,aAAA,CAAC,WAAY,EAAA,EAAA,YAAA,EAAW,uBACtB,EAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,KAAO,EAAA,MAAA,KAAW,iBAAkB,CAAA,MAAA,GAAS,SAAY,GAAA,SAAA;AAAA,MACzD,SAAS,MAAM;AACb,QAAA,SAAA,CAAU,kBAAkB,MAAM,CAAA;AAAA;AACpC,KAAA;AAAA,IACD;AAAA,GAGD,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,KAAO,EAAA,MAAA,KAAW,iBAAkB,CAAA,SAAA,GAAY,SAAY,GAAA,SAAA;AAAA,MAC5D,SAAS,MAAM;AACb,QAAA,SAAA,CAAU,kBAAkB,SAAS,CAAA;AAAA;AACvC,KAAA;AAAA,IACD;AAAA,GAGD,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,KAAO,EAAA,MAAA,KAAW,iBAAkB,CAAA,SAAA,GAAY,SAAY,GAAA,SAAA;AAAA,MAC5D,SAAS,MAAM;AACb,QAAA,SAAA,CAAU,kBAAkB,SAAS,CAAA;AAAA;AACvC,KAAA;AAAA,IACD;AAAA,GAGH,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"PullRequestStatusButtonGroup.esm.js","sources":["../../../src/components/PullRequestStatusButtonGroup/PullRequestStatusButtonGroup.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 Button from '@material-ui/core/Button';\nimport ButtonGroup from '@material-ui/core/ButtonGroup';\n\nimport { PullRequestStatus } from '@backstage-community/plugin-azure-devops-common';\n\nexport const PullRequestStatusButtonGroup = ({\n status,\n setStatus,\n}: {\n status: PullRequestStatus;\n setStatus: (pullRequestStatus: PullRequestStatus) => void;\n}) => {\n return (\n <ButtonGroup aria-label=\"outlined button group\">\n <Button\n color={status === PullRequestStatus.Active ? 'primary' : 'default'}\n onClick={() => {\n setStatus(PullRequestStatus.Active);\n }}\n >\n Active\n </Button>\n <Button\n color={status === PullRequestStatus.Completed ? 'primary' : 'default'}\n onClick={() => {\n setStatus(PullRequestStatus.Completed);\n }}\n >\n Completed\n </Button>\n <Button\n color={status === PullRequestStatus.Abandoned ? 'primary' : 'default'}\n onClick={() => {\n setStatus(PullRequestStatus.Abandoned);\n }}\n >\n Abandoned\n </Button>\n </ButtonGroup>\n );\n};\n"],"names":[],"mappings":";;;;;AAqBO,MAAM,+BAA+B,CAAC;AAAA,EAC3C,MAAA;AAAA,EACA;AACF,CAGM,KAAA;AACJ,EACE,uBAAA,IAAA,CAAC,WAAY,EAAA,EAAA,YAAA,EAAW,uBACtB,EAAA,QAAA,EAAA;AAAA,oBAAA,GAAA;AAAA,MAAC,MAAA;AAAA,MAAA;AAAA,QACC,KAAO,EAAA,MAAA,KAAW,iBAAkB,CAAA,MAAA,GAAS,SAAY,GAAA,SAAA;AAAA,QACzD,SAAS,MAAM;AACb,UAAA,SAAA,CAAU,kBAAkB,MAAM,CAAA;AAAA,SACpC;AAAA,QACD,QAAA,EAAA;AAAA;AAAA,KAED;AAAA,oBACA,GAAA;AAAA,MAAC,MAAA;AAAA,MAAA;AAAA,QACC,KAAO,EAAA,MAAA,KAAW,iBAAkB,CAAA,SAAA,GAAY,SAAY,GAAA,SAAA;AAAA,QAC5D,SAAS,MAAM;AACb,UAAA,SAAA,CAAU,kBAAkB,SAAS,CAAA;AAAA,SACvC;AAAA,QACD,QAAA,EAAA;AAAA;AAAA,KAED;AAAA,oBACA,GAAA;AAAA,MAAC,MAAA;AAAA,MAAA;AAAA,QACC,KAAO,EAAA,MAAA,KAAW,iBAAkB,CAAA,SAAA,GAAY,SAAY,GAAA,SAAA;AAAA,QAC5D,SAAS,MAAM;AACb,UAAA,SAAA,CAAU,kBAAkB,SAAS,CAAA;AAAA,SACvC;AAAA,QACD,QAAA,EAAA;AAAA;AAAA;AAED,GACF,EAAA,CAAA;AAEJ;;;;"}
@@ -1,8 +1,9 @@
1
+ import { jsx, jsxs } from 'react/jsx-runtime';
1
2
  import Box from '@material-ui/core/Box';
2
3
  import Chip from '@material-ui/core/Chip';
3
4
  import { ResponseErrorPanel, Table, Link } from '@backstage/core-components';
4
5
  import { PullRequestStatus } from '@backstage-community/plugin-azure-devops-common';
5
- import React, { useState } from 'react';
6
+ import { useState } from 'react';
6
7
  import { AzurePullRequestsIcon } from '../AzurePullRequestsIcon/AzurePullRequestsIcon.esm.js';
7
8
  import { DateTime } from 'luxon';
8
9
  import { PullRequestStatusButtonGroup } from '../PullRequestStatusButtonGroup/PullRequestStatusButtonGroup.esm.js';
@@ -20,15 +21,18 @@ const columns = [
20
21
  title: "Title",
21
22
  field: "title",
22
23
  width: "auto",
23
- render: (row) => /* @__PURE__ */ React.createElement(Box, { display: "flex", alignItems: "center" }, /* @__PURE__ */ React.createElement(Link, { to: row.link ?? "" }, row.title), row.isDraft && /* @__PURE__ */ React.createElement(Box, { paddingLeft: 1 }, /* @__PURE__ */ React.createElement(
24
- Chip,
25
- {
26
- label: "Draft",
27
- variant: "outlined",
28
- color: "secondary",
29
- size: "small"
30
- }
31
- )))
24
+ render: (row) => /* @__PURE__ */ jsxs(Box, { display: "flex", alignItems: "center", children: [
25
+ /* @__PURE__ */ jsx(Link, { to: row.link ?? "", children: row.title }),
26
+ row.isDraft && /* @__PURE__ */ jsx(Box, { paddingLeft: 1, children: /* @__PURE__ */ jsx(
27
+ Chip,
28
+ {
29
+ label: "Draft",
30
+ variant: "outlined",
31
+ color: "secondary",
32
+ size: "small"
33
+ }
34
+ ) })
35
+ ] })
32
36
  },
33
37
  {
34
38
  title: "Source",
@@ -61,9 +65,9 @@ const PullRequestTable = ({ defaultLimit }) => {
61
65
  pullRequestStatusState
62
66
  );
63
67
  if (error) {
64
- return /* @__PURE__ */ React.createElement(ResponseErrorPanel, { error });
68
+ return /* @__PURE__ */ jsx(ResponseErrorPanel, { error });
65
69
  }
66
- return /* @__PURE__ */ React.createElement(
70
+ return /* @__PURE__ */ jsx(
67
71
  Table,
68
72
  {
69
73
  isLoading: loading,
@@ -74,13 +78,20 @@ const PullRequestTable = ({ defaultLimit }) => {
74
78
  pageSize: 5,
75
79
  showEmptyDataSourceMessage: !loading
76
80
  },
77
- title: /* @__PURE__ */ React.createElement(Box, { display: "flex", alignItems: "center" }, /* @__PURE__ */ React.createElement(AzurePullRequestsIcon, { style: { fontSize: 30 } }), /* @__PURE__ */ React.createElement(Box, { mr: 1 }), "Azure Repos - Pull Requests (", items ? items.length : 0, ")", /* @__PURE__ */ React.createElement(Box, { position: "absolute", right: 320, top: 20 }, /* @__PURE__ */ React.createElement(
78
- PullRequestStatusButtonGroup,
79
- {
80
- status: pullRequestStatusState,
81
- setStatus: setPullRequestStatusState
82
- }
83
- ))),
81
+ title: /* @__PURE__ */ jsxs(Box, { display: "flex", alignItems: "center", children: [
82
+ /* @__PURE__ */ jsx(AzurePullRequestsIcon, { style: { fontSize: 30 } }),
83
+ /* @__PURE__ */ jsx(Box, { mr: 1 }),
84
+ "Azure Repos - Pull Requests (",
85
+ items ? items.length : 0,
86
+ ")",
87
+ /* @__PURE__ */ jsx(Box, { position: "absolute", right: 320, top: 20, children: /* @__PURE__ */ jsx(
88
+ PullRequestStatusButtonGroup,
89
+ {
90
+ status: pullRequestStatusState,
91
+ setStatus: setPullRequestStatusState
92
+ }
93
+ ) })
94
+ ] }),
84
95
  data: items ?? []
85
96
  }
86
97
  );
@@ -1 +1 @@
1
- {"version":3,"file":"PullRequestTable.esm.js","sources":["../../../src/components/PullRequestTable/PullRequestTable.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 Chip from '@material-ui/core/Chip';\nimport {\n Link,\n ResponseErrorPanel,\n Table,\n TableColumn,\n} from '@backstage/core-components';\nimport {\n PullRequest,\n PullRequestStatus,\n} from '@backstage-community/plugin-azure-devops-common';\nimport React, { useState } from 'react';\n\nimport { AzurePullRequestsIcon } from '../AzurePullRequestsIcon';\nimport { DateTime } from 'luxon';\nimport { PullRequestStatusButtonGroup } from '../PullRequestStatusButtonGroup';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport { usePullRequests } from '../../hooks/usePullRequests';\n\nconst columns: TableColumn[] = [\n {\n title: 'ID',\n field: 'pullRequestId',\n highlight: false,\n width: 'auto',\n },\n {\n title: 'Title',\n field: 'title',\n width: 'auto',\n render: (row: Partial<PullRequest>) => (\n <Box display=\"flex\" alignItems=\"center\">\n <Link to={row.link ?? ''}>{row.title}</Link>\n {row.isDraft && (\n <Box paddingLeft={1}>\n <Chip\n label=\"Draft\"\n variant=\"outlined\"\n color=\"secondary\"\n size=\"small\"\n />\n </Box>\n )}\n </Box>\n ),\n },\n {\n title: 'Source',\n field: 'sourceRefName',\n width: 'auto',\n },\n {\n title: 'Target',\n field: 'targetRefName',\n width: 'auto',\n },\n {\n title: 'Created By',\n field: 'createdBy',\n width: 'auto',\n },\n {\n title: 'Created',\n field: 'creationDate',\n width: 'auto',\n render: (row: Partial<PullRequest>) =>\n (row.creationDate\n ? DateTime.fromISO(row.creationDate)\n : DateTime.now()\n ).toRelative(),\n },\n];\n\ntype PullRequestTableProps = {\n defaultLimit?: number;\n};\n\nexport const PullRequestTable = ({ defaultLimit }: PullRequestTableProps) => {\n const [pullRequestStatusState, setPullRequestStatusState] =\n useState<PullRequestStatus>(PullRequestStatus.Active);\n const { entity } = useEntity();\n\n const { items, loading, error } = usePullRequests(\n entity,\n defaultLimit,\n pullRequestStatusState,\n );\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 <AzurePullRequestsIcon style={{ fontSize: 30 }} />\n <Box mr={1} />\n Azure Repos - Pull Requests ({items ? items.length : 0})\n <Box position=\"absolute\" right={320} top={20}>\n <PullRequestStatusButtonGroup\n status={pullRequestStatusState}\n setStatus={setPullRequestStatusState}\n />\n </Box>\n </Box>\n }\n data={items ?? []}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;AAoCA,MAAM,OAAyB,GAAA;AAAA,EAC7B;AAAA,IACE,KAAO,EAAA,IAAA;AAAA,IACP,KAAO,EAAA,eAAA;AAAA,IACP,SAAW,EAAA,KAAA;AAAA,IACX,KAAO,EAAA;AAAA,GACT;AAAA,EACA;AAAA,IACE,KAAO,EAAA,OAAA;AAAA,IACP,KAAO,EAAA,OAAA;AAAA,IACP,KAAO,EAAA,MAAA;AAAA,IACP,MAAA,EAAQ,CAAC,GACP,qBAAA,KAAA,CAAA,aAAA,CAAC,OAAI,OAAQ,EAAA,MAAA,EAAO,UAAW,EAAA,QAAA,EAAA,kBAC5B,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAK,IAAI,GAAI,C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A,IACA,YAAA;AAAA,IACA;AAAA,GACF;AAEA,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,KACE,kBAAA,KAAA,CAAA,aAAA,CAAC,GAAI,EAAA,EAAA,OAAA,EAAQ,QAAO,UAAW,EAAA,QAAA,EAAA,kBAC5B,KAAA,CAAA,aAAA,CAAA,qBAAA,EAAA,EAAsB,KAAO,EAAA,EAAE,QAAU,EAAA,EAAA,IAAM,CAChD,kBAAA,KAAA,CAAA,aAAA,CAAC,GAAI,EAAA,EAAA,EAAA,EAAI,CAAG,EAAA,CAAA,EAAE,+BACgB,EAAA,KAAA,GAAQ,MAAM,MAAS,GAAA,CAAA,EAAE,GACvD,kBAAA,KAAA,CAAA,aAAA,CAAC,OAAI,QAAS,EAAA,UAAA,EAAW,KAAO,EAAA,GAAA,EAAK,KAAK,EACxC,EAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,QAAC,4BAAA;AAAA,QAAA;AAAA,UACC,MAAQ,EAAA,sBAAA;AAAA,UACR,SAAW,EAAA;AAAA;AAAA,OAEf,CACF,CAAA;AAAA,MAEF,IAAA,EAAM,SAAS;AAAC;AAAA,GAClB;AAEJ;;;;"}
1
+ {"version":3,"file":"PullRequestTable.esm.js","sources":["../../../src/components/PullRequestTable/PullRequestTable.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 Chip from '@material-ui/core/Chip';\nimport {\n Link,\n ResponseErrorPanel,\n Table,\n TableColumn,\n} from '@backstage/core-components';\nimport {\n PullRequest,\n PullRequestStatus,\n} from '@backstage-community/plugin-azure-devops-common';\nimport { useState } from 'react';\n\nimport { AzurePullRequestsIcon } from '../AzurePullRequestsIcon';\nimport { DateTime } from 'luxon';\nimport { PullRequestStatusButtonGroup } from '../PullRequestStatusButtonGroup';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport { usePullRequests } from '../../hooks/usePullRequests';\n\nconst columns: TableColumn[] = [\n {\n title: 'ID',\n field: 'pullRequestId',\n highlight: false,\n width: 'auto',\n },\n {\n title: 'Title',\n field: 'title',\n width: 'auto',\n render: (row: Partial<PullRequest>) => (\n <Box display=\"flex\" alignItems=\"center\">\n <Link to={row.link ?? ''}>{row.title}</Link>\n {row.isDraft && (\n <Box paddingLeft={1}>\n <Chip\n label=\"Draft\"\n variant=\"outlined\"\n color=\"secondary\"\n size=\"small\"\n />\n </Box>\n )}\n </Box>\n ),\n },\n {\n title: 'Source',\n field: 'sourceRefName',\n width: 'auto',\n },\n {\n title: 'Target',\n field: 'targetRefName',\n width: 'auto',\n },\n {\n title: 'Created By',\n field: 'createdBy',\n width: 'auto',\n },\n {\n title: 'Created',\n field: 'creationDate',\n width: 'auto',\n render: (row: Partial<PullRequest>) =>\n (row.creationDate\n ? DateTime.fromISO(row.creationDate)\n : DateTime.now()\n ).toRelative(),\n },\n];\n\ntype PullRequestTableProps = {\n defaultLimit?: number;\n};\n\nexport const PullRequestTable = ({ defaultLimit }: PullRequestTableProps) => {\n const [pullRequestStatusState, setPullRequestStatusState] =\n useState<PullRequestStatus>(PullRequestStatus.Active);\n const { entity } = useEntity();\n\n const { items, loading, error } = usePullRequests(\n entity,\n defaultLimit,\n pullRequestStatusState,\n );\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 <AzurePullRequestsIcon style={{ fontSize: 30 }} />\n <Box mr={1} />\n Azure Repos - Pull Requests ({items ? items.length : 0})\n <Box position=\"absolute\" right={320} top={20}>\n <PullRequestStatusButtonGroup\n status={pullRequestStatusState}\n setStatus={setPullRequestStatusState}\n />\n </Box>\n </Box>\n }\n data={items ?? []}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;AAoCA,MAAM,OAAyB,GAAA;AAAA,EAC7B;AAAA,IACE,KAAO,EAAA,IAAA;AAAA,IACP,KAAO,EAAA,eAAA;AAAA,IACP,SAAW,EAAA,KAAA;AAAA,IACX,KAAO,EAAA;AAAA,GACT;AAAA,EACA;AAAA,IACE,KAAO,EAAA,OAAA;AAAA,IACP,KAAO,EAAA,OAAA;AAAA,IACP,KAAO,EAAA,MAAA;AAAA,IACP,MAAA,EAAQ,CAAC,GACP,qBAAA,IAAA,CAAC,OAAI,OAAQ,EAAA,MAAA,EAAO,YAAW,QAC7B,EAAA,QAAA,EAAA;AAAA,sBAAA,GAAA,CAAC,QAAK,EAAI,EAAA,GAAA,CAAI,IAAQ,IAAA,EAAA,EAAK,cAAI,KAAM,EAAA,CAAA;AAAA,MACpC,GAAI,CAAA,OAAA,oBACF,GAAA,CAAA,GAAA,EAAA,EAAI,aAAa,CAChB,EAAA,QAAA,kBAAA,GAAA;AAAA,QAAC,IAAA;AAAA,QAAA;AAAA,UACC,KAAM,EAAA,OAAA;AAAA,UACN,OAAQ,EAAA,UAAA;AAAA,UACR,KAAM,EAAA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,EAAA,IAAA;AAAA,QACR,MAAQ,EAAA,IAAA;AAAA,QACR,QAAU,EAAA,CAAA;AAAA,QACV,4BAA4B,CAAC;AAAA,OAC/B;AAAA,MACA,uBACG,IAAA,CAAA,GAAA,EAAA,EAAI,OAAQ,EAAA,MAAA,EAAO,YAAW,QAC7B,EAAA,QAAA,EAAA;AAAA,wBAAA,GAAA,CAAC,qBAAsB,EAAA,EAAA,KAAA,EAAO,EAAE,QAAA,EAAU,IAAM,EAAA,CAAA;AAAA,wBAChD,GAAA,CAAC,GAAI,EAAA,EAAA,EAAA,EAAI,CAAG,EAAA,CAAA;AAAA,QAAE,+BAAA;AAAA,QACgB,KAAA,GAAQ,MAAM,MAAS,GAAA,CAAA;AAAA,QAAE,GAAA;AAAA,4BACtD,GAAI,EAAA,EAAA,QAAA,EAAS,YAAW,KAAO,EAAA,GAAA,EAAK,KAAK,EACxC,EAAA,QAAA,kBAAA,GAAA;AAAA,UAAC,4BAAA;AAAA,UAAA;AAAA,YACC,MAAQ,EAAA,sBAAA;AAAA,YACR,SAAW,EAAA;AAAA;AAAA,SAEf,EAAA;AAAA,OACF,EAAA,CAAA;AAAA,MAEF,IAAA,EAAM,SAAS;AAAC;AAAA,GAClB;AAEJ;;;;"}
@@ -1,5 +1,6 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
1
2
  import { Page, Header, Content, Progress, ResponseErrorPanel } from '@backstage/core-components';
2
- import React, { useState } from 'react';
3
+ import { useState } from 'react';
3
4
  import { getPullRequestGroupConfigs, getPullRequestGroups } from './lib/utils.esm.js';
4
5
  import { FilterType } from './lib/filters/types.esm.js';
5
6
  import 'luxon';
@@ -21,12 +22,12 @@ const PullRequestsPageContent = ({
21
22
  error
22
23
  }) => {
23
24
  if (loading && (!pullRequestGroups || pullRequestGroups.length <= 0)) {
24
- return /* @__PURE__ */ React.createElement(Progress, null);
25
+ return /* @__PURE__ */ jsx(Progress, {});
25
26
  }
26
27
  if (error) {
27
- return /* @__PURE__ */ React.createElement(ResponseErrorPanel, { error });
28
+ return /* @__PURE__ */ jsx(ResponseErrorPanel, { error });
28
29
  }
29
- return /* @__PURE__ */ React.createElement(PullRequestGrid, { pullRequestGroups: pullRequestGroups ?? [] });
30
+ return /* @__PURE__ */ jsx(PullRequestGrid, { pullRequestGroups: pullRequestGroups ?? [] });
30
31
  };
31
32
  const DEFAULT_COLUMN_CONFIGS = [
32
33
  {
@@ -59,20 +60,23 @@ const PullRequestsPage = (props) => {
59
60
  pullRequests,
60
61
  pullRequestGroupConfigs
61
62
  );
62
- return /* @__PURE__ */ React.createElement(Page, { themeId: "tool" }, /* @__PURE__ */ React.createElement(Header, { title: "Azure Pull Requests" }), /* @__PURE__ */ React.createElement(Content, null, /* @__PURE__ */ React.createElement(
63
- RequirePermission,
64
- {
65
- permission: azureDevOpsPullRequestDashboardReadPermission
66
- },
67
- /* @__PURE__ */ React.createElement(
68
- PullRequestsPageContent,
63
+ return /* @__PURE__ */ jsxs(Page, { themeId: "tool", children: [
64
+ /* @__PURE__ */ jsx(Header, { title: "Azure Pull Requests" }),
65
+ /* @__PURE__ */ jsx(Content, { children: /* @__PURE__ */ jsx(
66
+ RequirePermission,
69
67
  {
70
- pullRequestGroups,
71
- loading,
72
- error
68
+ permission: azureDevOpsPullRequestDashboardReadPermission,
69
+ children: /* @__PURE__ */ jsx(
70
+ PullRequestsPageContent,
71
+ {
72
+ pullRequestGroups,
73
+ loading,
74
+ error
75
+ }
76
+ )
73
77
  }
74
- )
75
- )));
78
+ ) })
79
+ ] });
76
80
  };
77
81
 
78
82
  export { PullRequestsPage };
@@ -1 +1 @@
1
- {"version":3,"file":"PullRequestsPage.esm.js","sources":["../../../src/components/PullRequestsPage/PullRequestsPage.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 {\n Content,\n Header,\n Page,\n Progress,\n ResponseErrorPanel,\n} from '@backstage/core-components';\nimport { PullRequestColumnConfig, PullRequestGroup } from './lib/types';\nimport React, { useState } from 'react';\nimport { getPullRequestGroupConfigs, getPullRequestGroups } from './lib/utils';\nimport { FilterType } from './lib/filters';\nimport { PullRequestGrid } from './lib/PullRequestGrid';\nimport { useDashboardPullRequests } from '../../hooks';\nimport { useFilterProcessor } from './lib/hooks';\nimport { RequirePermission } from '@backstage/plugin-permission-react';\nimport { azureDevOpsPullRequestDashboardReadPermission } from '@backstage-community/plugin-azure-devops-common';\n\ntype PullRequestsPageContentProps = {\n pullRequestGroups: PullRequestGroup[] | undefined;\n loading: boolean;\n error?: Error;\n};\n\nconst PullRequestsPageContent = ({\n pullRequestGroups,\n loading,\n error,\n}: PullRequestsPageContentProps) => {\n if (loading && (!pullRequestGroups || pullRequestGroups.length <= 0)) {\n return <Progress />;\n }\n\n if (error) {\n return <ResponseErrorPanel error={error} />;\n }\n\n return <PullRequestGrid pullRequestGroups={pullRequestGroups ?? []} />;\n};\n\nconst DEFAULT_COLUMN_CONFIGS: PullRequestColumnConfig[] = [\n {\n title: 'Created by me',\n filters: [{ type: FilterType.CreatedByCurrentUser }],\n simplified: false,\n },\n {\n title: 'Other PRs',\n filters: [{ type: FilterType.All }],\n simplified: true,\n },\n];\n\ntype PullRequestsPageProps = {\n projectName?: string;\n pollingInterval?: number;\n defaultColumnConfigs?: PullRequestColumnConfig[];\n teamsLimit?: number;\n};\n\nexport const PullRequestsPage = (props: PullRequestsPageProps) => {\n const { projectName, pollingInterval, defaultColumnConfigs, teamsLimit } =\n props;\n\n const { pullRequests, loading, error } = useDashboardPullRequests(\n projectName,\n pollingInterval,\n teamsLimit,\n );\n\n const [columnConfigs] = useState(\n defaultColumnConfigs ?? DEFAULT_COLUMN_CONFIGS,\n );\n\n const filterProcessor = useFilterProcessor();\n\n const pullRequestGroupConfigs = getPullRequestGroupConfigs(\n columnConfigs,\n filterProcessor,\n );\n\n const pullRequestGroups = getPullRequestGroups(\n pullRequests,\n pullRequestGroupConfigs,\n );\n\n return (\n <Page themeId=\"tool\">\n <Header title=\"Azure Pull Requests\" />\n <Content>\n <RequirePermission\n permission={azureDevOpsPullRequestDashboardReadPermission}\n >\n <PullRequestsPageContent\n pullRequestGroups={pullRequestGroups}\n loading={loading}\n error={error}\n />\n </RequirePermission>\n </Content>\n </Page>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAuCA,MAAM,0BAA0B,CAAC;AAAA,EAC/B,iBAAA;AAAA,EACA,OAAA;AAAA,EACA;AACF,CAAoC,KAAA;AAClC,EAAA,IAAI,OAAY,KAAA,CAAC,iBAAqB,IAAA,iBAAA,CAAkB,UAAU,CAAI,CAAA,EAAA;AACpE,IAAA,2CAAQ,QAAS,EAAA,IAAA,CAAA;AAAA;AAGnB,EAAA,IAAI,KAAO,EAAA;AACT,IAAO,uBAAA,KAAA,CAAA,aAAA,CAAC,sBAAmB,KAAc,EAAA,CAAA;AAAA;AAG3C,EAAA,uBAAQ,KAAA,CAAA,aAAA,CAAA,eAAA,EAAA,EAAgB,iBAAmB,EAAA,iBAAA,IAAqB,EAAI,EAAA,CAAA;AACtE,CAAA;AAEA,MAAM,sBAAoD,GAAA;AAAA,EACxD;AAAA,IACE,KAAO,EAAA,eAAA;AAAA,IACP,SAAS,CAAC,EAAE,IAAM,EAAA,UAAA,CAAW,sBAAsB,CAAA;AAAA,IACnD,UAAY,EAAA;AAAA,GACd;AAAA,EACA;AAAA,IACE,KAAO,EAAA,WAAA;AAAA,IACP,SAAS,CAAC,EAAE,IAAM,EAAA,UAAA,CAAW,KAAK,CAAA;AAAA,IAClC,UAAY,EAAA;AAAA;AAEhB,CAAA;AASa,MAAA,gBAAA,GAAmB,CAAC,KAAiC,KAAA;AAChE,EAAA,MAAM,EAAE,WAAA,EAAa,eAAiB,EAAA,oBAAA,EAAsB,YAC1D,GAAA,KAAA;AAEF,EAAA,MAAM,EAAE,YAAA,EAAc,OAAS,EAAA,KAAA,EAAU,GAAA,wBAAA;AAAA,IACvC,WAAA;AAAA,IACA,eAAA;AAAA,IACA;AAAA,GACF;AAEA,EAAM,MAAA,CAAC,aAAa,CAAI,GAAA,QAAA;AAAA,IACtB,oBAAwB,IAAA;AAAA,GAC1B;AAEA,EAAA,MAAM,kBAAkB,kBAAmB,EAAA;AAE3C,EAAA,MAAM,uBAA0B,GAAA,0BAAA;AAAA,IAC9B,aAAA;AAAA,IACA;AAAA,GACF;AAEA,EAAA,MAAM,iBAAoB,GAAA,oBAAA;AAAA,IACxB,YAAA;AAAA,IACA;AAAA,GACF;AAEA,EACE,uBAAA,KAAA,CAAA,aAAA,CAAC,IAAK,EAAA,EAAA,OAAA,EAAQ,MACZ,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,UAAO,KAAM,EAAA,qBAAA,EAAsB,CACpC,kBAAA,KAAA,CAAA,aAAA,CAAC,OACC,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,iBAAA;AAAA,IAAA;AAAA,MACC,UAAY,EAAA;AAAA,KAAA;AAAA,oBAEZ,KAAA,CAAA,aAAA;AAAA,MAAC,uBAAA;AAAA,MAAA;AAAA,QACC,iBAAA;AAAA,QACA,OAAA;AAAA,QACA;AAAA;AAAA;AACF,GAEJ,CACF,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"PullRequestsPage.esm.js","sources":["../../../src/components/PullRequestsPage/PullRequestsPage.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 {\n Content,\n Header,\n Page,\n Progress,\n ResponseErrorPanel,\n} from '@backstage/core-components';\nimport { PullRequestColumnConfig, PullRequestGroup } from './lib/types';\nimport { useState } from 'react';\nimport { getPullRequestGroupConfigs, getPullRequestGroups } from './lib/utils';\nimport { FilterType } from './lib/filters';\nimport { PullRequestGrid } from './lib/PullRequestGrid';\nimport { useDashboardPullRequests } from '../../hooks';\nimport { useFilterProcessor } from './lib/hooks';\nimport { RequirePermission } from '@backstage/plugin-permission-react';\nimport { azureDevOpsPullRequestDashboardReadPermission } from '@backstage-community/plugin-azure-devops-common';\n\ntype PullRequestsPageContentProps = {\n pullRequestGroups: PullRequestGroup[] | undefined;\n loading: boolean;\n error?: Error;\n};\n\nconst PullRequestsPageContent = ({\n pullRequestGroups,\n loading,\n error,\n}: PullRequestsPageContentProps) => {\n if (loading && (!pullRequestGroups || pullRequestGroups.length <= 0)) {\n return <Progress />;\n }\n\n if (error) {\n return <ResponseErrorPanel error={error} />;\n }\n\n return <PullRequestGrid pullRequestGroups={pullRequestGroups ?? []} />;\n};\n\nconst DEFAULT_COLUMN_CONFIGS: PullRequestColumnConfig[] = [\n {\n title: 'Created by me',\n filters: [{ type: FilterType.CreatedByCurrentUser }],\n simplified: false,\n },\n {\n title: 'Other PRs',\n filters: [{ type: FilterType.All }],\n simplified: true,\n },\n];\n\ntype PullRequestsPageProps = {\n projectName?: string;\n pollingInterval?: number;\n defaultColumnConfigs?: PullRequestColumnConfig[];\n teamsLimit?: number;\n};\n\nexport const PullRequestsPage = (props: PullRequestsPageProps) => {\n const { projectName, pollingInterval, defaultColumnConfigs, teamsLimit } =\n props;\n\n const { pullRequests, loading, error } = useDashboardPullRequests(\n projectName,\n pollingInterval,\n teamsLimit,\n );\n\n const [columnConfigs] = useState(\n defaultColumnConfigs ?? DEFAULT_COLUMN_CONFIGS,\n );\n\n const filterProcessor = useFilterProcessor();\n\n const pullRequestGroupConfigs = getPullRequestGroupConfigs(\n columnConfigs,\n filterProcessor,\n );\n\n const pullRequestGroups = getPullRequestGroups(\n pullRequests,\n pullRequestGroupConfigs,\n );\n\n return (\n <Page themeId=\"tool\">\n <Header title=\"Azure Pull Requests\" />\n <Content>\n <RequirePermission\n permission={azureDevOpsPullRequestDashboardReadPermission}\n >\n <PullRequestsPageContent\n pullRequestGroups={pullRequestGroups}\n loading={loading}\n error={error}\n />\n </RequirePermission>\n </Content>\n </Page>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAuCA,MAAM,0BAA0B,CAAC;AAAA,EAC/B,iBAAA;AAAA,EACA,OAAA;AAAA,EACA;AACF,CAAoC,KAAA;AAClC,EAAA,IAAI,OAAY,KAAA,CAAC,iBAAqB,IAAA,iBAAA,CAAkB,UAAU,CAAI,CAAA,EAAA;AACpE,IAAA,2BAAQ,QAAS,EAAA,EAAA,CAAA;AAAA;AAGnB,EAAA,IAAI,KAAO,EAAA;AACT,IAAO,uBAAA,GAAA,CAAC,sBAAmB,KAAc,EAAA,CAAA;AAAA;AAG3C,EAAA,uBAAQ,GAAA,CAAA,eAAA,EAAA,EAAgB,iBAAmB,EAAA,iBAAA,IAAqB,EAAI,EAAA,CAAA;AACtE,CAAA;AAEA,MAAM,sBAAoD,GAAA;AAAA,EACxD;AAAA,IACE,KAAO,EAAA,eAAA;AAAA,IACP,SAAS,CAAC,EAAE,IAAM,EAAA,UAAA,CAAW,sBAAsB,CAAA;AAAA,IACnD,UAAY,EAAA;AAAA,GACd;AAAA,EACA;AAAA,IACE,KAAO,EAAA,WAAA;AAAA,IACP,SAAS,CAAC,EAAE,IAAM,EAAA,UAAA,CAAW,KAAK,CAAA;AAAA,IAClC,UAAY,EAAA;AAAA;AAEhB,CAAA;AASa,MAAA,gBAAA,GAAmB,CAAC,KAAiC,KAAA;AAChE,EAAA,MAAM,EAAE,WAAA,EAAa,eAAiB,EAAA,oBAAA,EAAsB,YAC1D,GAAA,KAAA;AAEF,EAAA,MAAM,EAAE,YAAA,EAAc,OAAS,EAAA,KAAA,EAAU,GAAA,wBAAA;AAAA,IACvC,WAAA;AAAA,IACA,eAAA;AAAA,IACA;AAAA,GACF;AAEA,EAAM,MAAA,CAAC,aAAa,CAAI,GAAA,QAAA;AAAA,IACtB,oBAAwB,IAAA;AAAA,GAC1B;AAEA,EAAA,MAAM,kBAAkB,kBAAmB,EAAA;AAE3C,EAAA,MAAM,uBAA0B,GAAA,0BAAA;AAAA,IAC9B,aAAA;AAAA,IACA;AAAA,GACF;AAEA,EAAA,MAAM,iBAAoB,GAAA,oBAAA;AAAA,IACxB,YAAA;AAAA,IACA;AAAA,GACF;AAEA,EACE,uBAAA,IAAA,CAAC,IAAK,EAAA,EAAA,OAAA,EAAQ,MACZ,EAAA,QAAA,EAAA;AAAA,oBAAC,GAAA,CAAA,MAAA,EAAA,EAAO,OAAM,qBAAsB,EAAA,CAAA;AAAA,wBACnC,OACC,EAAA,EAAA,QAAA,kBAAA,GAAA;AAAA,MAAC,iBAAA;AAAA,MAAA;AAAA,QACC,UAAY,EAAA,6CAAA;AAAA,QAEZ,QAAA,kBAAA,GAAA;AAAA,UAAC,uBAAA;AAAA,UAAA;AAAA,YACC,iBAAA;AAAA,YACA,OAAA;AAAA,YACA;AAAA;AAAA;AACF;AAAA,KAEJ,EAAA;AAAA,GACF,EAAA,CAAA;AAEJ;;;;"}
@@ -1,5 +1,5 @@
1
+ import { jsx } from 'react/jsx-runtime';
1
2
  import DoneAllIcon from '@material-ui/icons/DoneAll';
2
- import React from 'react';
3
3
  import { makeStyles } from '@material-ui/core/styles';
4
4
 
5
5
  const useStyles = makeStyles((theme) => ({
@@ -9,7 +9,7 @@ const useStyles = makeStyles((theme) => ({
9
9
  }));
10
10
  const AutoCompleteIcon = (props) => {
11
11
  const classes = useStyles(props);
12
- return /* @__PURE__ */ React.createElement(DoneAllIcon, { className: classes.root });
12
+ return /* @__PURE__ */ jsx(DoneAllIcon, { className: classes.root });
13
13
  };
14
14
 
15
15
  export { AutoCompleteIcon };
@@ -1 +1 @@
1
- {"version":3,"file":"AutoCompleteIcon.esm.js","sources":["../../../../../src/components/PullRequestsPage/lib/AutoCompleteIcon/AutoCompleteIcon.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 DoneAllIcon from '@material-ui/icons/DoneAll';\nimport React from 'react';\nimport { makeStyles } from '@material-ui/core/styles';\n\nconst useStyles = makeStyles(theme => ({\n root: (props: { hasAutoComplete: boolean }) => ({\n color: props.hasAutoComplete\n ? theme.palette.success.main\n : theme.palette.grey[400],\n }),\n}));\n\nexport const AutoCompleteIcon = (props: { hasAutoComplete: boolean }) => {\n const classes = useStyles(props);\n return <DoneAllIcon className={classes.root} />;\n};\n"],"names":[],"mappings":";;;;AAoBA,MAAM,SAAA,GAAY,WAAW,CAAU,KAAA,MAAA;AAAA,EACrC,IAAA,EAAM,CAAC,KAAyC,MAAA;AAAA,IAC9C,KAAA,EAAO,KAAM,CAAA,eAAA,GACT,KAAM,CAAA,OAAA,CAAQ,QAAQ,IACtB,GAAA,KAAA,CAAM,OAAQ,CAAA,IAAA,CAAK,GAAG;AAAA,GAC5B;AACF,CAAE,CAAA,CAAA;AAEW,MAAA,gBAAA,GAAmB,CAAC,KAAwC,KAAA;AACvE,EAAM,MAAA,OAAA,GAAU,UAAU,KAAK,CAAA;AAC/B,EAAA,uBAAQ,KAAA,CAAA,aAAA,CAAA,WAAA,EAAA,EAAY,SAAW,EAAA,OAAA,CAAQ,IAAM,EAAA,CAAA;AAC/C;;;;"}
1
+ {"version":3,"file":"AutoCompleteIcon.esm.js","sources":["../../../../../src/components/PullRequestsPage/lib/AutoCompleteIcon/AutoCompleteIcon.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 DoneAllIcon from '@material-ui/icons/DoneAll';\nimport { makeStyles } from '@material-ui/core/styles';\n\nconst useStyles = makeStyles(theme => ({\n root: (props: { hasAutoComplete: boolean }) => ({\n color: props.hasAutoComplete\n ? theme.palette.success.main\n : theme.palette.grey[400],\n }),\n}));\n\nexport const AutoCompleteIcon = (props: { hasAutoComplete: boolean }) => {\n const classes = useStyles(props);\n return <DoneAllIcon className={classes.root} />;\n};\n"],"names":[],"mappings":";;;;AAmBA,MAAM,SAAA,GAAY,WAAW,CAAU,KAAA,MAAA;AAAA,EACrC,IAAA,EAAM,CAAC,KAAyC,MAAA;AAAA,IAC9C,KAAA,EAAO,KAAM,CAAA,eAAA,GACT,KAAM,CAAA,OAAA,CAAQ,QAAQ,IACtB,GAAA,KAAA,CAAM,OAAQ,CAAA,IAAA,CAAK,GAAG;AAAA,GAC5B;AACF,CAAE,CAAA,CAAA;AAEW,MAAA,gBAAA,GAAmB,CAAC,KAAwC,KAAA;AACvE,EAAM,MAAA,OAAA,GAAU,UAAU,KAAK,CAAA;AAC/B,EAAA,uBAAQ,GAAA,CAAA,WAAA,EAAA,EAAY,SAAW,EAAA,OAAA,CAAQ,IAAM,EAAA,CAAA;AAC/C;;;;"}
@@ -1,3 +1,4 @@
1
+ import { jsx, jsxs } from 'react/jsx-runtime';
1
2
  import { Link, Avatar } from '@backstage/core-components';
2
3
  import Card from '@material-ui/core/Card';
3
4
  import CardContent from '@material-ui/core/CardContent';
@@ -7,7 +8,6 @@ import { AutoCompleteIcon } from '../AutoCompleteIcon/AutoCompleteIcon.esm.js';
7
8
  import { DateTime } from 'luxon';
8
9
  import { PullRequestCardPolicies } from './PullRequestCardPolicies.esm.js';
9
10
  import { PullRequestCardReviewers } from './PullRequestCardReviewers.esm.js';
10
- import React from 'react';
11
11
  import { makeStyles } from '@material-ui/core/styles';
12
12
 
13
13
  const useStyles = makeStyles(
@@ -40,11 +40,15 @@ const PullRequestCard = ({
40
40
  simplified
41
41
  }) => {
42
42
  const classes = useStyles();
43
- const title = /* @__PURE__ */ React.createElement(Link, { to: pullRequest.link ?? "", title: pullRequest.description }, pullRequest.title);
44
- const repoLink = /* @__PURE__ */ React.createElement(Link, { to: pullRequest.repository?.url ?? "", color: "inherit" }, pullRequest.repository?.name);
43
+ const title = /* @__PURE__ */ jsx(Link, { to: pullRequest.link ?? "", title: pullRequest.description, children: pullRequest.title });
44
+ const repoLink = /* @__PURE__ */ jsx(Link, { to: pullRequest.repository?.url ?? "", color: "inherit", children: pullRequest.repository?.name });
45
45
  const creationDate = pullRequest.creationDate ? DateTime.fromISO(pullRequest.creationDate).toRelative() : void 0;
46
- const subheader = /* @__PURE__ */ React.createElement(Typography, { component: "span" }, repoLink, " \xB7 ", creationDate);
47
- const avatar = /* @__PURE__ */ React.createElement(
46
+ const subheader = /* @__PURE__ */ jsxs(Typography, { component: "span", children: [
47
+ repoLink,
48
+ " \xB7 ",
49
+ creationDate
50
+ ] });
51
+ const avatar = /* @__PURE__ */ jsx(
48
52
  Avatar,
49
53
  {
50
54
  displayName: pullRequest.createdBy?.displayName,
@@ -52,32 +56,37 @@ const PullRequestCard = ({
52
56
  classes: { avatar: classes.avatar, avatarText: classes.avatarText }
53
57
  }
54
58
  );
55
- return /* @__PURE__ */ React.createElement(
59
+ return /* @__PURE__ */ jsxs(
56
60
  Card,
57
61
  {
58
62
  classes: { root: classes.card },
59
- "data-pull-request-id": pullRequest.pullRequestId
60
- },
61
- /* @__PURE__ */ React.createElement(
62
- CardHeader,
63
- {
64
- avatar,
65
- title,
66
- subheader,
67
- action: /* @__PURE__ */ React.createElement(AutoCompleteIcon, { hasAutoComplete: pullRequest.hasAutoComplete }),
68
- classes: {
69
- ...simplified && { root: classes.cardHeaderSimplified },
70
- action: classes.cardHeaderAction
71
- }
72
- }
73
- ),
74
- !simplified && /* @__PURE__ */ React.createElement(CardContent, { className: classes.content }, pullRequest.policies && /* @__PURE__ */ React.createElement(
75
- PullRequestCardPolicies,
76
- {
77
- policies: pullRequest.policies,
78
- className: classes.policies
79
- }
80
- ), pullRequest.reviewers && /* @__PURE__ */ React.createElement(PullRequestCardReviewers, { reviewers: pullRequest.reviewers }))
63
+ "data-pull-request-id": pullRequest.pullRequestId,
64
+ children: [
65
+ /* @__PURE__ */ jsx(
66
+ CardHeader,
67
+ {
68
+ avatar,
69
+ title,
70
+ subheader,
71
+ action: /* @__PURE__ */ jsx(AutoCompleteIcon, { hasAutoComplete: pullRequest.hasAutoComplete }),
72
+ classes: {
73
+ ...simplified && { root: classes.cardHeaderSimplified },
74
+ action: classes.cardHeaderAction
75
+ }
76
+ }
77
+ ),
78
+ !simplified && /* @__PURE__ */ jsxs(CardContent, { className: classes.content, children: [
79
+ pullRequest.policies && /* @__PURE__ */ jsx(
80
+ PullRequestCardPolicies,
81
+ {
82
+ policies: pullRequest.policies,
83
+ className: classes.policies
84
+ }
85
+ ),
86
+ pullRequest.reviewers && /* @__PURE__ */ jsx(PullRequestCardReviewers, { reviewers: pullRequest.reviewers })
87
+ ] })
88
+ ]
89
+ }
81
90
  );
82
91
  };
83
92
 
@@ -1 +1 @@
1
- {"version":3,"file":"PullRequestCard.esm.js","sources":["../../../../../src/components/PullRequestsPage/lib/PullRequestCard/PullRequestCard.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 { Avatar, Link } from '@backstage/core-components';\nimport Card from '@material-ui/core/Card';\nimport CardContent from '@material-ui/core/CardContent';\nimport CardHeader from '@material-ui/core/CardHeader';\nimport Typography from '@material-ui/core/Typography';\n\nimport { AutoCompleteIcon } from '../AutoCompleteIcon';\nimport { DashboardPullRequest } from '@backstage-community/plugin-azure-devops-common';\nimport { DateTime } from 'luxon';\nimport { PullRequestCardPolicies } from './PullRequestCardPolicies';\nimport { PullRequestCardReviewers } from './PullRequestCardReviewers';\nimport React from 'react';\nimport { makeStyles } from '@material-ui/core/styles';\n\nconst useStyles = makeStyles(\n theme => ({\n card: {\n backgroundColor:\n theme.palette.type === 'dark'\n ? theme.palette.grey[700]\n : theme.palette.common.white,\n },\n cardHeaderSimplified: {\n paddingBottom: theme.spacing(2),\n },\n cardHeaderAction: {\n display: 'flex',\n alignSelf: 'center',\n margin: 0,\n },\n content: {\n display: 'flex',\n flexDirection: 'row',\n },\n policies: {\n flex: 1,\n },\n avatar: { width: '2.5rem', height: '2.5rem' },\n avatarText: { fontSize: '1rem' },\n }),\n { name: 'PullRequestCard' },\n);\n\ntype PullRequestCardProps = {\n pullRequest: DashboardPullRequest;\n simplified?: boolean;\n};\n\nexport const PullRequestCard = ({\n pullRequest,\n simplified,\n}: PullRequestCardProps) => {\n const classes = useStyles();\n\n const title = (\n <Link to={pullRequest.link ?? ''} title={pullRequest.description}>\n {pullRequest.title}\n </Link>\n );\n\n const repoLink = (\n <Link to={pullRequest.repository?.url ?? ''} color=\"inherit\">\n {pullRequest.repository?.name}\n </Link>\n );\n\n const creationDate = pullRequest.creationDate\n ? DateTime.fromISO(pullRequest.creationDate).toRelative()\n : undefined;\n\n const subheader = (\n <Typography component=\"span\">\n {repoLink} · {creationDate}\n </Typography>\n );\n\n const avatar = (\n <Avatar\n displayName={pullRequest.createdBy?.displayName}\n picture={pullRequest.createdBy?.imageUrl}\n classes={{ avatar: classes.avatar, avatarText: classes.avatarText }}\n />\n );\n\n return (\n <Card\n classes={{ root: classes.card }}\n data-pull-request-id={pullRequest.pullRequestId}\n >\n <CardHeader\n avatar={avatar}\n title={title}\n subheader={subheader}\n action={\n <AutoCompleteIcon hasAutoComplete={pullRequest.hasAutoComplete} />\n }\n classes={{\n ...(simplified && { root: classes.cardHeaderSimplified }),\n action: classes.cardHeaderAction,\n }}\n />\n\n {!simplified && (\n <CardContent className={classes.content}>\n {pullRequest.policies && (\n <PullRequestCardPolicies\n policies={pullRequest.policies}\n className={classes.policies}\n />\n )}\n\n {pullRequest.reviewers && (\n <PullRequestCardReviewers reviewers={pullRequest.reviewers} />\n )}\n </CardContent>\n )}\n </Card>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;AA8BA,MAAM,SAAY,GAAA,UAAA;AAAA,EAChB,CAAU,KAAA,MAAA;AAAA,IACR,IAAM,EAAA;AAAA,MACJ,eACE,EAAA,KAAA,CAAM,OAAQ,CAAA,IAAA,KAAS,MACnB,GAAA,KAAA,CAAM,OAAQ,CAAA,IAAA,CAAK,GAAG,CAAA,GACtB,KAAM,CAAA,OAAA,CAAQ,MAAO,CAAA;AAAA,KAC7B;AAAA,IACA,oBAAsB,EAAA;AAAA,MACpB,aAAA,EAAe,KAAM,CAAA,OAAA,CAAQ,CAAC;AAAA,KAChC;AAAA,IACA,gBAAkB,EAAA;AAAA,MAChB,OAAS,EAAA,MAAA;AAAA,MACT,SAAW,EAAA,QAAA;AAAA,MACX,MAAQ,EAAA;AAAA,KACV;AAAA,IACA,OAAS,EAAA;AA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AA,MAChC,SAAS,EAAE,MAAA,EAAQ,QAAQ,MAAQ,EAAA,UAAA,EAAY,QAAQ,UAAW;AAAA;AAAA,GACpE;AAGF,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,IAAA;AAAA,IAAA;AAAA,MACC,OAAS,EAAA,EAAE,IAAM,EAAA,OAAA,CAAQ,IAAK,EAAA;AAAA,MAC9B,wBAAsB,WAAY,CAAA;AAAA,KAAA;AAAA,oBAElC,KAAA,CAAA,aAAA;AAAA,MAAC,UAAA;AAAA,MAAA;AAAA,QACC,MAAA;AAAA,QACA,KAAA;AAAA,QACA,SAAA;AAAA,QACA,MACE,kBAAA,KAAA,CAAA,aAAA,CAAC,gBAAiB,EAAA,EAAA,eAAA,EAAiB,YAAY,eAAiB,EAAA,CAAA;AAAA,QAElE,OAAS,EAAA;AAAA,UACP,GAAI,UAAA,IAAc,EAAE,IAAA,EAAM,QAAQ,oBAAqB,EAAA;AAAA,UACvD,QAAQ,OAAQ,CAAA;AAAA;AAClB;AAAA,KACF;AAAA,IAEC,CAAC,8BACC,KAAA,CAAA,aAAA,CAAA,WAAA,EAAA,EAAY,WAAW,OAAQ,CAAA,OAAA,EAAA,EAC7B,YAAY,QACX,oBAAA,KAAA,CAAA,aAAA;AAAA,MAAC,uBAAA;AAAA,MAAA;AAAA,QACC,UAAU,WAAY,CAAA,QAAA;AAAA,QACtB,WAAW,OAAQ,CAAA;AAAA;AAAA,KACrB,EAGD,YAAY,SACX,oBAAA,KAAA,CAAA,aAAA,CAAC,4BAAyB,SAAW,EAAA,WAAA,CAAY,WAAW,CAEhE;AAAA,GAEJ;AAEJ;;;;"}
1
+ {"version":3,"file":"PullRequestCard.esm.js","sources":["../../../../../src/components/PullRequestsPage/lib/PullRequestCard/PullRequestCard.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 { Avatar, Link } from '@backstage/core-components';\nimport Card from '@material-ui/core/Card';\nimport CardContent from '@material-ui/core/CardContent';\nimport CardHeader from '@material-ui/core/CardHeader';\nimport Typography from '@material-ui/core/Typography';\n\nimport { AutoCompleteIcon } from '../AutoCompleteIcon';\nimport { DashboardPullRequest } from '@backstage-community/plugin-azure-devops-common';\nimport { DateTime } from 'luxon';\nimport { PullRequestCardPolicies } from './PullRequestCardPolicies';\nimport { PullRequestCardReviewers } from './PullRequestCardReviewers';\nimport { makeStyles } from '@material-ui/core/styles';\n\nconst useStyles = makeStyles(\n theme => ({\n card: {\n backgroundColor:\n theme.palette.type === 'dark'\n ? theme.palette.grey[700]\n : theme.palette.common.white,\n },\n cardHeaderSimplified: {\n paddingBottom: theme.spacing(2),\n },\n cardHeaderAction: {\n display: 'flex',\n alignSelf: 'center',\n margin: 0,\n },\n content: {\n display: 'flex',\n flexDirection: 'row',\n },\n policies: {\n flex: 1,\n },\n avatar: { width: '2.5rem', height: '2.5rem' },\n avatarText: { fontSize: '1rem' },\n }),\n { name: 'PullRequestCard' },\n);\n\ntype PullRequestCardProps = {\n pullRequest: DashboardPullRequest;\n simplified?: boolean;\n};\n\nexport const PullRequestCard = ({\n pullRequest,\n simplified,\n}: PullRequestCardProps) => {\n const classes = useStyles();\n\n const title = (\n <Link to={pullRequest.link ?? ''} title={pullRequest.description}>\n {pullRequest.title}\n </Link>\n );\n\n const repoLink = (\n <Link to={pullRequest.repository?.url ?? ''} color=\"inherit\">\n {pullRequest.repository?.name}\n </Link>\n );\n\n const creationDate = pullRequest.creationDate\n ? DateTime.fromISO(pullRequest.creationDate).toRelative()\n : undefined;\n\n const subheader = (\n <Typography component=\"span\">\n {repoLink} · {creationDate}\n </Typography>\n );\n\n const avatar = (\n <Avatar\n displayName={pullRequest.createdBy?.displayName}\n picture={pullRequest.createdBy?.imageUrl}\n classes={{ avatar: classes.avatar, avatarText: classes.avatarText }}\n />\n );\n\n return (\n <Card\n classes={{ root: classes.card }}\n data-pull-request-id={pullRequest.pullRequestId}\n >\n <CardHeader\n avatar={avatar}\n title={title}\n subheader={subheader}\n action={\n <AutoCompleteIcon hasAutoComplete={pullRequest.hasAutoComplete} />\n }\n classes={{\n ...(simplified && { root: classes.cardHeaderSimplified }),\n action: classes.cardHeaderAction,\n }}\n />\n\n {!simplified && (\n <CardContent className={classes.content}>\n {pullRequest.policies && (\n <PullRequestCardPolicies\n policies={pullRequest.policies}\n className={classes.policies}\n />\n )}\n\n {pullRequest.reviewers && (\n <PullRequestCardReviewers reviewers={pullRequest.reviewers} />\n )}\n </CardContent>\n )}\n </Card>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;AA6BA,MAAM,SAAY,GAAA,UAAA;AAAA,EAChB,CAAU,KAAA,MAAA;AAAA,IACR,IAAM,EAAA;AAAA,MACJ,eACE,EAAA,KAAA,CAAM,OAAQ,CAAA,IAAA,KAAS,MACnB,GAAA,KAAA,CAAM,OAAQ,CAAA,IAAA,CAAK,GAAG,CAAA,GACtB,KAAM,CAAA,OAAA,CAAQ,MAAO,CAAA;AAAA,KAC7B;AAAA,IACA,oBAAsB,EAAA;AAAA,MACpB,aAAA,EAAe,KAAM,CAAA,OAAA,CAAQ,CAAC;AAAA,KAChC;AAAA,IACA,gBAAkB,EAAA;AAAA,MAChB,OAAS,EAAA,MAAA;AAAA,MACT,SAAW,EAAA,QAAA;AAAA,MACX,MAAQ,EAAA;AAAA,KACV;AAAA,IACA,OAAS,EAAA;AAAA,MACP,OAAS,EAAA,MAAA;AAAA,MACT,aAAe,EAAA;AAAA,KACjB;AAAA,IACA,QAAU,EAAA;AAAA,MACR,IAAM,EAAA;AAAA,KACR;AAAA,IACA,MAAQ,EAA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F,EACE,uBAAA,IAAA;AAAA,IAAC,IAAA;AAAA,IAAA;AAAA,MACC,OAAS,EAAA,EAAE,IAAM,EAAA,OAAA,CAAQ,IAAK,EAAA;AAAA,MAC9B,wBAAsB,WAAY,CAAA,aAAA;AAAA,MAElC,QAAA,EAAA;AAAA,wBAAA,GAAA;AAAA,UAAC,UAAA;AAAA,UAAA;AAAA,YACC,MAAA;AAAA,YACA,KAAA;AAAA,YACA,SAAA;AAAA,YACA,MACE,kBAAA,GAAA,CAAC,gBAAiB,EAAA,EAAA,eAAA,EAAiB,YAAY,eAAiB,EAAA,CAAA;AAAA,YAElE,OAAS,EAAA;AAAA,cACP,GAAI,UAAA,IAAc,EAAE,IAAA,EAAM,QAAQ,oBAAqB,EAAA;AAAA,cACvD,QAAQ,OAAQ,CAAA;AAAA;AAClB;AAAA,SACF;AAAA,QAEC,CAAC,UACA,oBAAA,IAAA,CAAC,WAAY,EAAA,EAAA,SAAA,EAAW,QAAQ,OAC7B,EAAA,QAAA,EAAA;AAAA,UAAA,WAAA,CAAY,QACX,oBAAA,GAAA;AAAA,YAAC,uBAAA;AAAA,YAAA;AAAA,cACC,UAAU,WAAY,CAAA,QAAA;AAAA,cACtB,WAAW,OAAQ,CAAA;AAAA;AAAA,WACrB;AAAA,UAGD,YAAY,SACX,oBAAA,GAAA,CAAC,wBAAyB,EAAA,EAAA,SAAA,EAAW,YAAY,SAAW,EAAA;AAAA,SAEhE,EAAA;AAAA;AAAA;AAAA,GAEJ;AAEJ;;;;"}
@@ -1,10 +1,10 @@
1
+ import { jsx } from 'react/jsx-runtime';
1
2
  import { PullRequestCardPolicy } from './PullRequestCardPolicy.esm.js';
2
- import React from 'react';
3
3
 
4
4
  const PullRequestCardPolicies = ({
5
5
  policies,
6
6
  className
7
- }) => /* @__PURE__ */ React.createElement("div", { className }, policies.map((policy) => /* @__PURE__ */ React.createElement(PullRequestCardPolicy, { key: policy.id, policy })));
7
+ }) => /* @__PURE__ */ jsx("div", { className, children: policies.map((policy) => /* @__PURE__ */ jsx(PullRequestCardPolicy, { policy }, policy.id)) });
8
8
 
9
9
  export { PullRequestCardPolicies };
10
10
  //# sourceMappingURL=PullRequestCardPolicies.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PullRequestCardPolicies.esm.js","sources":["../../../../../src/components/PullRequestsPage/lib/PullRequestCard/PullRequestCardPolicies.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 { Policy } from '@backstage-community/plugin-azure-devops-common';\nimport { PullRequestCardPolicy } from './PullRequestCardPolicy';\nimport React from 'react';\n\ntype PullRequestCardProps = {\n policies: Policy[];\n className: string;\n};\n\nexport const PullRequestCardPolicies = ({\n policies,\n className,\n}: PullRequestCardProps) => (\n <div className={className}>\n {policies.map(policy => (\n <PullRequestCardPolicy key={policy.id} policy={policy} />\n ))}\n </div>\n);\n"],"names":[],"mappings":";;;AAyBO,MAAM,0BAA0B,CAAC;AAAA,EACtC,QAAA;AAAA,EACA;AACF,CAAA,qBACG,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAI,SACF,EAAA,EAAA,QAAA,CAAS,GAAI,CAAA,CAAA,MAAA,qBACX,KAAA,CAAA,aAAA,CAAA,qBAAA,EAAA,EAAsB,GAAK,EAAA,MAAA,CAAO,EAAI,EAAA,MAAA,EAAgB,CACxD,CACH;;;;"}
1
+ {"version":3,"file":"PullRequestCardPolicies.esm.js","sources":["../../../../../src/components/PullRequestsPage/lib/PullRequestCard/PullRequestCardPolicies.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 { Policy } from '@backstage-community/plugin-azure-devops-common';\nimport { PullRequestCardPolicy } from './PullRequestCardPolicy';\n\ntype PullRequestCardProps = {\n policies: Policy[];\n className: string;\n};\n\nexport const PullRequestCardPolicies = ({\n policies,\n className,\n}: PullRequestCardProps) => (\n <div className={className}>\n {policies.map(policy => (\n <PullRequestCardPolicy key={policy.id} policy={policy} />\n ))}\n </div>\n);\n"],"names":[],"mappings":";;;AAwBO,MAAM,0BAA0B,CAAC;AAAA,EACtC,QAAA;AAAA,EACA;AACF,CAAA,qBACG,GAAA,CAAA,KAAA,EAAA,EAAI,SACF,EAAA,QAAA,EAAA,QAAA,CAAS,GAAI,CAAA,CAAA,MAAA,qBACX,GAAA,CAAA,qBAAA,EAAA,EAAsC,MAAX,EAAA,EAAA,MAAA,CAAO,EAAoB,CACxD,CACH,EAAA;;;;"}
@@ -1,9 +1,9 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
1
2
  import { PolicyType, PolicyEvaluationStatus } from '@backstage-community/plugin-azure-devops-common';
2
3
  import { withStyles, styled } from '@material-ui/core/styles';
3
4
  import Typography from '@material-ui/core/Typography';
4
5
  import CancelIcon from '@material-ui/icons/Cancel';
5
6
  import GroupWorkIcon from '@material-ui/icons/GroupWork';
6
- import React from 'react';
7
7
  import WatchLaterIcon from '@material-ui/icons/WatchLater';
8
8
 
9
9
  const PolicyRequiredIcon = withStyles(
@@ -35,20 +35,20 @@ function getPolicyIcon(policy) {
35
35
  case PolicyType.Build:
36
36
  switch (policy.status) {
37
37
  case PolicyEvaluationStatus.Running:
38
- return /* @__PURE__ */ React.createElement(PolicyInProgressIcon, null);
38
+ return /* @__PURE__ */ jsx(PolicyInProgressIcon, {});
39
39
  case PolicyEvaluationStatus.Rejected:
40
- return /* @__PURE__ */ React.createElement(PolicyIssueIcon, null);
40
+ return /* @__PURE__ */ jsx(PolicyIssueIcon, {});
41
41
  case PolicyEvaluationStatus.Queued:
42
- return /* @__PURE__ */ React.createElement(PolicyRequiredIcon, null);
42
+ return /* @__PURE__ */ jsx(PolicyRequiredIcon, {});
43
43
  default:
44
44
  return null;
45
45
  }
46
46
  case PolicyType.MinimumReviewers:
47
47
  case PolicyType.RequiredReviewers:
48
- return /* @__PURE__ */ React.createElement(PolicyRequiredIcon, null);
48
+ return /* @__PURE__ */ jsx(PolicyRequiredIcon, {});
49
49
  case PolicyType.Status:
50
50
  case PolicyType.Comments:
51
- return /* @__PURE__ */ React.createElement(PolicyIssueIcon, null);
51
+ return /* @__PURE__ */ jsx(PolicyIssueIcon, {});
52
52
  default:
53
53
  return null;
54
54
  }
@@ -60,7 +60,11 @@ const PullRequestCardPolicyContainer = styled("div")({
60
60
  });
61
61
  const PullRequestCardPolicy = ({
62
62
  policy
63
- }) => /* @__PURE__ */ React.createElement(PullRequestCardPolicyContainer, null, getPolicyIcon(policy), " ", /* @__PURE__ */ React.createElement(Typography, { component: "span" }, policy.text));
63
+ }) => /* @__PURE__ */ jsxs(PullRequestCardPolicyContainer, { children: [
64
+ getPolicyIcon(policy),
65
+ " ",
66
+ /* @__PURE__ */ jsx(Typography, { component: "span", children: policy.text })
67
+ ] });
64
68
 
65
69
  export { PullRequestCardPolicy };
66
70
  //# sourceMappingURL=PullRequestCardPolicy.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PullRequestCardPolicy.esm.js","sources":["../../../../../src/components/PullRequestsPage/lib/PullRequestCard/PullRequestCardPolicy.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 {\n Policy,\n PolicyEvaluationStatus,\n PolicyType,\n} from '@backstage-community/plugin-azure-devops-common';\nimport { styled, withStyles } from '@material-ui/core/styles';\nimport Typography from '@material-ui/core/Typography';\n\nimport CancelIcon from '@material-ui/icons/Cancel';\nimport GroupWorkIcon from '@material-ui/icons/GroupWork';\nimport React from 'react';\nimport WatchLaterIcon from '@material-ui/icons/WatchLater';\n\nconst PolicyRequiredIcon = withStyles(\n theme => ({\n root: {\n color: theme.palette.info.main,\n },\n }),\n { name: 'PolicyRequiredIcon' },\n)(WatchLaterIcon);\n\nconst PolicyIssueIcon = withStyles(\n theme => ({\n root: {\n color: theme.palette.error.main,\n },\n }),\n { name: 'PolicyIssueIcon' },\n)(CancelIcon);\n\nconst PolicyInProgressIcon = withStyles(\n theme => ({\n root: {\n color: theme.palette.info.main,\n },\n }),\n { name: 'PolicyInProgressIcon' },\n)(GroupWorkIcon);\n\nfunction getPolicyIcon(policy: Policy): React.JSX.Element | null {\n switch (policy.type) {\n case PolicyType.Build:\n switch (policy.status) {\n case PolicyEvaluationStatus.Running:\n return <PolicyInProgressIcon />;\n case PolicyEvaluationStatus.Rejected:\n return <PolicyIssueIcon />;\n case PolicyEvaluationStatus.Queued:\n return <PolicyRequiredIcon />;\n default:\n return null;\n }\n case PolicyType.MinimumReviewers:\n case PolicyType.RequiredReviewers:\n return <PolicyRequiredIcon />;\n case PolicyType.Status:\n case PolicyType.Comments:\n return <PolicyIssueIcon />;\n default:\n return null;\n }\n}\n\nconst PullRequestCardPolicyContainer = styled('div')({\n display: 'flex',\n alignItems: 'center',\n flexWrap: 'wrap',\n});\n\ntype PullRequestCardPolicyProps = {\n policy: Policy;\n};\n\nexport const PullRequestCardPolicy = ({\n policy,\n}: PullRequestCardPolicyProps) => (\n <PullRequestCardPolicyContainer>\n {getPolicyIcon(policy)}{' '}\n <Typography component=\"span\">{policy.text}</Typography>\n </PullRequestCardPolicyContainer>\n);\n"],"names":[],"mappings":";;;;;;;;AA6BA,MAAM,kBAAqB,GAAA,UAAA;AAAA,EACzB,CAAU,KAAA,MAAA;AAAA,IACR,IAAM,EAAA;AAAA,MACJ,KAAA,EAAO,KAAM,CAAA,OAAA,CAAQ,IAAK,CAAA;AAAA;AAC5B,GACF,CAAA;AAAA,EACA,EAAE,MAAM,oBAAqB;AAC/B,CAAA,CAAE,cAAc,CAAA;AAEhB,MAAM,eAAkB,GAAA,UAAA;AAAA,EACtB,CAAU,KAAA,MAAA;AAAA,IACR,IAAM,EAAA;AAAA,MACJ,KAAA,EAAO,KAAM,CAAA,OAAA,CAAQ,KAAM,CAAA;AAAA;AAC7B,GACF,CAAA;AAAA,EACA,EAAE,MAAM,iBAAkB;AAC5B,CAAA,CAAE,UAAU,CAAA;AAEZ,MAAM,oBAAuB,GAAA,UAAA;AAAA,EAC3B,CAAU,KAAA,MAAA;AAAA,IACR,IAAM,EAAA;AAAA,MACJ,KAAA,EAAO,KAAM,CAAA,OAAA,CAAQ,IAAK,CAAA;AAAA;AAC5B,GACF,CAAA;AAAA,EACA,EAAE,MAAM,sBAAuB;AACjC,CAAA,CAAE,aAAa,CAAA;AAEf,SAAS,cAAc,MAA0C,EAAA;AAC/D,EAAA,QAAQ,OAAO,IAAM;AAAA,IACnB,KAAK,UAAW,CAAA,KAAA;AACd,MAAA,QAAQ,OAAO,MAAQ;AAAA,QACrB,KAAK,sBAAuB,CAAA,OAAA;AAC1B,UAAA,2CAAQ,oBAAqB,EAAA,IAAA,CAAA;AAAA,QAC/B,KAAK,sBAAuB,CAAA,QAAA;AAC1B,UAAA,2CAAQ,eAAgB,EAAA,IAAA,CAAA;AAAA,QAC1B,KAAK,sBAAuB,CAAA,MAAA;AAC1B,UAAA,2CAAQ,kBAAmB,EAAA,IAAA,CAAA;AAAA,QAC7B;AACE,UAAO,OAAA,IAAA;AAAA;AACX,IACF,KAAK,UAAW,CAAA,gBAAA;AAAA,IAChB,KAAK,UAAW,CAAA,iBAAA;AACd,MAAA,2CAAQ,kBAAmB,EAAA,IAAA,CAAA;AAAA,IAC7B,KAAK,UAAW,CAAA,MAAA;AAAA,IAChB,KAAK,UAAW,CAAA,QAAA;AACd,MAAA,2CAAQ,eAAgB,EAAA,IAAA,CAAA;AAAA,IAC1B;AACE,MAAO,OAAA,IAAA;AAAA;AAEb;AAEA,MAAM,8BAAA,GAAiC,MAAO,CAAA,KAAK,CAAE,CAAA;AAAA,EACnD,OAAS,EAAA,MAAA;AAAA,EACT,UAAY,EAAA,QAAA;AAAA,EACZ,QAAU,EAAA;AACZ,CAAC,CAAA;AAMM,MAAM,wBAAwB,CAAC;AAAA,EACpC;AACF,CAAA,qBACG,KAAA,CAAA,aAAA,CAAA,8BAAA,EAAA,IAAA,EACE,aAAc,CAAA,MAAM,CAAG,EAAA,GAAA,kBACvB,KAAA,CAAA,aAAA,CAAA,UAAA,EAAA,EAAW,SAAU,EAAA,MAAA,EAAA,EAAQ,MAAO,CAAA,IAAK,CAC5C;;;;"}
1
+ {"version":3,"file":"PullRequestCardPolicy.esm.js","sources":["../../../../../src/components/PullRequestsPage/lib/PullRequestCard/PullRequestCardPolicy.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 {\n Policy,\n PolicyEvaluationStatus,\n PolicyType,\n} from '@backstage-community/plugin-azure-devops-common';\nimport { styled, withStyles } from '@material-ui/core/styles';\nimport Typography from '@material-ui/core/Typography';\n\nimport CancelIcon from '@material-ui/icons/Cancel';\nimport GroupWorkIcon from '@material-ui/icons/GroupWork';\nimport WatchLaterIcon from '@material-ui/icons/WatchLater';\n\nconst PolicyRequiredIcon = withStyles(\n theme => ({\n root: {\n color: theme.palette.info.main,\n },\n }),\n { name: 'PolicyRequiredIcon' },\n)(WatchLaterIcon);\n\nconst PolicyIssueIcon = withStyles(\n theme => ({\n root: {\n color: theme.palette.error.main,\n },\n }),\n { name: 'PolicyIssueIcon' },\n)(CancelIcon);\n\nconst PolicyInProgressIcon = withStyles(\n theme => ({\n root: {\n color: theme.palette.info.main,\n },\n }),\n { name: 'PolicyInProgressIcon' },\n)(GroupWorkIcon);\n\nfunction getPolicyIcon(policy: Policy): React.JSX.Element | null {\n switch (policy.type) {\n case PolicyType.Build:\n switch (policy.status) {\n case PolicyEvaluationStatus.Running:\n return <PolicyInProgressIcon />;\n case PolicyEvaluationStatus.Rejected:\n return <PolicyIssueIcon />;\n case PolicyEvaluationStatus.Queued:\n return <PolicyRequiredIcon />;\n default:\n return null;\n }\n case PolicyType.MinimumReviewers:\n case PolicyType.RequiredReviewers:\n return <PolicyRequiredIcon />;\n case PolicyType.Status:\n case PolicyType.Comments:\n return <PolicyIssueIcon />;\n default:\n return null;\n }\n}\n\nconst PullRequestCardPolicyContainer = styled('div')({\n display: 'flex',\n alignItems: 'center',\n flexWrap: 'wrap',\n});\n\ntype PullRequestCardPolicyProps = {\n policy: Policy;\n};\n\nexport const PullRequestCardPolicy = ({\n policy,\n}: PullRequestCardPolicyProps) => (\n <PullRequestCardPolicyContainer>\n {getPolicyIcon(policy)}{' '}\n <Typography component=\"span\">{policy.text}</Typography>\n </PullRequestCardPolicyContainer>\n);\n"],"names":[],"mappings":";;;;;;;;AA4BA,MAAM,kBAAqB,GAAA,UAAA;AAAA,EACzB,CAAU,KA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MAAA;AAAA,IAChB,KAAK,UAAW,CAAA,QAAA;AACd,MAAA,2BAAQ,eAAgB,EAAA,EAAA,CAAA;AAAA,IAC1B;AACE,MAAO,OAAA,IAAA;AAAA;AAEb;AAEA,MAAM,8BAAA,GAAiC,MAAO,CAAA,KAAK,CAAE,CAAA;AAAA,EACnD,OAAS,EAAA,MAAA;AAAA,EACT,UAAY,EAAA,QAAA;AAAA,EACZ,QAAU,EAAA;AACZ,CAAC,CAAA;AAMM,MAAM,wBAAwB,CAAC;AAAA,EACpC;AACF,CAAA,0BACG,8BACE,EAAA,EAAA,QAAA,EAAA;AAAA,EAAA,aAAA,CAAc,MAAM,CAAA;AAAA,EAAG,GAAA;AAAA,kBACvB,GAAA,CAAA,UAAA,EAAA,EAAW,SAAU,EAAA,MAAA,EAAQ,iBAAO,IAAK,EAAA;AAAA,CAC5C,EAAA;;;;"}
@@ -1,5 +1,5 @@
1
+ import { jsx } from 'react/jsx-runtime';
1
2
  import { Avatar } from '@backstage/core-components';
2
- import React from 'react';
3
3
  import { makeStyles } from '@material-ui/core/styles';
4
4
 
5
5
  const useStyles = makeStyles(
@@ -19,7 +19,7 @@ const PullRequestCardReviewer = ({
19
19
  reviewer
20
20
  }) => {
21
21
  const classes = useStyles();
22
- return /* @__PURE__ */ React.createElement(
22
+ return /* @__PURE__ */ jsx(
23
23
  Avatar,
24
24
  {
25
25
  displayName: reviewer.displayName,
@@ -1 +1 @@
1
- {"version":3,"file":"PullRequestCardReviewer.esm.js","sources":["../../../../../src/components/PullRequestsPage/lib/PullRequestCard/PullRequestCardReviewer.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 { Avatar } from '@backstage/core-components';\nimport React from 'react';\nimport { Reviewer } from '@backstage-community/plugin-azure-devops-common';\nimport { makeStyles } from '@material-ui/core/styles';\n\ntype PullRequestCardReviewerProps = {\n reviewer: Reviewer;\n};\n\nconst useStyles = makeStyles(\n {\n avatar: {\n width: '2.5rem',\n height: '2.5rem',\n border: '0.3rem solid silver',\n },\n avatarText: {\n fontSize: '1rem',\n },\n },\n { name: 'PullRequestCardReviewer' },\n);\n\nexport const PullRequestCardReviewer = ({\n reviewer,\n}: PullRequestCardReviewerProps) => {\n const classes = useStyles();\n\n return (\n <Avatar\n displayName={reviewer.displayName}\n picture={reviewer.imageUrl}\n classes={classes}\n />\n );\n};\n"],"names":[],"mappings":";;;;AAyBA,MAAM,SAAY,GAAA,UAAA;AAAA,EAChB;AAAA,IACE,MAAQ,EAAA;AAAA,MACN,KAAO,EAAA,QAAA;AAAA,MACP,MAAQ,EAAA,QAAA;AAAA,MACR,MAAQ,EAAA;AAAA,KACV;AAAA,IACA,UAAY,EAAA;AAAA,MACV,QAAU,EAAA;AAAA;AACZ,GACF;AAAA,EACA,EAAE,MAAM,yBAA0B;AACpC,CAAA;AAEO,MAAM,0BAA0B,CAAC;AAAA,EACtC;AACF,CAAoC,KAAA;AAClC,EAAA,MAAM,UAAU,SAAU,EAAA;AAE1B,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,aAAa,QAAS,CAAA,WAAA;AAAA,MACtB,SAAS,QAAS,CAAA,QAAA;AAAA,MAClB;AAAA;AAAA,GACF;AAEJ;;;;"}
1
+ {"version":3,"file":"PullRequestCardReviewer.esm.js","sources":["../../../../../src/components/PullRequestsPage/lib/PullRequestCard/PullRequestCardReviewer.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 { Avatar } from '@backstage/core-components';\nimport { Reviewer } from '@backstage-community/plugin-azure-devops-common';\nimport { makeStyles } from '@material-ui/core/styles';\n\ntype PullRequestCardReviewerProps = {\n reviewer: Reviewer;\n};\n\nconst useStyles = makeStyles(\n {\n avatar: {\n width: '2.5rem',\n height: '2.5rem',\n border: '0.3rem solid silver',\n },\n avatarText: {\n fontSize: '1rem',\n },\n },\n { name: 'PullRequestCardReviewer' },\n);\n\nexport const PullRequestCardReviewer = ({\n reviewer,\n}: PullRequestCardReviewerProps) => {\n const classes = useStyles();\n\n return (\n <Avatar\n displayName={reviewer.displayName}\n picture={reviewer.imageUrl}\n classes={classes}\n />\n );\n};\n"],"names":[],"mappings":";;;;AAwBA,MAAM,SAAY,GAAA,UAAA;AAAA,EAChB;AAAA,IACE,MAAQ,EAAA;AAAA,MACN,KAAO,EAAA,QAAA;AAAA,MACP,MAAQ,EAAA,QAAA;AAAA,MACR,MAAQ,EAAA;AAAA,KACV;AAAA,IACA,UAAY,EAAA;AAAA,MACV,QAAU,EAAA;AAAA;AACZ,GACF;AAAA,EACA,EAAE,MAAM,yBAA0B;AACpC,CAAA;AAEO,MAAM,0BAA0B,CAAC;AAAA,EACtC;AACF,CAAoC,KAAA;AAClC,EAAA,MAAM,UAAU,SAAU,EAAA;AAE1B,EACE,uBAAA,GAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,aAAa,QAAS,CAAA,WAAA;AAAA,MACtB,SAAS,QAAS,CAAA,QAAA;AAAA,MAClB;AAAA;AAAA,GACF;AAEJ;;;;"}
@@ -1,5 +1,5 @@
1
+ import { jsx } from 'react/jsx-runtime';
1
2
  import { PullRequestCardReviewer } from './PullRequestCardReviewer.esm.js';
2
- import React from 'react';
3
3
  import { reviewerFilter } from '../utils.esm.js';
4
4
  import { styled } from '@material-ui/core/styles';
5
5
 
@@ -11,7 +11,7 @@ const PullRequestCardReviewersContainer = styled("div")({
11
11
  });
12
12
  const PullRequestCardReviewers = ({
13
13
  reviewers
14
- }) => /* @__PURE__ */ React.createElement(PullRequestCardReviewersContainer, null, reviewers.filter(reviewerFilter).map((reviewer) => /* @__PURE__ */ React.createElement(PullRequestCardReviewer, { key: reviewer.id, reviewer })));
14
+ }) => /* @__PURE__ */ jsx(PullRequestCardReviewersContainer, { children: reviewers.filter(reviewerFilter).map((reviewer) => /* @__PURE__ */ jsx(PullRequestCardReviewer, { reviewer }, reviewer.id)) });
15
15
 
16
16
  export { PullRequestCardReviewers };
17
17
  //# sourceMappingURL=PullRequestCardReviewers.esm.js.map