@backstage-community/plugin-azure-devops 0.4.5 → 0.4.8

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 (39) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/alpha/package.json +2 -2
  3. package/dist/api/AzureDevOpsClient.esm.js +9 -16
  4. package/dist/api/AzureDevOpsClient.esm.js.map +1 -1
  5. package/dist/components/BuildTable/BuildTable.esm.js +1 -1
  6. package/dist/components/BuildTable/BuildTable.esm.js.map +1 -1
  7. package/dist/components/GitTagTable/GitTagTable.esm.js +3 -9
  8. package/dist/components/GitTagTable/GitTagTable.esm.js.map +1 -1
  9. package/dist/components/PullRequestTable/PullRequestTable.esm.js +10 -13
  10. package/dist/components/PullRequestTable/PullRequestTable.esm.js.map +1 -1
  11. package/dist/components/PullRequestsPage/PullRequestsPage.esm.js +2 -2
  12. package/dist/components/PullRequestsPage/PullRequestsPage.esm.js.map +1 -1
  13. package/dist/components/PullRequestsPage/lib/PullRequestCard/PullRequestCard.esm.js +4 -5
  14. package/dist/components/PullRequestsPage/lib/PullRequestCard/PullRequestCard.esm.js.map +1 -1
  15. package/dist/components/PullRequestsPage/lib/filters/assignedToTeamFilter.esm.js +1 -2
  16. package/dist/components/PullRequestsPage/lib/filters/assignedToTeamFilter.esm.js.map +1 -1
  17. package/dist/components/PullRequestsPage/lib/filters/assignedToUserFilter.esm.js +1 -2
  18. package/dist/components/PullRequestsPage/lib/filters/assignedToUserFilter.esm.js.map +1 -1
  19. package/dist/components/PullRequestsPage/lib/filters/createdByTeamFilter.esm.js +1 -2
  20. package/dist/components/PullRequestsPage/lib/filters/createdByTeamFilter.esm.js.map +1 -1
  21. package/dist/components/PullRequestsPage/lib/filters/createdByUserFilter.esm.js +1 -2
  22. package/dist/components/PullRequestsPage/lib/filters/createdByUserFilter.esm.js.map +1 -1
  23. package/dist/components/ReadmeCard/ReadmeCard.esm.js +2 -4
  24. package/dist/components/ReadmeCard/ReadmeCard.esm.js.map +1 -1
  25. package/dist/hooks/useBuildRuns.esm.js +2 -2
  26. package/dist/hooks/useBuildRuns.esm.js.map +1 -1
  27. package/dist/hooks/useGitTags.esm.js +1 -1
  28. package/dist/hooks/useGitTags.esm.js.map +1 -1
  29. package/dist/hooks/usePullRequests.esm.js +4 -4
  30. package/dist/hooks/usePullRequests.esm.js.map +1 -1
  31. package/dist/hooks/useUserEmail.esm.js +1 -2
  32. package/dist/hooks/useUserEmail.esm.js.map +1 -1
  33. package/dist/plugin.esm.js +4 -10
  34. package/dist/plugin.esm.js.map +1 -1
  35. package/dist/utils/arrayHas.esm.js +2 -2
  36. package/dist/utils/arrayHas.esm.js.map +1 -1
  37. package/dist/utils/getAnnotationValuesFromEntity.esm.js +5 -6
  38. package/dist/utils/getAnnotationValuesFromEntity.esm.js.map +1 -1
  39. package/package.json +18 -12
package/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # @backstage-community/plugin-azure-devops
2
2
 
3
+ ## 0.4.8
4
+
5
+ ### Patch Changes
6
+
7
+ - d33c708: version:bump to v1.29.1
8
+ - Updated dependencies [d33c708]
9
+ - @backstage-community/plugin-azure-devops-common@0.4.6
10
+
11
+ ## 0.4.7
12
+
13
+ ### Patch Changes
14
+
15
+ - 31aba58: Added package metadata
16
+ - Updated dependencies [31aba58]
17
+ - @backstage-community/plugin-azure-devops-common@0.4.5
18
+
19
+ ## 0.4.6
20
+
21
+ ### Patch Changes
22
+
23
+ - 8276458: Fixed bug in AzureDevOpsClient where multiple entityRef query parameters were appended in case of multiple build definitions, which caused 400 Bad Request error.
24
+ - 2deaaa0: Backstage v1.28.4 version bump
25
+ - Updated dependencies [2deaaa0]
26
+ - @backstage-community/plugin-azure-devops-common@0.4.4
27
+
3
28
  ## 0.4.5
4
29
 
5
30
  ### Patch Changes
