@backstage-community/plugin-azure-devops 0.6.3 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/alpha/plugin.esm.js.map +1 -1
  3. package/dist/alpha.d.ts +12 -12
  4. package/dist/api/AzureDevOpsApi.esm.js.map +1 -1
  5. package/dist/api/AzureDevOpsClient.esm.js.map +1 -1
  6. package/dist/components/AzurePipelinesIcon/AzurePipelinesIcon.esm.js.map +1 -1
  7. package/dist/components/AzurePullRequestsIcon/AzurePullRequestsIcon.esm.js.map +1 -1
  8. package/dist/components/BuildTable/BuildTable.esm.js.map +1 -1
  9. package/dist/components/EntityPageAzureGitTags/EntityPageAzureGitTags.esm.js.map +1 -1
  10. package/dist/components/EntityPageAzurePipelines/EntityPageAzurePipelines.esm.js.map +1 -1
  11. package/dist/components/EntityPageAzurePullRequests/EntityPageAzurePullRequests.esm.js.map +1 -1
  12. package/dist/components/GitTagTable/GitTagTable.esm.js.map +1 -1
  13. package/dist/components/PullRequestStatusButtonGroup/PullRequestStatusButtonGroup.esm.js.map +1 -1
  14. package/dist/components/PullRequestTable/PullRequestTable.esm.js.map +1 -1
  15. package/dist/components/PullRequestsPage/PullRequestsPage.esm.js.map +1 -1
  16. package/dist/components/PullRequestsPage/lib/AutoCompleteIcon/AutoCompleteIcon.esm.js.map +1 -1
  17. package/dist/components/PullRequestsPage/lib/PullRequestCard/PullRequestCard.esm.js.map +1 -1
  18. package/dist/components/PullRequestsPage/lib/PullRequestCard/PullRequestCardPolicies.esm.js.map +1 -1
  19. package/dist/components/PullRequestsPage/lib/PullRequestCard/PullRequestCardPolicy.esm.js.map +1 -1
  20. package/dist/components/PullRequestsPage/lib/PullRequestCard/PullRequestCardReviewer.esm.js.map +1 -1
  21. package/dist/components/PullRequestsPage/lib/PullRequestCard/PullRequestCardReviewers.esm.js.map +1 -1
  22. package/dist/components/PullRequestsPage/lib/PullRequestGrid/PullRequestGrid.esm.js.map +1 -1
  23. package/dist/components/PullRequestsPage/lib/PullRequestGridColumn/PullRequestGridColumn.esm.js.map +1 -1
  24. package/dist/components/PullRequestsPage/lib/filters/allFilter.esm.js.map +1 -1
  25. package/dist/components/PullRequestsPage/lib/filters/assignedToTeamFilter.esm.js.map +1 -1
  26. package/dist/components/PullRequestsPage/lib/filters/assignedToTeamsFilter.esm.js.map +1 -1
  27. package/dist/components/PullRequestsPage/lib/filters/assignedToUserFilter.esm.js.map +1 -1
  28. package/dist/components/PullRequestsPage/lib/filters/createFilter.esm.js.map +1 -1
  29. package/dist/components/PullRequestsPage/lib/filters/createdByTeamFilter.esm.js.map +1 -1
  30. package/dist/components/PullRequestsPage/lib/filters/createdByTeamsFilter.esm.js.map +1 -1
  31. package/dist/components/PullRequestsPage/lib/filters/createdByUserFilter.esm.js.map +1 -1
  32. package/dist/components/PullRequestsPage/lib/filters/types.esm.js.map +1 -1
  33. package/dist/components/PullRequestsPage/lib/hooks/useFilterProcessor.esm.js.map +1 -1
  34. package/dist/components/PullRequestsPage/lib/utils.esm.js.map +1 -1
  35. package/dist/components/ReadmeCard/ReadmeCard.esm.js.map +1 -1
  36. package/dist/hooks/useBuildRuns.esm.js.map +1 -1
  37. package/dist/hooks/useDashboardPullRequests.esm.js.map +1 -1
  38. package/dist/hooks/useGitTags.esm.js.map +1 -1
  39. package/dist/hooks/usePullRequests.esm.js.map +1 -1
  40. package/dist/hooks/useReadme.esm.js.map +1 -1
  41. package/dist/hooks/useUserEmail.esm.js.map +1 -1
  42. package/dist/hooks/useUserTeamIds.esm.js.map +1 -1
  43. package/dist/plugin.esm.js.map +1 -1
  44. package/dist/routes.esm.js.map +1 -1
  45. package/dist/utils/arrayHas.esm.js.map +1 -1
  46. package/dist/utils/equalsIgnoreCase.esm.js.map +1 -1
  47. package/dist/utils/getAnnotationValuesFromEntity.esm.js.map +1 -1
  48. package/dist/utils/getDurationFromDates.esm.js.map +1 -1
  49. package/package.json +24 -15
  50. package/alpha/package.json +0 -7
