@backstage-community/plugin-azure-devops 0.22.0 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/README.md +34 -0
- package/dist/alpha/plugin.esm.js +22 -2
- package/dist/alpha/plugin.esm.js.map +1 -1
- package/dist/alpha.d.ts +31 -0
- package/dist/components/WikiArticleSearchResultListItem/WikiArticleSearchResultListItem.esm.js +69 -0
- package/dist/components/WikiArticleSearchResultListItem/WikiArticleSearchResultListItem.esm.js.map +1 -0
- package/dist/components/WikiArticleSearchResultListItem/index.esm.js +2 -0
- package/dist/components/WikiArticleSearchResultListItem/index.esm.js.map +1 -0
- package/dist/index.d.ts +21 -1
- package/dist/index.esm.js +1 -1
- package/dist/plugin.esm.js +11 -1
- package/dist/plugin.esm.js.map +1 -1
- package/package.json +3 -1
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -352,6 +352,40 @@ To get the README component working you'll need to do the following two steps:
|
|
|
352
352
|
- The `if` prop is optional on the `EntitySwitch.Case`, you can remove it if you always want to see the tab even if the entity being viewed does not have the needed annotation
|
|
353
353
|
- The `maxHeight` property on the `EntityAzureReadmeCard` will set the maximum screen size you would like to see, if not set it will default to 100%
|
|
354
354
|
|
|
355
|
+
## Search
|
|
356
|
+
|
|
357
|
+
First, make sure to setup Backstage Search with the [@backstage-community/plugin-search-backend-module-azure-devops](../search-backend-module-azure-devops/) plugin.
|
|
358
|
+
Afterwards, add the following code snippet to use `AzureDevOpsWikiArticleSearchResultListItem` when the type of the search results is `azure-devops-wiki-article`:
|
|
359
|
+
|
|
360
|
+
```tsx
|
|
361
|
+
// In packages/app/src/components/search/SearchPage.tsx
|
|
362
|
+
import LibraryBooksIcon from '@material-ui/icons/LibraryBooks';
|
|
363
|
+
import { AzureDevOpsWikiArticleSearchResultListItem } from '@backstage-community/plugin-azure-devops';
|
|
364
|
+
|
|
365
|
+
|
|
366
|
+
...
|
|
367
|
+
// Optional - Add type to side pane
|
|
368
|
+
<SearchType.Accordion
|
|
369
|
+
name="Result Type"
|
|
370
|
+
defaultValue="software-catalog"
|
|
371
|
+
types={[
|
|
372
|
+
...
|
|
373
|
+
{
|
|
374
|
+
value: 'azure-devops-wiki-article',
|
|
375
|
+
name: 'Azure DevOps Wiki',
|
|
376
|
+
icon: <LibraryBooksIcon />,
|
|
377
|
+
},
|
|
378
|
+
]}
|
|
379
|
+
/>
|
|
380
|
+
...
|
|
381
|
+
|
|
382
|
+
// In results
|
|
383
|
+
<SearchResult>
|
|
384
|
+
... other items ...
|
|
385
|
+
<AzureDevOpsWikiArticleSearchResultListItem icon={<LibraryBooksIcon />}/>
|
|
386
|
+
</SearchResult>
|
|
387
|
+
```
|
|
388
|
+
|
|
355
389
|
## Permission Framework
|
|
356
390
|
|
|
357
391
|
Azure DevOps plugin supports the permission framework for PRs, GitTags, Pipelines and Readme features. To use these permissions you'll need to add the `@backstage-community/plugin-azure-devops-common` to the same location as your [Permission Policy](https://backstage.io/docs/permissions/writing-a-policy). This example assumes that your Permission Policy lives in your `packages/backend`:
|
package/dist/alpha/plugin.esm.js
CHANGED
|
@@ -4,8 +4,10 @@ import { azureDevOpsApiRef } from '../api/AzureDevOpsApi.esm.js';
|
|
|
4
4
|
import { AzureDevOpsClient } from '../api/AzureDevOpsClient.esm.js';
|
|
5
5
|
import { convertLegacyRouteRef, compatWrapper } from '@backstage/core-compat-api';
|
|
6
6
|
import { EntityContentBlueprint, EntityCardBlueprint } from '@backstage/plugin-catalog-react/alpha';
|
|
7
|
+
import { SearchResultListItemBlueprint, SearchFilterResultTypeBlueprint } from '@backstage/plugin-search-react/alpha';
|
|
7
8
|
import { azurePullRequestDashboardRouteRef } from '../routes.esm.js';
|
|
8
9
|
import { isAzurePipelinesAvailable, isAzureDevOpsAvailable } from '../plugin.esm.js';
|
|
10
|
+
import LibraryBooksIcon from '@material-ui/icons/LibraryBooks';
|
|
9
11
|
|
|
10
12
|
const azureDevOpsApi = ApiBlueprint.make({
|
|
11
13
|
params: (defineParams) => defineParams({
|
|
@@ -70,6 +72,22 @@ const azureDevOpsReadmeEntityCard = EntityCardBlueprint.make({
|
|
|
70
72
|
)
|
|
71
73
|
}
|
|
72
74
|
});
|
|
75
|
+
const azureDevOpsWikiArticleSearchResultListItem = SearchResultListItemBlueprint.make({
|
|
76
|
+
params: {
|
|
77
|
+
predicate: (result) => result.type === "azure-devops-wiki-article",
|
|
78
|
+
component: () => import('../components/WikiArticleSearchResultListItem/index.esm.js').then(
|
|
79
|
+
(m) => m.WikiArticleSearchResultListItem
|
|
80
|
+
)
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
const azureDevOpsWikiArticleSearchFilterResultType = SearchFilterResultTypeBlueprint.make({
|
|
84
|
+
name: "azure-devops-wiki-article-results-type",
|
|
85
|
+
params: {
|
|
86
|
+
value: "azure-devops-wiki-article",
|
|
87
|
+
name: "Azure DevOps Wiki",
|
|
88
|
+
icon: /* @__PURE__ */ jsx(LibraryBooksIcon, {})
|
|
89
|
+
}
|
|
90
|
+
});
|
|
73
91
|
var plugin = createFrontendPlugin({
|
|
74
92
|
pluginId: "azure-devops",
|
|
75
93
|
extensions: [
|
|
@@ -78,9 +96,11 @@ var plugin = createFrontendPlugin({
|
|
|
78
96
|
azureDevOpsPipelinesEntityContent,
|
|
79
97
|
azureDevOpsGitTagsEntityContent,
|
|
80
98
|
azureDevOpsPullRequestsEntityContent,
|
|
81
|
-
azureDevOpsPullRequestPage
|
|
99
|
+
azureDevOpsPullRequestPage,
|
|
100
|
+
azureDevOpsWikiArticleSearchResultListItem,
|
|
101
|
+
azureDevOpsWikiArticleSearchFilterResultType
|
|
82
102
|
]
|
|
83
103
|
});
|
|
84
104
|
|
|
85
|
-
export { azureDevOpsApi, azureDevOpsGitTagsEntityContent, azureDevOpsPipelinesEntityContent, azureDevOpsPullRequestPage, azureDevOpsPullRequestsEntityContent, azureDevOpsReadmeEntityCard, plugin as default };
|
|
105
|
+
export { azureDevOpsApi, azureDevOpsGitTagsEntityContent, azureDevOpsPipelinesEntityContent, azureDevOpsPullRequestPage, azureDevOpsPullRequestsEntityContent, azureDevOpsReadmeEntityCard, azureDevOpsWikiArticleSearchResultListItem, plugin as default };
|
|
86
106
|
//# sourceMappingURL=plugin.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.esm.js","sources":["../../src/alpha/plugin.tsx"],"sourcesContent":["/*\n * Copyright 2023 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 ApiBlueprint,\n PageBlueprint,\n createFrontendPlugin,\n discoveryApiRef,\n fetchApiRef,\n} from '@backstage/frontend-plugin-api';\nimport { azureDevOpsApiRef, AzureDevOpsClient } from '../api';\nimport {\n compatWrapper,\n convertLegacyRouteRef,\n} from '@backstage/core-compat-api';\nimport {\n EntityCardBlueprint,\n EntityContentBlueprint,\n} from '@backstage/plugin-catalog-react/alpha';\nimport { azurePullRequestDashboardRouteRef } from '../routes';\nimport { isAzureDevOpsAvailable, isAzurePipelinesAvailable } from '../plugin';\n\n/** @alpha */\nexport const azureDevOpsApi = ApiBlueprint.make({\n params: defineParams =>\n defineParams({\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/** @alpha */\nexport const azureDevOpsPullRequestPage = PageBlueprint.make({\n params: {\n path: '/azure-pull-requests',\n routeRef: convertLegacyRouteRef(azurePullRequestDashboardRouteRef),\n loader: () =>\n import('../components/PullRequestsPage').then(m =>\n compatWrapper(<m.PullRequestsPage />),\n ),\n },\n});\n\n/** @alpha */\nexport const azureDevOpsPipelinesEntityContent = EntityContentBlueprint.make({\n name: 'pipelines',\n params: {\n path: '/pipelines',\n title: 'Pipelines',\n filter: isAzurePipelinesAvailable,\n loader: () =>\n import('../components/EntityPageAzurePipelines').then(m =>\n compatWrapper(<m.EntityPageAzurePipelines />),\n ),\n },\n});\n\n/** @alpha */\nexport const azureDevOpsGitTagsEntityContent = EntityContentBlueprint.make({\n name: 'git-tags',\n params: {\n path: '/git-tags',\n title: 'Git Tags',\n filter: isAzureDevOpsAvailable,\n loader: () =>\n import('../components/EntityPageAzureGitTags').then(m =>\n compatWrapper(<m.EntityPageAzureGitTags />),\n ),\n },\n});\n\n/** @alpha */\nexport const azureDevOpsPullRequestsEntityContent = EntityContentBlueprint.make(\n {\n name: 'pull-requests',\n params: {\n path: '/pull-requests',\n title: 'Pull Requests',\n filter: isAzureDevOpsAvailable,\n loader: () =>\n import('../components/EntityPageAzurePullRequests').then(m =>\n compatWrapper(<m.EntityPageAzurePullRequests />),\n ),\n },\n },\n);\n\n/** @alpha */\nexport const azureDevOpsReadmeEntityCard = EntityCardBlueprint.make({\n name: 'readme',\n params: {\n filter: isAzureDevOpsAvailable,\n loader: async () =>\n import('../components/ReadmeCard').then(m =>\n compatWrapper(<m.ReadmeCard />),\n ),\n },\n});\n\n/** @alpha */\nexport default createFrontendPlugin({\n pluginId: 'azure-devops',\n extensions: [\n azureDevOpsApi,\n azureDevOpsReadmeEntityCard,\n azureDevOpsPipelinesEntityContent,\n azureDevOpsGitTagsEntityContent,\n azureDevOpsPullRequestsEntityContent,\n azureDevOpsPullRequestPage,\n ],\n});\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin.esm.js","sources":["../../src/alpha/plugin.tsx"],"sourcesContent":["/*\n * Copyright 2023 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 ApiBlueprint,\n PageBlueprint,\n createFrontendPlugin,\n discoveryApiRef,\n fetchApiRef,\n} from '@backstage/frontend-plugin-api';\nimport { azureDevOpsApiRef, AzureDevOpsClient } from '../api';\nimport {\n compatWrapper,\n convertLegacyRouteRef,\n} from '@backstage/core-compat-api';\nimport {\n EntityCardBlueprint,\n EntityContentBlueprint,\n} from '@backstage/plugin-catalog-react/alpha';\nimport {\n SearchFilterResultTypeBlueprint,\n SearchResultListItemBlueprint,\n} from '@backstage/plugin-search-react/alpha';\nimport { azurePullRequestDashboardRouteRef } from '../routes';\nimport { isAzureDevOpsAvailable, isAzurePipelinesAvailable } from '../plugin';\nimport LibraryBooksIcon from '@material-ui/icons/LibraryBooks';\n\n/** @alpha */\nexport const azureDevOpsApi = ApiBlueprint.make({\n params: defineParams =>\n defineParams({\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/** @alpha */\nexport const azureDevOpsPullRequestPage = PageBlueprint.make({\n params: {\n path: '/azure-pull-requests',\n routeRef: convertLegacyRouteRef(azurePullRequestDashboardRouteRef),\n loader: () =>\n import('../components/PullRequestsPage').then(m =>\n compatWrapper(<m.PullRequestsPage />),\n ),\n },\n});\n\n/** @alpha */\nexport const azureDevOpsPipelinesEntityContent = EntityContentBlueprint.make({\n name: 'pipelines',\n params: {\n path: '/pipelines',\n title: 'Pipelines',\n filter: isAzurePipelinesAvailable,\n loader: () =>\n import('../components/EntityPageAzurePipelines').then(m =>\n compatWrapper(<m.EntityPageAzurePipelines />),\n ),\n },\n});\n\n/** @alpha */\nexport const azureDevOpsGitTagsEntityContent = EntityContentBlueprint.make({\n name: 'git-tags',\n params: {\n path: '/git-tags',\n title: 'Git Tags',\n filter: isAzureDevOpsAvailable,\n loader: () =>\n import('../components/EntityPageAzureGitTags').then(m =>\n compatWrapper(<m.EntityPageAzureGitTags />),\n ),\n },\n});\n\n/** @alpha */\nexport const azureDevOpsPullRequestsEntityContent = EntityContentBlueprint.make(\n {\n name: 'pull-requests',\n params: {\n path: '/pull-requests',\n title: 'Pull Requests',\n filter: isAzureDevOpsAvailable,\n loader: () =>\n import('../components/EntityPageAzurePullRequests').then(m =>\n compatWrapper(<m.EntityPageAzurePullRequests />),\n ),\n },\n },\n);\n\n/** @alpha */\nexport const azureDevOpsReadmeEntityCard = EntityCardBlueprint.make({\n name: 'readme',\n params: {\n filter: isAzureDevOpsAvailable,\n loader: async () =>\n import('../components/ReadmeCard').then(m =>\n compatWrapper(<m.ReadmeCard />),\n ),\n },\n});\n\nexport const azureDevOpsWikiArticleSearchResultListItem =\n SearchResultListItemBlueprint.make({\n params: {\n predicate: result => result.type === 'azure-devops-wiki-article',\n component: () =>\n import('../components/WikiArticleSearchResultListItem').then(\n m => m.WikiArticleSearchResultListItem,\n ),\n },\n });\n\nconst azureDevOpsWikiArticleSearchFilterResultType =\n SearchFilterResultTypeBlueprint.make({\n name: 'azure-devops-wiki-article-results-type',\n params: {\n value: 'azure-devops-wiki-article',\n name: 'Azure DevOps Wiki',\n icon: <LibraryBooksIcon />,\n },\n });\n\n/** @alpha */\nexport default createFrontendPlugin({\n pluginId: 'azure-devops',\n extensions: [\n azureDevOpsApi,\n azureDevOpsReadmeEntityCard,\n azureDevOpsPipelinesEntityContent,\n azureDevOpsGitTagsEntityContent,\n azureDevOpsPullRequestsEntityContent,\n azureDevOpsPullRequestPage,\n azureDevOpsWikiArticleSearchResultListItem,\n azureDevOpsWikiArticleSear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EAAA,2BAAA;AAAA,IACP,IAAM,EAAA,mBAAA;AAAA,IACN,IAAA,sBAAO,gBAAiB,EAAA,EAAA;AAAA;AAE5B,CAAC,CAAA;AAGH,aAAe,oBAAqB,CAAA;AAAA,EAClC,QAAU,EAAA,cAAA;AAAA,EACV,UAAY,EAAA;AAAA,IACV,cAAA;AAAA,IACA,2BAAA;AAAA,IACA,iCAAA;AAAA,IACA,+BAAA;AAAA,IACA,oCAAA;AAAA,IACA,0BAAA;AAAA,IACA,0CAAA;AAAA,IACA;AAAA;AAEJ,CAAC,CAAA;;;;"}
|
package/dist/alpha.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import * as _backstage_plugin_search_react_alpha from '@backstage/plugin-search-react/alpha';
|
|
2
3
|
import * as _backstage_catalog_model from '@backstage/catalog-model';
|
|
3
4
|
import * as _backstage_plugin_catalog_react_alpha from '@backstage/plugin-catalog-react/alpha';
|
|
4
5
|
import * as react from 'react';
|
|
@@ -174,6 +175,36 @@ declare const _default: _backstage_frontend_plugin_api.OverridableFrontendPlugin
|
|
|
174
175
|
routeRef?: _backstage_frontend_plugin_api.RouteRef<_backstage_frontend_plugin_api.AnyRouteRefParams> | undefined;
|
|
175
176
|
};
|
|
176
177
|
}>;
|
|
178
|
+
"search-filter-result-type:azure-devops/azure-devops-wiki-article-results-type": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
|
|
179
|
+
kind: "search-filter-result-type";
|
|
180
|
+
name: "azure-devops-wiki-article-results-type";
|
|
181
|
+
config: {};
|
|
182
|
+
configInput: {};
|
|
183
|
+
output: _backstage_frontend_plugin_api.ExtensionDataRef<{
|
|
184
|
+
value: string;
|
|
185
|
+
name: string;
|
|
186
|
+
icon: react.JSX.Element;
|
|
187
|
+
}, "search.filters.result-types.type", {}>;
|
|
188
|
+
inputs: {};
|
|
189
|
+
params: _backstage_plugin_search_react_alpha.SearchFilterResultTypeBlueprintParams;
|
|
190
|
+
}>;
|
|
191
|
+
"search-result-list-item:azure-devops": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
|
|
192
|
+
kind: "search-result-list-item";
|
|
193
|
+
name: undefined;
|
|
194
|
+
config: {
|
|
195
|
+
noTrack: boolean;
|
|
196
|
+
};
|
|
197
|
+
configInput: {
|
|
198
|
+
noTrack?: boolean | undefined;
|
|
199
|
+
};
|
|
200
|
+
output: _backstage_frontend_plugin_api.ExtensionDataRef<{
|
|
201
|
+
predicate?: _backstage_plugin_search_react_alpha.SearchResultItemExtensionPredicate | undefined;
|
|
202
|
+
component: _backstage_plugin_search_react_alpha.SearchResultItemExtensionComponent;
|
|
203
|
+
icon?: react.JSX.Element | undefined;
|
|
204
|
+
}, "search.search-result-list-item.item", {}>;
|
|
205
|
+
inputs: {};
|
|
206
|
+
params: _backstage_plugin_search_react_alpha.SearchResultListItemBlueprintParams;
|
|
207
|
+
}>;
|
|
177
208
|
}>;
|
|
178
209
|
|
|
179
210
|
export { _default as default };
|
package/dist/components/WikiArticleSearchResultListItem/WikiArticleSearchResultListItem.esm.js
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import ListItemIcon from '@material-ui/core/ListItemIcon';
|
|
3
|
+
import ListItemText from '@material-ui/core/ListItemText';
|
|
4
|
+
import { makeStyles } from '@material-ui/core/styles';
|
|
5
|
+
import Typography from '@material-ui/core/Typography';
|
|
6
|
+
import { Link } from '@backstage/core-components';
|
|
7
|
+
import { HighlightedSearchResultText } from '@backstage/plugin-search-react';
|
|
8
|
+
|
|
9
|
+
const useStyles = makeStyles({
|
|
10
|
+
item: {
|
|
11
|
+
display: "flex"
|
|
12
|
+
},
|
|
13
|
+
flexContainer: {
|
|
14
|
+
flexWrap: "wrap"
|
|
15
|
+
},
|
|
16
|
+
itemText: {
|
|
17
|
+
width: "100%",
|
|
18
|
+
wordBreak: "break-all",
|
|
19
|
+
marginBottom: "1rem"
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
function WikiArticleSearchResultListItem(props) {
|
|
23
|
+
const { lineClamp = 5, highlight, icon, result } = props;
|
|
24
|
+
const classes = useStyles();
|
|
25
|
+
if (!result) return null;
|
|
26
|
+
return /* @__PURE__ */ jsxs("div", { className: classes.item, children: [
|
|
27
|
+
icon && /* @__PURE__ */ jsx(ListItemIcon, { children: icon }),
|
|
28
|
+
/* @__PURE__ */ jsx("div", { className: classes.flexContainer, children: /* @__PURE__ */ jsx(
|
|
29
|
+
ListItemText,
|
|
30
|
+
{
|
|
31
|
+
className: classes.itemText,
|
|
32
|
+
primaryTypographyProps: { variant: "h6" },
|
|
33
|
+
primary: /* @__PURE__ */ jsx(Link, { noTrack: true, to: result.location, children: highlight?.fields.title ? /* @__PURE__ */ jsx(
|
|
34
|
+
HighlightedSearchResultText,
|
|
35
|
+
{
|
|
36
|
+
text: highlight?.fields.title || "",
|
|
37
|
+
preTag: highlight?.preTag || "",
|
|
38
|
+
postTag: highlight?.postTag || ""
|
|
39
|
+
}
|
|
40
|
+
) : result.title }),
|
|
41
|
+
secondary: /* @__PURE__ */ jsx(
|
|
42
|
+
Typography,
|
|
43
|
+
{
|
|
44
|
+
component: "span",
|
|
45
|
+
style: {
|
|
46
|
+
display: "-webkit-box",
|
|
47
|
+
WebkitBoxOrient: "vertical",
|
|
48
|
+
WebkitLineClamp: lineClamp,
|
|
49
|
+
overflow: "hidden"
|
|
50
|
+
},
|
|
51
|
+
color: "textSecondary",
|
|
52
|
+
variant: "body2",
|
|
53
|
+
children: highlight?.fields.text ? /* @__PURE__ */ jsx(
|
|
54
|
+
HighlightedSearchResultText,
|
|
55
|
+
{
|
|
56
|
+
text: highlight.fields.text,
|
|
57
|
+
preTag: highlight.preTag,
|
|
58
|
+
postTag: highlight.postTag
|
|
59
|
+
}
|
|
60
|
+
) : result.text
|
|
61
|
+
}
|
|
62
|
+
)
|
|
63
|
+
}
|
|
64
|
+
) })
|
|
65
|
+
] });
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export { WikiArticleSearchResultListItem };
|
|
69
|
+
//# sourceMappingURL=WikiArticleSearchResultListItem.esm.js.map
|
package/dist/components/WikiArticleSearchResultListItem/WikiArticleSearchResultListItem.esm.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WikiArticleSearchResultListItem.esm.js","sources":["../../../src/components/WikiArticleSearchResultListItem/WikiArticleSearchResultListItem.tsx"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ReactNode } from 'react';\nimport ListItemIcon from '@material-ui/core/ListItemIcon';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport { makeStyles } from '@material-ui/core/styles';\nimport Typography from '@material-ui/core/Typography';\nimport { Link } from '@backstage/core-components';\nimport {\n IndexableDocument,\n ResultHighlight,\n} from '@backstage/plugin-search-common';\nimport { HighlightedSearchResultText } from '@backstage/plugin-search-react';\n\nconst useStyles = makeStyles({\n item: {\n display: 'flex',\n },\n flexContainer: {\n flexWrap: 'wrap',\n },\n itemText: {\n width: '100%',\n wordBreak: 'break-all',\n marginBottom: '1rem',\n },\n});\n\n/**\n * @public\n */\nexport type WikiArticleSearchResultListItemProps = {\n lineClamp?: number;\n highlight?: ResultHighlight;\n icon?: ReactNode;\n rank?: number;\n result?: IndexableDocument;\n};\n\n/**\n * A component to display a Wiki Article search result.\n * @public\n */\nexport function WikiArticleSearchResultListItem(\n props: WikiArticleSearchResultListItemProps,\n) {\n const { lineClamp = 5, highlight, icon, result } = props;\n const classes = useStyles();\n\n if (!result) return null;\n\n return (\n <div className={classes.item}>\n {icon && <ListItemIcon>{icon}</ListItemIcon>}\n <div className={classes.flexContainer}>\n <ListItemText\n className={classes.itemText}\n primaryTypographyProps={{ variant: 'h6' }}\n primary={\n <Link noTrack to={result.location}>\n {highlight?.fields.title ? (\n <HighlightedSearchResultText\n text={highlight?.fields.title || ''}\n preTag={highlight?.preTag || ''}\n postTag={highlight?.postTag || ''}\n />\n ) : (\n result.title\n )}\n </Link>\n }\n secondary={\n <Typography\n component=\"span\"\n style={{\n display: '-webkit-box',\n WebkitBoxOrient: 'vertical',\n WebkitLineClamp: lineClamp,\n overflow: 'hidden',\n }}\n color=\"textSecondary\"\n variant=\"body2\"\n >\n {highlight?.fields.text ? (\n <HighlightedSearchResultText\n text={highlight.fields.text}\n preTag={highlight.preTag}\n postTag={highlight.postTag}\n />\n ) : (\n result.text\n )}\n </Typography>\n }\n />\n </div>\n </div>\n );\n}\n"],"names":[],"mappings":";;;;;;;;AA4BA,MAAM,YAAY,UAAW,CAAA;AAAA,EAC3B,IAAM,EAAA;AAAA,IACJ,OAAS,EAAA;AAAA,GACX;AAAA,EACA,aAAe,EAAA;AAAA,IACb,QAAU,EAAA;AAAA,GACZ;AAAA,EACA,QAAU,EAAA;AAAA,IACR,KAAO,EAAA,MAAA;AAAA,IACP,SAAW,EAAA,WAAA;AAAA,IACX,YAAc,EAAA;AAAA;AAElB,CAAC,CAAA;AAiBM,SAAS,gCACd,KACA,EAAA;AACA,EAAA,MAAM,EAAE,SAAY,GAAA,CAAA,EAAG,SAAW,EAAA,IAAA,EAAM,QAAW,GAAA,KAAA;AACnD,EAAA,MAAM,UAAU,SAAU,EAAA;AAE1B,EAAI,IAAA,CAAC,QAAe,OAAA,IAAA;AAEpB,EAAA,uBACG,IAAA,CAAA,KAAA,EAAA,EAAI,SAAW,EAAA,OAAA,CAAQ,IACrB,EAAA,QAAA,EAAA;AAAA,IAAQ,IAAA,oBAAA,GAAA,CAAC,gBAAc,QAA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,GACF,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
3
|
import { DashboardPullRequest, GitTag, PullRequestOptions, PullRequest, Team, BuildRunOptions, BuildRun, ReadmeConfig, Readme } from '@backstage-community/plugin-azure-devops-common';
|
|
3
4
|
import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
|
|
4
5
|
import { DiscoveryApi, FetchApi } from '@backstage/core-plugin-api';
|
|
5
6
|
import { Entity } from '@backstage/catalog-model';
|
|
7
|
+
import { ReactNode } from 'react';
|
|
8
|
+
import { ResultHighlight, IndexableDocument } from '@backstage/plugin-search-common';
|
|
6
9
|
import { SvgIconProps } from '@material-ui/core/SvgIcon';
|
|
7
10
|
|
|
8
11
|
/** @public */
|
|
@@ -95,6 +98,17 @@ interface PullRequestColumnConfig {
|
|
|
95
98
|
simplified?: boolean;
|
|
96
99
|
}
|
|
97
100
|
|
|
101
|
+
/**
|
|
102
|
+
* @public
|
|
103
|
+
*/
|
|
104
|
+
type WikiArticleSearchResultListItemProps = {
|
|
105
|
+
lineClamp?: number;
|
|
106
|
+
highlight?: ResultHighlight;
|
|
107
|
+
icon?: ReactNode;
|
|
108
|
+
rank?: number;
|
|
109
|
+
result?: IndexableDocument;
|
|
110
|
+
};
|
|
111
|
+
|
|
98
112
|
/** @public */
|
|
99
113
|
declare const isAzureDevOpsAvailable: (entity: Entity) => boolean;
|
|
100
114
|
/** @public */
|
|
@@ -122,6 +136,12 @@ declare const EntityAzurePullRequestsContent: (props: {
|
|
|
122
136
|
declare const EntityAzureReadmeCard: (props: {
|
|
123
137
|
maxHeight?: number | undefined;
|
|
124
138
|
}) => react_jsx_runtime.JSX.Element;
|
|
139
|
+
/**
|
|
140
|
+
* React extension used to render results on Search page or modal
|
|
141
|
+
*
|
|
142
|
+
* @public
|
|
143
|
+
*/
|
|
144
|
+
declare const AzureDevOpsWikiArticleSearchResultListItem: (props: WikiArticleSearchResultListItemProps) => React.JSX.Element | null;
|
|
125
145
|
|
|
126
146
|
/** @public */
|
|
127
147
|
declare const AzurePullRequestsIcon: (props: SvgIconProps) => react_jsx_runtime.JSX.Element;
|
|
@@ -175,4 +195,4 @@ declare class AzureDevOpsClient implements AzureDevOpsApi {
|
|
|
175
195
|
private get;
|
|
176
196
|
}
|
|
177
197
|
|
|
178
|
-
export { type AllFilter, type AssignedToTeamFilter, type AssignedToTeamsFilter, type AssignedToUserFilter, type AzureDevOpsApi, AzureDevOpsClient, AzurePullRequestsIcon, AzurePullRequestsPage, type BaseFilter, type CreatedByTeamFilter, type CreatedByTeamsFilter, type CreatedByUserFilter, EntityAzureGitTagsContent, EntityAzurePipelinesContent, EntityAzurePullRequestsContent, EntityAzureReadmeCard, type Filter, FilterType, type PullRequestColumnConfig, type PullRequestFilter, azureDevOpsApiRef, azureDevOpsPlugin, isAzureDevOpsAvailable, isAzurePipelinesAvailable };
|
|
198
|
+
export { type AllFilter, type AssignedToTeamFilter, type AssignedToTeamsFilter, type AssignedToUserFilter, type AzureDevOpsApi, AzureDevOpsClient, AzureDevOpsWikiArticleSearchResultListItem, AzurePullRequestsIcon, AzurePullRequestsPage, type BaseFilter, type CreatedByTeamFilter, type CreatedByTeamsFilter, type CreatedByUserFilter, EntityAzureGitTagsContent, EntityAzurePipelinesContent, EntityAzurePullRequestsContent, EntityAzureReadmeCard, type Filter, FilterType, type PullRequestColumnConfig, type PullRequestFilter, type WikiArticleSearchResultListItemProps, azureDevOpsApiRef, azureDevOpsPlugin, isAzureDevOpsAvailable, isAzurePipelinesAvailable };
|
package/dist/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { AzurePullRequestsPage, EntityAzureGitTagsContent, EntityAzurePipelinesContent, EntityAzurePullRequestsContent, EntityAzureReadmeCard, azureDevOpsPlugin, isAzureDevOpsAvailable, isAzurePipelinesAvailable } from './plugin.esm.js';
|
|
1
|
+
export { AzureDevOpsWikiArticleSearchResultListItem, AzurePullRequestsPage, EntityAzureGitTagsContent, EntityAzurePipelinesContent, EntityAzurePullRequestsContent, EntityAzureReadmeCard, azureDevOpsPlugin, isAzureDevOpsAvailable, isAzurePipelinesAvailable } from './plugin.esm.js';
|
|
2
2
|
export { AzurePullRequestsIcon } from './components/AzurePullRequestsIcon/AzurePullRequestsIcon.esm.js';
|
|
3
3
|
export { azureDevOpsApiRef } from './api/AzureDevOpsApi.esm.js';
|
|
4
4
|
export { AzureDevOpsClient } from './api/AzureDevOpsClient.esm.js';
|
package/dist/plugin.esm.js
CHANGED
|
@@ -3,6 +3,7 @@ import { createPlugin, createApiFactory, discoveryApiRef, fetchApiRef, createRou
|
|
|
3
3
|
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
|
+
import { createSearchResultListItemExtension } from '@backstage/plugin-search-react';
|
|
6
7
|
|
|
7
8
|
const isAzureDevOpsAvailable = (entity) => Boolean(entity.metadata.annotations?.[AZURE_DEVOPS_REPO_ANNOTATION]);
|
|
8
9
|
const isAzurePipelinesAvailable = (entity) => Boolean(entity.metadata.annotations?.[AZURE_DEVOPS_REPO_ANNOTATION]) || Boolean(entity.metadata.annotations?.[AZURE_DEVOPS_PROJECT_ANNOTATION]) && Boolean(
|
|
@@ -63,6 +64,15 @@ const EntityAzureReadmeCard = azureDevOpsPlugin.provide(
|
|
|
63
64
|
}
|
|
64
65
|
})
|
|
65
66
|
);
|
|
67
|
+
const AzureDevOpsWikiArticleSearchResultListItem = azureDevOpsPlugin.provide(
|
|
68
|
+
createSearchResultListItemExtension({
|
|
69
|
+
name: "WikiArticleSearchResultListItem",
|
|
70
|
+
component: () => import('./components/WikiArticleSearchResultListItem/index.esm.js').then(
|
|
71
|
+
(m) => m.WikiArticleSearchResultListItem
|
|
72
|
+
),
|
|
73
|
+
predicate: (result) => result.type === "adr"
|
|
74
|
+
})
|
|
75
|
+
);
|
|
66
76
|
|
|
67
|
-
export { AzurePullRequestsPage, EntityAzureGitTagsContent, EntityAzurePipelinesContent, EntityAzurePullRequestsContent, EntityAzureReadmeCard, azureDevOpsPlugin, isAzureDevOpsAvailable, isAzurePipelinesAvailable };
|
|
77
|
+
export { AzureDevOpsWikiArticleSearchResultListItem, AzurePullRequestsPage, EntityAzureGitTagsContent, EntityAzurePipelinesContent, EntityAzurePullRequestsContent, EntityAzureReadmeCard, azureDevOpsPlugin, isAzureDevOpsAvailable, isAzurePipelinesAvailable };
|
|
68
78
|
//# sourceMappingURL=plugin.esm.js.map
|
package/dist/plugin.esm.js.map
CHANGED
|
@@ -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":"
|
|
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';\nimport { createSearchResultListItemExtension } from '@backstage/plugin-search-react';\nimport { WikiArticleSearchResultListItemProps } from './components/WikiArticleSearchResultListItem';\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\n/**\n * React extension used to render results on Search page or modal\n *\n * @public\n */\nexport const AzureDevOpsWikiArticleSearchResultListItem: (\n props: WikiArticleSearchResultListItemProps,\n) => React.JSX.Element | null = azureDevOpsPlugin.provide(\n createSearchResultListItemExtension({\n name: 'WikiArticleSearchResultListItem',\n component: () =>\n import('./components/WikiArticleSearchResultListItem').then(\n m => m.WikiArticleSearchResultListItem,\n ),\n predicate: result => result.type === 'adr',\n }),\n);\n"],"names":[],"mappings":";;;;;;;AA2Ca,MAAA,sBAAA,GAAyB,CAAC,MACrC,KAAA,OAAA,CAAQ,OAAO,QAAS,CAAA,WAAA,GAAc,4BAA4B,CAAC;AAG9D,MAAM,4BAA4B,CAAC,MAAA,KACxC,OAAQ,CAAA,MAAA,CAAO,SAAS,WAAc,GAAA,4BAA4B,CAAC,CAAA,IAClE,QAAQ,MAAO,CAAA,QAAA,CAAS,WAAc,GAAA,+BAA+B,CAAC,CACrE,IAAA,OAAA;AAAA,EACE,MAAA,CAAO,QAAS,CAAA,WAAA,GAAc,wCAAwC;AACxE;AAGG,MAAM,oBAAoB,YAAa,CAAA;AAAA,EAC5C,EAAI,EAAA,aAAA;AAAA,EACJ,IAAM,EAAA;AAAA,IACJ,gBAAiB,CAAA;AAAA,MACf,GAAK,EAAA,iBAAA;AAAA,MACL,IAAM,EAAA;AAAA,QACJ,YAAc,EAAA,eAAA;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AA;AAAA,IACN,SAAW,EAAA;AAAA,MACT,IAAA,EAAM,MAAM,OAAO,sCAAyB,EAAE,IAAK,CAAA,CAAA,CAAA,KAAK,EAAE,UAAU;AAAA;AACtE,GACD;AACH;AAOO,MAAM,6CAEmB,iBAAkB,CAAA,OAAA;AAAA,EAChD,mCAAoC,CAAA;AAAA,IAClC,IAAM,EAAA,iCAAA;AAAA,IACN,SAAW,EAAA,MACT,OAAO,2DAA8C,CAAE,CAAA,IAAA;AAAA,MACrD,OAAK,CAAE,CAAA;AAAA,KACT;AAAA,IACF,SAAA,EAAW,CAAU,MAAA,KAAA,MAAA,CAAO,IAAS,KAAA;AAAA,GACtC;AACH;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage-community/plugin-azure-devops",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.23.0",
|
|
4
4
|
"backstage": {
|
|
5
5
|
"role": "frontend-plugin",
|
|
6
6
|
"pluginId": "azure-devops",
|
|
@@ -72,6 +72,8 @@
|
|
|
72
72
|
"@backstage/frontend-plugin-api": "^0.13.1",
|
|
73
73
|
"@backstage/plugin-catalog-react": "^1.21.3",
|
|
74
74
|
"@backstage/plugin-permission-react": "^0.4.38",
|
|
75
|
+
"@backstage/plugin-search-common": "^1.2.21",
|
|
76
|
+
"@backstage/plugin-search-react": "^1.10.0",
|
|
75
77
|
"@material-ui/core": "^4.12.2",
|
|
76
78
|
"@material-ui/icons": "^4.9.1",
|
|
77
79
|
"@types/react": "^16.13.1 || ^17.0.0 || ^18.0.0",
|