@@ -1,6 +1,6 @@
1
1
  {
2
- "name": "@backstage-community/plugin-azure-devops",
3
- "version": "0.4.5",
2
+ "name": "@backstage-community/plugin-azure-devops__alpha",
3
+ "version": "0.4.8",
4
4
  "main": "../dist/alpha.esm.js",
5
5
  "module": "../dist/alpha.esm.js",
6
6
  "types": "../dist/alpha.d.ts"
@@ -1,21 +1,15 @@
1
1
  import { ResponseError } from '@backstage/errors';
2
2
 
3
- var __defProp = Object.defineProperty;
4
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5
- var __publicField = (obj, key, value) => {
6
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
7
- return value;
8
- };
9
3
  class AzureDevOpsClient {
4
+ discoveryApi;
5
+ fetchApi;
10
6
  constructor(options) {
11
- __publicField(this, "discoveryApi");
12
- __publicField(this, "fetchApi");
13
7
  this.discoveryApi = options.discoveryApi;
14
8
  this.fetchApi = options.fetchApi;
15
9
  }
16
10
  async getRepoBuilds(projectName, repoName, host, org, options) {
17
11
  const queryString = new URLSearchParams();
18
- if (options == null ? void 0 : options.top) {
12
+ if (options?.top) {
19
13
  queryString.append("top", options.top.toString());
20
14
  }
21
15
  if (host) {
@@ -47,13 +41,13 @@ class AzureDevOpsClient {
47
41
  }
48
42
  async getPullRequests(projectName, repoName, entityRef, host, org, options) {
49
43
  const queryString = new URLSearchParams();
50
- if (options == null ? void 0 : options.top) {
44
+ if (options?.top) {
51
45
  queryString.append("top", options.top.toString());
52
46
  }
53
- if (options == null ? void 0 : options.status) {
47
+ if (options?.status) {
54
48
  queryString.append("status", options.status.toString());
55
49
  }
56
- if (options == null ? void 0 : options.teamsLimit) {
50
+ if (options?.teamsLimit) {
57
51
  queryString.append("teamsLimit", options.teamsLimit.toString());
58
52
  }
59
53
  if (host) {
@@ -94,6 +88,7 @@ class AzureDevOpsClient {
94
88
  }
95
89
  async getBuildRuns(projectName, entityRef, repoName, definitionName, host, org, options) {
96
90
  const queryString = new URLSearchParams();
91
+ queryString.append("entityRef", entityRef);
97
92
  if (repoName) {
98
93
  queryString.append("repoName", repoName);
99
94
  }
@@ -109,10 +104,9 @@ class AzureDevOpsClient {
109
104
  const buildRuns = [];
110
105
  for (const name of definitionNames) {
111
106
  queryString.set("definitionName", name.trim());
112
- if (options == null ? void 0 : options.top) {
107
+ if (options?.top) {
113
108
  queryString.set("top", options.top.toString());
114
109
  }
115
- queryString.append("entityRef", entityRef);
116
110
  const urlSegment2 = `builds/${encodeURIComponent(
117
111
  projectName
118
112
  )}?${queryString}`;
@@ -123,10 +117,9 @@ class AzureDevOpsClient {
123
117
  }
124
118
  queryString.append("definitionName", definitionName.trim());
125
119
  }
126
- if (options == null ? void 0 : options.top) {
120
+ if (options?.top) {
127
121
  queryString.append("top", options.top.toString());
128
122
  }
129
- queryString.append("entityRef", entityRef);
130
123
  const urlSegment = `builds/${encodeURIComponent(
131
124
  projectName
132
125
  )}?${queryString}`;
@@ -1 +1 @@
1
- {"version":3,"file":"AzureDevOpsClient.esm.js","sources":["../../src/api/AzureDevOpsClient.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 BuildRun,\n BuildRunOptions,\n DashboardPullRequest,\n GitTag,\n PullRequest,\n PullRequestOptions,\n Readme,\n ReadmeConfig,\n RepoBuild,\n RepoBuildOptions,\n Team,\n} from '@backstage-community/plugin-azure-devops-common';\nimport { DiscoveryApi, FetchApi } from '@backstage/core-plugin-api';\nimport { ResponseError } from '@backstage/errors';\nimport { AzureDevOpsApi } from './AzureDevOpsApi';\n\n/** @public */\nexport class AzureDevOpsClient implements AzureDevOpsApi {\n private readonly discoveryApi: DiscoveryApi;\n private readonly fetchApi: FetchApi;\n\n public constructor(options: {\n discoveryApi: DiscoveryApi;\n fetchApi: FetchApi;\n }) {\n this.discoveryApi = options.discoveryApi;\n this.fetchApi = options.fetchApi;\n }\n\n public async getRepoBuilds(\n projectName: string,\n repoName: string,\n host?: string,\n org?: string,\n options?: RepoBuildOptions,\n ): Promise<{ items: RepoBuild[] }> {\n const queryString = new URLSearchParams();\n if (options?.top) {\n queryString.append('top', options.top.toString());\n }\n if (host) {\n queryString.append('host', host);\n }\n if (org) {\n queryString.append('org', org);\n }\n const urlSegment = `repo-builds/${encodeURIComponent(\n projectName,\n )}/${encodeURIComponent(repoName)}?${queryString}`;\n\n const items = await this.get<RepoBuild[]>(urlSegment);\n return { items };\n }\n\n public async getGitTags(\n projectName: string,\n repoName: string,\n entityRef: string,\n host?: string,\n org?: string,\n ): Promise<{ items: GitTag[] }> {\n const queryString = new URLSearchParams();\n if (host) {\n queryString.append('host', host);\n }\n if (org) {\n queryString.append('org', org);\n }\n queryString.append('entityRef', entityRef);\n const urlSegment = `git-tags/${encodeURIComponent(\n projectName,\n )}/${encodeURIComponent(repoName)}?${queryString}`;\n\n const items = await this.get<GitTag[]>(urlSegment);\n return { items };\n }\n\n public async getPullRequests(\n projectName: string,\n repoName: string,\n entityRef: string,\n host?: string,\n org?: string,\n options?: PullRequestOptions,\n ): Promise<{ items: PullRequest[] }> {\n const queryString = new URLSearchParams();\n if (options?.top) {\n queryString.append('top', options.top.toString());\n }\n if (options?.status) {\n queryString.append('status', options.status.toString());\n }\n if (options?.teamsLimit) {\n queryString.append('teamsLimit', options.teamsLimit.toString());\n }\n if (host) {\n queryString.append('host', host);\n }\n if (org) {\n queryString.append('org', org);\n }\n queryString.append('entityRef', entityRef);\n const urlSegment = `pull-requests/${encodeURIComponent(\n projectName,\n )}/${encodeURIComponent(repoName)}?${queryString}`;\n\n const items = await this.get<PullRequest[]>(urlSegment);\n return { items };\n }\n\n public getDashboardPullRequests(\n projectName: string,\n teamsLimit?: number,\n ): Promise<DashboardPullRequest[]> {\n const queryString = new URLSearchParams();\n queryString.append('top', '100');\n if (teamsLimit) {\n queryString.append('teamsLimit', teamsLimit.toString());\n }\n const urlSegment = `dashboard-pull-requests/${projectName}?${queryString}`;\n return this.get<DashboardPullRequest[]>(urlSegment);\n }\n\n public getAllTeams(limit?: number): Promise<Team[]> {\n const queryString = new URLSearchParams();\n if (limit) {\n queryString.append('limit', limit.toString());\n }\n let urlSegment = 'all-teams';\n if (queryString.toString()) {\n urlSegment += `?${queryString}`;\n }\n return this.get<Team[]>(urlSegment);\n }\n\n public getUserTeamIds(userId: string): Promise<string[]> {\n return this.get<string[]>(`users/${userId}/team-ids`);\n }\n\n public async getBuildRuns(\n projectName: string,\n entityRef: string,\n repoName?: string,\n definitionName?: string,\n host?: string,\n org?: string,\n options?: BuildRunOptions,\n ): Promise<{ items: BuildRun[] }> {\n const queryString = new URLSearchParams();\n if (repoName) {\n queryString.append('repoName', repoName);\n }\n if (host) {\n queryString.append('host', host);\n }\n if (org) {\n queryString.append('org', org);\n }\n if (definitionName) {\n const definitionNames = definitionName.split(',');\n if (definitionNames.length > 1) {\n const buildRuns: BuildRun[] = [];\n for (const name of definitionNames) {\n queryString.set('definitionName', name.trim());\n if (options?.top) {\n queryString.set('top', options.top.toString());\n }\n queryString.append('entityRef', entityRef);\n const urlSegment = `builds/${encodeURIComponent(\n projectName,\n )}?${queryString}`;\n const items = await this.get<BuildRun[]>(urlSegment);\n buildRuns.push(...items);\n }\n return { items: buildRuns };\n }\n queryString.append('definitionName', definitionName.trim());\n }\n if (options?.top) {\n queryString.append('top', options.top.toString());\n }\n queryString.append('entityRef', entityRef);\n const urlSegment = `builds/${encodeURIComponent(\n projectName,\n )}?${queryString}`;\n const items = await this.get<BuildRun[]>(urlSegment);\n return { items };\n }\n\n public async getReadme(opts: ReadmeConfig): Promise<Readme> {\n const queryString = new URLSearchParams();\n if (opts.host) {\n queryString.append('host', opts.host);\n }\n if (opts.org) {\n queryString.append('org', opts.org);\n }\n if (opts.path) {\n queryString.append('path', opts.path);\n }\n queryString.append('entityRef', opts.entityRef);\n return await this.get(\n `readme/${encodeURIComponent(opts.project)}/${encodeURIComponent(\n opts.repo,\n )}?${queryString}`,\n );\n }\n\n private async get<T>(path: string): Promise<T> {\n const baseUrl = `${await this.discoveryApi.getBaseUrl('azure-devops')}/`;\n const url = new URL(path, baseUrl);\n\n const response = await this.fetchApi.fetch(url.toString());\n\n if (!response.ok) {\n throw await ResponseError.fromResponse(response);\n }\n\n return response.json() as Promise<T>;\n }\n}\n"],"names":["urlSegment","items"],"mappings":";;;;;;;;AAkCO,MAAM,iBAA4C,CAAA;AAAA,EAIhD,YAAY,OAGhB,EAAA;AANH,IAAiB,aAAA,CAAA,IAAA,EAAA,cAAA,CAAA,CAAA;AACjB,IAAiB,aAAA,CAAA,IAAA,EAAA,UAAA,CAAA,CAAA;AAMf,IAAA,IAAA,CAAK,eAAe,OAAQ,CAAA,YAAA,CAAA;AAC5B,IAAA,IAAA,CAAK,WAAW,OAAQ,CAAA,QAAA,CAAA;AAAA,GAC1B;AAAA,EAEA,MAAa,aACX,CAAA,WAAA,EACA,QACA,EAAA,IAAA,EACA,KACA,OACiC,EAAA;AACjC,IAAM,MAAA,WAAA,GAAc,IAAI,eAAgB,EAAA,CAAA;AACxC,IAAA,IAAI,mCAAS,GAAK,EAAA;AAChB,MAAA,WAAA,CAAY,MAAO,CAAA,KAAA,EAAO,OAAQ,CAAA,GAAA,CAAI,UAAU,CAAA,CAAA;AAAA,KAClD;AACA,IAAA,IAAI,IAAM,EAAA;AACR,MAAY,WAAA,CAAA,MAAA,CAAO,QAAQ,IAAI,CAAA,CAAA;AAAA,KACjC;AACA,IAAA,IAAI,GAAK,EAAA;AACP,MAAY,WAAA,CAAA,MAAA,CAAO,OAAO,GAAG,CAAA,CAAA;AAAA,KAC/B;AACA,IAAA,MAAM,aAAa,CAAe,YAAA,EAAA,kBAAA;AAAA,MAChC,WAAA;AAAA,KACD,CAAI,CAAA,EAAA,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evOpsClient.esm.js","sources":["../../src/api/AzureDevOpsClient.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 BuildRun,\n BuildRunOptions,\n DashboardPullRequest,\n GitTag,\n PullRequest,\n PullRequestOptions,\n Readme,\n ReadmeConfig,\n RepoBuild,\n RepoBuildOptions,\n Team,\n} from '@backstage-community/plugin-azure-devops-common';\nimport { DiscoveryApi, FetchApi } from '@backstage/core-plugin-api';\nimport { ResponseError } from '@backstage/errors';\nimport { AzureDevOpsApi } from './AzureDevOpsApi';\n\n/** @public */\nexport class AzureDevOpsClient implements AzureDevOpsApi {\n private readonly discoveryApi: DiscoveryApi;\n private readonly fetchApi: FetchApi;\n\n public constructor(options: {\n discoveryApi: DiscoveryApi;\n fetchApi: FetchApi;\n }) {\n this.discoveryApi = options.discoveryApi;\n this.fetchApi = options.fetchApi;\n }\n\n public async getRepoBuilds(\n projectName: string,\n repoName: string,\n host?: string,\n org?: string,\n options?: RepoBuildOptions,\n ): Promise<{ items: RepoBuild[] }> {\n const queryString = new URLSearchParams();\n if (options?.top) {\n queryString.append('top', options.top.toString());\n }\n if (host) {\n queryString.append('host', host);\n }\n if (org) {\n queryString.append('org', org);\n }\n const urlSegment = `repo-builds/${encodeURIComponent(\n projectName,\n )}/${encodeURIComponent(repoName)}?${queryString}`;\n\n const items = await this.get<RepoBuild[]>(urlSegment);\n return { items };\n }\n\n public async getGitTags(\n projectName: string,\n repoName: string,\n entityRef: string,\n host?: string,\n org?: string,\n ): Promise<{ items: GitTag[] }> {\n const queryString = new URLSearchParams();\n if (host) {\n queryString.append('host', host);\n }\n if (org) {\n queryString.append('org', org);\n }\n queryString.append('entityRef', entityRef);\n const urlSegment = `git-tags/${encodeURIComponent(\n projectName,\n )}/${encodeURIComponent(repoName)}?${queryString}`;\n\n const items = await this.get<GitTag[]>(urlSegment);\n return { items };\n }\n\n public async getPullRequests(\n projectName: string,\n repoName: string,\n entityRef: string,\n host?: string,\n org?: string,\n options?: PullRequestOptions,\n ): Promise<{ items: PullRequest[] }> {\n const queryString = new URLSearchParams();\n if (options?.top) {\n queryString.append('top', options.top.toString());\n }\n if (options?.status) {\n queryString.append('status', options.status.toString());\n }\n if (options?.teamsLimit) {\n queryString.append('teamsLimit', options.teamsLimit.toString());\n }\n if (host) {\n queryString.append('host', host);\n }\n if (org) {\n queryString.append('org', org);\n }\n queryString.append('entityRef', entityRef);\n const urlSegment = `pull-requests/${encodeURIComponent(\n projectName,\n )}/${encodeURIComponent(repoName)}?${queryString}`;\n\n const items = await this.get<PullRequest[]>(urlSegment);\n return { items };\n }\n\n public getDashboardPullRequests(\n projectName: string,\n teamsLimit?: number,\n ): Promise<DashboardPullRequest[]> {\n const queryString = new URLSearchParams();\n queryString.append('top', '100');\n if (teamsLimit) {\n queryString.append('teamsLimit', teamsLimit.toString());\n }\n const urlSegment = `dashboard-pull-requests/${projectName}?${queryString}`;\n return this.get<DashboardPullRequest[]>(urlSegment);\n }\n\n public getAllTeams(limit?: number): Promise<Team[]> {\n const queryString = new URLSearchParams();\n if (limit) {\n queryString.append('limit', limit.toString());\n }\n let urlSegment = 'all-teams';\n if (queryString.toString()) {\n urlSegment += `?${queryString}`;\n }\n return this.get<Team[]>(urlSegment);\n }\n\n public getUserTeamIds(userId: string): Promise<string[]> {\n return this.get<string[]>(`users/${userId}/team-ids`);\n }\n\n public async getBuildRuns(\n projectName: string,\n entityRef: string,\n repoName?: string,\n definitionName?: string,\n host?: string,\n org?: string,\n options?: BuildRunOptions,\n ): Promise<{ items: BuildRun[] }> {\n const queryString = new URLSearchParams();\n queryString.append('entityRef', entityRef);\n if (repoName) {\n queryString.append('repoName', repoName);\n }\n if (host) {\n queryString.append('host', host);\n }\n if (org) {\n queryString.append('org', org);\n }\n if (definitionName) {\n const definitionNames = definitionName.split(',');\n if (definitionNames.length > 1) {\n const buildRuns: BuildRun[] = [];\n for (const name of definitionNames) {\n queryString.set('definitionName', name.trim());\n if (options?.top) {\n queryString.set('top', options.top.toString());\n }\n const urlSegment = `builds/${encodeURIComponent(\n projectName,\n )}?${queryString}`;\n const items = await this.get<BuildRun[]>(urlSegment);\n buildRuns.push(...items);\n }\n return { items: buildRuns };\n }\n queryString.append('definitionName', definitionName.trim());\n }\n if (options?.top) {\n queryString.append('top', options.top.toString());\n }\n const urlSegment = `builds/${encodeURIComponent(\n projectName,\n )}?${queryString}`;\n const items = await this.get<BuildRun[]>(urlSegment);\n return { items };\n }\n\n public async getReadme(opts: ReadmeConfig): Promise<Readme> {\n const queryString = new URLSearchParams();\n if (opts.host) {\n queryString.append('host', opts.host);\n }\n if (opts.org) {\n queryString.append('org', opts.org);\n }\n if (opts.path) {\n queryString.append('path', opts.path);\n }\n queryString.append('entityRef', opts.entityRef);\n return await this.get(\n `readme/${encodeURIComponent(opts.project)}/${encodeURIComponent(\n opts.repo,\n )}?${queryString}`,\n );\n }\n\n private async get<T>(path: string): Promise<T> {\n const baseUrl = `${await this.discoveryApi.getBaseUrl('azure-devops')}/`;\n const url = new URL(path, baseUrl);\n\n const response = await this.fetchApi.fetch(url.toString());\n\n if (!response.ok) {\n throw await ResponseError.fromResponse(response);\n }\n\n return response.json() as Promise<T>;\n }\n}\n"],"names":["urlSegment","items"],"mappings":";;AAkCO,MAAM,iBAA4C,CAAA;AAAA,EACtC,YAAA,CAAA;AAAA,EACA,QAAA,CAAA;AAAA,EAEV,YAAY,OAGhB,EAAA;AACD,IAAA,IAAA,CAAK,eAAe,OAAQ,CAAA,YAAA,CAAA;AAC5B,IAAA,IAAA,CAAK,WAAW,OAAQ,CAAA,QAAA,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A,EAEA,MAAc,IAAO,IAA0B,EAAA;AAC7C,IAAA,MAAM,UAAU,CAAG,EAAA,MAAM,KAAK,YAAa,CAAA,UAAA,CAAW,cAAc,CAAC,CAAA,CAAA,CAAA,CAAA;AACrE,IAAA,MAAM,GAAM,GAAA,IAAI,GAAI,CAAA,IAAA,EAAM,OAAO,CAAA,CAAA;AAEjC,IAAA,MAAM,WAAW,MAAM,IAAA,CAAK,SAAS,KAAM,CAAA,GAAA,CAAI,UAAU,CAAA,CAAA;AAEzD,IAAI,IAAA,CAAC,SAAS,EAAI,EAAA;AAChB,MAAM,MAAA,MAAM,aAAc,CAAA,YAAA,CAAa,QAAQ,CAAA,CAAA;AAAA,KACjD;AAEA,IAAA,OAAO,SAAS,IAAK,EAAA,CAAA;AAAA,GACvB;AACF;;;;"}
@@ -91,7 +91,7 @@ const BuildTable = ({ items, loading, error }) => {
91
91
  showEmptyDataSourceMessage: !loading
92
92
  },
93
93
  title: /* @__PURE__ */ React.createElement(Box, { display: "flex", alignItems: "center" }, /* @__PURE__ */ React.createElement(AzurePipelinesIcon, { style: { fontSize: 30 } }), /* @__PURE__ */ React.createElement(Box, { mr: 1 }), "Azure Pipelines - Builds (", items ? items.length : 0, ")"),
94
- data: items != null ? items : []
94
+ data: items ?? []
95
95
  }
96
96
  );
97
97
  };
@@ -1 +1 @@
1
- {"version":3,"file":"BuildTable.esm.js","sources":["../../../src/components/BuildTable/BuildTable.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Box from '@material-ui/core/Box';\nimport Typography from '@material-ui/core/Typography';\nimport {\n BuildResult,\n BuildRun,\n BuildStatus,\n} from '@backstage-community/plugin-azure-devops-common';\nimport {\n Link,\n ResponseErrorPanel,\n StatusAborted,\n StatusError,\n StatusOK,\n StatusPending,\n StatusRunning,\n StatusWarning,\n Table,\n TableColumn,\n} from '@backstage/core-components';\n\nimport { AzurePipelinesIcon } from '../AzurePipelinesIcon';\nimport { DateTime } from 'luxon';\nimport React from 'react';\nimport { getDurationFromDates } from '../../utils/getDurationFromDates';\n\nexport const getBuildResultComponent = (result: number | undefined) => {\n switch (result) {\n case BuildResult.Succeeded:\n return (\n <Typography component=\"span\">\n <StatusOK /> Succeeded\n </Typography>\n );\n case BuildResult.PartiallySucceeded:\n return (\n <Typography component=\"span\">\n <StatusWarning /> Partially Succeeded\n </Typography>\n );\n case BuildResult.Failed:\n return (\n <Typography component=\"span\">\n <StatusError /> Failed\n </Typography>\n );\n case BuildResult.Canceled:\n return (\n <Typography component=\"span\">\n <StatusAborted /> Canceled\n </Typography>\n );\n case BuildResult.None:\n default:\n return (\n <Typography component=\"span\">\n <StatusWarning /> Unknown\n </Typography>\n );\n }\n};\n\nexport const getBuildStateComponent = (\n status: number | undefined,\n result: number | undefined,\n) => {\n switch (status) {\n case BuildStatus.InProgress:\n return (\n <Typography component=\"span\">\n <StatusRunning /> In Progress\n </Typography>\n );\n case BuildStatus.Completed:\n return getBuildResultComponent(result);\n case BuildStatus.Cancelling:\n return (\n <Typography component=\"span\">\n <StatusAborted /> Cancelling\n </Typography>\n );\n case BuildStatus.Postponed:\n return (\n <Typography component=\"span\">\n <StatusPending /> Postponed\n </Typography>\n );\n case BuildStatus.NotStarted:\n return (\n <Typography component=\"span\">\n <StatusAborted /> Not Started\n </Typography>\n );\n case BuildStatus.None:\n default:\n return (\n <Typography component=\"span\">\n <StatusWarning /> Unknown\n </Typography>\n );\n }\n};\n\nconst columns: TableColumn[] = [\n {\n title: 'ID',\n field: 'id',\n highlight: false,\n width: 'auto',\n },\n {\n title: 'Build',\n field: 'title',\n width: 'auto',\n render: (row: Partial<BuildRun>) => (\n <Link to={row.link || ''}>{row.title}</Link>\n ),\n },\n {\n title: 'Source',\n field: 'source',\n width: 'auto',\n },\n {\n title: 'State',\n width: 'auto',\n render: (row: Partial<BuildRun>) => (\n <Box display=\"flex\" alignItems=\"center\">\n <Typography variant=\"button\">\n {getBuildStateComponent(row.status, row.result)}\n </Typography>\n </Box>\n ),\n },\n {\n title: 'Duration',\n field: 'queueTime',\n width: 'auto',\n render: (row: Partial<BuildRun>) => (\n <Box display=\"flex\" alignItems=\"center\">\n <Typography>\n {getDurationFromDates(row.startTime, row.finishTime)}\n </Typography>\n </Box>\n ),\n },\n {\n title: 'Age',\n field: 'queueTime',\n width: 'auto',\n render: (row: Partial<BuildRun>) =>\n (row.queueTime\n ? DateTime.fromISO(row.queueTime)\n : DateTime.now()\n ).toRelative(),\n },\n];\n\ntype BuildTableProps = {\n items?: BuildRun[];\n loading: boolean;\n error?: Error;\n};\n\nexport const BuildTable = ({ items, loading, error }: BuildTableProps) => {\n if (error) {\n return (\n <div>\n <ResponseErrorPanel error={error} />\n </div>\n );\n }\n\n return (\n <Table\n isLoading={loading}\n columns={columns}\n options={{\n search: true,\n paging: true,\n pageSize: 5,\n showEmptyDataSourceMessage: !loading,\n }}\n title={\n <Box display=\"flex\" alignItems=\"center\">\n <AzurePipelinesIcon style={{ fontSize: 30 }} />\n <Box mr={1} />\n Azure Pipelines - Builds ({items ? items.length : 0})\n </Box>\n }\n data={items ?? []}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;;;;AAyCa,MAAA,uBAAA,GAA0B,CAAC,MAA+B,KAAA;AACrE,EAAA,QAAQ,MAAQ;AAAA,IACd,KAAK,WAAY,CAAA,SAAA;AACf,MAAA,2CACG,UAAW,EAAA,EAAA,SAAA,EAAU,0BACnB,KAAA,CAAA,aAAA,CAAA,QAAA,EAAA,IAAS,GAAE,YACd,CAAA,CAAA;AAAA,IAEJ,KAAK,WAAY,CAAA,kBA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C7B,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,kBAAmB,EAAA,EAAA,KAAA,EAAO,EAAE,QAAA,EAAU,IAAM,EAAA,CAAA,kBAC5C,KAAA,CAAA,aAAA,CAAA,GAAA,EAAA,EAAI,EAAI,EAAA,CAAA,EAAG,CAAE,EAAA,4BAAA,EACa,KAAQ,GAAA,KAAA,CAAM,MAAS,GAAA,CAAA,EAAE,GACtD,CAAA;AAAA,MAEF,IAAA,EAAM,wBAAS,EAAC;AAAA,KAAA;AAAA,GAClB,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"BuildTable.esm.js","sources":["../../../src/components/BuildTable/BuildTable.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Box from '@material-ui/core/Box';\nimport Typography from '@material-ui/core/Typography';\nimport {\n BuildResult,\n BuildRun,\n BuildStatus,\n} from '@backstage-community/plugin-azure-devops-common';\nimport {\n Link,\n ResponseErrorPanel,\n StatusAborted,\n StatusError,\n StatusOK,\n StatusPending,\n StatusRunning,\n StatusWarning,\n Table,\n TableColumn,\n} from '@backstage/core-components';\n\nimport { AzurePipelinesIcon } from '../AzurePipelinesIcon';\nimport { DateTime } from 'luxon';\nimport React from 'react';\nimport { getDurationFromDates } from '../../utils/getDurationFromDates';\n\nexport const getBuildResultComponent = (result: number | undefined) => {\n switch (result) {\n case BuildResult.Succeeded:\n return (\n <Typography component=\"span\">\n <StatusOK /> Succeeded\n </Typography>\n );\n case BuildResult.PartiallySucceeded:\n return (\n <Typography component=\"span\">\n <StatusWarning /> Partially Succeeded\n </Typography>\n );\n case BuildResult.Failed:\n return (\n <Typography component=\"span\">\n <StatusError /> Failed\n </Typography>\n );\n case BuildResult.Canceled:\n return (\n <Typography component=\"span\">\n <StatusAborted /> Canceled\n </Typography>\n );\n case BuildResult.None:\n default:\n return (\n <Typography component=\"span\">\n <StatusWarning /> Unknown\n </Typography>\n );\n }\n};\n\nexport const getBuildStateComponent = (\n status: number | undefined,\n result: number | undefined,\n) => {\n switch (status) {\n case BuildStatus.InProgress:\n return (\n <Typography component=\"span\">\n <StatusRunning /> In Progress\n </Typography>\n );\n case BuildStatus.Completed:\n return getBuildResultComponent(result);\n case BuildStatus.Cancelling:\n return (\n <Typography component=\"span\">\n <StatusAborted /> Cancelling\n </Typography>\n );\n case BuildStatus.Postponed:\n return (\n <Typography component=\"span\">\n <StatusPending /> Postponed\n </Typography>\n );\n case BuildStatus.NotStarted:\n return (\n <Typography component=\"span\">\n <StatusAborted /> Not Started\n </Typography>\n );\n case BuildStatus.None:\n default:\n return (\n <Typography component=\"span\">\n <StatusWarning /> Unknown\n </Typography>\n );\n }\n};\n\nconst columns: TableColumn[] = [\n {\n title: 'ID',\n field: 'id',\n highlight: false,\n width: 'auto',\n },\n {\n title: 'Build',\n field: 'title',\n width: 'auto',\n render: (row: Partial<BuildRun>) => (\n <Link to={row.link || ''}>{row.title}</Link>\n ),\n },\n {\n title: 'Source',\n field: 'source',\n width: 'auto',\n },\n {\n title: 'State',\n width: 'auto',\n render: (row: Partial<BuildRun>) => (\n <Box display=\"flex\" alignItems=\"center\">\n <Typography variant=\"button\">\n {getBuildStateComponent(row.status, row.result)}\n </Typography>\n </Box>\n ),\n },\n {\n title: 'Duration',\n field: 'queueTime',\n width: 'auto',\n render: (row: Partial<BuildRun>) => (\n <Box display=\"flex\" alignItems=\"center\">\n <Typography>\n {getDurationFromDates(row.startTime, row.finishTime)}\n </Typography>\n </Box>\n ),\n },\n {\n title: 'Age',\n field: 'queueTime',\n width: 'auto',\n render: (row: Partial<BuildRun>) =>\n (row.queueTime\n ? DateTime.fromISO(row.queueTime)\n : DateTime.now()\n ).toRelative(),\n },\n];\n\ntype BuildTableProps = {\n items?: BuildRun[];\n loading: boolean;\n error?: Error;\n};\n\nexport const BuildTable = ({ items, loading, error }: BuildTableProps) => {\n if (error) {\n return (\n <div>\n <ResponseErrorPanel error={error} />\n </div>\n );\n }\n\n return (\n <Table\n isLoading={loading}\n columns={columns}\n options={{\n search: true,\n paging: true,\n pageSize: 5,\n showEmptyDataSourceMessage: !loading,\n }}\n title={\n <Box display=\"flex\" alignItems=\"center\">\n <AzurePipelinesIcon style={{ fontSize: 30 }} />\n <Box mr={1} />\n Azure Pipelines - Builds ({items ? items.length : 0})\n </Box>\n }\n data={items ?? []}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;;;;AAyCa,MAAA,uBAAA,GAA0B,CAAC,MAA+B,KAAA;AACrE,EAAA,QAAQ,MAAQ;AAAA,IACd,KAAK,WAAY,CAAA,SAAA;AACf,MAAA,2CACG,UAAW,EAAA,EAAA,SAAA,EAAU,0BACnB,KAAA,CAAA,aAAA,CAAA,QAAA,EAAA,IAAS,GAAE,YACd,CAAA,CAAA;AAAA,IAEJ,KAAK,WAAY,CAAA,kBAAA;AACf,MAAA,2CACG,UAAW,EAAA,EAAA,SAAA,EAAU,0BACnB,KAAA,CAAA,aAAA,CAAA,aAAA,EAAA,IAAc,GAAE,sBACnB,CAAA,CAAA;AAAA,IAEJ,KAAK,WAAY,CAAA,MAAA;AACf,MAAA,2CACG,UAAW,EAAA,EAAA,SAAA,EAAU,0BACnB,KAAA,CAAA,aAAA,CAAA,WAAA,EAAA,IAAY,GAAE,SACjB,CAAA,CAAA;AAAA,IAEJ,KAAK,WAAY,CAAA,QAAA;AACf,MAAA,2CACG,UAAW,EAAA,EAAA,SAAA,EAAU,0BACnB,KAAA,CAAA,aAAA,CAAA,aAAA,EAAA,IAAc,GAAE,WACnB,CAAA,CAAA;AAAA,IAEJ,KAAK,WAAY,CAAA,IAAA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,GAAA,CAAI,SACD,GAAA,QAAA,CAAS,OAAQ,CAAA,GAAA,CAAI,SAAS,CAAA,GAC9B,QAAS,CAAA,GAAA,IACX,UAAW,EAAA;AAAA,GACjB;AACF,CAAA,CAAA;AAQO,MAAM,aAAa,CAAC,EAAE,KAAO,EAAA,OAAA,EAAS,OAA6B,KAAA;AACxE,EAAA,IAAI,KAAO,EAAA;AACT,IAAA,uBACG,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,IAAA,kBACE,KAAA,CAAA,aAAA,CAAA,kBAAA,EAAA,EAAmB,OAAc,CACpC,CAAA,CAAA;AAAA,GAEJ;AAEA,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,SAAW,EAAA,OAAA;AAAA,MACX,OAAA;AAAA,MACA,OAAS,EAAA;AAAA,QACP,MAAQ,EAAA,IAAA;AAAA,QACR,MAAQ,EAAA,IAAA;AAAA,QACR,QAAU,EAAA,CAAA;AAAA,QACV,4BAA4B,CAAC,OAAA;AAAA,OAC/B;AAAA,MACA,KAAA,kBACG,KAAA,CAAA,aAAA,CAAA,GAAA,EAAA,EAAI,OAAQ,EAAA,MAAA,EAAO,YAAW,QAC7B,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,kBAAmB,EAAA,EAAA,KAAA,EAAO,EAAE,QAAA,EAAU,IAAM,EAAA,CAAA,kBAC5C,KAAA,CAAA,aAAA,CAAA,GAAA,EAAA,EAAI,EAAI,EAAA,CAAA,EAAG,CAAE,EAAA,4BAAA,EACa,KAAQ,GAAA,KAAA,CAAM,MAAS,GAAA,CAAA,EAAE,GACtD,CAAA;AAAA,MAEF,IAAA,EAAM,SAAS,EAAC;AAAA,KAAA;AAAA,GAClB,CAAA;AAEJ;;;;"}
@@ -12,19 +12,13 @@ const columns = [
12
12
  highlight: false,
13
13
  defaultSort: "desc",
14
14
  width: "auto",
15
- render: (row) => {
16
- var _a;
17
- return /* @__PURE__ */ React.createElement(Box, { display: "flex", alignItems: "center" }, /* @__PURE__ */ React.createElement(Link, { to: (_a = row.link) != null ? _a : "" }, row.name));
18
- }
15
+ render: (row) => /* @__PURE__ */ React.createElement(Box, { display: "flex", alignItems: "center" }, /* @__PURE__ */ React.createElement(Link, { to: row.link ?? "" }, row.name))
19
16
  },
20
17
  {
21
18
  title: "Commit",
22
19
  field: "peeledObjectId",
23
20
  width: "auto",
24
- render: (row) => {
25
- var _a;
26
- return /* @__PURE__ */ React.createElement(Box, { display: "flex", alignItems: "center" }, /* @__PURE__ */ React.createElement(Link, { to: (_a = row.commitLink) != null ? _a : "" }, row.peeledObjectId));
27
- }
21
+ render: (row) => /* @__PURE__ */ React.createElement(Box, { display: "flex", alignItems: "center" }, /* @__PURE__ */ React.createElement(Link, { to: row.commitLink ?? "" }, row.peeledObjectId))
28
22
  },
29
23
  {
30
24
  title: "Created By",
@@ -50,7 +44,7 @@ const GitTagTable = () => {
50
44
  showEmptyDataSourceMessage: !loading
51
45
  },
52
46
  title: /* @__PURE__ */ React.createElement(Box, { display: "flex", alignItems: "center" }, /* @__PURE__ */ React.createElement(AzureGitTagsIcon, { style: { fontSize: 30 } }), /* @__PURE__ */ React.createElement(Box, { mr: 1 }), "Azure Repos - Git Tags (", items ? items.length : 0, ")"),
53
- data: items != null ? items : []
47
+ data: items ?? []
54
48
  }
55
49
  );
56
50
  };
@@ -1 +1 @@
1
- {"version":3,"file":"GitTagTable.esm.js","sources":["../../../src/components/GitTagTable/GitTagTable.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Box from '@material-ui/core/Box';\nimport {\n Link,\n ResponseErrorPanel,\n Table,\n TableColumn,\n} from '@backstage/core-components';\nimport { GitTag } from '@backstage-community/plugin-azure-devops-common';\nimport React from 'react';\n\nimport { AzureGitTagsIcon } from '../AzureGitTagsIcon';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport { useGitTags } from '../../hooks/useGitTags';\n\nconst columns: TableColumn[] = [\n {\n title: 'Tag',\n field: 'name',\n highlight: false,\n defaultSort: 'desc',\n width: 'auto',\n render: (row: Partial<GitTag>) => (\n <Box display=\"flex\" alignItems=\"center\">\n <Link to={row.link ?? ''}>{row.name}</Link>\n </Box>\n ),\n },\n {\n title: 'Commit',\n field: 'peeledObjectId',\n width: 'auto',\n render: (row: Partial<GitTag>) => (\n <Box display=\"flex\" alignItems=\"center\">\n <Link to={row.commitLink ?? ''}>{row.peeledObjectId}</Link>\n </Box>\n ),\n },\n {\n title: 'Created By',\n field: 'createdBy',\n width: 'auto',\n },\n];\n\nexport const GitTagTable = () => {\n const { entity } = useEntity();\n\n const { items, loading, error } = useGitTags(entity);\n\n if (error) {\n return <ResponseErrorPanel error={error} />;\n }\n\n return (\n <Table\n isLoading={loading}\n columns={columns}\n options={{\n search: true,\n paging: true,\n pageSize: 5,\n showEmptyDataSourceMessage: !loading,\n }}\n title={\n <Box display=\"flex\" alignItems=\"center\">\n <AzureGitTagsIcon style={{ fontSize: 30 }} />\n <Box mr={1} />\n Azure Repos - Git Tags ({items ? items.length : 0})\n </Box>\n }\n data={items ?? []}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;;AA8BA,MAAM,OAAyB,GAAA;AAAA,EAC7B;AAAA,IACE,KAAO,EAAA,KAAA;AAAA,IACP,KAAO,EAAA,MAAA;AAAA,IACP,SAAW,EAAA,KAAA;AAAA,IACX,WAAa,EAAA,MAAA;AAAA,IACb,KAAO,EAAA,MAAA;AAAA,IACP,MAAA,EAAQ,CAAC,GAAsB,KAAA;AArCnC,MAAA,IAAA,EAAA,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uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,SAAW,EAAA,OAAA;AAAA,MACX,OAAA;AAAA,MACA,OAAS,EAAA;AAAA,QACP,MAAQ,EAAA,IAAA;AAAA,QACR,MAAQ,EAAA,IAAA;AAAA,QACR,QAAU,EAAA,CAAA;AAAA,QACV,4BAA4B,CAAC,OAAA;AAAA,OAC/B;AAAA,MACA,KAAA,kBACG,KAAA,CAAA,aAAA,CAAA,GAAA,EAAA,EAAI,OAAQ,EAAA,MAAA,EAAO,YAAW,QAC7B,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,gBAAiB,EAAA,EAAA,KAAA,EAAO,EAAE,QAAA,EAAU,IAAM,EAAA,CAAA,kBAC1C,KAAA,CAAA,aAAA,CAAA,GAAA,EAAA,EAAI,EAAI,EAAA,CAAA,EAAG,CAAE,EAAA,0BAAA,EACW,KAAQ,GAAA,KAAA,CAAM,MAAS,GAAA,CAAA,EAAE,GACpD,CAAA;AAAA,MAEF,IAAA,EAAM,wBAAS,EAAC;AAAA,KAAA;AAAA,GAClB,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"GitTagTable.esm.js","sources":["../../../src/components/GitTagTable/GitTagTable.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Box from '@material-ui/core/Box';\nimport {\n Link,\n ResponseErrorPanel,\n Table,\n TableColumn,\n} from '@backstage/core-components';\nimport { GitTag } from '@backstage-community/plugin-azure-devops-common';\nimport React from 'react';\n\nimport { AzureGitTagsIcon } from '../AzureGitTagsIcon';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport { useGitTags } from '../../hooks/useGitTags';\n\nconst columns: TableColumn[] = [\n {\n title: 'Tag',\n field: 'name',\n highlight: false,\n defaultSort: 'desc',\n width: 'auto',\n render: (row: Partial<GitTag>) => (\n <Box display=\"flex\" alignItems=\"center\">\n <Link to={row.link ?? ''}>{row.name}</Link>\n </Box>\n ),\n },\n {\n title: 'Commit',\n field: 'peeledObjectId',\n width: 'auto',\n render: (row: Partial<GitTag>) => (\n <Box display=\"flex\" alignItems=\"center\">\n <Link to={row.commitLink ?? ''}>{row.peeledObjectId}</Link>\n </Box>\n ),\n },\n {\n title: 'Created By',\n field: 'createdBy',\n width: 'auto',\n },\n];\n\nexport const GitTagTable = () => {\n const { entity } = useEntity();\n\n const { items, loading, error } = useGitTags(entity);\n\n if (error) {\n return <ResponseErrorPanel error={error} />;\n }\n\n return (\n <Table\n isLoading={loading}\n columns={columns}\n options={{\n search: true,\n paging: true,\n pageSize: 5,\n showEmptyDataSourceMessage: !loading,\n }}\n title={\n <Box display=\"flex\" alignItems=\"center\">\n <AzureGitTagsIcon style={{ fontSize: 30 }} />\n <Box mr={1} />\n Azure Repos - Git Tags ({items ? items.length : 0})\n </Box>\n }\n data={items ?? []}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;;AA8BA,MAAM,OAAyB,GAAA;AAAA,EAC7B;AAAA,IACE,KAAO,EAAA,KAAA;AAAA,IACP,KAAO,EAAA,MAAA;AAAA,IACP,SAAW,EAAA,KAAA;AAAA,IACX,WAAa,EAAA,MAAA;AAAA,IACb,KAAO,EAAA,MAAA;AAAA,IACP,QAAQ,CAAC,GAAA,qBACN,KAAA,CAAA,aAAA,CAAA,GAAA,EAAA,EAAI,SAAQ,MAAO,EAAA,UAAA,EAAW,QAC7B,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,QAAK,EAAI,EAAA,GAAA,CAAI,QAAQ,EAAK,EAAA,EAAA,GAAA,CAAI,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KAAA,EAAO,EAAE,QAAA,EAAU,IAAM,EAAA,CAAA,kBAC1C,KAAA,CAAA,aAAA,CAAA,GAAA,EAAA,EAAI,EAAI,EAAA,CAAA,EAAG,CAAE,EAAA,0BAAA,EACW,KAAQ,GAAA,KAAA,CAAM,MAAS,GAAA,CAAA,EAAE,GACpD,CAAA;AAAA,MAEF,IAAA,EAAM,SAAS,EAAC;AAAA,KAAA;AAAA,GAClB,CAAA;AAEJ;;;;"}
@@ -20,18 +20,15 @@ const columns = [
20
20
  title: "Title",
21
21
  field: "title",
22
22
  width: "auto",
23
- render: (row) => {
24
- var _a;
25
- return /* @__PURE__ */ React.createElement(Box, { display: "flex", alignItems: "center" }, /* @__PURE__ */ React.createElement(Link, { to: (_a = row.link) != null ? _a : "" }, row.title), row.isDraft && /* @__PURE__ */ React.createElement(Box, { paddingLeft: 1 }, /* @__PURE__ */ React.createElement(
26
- Chip,
27
- {
28
- label: "Draft",
29
- variant: "outlined",
30
- color: "secondary",
31
- size: "small"
32
- }
33
- )));
34
- }
23
+ render: (row) => /* @__PURE__ */ React.createElement(Box, { display: "flex", alignItems: "center" }, /* @__PURE__ */ React.createElement(Link, { to: row.link ?? "" }, row.title), row.isDraft && /* @__PURE__ */ React.createElement(Box, { paddingLeft: 1 }, /* @__PURE__ */ React.createElement(
24
+ Chip,
25
+ {
26
+ label: "Draft",
27
+ variant: "outlined",
28
+ color: "secondary",
29
+ size: "small"
30
+ }
31
+ )))
35
32
  },
36
33
  {
37
34
  title: "Source",
@@ -84,7 +81,7 @@ const PullRequestTable = ({ defaultLimit }) => {
84
81
  setStatus: setPullRequestStatusState
85
82
  }
86
83
  ))),
87
- data: items != null ? items : []
84
+ data: items ?? []
88
85
  }
89
86
  );
90
87
  };
@@ -1 +1 @@
1
- {"version":3,"file":"PullRequestTable.esm.js","sources":["../../../src/components/PullRequestTable/PullRequestTable.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Box from '@material-ui/core/Box';\nimport Chip from '@material-ui/core/Chip';\nimport {\n Link,\n ResponseErrorPanel,\n Table,\n TableColumn,\n} from '@backstage/core-components';\nimport {\n PullRequest,\n PullRequestStatus,\n} from '@backstage-community/plugin-azure-devops-common';\nimport React, { useState } from 'react';\n\nimport { AzurePullRequestsIcon } from '../AzurePullRequestsIcon';\nimport { DateTime } from 'luxon';\nimport { PullRequestStatusButtonGroup } from '../PullRequestStatusButtonGroup';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport { usePullRequests } from '../../hooks/usePullRequests';\n\nconst columns: TableColumn[] = [\n {\n title: 'ID',\n field: 'pullRequestId',\n highlight: false,\n width: 'auto',\n },\n {\n title: 'Title',\n field: 'title',\n width: 'auto',\n render: (row: Partial<PullRequest>) => (\n <Box display=\"flex\" alignItems=\"center\">\n <Link to={row.link ?? ''}>{row.title}</Link>\n {row.isDraft && (\n <Box paddingLeft={1}>\n <Chip\n label=\"Draft\"\n variant=\"outlined\"\n color=\"secondary\"\n size=\"small\"\n />\n </Box>\n )}\n </Box>\n ),\n },\n {\n title: 'Source',\n field: 'sourceRefName',\n width: 'auto',\n },\n {\n title: 'Target',\n field: 'targetRefName',\n width: 'auto',\n },\n {\n title: 'Created By',\n field: 'createdBy',\n width: 'auto',\n },\n {\n title: 'Created',\n field: 'creationDate',\n width: 'auto',\n render: (row: Partial<PullRequest>) =>\n (row.creationDate\n ? DateTime.fromISO(row.creationDate)\n : DateTime.now()\n ).toRelative(),\n },\n];\n\ntype PullRequestTableProps = {\n defaultLimit?: number;\n};\n\nexport const PullRequestTable = ({ defaultLimit }: PullRequestTableProps) => {\n const [pullRequestStatusState, setPullRequestStatusState] =\n useState<PullRequestStatus>(PullRequestStatus.Active);\n const { entity } = useEntity();\n\n const { items, loading, error } = usePullRequests(\n entity,\n defaultLimit,\n pullRequestStatusState,\n );\n\n if (error) {\n return <ResponseErrorPanel error={error} />;\n }\n\n return (\n <Table\n isLoading={loading}\n columns={columns}\n options={{\n search: true,\n paging: true,\n pageSize: 5,\n showEmptyDataSourceMessage: !loading,\n }}\n title={\n <Box display=\"flex\" alignItems=\"center\">\n <AzurePullRequestsIcon style={{ fontSize: 30 }} />\n <Box mr={1} />\n Azure Repos - Pull Requests ({items ? items.length : 0})\n <Box position=\"absolute\" right={320} top={20}>\n <PullRequestStatusButtonGroup\n status={pullRequestStatusState}\n setStatus={setPullRequestStatusState}\n />\n </Box>\n </Box>\n }\n data={items ?? []}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;AAoCA,MAAM,OAAyB,GAAA;AAAA,EAC7B;AAAA,IACE,KAAO,EAAA,IAAA;AAAA,IACP,KAAO,EAAA,eAAA;AAAA,IACP,SAAW,EAAA,KAAA;AAAA,IACX,KAAO,EAAA,MAAA;AAAA,GACT;AAAA,EACA;AAAA,IACE,KAAO,EAAA,OAAA;AAAA,IACP,KAAO,EAAA,OAAA;AAAA,IACP,KAAO,EAAA,MAAA;AAAA,IACP,MAAA,EAAQ,CAAC,GAA2B,KAAA;AA/CxC,MAAA,IAAA,EAAA,CAAA;AAgDM,MAAC,uBAAA,KAAA,CAAA,aAAA,CAAA,GAAA,EAAA,EAAI,SAAQ,MAAO,EAAA,UAAA,EAAW,4BAC5B,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAK,KAAI,EAAI,GAAA,GAAA,CAAA,IAAA,KAAJ,YAAY,EAAK,EAAA,EAAA,GAAA,CAAI,KAAM,CACpC,EAAA,GAAA,CAAI,2BACF,KAAA,CAAA,aAAA,CAAA,GAAA,EAAA,EAAI,aAAa,CAChB,EAAA,kBA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EAAA;AACT,IAAO,uBAAA,KAAA,CAAA,aAAA,CAAC,sBAAmB,KAAc,EAAA,CAAA,CAAA;AAAA,GAC3C;AAEA,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,SAAW,EAAA,OAAA;AAAA,MACX,OAAA;AAAA,MACA,OAAS,EAAA;AAAA,QACP,MAAQ,EAAA,IAAA;AAAA,QACR,MAAQ,EAAA,IAAA;AAAA,QACR,QAAU,EAAA,CAAA;AAAA,QACV,4BAA4B,CAAC,OAAA;AAAA,OAC/B;AAAA,MACA,KACE,kBAAA,KAAA,CAAA,aAAA,CAAC,GAAI,EAAA,EAAA,OAAA,EAAQ,QAAO,UAAW,EAAA,QAAA,EAAA,kBAC5B,KAAA,CAAA,aAAA,CAAA,qBAAA,EAAA,EAAsB,KAAO,EAAA,EAAE,QAAU,EAAA,EAAA,IAAM,CAChD,kBAAA,KAAA,CAAA,aAAA,CAAC,GAAI,EAAA,EAAA,EAAA,EAAI,CAAG,EAAA,CAAA,EAAE,+BACgB,EAAA,KAAA,GAAQ,MAAM,MAAS,GAAA,CAAA,EAAE,GACvD,kBAAA,KAAA,CAAA,aAAA,CAAC,OAAI,QAAS,EAAA,UAAA,EAAW,KAAO,EAAA,GAAA,EAAK,KAAK,EACxC,EAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,QAAC,4BAAA;AAAA,QAAA;AAAA,UACC,MAAQ,EAAA,sBAAA;AAAA,UACR,SAAW,EAAA,yBAAA;AAAA,SAAA;AAAA,OAEf,CACF,CAAA;AAAA,MAEF,IAAA,EAAM,wBAAS,EAAC;AAAA,KAAA;AAAA,GAClB,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"PullRequestTable.esm.js","sources":["../../../src/components/PullRequestTable/PullRequestTable.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Box from '@material-ui/core/Box';\nimport Chip from '@material-ui/core/Chip';\nimport {\n Link,\n ResponseErrorPanel,\n Table,\n TableColumn,\n} from '@backstage/core-components';\nimport {\n PullRequest,\n PullRequestStatus,\n} from '@backstage-community/plugin-azure-devops-common';\nimport React, { useState } from 'react';\n\nimport { AzurePullRequestsIcon } from '../AzurePullRequestsIcon';\nimport { DateTime } from 'luxon';\nimport { PullRequestStatusButtonGroup } from '../PullRequestStatusButtonGroup';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport { usePullRequests } from '../../hooks/usePullRequests';\n\nconst columns: TableColumn[] = [\n {\n title: 'ID',\n field: 'pullRequestId',\n highlight: false,\n width: 'auto',\n },\n {\n title: 'Title',\n field: 'title',\n width: 'auto',\n render: (row: Partial<PullRequest>) => (\n <Box display=\"flex\" alignItems=\"center\">\n <Link to={row.link ?? ''}>{row.title}</Link>\n {row.isDraft && (\n <Box paddingLeft={1}>\n <Chip\n label=\"Draft\"\n variant=\"outlined\"\n color=\"secondary\"\n size=\"small\"\n />\n </Box>\n )}\n </Box>\n ),\n },\n {\n title: 'Source',\n field: 'sourceRefName',\n width: 'auto',\n },\n {\n title: 'Target',\n field: 'targetRefName',\n width: 'auto',\n },\n {\n title: 'Created By',\n field: 'createdBy',\n width: 'auto',\n },\n {\n title: 'Created',\n field: 'creationDate',\n width: 'auto',\n render: (row: Partial<PullRequest>) =>\n (row.creationDate\n ? DateTime.fromISO(row.creationDate)\n : DateTime.now()\n ).toRelative(),\n },\n];\n\ntype PullRequestTableProps = {\n defaultLimit?: number;\n};\n\nexport const PullRequestTable = ({ defaultLimit }: PullRequestTableProps) => {\n const [pullRequestStatusState, setPullRequestStatusState] =\n useState<PullRequestStatus>(PullRequestStatus.Active);\n const { entity } = useEntity();\n\n const { items, loading, error } = usePullRequests(\n entity,\n defaultLimit,\n pullRequestStatusState,\n );\n\n if (error) {\n return <ResponseErrorPanel error={error} />;\n }\n\n return (\n <Table\n isLoading={loading}\n columns={columns}\n options={{\n search: true,\n paging: true,\n pageSize: 5,\n showEmptyDataSourceMessage: !loading,\n }}\n title={\n <Box display=\"flex\" alignItems=\"center\">\n <AzurePullRequestsIcon style={{ fontSize: 30 }} />\n <Box mr={1} />\n Azure Repos - Pull Requests ({items ? items.length : 0})\n <Box position=\"absolute\" right={320} top={20}>\n <PullRequestStatusButtonGroup\n status={pullRequestStatusState}\n setStatus={setPullRequestStatusState}\n />\n </Box>\n </Box>\n }\n data={items ?? []}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;AAoCA,MAAM,OAAyB,GAAA;AAAA,EAC7B;AAAA,IACE,KAAO,EAAA,IAAA;AAAA,IACP,KAAO,EAAA,eAAA;AAAA,IACP,SAAW,EAAA,KAAA;AAAA,IACX,KAAO,EAAA,MAAA;AAAA,GACT;AAAA,EACA;AAAA,IACE,KAAO,EAAA,OAAA;AAAA,IACP,KAAO,EAAA,OAAA;AAAA,IACP,KAAO,EAAA,MAAA;AAAA,IACP,MAAA,EAAQ,CAAC,GACP,qBAAA,KAAA,CAAA,aAAA,CAAC,OAAI,OAAQ,EAAA,MAAA,EAAO,UAAW,EAAA,QAAA,EAAA,kBAC5B,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAK,IAAI,GAAI,CAAA,IAAA,IAAQ,EAAK,EAAA,EAAA,GAAA,CAAI,KAAM,CAAA,EACpC,IAAI,OACH,oBAAA,KAAA,CAAA,aAAA,CAAC,GAAI,EAAA,EAAA,WAAA,EAAa,CAChB,EAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,MAAC,IAAA;AAAA,MAAA;AAAA,QACC,KAAM,EAAA,OAAA;AAAA,QACN,OAAQ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A,CAAA,aAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,SAAW,EAAA,OAAA;AAAA,MACX,OAAA;AAAA,MACA,OAAS,EAAA;AAAA,QACP,MAAQ,EAAA,IAAA;AAAA,QACR,MAAQ,EAAA,IAAA;AAAA,QACR,QAAU,EAAA,CAAA;AAAA,QACV,4BAA4B,CAAC,OAAA;AAAA,OAC/B;AAAA,MACA,KACE,kBAAA,KAAA,CAAA,aAAA,CAAC,GAAI,EAAA,EAAA,OAAA,EAAQ,QAAO,UAAW,EAAA,QAAA,EAAA,kBAC5B,KAAA,CAAA,aAAA,CAAA,qBAAA,EAAA,EAAsB,KAAO,EAAA,EAAE,QAAU,EAAA,EAAA,IAAM,CAChD,kBAAA,KAAA,CAAA,aAAA,CAAC,GAAI,EAAA,EAAA,EAAA,EAAI,CAAG,EAAA,CAAA,EAAE,+BACgB,EAAA,KAAA,GAAQ,MAAM,MAAS,GAAA,CAAA,EAAE,GACvD,kBAAA,KAAA,CAAA,aAAA,CAAC,OAAI,QAAS,EAAA,UAAA,EAAW,KAAO,EAAA,GAAA,EAAK,KAAK,EACxC,EAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,QAAC,4BAAA;AAAA,QAAA;AAAA,UACC,MAAQ,EAAA,sBAAA;AAAA,UACR,SAAW,EAAA,yBAAA;AAAA,SAAA;AAAA,OAEf,CACF,CAAA;AAAA,MAEF,IAAA,EAAM,SAAS,EAAC;AAAA,KAAA;AAAA,GAClB,CAAA;AAEJ;;;;"}
@@ -26,7 +26,7 @@ const PullRequestsPageContent = ({
26
26
  if (error) {
27
27
  return /* @__PURE__ */ React.createElement(ResponseErrorPanel, { error });
28
28
  }
29
- return /* @__PURE__ */ React.createElement(PullRequestGrid, { pullRequestGroups: pullRequestGroups != null ? pullRequestGroups : [] });
29
+ return /* @__PURE__ */ React.createElement(PullRequestGrid, { pullRequestGroups: pullRequestGroups ?? [] });
30
30
  };
31
31
  const DEFAULT_COLUMN_CONFIGS = [
32
32
  {
@@ -48,7 +48,7 @@ const PullRequestsPage = (props) => {
48
48
  teamsLimit
49
49
  );
50
50
  const [columnConfigs] = useState(
51
- defaultColumnConfigs != null ? defaultColumnConfigs : DEFAULT_COLUMN_CONFIGS
51
+ defaultColumnConfigs ?? DEFAULT_COLUMN_CONFIGS
52
52
  );
53
53
  const filterProcessor = useFilterProcessor();
54
54
  const pullRequestGroupConfigs = getPullRequestGroupConfigs(
@@ -1 +1 @@
1
- {"version":3,"file":"PullRequestsPage.esm.js","sources":["../../../src/components/PullRequestsPage/PullRequestsPage.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n Content,\n Header,\n Page,\n Progress,\n ResponseErrorPanel,\n} from '@backstage/core-components';\nimport { PullRequestColumnConfig, PullRequestGroup } from './lib/types';\nimport React, { useState } from 'react';\nimport { getPullRequestGroupConfigs, getPullRequestGroups } from './lib/utils';\nimport { FilterType } from './lib/filters';\nimport { PullRequestGrid } from './lib/PullRequestGrid';\nimport { useDashboardPullRequests } from '../../hooks';\nimport { useFilterProcessor } from './lib/hooks';\nimport { RequirePermission } from '@backstage/plugin-permission-react';\nimport { azureDevOpsPullRequestDashboardReadPermission } from '@backstage-community/plugin-azure-devops-common';\n\ntype PullRequestsPageContentProps = {\n pullRequestGroups: PullRequestGroup[] | undefined;\n loading: boolean;\n error?: Error;\n};\n\nconst PullRequestsPageContent = ({\n pullRequestGroups,\n loading,\n error,\n}: PullRequestsPageContentProps) => {\n if (loading && (!pullRequestGroups || pullRequestGroups.length <= 0)) {\n return <Progress />;\n }\n\n if (error) {\n return <ResponseErrorPanel error={error} />;\n }\n\n return <PullRequestGrid pullRequestGroups={pullRequestGroups ?? []} />;\n};\n\nconst DEFAULT_COLUMN_CONFIGS: PullRequestColumnConfig[] = [\n {\n title: 'Created by me',\n filters: [{ type: FilterType.CreatedByCurrentUser }],\n simplified: false,\n },\n {\n title: 'Other PRs',\n filters: [{ type: FilterType.All }],\n simplified: true,\n },\n];\n\ntype PullRequestsPageProps = {\n projectName?: string;\n pollingInterval?: number;\n defaultColumnConfigs?: PullRequestColumnConfig[];\n teamsLimit?: number;\n};\n\nexport const PullRequestsPage = (props: PullRequestsPageProps) => {\n const { projectName, pollingInterval, defaultColumnConfigs, teamsLimit } =\n props;\n\n const { pullRequests, loading, error } = useDashboardPullRequests(\n projectName,\n pollingInterval,\n teamsLimit,\n );\n\n const [columnConfigs] = useState(\n defaultColumnConfigs ?? DEFAULT_COLUMN_CONFIGS,\n );\n\n const filterProcessor = useFilterProcessor();\n\n const pullRequestGroupConfigs = getPullRequestGroupConfigs(\n columnConfigs,\n filterProcessor,\n );\n\n const pullRequestGroups = getPullRequestGroups(\n pullRequests,\n pullRequestGroupConfigs,\n );\n\n return (\n <Page themeId=\"tool\">\n <Header title=\"Azure Pull Requests\" />\n <Content>\n <RequirePermission\n permission={azureDevOpsPullRequestDashboardReadPermission}\n >\n <PullRequestsPageContent\n pullRequestGroups={pullRequestGroups}\n loading={loading}\n error={error}\n />\n </RequirePermission>\n </Content>\n </Page>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAuCA,MAAM,0BAA0B,CAAC;AAAA,EAC/B,iBAAA;AAAA,EACA,OAAA;AAAA,EACA,KAAA;AACF,CAAoC,KAAA;AAClC,EAAA,IAAI,OAAY,KAAA,CAAC,iBAAqB,IAAA,iBAAA,CAAkB,UAAU,CAAI,CAAA,EAAA;AACpE,IAAA,2CAAQ,QAAS,EAAA,IAAA,CAAA,CAAA;AAAA,GACnB;AAEA,EAAA,IAAI,KAA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EA,EACE,uBAAA,KAAA,CAAA,aAAA,CAAC,IAAK,EAAA,EAAA,OAAA,EAAQ,MACZ,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,UAAO,KAAM,EAAA,qBAAA,EAAsB,CACpC,kBAAA,KAAA,CAAA,aAAA,CAAC,OACC,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,iBAAA;AAAA,IAAA;AAAA,MACC,UAAY,EAAA,6CAAA;AAAA,KAAA;AAAA,oBAEZ,KAAA,CAAA,aAAA;AAAA,MAAC,uBAAA;AAAA,MAAA;AAAA,QACC,iBAAA;AAAA,QACA,OAAA;AAAA,QACA,KAAA;AAAA,OAAA;AAAA,KACF;AAAA,GAEJ,CACF,CAAA,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"PullRequestsPage.esm.js","sources":["../../../src/components/PullRequestsPage/PullRequestsPage.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n Content,\n Header,\n Page,\n Progress,\n ResponseErrorPanel,\n} from '@backstage/core-components';\nimport { PullRequestColumnConfig, PullRequestGroup } from './lib/types';\nimport React, { useState } from 'react';\nimport { getPullRequestGroupConfigs, getPullRequestGroups } from './lib/utils';\nimport { FilterType } from './lib/filters';\nimport { PullRequestGrid } from './lib/PullRequestGrid';\nimport { useDashboardPullRequests } from '../../hooks';\nimport { useFilterProcessor } from './lib/hooks';\nimport { RequirePermission } from '@backstage/plugin-permission-react';\nimport { azureDevOpsPullRequestDashboardReadPermission } from '@backstage-community/plugin-azure-devops-common';\n\ntype PullRequestsPageContentProps = {\n pullRequestGroups: PullRequestGroup[] | undefined;\n loading: boolean;\n error?: Error;\n};\n\nconst PullRequestsPageContent = ({\n pullRequestGroups,\n loading,\n error,\n}: PullRequestsPageContentProps) => {\n if (loading && (!pullRequestGroups || pullRequestGroups.length <= 0)) {\n return <Progress />;\n }\n\n if (error) {\n return <ResponseErrorPanel error={error} />;\n }\n\n return <PullRequestGrid pullRequestGroups={pullRequestGroups ?? []} />;\n};\n\nconst DEFAULT_COLUMN_CONFIGS: PullRequestColumnConfig[] = [\n {\n title: 'Created by me',\n filters: [{ type: FilterType.CreatedByCurrentUser }],\n simplified: false,\n },\n {\n title: 'Other PRs',\n filters: [{ type: FilterType.All }],\n simplified: true,\n },\n];\n\ntype PullRequestsPageProps = {\n projectName?: string;\n pollingInterval?: number;\n defaultColumnConfigs?: PullRequestColumnConfig[];\n teamsLimit?: number;\n};\n\nexport const PullRequestsPage = (props: PullRequestsPageProps) => {\n const { projectName, pollingInterval, defaultColumnConfigs, teamsLimit } =\n props;\n\n const { pullRequests, loading, error } = useDashboardPullRequests(\n projectName,\n pollingInterval,\n teamsLimit,\n );\n\n const [columnConfigs] = useState(\n defaultColumnConfigs ?? DEFAULT_COLUMN_CONFIGS,\n );\n\n const filterProcessor = useFilterProcessor();\n\n const pullRequestGroupConfigs = getPullRequestGroupConfigs(\n columnConfigs,\n filterProcessor,\n );\n\n const pullRequestGroups = getPullRequestGroups(\n pullRequests,\n pullRequestGroupConfigs,\n );\n\n return (\n <Page themeId=\"tool\">\n <Header title=\"Azure Pull Requests\" />\n <Content>\n <RequirePermission\n permission={azureDevOpsPullRequestDashboardReadPermission}\n >\n <PullRequestsPageContent\n pullRequestGroups={pullRequestGroups}\n loading={loading}\n error={error}\n />\n </RequirePermission>\n </Content>\n </Page>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAuCA,MAAM,0BAA0B,CAAC;AAAA,EAC/B,iBAAA;AAAA,EACA,OAAA;AAAA,EACA,K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AA,IAC9B,aAAA;AAAA,IACA,eAAA;AAAA,GACF,CAAA;AAEA,EAAA,MAAM,iBAAoB,GAAA,oBAAA;AAAA,IACxB,YAAA;AAAA,IACA,uBAAA;AAAA,GACF,CAAA;AAEA,EACE,uBAAA,KAAA,CAAA,aAAA,CAAC,IAAK,EAAA,EAAA,OAAA,EAAQ,MACZ,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,UAAO,KAAM,EAAA,qBAAA,EAAsB,CACpC,kBAAA,KAAA,CAAA,aAAA,CAAC,OACC,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,iBAAA;AAAA,IAAA;AAAA,MACC,UAAY,EAAA,6CAAA;AAAA,KAAA;AAAA,oBAEZ,KAAA,CAAA,aAAA;AAAA,MAAC,uBAAA;AAAA,MAAA;AAAA,QACC,iBAAA;AAAA,QACA,OAAA;AAAA,QACA,KAAA;AAAA,OAAA;AAAA,KACF;AAAA,GAEJ,CACF,CAAA,CAAA;AAEJ;;;;"}
@@ -39,17 +39,16 @@ const PullRequestCard = ({
39
39
  pullRequest,
40
40
  simplified
41
41
  }) => {
42
- var _a, _b, _c, _d, _e, _f;
43
42
  const classes = useStyles();
44
- const title = /* @__PURE__ */ React.createElement(Link, { to: (_a = pullRequest.link) != null ? _a : "", title: pullRequest.description }, pullRequest.title);
45
- const repoLink = /* @__PURE__ */ React.createElement(Link, { to: (_c = (_b = pullRequest.repository) == null ? void 0 : _b.url) != null ? _c : "", color: "inherit" }, (_d = pullRequest.repository) == null ? void 0 : _d.name);
43
+ const title = /* @__PURE__ */ React.createElement(Link, { to: pullRequest.link ?? "", title: pullRequest.description }, pullRequest.title);
44
+ const repoLink = /* @__PURE__ */ React.createElement(Link, { to: pullRequest.repository?.url ?? "", color: "inherit" }, pullRequest.repository?.name);
46
45
  const creationDate = pullRequest.creationDate ? DateTime.fromISO(pullRequest.creationDate).toRelative() : void 0;
47
46
  const subheader = /* @__PURE__ */ React.createElement(Typography, { component: "span" }, repoLink, " \xB7 ", creationDate);
48
47
  const avatar = /* @__PURE__ */ React.createElement(
49
48
  Avatar,
50
49
  {
51
- displayName: (_e = pullRequest.createdBy) == null ? void 0 : _e.displayName,
52
- picture: (_f = pullRequest.createdBy) == null ? void 0 : _f.imageUrl,
50
+ displayName: pullRequest.createdBy?.displayName,
51
+ picture: pullRequest.createdBy?.imageUrl,
53
52
  classes: { avatar: classes.avatar, avatarText: classes.avatarText }
54
53
  }
55
54
  );
@@ -1 +1 @@
1
- {"version":3,"file":"PullRequestCard.esm.js","sources":["../../../../../src/components/PullRequestsPage/lib/PullRequestCard/PullRequestCard.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Avatar, Link } from '@backstage/core-components';\nimport Card from '@material-ui/core/Card';\nimport CardContent from '@material-ui/core/CardContent';\nimport CardHeader from '@material-ui/core/CardHeader';\nimport Typography from '@material-ui/core/Typography';\n\nimport { AutoCompleteIcon } from '../AutoCompleteIcon';\nimport { DashboardPullRequest } from '@backstage-community/plugin-azure-devops-common';\nimport { DateTime } from 'luxon';\nimport { PullRequestCardPolicies } from './PullRequestCardPolicies';\nimport { PullRequestCardReviewers } from './PullRequestCardReviewers';\nimport React from 'react';\nimport { makeStyles } from '@material-ui/core/styles';\n\nconst useStyles = makeStyles(\n theme => ({\n card: {\n backgroundColor:\n theme.palette.type === 'dark'\n ? theme.palette.grey[700]\n : theme.palette.common.white,\n },\n cardHeaderSimplified: {\n paddingBottom: theme.spacing(2),\n },\n cardHeaderAction: {\n display: 'flex',\n alignSelf: 'center',\n margin: 0,\n },\n content: {\n display: 'flex',\n flexDirection: 'row',\n },\n policies: {\n flex: 1,\n },\n avatar: { width: '2.5rem', height: '2.5rem' },\n avatarText: { fontSize: '1rem' },\n }),\n { name: 'PullRequestCard' },\n);\n\ntype PullRequestCardProps = {\n pullRequest: DashboardPullRequest;\n simplified?: boolean;\n};\n\nexport const PullRequestCard = ({\n pullRequest,\n simplified,\n}: PullRequestCardProps) => {\n const classes = useStyles();\n\n const title = (\n <Link to={pullRequest.link ?? ''} title={pullRequest.description}>\n {pullRequest.title}\n </Link>\n );\n\n const repoLink = (\n <Link to={pullRequest.repository?.url ?? ''} color=\"inherit\">\n {pullRequest.repository?.name}\n </Link>\n );\n\n const creationDate = pullRequest.creationDate\n ? DateTime.fromISO(pullRequest.creationDate).toRelative()\n : undefined;\n\n const subheader = (\n <Typography component=\"span\">\n {repoLink} · {creationDate}\n </Typography>\n );\n\n const avatar = (\n <Avatar\n displayName={pullRequest.createdBy?.displayName}\n picture={pullRequest.createdBy?.imageUrl}\n classes={{ avatar: classes.avatar, avatarText: classes.avatarText }}\n />\n );\n\n return (\n <Card\n classes={{ root: classes.card }}\n data-pull-request-id={pullRequest.pullRequestId}\n >\n <CardHeader\n avatar={avatar}\n title={title}\n subheader={subheader}\n action={\n <AutoCompleteIcon hasAutoComplete={pullRequest.hasAutoComplete} />\n }\n classes={{\n ...(simplified && { root: classes.cardHeaderSimplified }),\n action: classes.cardHeaderAction,\n }}\n />\n\n {!simplified && (\n <CardContent className={classes.content}>\n {pullRequest.policies && (\n <PullRequestCardPolicies\n policies={pullRequest.policies}\n className={classes.policies}\n />\n )}\n\n {pullRequest.reviewers && (\n <PullRequestCardReviewers reviewers={pullRequest.reviewers} />\n )}\n </CardContent>\n )}\n </Card>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;AA8BA,MAAM,SAAY,GAAA,UAAA;AAAA,EAChB,CAAU,KAAA,MAAA;AAAA,IACR,IAAM,EAAA;AAAA,MACJ,eACE,EAAA,K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,KAAA;AAAA,QACA,SAAA;AAAA,QACA,MACE,kBAAA,KAAA,CAAA,aAAA,CAAC,gBAAiB,EAAA,EAAA,eAAA,EAAiB,YAAY,eAAiB,EAAA,CAAA;AAAA,QAElE,OAAS,EAAA;AAAA,UACP,GAAI,UAAA,IAAc,EAAE,IAAA,EAAM,QAAQ,oBAAqB,EAAA;AAAA,UACvD,QAAQ,OAAQ,CAAA,gBAAA;AAAA,SAClB;AAAA,OAAA;AAAA,KACF;AAAA,IAEC,CAAC,8BACC,KAAA,CAAA,aAAA,CAAA,WAAA,EAAA,EAAY,WAAW,OAAQ,CAAA,OAAA,EAAA,EAC7B,YAAY,QACX,oBAAA,KAAA,CAAA,aAAA;AAAA,MAAC,uBAAA;AAAA,MAAA;AAAA,QACC,UAAU,WAAY,CAAA,QAAA;AAAA,QACtB,WAAW,OAAQ,CAAA,QAAA;AAAA,OAAA;AAAA,KACrB,EAGD,YAAY,SACX,oBAAA,KAAA,CAAA,aAAA,CAAC,4BAAyB,SAAW,EAAA,WAAA,CAAY,WAAW,CAEhE,CAAA;AAAA,GAEJ,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"PullRequestCard.esm.js","sources":["../../../../../src/components/PullRequestsPage/lib/PullRequestCard/PullRequestCard.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Avatar, Link } from '@backstage/core-components';\nimport Card from '@material-ui/core/Card';\nimport CardContent from '@material-ui/core/CardContent';\nimport CardHeader from '@material-ui/core/CardHeader';\nimport Typography from '@material-ui/core/Typography';\n\nimport { AutoCompleteIcon } from '../AutoCompleteIcon';\nimport { DashboardPullRequest } from '@backstage-community/plugin-azure-devops-common';\nimport { DateTime } from 'luxon';\nimport { PullRequestCardPolicies } from './PullRequestCardPolicies';\nimport { PullRequestCardReviewers } from './PullRequestCardReviewers';\nimport React from 'react';\nimport { makeStyles } from '@material-ui/core/styles';\n\nconst useStyles = makeStyles(\n theme => ({\n card: {\n backgroundColor:\n theme.palette.type === 'dark'\n ? theme.palette.grey[700]\n : theme.palette.common.white,\n },\n cardHeaderSimplified: {\n paddingBottom: theme.spacing(2),\n },\n cardHeaderAction: {\n display: 'flex',\n alignSelf: 'center',\n margin: 0,\n },\n content: {\n display: 'flex',\n flexDirection: 'row',\n },\n policies: {\n flex: 1,\n },\n avatar: { width: '2.5rem', height: '2.5rem' },\n avatarText: { fontSize: '1rem' },\n }),\n { name: 'PullRequestCard' },\n);\n\ntype PullRequestCardProps = {\n pullRequest: DashboardPullRequest;\n simplified?: boolean;\n};\n\nexport const PullRequestCard = ({\n pullRequest,\n simplified,\n}: PullRequestCardProps) => {\n const classes = useStyles();\n\n const title = (\n <Link to={pullRequest.link ?? ''} title={pullRequest.description}>\n {pullRequest.title}\n </Link>\n );\n\n const repoLink = (\n <Link to={pullRequest.repository?.url ?? ''} color=\"inherit\">\n {pullRequest.repository?.name}\n </Link>\n );\n\n const creationDate = pullRequest.creationDate\n ? DateTime.fromISO(pullRequest.creationDate).toRelative()\n : undefined;\n\n const subheader = (\n <Typography component=\"span\">\n {repoLink} · {creationDate}\n </Typography>\n );\n\n const avatar = (\n <Avatar\n displayName={pullRequest.createdBy?.displayName}\n picture={pullRequest.createdBy?.imageUrl}\n classes={{ avatar: classes.avatar, avatarText: classes.avatarText }}\n />\n );\n\n return (\n <Card\n classes={{ root: classes.card }}\n data-pull-request-id={pullRequest.pullRequestId}\n >\n <CardHeader\n avatar={avatar}\n title={title}\n subheader={subheader}\n action={\n <AutoCompleteIcon hasAutoComplete={pullRequest.hasAutoComplete} />\n }\n classes={{\n ...(simplified && { root: classes.cardHeaderSimplified }),\n action: classes.cardHeaderAction,\n }}\n />\n\n {!simplified && (\n <CardContent className={classes.content}>\n {pullRequest.policies && (\n <PullRequestCardPolicies\n policies={pullRequest.policies}\n className={classes.policies}\n />\n )}\n\n {pullRequest.reviewers && (\n <PullRequestCardReviewers reviewers={pullRequest.reviewers} />\n )}\n </CardContent>\n )}\n </Card>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;AA8BA,MAAM,SAAY,GAAA,UAAA;AAAA,EAChB,CAAU,KAAA,MAAA;AAAA,IACR,IAAM,EAAA;AAAA,MACJ,eACE,EAAA,KAAA,CAAM,OAAQ,CAAA,IAAA,KAAS,MACnB,GAAA,KAAA,CAAM,OAAQ,CAAA,IAAA,CAAK,GAAG,CAAA,GACtB,KAAM,CAAA,OAAA,CAAQ,MAAO,CAAA,KAAA;AAAA,KAC7B;AAAA,IACA,oBAAsB,EAAA;AAAA,MACpB,aAAA,EAAe,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,KAChC;AAAA,IACA,gBAAkB,EAAA;AAAA,MAChB,OAAS,EAAA,MAAA;AAAA,MACT,SAAW,EAAA,QAAA;AAAA,MACX,MAAQ,EAAA,CAAA;AAAA,KACV;AAAA,IACA,OAAS,EAAA;AAAA,MACP,OAAS,EAAA,MAAA;AAAA,MACT,aAAe,EAAA,KAAA;AAAA,KACjB;AAAA,IACA,QAAU,EAAA;AAAA,MACR,IAAM,EAAA,CAAA;AAAA,KACR;AAAA,IACA,MAAQ,EAAA,EAAE,KAAO,EAAA,QAAA,EAAU,QAAQ,QAAS,EAAA;AAAA,IAC5C,UAAA,EAAY,EAAE,QAAA,EAAU,MAAO,EAAA;AAAA,GACjC,CAAA;AAAA,EACA,EAAE,MAAM,iBAAkB,EAAA;AAC5B,CAAA,CAAA;AAOO,MAAM,kBAAkB,CAAC;AAAA,EAC9B,WAAA;AAAA,EACA,UAAA;AACF,CAA4B,KAAA;AAC1B,EAAA,MAA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AA,QACC,MAAA;AAAA,QACA,KAAA;AAAA,QACA,SAAA;AAAA,QACA,MACE,kBAAA,KAAA,CAAA,aAAA,CAAC,gBAAiB,EAAA,EAAA,eAAA,EAAiB,YAAY,eAAiB,EAAA,CAAA;AAAA,QAElE,OAAS,EAAA;AAAA,UACP,GAAI,UAAA,IAAc,EAAE,IAAA,EAAM,QAAQ,oBAAqB,EAAA;AAAA,UACvD,QAAQ,OAAQ,CAAA,gBAAA;AAAA,SAClB;AAAA,OAAA;AAAA,KACF;AAAA,IAEC,CAAC,8BACC,KAAA,CAAA,aAAA,CAAA,WAAA,EAAA,EAAY,WAAW,OAAQ,CAAA,OAAA,EAAA,EAC7B,YAAY,QACX,oBAAA,KAAA,CAAA,aAAA;AAAA,MAAC,uBAAA;AAAA,MAAA;AAAA,QACC,UAAU,WAAY,CAAA,QAAA;AAAA,QACtB,WAAW,OAAQ,CAAA,QAAA;AAAA,OAAA;AAAA,KACrB,EAGD,YAAY,SACX,oBAAA,KAAA,CAAA,aAAA,CAAC,4BAAyB,SAAW,EAAA,WAAA,CAAY,WAAW,CAEhE,CAAA;AAAA,GAEJ,CAAA;AAEJ;;;;"}
@@ -5,8 +5,7 @@ import '@backstage-community/plugin-azure-devops-common';
5
5
 
6
6
  function createAssignedToTeamFilter(filter) {
7
7
  return (pullRequest) => {
8
- var _a;
9
- const reviewerIds = (_a = pullRequest.reviewers) == null ? void 0 : _a.map((reviewer) => reviewer.id);
8
+ const reviewerIds = pullRequest.reviewers?.map((reviewer) => reviewer.id);
10
9
  if (!reviewerIds) {
11
10
  return false;
12
11
  }
@@ -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;AA7BzD,IAAA,IAAA,EAAA,CAAA;AA8BI,IAAA,MAAM,eAAc,EAAY,GAAA,WAAA,CAAA,SAAA,KAAZ,IAAuB,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,GAAA,CAAI,cAAY,QAAS,CAAA,EAAA,CAAA,CAAA;AAEpE,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,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;;;;"}
@@ -6,8 +6,7 @@ import '@backstage-community/plugin-azure-devops-common';
6
6
  function createAssignedToUserFilter(filter) {
7
7
  const email = filter.email;
8
8
  return (pullRequest) => {
9
- var _a;
10
- const uniqueNames = (_a = pullRequest.reviewers) == null ? void 0 : _a.map(
9
+ const uniqueNames = pullRequest.reviewers?.map(
11
10
  (reviewer) => reviewer.uniqueName
12
11
  );
13
12
  if (!email || !uniqueNames) {
@@ -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;AAtCzD,IAAA,IAAA,EAAA,CAAA;AAuCI,IAAM,MAAA,WAAA,GAAA,CAAc,EAAY,GAAA,WAAA,CAAA,SAAA,KAAZ,IAAuB,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,GAAA;AAAA,MACzC,cAAY,QAAS,CAAA,UAAA;AAAA,KAAA,CAAA;AAGvB,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,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;;;;"}
@@ -5,8 +5,7 @@ import '@backstage-community/plugin-azure-devops-common';
5
5
 
6
6
  function createCreatedByTeamFilter(filter) {
7
7
  return (pullRequest) => {
8
- var _a, _b;
9
- const [createdByTeams, team] = "teamId" in filter ? [(_a = pullRequest.createdBy) == null ? void 0 : _a.teamIds, filter.teamId] : [(_b = pullRequest.createdBy) == null ? void 0 : _b.teamNames, filter.teamName];
8
+ const [createdByTeams, team] = "teamId" in filter ? [pullRequest.createdBy?.teamIds, filter.teamId] : [pullRequest.createdBy?.teamNames, filter.teamName];
10
9
  if (!createdByTeams) {
11
10
  return false;
12
11
  }
@@ -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;AA7BzD,IAAA,IAAA,EAAA,EAAA,EAAA,CAAA;AA8BI,IAAM,MAAA,CAAC,gBAAgB,IAAI,CAAA,GACzB,YAAY,MACR,GAAA,CAAA,CAAC,iBAAY,SAAZ,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAuB,SAAS,MAAO,CAAA,MAAM,IAC9C,CAAC,CAAA,EAAA,GAAA,WAAA,CAAY,cAAZ,IAAuB,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,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,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;;;;"}
@@ -6,8 +6,7 @@ import '@backstage-community/plugin-azure-devops-common';
6
6
  function createCreatedByUserFilter(filter) {
7
7
  const email = filter.email;
8
8
  return (pullRequest) => {
9
- var _a;
10
- const uniqueName = (_a = pullRequest.createdBy) == null ? void 0 : _a.uniqueName;
9
+ const uniqueName = pullRequest.createdBy?.uniqueName;
11
10
  if (!email || !uniqueName) {
12
11
  return false;
13
12
  }
@@ -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;AAtCzD,IAAA,IAAA,EAAA,CAAA;AAuCI,IAAM,MAAA,UAAA,GAAA,CAAa,EAAY,GAAA,WAAA,CAAA,SAAA,KAAZ,IAAuB,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,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,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;;;;"}
@@ -37,8 +37,7 @@ const useStyles = makeStyles((theme) => ({
37
37
  }
38
38
  }));
39
39
  function isNotFoundError(error) {
40
- var _a;
41
- return ((_a = error == null ? void 0 : error.response) == null ? void 0 : _a.status) === 404;
40
+ return error?.response?.status === 404;
42
41
  }
43
42
  const ReadmeCardError = ({ error }) => {
44
43
  if (isNotFoundError(error)) {
@@ -63,7 +62,6 @@ const ReadmeCardError = ({ error }) => {
63
62
  return /* @__PURE__ */ React.createElement(ErrorPanel, { title: error.message, error });
64
63
  };
65
64
  const ReadmeCard = (props) => {
66
- var _a;
67
65
  const classes = useStyles();
68
66
  const { entity } = useEntity();
69
67
  const { loading, error, item: value } = useReadme(entity);
@@ -81,7 +79,7 @@ const ReadmeCard = (props) => {
81
79
  title: "Readme"
82
80
  }
83
81
  },
84
- /* @__PURE__ */ React.createElement(Box, { className: classes.readMe, sx: { maxHeight: props.maxHeight } }, /* @__PURE__ */ React.createElement(MarkdownContent, { content: (_a = value == null ? void 0 : value.content) != null ? _a : "" }))
82
+ /* @__PURE__ */ React.createElement(Box, { className: classes.readMe, sx: { maxHeight: props.maxHeight } }, /* @__PURE__ */ React.createElement(MarkdownContent, { content: value?.content ?? "" }))
85
83
  );
86
84
  };
87
85
 
@@ -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,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,CAAA,UAAA,EAAA,EAAW,KAAO,EAAA,KAAA,CAAM,SAAS,KAAc,EAAA,CAAA,CAAA;AACzD,CAAA,CAAA;AAEa,MAAA,UAAA,GAAa,CAAC,KAAiB,KAAA;AAtF5C,EAAA,IAAA,EAAA,CAAA;AAuFE,EAAA,MAAM,UAAU,SAAU,EAAA,CAAA;AAC1B,EAAM,MAAA,EAAE,MAAO,EAAA,GAAI,SAAU,EAAA,CAAA;AAC7B,EAAA,MAAM,EAAE,OAAS,EAAA,KAAA,EAAO,MAAM,KAAM,EAAA,GAAI,UAAU,MAAM,CAAA,CAAA;AAExD,EAAA,IAAI,OAAS,EAAA;AACX,IAAA,2CAAQ,QAAS,EAAA,IAAA,CAAA,CAAA;AAAA,aACR,KAAO,EAAA;AAChB,IAAO,uBAAA,KAAA,CAAA,aAAA,CAAC,mBAAgB,KAAc,EAAA,CAAA,CAAA;AAAA,GACxC;AAEA,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,QAAA;AAAA,IAAA;AAAA,MACC,KAAM,EAAA,QAAA;AAAA,MACN,QAAU,EAAA;AAAA,QACR,MAAM,KAAO,CAAA,GAAA;AAAA,QACb,KAAO,EAAA,QAAA;AAAA,OACT;AAAA,KAAA;AAAA,wCAEC,GAAI,EAAA,EAAA,SAAA,EAAW,QAAQ,MAAQ,EAAA,EAAA,EAAI,EAAE,SAAW,EAAA,KAAA,CAAM,SAAU,EAAA,EAAA,sCAC9D,eAAgB,EAAA,EAAA,OAAA,EAAA,CAAS,oCAAO,OAAP,KAAA,IAAA,GAAA,EAAA,GAAkB,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,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,KAAA,EAAwB,KAAA;AACjD,EAAI,IAAA,eAAA,CAAgB,KAAK,CAAG,EAAA;AAC1B,IACE,uBAAA,KAAA,CAAA,aAAA;AAAA,MAAC,UAAA;AAAA,MAAA;AAAA,QACC,KAAM,EAAA,qCAAA;AAAA,QACN,OAAQ,EAAA,OAAA;AAAA,QACR,WAAY,EAAA,kFAAA;AAAA,QACZ,MACE,kBAAA,KAAA,CAAA,aAAA;AAAA,UAAC,MAAA;AAAA,UAAA;AAAA,YACC,OAAQ,EAAA,WAAA;AAAA,YAC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} from '@backstage/catalog-model';
10
10
 
11
11
  function useBuildRuns(entity, defaultLimit) {
12
- const top = defaultLimit != null ? defaultLimit : AZURE_DEVOPS_DEFAULT_TOP;
12
+ const top = defaultLimit ?? AZURE_DEVOPS_DEFAULT_TOP;
13
13
  const options = {
14
14
  top
15
15
  };
@@ -27,7 +27,7 @@ function useBuildRuns(entity, defaultLimit) {
27
27
  );
28
28
  }, [api]);
29
29
  return {
30
- items: value == null ? void 0 : value.items,
30
+ items: value?.items,
31
31
  loading,
32
32
  error
33
33
  };
@@ -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,IAAA,GAAA,YAAA,GAAA,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,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,KAAA,CAAA,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,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;;;;"}
@@ -20,7 +20,7 @@ function useGitTags(entity) {
20
20
  );
21
21
  }, [api]);
22
22
  return {
23
- items: value == null ? void 0 : value.items,
23
+ items: value?.items,
24
24
  loading,
25
25
  error
26
26
  };
@@ -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,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,KAAA,CAAA,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,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;;;;"}
@@ -9,9 +9,9 @@ import 'humanize-duration';
9
9
  import { getAnnotationValuesFromEntity } from '../utils/getAnnotationValuesFromEntity.esm.js';
10
10
 
11
11
  function usePullRequests(entity, defaultLimit, requestedStatus, defaultTeamsLimit) {
12
- const top = defaultLimit != null ? defaultLimit : AZURE_DEVOPS_DEFAULT_TOP;
13
- const teamsLimit = defaultTeamsLimit != null ? defaultTeamsLimit : void 0;
14
- const status = requestedStatus != null ? requestedStatus : PullRequestStatus.Active;
12
+ const top = defaultLimit ?? AZURE_DEVOPS_DEFAULT_TOP;
13
+ const teamsLimit = defaultTeamsLimit ?? void 0;
14
+ const status = requestedStatus ?? PullRequestStatus.Active;
15
15
  const options = {
16
16
  top,
17
17
  status,
@@ -31,7 +31,7 @@ function usePullRequests(entity, defaultLimit, requestedStatus, defaultTeamsLimi
31
31
  );
32
32
  }, [api, top, status]);
33
33
  return {
34
- items: value == null ? void 0 : value.items,
34
+ items: value?.items,
35
35
  loading,
36
36
  error
37
37
  };
@@ -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,IAAA,GAAA,YAAA,GAAA,wBAAA,CAAA;AAC5B,EAAA,MAAM,aAAa,iBAAqB,IAAA,IAAA,GAAA,iBAAA,GAAA,KAAA,CAAA,CAAA;AACxC,EAAM,MAAA,MAAA,GAAS,4CAAmB,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,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,KAAA,CAAA,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,CAAA;AAC5B,EAAA,MAAM,aAAa,iBAAqB,IAAA,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;;;;"}
@@ -2,10 +2,9 @@ import { useApi, identityApiRef } from '@backstage/core-plugin-api';
2
2
  import useAsync from 'react-use/esm/useAsync';
3
3
 
4
4
  function useUserEmail() {
5
- var _a;
6
5
  const identityApi = useApi(identityApiRef);
7
6
  const state = useAsync(() => identityApi.getProfileInfo(), [identityApi]);
8
- return (_a = state.value) == null ? void 0 : _a.email;
7
+ return state.value?.email;
9
8
  }
10
9
 
11
10
  export { useUserEmail };
@@ -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;AAnBnD,EAAA,IAAA,EAAA,CAAA;AAoBE,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,EAAO,OAAA,CAAA,EAAA,GAAA,KAAA,CAAM,UAAN,IAAa,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,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,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;;;;"}
@@ -4,16 +4,10 @@ import { AzureDevOpsClient } from './api/AzureDevOpsClient.esm.js';
4
4
  import { azureDevOpsApiRef } from './api/AzureDevOpsApi.esm.js';
5
5
  import { AZURE_DEVOPS_REPO_ANNOTATION, AZURE_DEVOPS_PROJECT_ANNOTATION, AZURE_DEVOPS_BUILD_DEFINITION_ANNOTATION } from '@backstage-community/plugin-azure-devops-common';
6
6
 
7
- const isAzureDevOpsAvailable = (entity) => {
8
- var _a;
9
- return Boolean((_a = entity.metadata.annotations) == null ? void 0 : _a[AZURE_DEVOPS_REPO_ANNOTATION]);
10
- };
11
- const isAzurePipelinesAvailable = (entity) => {
12
- var _a, _b, _c;
13
- return Boolean((_a = entity.metadata.annotations) == null ? void 0 : _a[AZURE_DEVOPS_REPO_ANNOTATION]) || Boolean((_b = entity.metadata.annotations) == null ? void 0 : _b[AZURE_DEVOPS_PROJECT_ANNOTATION]) && Boolean(
14
- (_c = entity.metadata.annotations) == null ? void 0 : _c[AZURE_DEVOPS_BUILD_DEFINITION_ANNOTATION]
15
- );
16
- };
7
+ const isAzureDevOpsAvailable = (entity) => Boolean(entity.metadata.annotations?.[AZURE_DEVOPS_REPO_ANNOTATION]);
8
+ const isAzurePipelinesAvailable = (entity) => Boolean(entity.metadata.annotations?.[AZURE_DEVOPS_REPO_ANNOTATION]) || Boolean(entity.metadata.annotations?.[AZURE_DEVOPS_PROJECT_ANNOTATION]) && Boolean(
9
+ entity.metadata.annotations?.[AZURE_DEVOPS_BUILD_DEFINITION_ANNOTATION]
10
+ );
17
11
  const azureDevOpsPlugin = createPlugin({
18
12
  id: "azureDevOps",
19
13
  apis: [
@@ -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,MAAgB,KAAA;AAzCvD,EAAA,IAAA,EAAA,CAAA;AA0CE,EAAA,OAAA,OAAA,CA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"],"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,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AAK,CAAE,CAAA,sBAAA;AAAA,KACT;AAAA,IACF,UAAY,EAAA,iCAAA;AAAA,GACb,CAAA;AACH,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;;;;"}
@@ -4,8 +4,8 @@ function arrayHas(arr, value) {
4
4
  function stringArrayHas(arr, value, ignoreCase = false) {
5
5
  if (ignoreCase) {
6
6
  return arrayHas(
7
- arr.map((a) => a == null ? void 0 : a.toLocaleLowerCase("en-US")),
8
- value == null ? void 0 : value.toLocaleLowerCase("en-US")
7
+ arr.map((a) => a?.toLocaleLowerCase("en-US")),
8
+ value?.toLocaleLowerCase("en-US")
9
9
  );
10
10
  }
11
11
  return arrayHas(arr, value);
@@ -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,GAAI,CAAA,GAAA,CAAI,CAAK,CAAA,KAAA,CAAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,CAAA,CAAG,kBAAkB,OAAQ,CAAA,CAAA;AAAA,MAC1C,+BAAO,iBAAkB,CAAA,OAAA,CAAA;AAAA,KAC3B,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,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,12 +1,11 @@
1
1
  import { AZURE_DEVOPS_PROJECT_ANNOTATION, AZURE_DEVOPS_BUILD_DEFINITION_ANNOTATION, AZURE_DEVOPS_README_ANNOTATION, AZURE_DEVOPS_REPO_ANNOTATION, AZURE_DEVOPS_HOST_ORG_ANNOTATION } from '@backstage-community/plugin-azure-devops-common';
2
2
 
3
3
  function getAnnotationValuesFromEntity(entity) {
4
- var _a, _b, _c;
5
4
  const hostOrg = getHostOrg(entity.metadata.annotations);
6
5
  const projectRepo = getProjectRepo(entity.metadata.annotations);
7
- const project = (_a = entity.metadata.annotations) == null ? void 0 : _a[AZURE_DEVOPS_PROJECT_ANNOTATION];
8
- const definition = (_b = entity.metadata.annotations) == null ? void 0 : _b[AZURE_DEVOPS_BUILD_DEFINITION_ANNOTATION];
9
- const readmePath = (_c = entity.metadata.annotations) == null ? void 0 : _c[AZURE_DEVOPS_README_ANNOTATION];
6
+ const project = entity.metadata.annotations?.[AZURE_DEVOPS_PROJECT_ANNOTATION];
7
+ const definition = entity.metadata.annotations?.[AZURE_DEVOPS_BUILD_DEFINITION_ANNOTATION];
8
+ const readmePath = entity.metadata.annotations?.[AZURE_DEVOPS_README_ANNOTATION];
10
9
  if (definition) {
11
10
  if (project) {
12
11
  return {
@@ -46,7 +45,7 @@ function getAnnotationValuesFromEntity(entity) {
46
45
  throw new Error('Expected "dev.azure.com" annotations were not found');
47
46
  }
48
47
  function getProjectRepo(annotations) {
49
- const annotation = annotations == null ? void 0 : annotations[AZURE_DEVOPS_REPO_ANNOTATION];
48
+ const annotation = annotations?.[AZURE_DEVOPS_REPO_ANNOTATION];
50
49
  if (!annotation) {
51
50
  return { project: void 0, repo: void 0 };
52
51
  }
@@ -61,7 +60,7 @@ function getProjectRepo(annotations) {
61
60
  );
62
61
  }
63
62
  function getHostOrg(annotations) {
64
- const annotation = annotations == null ? void 0 : annotations[AZURE_DEVOPS_HOST_ORG_ANNOTATION];
63
+ const annotation = annotations?.[AZURE_DEVOPS_HOST_ORG_ANNOTATION];
65
64
  if (!annotation) {
66
65
  return { host: void 0, org: void 0 };
67
66
  }
@@ -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;AAhCF,EAAA,IAAA,EAAA,EAAA,EAAA,EAAA,EAAA,CAAA;AAiCE,EAAA,MAAM,OAAU,GAAA,UAAA,CAAW,MAAO,CAAA,QAAA,CAAS,WAAW,CAAA,CAAA;AACtD,EAAA,MAAM,WAAc,GAAA,cAAA,CAAe,MAAO,CAAA,QAAA,CAAS,WAAW,CAAA,CAAA;AAC9D,EAAA,MAAM,OACJ,GAAA,CAAA,EAAA,GAAA,MAAA,CAAO,QAAS,CAAA,WAAA,KAAhB,IAA8B,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,+BAAA,CAAA,CAAA;AAChC,EAAA,MAAM,UACJ,GAAA,CAAA,EAAA,GAAA,MAAA,CAAO,QAAS,CAAA,WAAA,KAAhB,IAA8B,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,wCAAA,CAAA,CAAA;AAChC,EAAA,MAAM,UACJ,GAAA,CAAA,EAAA,GAAA,MAAA,CAAO,QAAS,CAAA,WAAA,KAAhB,IAA8B,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,8BAAA,CAAA,CAAA;AAEhC,EAAA,IAAI,UAAY,EAAA;AACd,IAAA,IAAI,OAAS,EAA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F;;;;"}
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,UAAA,CAAW,MAAO,CAAA,QAAA,CAAS,WAAW,CAAA,CAAA;AACtD,EAAA,MAAM,WAAc,GAAA,cAAA,CAAe,MAAO,CAAA,QAAA,CAAS,WAAW,CAAA,CAAA;AAC9D,EAAA,MAAM,OACJ,GAAA,MAAA,CAAO,QAAS,CAAA,WAAA,GAAc,+BAA+B,CAAA,CAAA;AAC/D,EAAA,MAAM,UACJ,GAAA,MAAA,C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,KAAA;AAAA,IACR,CAAA,8BAAA,EAAiC,gCAAgC,CAAA,gEAAA,EAAmE,UAAU,CAAA,CAAA,CAAA;AAAA,GAChJ,CAAA;AACF;;;;"}
package/package.json CHANGED
@@ -1,8 +1,14 @@
1
1
  {
2
2
  "name": "@backstage-community/plugin-azure-devops",
3
- "version": "0.4.5",
3
+ "version": "0.4.8",
4
4
  "backstage": {
5
- "role": "frontend-plugin"
5
+ "role": "frontend-plugin",
6
+ "pluginId": "azure-devops",
7
+ "pluginPackages": [
8
+ "@backstage-community/plugin-azure-devops",
9
+ "@backstage-community/plugin-azure-devops-backend",
10
+ "@backstage-community/plugin-azure-devops-common"
11
+ ]
6
12
  },
7
13
  "publishConfig": {
8
14
  "access": "public"
@@ -44,15 +50,15 @@
44
50
  "test": "backstage-cli package test"
45
51
  },
46
52
  "dependencies": {
47
- "@backstage-community/plugin-azure-devops-common": "^0.4.3",
53
+ "@backstage-community/plugin-azure-devops-common": "^0.4.6",
48
54
  "@backstage/catalog-model": "^1.5.0",
49
- "@backstage/core-compat-api": "^0.2.5",
50
- "@backstage/core-components": "^0.14.7",
51
- "@backstage/core-plugin-api": "^1.9.2",
55
+ "@backstage/core-compat-api": "^0.2.7",
56
+ "@backstage/core-components": "^0.14.9",
57
+ "@backstage/core-plugin-api": "^1.9.3",
52
58
  "@backstage/errors": "^1.2.4",
53
- "@backstage/frontend-plugin-api": "^0.6.5",
54
- "@backstage/plugin-catalog-react": "^1.12.0",
55
- "@backstage/plugin-permission-react": "^0.4.22",
59
+ "@backstage/frontend-plugin-api": "^0.6.7",
60
+ "@backstage/plugin-catalog-react": "^1.12.2",
61
+ "@backstage/plugin-permission-react": "^0.4.24",
56
62
  "@material-ui/core": "^4.12.2",
57
63
  "@material-ui/icons": "^4.9.1",
58
64
  "@types/react": "^16.13.1 || ^17.0.0 || ^18.0.0",
@@ -61,9 +67,9 @@
61
67
  "react-use": "^17.2.4"
62
68
  },
63
69
  "devDependencies": {
64
- "@backstage/cli": "^0.26.6",
65
- "@backstage/dev-utils": "^1.0.32",
66
- "@backstage/test-utils": "^1.5.5",
70
+ "@backstage/cli": "^0.26.11",
71
+ "@backstage/dev-utils": "^1.0.35",
72
+ "@backstage/test-utils": "^1.5.8",
67
73
  "@testing-library/dom": "^10.0.0",
68
74
  "@testing-library/jest-dom": "^6.0.0",
69
75
  "@testing-library/react": "^15.0.0",