@@ -1 +1 @@
1
- {"version":3,"file":"PullRequestCardReviewers.esm.js","sources":["../../../../../src/components/PullRequestsPage/lib/PullRequestCard/PullRequestCardReviewers.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 { PullRequestCardReviewer } from './PullRequestCardReviewer';\nimport React from 'react';\nimport { Reviewer } from '@backstage-community/plugin-azure-devops-common';\nimport { reviewerFilter } from '../utils';\nimport { styled } from '@material-ui/core/styles';\n\nconst PullRequestCardReviewersContainer = styled('div')({\n '& > *': {\n marginTop: 4,\n marginBottom: 4,\n },\n});\n\ntype PullRequestCardReviewersProps = {\n reviewers: Reviewer[];\n};\n\nexport const PullRequestCardReviewers = ({\n reviewers,\n}: PullRequestCardReviewersProps) => (\n <PullRequestCardReviewersContainer>\n {reviewers.filter(reviewerFilter).map(reviewer => (\n <PullRequestCardReviewer key={reviewer.id} reviewer={reviewer} />\n ))}\n </PullRequestCardReviewersContainer>\n);\n"],"names":[],"mappings":";;;;;AAsBA,MAAM,iCAAA,GAAoC,MAAO,CAAA,KAAK,CAAE,CAAA;AAAA,EACtD,OAAS,EAAA;AAAA,IACP,SAAW,EAAA,CAAA;AAAA,IACX,YAAc,EAAA,CAAA;AAAA,GAChB;AACF,CAAC,CAAA,CAAA;AAMM,MAAM,2BAA2B,CAAC;AAAA,EACvC,SAAA;AACF,CAAA,qBACG,KAAA,CAAA,aAAA,CAAA,iCAAA,EAAA,IAAA,EACE,SAAU,CAAA,MAAA,CAAO,cAAc,CAAE,CAAA,GAAA,CAAI,CACpC,QAAA,qBAAA,KAAA,CAAA,aAAA,CAAC,2BAAwB,GAAK,EAAA,QAAA,CAAS,EAAI,EAAA,QAAA,EAAoB,CAChE,CACH;;;;"}
1
+ {"version":3,"file":"PullRequestCardReviewers.esm.js","sources":["../../../../../src/components/PullRequestsPage/lib/PullRequestCard/PullRequestCardReviewers.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 { PullRequestCardReviewer } from './PullRequestCardReviewer';\nimport React from 'react';\nimport { Reviewer } from '@backstage-community/plugin-azure-devops-common';\nimport { reviewerFilter } from '../utils';\nimport { styled } from '@material-ui/core/styles';\n\nconst PullRequestCardReviewersContainer = styled('div')({\n '& > *': {\n marginTop: 4,\n marginBottom: 4,\n },\n});\n\ntype PullRequestCardReviewersProps = {\n reviewers: Reviewer[];\n};\n\nexport const PullRequestCardReviewers = ({\n reviewers,\n}: PullRequestCardReviewersProps) => (\n <PullRequestCardReviewersContainer>\n {reviewers.filter(reviewerFilter).map(reviewer => (\n <PullRequestCardReviewer key={reviewer.id} reviewer={reviewer} />\n ))}\n </PullRequestCardReviewersContainer>\n);\n"],"names":[],"mappings":";;;;;AAsBA,MAAM,iCAAA,GAAoC,MAAO,CAAA,KAAK,CAAE,CAAA;AAAA,EACtD,OAAS,EAAA;AAAA,IACP,SAAW,EAAA,CAAA;AAAA,IACX,YAAc,EAAA;AAAA;AAElB,CAAC,CAAA;AAMM,MAAM,2BAA2B,CAAC;AAAA,EACvC;AACF,CAAA,qBACG,KAAA,CAAA,aAAA,CAAA,iCAAA,EAAA,IAAA,EACE,SAAU,CAAA,MAAA,CAAO,cAAc,CAAE,CAAA,GAAA,CAAI,CACpC,QAAA,qBAAA,KAAA,CAAA,aAAA,CAAC,2BAAwB,GAAK,EAAA,QAAA,CAAS,EAAI,EAAA,QAAA,EAAoB,CAChE,CACH;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"PullRequestGrid.esm.js","sources":["../../../../../src/components/PullRequestsPage/lib/PullRequestGrid/PullRequestGrid.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 { PullRequestGridColumn } from '../PullRequestGridColumn';\nimport { PullRequestGroup } from '../types';\nimport React from 'react';\nimport { styled } from '@material-ui/core/styles';\n\nconst GridDiv = styled('div')(({ theme }) => ({\n display: 'flex',\n flexDirection: 'row',\n justifyContent: 'space-between',\n '& > *': {\n marginRight: theme.spacing(2),\n },\n '& > :last-of-type': {\n marginRight: 0,\n },\n}));\n\ntype PullRequestGridProps = {\n pullRequestGroups: PullRequestGroup[];\n};\n\nexport const PullRequestGrid = ({\n pullRequestGroups,\n}: PullRequestGridProps) => {\n return (\n <GridDiv>\n {pullRequestGroups.map((pullRequestGroup, index) => (\n <PullRequestGridColumn\n key={index}\n pullRequestGroup={pullRequestGroup}\n />\n ))}\n </GridDiv>\n );\n};\n"],"names":[],"mappings":";;;;AAqBA,MAAM,UAAU,MAAO,CAAA,KAAK,EAAE,CAAC,EAAE,OAAa,MAAA;AAAA,EAC5C,OAAS,EAAA,MAAA;AAAA,EACT,aAAe,EAAA,KAAA;AAAA,EACf,cAAgB,EAAA,eAAA;AAAA,EAChB,OAAS,EAAA;AAAA,IACP,WAAA,EAAa,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,GAC9B;AAAA,EACA,mBAAqB,EAAA;AAAA,IACnB,WAAa,EAAA,CAAA;AAAA,GACf;AACF,CAAE,CAAA,CAAA,CAAA;AAMK,MAAM,kBAAkB,CAAC;AAAA,EAC9B,iBAAA;AACF,CAA4B,KAAA;AAC1B,EAAA,2CACG,OACE,EAAA,IAAA,EAAA,iBAAA,CAAkB,GAAI,CAAA,CAAC,kBAAkB,KACxC,qBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,qBAAA;AAAA,IAAA;AAAA,MACC,GAAK,EAAA,KAAA;AAAA,MACL,gBAAA;AAAA,KAAA;AAAA,GAEH,CACH,CAAA,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"PullRequestGrid.esm.js","sources":["../../../../../src/components/PullRequestsPage/lib/PullRequestGrid/PullRequestGrid.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 { PullRequestGridColumn } from '../PullRequestGridColumn';\nimport { PullRequestGroup } from '../types';\nimport React from 'react';\nimport { styled } from '@material-ui/core/styles';\n\nconst GridDiv = styled('div')(({ theme }) => ({\n display: 'flex',\n flexDirection: 'row',\n justifyContent: 'space-between',\n '& > *': {\n marginRight: theme.spacing(2),\n },\n '& > :last-of-type': {\n marginRight: 0,\n },\n}));\n\ntype PullRequestGridProps = {\n pullRequestGroups: PullRequestGroup[];\n};\n\nexport const PullRequestGrid = ({\n pullRequestGroups,\n}: PullRequestGridProps) => {\n return (\n <GridDiv>\n {pullRequestGroups.map((pullRequestGroup, index) => (\n <PullRequestGridColumn\n key={index}\n pullRequestGroup={pullRequestGroup}\n />\n ))}\n </GridDiv>\n );\n};\n"],"names":[],"mappings":";;;;AAqBA,MAAM,UAAU,MAAO,CAAA,KAAK,EAAE,CAAC,EAAE,OAAa,MAAA;AAAA,EAC5C,OAAS,EAAA,MAAA;AAAA,EACT,aAAe,EAAA,KAAA;AAAA,EACf,cAAgB,EAAA,eAAA;AAAA,EAChB,OAAS,EAAA;AAAA,IACP,WAAA,EAAa,KAAM,CAAA,OAAA,CAAQ,CAAC;AAAA,GAC9B;AAAA,EACA,mBAAqB,EAAA;AAAA,IACnB,WAAa,EAAA;AAAA;AAEjB,CAAE,CAAA,CAAA;AAMK,MAAM,kBAAkB,CAAC;AAAA,EAC9B;AACF,CAA4B,KAAA;AAC1B,EAAA,2CACG,OACE,EAAA,IAAA,EAAA,iBAAA,CAAkB,GAAI,CAAA,CAAC,kBAAkB,KACxC,qBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,qBAAA;AAAA,IAAA;AAAA,MACC,GAAK,EAAA,KAAA;AAAA,MACL;AAAA;AAAA,GAEH,CACH,CAAA;AAEJ;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"PullRequestGridColumn.esm.js","sources":["../../../../../src/components/PullRequestsPage/lib/PullRequestGridColumn/PullRequestGridColumn.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 Paper from '@material-ui/core/Paper';\nimport Typography from '@material-ui/core/Typography';\nimport { styled, withStyles } from '@material-ui/core/styles';\n\nimport { PullRequestCard } from '../PullRequestCard';\nimport { PullRequestGroup } from '../types';\nimport React from 'react';\n\nconst ColumnPaper = withStyles(theme => ({\n root: {\n display: 'flex',\n flexDirection: 'column',\n flex: 1,\n padding: theme.spacing(2),\n backgroundColor:\n theme.palette.type === 'dark'\n ? theme.palette.grey[800]\n : theme.palette.grey[300],\n height: '100%',\n },\n}))(Paper);\n\nconst ColumnTitleDiv = styled('div')(({ theme }) => ({\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n marginBottom: theme.spacing(2),\n}));\n\nexport const PullRequestCardContainer = styled('div')(({ theme }) => ({\n display: 'flex',\n flexDirection: 'column',\n '& > *': {\n marginBottom: theme.spacing(2),\n },\n '& > :last-of-type': {\n marginBottom: 0,\n },\n}));\n\ntype PullRequestGridColumnProps = {\n pullRequestGroup: PullRequestGroup;\n};\n\nexport const PullRequestGridColumn = ({\n pullRequestGroup,\n}: PullRequestGridColumnProps) => {\n const columnTitle = (\n <ColumnTitleDiv>\n <Typography variant=\"h5\">{pullRequestGroup.title}</Typography>\n </ColumnTitleDiv>\n );\n\n const pullRequests = (\n <PullRequestCardContainer>\n {pullRequestGroup.pullRequests.map(pullRequest => (\n <PullRequestCard\n key={pullRequest.pullRequestId}\n pullRequest={pullRequest}\n simplified={pullRequestGroup.simplified}\n />\n ))}\n </PullRequestCardContainer>\n );\n\n return (\n <ColumnPaper>\n {columnTitle}\n {pullRequests}\n </ColumnPaper>\n );\n};\n"],"names":[],"mappings":";;;;;;AAwBA,MAAM,WAAA,GAAc,WAAW,CAAU,KAAA,MAAA;AAAA,EACvC,IAAM,EAAA;AAAA,IACJ,OAAS,EAAA,MAAA;AAAA,IACT,aAAe,EAAA,QAAA;AAAA,IACf,IAAM,EAAA,CAAA;AAAA,IACN,OAAA,EAAS,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,IACxB,eACE,EAAA,KAAA,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CAAA,aAAA;AAAA,MACjB,WAAA;AAAA,MACA,YAAY,gBAAiB,CAAA,UAAA;AAAA,KAAA;AAAA,GAEhC,CACH,CAAA,CAAA;AAGF,EACE,uBAAA,KAAA,CAAA,aAAA,CAAC,WACE,EAAA,IAAA,EAAA,WAAA,EACA,YACH,CAAA,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"PullRequestGridColumn.esm.js","sources":["../../../../../src/components/PullRequestsPage/lib/PullRequestGridColumn/PullRequestGridColumn.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 Paper from '@material-ui/core/Paper';\nimport Typography from '@material-ui/core/Typography';\nimport { styled, withStyles } from '@material-ui/core/styles';\n\nimport { PullRequestCard } from '../PullRequestCard';\nimport { PullRequestGroup } from '../types';\nimport React from 'react';\n\nconst ColumnPaper = withStyles(theme => ({\n root: {\n display: 'flex',\n flexDirection: 'column',\n flex: 1,\n padding: theme.spacing(2),\n backgroundColor:\n theme.palette.type === 'dark'\n ? theme.palette.grey[800]\n : theme.palette.grey[300],\n height: '100%',\n },\n}))(Paper);\n\nconst ColumnTitleDiv = styled('div')(({ theme }) => ({\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n marginBottom: theme.spacing(2),\n}));\n\nexport const PullRequestCardContainer = styled('div')(({ theme }) => ({\n display: 'flex',\n flexDirection: 'column',\n '& > *': {\n marginBottom: theme.spacing(2),\n },\n '& > :last-of-type': {\n marginBottom: 0,\n },\n}));\n\ntype PullRequestGridColumnProps = {\n pullRequestGroup: PullRequestGroup;\n};\n\nexport const PullRequestGridColumn = ({\n pullRequestGroup,\n}: PullRequestGridColumnProps) => {\n const columnTitle = (\n <ColumnTitleDiv>\n <Typography variant=\"h5\">{pullRequestGroup.title}</Typography>\n </ColumnTitleDiv>\n );\n\n const pullRequests = (\n <PullRequestCardContainer>\n {pullRequestGroup.pullRequests.map(pullRequest => (\n <PullRequestCard\n key={pullRequest.pullRequestId}\n pullRequest={pullRequest}\n simplified={pullRequestGroup.simplified}\n />\n ))}\n </PullRequestCardContainer>\n );\n\n return (\n <ColumnPaper>\n {columnTitle}\n {pullRequests}\n </ColumnPaper>\n );\n};\n"],"names":[],"mappings":";;;;;;AAwBA,MAAM,WAAA,GAAc,WAAW,CAAU,KAAA,MAAA;AAAA,EACvC,IAAM,EAAA;AAAA,IACJ,OAAS,EAAA,MAAA;AAAA,IACT,aAAe,EAAA,QAAA;AAAA,IACf,IAAM,EAAA,CAAA;AAAA,IACN,OAAA,EAAS,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,IACxB,eACE,EAAA,KAAA,CAAM,OAAQ,CAAA,IAAA,KAAS,MACnB,GAAA,KAAA,CAAM,OAAQ,CAAA,IAAA,CAAK,GAAG,CAAA,GACtB,KAAM,CAAA,OAAA,CAAQ,KAAK,GAAG,CAAA;AAAA,IAC5B,MAAQ,EAAA;AAAA;AAEZ,CAAA,CAAE,EAAE,KAAK,CAAA;AAET,MAAM,iBAAiB,MAAO,CAAA,KAAK,EAAE,CAAC,EAAE,OAAa,MAAA;AAAA,EACnD,OAAS,EAAA,MAAA;AAAA,EACT,aAAe,EAAA,KAAA;AAAA,EACf,UAAY,EAAA,QAAA;AAAA,EACZ,cAAgB,EAAA,eAAA;AAAA,EAChB,YAAA,EAAc,KAAM,CAAA,OAAA,CAAQ,CAAC;AAC/B,CAAE,CAAA,CAAA;AAEK,MAAM,2BAA2B,MAAO,CAAA,KAAK,EAAE,CAAC,EAAE,OAAa,MAAA;AAAA,EACpE,OAAS,EAAA,MAAA;AAAA,EACT,aAAe,EAAA,QAAA;AAAA,EACf,OAAS,EAAA;AAAA,IACP,YAAA,EAAc,KAAM,CAAA,OAAA,CAAQ,CAAC;AAAA,GAC/B;AAAA,EACA,mBAAqB,EAAA;AAAA,IACnB,YAAc,EAAA;AAAA;AAElB,CAAE,CAAA;AAMK,MAAM,wBAAwB,CAAC;AAAA,EACpC;AACF,CAAkC,KAAA;AAChC,EAAM,MAAA,WAAA,uCACH,cACC,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,cAAW,OAAQ,EAAA,IAAA,EAAA,EAAM,gBAAiB,CAAA,KAAM,CACnD,CAAA;AAGF,EAAA,MAAM,+BACH,KAAA,CAAA,aAAA,CAAA,wBAAA,EAAA,IAAA,EACE,gBAAiB,CAAA,YAAA,CAAa,IAAI,CACjC,WAAA,qBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,eAAA;AAAA,IAAA;AAAA,MACC,KAAK,WAAY,CAAA,aAAA;AAAA,MACjB,WAAA;AAAA,MACA,YAAY,gBAAiB,CAAA;AAAA;AAAA,GAEhC,CACH,CAAA;AAGF,EACE,uBAAA,KAAA,CAAA,aAAA,CAAC,WACE,EAAA,IAAA,EAAA,WAAA,EACA,YACH,CAAA;AAEJ;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"allFilter.esm.js","sources":["../../../../../src/components/PullRequestsPage/lib/filters/allFilter.ts"],"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 { BaseFilter, FilterType, PullRequestFilter } from './types';\n\nimport { DashboardPullRequest } from '@backstage-community/plugin-azure-devops-common';\n\n/** @public */\nexport type AllFilter = BaseFilter & {\n type: FilterType.All;\n};\n\nexport function createAllFilter(): PullRequestFilter {\n return (_pullRequest: DashboardPullRequest): boolean => true;\n}\n"],"names":[],"mappings":"AAyBO,SAAS,eAAqC,GAAA;AACnD,EAAA,OAAO,CAAC,YAAgD,KAAA,IAAA,CAAA;AAC1D;;;;"}
1
+ {"version":3,"file":"allFilter.esm.js","sources":["../../../../../src/components/PullRequestsPage/lib/filters/allFilter.ts"],"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 { BaseFilter, FilterType, PullRequestFilter } from './types';\n\nimport { DashboardPullRequest } from '@backstage-community/plugin-azure-devops-common';\n\n/** @public */\nexport type AllFilter = BaseFilter & {\n type: FilterType.All;\n};\n\nexport function createAllFilter(): PullRequestFilter {\n return (_pullRequest: DashboardPullRequest): boolean => true;\n}\n"],"names":[],"mappings":"AAyBO,SAAS,eAAqC,GAAA;AACnD,EAAA,OAAO,CAAC,YAAgD,KAAA,IAAA;AAC1D;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"assignedToTeamFilter.esm.js","sources":["../../../../../src/components/PullRequestsPage/lib/filters/assignedToTeamFilter.ts"],"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 { DashboardPullRequest } from '@backstage-community/plugin-azure-devops-common';\nimport { BaseFilter, FilterType, PullRequestFilter } from './types';\nimport { stringArrayHas } from '../../../../utils';\n\n/** @public */\nexport type AssignedToTeamFilter = BaseFilter & {\n type: FilterType.AssignedToTeam;\n teamId: string;\n};\n\nexport function createAssignedToTeamFilter(\n filter: AssignedToTeamFilter,\n): PullRequestFilter {\n return (pullRequest: DashboardPullRequest): boolean => {\n const reviewerIds = pullRequest.reviewers?.map(reviewer => reviewer.id);\n\n if (!reviewerIds) {\n return false;\n }\n\n return stringArrayHas(reviewerIds, filter.teamId, true);\n };\n}\n"],"names":[],"mappings":";;;;;AA0BO,SAAS,2BACd,MACmB,EAAA;AACnB,EAAA,OAAO,CAAC,WAA+C,KAAA;AACrD,IAAA,MAAM,cAAc,WAAY,CAAA,SAAA,EAAW,GAAI,CAAA,CAAA,QAAA,KAAY,SAAS,EAAE,CAAA,CAAA;AAEtE,IAAA,IAAI,CAAC,WAAa,EAAA;AAChB,MAAO,OAAA,KAAA,CAAA;AAAA,KACT;AAEA,IAAA,OAAO,cAAe,CAAA,WAAA,EAAa,MAAO,CAAA,MAAA,EAAQ,IAAI,CAAA,CAAA;AAAA,GACxD,CAAA;AACF;;;;"}
1
+ {"version":3,"file":"assignedToTeamFilter.esm.js","sources":["../../../../../src/components/PullRequestsPage/lib/filters/assignedToTeamFilter.ts"],"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 { DashboardPullRequest } from '@backstage-community/plugin-azure-devops-common';\nimport { BaseFilter, FilterType, PullRequestFilter } from './types';\nimport { stringArrayHas } from '../../../../utils';\n\n/** @public */\nexport type AssignedToTeamFilter = BaseFilter & {\n type: FilterType.AssignedToTeam;\n teamId: string;\n};\n\nexport function createAssignedToTeamFilter(\n filter: AssignedToTeamFilter,\n): PullRequestFilter {\n return (pullRequest: DashboardPullRequest): boolean => {\n const reviewerIds = pullRequest.reviewers?.map(reviewer => reviewer.id);\n\n if (!reviewerIds) {\n return false;\n }\n\n return stringArrayHas(reviewerIds, filter.teamId, true);\n };\n}\n"],"names":[],"mappings":";;;;;AA0BO,SAAS,2BACd,MACmB,EAAA;AACnB,EAAA,OAAO,CAAC,WAA+C,KAAA;AACrD,IAAA,MAAM,cAAc,WAAY,CAAA,SAAA,EAAW,GAAI,CAAA,CAAA,QAAA,KAAY,SAAS,EAAE,CAAA;AAEtE,IAAA,IAAI,CAAC,WAAa,EAAA;AAChB,MAAO,OAAA,KAAA;AAAA;AAGT,IAAA,OAAO,cAAe,CAAA,WAAA,EAAa,MAAO,CAAA,MAAA,EAAQ,IAAI,CAAA;AAAA,GACxD;AACF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"assignedToTeamsFilter.esm.js","sources":["../../../../../src/components/PullRequestsPage/lib/filters/assignedToTeamsFilter.ts"],"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 { DashboardPullRequest } from '@backstage-community/plugin-azure-devops-common';\nimport { BaseFilter, FilterType, PullRequestFilter } from './types';\nimport { createAssignedToTeamFilter } from './assignedToTeamFilter';\n\n/** @public */\nexport type AssignedToTeamsFilter = BaseFilter &\n (\n | {\n type: FilterType.AssignedToTeams;\n teamIds: string[];\n }\n | {\n type: FilterType.AssignedToCurrentUsersTeams;\n teamIds?: string[];\n }\n );\n\nexport function createAssignedToTeamsFilter(\n filter: AssignedToTeamsFilter,\n): PullRequestFilter {\n const teamIds = filter.teamIds;\n\n return (pullRequest: DashboardPullRequest): boolean => {\n if (!teamIds) {\n return false;\n }\n\n return teamIds.some(teamId => {\n return createAssignedToTeamFilter({\n type: FilterType.AssignedToTeam,\n teamId,\n })(pullRequest);\n });\n };\n}\n"],"names":[],"mappings":";;;AAiCO,SAAS,4BACd,MACmB,EAAA;AACnB,EAAA,MAAM,UAAU,MAAO,CAAA,OAAA,CAAA;AAEvB,EAAA,OAAO,CAAC,WAA+C,KAAA;AACrD,IAAA,IAAI,CAAC,OAAS,EAAA;AACZ,MAAO,OAAA,KAAA,CAAA;AAAA,KACT;AAEA,IAAO,OAAA,OAAA,CAAQ,KAAK,CAAU,MAAA,KAAA;AAC5B,MAAA,OAAO,0BAA2B,CAAA;AAAA,QAChC,MAAM,UAAW,CAAA,cAAA;AAAA,QACjB,MAAA;AAAA,OACD,EAAE,WAAW,CAAA,CAAA;AAAA,KACf,CAAA,CAAA;AAAA,GACH,CAAA;AACF;;;;"}
1
+ {"version":3,"file":"assignedToTeamsFilter.esm.js","sources":["../../../../../src/components/PullRequestsPage/lib/filters/assignedToTeamsFilter.ts"],"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 { DashboardPullRequest } from '@backstage-community/plugin-azure-devops-common';\nimport { BaseFilter, FilterType, PullRequestFilter } from './types';\nimport { createAssignedToTeamFilter } from './assignedToTeamFilter';\n\n/** @public */\nexport type AssignedToTeamsFilter = BaseFilter &\n (\n | {\n type: FilterType.AssignedToTeams;\n teamIds: string[];\n }\n | {\n type: FilterType.AssignedToCurrentUsersTeams;\n teamIds?: string[];\n }\n );\n\nexport function createAssignedToTeamsFilter(\n filter: AssignedToTeamsFilter,\n): PullRequestFilter {\n const teamIds = filter.teamIds;\n\n return (pullRequest: DashboardPullRequest): boolean => {\n if (!teamIds) {\n return false;\n }\n\n return teamIds.some(teamId => {\n return createAssignedToTeamFilter({\n type: FilterType.AssignedToTeam,\n teamId,\n })(pullRequest);\n });\n };\n}\n"],"names":[],"mappings":";;;AAiCO,SAAS,4BACd,MACmB,EAAA;AACnB,EAAA,MAAM,UAAU,MAAO,CAAA,OAAA;AAEvB,EAAA,OAAO,CAAC,WAA+C,KAAA;AACrD,IAAA,IAAI,CAAC,OAAS,EAAA;AACZ,MAAO,OAAA,KAAA;AAAA;AAGT,IAAO,OAAA,OAAA,CAAQ,KAAK,CAAU,MAAA,KAAA;AAC5B,MAAA,OAAO,0BAA2B,CAAA;AAAA,QAChC,MAAM,UAAW,CAAA,cAAA;AAAA,QACjB;AAAA,OACD,EAAE,WAAW,CAAA;AAAA,KACf,CAAA;AAAA,GACH;AACF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"assignedToUserFilter.esm.js","sources":["../../../../../src/components/PullRequestsPage/lib/filters/assignedToUserFilter.ts"],"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 { DashboardPullRequest } from '@backstage-community/plugin-azure-devops-common';\nimport { BaseFilter, FilterType, PullRequestFilter } from './types';\nimport { stringArrayHas } from '../../../../utils';\n\n/** @public */\nexport type AssignedToUserFilter = BaseFilter &\n (\n | {\n type: FilterType.AssignedToUser;\n email: string;\n }\n | {\n type: FilterType.AssignedToCurrentUser;\n email?: string;\n }\n );\n\nexport function createAssignedToUserFilter(\n filter: AssignedToUserFilter,\n): PullRequestFilter {\n const email = filter.email;\n\n return (pullRequest: DashboardPullRequest): boolean => {\n const uniqueNames = pullRequest.reviewers?.map(\n reviewer => reviewer.uniqueName,\n );\n\n if (!email || !uniqueNames) {\n return false;\n }\n\n return stringArrayHas(uniqueNames, email, true);\n };\n}\n"],"names":[],"mappings":";;;;;AAiCO,SAAS,2BACd,MACmB,EAAA;AACnB,EAAA,MAAM,QAAQ,MAAO,CAAA,KAAA,CAAA;AAErB,EAAA,OAAO,CAAC,WAA+C,KAAA;AACrD,IAAM,MAAA,WAAA,GAAc,YAAY,SAAW,EAAA,GAAA;AAAA,MACzC,cAAY,QAAS,CAAA,UAAA;AAAA,KACvB,CAAA;AAEA,IAAI,IAAA,CAAC,KAAS,IAAA,CAAC,WAAa,EAAA;AAC1B,MAAO,OAAA,KAAA,CAAA;AAAA,KACT;AAEA,IAAO,OAAA,cAAA,CAAe,WAAa,EAAA,KAAA,EAAO,IAAI,CAAA,CAAA;AAAA,GAChD,CAAA;AACF;;;;"}
1
+ {"version":3,"file":"assignedToUserFilter.esm.js","sources":["../../../../../src/components/PullRequestsPage/lib/filters/assignedToUserFilter.ts"],"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 { DashboardPullRequest } from '@backstage-community/plugin-azure-devops-common';\nimport { BaseFilter, FilterType, PullRequestFilter } from './types';\nimport { stringArrayHas } from '../../../../utils';\n\n/** @public */\nexport type AssignedToUserFilter = BaseFilter &\n (\n | {\n type: FilterType.AssignedToUser;\n email: string;\n }\n | {\n type: FilterType.AssignedToCurrentUser;\n email?: string;\n }\n );\n\nexport function createAssignedToUserFilter(\n filter: AssignedToUserFilter,\n): PullRequestFilter {\n const email = filter.email;\n\n return (pullRequest: DashboardPullRequest): boolean => {\n const uniqueNames = pullRequest.reviewers?.map(\n reviewer => reviewer.uniqueName,\n );\n\n if (!email || !uniqueNames) {\n return false;\n }\n\n return stringArrayHas(uniqueNames, email, true);\n };\n}\n"],"names":[],"mappings":";;;;;AAiCO,SAAS,2BACd,MACmB,EAAA;AACnB,EAAA,MAAM,QAAQ,MAAO,CAAA,KAAA;AAErB,EAAA,OAAO,CAAC,WAA+C,KAAA;AACrD,IAAM,MAAA,WAAA,GAAc,YAAY,SAAW,EAAA,GAAA;AAAA,MACzC,cAAY,QAAS,CAAA;AAAA,KACvB;AAEA,IAAI,IAAA,CAAC,KAAS,IAAA,CAAC,WAAa,EAAA;AAC1B,MAAO,OAAA,KAAA;AAAA;AAGT,IAAO,OAAA,cAAA,CAAe,WAAa,EAAA,KAAA,EAAO,IAAI,CAAA;AAAA,GAChD;AACF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"createFilter.esm.js","sources":["../../../../../src/components/PullRequestsPage/lib/filters/createFilter.ts"],"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 { Filter, FilterType, PullRequestFilter } from './types';\n\nimport { DashboardPullRequest } from '@backstage-community/plugin-azure-devops-common';\nimport { createAllFilter } from './allFilter';\nimport { createAssignedToTeamFilter } from './assignedToTeamFilter';\nimport { createAssignedToTeamsFilter } from './assignedToTeamsFilter';\nimport { createAssignedToUserFilter } from './assignedToUserFilter';\nimport { createCreatedByTeamFilter } from './createdByTeamFilter';\nimport { createCreatedByTeamsFilter } from './createdByTeamsFilter';\nimport { createCreatedByUserFilter } from './createdByUserFilter';\n\nexport function createFilter(filters: Filter | Filter[]): PullRequestFilter {\n const mapFilter = (filter: Filter): PullRequestFilter => {\n switch (filter.type) {\n case FilterType.AssignedToUser:\n case FilterType.AssignedToCurrentUser:\n return createAssignedToUserFilter(filter);\n\n case FilterType.CreatedByUser:\n case FilterType.CreatedByCurrentUser:\n return createCreatedByUserFilter(filter);\n\n case FilterType.AssignedToTeam:\n return createAssignedToTeamFilter(filter);\n\n case FilterType.CreatedByTeam:\n return createCreatedByTeamFilter(filter);\n\n case FilterType.AssignedToTeams:\n case FilterType.AssignedToCurrentUsersTeams:\n return createAssignedToTeamsFilter(filter);\n\n case FilterType.CreatedByTeams:\n case FilterType.CreatedByCurrentUsersTeams:\n return createCreatedByTeamsFilter(filter);\n\n case FilterType.All:\n return createAllFilter();\n\n default:\n return _ => false;\n }\n };\n\n if (Array.isArray(filters)) {\n if (filters.length === 1) {\n return mapFilter(filters[0]);\n }\n\n return (pullRequest: DashboardPullRequest): boolean =>\n filters.every(filter => mapFilter(filter)(pullRequest));\n }\n\n return mapFilter(filters);\n}\n"],"names":[],"mappings":";;;;;;;;;AA2BO,SAAS,aAAa,OAA+C,EAAA;AAC1E,EAAM,MAAA,SAAA,GAAY,CAAC,MAAsC,KAAA;AACvD,IAAA,QAAQ,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m.js","sources":["../../../../../src/components/PullRequestsPage/lib/filters/createFilter.ts"],"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 { Filter, FilterType, PullRequestFilter } from './types';\n\nimport { DashboardPullRequest } from '@backstage-community/plugin-azure-devops-common';\nimport { createAllFilter } from './allFilter';\nimport { createAssignedToTeamFilter } from './assignedToTeamFilter';\nimport { createAssignedToTeamsFilter } from './assignedToTeamsFilter';\nimport { createAssignedToUserFilter } from './assignedToUserFilter';\nimport { createCreatedByTeamFilter } from './createdByTeamFilter';\nimport { createCreatedByTeamsFilter } from './createdByTeamsFilter';\nimport { createCreatedByUserFilter } from './createdByUserFilter';\n\nexport function createFilter(filters: Filter | Filter[]): PullRequestFilter {\n const mapFilter = (filter: Filter): PullRequestFilter => {\n switch (filter.type) {\n case FilterType.AssignedToUser:\n case FilterType.AssignedToCurrentUser:\n return createAssignedToUserFilter(filter);\n\n case FilterType.CreatedByUser:\n case FilterType.CreatedByCurrentUser:\n return createCreatedByUserFilter(filter);\n\n case FilterType.AssignedToTeam:\n return createAssignedToTeamFilter(filter);\n\n case FilterType.CreatedByTeam:\n return createCreatedByTeamFilter(filter);\n\n case FilterType.AssignedToTeams:\n case FilterType.AssignedToCurrentUsersTeams:\n return createAssignedToTeamsFilter(filter);\n\n case FilterType.CreatedByTeams:\n case FilterType.CreatedByCurrentUsersTeams:\n return createCreatedByTeamsFilter(filter);\n\n case FilterType.All:\n return createAllFilter();\n\n default:\n return _ => false;\n }\n };\n\n if (Array.isArray(filters)) {\n if (filters.length === 1) {\n return mapFilter(filters[0]);\n }\n\n return (pullRequest: DashboardPullRequest): boolean =>\n filters.every(filter => mapFilter(filter)(pullRequest));\n }\n\n return mapFilter(filters);\n}\n"],"names":[],"mappings":";;;;;;;;;AA2BO,SAAS,aAAa,OAA+C,EAAA;AAC1E,EAAM,MAAA,SAAA,GAAY,CAAC,MAAsC,KAAA;AACvD,IAAA,QAAQ,OAAO,IAAM;AAAA,MACnB,KAAK,UAAW,CAAA,cAAA;AAAA,MAChB,KAAK,UAAW,CAAA,qBAAA;AACd,QAAA,OAAO,2BAA2B,MAAM,CAAA;AAAA,MAE1C,KAAK,UAAW,CAAA,aAAA;AAAA,MAChB,KAAK,UAAW,CAAA,oBAAA;AACd,QAAA,OAAO,0BAA0B,MAAM,CAAA;AAAA,MAEzC,KAAK,UAAW,CAAA,cAAA;AACd,QAAA,OAAO,2BAA2B,MAAM,CAAA;AAAA,MAE1C,KAAK,UAAW,CAAA,aAAA;AACd,QAAA,OAAO,0BAA0B,MAAM,CAAA;AAAA,MAEzC,KAAK,UAAW,CAAA,eAAA;AAAA,MAChB,KAAK,UAAW,CAAA,2BAAA;AACd,QAAA,OAAO,4BAA4B,MAAM,CAAA;AAAA,MAE3C,KAAK,UAAW,CAAA,cAAA;AAAA,MAChB,KAAK,UAAW,CAAA,0BAAA;AACd,QAAA,OAAO,2BAA2B,MAAM,CAAA;AAAA,MAE1C,KAAK,UAAW,CAAA,GAAA;AACd,QAAA,OAAO,eAAgB,EAAA;AAAA,MAEzB;AACE,QAAA,OAAO,CAAK,CAAA,KAAA,KAAA;AAAA;AAChB,GACF;AAEA,EAAI,IAAA,KAAA,CAAM,OAAQ,CAAA,OAAO,CAAG,EAAA;AAC1B,IAAI,IAAA,OAAA,CAAQ,WAAW,CAAG,EAAA;AACxB,MAAO,OAAA,SAAA,CAAU,OAAQ,CAAA,CAAC,CAAC,CAAA;AAAA;AAG7B,IAAO,OAAA,CAAC,gBACN,OAAQ,CAAA,KAAA,CAAM,YAAU,SAAU,CAAA,MAAM,CAAE,CAAA,WAAW,CAAC,CAAA;AAAA;AAG1D,EAAA,OAAO,UAAU,OAAO,CAAA;AAC1B;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"createdByTeamFilter.esm.js","sources":["../../../../../src/components/PullRequestsPage/lib/filters/createdByTeamFilter.ts"],"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 { DashboardPullRequest } from '@backstage-community/plugin-azure-devops-common';\nimport { BaseFilter, FilterType, PullRequestFilter } from './types';\nimport { stringArrayHas } from '../../../../utils';\n\n/** @public */\nexport type CreatedByTeamFilter = BaseFilter &\n ({\n type: FilterType.CreatedByTeam;\n } & ({ teamId: string } | { teamName: string }));\n\nexport function createCreatedByTeamFilter(\n filter: CreatedByTeamFilter,\n): PullRequestFilter {\n return (pullRequest: DashboardPullRequest): boolean => {\n const [createdByTeams, team] =\n 'teamId' in filter\n ? [pullRequest.createdBy?.teamIds, filter.teamId]\n : [pullRequest.createdBy?.teamNames, filter.teamName];\n\n if (!createdByTeams) {\n return false;\n }\n\n return stringArrayHas(createdByTeams, team, true);\n };\n}\n"],"names":[],"mappings":";;;;;AA0BO,SAAS,0BACd,MACmB,EAAA;AACnB,EAAA,OAAO,CAAC,WAA+C,KAAA;AACrD,IAAA,MAAM,CAAC,cAAgB,EAAA,IAAI,IACzB,QAAY,IAAA,MAAA,GACR,CAAC,WAAY,CAAA,SAAA,EAAW,OAAS,EAAA,MAAA,CAAO,MAAM,CAC9C,GAAA,CAAC,YAAY,SAAW,EAAA,SAAA,EAAW,OAAO,QAAQ,CAAA,CAAA;AAExD,IAAA,IAAI,CAAC,cAAgB,EAAA;AACnB,MAAO,OAAA,KAAA,CAAA;AAAA,KACT;AAEA,IAAO,OAAA,cAAA,CAAe,cAAgB,EAAA,IAAA,EAAM,IAAI,CAAA,CAAA;AAAA,GAClD,CAAA;AACF;;;;"}
1
+ {"version":3,"file":"createdByTeamFilter.esm.js","sources":["../../../../../src/components/PullRequestsPage/lib/filters/createdByTeamFilter.ts"],"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 { DashboardPullRequest } from '@backstage-community/plugin-azure-devops-common';\nimport { BaseFilter, FilterType, PullRequestFilter } from './types';\nimport { stringArrayHas } from '../../../../utils';\n\n/** @public */\nexport type CreatedByTeamFilter = BaseFilter &\n ({\n type: FilterType.CreatedByTeam;\n } & ({ teamId: string } | { teamName: string }));\n\nexport function createCreatedByTeamFilter(\n filter: CreatedByTeamFilter,\n): PullRequestFilter {\n return (pullRequest: DashboardPullRequest): boolean => {\n const [createdByTeams, team] =\n 'teamId' in filter\n ? [pullRequest.createdBy?.teamIds, filter.teamId]\n : [pullRequest.createdBy?.teamNames, filter.teamName];\n\n if (!createdByTeams) {\n return false;\n }\n\n return stringArrayHas(createdByTeams, team, true);\n };\n}\n"],"names":[],"mappings":";;;;;AA0BO,SAAS,0BACd,MACmB,EAAA;AACnB,EAAA,OAAO,CAAC,WAA+C,KAAA;AACrD,IAAA,MAAM,CAAC,cAAgB,EAAA,IAAI,IACzB,QAAY,IAAA,MAAA,GACR,CAAC,WAAY,CAAA,SAAA,EAAW,OAAS,EAAA,MAAA,CAAO,MAAM,CAC9C,GAAA,CAAC,YAAY,SAAW,EAAA,SAAA,EAAW,OAAO,QAAQ,CAAA;AAExD,IAAA,IAAI,CAAC,cAAgB,EAAA;AACnB,MAAO,OAAA,KAAA;AAAA;AAGT,IAAO,OAAA,cAAA,CAAe,cAAgB,EAAA,IAAA,EAAM,IAAI,CAAA;AAAA,GAClD;AACF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"createdByTeamsFilter.esm.js","sources":["../../../../../src/components/PullRequestsPage/lib/filters/createdByTeamsFilter.ts"],"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 { DashboardPullRequest } from '@backstage-community/plugin-azure-devops-common';\nimport { BaseFilter, FilterType, PullRequestFilter } from './types';\nimport { createCreatedByTeamFilter } from './createdByTeamFilter';\n\n/** @public */\nexport type CreatedByTeamsFilter = BaseFilter &\n (\n | ({\n type: FilterType.CreatedByTeams;\n } & ({ teamIds: string[] } | { teamNames: string[] }))\n | {\n type: FilterType.CreatedByCurrentUsersTeams;\n teamIds?: string[];\n }\n );\n\nexport function createCreatedByTeamsFilter(\n filter: CreatedByTeamsFilter,\n): PullRequestFilter {\n return (pullRequest: DashboardPullRequest): boolean => {\n if ('teamNames' in filter) {\n const teamNames = filter.teamNames;\n\n if (!teamNames) {\n return false;\n }\n\n return teamNames.some(teamName => {\n return createCreatedByTeamFilter({\n type: FilterType.CreatedByTeam,\n teamName,\n })(pullRequest);\n });\n }\n\n const teamIds = filter.teamIds;\n\n if (!teamIds) {\n return false;\n }\n\n return teamIds.some(teamId => {\n return createCreatedByTeamFilter({\n type: FilterType.CreatedByTeam,\n teamId,\n })(pullRequest);\n });\n };\n}\n"],"names":[],"mappings":";;;AAgCO,SAAS,2BACd,MACmB,EAAA;AACnB,EAAA,OAAO,CAAC,WAA+C,KAAA;AACrD,IAAA,IAAI,eAAe,MAAQ,EAAA;AACzB,MAAA,MAAM,YAAY,MAAO,CAAA,SAAA,CAAA;AAEzB,MAAA,IAAI,CAAC,SAAW,EAAA;AACd,QAAO,OAAA,KAAA,CAAA;AAAA,OACT;AAEA,MAAO,OAAA,SAAA,CAAU,KAAK,CAAY,QAAA,KAAA;AAChC,QAAA,OAAO,yBAA0B,CAAA;AAAA,UAC/B,MAAM,UAAW,CAAA,aAAA;AAAA,UACjB,QAAA;AAAA,SACD,EAAE,WAAW,CAAA,CAAA;AAAA,OACf,CAAA,CAAA;AAAA,KACH;AAEA,IAAA,MAAM,UAAU,MAAO,CAAA,OAAA,CAAA;AAEvB,IAAA,IAAI,CAAC,OAAS,EAAA;AACZ,MAAO,OAAA,KAAA,CAAA;AAAA,KACT;AAEA,IAAO,OAAA,OAAA,CAAQ,KAAK,CAAU,MAAA,KAAA;AAC5B,MAAA,OAAO,yBAA0B,CAAA;AAAA,QAC/B,MAAM,UAAW,CAAA,aAAA;AAAA,QACjB,MAAA;AAAA,OACD,EAAE,WAAW,CAAA,CAAA;AAAA,KACf,CAAA,CAAA;AAAA,GACH,CAAA;AACF;;;;"}
1
+ {"version":3,"file":"createdByTeamsFilter.esm.js","sources":["../../../../../src/components/PullRequestsPage/lib/filters/createdByTeamsFilter.ts"],"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 { DashboardPullRequest } from '@backstage-community/plugin-azure-devops-common';\nimport { BaseFilter, FilterType, PullRequestFilter } from './types';\nimport { createCreatedByTeamFilter } from './createdByTeamFilter';\n\n/** @public */\nexport type CreatedByTeamsFilter = BaseFilter &\n (\n | ({\n type: FilterType.CreatedByTeams;\n } & ({ teamIds: string[] } | { teamNames: string[] }))\n | {\n type: FilterType.CreatedByCurrentUsersTeams;\n teamIds?: string[];\n }\n );\n\nexport function createCreatedByTeamsFilter(\n filter: CreatedByTeamsFilter,\n): PullRequestFilter {\n return (pullRequest: DashboardPullRequest): boolean => {\n if ('teamNames' in filter) {\n const teamNames = filter.teamNames;\n\n if (!teamNames) {\n return false;\n }\n\n return teamNames.some(teamName => {\n return createCreatedByTeamFilter({\n type: FilterType.CreatedByTeam,\n teamName,\n })(pullRequest);\n });\n }\n\n const teamIds = filter.teamIds;\n\n if (!teamIds) {\n return false;\n }\n\n return teamIds.some(teamId => {\n return createCreatedByTeamFilter({\n type: FilterType.CreatedByTeam,\n teamId,\n })(pullRequest);\n });\n };\n}\n"],"names":[],"mappings":";;;AAgCO,SAAS,2BACd,MACmB,EAAA;AACnB,EAAA,OAAO,CAAC,WAA+C,KAAA;AACrD,IAAA,IAAI,eAAe,MAAQ,EAAA;AACzB,MAAA,MAAM,YAAY,MAAO,CAAA,SAAA;AAEzB,MAAA,IAAI,CAAC,SAAW,EAAA;AACd,QAAO,OAAA,KAAA;AAAA;AAGT,MAAO,OAAA,SAAA,CAAU,KAAK,CAAY,QAAA,KAAA;AAChC,QAAA,OAAO,yBAA0B,CAAA;AAAA,UAC/B,MAAM,UAAW,CAAA,aAAA;AAAA,UACjB;AAAA,SACD,EAAE,WAAW,CAAA;AAAA,OACf,CAAA;AAAA;AAGH,IAAA,MAAM,UAAU,MAAO,CAAA,OAAA;AAEvB,IAAA,IAAI,CAAC,OAAS,EAAA;AACZ,MAAO,OAAA,KAAA;AAAA;AAGT,IAAO,OAAA,OAAA,CAAQ,KAAK,CAAU,MAAA,KAAA;AAC5B,MAAA,OAAO,yBAA0B,CAAA;AAAA,QAC/B,MAAM,UAAW,CAAA,aAAA;AAAA,QACjB;AAAA,OACD,EAAE,WAAW,CAAA;AAAA,KACf,CAAA;AAAA,GACH;AACF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"createdByUserFilter.esm.js","sources":["../../../../../src/components/PullRequestsPage/lib/filters/createdByUserFilter.ts"],"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 { DashboardPullRequest } from '@backstage-community/plugin-azure-devops-common';\nimport { BaseFilter, FilterType, PullRequestFilter } from './types';\nimport { equalsIgnoreCase } from '../../../../utils';\n\n/** @public */\nexport type CreatedByUserFilter = BaseFilter &\n (\n | {\n type: FilterType.CreatedByUser;\n email: string;\n }\n | {\n type: FilterType.CreatedByCurrentUser;\n email?: string;\n }\n );\n\nexport function createCreatedByUserFilter(\n filter: CreatedByUserFilter,\n): PullRequestFilter {\n const email = filter.email;\n\n return (pullRequest: DashboardPullRequest): boolean => {\n const uniqueName = pullRequest.createdBy?.uniqueName;\n\n if (!email || !uniqueName) {\n return false;\n }\n\n return equalsIgnoreCase(email, uniqueName);\n };\n}\n"],"names":[],"mappings":";;;;;AAiCO,SAAS,0BACd,MACmB,EAAA;AACnB,EAAA,MAAM,QAAQ,MAAO,CAAA,KAAA,CAAA;AAErB,EAAA,OAAO,CAAC,WAA+C,KAAA;AACrD,IAAM,MAAA,UAAA,GAAa,YAAY,SAAW,EAAA,UAAA,CAAA;AAE1C,IAAI,IAAA,CAAC,KAAS,IAAA,CAAC,UAAY,EAAA;AACzB,MAAO,OAAA,KAAA,CAAA;AAAA,KACT;AAEA,IAAO,OAAA,gBAAA,CAAiB,OAAO,UAAU,CAAA,CAAA;AAAA,GAC3C,CAAA;AACF;;;;"}
1
+ {"version":3,"file":"createdByUserFilter.esm.js","sources":["../../../../../src/components/PullRequestsPage/lib/filters/createdByUserFilter.ts"],"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 { DashboardPullRequest } from '@backstage-community/plugin-azure-devops-common';\nimport { BaseFilter, FilterType, PullRequestFilter } from './types';\nimport { equalsIgnoreCase } from '../../../../utils';\n\n/** @public */\nexport type CreatedByUserFilter = BaseFilter &\n (\n | {\n type: FilterType.CreatedByUser;\n email: string;\n }\n | {\n type: FilterType.CreatedByCurrentUser;\n email?: string;\n }\n );\n\nexport function createCreatedByUserFilter(\n filter: CreatedByUserFilter,\n): PullRequestFilter {\n const email = filter.email;\n\n return (pullRequest: DashboardPullRequest): boolean => {\n const uniqueName = pullRequest.createdBy?.uniqueName;\n\n if (!email || !uniqueName) {\n return false;\n }\n\n return equalsIgnoreCase(email, uniqueName);\n };\n}\n"],"names":[],"mappings":";;;;;AAiCO,SAAS,0BACd,MACmB,EAAA;AACnB,EAAA,MAAM,QAAQ,MAAO,CAAA,KAAA;AAErB,EAAA,OAAO,CAAC,WAA+C,KAAA;AACrD,IAAM,MAAA,UAAA,GAAa,YAAY,SAAW,EAAA,UAAA;AAE1C,IAAI,IAAA,CAAC,KAAS,IAAA,CAAC,UAAY,EAAA;AACzB,MAAO,OAAA,KAAA;AAAA;AAGT,IAAO,OAAA,gBAAA,CAAiB,OAAO,UAAU,CAAA;AAAA,GAC3C;AACF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.esm.js","sources":["../../../../../src/components/PullRequestsPage/lib/filters/types.ts"],"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 { AllFilter } from './allFilter';\nimport { AssignedToTeamFilter } from './assignedToTeamFilter';\nimport { AssignedToTeamsFilter } from './assignedToTeamsFilter';\nimport { AssignedToUserFilter } from './assignedToUserFilter';\nimport { CreatedByTeamFilter } from './createdByTeamFilter';\nimport { CreatedByTeamsFilter } from './createdByTeamsFilter';\nimport { CreatedByUserFilter } from './createdByUserFilter';\nimport { DashboardPullRequest } from '@backstage-community/plugin-azure-devops-common';\n\n/** @public */\nexport enum FilterType {\n All = 'All',\n\n // Assigned To\n AssignedToUser = 'AssignedToUser',\n AssignedToCurrentUser = 'AssignedToCurrentUser',\n AssignedToTeam = 'AssignedToTeam',\n AssignedToTeams = 'AssignedToTeams',\n AssignedToCurrentUsersTeams = 'AssignedToCurrentUsersTeams',\n\n // Created By\n CreatedByUser = 'CreatedByUser',\n CreatedByCurrentUser = 'CreatedByCurrentUser',\n CreatedByTeam = 'CreatedByTeam',\n CreatedByTeams = 'CreatedByTeams',\n CreatedByCurrentUsersTeams = 'CreatedByCurrentUsersTeams',\n}\n\n/** @public */\nexport const FilterTypes = [\n FilterType.All,\n\n FilterType.AssignedToUser,\n FilterType.AssignedToCurrentUser,\n FilterType.AssignedToTeam,\n FilterType.AssignedToTeams,\n FilterType.AssignedToCurrentUsersTeams,\n\n FilterType.CreatedByUser,\n FilterType.CreatedByCurrentUser,\n FilterType.CreatedByTeam,\n FilterType.CreatedByTeams,\n FilterType.CreatedByCurrentUsersTeams,\n] as const;\n\n/** @public */\nexport type BaseFilter = {\n type: FilterType;\n};\n\n/** @public */\nexport type Filter =\n | AssignedToUserFilter\n | CreatedByUserFilter\n | AssignedToTeamFilter\n | CreatedByTeamFilter\n | AssignedToTeamsFilter\n | CreatedByTeamsFilter\n | AllFilter;\n\nexport type {\n AssignedToUserFilter,\n CreatedByUserFilter,\n AssignedToTeamFilter,\n CreatedByTeamFilter,\n AssignedToTeamsFilter,\n CreatedByTeamsFilter,\n AllFilter,\n};\n\n/** @public */\nexport type PullRequestFilter = (pullRequest: DashboardPullRequest) => boolean;\n"],"names":["FilterType"],"mappings":"AA0BY,IAAA,UAAA,qBAAAA,WAAL,KAAA;AACL,EAAAA,YAAA,KAAM,CAAA,GAAA,KAAA,CAAA;AAGN,EAAAA,YAAA,gBAAiB,CAAA,GAAA,gBAAA,CAAA;AACjB,EAAAA,YAAA,uBAAwB,CAAA,GAAA,uBAAA,CAAA;AACxB,EAAAA,YAAA,gBAAiB,CAAA,GAAA,gBAAA,CAAA;AACjB,EAAAA,YAAA,iBAAkB,CAAA,GAAA,iBAAA,CAAA;AAClB,EAAAA,YAAA,6BAA8B,CAAA,GAAA,6BAAA,CAAA;AAG9B,EAAAA,YAAA,eAAgB,CAAA,GAAA,eAAA,CAAA;AAChB,EAAAA,YAAA,sBAAuB,CAAA,GAAA,sBAAA,CAAA;AACvB,EAAAA,YAAA,eAAgB,CAAA,GAAA,eAAA,CAAA;AAChB,EAAAA,YAAA,gBAAiB,CAAA,GAAA,gBAAA,CAAA;AACjB,EAAAA,YAAA,4BAA6B,CAAA,GAAA,4BAAA,CAAA;AAfnB,EAAAA,OAAAA,WAAAA,CAAAA;AAAA,CAAA,EAAA,UAAA,IAAA,EAAA;;;;"}
1
+ {"version":3,"file":"types.esm.js","sources":["../../../../../src/components/PullRequestsPage/lib/filters/types.ts"],"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 { AllFilter } from './allFilter';\nimport { AssignedToTeamFilter } from './assignedToTeamFilter';\nimport { AssignedToTeamsFilter } from './assignedToTeamsFilter';\nimport { AssignedToUserFilter } from './assignedToUserFilter';\nimport { CreatedByTeamFilter } from './createdByTeamFilter';\nimport { CreatedByTeamsFilter } from './createdByTeamsFilter';\nimport { CreatedByUserFilter } from './createdByUserFilter';\nimport { DashboardPullRequest } from '@backstage-community/plugin-azure-devops-common';\n\n/** @public */\nexport enum FilterType {\n All = 'All',\n\n // Assigned To\n AssignedToUser = 'AssignedToUser',\n AssignedToCurrentUser = 'AssignedToCurrentUser',\n AssignedToTeam = 'AssignedToTeam',\n AssignedToTeams = 'AssignedToTeams',\n AssignedToCurrentUsersTeams = 'AssignedToCurrentUsersTeams',\n\n // Created By\n CreatedByUser = 'CreatedByUser',\n CreatedByCurrentUser = 'CreatedByCurrentUser',\n CreatedByTeam = 'CreatedByTeam',\n CreatedByTeams = 'CreatedByTeams',\n CreatedByCurrentUsersTeams = 'CreatedByCurrentUsersTeams',\n}\n\n/** @public */\nexport const FilterTypes = [\n FilterType.All,\n\n FilterType.AssignedToUser,\n FilterType.AssignedToCurrentUser,\n FilterType.AssignedToTeam,\n FilterType.AssignedToTeams,\n FilterType.AssignedToCurrentUsersTeams,\n\n FilterType.CreatedByUser,\n FilterType.CreatedByCurrentUser,\n FilterType.CreatedByTeam,\n FilterType.CreatedByTeams,\n FilterType.CreatedByCurrentUsersTeams,\n] as const;\n\n/** @public */\nexport type BaseFilter = {\n type: FilterType;\n};\n\n/** @public */\nexport type Filter =\n | AssignedToUserFilter\n | CreatedByUserFilter\n | AssignedToTeamFilter\n | CreatedByTeamFilter\n | AssignedToTeamsFilter\n | CreatedByTeamsFilter\n | AllFilter;\n\nexport type {\n AssignedToUserFilter,\n CreatedByUserFilter,\n AssignedToTeamFilter,\n CreatedByTeamFilter,\n AssignedToTeamsFilter,\n CreatedByTeamsFilter,\n AllFilter,\n};\n\n/** @public */\nexport type PullRequestFilter = (pullRequest: DashboardPullRequest) => boolean;\n"],"names":["FilterType"],"mappings":"AA0BY,IAAA,UAAA,qBAAAA,WAAL,KAAA;AACL,EAAAA,YAAA,KAAM,CAAA,GAAA,KAAA;AAGN,EAAAA,YAAA,gBAAiB,CAAA,GAAA,gBAAA;AACjB,EAAAA,YAAA,uBAAwB,CAAA,GAAA,uBAAA;AACxB,EAAAA,YAAA,gBAAiB,CAAA,GAAA,gBAAA;AACjB,EAAAA,YAAA,iBAAkB,CAAA,GAAA,iBAAA;AAClB,EAAAA,YAAA,6BAA8B,CAAA,GAAA,6BAAA;AAG9B,EAAAA,YAAA,eAAgB,CAAA,GAAA,eAAA;AAChB,EAAAA,YAAA,sBAAuB,CAAA,GAAA,sBAAA;AACvB,EAAAA,YAAA,eAAgB,CAAA,GAAA,eAAA;AAChB,EAAAA,YAAA,gBAAiB,CAAA,GAAA,gBAAA;AACjB,EAAAA,YAAA,4BAA6B,CAAA,GAAA,4BAAA;AAfnB,EAAAA,OAAAA,WAAAA;AAAA,CAAA,EAAA,UAAA,IAAA,EAAA;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useFilterProcessor.esm.js","sources":["../../../../../src/components/PullRequestsPage/lib/hooks/useFilterProcessor.ts"],"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 { Filter, FilterType } from '../filters';\nimport { useUserEmail, useUserTeamIds } from '../../../../hooks';\n\nexport function useFilterProcessor(): (filters: Filter[]) => Filter[] {\n const userEmail = useUserEmail();\n const { teamIds } = useUserTeamIds(userEmail);\n\n return (filters: Filter[]): Filter[] => {\n for (const filter of filters) {\n switch (filter.type) {\n case FilterType.AssignedToCurrentUser:\n case FilterType.CreatedByCurrentUser:\n filter.email = userEmail;\n break;\n\n case FilterType.AssignedToCurrentUsersTeams:\n case FilterType.CreatedByCurrentUsersTeams:\n filter.teamIds = teamIds;\n break;\n\n default:\n break;\n }\n }\n\n return filters;\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAmBO,SAAS,kBAAsD,GAAA;AACpE,EAAA,MAAM,YAAY,YAAa,EAAA,CAAA;AAC/B,EAAA,MAAM,EAAE,OAAA,EAAY,GAAA,cAAA,CAAe,SAAS,CAAA,CAAA;AAE5C,EAAA,OAAO,CAAC,OAAgC,KAAA;AACtC,IAAA,KAAA,MAAW,UAAU,OAAS,EAAA;AAC5B,MAAA,QAAQ,OAAO,IAAM;AAAA,QACnB,KAAK,UAAW,CAAA,qBAAA,CAAA;AAAA,QAChB,KAAK,UAAW,CAAA,oBAAA;AACd,UAAA,MAAA,CAAO,KAAQ,GAAA,SAAA,CAAA;AACf,UAAA,MAAA;AAAA,QAEF,KAAK,UAAW,CAAA,2BAAA,CAAA;AAAA,QAChB,KAAK,UAAW,CAAA,0BAAA;AACd,UAAA,MAAA,CAAO,OAAU,GAAA,OAAA,CAAA;AACjB,UAAA,MAAA;AAGA,OACJ;AAAA,KACF;AAEA,IAAO,OAAA,OAAA,CAAA;AAAA,GACT,CAAA;AACF;;;;"}
1
+ {"version":3,"file":"useFilterProcessor.esm.js","sources":["../../../../../src/components/PullRequestsPage/lib/hooks/useFilterProcessor.ts"],"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 { Filter, FilterType } from '../filters';\nimport { useUserEmail, useUserTeamIds } from '../../../../hooks';\n\nexport function useFilterProcessor(): (filters: Filter[]) => Filter[] {\n const userEmail = useUserEmail();\n const { teamIds } = useUserTeamIds(userEmail);\n\n return (filters: Filter[]): Filter[] => {\n for (const filter of filters) {\n switch (filter.type) {\n case FilterType.AssignedToCurrentUser:\n case FilterType.CreatedByCurrentUser:\n filter.email = userEmail;\n break;\n\n case FilterType.AssignedToCurrentUsersTeams:\n case FilterType.CreatedByCurrentUsersTeams:\n filter.teamIds = teamIds;\n break;\n\n default:\n break;\n }\n }\n\n return filters;\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAmBO,SAAS,kBAAsD,GAAA;AACpE,EAAA,MAAM,YAAY,YAAa,EAAA;AAC/B,EAAA,MAAM,EAAE,OAAA,EAAY,GAAA,cAAA,CAAe,SAAS,CAAA;AAE5C,EAAA,OAAO,CAAC,OAAgC,KAAA;AACtC,IAAA,KAAA,MAAW,UAAU,OAAS,EAAA;AAC5B,MAAA,QAAQ,OAAO,IAAM;AAAA,QACnB,KAAK,UAAW,CAAA,qBAAA;AAAA,QAChB,KAAK,UAAW,CAAA,oBAAA;AACd,UAAA,MAAA,CAAO,KAAQ,GAAA,SAAA;AACf,UAAA;AAAA,QAEF,KAAK,UAAW,CAAA,2BAAA;AAAA,QAChB,KAAK,UAAW,CAAA,0BAAA;AACd,UAAA,MAAA,CAAO,OAAU,GAAA,OAAA;AACjB,UAAA;AAGA;AACJ;AAGF,IAAO,OAAA,OAAA;AAAA,GACT;AACF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.esm.js","sources":["../../../../src/components/PullRequestsPage/lib/utils.ts"],"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 DashboardPullRequest,\n PullRequestVoteStatus,\n Reviewer,\n} from '@backstage-community/plugin-azure-devops-common';\nimport { Filter, createFilter } from './filters';\nimport {\n PullRequestColumnConfig,\n PullRequestGroup,\n PullRequestGroupConfig,\n} from './types';\n\n/**\n * Filters a reviewer based on vote status and if the reviewer is required.\n * @param reviewer - a reviewer to filter.\n * @returns whether or not to filter the `reviewer`.\n */\nexport function reviewerFilter(reviewer: Reviewer): boolean {\n return reviewer.voteStatus === PullRequestVoteStatus.NoVote\n ? !!reviewer.isRequired\n : !reviewer.isContainer;\n}\n\n/**\n * Removes values from the provided array and returns them.\n * @param arr - the array to extract values from.\n * @param filter - a filter used to extract values from the provided array.\n * @returns the values that were extracted from the array.\n *\n * @example\n * ```ts\n * const numbers = [1, 2, 3, 4, 5, 6];\n * const numberFilter = (num: number): boolean => num > 3;\n * const extractedNumbers = arrayExtract(numbers, numberFilter);\n * console.log(numbers); // [1, 2, 3]\n * console.log(extractedNumbers); // [4, 5, 6]\n * ```\n *\n * @example\n * ```ts\n * const numbers = [1, 2, 3, 4, 5, 6];\n * const numberFilter = (num: number): boolean => num % 2 === 0;\n * const extractedNumbers = arrayExtract(numbers, numberFilter);\n * console.log(numbers); // [1, 3, 5]\n * console.log(extractedNumbers); // [2, 4, 6]\n * ```\n */\nexport function arrayExtract<T>(arr: T[], filter: (value: T) => unknown): T[] {\n const extractedValues: T[] = [];\n\n for (let i = 0; i - extractedValues.length < arr.length; i++) {\n const offsetIndex = i - extractedValues.length;\n\n const value = arr[offsetIndex];\n\n if (filter(value)) {\n arr.splice(offsetIndex, 1);\n extractedValues.push(value);\n }\n }\n\n return extractedValues;\n}\n\n/**\n * Creates groups of pull requests based on a list of `PullRequestGroupConfig`.\n * @param pullRequests - all pull requests to be split up into groups.\n * @param configs - the config used for splitting up the pull request groups.\n * @returns a list of pull request groups.\n */\nexport function getPullRequestGroups(\n pullRequests: DashboardPullRequest[] | undefined,\n configs: PullRequestGroupConfig[],\n): PullRequestGroup[] | undefined {\n if (!pullRequests) {\n return undefined;\n }\n\n const remainingPullRequests: DashboardPullRequest[] = [...pullRequests];\n const pullRequestGroups: PullRequestGroup[] = [];\n\n configs.forEach(({ title, filter: configFilter, simplified }) => {\n const groupPullRequests = arrayExtract(remainingPullRequests, configFilter);\n\n pullRequestGroups.push({\n title,\n pullRequests: groupPullRequests,\n simplified,\n });\n });\n\n return pullRequestGroups;\n}\n\nexport function getPullRequestGroupConfigs(\n columnConfigs: PullRequestColumnConfig[],\n filterProcessor: (filters: Filter[]) => Filter[],\n): PullRequestGroupConfig[] {\n return columnConfigs.map(columnConfig => {\n const filters = filterProcessor(columnConfig.filters);\n return {\n title: columnConfig.title,\n filter: createFilter(filters),\n simplified: columnConfig.simplified,\n };\n });\n}\n"],"names":[],"mappings":";;;AAiCO,SAAS,eAAe,QAA6B,EAAA;AAC1D,EAAO,OAAA,QAAA,CAAS,eAAe,qBAAsB,CAAA,MAAA,GACjD,CAAC,CAAC,QAAA,CAAS,UACX,GAAA,CAAC,QAAS,CAAA,WAAA,CAAA;AAChB,CAAA;AA0BgB,SAAA,YAAA,CAAgB,KAAU,MAAoC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AAA,CAAa,OAAO,CAAA,CAAA;AACpD,IAAO,OAAA;AAAA,MACL,OAAO,YAAa,CAAA,KAAA;AAAA,MACpB,MAAA,EAAQ,aAAa,OAAO,CAAA;AAAA,MAC5B,YAAY,YAAa,CAAA,UAAA;AAAA,KAC3B,CAAA;AAAA,GACD,CAAA,CAAA;AACH;;;;"}
1
+ {"version":3,"file":"utils.esm.js","sources":["../../../../src/components/PullRequestsPage/lib/utils.ts"],"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 DashboardPullRequest,\n PullRequestVoteStatus,\n Reviewer,\n} from '@backstage-community/plugin-azure-devops-common';\nimport { Filter, createFilter } from './filters';\nimport {\n PullRequestColumnConfig,\n PullRequestGroup,\n PullRequestGroupConfig,\n} from './types';\n\n/**\n * Filters a reviewer based on vote status and if the reviewer is required.\n * @param reviewer - a reviewer to filter.\n * @returns whether or not to filter the `reviewer`.\n */\nexport function reviewerFilter(reviewer: Reviewer): boolean {\n return reviewer.voteStatus === PullRequestVoteStatus.NoVote\n ? !!reviewer.isRequired\n : !reviewer.isContainer;\n}\n\n/**\n * Removes values from the provided array and returns them.\n * @param arr - the array to extract values from.\n * @param filter - a filter used to extract values from the provided array.\n * @returns the values that were extracted from the array.\n *\n * @example\n * ```ts\n * const numbers = [1, 2, 3, 4, 5, 6];\n * const numberFilter = (num: number): boolean => num > 3;\n * const extractedNumbers = arrayExtract(numbers, numberFilter);\n * console.log(numbers); // [1, 2, 3]\n * console.log(extractedNumbers); // [4, 5, 6]\n * ```\n *\n * @example\n * ```ts\n * const numbers = [1, 2, 3, 4, 5, 6];\n * const numberFilter = (num: number): boolean => num % 2 === 0;\n * const extractedNumbers = arrayExtract(numbers, numberFilter);\n * console.log(numbers); // [1, 3, 5]\n * console.log(extractedNumbers); // [2, 4, 6]\n * ```\n */\nexport function arrayExtract<T>(arr: T[], filter: (value: T) => unknown): T[] {\n const extractedValues: T[] = [];\n\n for (let i = 0; i - extractedValues.length < arr.length; i++) {\n const offsetIndex = i - extractedValues.length;\n\n const value = arr[offsetIndex];\n\n if (filter(value)) {\n arr.splice(offsetIndex, 1);\n extractedValues.push(value);\n }\n }\n\n return extractedValues;\n}\n\n/**\n * Creates groups of pull requests based on a list of `PullRequestGroupConfig`.\n * @param pullRequests - all pull requests to be split up into groups.\n * @param configs - the config used for splitting up the pull request groups.\n * @returns a list of pull request groups.\n */\nexport function getPullRequestGroups(\n pullRequests: DashboardPullRequest[] | undefined,\n configs: PullRequestGroupConfig[],\n): PullRequestGroup[] | undefined {\n if (!pullRequests) {\n return undefined;\n }\n\n const remainingPullRequests: DashboardPullRequest[] = [...pullRequests];\n const pullRequestGroups: PullRequestGroup[] = [];\n\n configs.forEach(({ title, filter: configFilter, simplified }) => {\n const groupPullRequests = arrayExtract(remainingPullRequests, configFilter);\n\n pullRequestGroups.push({\n title,\n pullRequests: groupPullRequests,\n simplified,\n });\n });\n\n return pullRequestGroups;\n}\n\nexport function getPullRequestGroupConfigs(\n columnConfigs: PullRequestColumnConfig[],\n filterProcessor: (filters: Filter[]) => Filter[],\n): PullRequestGroupConfig[] {\n return columnConfigs.map(columnConfig => {\n const filters = filterProcessor(columnConfig.filters);\n return {\n title: columnConfig.title,\n filter: createFilter(filters),\n simplified: columnConfig.simplified,\n };\n });\n}\n"],"names":[],"mappings":";;;AAiCO,SAAS,eAAe,QAA6B,EAAA;AAC1D,EAAO,OAAA,QAAA,CAAS,eAAe,qBAAsB,CAAA,MAAA,GACjD,CAAC,CAAC,QAAA,CAAS,UACX,GAAA,CAAC,QAAS,CAAA,WAAA;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AA,KAAA;AAAA,MACpB,MAAA,EAAQ,aAAa,OAAO,CAAA;AAAA,MAC5B,YAAY,YAAa,CAAA;AAAA,KAC3B;AAAA,GACD,CAAA;AACH;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ReadmeCard.esm.js","sources":["../../../src/components/ReadmeCard/ReadmeCard.tsx"],"sourcesContent":["/*\n * Copyright 2022 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 Button from '@material-ui/core/Button';\nimport { makeStyles } from '@material-ui/core/styles';\nimport {\n InfoCard,\n Progress,\n MarkdownContent,\n EmptyState,\n ErrorPanel,\n} from '@backstage/core-components';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport React from 'react';\n\nimport { useReadme } from '../../hooks';\n\nconst useStyles = makeStyles(theme => ({\n readMe: {\n overflowY: 'auto',\n paddingRight: theme.spacing(1),\n '&::-webkit-scrollbar-track': {\n backgroundColor: '#F5F5F5',\n borderRadius: '5px',\n },\n '&::-webkit-scrollbar': {\n width: '5px',\n backgroundColor: '#F5F5F5',\n borderRadius: '5px',\n },\n '&::-webkit-scrollbar-thumb': {\n border: '1px solid #555555',\n backgroundColor: '#555',\n borderRadius: '4px',\n },\n },\n}));\n\ntype Props = {\n maxHeight?: number;\n};\n\ntype ErrorProps = {\n error: Error;\n};\n\nfunction isNotFoundError(error: any): boolean {\n return error?.response?.status === 404;\n}\n\nconst ReadmeCardError = ({ error }: ErrorProps) => {\n if (isNotFoundError(error)) {\n return (\n <EmptyState\n title=\"No README available for this entity\"\n missing=\"field\"\n description=\"You can add a README to your entity by following the Azure DevOps documentation.\"\n action={\n <Button\n variant=\"contained\"\n color=\"primary\"\n href=\"https://docs.microsoft.com/en-us/azure/devops/repos/git/create-a-readme?view=azure-devops\"\n >\n Read more\n </Button>\n }\n />\n );\n }\n return <ErrorPanel title={error.message} error={error} />;\n};\n\nexport const ReadmeCard = (props: Props) => {\n const classes = useStyles();\n const { entity } = useEntity();\n const { loading, error, item: value } = useReadme(entity);\n\n if (loading) {\n return <Progress />;\n } else if (error) {\n return <ReadmeCardError error={error} />;\n }\n\n return (\n <InfoCard\n title=\"Readme\"\n deepLink={{\n link: value!.url,\n title: 'Readme',\n }}\n >\n <Box className={classes.readMe} sx={{ maxHeight: props.maxHeight }}>\n <MarkdownContent content={value?.content ?? ''} />\n </Box>\n </InfoCard>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AA+BA,MAAM,SAAA,GAAY,WAAW,CAAU,KAAA,MAAA;AAAA,EACrC,MAAQ,EAAA;AAAA,IACN,SAAW,EAAA,MAAA;AAAA,IACX,YAAA,EAAc,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,IAC7B,4BAA8B,EAAA;AAAA,MAC5B,eAAiB,EAAA,SAAA;AAAA,MACjB,YAAc,EAAA,KAAA;AAAA,KAChB;AAAA,IACA,sBAAwB,EAAA;AAAA,MACtB,KAAO,EAAA,KAAA;AAAA,MACP,eAAiB,EAAA,SAAA;AAAA,MACjB,YAAc,EAAA,KAAA;AAAA,KAChB;AAAA,IACA,4BAA8B,EAAA;AAAA,MAC5B,MAAQ,EAAA,mBAAA;AAAA,MACR,eAAiB,EAAA,MAAA;AAAA,MACjB,YAAc,EAAA,KAAA;AAAA,KAChB;AAAA,GACF;AACF,CAAE,CAAA,CAAA,CAAA;AAUF,SAAS,gBAAgB,KAAqB,EAAA;AAC5C,EAAO,OAAA,KAAA,EAAO,UAAU,MAAW,KAAA,GAAA,CAAA;AACrC,CAAA;AAEA,MAAM,eAAkB,GAAA,CAAC,EAAE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T;AAAA,KAAA;AAAA,wCAEC,GAAI,EAAA,EAAA,SAAA,EAAW,OAAQ,CAAA,MAAA,EAAQ,IAAI,EAAE,SAAA,EAAW,KAAM,CAAA,SAAA,sBACpD,KAAA,CAAA,aAAA,CAAA,eAAA,EAAA,EAAgB,SAAS,KAAO,EAAA,OAAA,IAAW,IAAI,CAClD,CAAA;AAAA,GACF,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"ReadmeCard.esm.js","sources":["../../../src/components/ReadmeCard/ReadmeCard.tsx"],"sourcesContent":["/*\n * Copyright 2022 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 Button from '@material-ui/core/Button';\nimport { makeStyles } from '@material-ui/core/styles';\nimport {\n InfoCard,\n Progress,\n MarkdownContent,\n EmptyState,\n ErrorPanel,\n} from '@backstage/core-components';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport React from 'react';\n\nimport { useReadme } from '../../hooks';\n\nconst useStyles = makeStyles(theme => ({\n readMe: {\n overflowY: 'auto',\n paddingRight: theme.spacing(1),\n '&::-webkit-scrollbar-track': {\n backgroundColor: '#F5F5F5',\n borderRadius: '5px',\n },\n '&::-webkit-scrollbar': {\n width: '5px',\n backgroundColor: '#F5F5F5',\n borderRadius: '5px',\n },\n '&::-webkit-scrollbar-thumb': {\n border: '1px solid #555555',\n backgroundColor: '#555',\n borderRadius: '4px',\n },\n },\n}));\n\ntype Props = {\n maxHeight?: number;\n};\n\ntype ErrorProps = {\n error: Error;\n};\n\nfunction isNotFoundError(error: any): boolean {\n return error?.response?.status === 404;\n}\n\nconst ReadmeCardError = ({ error }: ErrorProps) => {\n if (isNotFoundError(error)) {\n return (\n <EmptyState\n title=\"No README available for this entity\"\n missing=\"field\"\n description=\"You can add a README to your entity by following the Azure DevOps documentation.\"\n action={\n <Button\n variant=\"contained\"\n color=\"primary\"\n href=\"https://docs.microsoft.com/en-us/azure/devops/repos/git/create-a-readme?view=azure-devops\"\n >\n Read more\n </Button>\n }\n />\n );\n }\n return <ErrorPanel title={error.message} error={error} />;\n};\n\nexport const ReadmeCard = (props: Props) => {\n const classes = useStyles();\n const { entity } = useEntity();\n const { loading, error, item: value } = useReadme(entity);\n\n if (loading) {\n return <Progress />;\n } else if (error) {\n return <ReadmeCardError error={error} />;\n }\n\n return (\n <InfoCard\n title=\"Readme\"\n deepLink={{\n link: value!.url,\n title: 'Readme',\n }}\n >\n <Box className={classes.readMe} sx={{ maxHeight: props.maxHeight }}>\n <MarkdownContent content={value?.content ?? ''} />\n </Box>\n </InfoCard>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AA+BA,MAAM,SAAA,GAAY,WAAW,CAAU,KAAA,MAAA;AAAA,EACrC,MAAQ,EAAA;AAAA,IACN,SAAW,EAAA,MAAA;AAAA,IACX,YAAA,EAAc,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,IAC7B,4BAA8B,EAAA;AAAA,MAC5B,eAAiB,EAAA,SAAA;AAAA,MACjB,YAAc,EAAA;AAAA,KAChB;AAAA,IACA,sBAAwB,EAAA;AAAA,MACtB,KAAO,EAAA,KAAA;AAAA,MACP,eAAiB,EAAA,SAAA;AAAA,MACjB,YAAc,EAAA;AAAA,KAChB;AAAA,IACA,4BAA8B,EAAA;AAAA,MAC5B,MAAQ,EAAA,mBAAA;AAAA,MACR,eAAiB,EAAA,MAAA;AAAA,MACjB,YAAc,EAAA;AAAA;AAChB;AAEJ,CAAE,CAAA,CAAA;AAUF,SAAS,gBAAgB,KAAqB,EAAA;AAC5C,EAAO,OAAA,KAAA,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AEC,GAAI,EAAA,EAAA,SAAA,EAAW,OAAQ,CAAA,MAAA,EAAQ,IAAI,EAAE,SAAA,EAAW,KAAM,CAAA,SAAA,sBACpD,KAAA,CAAA,aAAA,CAAA,eAAA,EAAA,EAAgB,SAAS,KAAO,EAAA,OAAA,IAAW,IAAI,CAClD;AAAA,GACF;AAEJ;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useBuildRuns.esm.js","sources":["../../src/hooks/useBuildRuns.ts"],"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 AZURE_DEVOPS_DEFAULT_TOP,\n BuildRun,\n BuildRunOptions,\n} from '@backstage-community/plugin-azure-devops-common';\n\nimport { azureDevOpsApiRef } from '../api';\nimport { useApi } from '@backstage/core-plugin-api';\nimport useAsync from 'react-use/esm/useAsync';\nimport { getAnnotationValuesFromEntity } from '../utils';\nimport { Entity, stringifyEntityRef } from '@backstage/catalog-model';\n\nexport function useBuildRuns(\n entity: Entity,\n defaultLimit?: number,\n): {\n items?: BuildRun[];\n loading: boolean;\n error?: Error;\n} {\n const top = defaultLimit ?? AZURE_DEVOPS_DEFAULT_TOP;\n const options: BuildRunOptions = {\n top: top,\n };\n\n const api = useApi(azureDevOpsApiRef);\n\n const { value, loading, error } = useAsync(() => {\n const { project, repo, definition, host, org } =\n getAnnotationValuesFromEntity(entity);\n return api.getBuildRuns(\n project,\n stringifyEntityRef(entity),\n repo,\n definition,\n host,\n org,\n options,\n );\n }, [api]);\n\n return {\n items: value?.items,\n loading,\n error,\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;AA4BgB,SAAA,YAAA,CACd,QACA,YAKA,EAAA;AACA,EAAA,MAAM,MAAM,YAAgB,IAAA,wBAAA,CAAA;AAC5B,EAAA,MAAM,OAA2B,GAAA;AAAA,IAC/B,GAAA;AAAA,GACF,CAAA;AAEA,EAAM,MAAA,GAAA,GAAM,OAAO,iBAAiB,CAAA,CAAA;AAEpC,EAAA,MAAM,EAAE,KAAO,EAAA,OAAA,EAAS,KAAM,EAAA,GAAI,SAAS,MAAM;AAC/C,IAAM,MAAA,EAAE,SAAS,IAAM,EAAA,UAAA,EAAY,MAAM,GAAI,EAAA,GAC3C,8BAA8B,MAAM,CAAA,CAAA;AACtC,IAAA,OAAO,GAAI,CAAA,YAAA;AAAA,MACT,OAAA;AAAA,MACA,mBAAmB,MAAM,CAAA;AAAA,MACzB,IAAA;AAAA,MACA,UAAA;AAAA,MACA,IAAA;AAAA,MACA,GAAA;AAAA,MACA,OAAA;AAAA,KACF,CAAA;AAAA,GACF,EAAG,CAAC,GAAG,CAAC,CAAA,CAAA;AAER,EAAO,OAAA;AAAA,IACL,OAAO,KAAO,EAAA,KAAA;AAAA,IACd,OAAA;AAAA,IACA,KAAA;AAAA,GACF,CAAA;AACF;;;;"}
1
+ {"version":3,"file":"useBuildRuns.esm.js","sources":["../../src/hooks/useBuildRuns.ts"],"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 AZURE_DEVOPS_DEFAULT_TOP,\n BuildRun,\n BuildRunOptions,\n} from '@backstage-community/plugin-azure-devops-common';\n\nimport { azureDevOpsApiRef } from '../api';\nimport { useApi } from '@backstage/core-plugin-api';\nimport useAsync from 'react-use/esm/useAsync';\nimport { getAnnotationValuesFromEntity } from '../utils';\nimport { Entity, stringifyEntityRef } from '@backstage/catalog-model';\n\nexport function useBuildRuns(\n entity: Entity,\n defaultLimit?: number,\n): {\n items?: BuildRun[];\n loading: boolean;\n error?: Error;\n} {\n const top = defaultLimit ?? AZURE_DEVOPS_DEFAULT_TOP;\n const options: BuildRunOptions = {\n top: top,\n };\n\n const api = useApi(azureDevOpsApiRef);\n\n const { value, loading, error } = useAsync(() => {\n const { project, repo, definition, host, org } =\n getAnnotationValuesFromEntity(entity);\n return api.getBuildRuns(\n project,\n stringifyEntityRef(entity),\n repo,\n definition,\n host,\n org,\n options,\n );\n }, [api]);\n\n return {\n items: value?.items,\n loading,\n error,\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;AA4BgB,SAAA,YAAA,CACd,QACA,YAKA,EAAA;AACA,EAAA,MAAM,MAAM,YAAgB,IAAA,wBAAA;AAC5B,EAAA,MAAM,OAA2B,GAAA;AAAA,IAC/B;AAAA,GACF;AAEA,EAAM,MAAA,GAAA,GAAM,OAAO,iBAAiB,CAAA;AAEpC,EAAA,MAAM,EAAE,KAAO,EAAA,OAAA,EAAS,KAAM,EAAA,GAAI,SAAS,MAAM;AAC/C,IAAM,MAAA,EAAE,SAAS,IAAM,EAAA,UAAA,EAAY,MAAM,GAAI,EAAA,GAC3C,8BAA8B,MAAM,CAAA;AACtC,IAAA,OAAO,GAAI,CAAA,YAAA;AAAA,MACT,OAAA;AAAA,MACA,mBAAmB,MAAM,CAAA;AAAA,MACzB,IAAA;AAAA,MACA,UAAA;AAAA,MACA,IAAA;AAAA,MACA,GAAA;AAAA,MACA;AAAA,KACF;AAAA,GACF,EAAG,CAAC,GAAG,CAAC,CAAA;AAER,EAAO,OAAA;AAAA,IACL,OAAO,KAAO,EAAA,KAAA;AAAA,IACd,OAAA;AAAA,IACA;AAAA,GACF;AACF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useDashboardPullRequests.esm.js","sources":["../../src/hooks/useDashboardPullRequests.ts"],"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 { errorApiRef, useApi } from '@backstage/core-plugin-api';\nimport useAsyncRetry from 'react-use/esm/useAsyncRetry';\nimport useInterval from 'react-use/esm/useInterval';\n\nimport { DashboardPullRequest } from '@backstage-community/plugin-azure-devops-common';\nimport { azureDevOpsApiRef } from '../api';\nimport { useCallback } from 'react';\n\nconst POLLING_INTERVAL = 10000;\n\nexport function useDashboardPullRequests(\n project?: string,\n pollingInterval: number = POLLING_INTERVAL,\n teamsLimit?: number,\n): {\n pullRequests?: DashboardPullRequest[];\n loading: boolean;\n error?: Error;\n} {\n const api = useApi(azureDevOpsApiRef);\n const errorApi = useApi(errorApiRef);\n\n const getDashboardPullRequests = useCallback(async (): Promise<\n DashboardPullRequest[]\n > => {\n if (!project) {\n return Promise.reject(new Error('Missing project name'));\n }\n\n try {\n return await api.getDashboardPullRequests(project, teamsLimit);\n } catch (error) {\n if (error instanceof Error) {\n errorApi.post(error);\n }\n\n return Promise.reject(error);\n }\n }, [project, api, teamsLimit, errorApi]);\n\n const {\n value: pullRequests,\n loading,\n error,\n retry,\n } = useAsyncRetry(\n () => getDashboardPullRequests(),\n [getDashboardPullRequests],\n );\n\n useInterval(() => retry(), pollingInterval);\n\n return {\n pullRequests,\n loading,\n error,\n };\n}\n"],"names":["error"],"mappings":";;;;;;;AAwBA,MAAM,gBAAmB,GAAA,GAAA,CAAA;AAElB,SAAS,wBACd,CAAA,OAAA,EACA,eAA0B,GAAA,gBAAA,EAC1B,UAKA,EAAA;AACA,EAAM,MAAA,GAAA,GAAM,OAAO,iBAAiB,CAAA,CAAA;AACpC,EAAM,MAAA,QAAA,GAAW,OAAO,WAAW,CAAA,CAAA;AAEnC,EAAM,MAAA,wBAAA,GAA2B,YAAY,YAExC;AACH,IAAA,IAAI,CAAC,OAAS,EAAA;AACZ,MAAA,OAAO,OAAQ,CAAA,MAAA,CAAO,IAAI,KAAA,CAAM,sBAAsB,CAAC,CAAA,CAAA;AAAA,KACzD;AAEA,IAAI,IAAA;AACF,MAAA,OAAO,MAAM,GAAA,CAAI,wBAAyB,CAAA,OAAA,EAAS,UAAU,CAAA,CAAA;AAAA,aACtDA,MAAO,EAAA;AACd,MAAA,IAAIA,kBAAiB,KAAO,EAAA;AAC1B,QAAA,QAAA,CAAS,KAAKA,MAAK,CAAA,CAAA;AAAA,OACrB;AAEA,MAAO,OAAA,OAAA,CAAQ,OAAOA,MAAK,CAAA,CAAA;AAAA,KAC7B;AAAA,KACC,CAAC,OAAA,EAAS,GAAK,EAAA,UAAA,EAAY,QAAQ,CAAC,CAAA,CAAA;AAEvC,EAAM,MAAA;AAAA,IACJ,KAAO,EAAA,YAAA;AAAA,IACP,OAAA;AAAA,IACA,KAAA;AAAA,IACA,KAAA;AAAA,GACE,GAAA,aAAA;AAAA,IACF,MAAM,wBAAyB,EAAA;AAAA,IAC/B,CAAC,wBAAwB,CAAA;AAAA,GAC3B,CAAA;AAEA,EAAY,WAAA,CAAA,MAAM,KAAM,EAAA,EAAG,eAAe,CAAA,CAAA;AAE1C,EAAO,OAAA;AAAA,IACL,YAAA;AAAA,IACA,OAAA;AAAA,IACA,KAAA;AAAA,GACF,CAAA;AACF;;;;"}
1
+ {"version":3,"file":"useDashboardPullRequests.esm.js","sources":["../../src/hooks/useDashboardPullRequests.ts"],"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 { errorApiRef, useApi } from '@backstage/core-plugin-api';\nimport useAsyncRetry from 'react-use/esm/useAsyncRetry';\nimport useInterval from 'react-use/esm/useInterval';\n\nimport { DashboardPullRequest } from '@backstage-community/plugin-azure-devops-common';\nimport { azureDevOpsApiRef } from '../api';\nimport { useCallback } from 'react';\n\nconst POLLING_INTERVAL = 10000;\n\nexport function useDashboardPullRequests(\n project?: string,\n pollingInterval: number = POLLING_INTERVAL,\n teamsLimit?: number,\n): {\n pullRequests?: DashboardPullRequest[];\n loading: boolean;\n error?: Error;\n} {\n const api = useApi(azureDevOpsApiRef);\n const errorApi = useApi(errorApiRef);\n\n const getDashboardPullRequests = useCallback(async (): Promise<\n DashboardPullRequest[]\n > => {\n if (!project) {\n return Promise.reject(new Error('Missing project name'));\n }\n\n try {\n return await api.getDashboardPullRequests(project, teamsLimit);\n } catch (error) {\n if (error instanceof Error) {\n errorApi.post(error);\n }\n\n return Promise.reject(error);\n }\n }, [project, api, teamsLimit, errorApi]);\n\n const {\n value: pullRequests,\n loading,\n error,\n retry,\n } = useAsyncRetry(\n () => getDashboardPullRequests(),\n [getDashboardPullRequests],\n );\n\n useInterval(() => retry(), pollingInterval);\n\n return {\n pullRequests,\n loading,\n error,\n };\n}\n"],"names":["error"],"mappings":";;;;;;;AAwBA,MAAM,gBAAmB,GAAA,GAAA;AAElB,SAAS,wBACd,CAAA,OAAA,EACA,eAA0B,GAAA,gBAAA,EAC1B,UAKA,EAAA;AACA,EAAM,MAAA,GAAA,GAAM,OAAO,iBAAiB,CAAA;AACpC,EAAM,MAAA,QAAA,GAAW,OAAO,WAAW,CAAA;AAEnC,EAAM,MAAA,wBAAA,GAA2B,YAAY,YAExC;AACH,IAAA,IAAI,CAAC,OAAS,EAAA;AACZ,MAAA,OAAO,OAAQ,CAAA,MAAA,CAAO,IAAI,KAAA,CAAM,sBAAsB,CAAC,CAAA;AAAA;AAGzD,IAAI,IAAA;AACF,MAAA,OAAO,MAAM,GAAA,CAAI,wBAAyB,CAAA,OAAA,EAAS,UAAU,CAAA;AAAA,aACtDA,MAAO,EAAA;AACd,MAAA,IAAIA,kBAAiB,KAAO,EAAA;AAC1B,QAAA,QAAA,CAAS,KAAKA,MAAK,CAAA;AAAA;AAGrB,MAAO,OAAA,OAAA,CAAQ,OAAOA,MAAK,CAAA;AAAA;AAC7B,KACC,CAAC,OAAA,EAAS,GAAK,EAAA,UAAA,EAAY,QAAQ,CAAC,CAAA;AAEvC,EAAM,MAAA;AAAA,IACJ,KAAO,EAAA,YAAA;AAAA,IACP,OAAA;AAAA,IACA,KAAA;AAAA,IACA;AAAA,GACE,GAAA,aAAA;AAAA,IACF,MAAM,wBAAyB,EAAA;AAAA,IAC/B,CAAC,wBAAwB;AAAA,GAC3B;AAEA,EAAY,WAAA,CAAA,MAAM,KAAM,EAAA,EAAG,eAAe,CAAA;AAE1C,EAAO,OAAA;AAAA,IACL,YAAA;AAAA,IACA,OAAA;AAAA,IACA;AAAA,GACF;AACF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useGitTags.esm.js","sources":["../../src/hooks/useGitTags.ts"],"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 { GitTag } from '@backstage-community/plugin-azure-devops-common';\n\nimport { Entity, stringifyEntityRef } from '@backstage/catalog-model';\nimport { azureDevOpsApiRef } from '../api';\nimport { useApi } from '@backstage/core-plugin-api';\nimport useAsync from 'react-use/esm/useAsync';\nimport { getAnnotationValuesFromEntity } from '../utils';\n\nexport function useGitTags(entity: Entity): {\n items?: GitTag[];\n loading: boolean;\n error?: Error;\n} {\n const api = useApi(azureDevOpsApiRef);\n\n const { value, loading, error } = useAsync(() => {\n const { project, repo, host, org } = getAnnotationValuesFromEntity(entity);\n return api.getGitTags(\n project,\n repo as string,\n stringifyEntityRef(entity),\n host,\n org,\n );\n }, [api]);\n\n return {\n items: value?.items,\n loading,\n error,\n };\n}\n"],"names":[],"mappings":";;;;;;;;;AAwBO,SAAS,WAAW,MAIzB,EAAA;AACA,EAAM,MAAA,GAAA,GAAM,OAAO,iBAAiB,CAAA,CAAA;AAEpC,EAAA,MAAM,EAAE,KAAO,EAAA,OAAA,EAAS,KAAM,EAAA,GAAI,SAAS,MAAM;AAC/C,IAAA,MAAM,EAAE,OAAS,EAAA,IAAA,EAAM,MAAM,GAAI,EAAA,GAAI,8BAA8B,MAAM,CAAA,CAAA;AACzE,IAAA,OAAO,GAAI,CAAA,UAAA;AAAA,MACT,OAAA;AAAA,MACA,IAAA;AAAA,MACA,mBAAmB,MAAM,CAAA;AAAA,MACzB,IAAA;AAAA,MACA,GAAA;AAAA,KACF,CAAA;AAAA,GACF,EAAG,CAAC,GAAG,CAAC,CAAA,CAAA;AAER,EAAO,OAAA;AAAA,IACL,OAAO,KAAO,EAAA,KAAA;AAAA,IACd,OAAA;AAAA,IACA,KAAA;AAAA,GACF,CAAA;AACF;;;;"}
1
+ {"version":3,"file":"useGitTags.esm.js","sources":["../../src/hooks/useGitTags.ts"],"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 { GitTag } from '@backstage-community/plugin-azure-devops-common';\n\nimport { Entity, stringifyEntityRef } from '@backstage/catalog-model';\nimport { azureDevOpsApiRef } from '../api';\nimport { useApi } from '@backstage/core-plugin-api';\nimport useAsync from 'react-use/esm/useAsync';\nimport { getAnnotationValuesFromEntity } from '../utils';\n\nexport function useGitTags(entity: Entity): {\n items?: GitTag[];\n loading: boolean;\n error?: Error;\n} {\n const api = useApi(azureDevOpsApiRef);\n\n const { value, loading, error } = useAsync(() => {\n const { project, repo, host, org } = getAnnotationValuesFromEntity(entity);\n return api.getGitTags(\n project,\n repo as string,\n stringifyEntityRef(entity),\n host,\n org,\n );\n }, [api]);\n\n return {\n items: value?.items,\n loading,\n error,\n };\n}\n"],"names":[],"mappings":";;;;;;;;;AAwBO,SAAS,WAAW,MAIzB,EAAA;AACA,EAAM,MAAA,GAAA,GAAM,OAAO,iBAAiB,CAAA;AAEpC,EAAA,MAAM,EAAE,KAAO,EAAA,OAAA,EAAS,KAAM,EAAA,GAAI,SAAS,MAAM;AAC/C,IAAA,MAAM,EAAE,OAAS,EAAA,IAAA,EAAM,MAAM,GAAI,EAAA,GAAI,8BAA8B,MAAM,CAAA;AACzE,IAAA,OAAO,GAAI,CAAA,UAAA;AAAA,MACT,OAAA;AAAA,MACA,IAAA;AAAA,MACA,mBAAmB,MAAM,CAAA;AAAA,MACzB,IAAA;AAAA,MACA;AAAA,KACF;AAAA,GACF,EAAG,CAAC,GAAG,CAAC,CAAA;AAER,EAAO,OAAA;AAAA,IACL,OAAO,KAAO,EAAA,KAAA;AAAA,IACd,OAAA;AAAA,IACA;AAAA,GACF;AACF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"usePullRequests.esm.js","sources":["../../src/hooks/usePullRequests.ts"],"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 AZURE_DEVOPS_DEFAULT_TOP,\n PullRequest,\n PullRequestOptions,\n PullRequestStatus,\n} from '@backstage-community/plugin-azure-devops-common';\n\nimport { Entity, stringifyEntityRef } from '@backstage/catalog-model';\nimport { azureDevOpsApiRef } from '../api';\nimport { useApi } from '@backstage/core-plugin-api';\nimport useAsync from 'react-use/esm/useAsync';\nimport { getAnnotationValuesFromEntity } from '../utils';\n\nexport function usePullRequests(\n entity: Entity,\n defaultLimit?: number,\n requestedStatus?: PullRequestStatus,\n defaultTeamsLimit?: number,\n): {\n items?: PullRequest[];\n loading: boolean;\n error?: Error;\n} {\n const top = defaultLimit ?? AZURE_DEVOPS_DEFAULT_TOP;\n const teamsLimit = defaultTeamsLimit ?? undefined;\n const status = requestedStatus ?? PullRequestStatus.Active;\n const options: PullRequestOptions = {\n top,\n status,\n teamsLimit,\n };\n\n const api = useApi(azureDevOpsApiRef);\n\n const { value, loading, error } = useAsync(() => {\n const { project, repo, host, org } = getAnnotationValuesFromEntity(entity);\n const entityRef = stringifyEntityRef(entity);\n return api.getPullRequests(\n project,\n repo as string,\n entityRef,\n host,\n org,\n options,\n );\n }, [api, top, status]);\n\n return {\n items: value?.items,\n loading,\n error,\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;AA6BO,SAAS,eACd,CAAA,MAAA,EACA,YACA,EAAA,eAAA,EACA,iBAKA,EAAA;AACA,EAAA,MAAM,MAAM,YAAgB,IAAA,wBAAA,CAAA;AAC5B,EAAA,MAAM,aAAkC,KAAA,CAAA,CAAA;AACxC,EAAM,MAAA,MAAA,GAAS,mBAAmB,iBAAkB,CAAA,MAAA,CAAA;AACpD,EAAA,MAAM,OAA8B,GAAA;AAAA,IAClC,GAAA;AAAA,IACA,MAAA;AAAA,IACA,UAAA;AAAA,GACF,CAAA;AAEA,EAAM,MAAA,GAAA,GAAM,OAAO,iBAAiB,CAAA,CAAA;AAEpC,EAAA,MAAM,EAAE,KAAO,EAAA,OAAA,EAAS,KAAM,EAAA,GAAI,SAAS,MAAM;AAC/C,IAAA,MAAM,EAAE,OAAS,EAAA,IAAA,EAAM,MAAM,GAAI,EAAA,GAAI,8BAA8B,MAAM,CAAA,CAAA;AACzE,IAAM,MAAA,SAAA,GAAY,mBAAmB,MAAM,CAAA,CAAA;AAC3C,IAAA,OAAO,GAAI,CAAA,eAAA;AAAA,MACT,OAAA;AAAA,MACA,IAAA;AAAA,MACA,SAAA;AAAA,MACA,IAAA;AAAA,MACA,GAAA;AAAA,MACA,OAAA;AAAA,KACF,CAAA;AAAA,GACC,EAAA,CAAC,GAAK,EAAA,GAAA,EAAK,MAAM,CAAC,CAAA,CAAA;AAErB,EAAO,OAAA;AAAA,IACL,OAAO,KAAO,EAAA,KAAA;AAAA,IACd,OAAA;AAAA,IACA,KAAA;AAAA,GACF,CAAA;AACF;;;;"}
1
+ {"version":3,"file":"usePullRequests.esm.js","sources":["../../src/hooks/usePullRequests.ts"],"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 AZURE_DEVOPS_DEFAULT_TOP,\n PullRequest,\n PullRequestOptions,\n PullRequestStatus,\n} from '@backstage-community/plugin-azure-devops-common';\n\nimport { Entity, stringifyEntityRef } from '@backstage/catalog-model';\nimport { azureDevOpsApiRef } from '../api';\nimport { useApi } from '@backstage/core-plugin-api';\nimport useAsync from 'react-use/esm/useAsync';\nimport { getAnnotationValuesFromEntity } from '../utils';\n\nexport function usePullRequests(\n entity: Entity,\n defaultLimit?: number,\n requestedStatus?: PullRequestStatus,\n defaultTeamsLimit?: number,\n): {\n items?: PullRequest[];\n loading: boolean;\n error?: Error;\n} {\n const top = defaultLimit ?? AZURE_DEVOPS_DEFAULT_TOP;\n const teamsLimit = defaultTeamsLimit ?? undefined;\n const status = requestedStatus ?? PullRequestStatus.Active;\n const options: PullRequestOptions = {\n top,\n status,\n teamsLimit,\n };\n\n const api = useApi(azureDevOpsApiRef);\n\n const { value, loading, error } = useAsync(() => {\n const { project, repo, host, org } = getAnnotationValuesFromEntity(entity);\n const entityRef = stringifyEntityRef(entity);\n return api.getPullRequests(\n project,\n repo as string,\n entityRef,\n host,\n org,\n options,\n );\n }, [api, top, status]);\n\n return {\n items: value?.items,\n loading,\n error,\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;AA6BO,SAAS,eACd,CAAA,MAAA,EACA,YACA,EAAA,eAAA,EACA,iBAKA,EAAA;AACA,EAAA,MAAM,MAAM,YAAgB,IAAA,wBAAA;AAC5B,EAAA,MAAM,aAAkC,KAAA,CAAA;AACxC,EAAM,MAAA,MAAA,GAAS,mBAAmB,iBAAkB,CAAA,MAAA;AACpD,EAAA,MAAM,OAA8B,GAAA;AAAA,IAClC,GAAA;AAAA,IACA,MAAA;AAAA,IACA;AAAA,GACF;AAEA,EAAM,MAAA,GAAA,GAAM,OAAO,iBAAiB,CAAA;AAEpC,EAAA,MAAM,EAAE,KAAO,EAAA,OAAA,EAAS,KAAM,EAAA,GAAI,SAAS,MAAM;AAC/C,IAAA,MAAM,EAAE,OAAS,EAAA,IAAA,EAAM,MAAM,GAAI,EAAA,GAAI,8BAA8B,MAAM,CAAA;AACzE,IAAM,MAAA,SAAA,GAAY,mBAAmB,MAAM,CAAA;AAC3C,IAAA,OAAO,GAAI,CAAA,eAAA;AAAA,MACT,OAAA;AAAA,MACA,IAAA;AAAA,MACA,SAAA;AAAA,MACA,IAAA;AAAA,MACA,GAAA;AAAA,MACA;AAAA,KACF;AAAA,GACC,EAAA,CAAC,GAAK,EAAA,GAAA,EAAK,MAAM,CAAC,CAAA;AAErB,EAAO,OAAA;AAAA,IACL,OAAO,KAAO,EAAA,KAAA;AAAA,IACd,OAAA;AAAA,IACA;AAAA,GACF;AACF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useReadme.esm.js","sources":["../../src/hooks/useReadme.ts"],"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 { Readme } from '@backstage-community/plugin-azure-devops-common';\n\nimport { Entity, stringifyEntityRef } from '@backstage/catalog-model';\nimport { azureDevOpsApiRef } from '../api';\nimport { useApi } from '@backstage/core-plugin-api';\nimport useAsync from 'react-use/esm/useAsync';\nimport { getAnnotationValuesFromEntity } from '../utils';\n\nexport function useReadme(entity: Entity): {\n item?: Readme;\n loading: boolean;\n error?: Error;\n} {\n const api = useApi(azureDevOpsApiRef);\n\n const { value, loading, error } = useAsync(() => {\n const { project, repo, host, org, readmePath } =\n getAnnotationValuesFromEntity(entity);\n const entityRef = stringifyEntityRef(entity);\n return api.getReadme({\n project,\n repo: repo as string,\n entityRef,\n host,\n org,\n path: readmePath,\n });\n }, [api]);\n\n return {\n item: value,\n loading,\n error,\n };\n}\n"],"names":[],"mappings":";;;;;;;;;AAwBO,SAAS,UAAU,MAIxB,EAAA;AACA,EAAM,MAAA,GAAA,GAAM,OAAO,iBAAiB,CAAA,CAAA;AAEpC,EAAA,MAAM,EAAE,KAAO,EAAA,OAAA,EAAS,KAAM,EAAA,GAAI,SAAS,MAAM;AAC/C,IAAM,MAAA,EAAE,SAAS,IAAM,EAAA,IAAA,EAAM,KAAK,UAAW,EAAA,GAC3C,8BAA8B,MAAM,CAAA,CAAA;AACtC,IAAM,MAAA,SAAA,GAAY,mBAAmB,MAAM,CAAA,CAAA;AAC3C,IAAA,OAAO,IAAI,SAAU,CAAA;AAAA,MACnB,OAAA;AAAA,MACA,IAAA;AAAA,MACA,SAAA;AAAA,MACA,IAAA;AAAA,MACA,GAAA;AAAA,MACA,IAAM,EAAA,UAAA;AAAA,KACP,CAAA,CAAA;AAAA,GACH,EAAG,CAAC,GAAG,CAAC,CAAA,CAAA;AAER,EAAO,OAAA;AAAA,IACL,IAAM,EAAA,KAAA;AAAA,IACN,OAAA;AAAA,IACA,KAAA;AAAA,GACF,CAAA;AACF;;;;"}
1
+ {"version":3,"file":"useReadme.esm.js","sources":["../../src/hooks/useReadme.ts"],"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 { Readme } from '@backstage-community/plugin-azure-devops-common';\n\nimport { Entity, stringifyEntityRef } from '@backstage/catalog-model';\nimport { azureDevOpsApiRef } from '../api';\nimport { useApi } from '@backstage/core-plugin-api';\nimport useAsync from 'react-use/esm/useAsync';\nimport { getAnnotationValuesFromEntity } from '../utils';\n\nexport function useReadme(entity: Entity): {\n item?: Readme;\n loading: boolean;\n error?: Error;\n} {\n const api = useApi(azureDevOpsApiRef);\n\n const { value, loading, error } = useAsync(() => {\n const { project, repo, host, org, readmePath } =\n getAnnotationValuesFromEntity(entity);\n const entityRef = stringifyEntityRef(entity);\n return api.getReadme({\n project,\n repo: repo as string,\n entityRef,\n host,\n org,\n path: readmePath,\n });\n }, [api]);\n\n return {\n item: value,\n loading,\n error,\n };\n}\n"],"names":[],"mappings":";;;;;;;;;AAwBO,SAAS,UAAU,MAIxB,EAAA;AACA,EAAM,MAAA,GAAA,GAAM,OAAO,iBAAiB,CAAA;AAEpC,EAAA,MAAM,EAAE,KAAO,EAAA,OAAA,EAAS,KAAM,EAAA,GAAI,SAAS,MAAM;AAC/C,IAAM,MAAA,EAAE,SAAS,IAAM,EAAA,IAAA,EAAM,KAAK,UAAW,EAAA,GAC3C,8BAA8B,MAAM,CAAA;AACtC,IAAM,MAAA,SAAA,GAAY,mBAAmB,MAAM,CAAA;AAC3C,IAAA,OAAO,IAAI,SAAU,CAAA;AAAA,MACnB,OAAA;AAAA,MACA,IAAA;AAAA,MACA,SAAA;AAAA,MACA,IAAA;AAAA,MACA,GAAA;AAAA,MACA,IAAM,EAAA;AAAA,KACP,CAAA;AAAA,GACH,EAAG,CAAC,GAAG,CAAC,CAAA;AAER,EAAO,OAAA;AAAA,IACL,IAAM,EAAA,KAAA;AAAA,IACN,OAAA;AAAA,IACA;AAAA,GACF;AACF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useUserEmail.esm.js","sources":["../../src/hooks/useUserEmail.ts"],"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 { identityApiRef, useApi } from '@backstage/core-plugin-api';\nimport useAsync from 'react-use/esm/useAsync';\n\nexport function useUserEmail(): string | undefined {\n const identityApi = useApi(identityApiRef);\n const state = useAsync(() => identityApi.getProfileInfo(), [identityApi]);\n return state.value?.email;\n}\n"],"names":[],"mappings":";;;AAmBO,SAAS,YAAmC,GAAA;AACjD,EAAM,MAAA,WAAA,GAAc,OAAO,cAAc,CAAA,CAAA;AACzC,EAAM,MAAA,KAAA,GAAQ,SAAS,MAAM,WAAA,CAAY,gBAAkB,EAAA,CAAC,WAAW,CAAC,CAAA,CAAA;AACxE,EAAA,OAAO,MAAM,KAAO,EAAA,KAAA,CAAA;AACtB;;;;"}
1
+ {"version":3,"file":"useUserEmail.esm.js","sources":["../../src/hooks/useUserEmail.ts"],"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 { identityApiRef, useApi } from '@backstage/core-plugin-api';\nimport useAsync from 'react-use/esm/useAsync';\n\nexport function useUserEmail(): string | undefined {\n const identityApi = useApi(identityApiRef);\n const state = useAsync(() => identityApi.getProfileInfo(), [identityApi]);\n return state.value?.email;\n}\n"],"names":[],"mappings":";;;AAmBO,SAAS,YAAmC,GAAA;AACjD,EAAM,MAAA,WAAA,GAAc,OAAO,cAAc,CAAA;AACzC,EAAM,MAAA,KAAA,GAAQ,SAAS,MAAM,WAAA,CAAY,gBAAkB,EAAA,CAAC,WAAW,CAAC,CAAA;AACxE,EAAA,OAAO,MAAM,KAAO,EAAA,KAAA;AACtB;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useUserTeamIds.esm.js","sources":["../../src/hooks/useUserTeamIds.ts"],"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 { azureDevOpsApiRef } from '../api';\nimport { useApi } from '@backstage/core-plugin-api';\nimport useAsync from 'react-use/esm/useAsync';\n\nexport function useUserTeamIds(userId: string | undefined): {\n teamIds?: string[];\n loading: boolean;\n error?: Error;\n} {\n const api = useApi(azureDevOpsApiRef);\n\n const {\n value: teamIds,\n loading,\n error,\n } = useAsync(() => {\n return userId ? api.getUserTeamIds(userId) : Promise.resolve(undefined);\n }, [userId, api]);\n\n return {\n teamIds,\n loading,\n error,\n };\n}\n"],"names":[],"mappings":";;;;;AAoBO,SAAS,eAAe,MAI7B,EAAA;AACA,EAAM,MAAA,GAAA,GAAM,OAAO,iBAAiB,CAAA,CAAA;AAEpC,EAAM,MAAA;AAAA,IACJ,KAAO,EAAA,OAAA;AAAA,IACP,OAAA;AAAA,IACA,KAAA;AAAA,GACF,GAAI,SAAS,MAAM;AACjB,IAAA,OAAO,SAAS,GAAI,CAAA,cAAA,CAAe,MAAM,CAAI,GAAA,OAAA,CAAQ,QAAQ,KAAS,CAAA,CAAA,CAAA;AAAA,GACrE,EAAA,CAAC,MAAQ,EAAA,GAAG,CAAC,CAAA,CAAA;AAEhB,EAAO,OAAA;AAAA,IACL,OAAA;AAAA,IACA,OAAA;AAAA,IACA,KAAA;AAAA,GACF,CAAA;AACF;;;;"}
1
+ {"version":3,"file":"useUserTeamIds.esm.js","sources":["../../src/hooks/useUserTeamIds.ts"],"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 { azureDevOpsApiRef } from '../api';\nimport { useApi } from '@backstage/core-plugin-api';\nimport useAsync from 'react-use/esm/useAsync';\n\nexport function useUserTeamIds(userId: string | undefined): {\n teamIds?: string[];\n loading: boolean;\n error?: Error;\n} {\n const api = useApi(azureDevOpsApiRef);\n\n const {\n value: teamIds,\n loading,\n error,\n } = useAsync(() => {\n return userId ? api.getUserTeamIds(userId) : Promise.resolve(undefined);\n }, [userId, api]);\n\n return {\n teamIds,\n loading,\n error,\n };\n}\n"],"names":[],"mappings":";;;;;AAoBO,SAAS,eAAe,MAI7B,EAAA;AACA,EAAM,MAAA,GAAA,GAAM,OAAO,iBAAiB,CAAA;AAEpC,EAAM,MAAA;AAAA,IACJ,KAAO,EAAA,OAAA;AAAA,IACP,OAAA;AAAA,IACA;AAAA,GACF,GAAI,SAAS,MAAM;AACjB,IAAA,OAAO,SAAS,GAAI,CAAA,cAAA,CAAe,MAAM,CAAI,GAAA,OAAA,CAAQ,QAAQ,KAAS,CAAA,CAAA;AAAA,GACrE,EAAA,CAAC,MAAQ,EAAA,GAAG,CAAC,CAAA;AAEhB,EAAO,OAAA;AAAA,IACL,OAAA;AAAA,IACA,OAAA;AAAA,IACA;AAAA,GACF;AACF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.esm.js","sources":["../src/plugin.ts"],"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 azurePipelinesEntityContentRouteRef,\n azurePullRequestDashboardRouteRef,\n azureGitTagsEntityContentRouteRef,\n azurePullRequestsEntityContentRouteRef,\n} from './routes';\nimport {\n createApiFactory,\n createPlugin,\n createRoutableExtension,\n createComponentExtension,\n discoveryApiRef,\n fetchApiRef,\n} from '@backstage/core-plugin-api';\n\nimport { AzureDevOpsClient } from './api/AzureDevOpsClient';\nimport { Entity } from '@backstage/catalog-model';\nimport { azureDevOpsApiRef } from './api/AzureDevOpsApi';\nimport {\n AZURE_DEVOPS_REPO_ANNOTATION,\n AZURE_DEVOPS_PROJECT_ANNOTATION,\n AZURE_DEVOPS_BUILD_DEFINITION_ANNOTATION,\n} from '@backstage-community/plugin-azure-devops-common';\n\n/** @public */\nexport const isAzureDevOpsAvailable = (entity: Entity) =>\n Boolean(entity.metadata.annotations?.[AZURE_DEVOPS_REPO_ANNOTATION]);\n\n/** @public */\nexport const isAzurePipelinesAvailable = (entity: Entity) =>\n Boolean(entity.metadata.annotations?.[AZURE_DEVOPS_REPO_ANNOTATION]) ||\n (Boolean(entity.metadata.annotations?.[AZURE_DEVOPS_PROJECT_ANNOTATION]) &&\n Boolean(\n entity.metadata.annotations?.[AZURE_DEVOPS_BUILD_DEFINITION_ANNOTATION],\n ));\n\n/** @public */\nexport const azureDevOpsPlugin = createPlugin({\n id: 'azureDevOps',\n apis: [\n createApiFactory({\n api: azureDevOpsApiRef,\n deps: {\n discoveryApi: discoveryApiRef,\n fetchApi: fetchApiRef,\n },\n factory: ({ discoveryApi, fetchApi }) =>\n new AzureDevOpsClient({ discoveryApi, fetchApi }),\n }),\n ],\n});\n\n/** @public */\nexport const AzurePullRequestsPage = azureDevOpsPlugin.provide(\n createRoutableExtension({\n name: 'AzurePullRequestsPage',\n component: () =>\n import('./components/PullRequestsPage').then(m => m.PullRequestsPage),\n mountPoint: azurePullRequestDashboardRouteRef,\n }),\n);\n\n/** @public */\nexport const EntityAzurePipelinesContent = azureDevOpsPlugin.provide(\n createRoutableExtension({\n name: 'EntityAzurePipelinesContent',\n component: () =>\n import('./components/EntityPageAzurePipelines').then(\n m => m.EntityPageAzurePipelines,\n ),\n mountPoint: azurePipelinesEntityContentRouteRef,\n }),\n);\n\n/** @public */\nexport const EntityAzureGitTagsContent = azureDevOpsPlugin.provide(\n createRoutableExtension({\n name: 'EntityAzureGitTagsContent',\n component: () =>\n import('./components/EntityPageAzureGitTags').then(\n m => m.EntityPageAzureGitTags,\n ),\n mountPoint: azureGitTagsEntityContentRouteRef,\n }),\n);\n\n/** @public */\nexport const EntityAzurePullRequestsContent = azureDevOpsPlugin.provide(\n createRoutableExtension({\n name: 'EntityAzurePullRequestsContent',\n component: () =>\n import('./components/EntityPageAzurePullRequests').then(\n m => m.EntityPageAzurePullRequests,\n ),\n mountPoint: azurePullRequestsEntityContentRouteRef,\n }),\n);\n\n/** @public */\nexport const EntityAzureReadmeCard = azureDevOpsPlugin.provide(\n createComponentExtension({\n name: 'EntityAzureReadmeCard',\n component: {\n lazy: () => import('./components/ReadmeCard').then(m => m.ReadmeCard),\n },\n }),\n);\n"],"names":[],"mappings":";;;;;;AAyCa,MAAA,sBAAA,GAAyB,CAAC,MACrC,KAAA,OAAA,CAAQ,OAAO,QAAS,CAAA,WAAA,GAAc,4BAA4B,CAAC,EAAA;AAG9D,MAAM,4BAA4B,CAAC,MAAA,KACxC,OAAQ,CAAA,MAAA,CAAO,SAAS,WAAc,GAAA,4BAA4B,CAAC,CAAA,IAClE,QAAQ,MAAO,CAAA,QAAA,CAAS,WAAc,GAAA,+BAA+B,CAAC,CACrE,IAAA,OAAA;AAAA,EACE,MAAA,CAAO,QAAS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H,EAAA;AAGO,MAAM,iCAAiC,iBAAkB,CAAA,OAAA;AAAA,EAC9D,uBAAwB,CAAA;AAAA,IACtB,IAAM,EAAA,gCAAA;AAAA,IACN,SAAW,EAAA,MACT,OAAO,uDAA0C,CAAE,CAAA,IAAA;AAAA,MACjD,OAAK,CAAE,CAAA,2BAAA;AAAA,KACT;AAAA,IACF,UAAY,EAAA,sCAAA;AAAA,GACb,CAAA;AACH,EAAA;AAGO,MAAM,wBAAwB,iBAAkB,CAAA,OAAA;AAAA,EACrD,wBAAyB,CAAA;AAAA,IACvB,IAAM,EAAA,uBAAA;AAAA,IACN,SAAW,EAAA;AAAA,MACT,IAAA,EAAM,MAAM,OAAO,sCAAyB,EAAE,IAAK,CAAA,CAAA,CAAA,KAAK,EAAE,UAAU,CAAA;AAAA,KACtE;AAAA,GACD,CAAA;AACH;;;;"}
1
+ {"version":3,"file":"plugin.esm.js","sources":["../src/plugin.ts"],"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 azurePipelinesEntityContentRouteRef,\n azurePullRequestDashboardRouteRef,\n azureGitTagsEntityContentRouteRef,\n azurePullRequestsEntityContentRouteRef,\n} from './routes';\nimport {\n createApiFactory,\n createPlugin,\n createRoutableExtension,\n createComponentExtension,\n discoveryApiRef,\n fetchApiRef,\n} from '@backstage/core-plugin-api';\n\nimport { AzureDevOpsClient } from './api/AzureDevOpsClient';\nimport { Entity } from '@backstage/catalog-model';\nimport { azureDevOpsApiRef } from './api/AzureDevOpsApi';\nimport {\n AZURE_DEVOPS_REPO_ANNOTATION,\n AZURE_DEVOPS_PROJECT_ANNOTATION,\n AZURE_DEVOPS_BUILD_DEFINITION_ANNOTATION,\n} from '@backstage-community/plugin-azure-devops-common';\n\n/** @public */\nexport const isAzureDevOpsAvailable = (entity: Entity) =>\n Boolean(entity.metadata.annotations?.[AZURE_DEVOPS_REPO_ANNOTATION]);\n\n/** @public */\nexport const isAzurePipelinesAvailable = (entity: Entity) =>\n Boolean(entity.metadata.annotations?.[AZURE_DEVOPS_REPO_ANNOTATION]) ||\n (Boolean(entity.metadata.annotations?.[AZURE_DEVOPS_PROJECT_ANNOTATION]) &&\n Boolean(\n entity.metadata.annotations?.[AZURE_DEVOPS_BUILD_DEFINITION_ANNOTATION],\n ));\n\n/** @public */\nexport const azureDevOpsPlugin = createPlugin({\n id: 'azureDevOps',\n apis: [\n createApiFactory({\n api: azureDevOpsApiRef,\n deps: {\n discoveryApi: discoveryApiRef,\n fetchApi: fetchApiRef,\n },\n factory: ({ discoveryApi, fetchApi }) =>\n new AzureDevOpsClient({ discoveryApi, fetchApi }),\n }),\n ],\n});\n\n/** @public */\nexport const AzurePullRequestsPage = azureDevOpsPlugin.provide(\n createRoutableExtension({\n name: 'AzurePullRequestsPage',\n component: () =>\n import('./components/PullRequestsPage').then(m => m.PullRequestsPage),\n mountPoint: azurePullRequestDashboardRouteRef,\n }),\n);\n\n/** @public */\nexport const EntityAzurePipelinesContent = azureDevOpsPlugin.provide(\n createRoutableExtension({\n name: 'EntityAzurePipelinesContent',\n component: () =>\n import('./components/EntityPageAzurePipelines').then(\n m => m.EntityPageAzurePipelines,\n ),\n mountPoint: azurePipelinesEntityContentRouteRef,\n }),\n);\n\n/** @public */\nexport const EntityAzureGitTagsContent = azureDevOpsPlugin.provide(\n createRoutableExtension({\n name: 'EntityAzureGitTagsContent',\n component: () =>\n import('./components/EntityPageAzureGitTags').then(\n m => m.EntityPageAzureGitTags,\n ),\n mountPoint: azureGitTagsEntityContentRouteRef,\n }),\n);\n\n/** @public */\nexport const EntityAzurePullRequestsContent = azureDevOpsPlugin.provide(\n createRoutableExtension({\n name: 'EntityAzurePullRequestsContent',\n component: () =>\n import('./components/EntityPageAzurePullRequests').then(\n m => m.EntityPageAzurePullRequests,\n ),\n mountPoint: azurePullRequestsEntityContentRouteRef,\n }),\n);\n\n/** @public */\nexport const EntityAzureReadmeCard = azureDevOpsPlugin.provide(\n createComponentExtension({\n name: 'EntityAzureReadmeCard',\n component: {\n lazy: () => import('./components/ReadmeCard').then(m => m.ReadmeCard),\n },\n }),\n);\n"],"names":[],"mappings":";;;;;;AAyCa,MAAA,sBAAA,GAAyB,CAAC,MACrC,KAAA,OAAA,CAAQ,OAAO,QAAS,CAAA,WAAA,GAAc,4BAA4B,CAAC;AAG9D,MAAM,4BAA4B,CAAC,MAAA,KACxC,OAAQ,CAAA,MAAA,CAAO,SAAS,WAAc,GAAA,4BAA4B,CAAC,CAAA,IAClE,QAAQ,MAAO,CAAA,QAAA,CAAS,WAAc,GAAA,+BAA+B,CAAC,CACrE,IAAA,OAAA;AAAA,EACE,MAAA,CAAO,QAAS,CAAA,WAAA,GAAc,wCAAwC;AACxE;AAGG,MAAM,oBAAoB,YAAa,CAAA;AAAA,EAC5C,EAAI,EAAA,aAAA;AAAA,EACJ,IAAM,EAAA;AAAA,IACJ,gBAAiB,CAAA;AAAA,MACf,GAAK,EAAA,iBAAA;AAAA,MACL,IAAM,EAAA;AAAA,QACJ,YAAc,EAAA,eAAA;AAAA,QACd,QAAU,EAAA;AAAA,OACZ;AAAA,MACA,OAAA,EAAS,CAAC,EAAE,YAAc,EAAA,QAAA,EACxB,KAAA,IAAI,iBAAkB,CAAA,EAAE,YAAc,EAAA,QAAA,EAAU;AAAA,KACnD;AAAA;AAEL,CAAC;AAGM,MAAM,wBAAwB,iBAAkB,CAAA,OAAA;AAAA,EACrD,uBAAwB,CAAA;AAAA,IACtB,IAAM,EAAA,uBAAA;AAAA,IACN,SAAA,EAAW,MACT,OAAO,4CAA+B,EAAE,IAAK,CAAA,CAAA,CAAA,KAAK,EAAE,gBAAgB,CAAA;AAAA,IACtE,UAAY,EAAA;AAAA,GACb;AACH;AAGO,MAAM,8BAA8B,iBAAkB,CAAA,OAAA;AAAA,EAC3D,uBAAwB,CAAA;AAAA,IACtB,IAAM,EAAA,6BAAA;AAAA,IACN,SAAW,EAAA,MACT,OAAO,oDAAuC,CAAE,CAAA,IAAA;AAAA,MAC9C,OAAK,CAAE,CAAA;AAAA,KACT;AAAA,IACF,UAAY,EAAA;AAAA,GACb;AACH;AAGO,MAAM,4BAA4B,iBAAkB,CAAA,OAAA;AAAA,EACzD,uBAAwB,CAAA;AAAA,IACtB,IAAM,EAAA,2BAAA;AAAA,IACN,SAAW,EAAA,MACT,OAAO,kDAAqC,CAAE,CAAA,IAAA;AAAA,MAC5C,OAAK,CAAE,CAAA;AAAA,KACT;AAAA,IACF,UAAY,EAAA;AAAA,GACb;AACH;AAGO,MAAM,iCAAiC,iBAAkB,CAAA,OAAA;AAAA,EAC9D,uBAAwB,CAAA;AAAA,IACtB,IAAM,EAAA,gCAAA;AAAA,IACN,SAAW,EAAA,MACT,OAAO,uDAA0C,CAAE,CAAA,IAAA;AAAA,MACjD,OAAK,CAAE,CAAA;AAAA,KACT;AAAA,IACF,UAAY,EAAA;AAAA,GACb;AACH;AAGO,MAAM,wBAAwB,iBAAkB,CAAA,OAAA;AAAA,EACrD,wBAAyB,CAAA;AAAA,IACvB,IAAM,EAAA,uBAAA;AAAA,IACN,SAAW,EAAA;AAAA,MACT,IAAA,EAAM,MAAM,OAAO,sCAAyB,EAAE,IAAK,CAAA,CAAA,CAAA,KAAK,EAAE,UAAU;AAAA;AACtE,GACD;AACH;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"routes.esm.js","sources":["../src/routes.ts"],"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 { createRouteRef } from '@backstage/core-plugin-api';\n\nexport const azurePullRequestDashboardRouteRef = createRouteRef({\n id: 'azure-pull-request-dashboard',\n});\n\nexport const azurePipelinesEntityContentRouteRef = createRouteRef({\n id: 'azure-pipelines-entity-content',\n});\n\nexport const azureGitTagsEntityContentRouteRef = createRouteRef({\n id: 'azure-git-tags-entity-content',\n});\n\nexport const azurePullRequestsEntityContentRouteRef = createRouteRef({\n id: 'azure-pull-requests-entity-content',\n});\n"],"names":[],"mappings":";;AAkBO,MAAM,oCAAoC,cAAe,CAAA;AAAA,EAC9D,EAAI,EAAA,8BAAA;AACN,CAAC,EAAA;AAEM,MAAM,sCAAsC,cAAe,CAAA;AAAA,EAChE,EAAI,EAAA,gCAAA;AACN,CAAC,EAAA;AAEM,MAAM,oCAAoC,cAAe,CAAA;AAAA,EAC9D,EAAI,EAAA,+BAAA;AACN,CAAC,EAAA;AAEM,MAAM,yCAAyC,cAAe,CAAA;AAAA,EACnE,EAAI,EAAA,oCAAA;AACN,CAAC;;;;"}
1
+ {"version":3,"file":"routes.esm.js","sources":["../src/routes.ts"],"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 { createRouteRef } from '@backstage/core-plugin-api';\n\nexport const azurePullRequestDashboardRouteRef = createRouteRef({\n id: 'azure-pull-request-dashboard',\n});\n\nexport const azurePipelinesEntityContentRouteRef = createRouteRef({\n id: 'azure-pipelines-entity-content',\n});\n\nexport const azureGitTagsEntityContentRouteRef = createRouteRef({\n id: 'azure-git-tags-entity-content',\n});\n\nexport const azurePullRequestsEntityContentRouteRef = createRouteRef({\n id: 'azure-pull-requests-entity-content',\n});\n"],"names":[],"mappings":";;AAkBO,MAAM,oCAAoC,cAAe,CAAA;AAAA,EAC9D,EAAI,EAAA;AACN,CAAC;AAEM,MAAM,sCAAsC,cAAe,CAAA;AAAA,EAChE,EAAI,EAAA;AACN,CAAC;AAEM,MAAM,oCAAoC,cAAe,CAAA;AAAA,EAC9D,EAAI,EAAA;AACN,CAAC;AAEM,MAAM,yCAAyC,cAAe,CAAA;AAAA,EACnE,EAAI,EAAA;AACN,CAAC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"arrayHas.esm.js","sources":["../../src/utils/arrayHas.ts"],"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\nexport function arrayHas<T>(arr: T[], value: T): boolean {\n return new Set<T>(arr).has(value);\n}\n\nexport function stringArrayHas(\n arr: Array<string | undefined>,\n value: string | undefined,\n ignoreCase: boolean = false,\n): boolean {\n if (ignoreCase) {\n return arrayHas(\n arr.map(a => a?.toLocaleLowerCase('en-US')),\n value?.toLocaleLowerCase('en-US'),\n );\n }\n\n return arrayHas(arr, value);\n}\n"],"names":[],"mappings":"AAgBgB,SAAA,QAAA,CAAY,KAAU,KAAmB,EAAA;AACvD,EAAA,OAAO,IAAI,GAAA,CAAO,GAAG,CAAA,CAAE,IAAI,KAAK,CAAA,CAAA;AAClC,CAAA;AAEO,SAAS,cACd,CAAA,GAAA,EACA,KACA,EAAA,UAAA,GAAsB,KACb,EAAA;AACT,EAAA,IAAI,UAAY,EAAA;AACd,IAAO,OAAA,QAAA;AAAA,MACL,IAAI,GAAI,CAAA,CAAA,CAAA,KAAK,CAAG,EAAA,iBAAA,CAAkB,OAAO,CAAC,CAAA;AAAA,MAC1C,KAAA,EAAO,kBAAkB,OAAO,CAAA;AAAA,KAClC,CAAA;AAAA,GACF;AAEA,EAAO,OAAA,QAAA,CAAS,KAAK,KAAK,CAAA,CAAA;AAC5B;;;;"}
1
+ {"version":3,"file":"arrayHas.esm.js","sources":["../../src/utils/arrayHas.ts"],"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\nexport function arrayHas<T>(arr: T[], value: T): boolean {\n return new Set<T>(arr).has(value);\n}\n\nexport function stringArrayHas(\n arr: Array<string | undefined>,\n value: string | undefined,\n ignoreCase: boolean = false,\n): boolean {\n if (ignoreCase) {\n return arrayHas(\n arr.map(a => a?.toLocaleLowerCase('en-US')),\n value?.toLocaleLowerCase('en-US'),\n );\n }\n\n return arrayHas(arr, value);\n}\n"],"names":[],"mappings":"AAgBgB,SAAA,QAAA,CAAY,KAAU,KAAmB,EAAA;AACvD,EAAA,OAAO,IAAI,GAAA,CAAO,GAAG,CAAA,CAAE,IAAI,KAAK,CAAA;AAClC;AAEO,SAAS,cACd,CAAA,GAAA,EACA,KACA,EAAA,UAAA,GAAsB,KACb,EAAA;AACT,EAAA,IAAI,UAAY,EAAA;AACd,IAAO,OAAA,QAAA;AAAA,MACL,IAAI,GAAI,CAAA,CAAA,CAAA,KAAK,CAAG,EAAA,iBAAA,CAAkB,OAAO,CAAC,CAAA;AAAA,MAC1C,KAAA,EAAO,kBAAkB,OAAO;AAAA,KAClC;AAAA;AAGF,EAAO,OAAA,QAAA,CAAS,KAAK,KAAK,CAAA;AAC5B;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"equalsIgnoreCase.esm.js","sources":["../../src/utils/equalsIgnoreCase.ts"],"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\nexport function equalsIgnoreCase(str1: string, str2: string): boolean {\n return str1.toLocaleLowerCase('en-US') === str2.toLocaleLowerCase('en-US');\n}\n"],"names":[],"mappings":"AAgBgB,SAAA,gBAAA,CAAiB,MAAc,IAAuB,EAAA;AACpE,EAAA,OAAO,KAAK,iBAAkB,CAAA,OAAO,CAAM,KAAA,IAAA,CAAK,kBAAkB,OAAO,CAAA,CAAA;AAC3E;;;;"}
1
+ {"version":3,"file":"equalsIgnoreCase.esm.js","sources":["../../src/utils/equalsIgnoreCase.ts"],"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\nexport function equalsIgnoreCase(str1: string, str2: string): boolean {\n return str1.toLocaleLowerCase('en-US') === str2.toLocaleLowerCase('en-US');\n}\n"],"names":[],"mappings":"AAgBgB,SAAA,gBAAA,CAAiB,MAAc,IAAuB,EAAA;AACpE,EAAA,OAAO,KAAK,iBAAkB,CAAA,OAAO,CAAM,KAAA,IAAA,CAAK,kBAAkB,OAAO,CAAA;AAC3E;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"getAnnotationValuesFromEntity.esm.js","sources":["../../src/utils/getAnnotationValuesFromEntity.ts"],"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 { Entity } from '@backstage/catalog-model';\nimport {\n AZURE_DEVOPS_PROJECT_ANNOTATION,\n AZURE_DEVOPS_BUILD_DEFINITION_ANNOTATION,\n AZURE_DEVOPS_README_ANNOTATION,\n AZURE_DEVOPS_REPO_ANNOTATION,\n AZURE_DEVOPS_HOST_ORG_ANNOTATION,\n} from '@backstage-community/plugin-azure-devops-common';\n\nexport function getAnnotationValuesFromEntity(entity: Entity): {\n project: string;\n repo?: string;\n definition?: string;\n host?: string;\n org?: string;\n readmePath?: string;\n} {\n const hostOrg = getHostOrg(entity.metadata.annotations);\n const projectRepo = getProjectRepo(entity.metadata.annotations);\n const project =\n entity.metadata.annotations?.[AZURE_DEVOPS_PROJECT_ANNOTATION];\n const definition =\n entity.metadata.annotations?.[AZURE_DEVOPS_BUILD_DEFINITION_ANNOTATION];\n const readmePath =\n entity.metadata.annotations?.[AZURE_DEVOPS_README_ANNOTATION];\n\n if (definition) {\n if (project) {\n return {\n project,\n definition,\n readmePath: readmePath,\n ...hostOrg,\n };\n }\n if (projectRepo.project) {\n return {\n project: projectRepo.project,\n repo: projectRepo.repo,\n definition,\n readmePath: readmePath,\n ...hostOrg,\n };\n }\n throw new Error(\n `Value for annotation \"${AZURE_DEVOPS_PROJECT_ANNOTATION}\" was not found`,\n );\n } else {\n if (projectRepo.project) {\n return {\n project: projectRepo.project,\n repo: projectRepo.repo,\n readmePath: readmePath,\n ...hostOrg,\n };\n }\n\n if (project) {\n throw new Error(\n `Value for annotation \"${AZURE_DEVOPS_BUILD_DEFINITION_ANNOTATION}\" was not found`,\n );\n }\n }\n\n throw new Error('Expected \"dev.azure.com\" annotations were not found');\n}\n\nfunction getProjectRepo(annotations?: Record<string, string>): {\n project?: string;\n repo?: string;\n} {\n const annotation = annotations?.[AZURE_DEVOPS_REPO_ANNOTATION];\n if (!annotation) {\n return { project: undefined, repo: undefined };\n }\n\n if (annotation.split('/').length === 2) {\n const [project, repo] = annotation.split('/');\n if (project && repo) {\n return { project, repo };\n }\n }\n\n throw new Error(\n `Invalid value for annotation \"${AZURE_DEVOPS_REPO_ANNOTATION}\"; expected format is: <project-name>/<repo-name>, found: \"${annotation}\"`,\n );\n}\n\nfunction getHostOrg(annotations?: Record<string, string>): {\n host?: string;\n org?: string;\n} {\n const annotation = annotations?.[AZURE_DEVOPS_HOST_ORG_ANNOTATION];\n if (!annotation) {\n return { host: undefined, org: undefined };\n }\n\n const segments = annotation.split('/');\n if (segments.length === 2) {\n const [host, org] = segments;\n if (host && org) {\n return { host, org };\n }\n } else if (segments.length === 3) {\n const [host, subpath, org] = segments;\n return { host: `${host}/${subpath}`, org };\n }\n\n throw new Error(\n `Invalid value for annotation \"${AZURE_DEVOPS_HOST_ORG_ANNOTATION}\"; expected format is: <host-name>/<organization-name>, found: \"${annotation}\"`,\n );\n}\n"],"names":[],"mappings":";;AAyBO,SAAS,8BAA8B,MAO5C,EAAA;AACA,EAAA,MAAM,OAAU,GAAA,UA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A,IAAW,QAAS,CAAA,MAAA,KAAW,CAAG,EAAA;AAChC,IAAA,MAAM,CAAC,IAAA,EAAM,OAAS,EAAA,GAAG,CAAI,GAAA,QAAA,CAAA;AAC7B,IAAA,OAAO,EAAE,IAAM,EAAA,CAAA,EAAG,IAAI,CAAI,CAAA,EAAA,OAAO,IAAI,GAAI,EAAA,CAAA;AAAA,GAC3C;AAEA,EAAA,MAAM,IAAI,KAAA;AAAA,IACR,CAAA,8BAAA,EAAiC,gCAAgC,CAAA,gEAAA,EAAmE,UAAU,CAAA,CAAA,CAAA;AAAA,GAChJ,CAAA;AACF;;;;"}
1
+ {"version":3,"file":"getAnnotationValuesFromEntity.esm.js","sources":["../../src/utils/getAnnotationValuesFromEntity.ts"],"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 { Entity } from '@backstage/catalog-model';\nimport {\n AZURE_DEVOPS_PROJECT_ANNOTATION,\n AZURE_DEVOPS_BUILD_DEFINITION_ANNOTATION,\n AZURE_DEVOPS_README_ANNOTATION,\n AZURE_DEVOPS_REPO_ANNOTATION,\n AZURE_DEVOPS_HOST_ORG_ANNOTATION,\n} from '@backstage-community/plugin-azure-devops-common';\n\nexport function getAnnotationValuesFromEntity(entity: Entity): {\n project: string;\n repo?: string;\n definition?: string;\n host?: string;\n org?: string;\n readmePath?: string;\n} {\n const hostOrg = getHostOrg(entity.metadata.annotations);\n const projectRepo = getProjectRepo(entity.metadata.annotations);\n const project =\n entity.metadata.annotations?.[AZURE_DEVOPS_PROJECT_ANNOTATION];\n const definition =\n entity.metadata.annotations?.[AZURE_DEVOPS_BUILD_DEFINITION_ANNOTATION];\n const readmePath =\n entity.metadata.annotations?.[AZURE_DEVOPS_README_ANNOTATION];\n\n if (definition) {\n if (project) {\n return {\n project,\n definition,\n readmePath: readmePath,\n ...hostOrg,\n };\n }\n if (projectRepo.project) {\n return {\n project: projectRepo.project,\n repo: projectRepo.repo,\n definition,\n readmePath: readmePath,\n ...hostOrg,\n };\n }\n throw new Error(\n `Value for annotation \"${AZURE_DEVOPS_PROJECT_ANNOTATION}\" was not found`,\n );\n } else {\n if (projectRepo.project) {\n return {\n project: projectRepo.project,\n repo: projectRepo.repo,\n readmePath: readmePath,\n ...hostOrg,\n };\n }\n\n if (project) {\n throw new Error(\n `Value for annotation \"${AZURE_DEVOPS_BUILD_DEFINITION_ANNOTATION}\" was not found`,\n );\n }\n }\n\n throw new Error('Expected \"dev.azure.com\" annotations were not found');\n}\n\nfunction getProjectRepo(annotations?: Record<string, string>): {\n project?: string;\n repo?: string;\n} {\n const annotation = annotations?.[AZURE_DEVOPS_REPO_ANNOTATION];\n if (!annotation) {\n return { project: undefined, repo: undefined };\n }\n\n if (annotation.split('/').length === 2) {\n const [project, repo] = annotation.split('/');\n if (project && repo) {\n return { project, repo };\n }\n }\n\n throw new Error(\n `Invalid value for annotation \"${AZURE_DEVOPS_REPO_ANNOTATION}\"; expected format is: <project-name>/<repo-name>, found: \"${annotation}\"`,\n );\n}\n\nfunction getHostOrg(annotations?: Record<string, string>): {\n host?: string;\n org?: string;\n} {\n const annotation = annotations?.[AZURE_DEVOPS_HOST_ORG_ANNOTATION];\n if (!annotation) {\n return { host: undefined, org: undefined };\n }\n\n const segments = annotation.split('/');\n if (segments.length === 2) {\n const [host, org] = segments;\n if (host && org) {\n return { host, org };\n }\n } else if (segments.length === 3) {\n const [host, subpath, org] = segments;\n return { host: `${host}/${subpath}`, org };\n }\n\n throw new Error(\n `Invalid value for annotation \"${AZURE_DEVOPS_HOST_ORG_ANNOTATION}\"; expected format is: <host-name>/<organization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AA;AAC7B,IAAA,OAAO,EAAE,IAAM,EAAA,CAAA,EAAG,IAAI,CAAI,CAAA,EAAA,OAAO,IAAI,GAAI,EAAA;AAAA;AAG3C,EAAA,MAAM,IAAI,KAAA;AAAA,IACR,CAAA,8BAAA,EAAiC,gCAAgC,CAAA,gEAAA,EAAmE,UAAU,CAAA,CAAA;AAAA,GAChJ;AACF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"getDurationFromDates.esm.js","sources":["../../src/utils/getDurationFromDates.ts"],"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 { DateTime, Interval } from 'luxon';\nimport humanizeDuration from 'humanize-duration';\n\nexport const getDurationFromDates = (\n startTime?: string,\n finishTime?: string,\n): string => {\n if (!startTime || (!startTime && !finishTime)) {\n return '';\n }\n\n const start = DateTime.fromISO(startTime);\n const finish = finishTime ? DateTime.fromISO(finishTime) : DateTime.now();\n\n const formatted = Interval.fromDateTimes(start, finish)\n .toDuration()\n .valueOf();\n\n const shortEnglishHumanizer = humanizeDuration.humanizer({\n language: 'shortEn',\n languages: {\n shortEn: {\n y: () => 'y',\n mo: () => 'mo',\n w: () => 'w',\n d: () => 'd',\n h: () => 'h',\n m: () => 'm',\n s: () => 's',\n ms: () => 'ms',\n },\n },\n });\n\n return shortEnglishHumanizer(formatted, {\n largest: 2,\n round: true,\n spacer: '',\n });\n};\n"],"names":[],"mappings":";;;AAmBa,MAAA,oBAAA,GAAuB,CAClC,SAAA,EACA,UACW,KAAA;AACX,EAAA,IAAI,CAAC,SAAA,IAAc,CAAC,SAAA,IAAa,CAAC,UAAa,EAAA;AAC7C,IAAO,OAAA,EAAA,CAAA;AAAA,GACT;AAEA,EAAM,MAAA,KAAA,GAAQ,QAAS,CAAA,OAAA,CAAQ,SAAS,CAAA,CAAA;AACxC,EAAA,MAAM,SAAS,UAAa,GAAA,QAAA,CAAS,QAAQ,UAAU,CAAA,GAAI,SAAS,GAAI,EAAA,CAAA;AAExE,EAAM,MAAA,SAAA,GAAY,SAAS,aAAc,CAAA,KAAA,EAAO,MAAM,CACnD,CAAA,UAAA,GACA,OAAQ,EAAA,CAAA;AAEX,EAAM,MAAA,qBAAA,GAAwB,iBAAiB,SAAU,CAAA;AAAA,IACvD,QAAU,EAAA,SAAA;AAAA,IACV,SAAW,EAAA;AAAA,MACT,OAAS,EAAA;AAAA,QACP,GAAG,MAAM,GAAA;AAAA,QACT,IAAI,MAAM,IAAA;AAAA,QACV,GAAG,MAAM,GAAA;AAAA,QACT,GAAG,MAAM,GAAA;AAAA,QACT,GAAG,MAAM,GAAA;AAAA,QACT,GAAG,MAAM,GAAA;AAAA,QACT,GAAG,MAAM,GAAA;AAAA,QACT,IAAI,MAAM,IAAA;AAAA,OACZ;AAAA,KACF;AAAA,GACD,CAAA,CAAA;AAED,EAAA,OAAO,sBAAsB,SAAW,EAAA;AAAA,IACtC,OAAS,EAAA,CAAA;AAAA,IACT,KAAO,EAAA,IAAA;AAAA,IACP,MAAQ,EAAA,EAAA;AAAA,GACT,CAAA,CAAA;AACH;;;;"}
1
+ {"version":3,"file":"getDurationFromDates.esm.js","sources":["../../src/utils/getDurationFromDates.ts"],"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 { DateTime, Interval } from 'luxon';\nimport humanizeDuration from 'humanize-duration';\n\nexport const getDurationFromDates = (\n startTime?: string,\n finishTime?: string,\n): string => {\n if (!startTime || (!startTime && !finishTime)) {\n return '';\n }\n\n const start = DateTime.fromISO(startTime);\n const finish = finishTime ? DateTime.fromISO(finishTime) : DateTime.now();\n\n const formatted = Interval.fromDateTimes(start, finish)\n .toDuration()\n .valueOf();\n\n const shortEnglishHumanizer = humanizeDuration.humanizer({\n language: 'shortEn',\n languages: {\n shortEn: {\n y: () => 'y',\n mo: () => 'mo',\n w: () => 'w',\n d: () => 'd',\n h: () => 'h',\n m: () => 'm',\n s: () => 's',\n ms: () => 'ms',\n },\n },\n });\n\n return shortEnglishHumanizer(formatted, {\n largest: 2,\n round: true,\n spacer: '',\n });\n};\n"],"names":[],"mappings":";;;AAmBa,MAAA,oBAAA,GAAuB,CAClC,SAAA,EACA,UACW,KAAA;AACX,EAAA,IAAI,CAAC,SAAA,IAAc,CAAC,SAAA,IAAa,CAAC,UAAa,EAAA;AAC7C,IAAO,OAAA,EAAA;AAAA;AAGT,EAAM,MAAA,KAAA,GAAQ,QAAS,CAAA,OAAA,CAAQ,SAAS,CAAA;AACxC,EAAA,MAAM,SAAS,UAAa,GAAA,QAAA,CAAS,QAAQ,UAAU,CAAA,GAAI,SAAS,GAAI,EAAA;AAExE,EAAM,MAAA,SAAA,GAAY,SAAS,aAAc,CAAA,KAAA,EAAO,MAAM,CACnD,CAAA,UAAA,GACA,OAAQ,EAAA;AAEX,EAAM,MAAA,qBAAA,GAAwB,iBAAiB,SAAU,CAAA;AAAA,IACvD,QAAU,EAAA,SAAA;AAAA,IACV,SAAW,EAAA;AAAA,MACT,OAAS,EAAA;AAAA,QACP,GAAG,MAAM,GAAA;AAAA,QACT,IAAI,MAAM,IAAA;AAAA,QACV,GAAG,MAAM,GAAA;AAAA,QACT,GAAG,MAAM,GAAA;AAAA,QACT,GAAG,MAAM,GAAA;AAAA,QACT,GAAG,MAAM,GAAA;AAAA,QACT,GAAG,MAAM,GAAA;AAAA,QACT,IAAI,MAAM;AAAA;AACZ;AACF,GACD,CAAA;AAED,EAAA,OAAO,sBAAsB,SAAW,EAAA;AAAA,IACtC,OAAS,EAAA,CAAA;AAAA,IACT,KAAO,EAAA,IAAA;AAAA,IACP,MAAQ,EAAA;AAAA,GACT,CAAA;AACH;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage-community/plugin-azure-devops",
3
- "version": "0.6.3",
3
+ "version": "0.8.0",
4
4
  "backstage": {
5
5
  "role": "frontend-plugin",
6
6
  "pluginId": "azure-devops",
@@ -37,9 +37,18 @@
37
37
  },
38
38
  "main": "./dist/index.esm.js",
39
39
  "types": "./dist/index.d.ts",
40
+ "typesVersions": {
41
+ "*": {
42
+ "index": [
43
+ "dist/index.d.ts"
44
+ ],
45
+ "alpha": [
46
+ "dist/alpha.d.ts"
47
+ ]
48
+ }
49
+ },
40
50
  "files": [
41
- "dist",
42
- "alpha"
51
+ "dist"
43
52
  ],
44
53
  "scripts": {
45
54
  "build": "backstage-cli package build",
@@ -51,15 +60,15 @@
51
60
  "test": "backstage-cli package test"
52
61
  },
53
62
  "dependencies": {
54
- "@backstage-community/plugin-azure-devops-common": "^0.4.9",
55
- "@backstage/catalog-model": "^1.7.0",
56
- "@backstage/core-compat-api": "^0.3.1",
57
- "@backstage/core-components": "^0.15.1",
58
- "@backstage/core-plugin-api": "^1.10.0",
59
- "@backstage/errors": "^1.2.4",
60
- "@backstage/frontend-plugin-api": "^0.9.0",
61
- "@backstage/plugin-catalog-react": "^1.14.0",
62
- "@backstage/plugin-permission-react": "^0.4.27",
63
+ "@backstage-community/plugin-azure-devops-common": "^0.6.0",
64
+ "@backstage/catalog-model": "^1.7.2",
65
+ "@backstage/core-compat-api": "^0.3.4",
66
+ "@backstage/core-components": "^0.16.2",
67
+ "@backstage/core-plugin-api": "^1.10.2",
68
+ "@backstage/errors": "^1.2.6",
69
+ "@backstage/frontend-plugin-api": "^0.9.3",
70
+ "@backstage/plugin-catalog-react": "^1.15.0",
71
+ "@backstage/plugin-permission-react": "^0.4.29",
63
72
  "@material-ui/core": "^4.12.2",
64
73
  "@material-ui/icons": "^4.9.1",
65
74
  "@types/react": "^16.13.1 || ^17.0.0 || ^18.0.0",
@@ -68,9 +77,9 @@
68
77
  "react-use": "^17.2.4"
69
78
  },
70
79
  "devDependencies": {
71
- "@backstage/cli": "^0.28.0",
72
- "@backstage/dev-utils": "^1.1.2",
73
- "@backstage/test-utils": "^1.7.0",
80
+ "@backstage/cli": "^0.29.4",
81
+ "@backstage/dev-utils": "^1.1.5",
82
+ "@backstage/test-utils": "^1.7.3",
74
83
  "@testing-library/dom": "^10.0.0",
75
84
  "@testing-library/jest-dom": "^6.0.0",
76
85
  "@testing-library/react": "^15.0.0",
@@ -1,7 +0,0 @@
1
- {
2
- "name": "@backstage-community/plugin-azure-devops__alpha",
3
- "version": "0.6.3",
4
- "main": "../dist/alpha.esm.js",
5
- "module": "../dist/alpha.esm.js",
6
- "types": "../dist/alpha.d.ts"
7
- }