@backstage/plugin-search 1.4.0 → 1.4.1-next.1
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 +36 -0
- package/alpha/package.json +7 -0
- package/dist/alpha.d.ts +17 -0
- package/dist/alpha.esm.js +160 -0
- package/dist/alpha.esm.js.map +1 -0
- package/dist/esm/{index-625b4401.esm.js → SearchType-93364f77.esm.js} +10 -222
- package/dist/esm/SearchType-93364f77.esm.js.map +1 -0
- package/dist/esm/index-64b2be7b.esm.js +14 -0
- package/dist/esm/index-64b2be7b.esm.js.map +1 -0
- package/dist/esm/index-7b5db6ad.esm.js +222 -0
- package/dist/esm/index-7b5db6ad.esm.js.map +1 -0
- package/dist/esm/{index-ec7f140c.esm.js → index-85bc4887.esm.js} +5 -4
- package/dist/esm/{index-ec7f140c.esm.js.map → index-85bc4887.esm.js.map} +1 -1
- package/dist/esm/{index-3c2238df.esm.js → index-e4d4ee69.esm.js} +5 -4
- package/dist/esm/{index-3c2238df.esm.js.map → index-e4d4ee69.esm.js.map} +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.esm.js +4 -3
- package/dist/index.esm.js.map +1 -1
- package/package.json +28 -15
- package/dist/esm/index-14e72004.esm.js +0 -23
- package/dist/esm/index-14e72004.esm.js.map +0 -1
- package/dist/esm/index-625b4401.esm.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,41 @@
|
|
|
1
1
|
# @backstage/plugin-search
|
|
2
2
|
|
|
3
|
+
## 1.4.1-next.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- e5a2956dd2: Create an experimental search plugin that is compatible with the declarative integration system, it is exported from `/alpha` subpath.
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @backstage/frontend-plugin-api@0.1.1-next.1
|
|
10
|
+
- @backstage/core-components@0.13.6-next.1
|
|
11
|
+
- @backstage/plugin-search-react@1.7.1-next.1
|
|
12
|
+
- @backstage/plugin-catalog-react@1.8.5-next.1
|
|
13
|
+
- @backstage/core-plugin-api@1.7.0-next.0
|
|
14
|
+
- @backstage/config@1.1.0
|
|
15
|
+
- @backstage/catalog-model@1.4.2
|
|
16
|
+
- @backstage/errors@1.2.2
|
|
17
|
+
- @backstage/theme@0.4.2
|
|
18
|
+
- @backstage/types@1.1.1
|
|
19
|
+
- @backstage/version-bridge@1.0.5
|
|
20
|
+
- @backstage/plugin-search-common@1.2.6
|
|
21
|
+
|
|
22
|
+
## 1.4.1-next.0
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- Updated dependencies
|
|
27
|
+
- @backstage/plugin-catalog-react@1.8.5-next.0
|
|
28
|
+
- @backstage/core-plugin-api@1.7.0-next.0
|
|
29
|
+
- @backstage/core-components@0.13.6-next.0
|
|
30
|
+
- @backstage/config@1.1.0
|
|
31
|
+
- @backstage/plugin-search-react@1.7.1-next.0
|
|
32
|
+
- @backstage/catalog-model@1.4.2
|
|
33
|
+
- @backstage/errors@1.2.2
|
|
34
|
+
- @backstage/theme@0.4.2
|
|
35
|
+
- @backstage/types@1.1.1
|
|
36
|
+
- @backstage/version-bridge@1.0.5
|
|
37
|
+
- @backstage/plugin-search-common@1.2.6
|
|
38
|
+
|
|
3
39
|
## 1.4.0
|
|
4
40
|
|
|
5
41
|
### Minor Changes
|
package/dist/alpha.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as _backstage_frontend_plugin_api from '@backstage/frontend-plugin-api';
|
|
2
|
+
|
|
3
|
+
/** @alpha */
|
|
4
|
+
declare const SearchApi: _backstage_frontend_plugin_api.Extension<{}>;
|
|
5
|
+
/** @alpha */
|
|
6
|
+
declare const SearchPage: _backstage_frontend_plugin_api.Extension<{
|
|
7
|
+
path: string;
|
|
8
|
+
noTrack: boolean;
|
|
9
|
+
}>;
|
|
10
|
+
/** @alpha */
|
|
11
|
+
declare const SearchNavItem: _backstage_frontend_plugin_api.Extension<{
|
|
12
|
+
title: string;
|
|
13
|
+
}>;
|
|
14
|
+
/** @alpha */
|
|
15
|
+
declare const _default: _backstage_frontend_plugin_api.BackstagePlugin;
|
|
16
|
+
|
|
17
|
+
export { SearchApi, SearchNavItem, SearchPage, _default as default };
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { makeStyles, Grid, Paper } from '@material-ui/core';
|
|
3
|
+
import SearchIcon from '@material-ui/icons/Search';
|
|
4
|
+
import { useSidebarPinState, Page, Header, Content, CatalogIcon, DocsIcon } from '@backstage/core-components';
|
|
5
|
+
import { discoveryApiRef, identityApiRef, createRouteRef, useApi } from '@backstage/core-plugin-api';
|
|
6
|
+
import { createApiExtension, createPageExtension, createSchemaFromZod, createExtensionInput, createNavItemExtension, createPlugin } from '@backstage/frontend-plugin-api';
|
|
7
|
+
import { catalogApiRef, CATALOG_FILTER_EXISTS } from '@backstage/plugin-catalog-react';
|
|
8
|
+
import { searchApiRef, SearchContextProvider, useSearch, SearchBar, SearchFilter, SearchPagination, SearchResult, SearchResultPager, DefaultResultListItem } from '@backstage/plugin-search-react';
|
|
9
|
+
import { searchResultItemExtensionData } from '@backstage/plugin-search-react/alpha';
|
|
10
|
+
import { S as SearchClient, U as UrlUpdater, b as SearchType } from './esm/SearchType-93364f77.esm.js';
|
|
11
|
+
import '@backstage/errors';
|
|
12
|
+
import 'qs';
|
|
13
|
+
import 'react-use/lib/usePrevious';
|
|
14
|
+
import 'react-router-dom';
|
|
15
|
+
import 'react-use/lib/useEffectOnce';
|
|
16
|
+
import '@material-ui/icons/ExpandMore';
|
|
17
|
+
import '@material-ui/icons/FontDownload';
|
|
18
|
+
import 'react-use/lib/useAsync';
|
|
19
|
+
|
|
20
|
+
const SearchApi = createApiExtension({
|
|
21
|
+
factory: {
|
|
22
|
+
api: searchApiRef,
|
|
23
|
+
deps: { discoveryApi: discoveryApiRef, identityApi: identityApiRef },
|
|
24
|
+
factory: ({
|
|
25
|
+
identityApi,
|
|
26
|
+
discoveryApi
|
|
27
|
+
}) => new SearchClient({ discoveryApi, identityApi })
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
const useSearchPageStyles = makeStyles((theme) => ({
|
|
31
|
+
filter: {
|
|
32
|
+
"& + &": {
|
|
33
|
+
marginTop: theme.spacing(2.5)
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
filters: {
|
|
37
|
+
padding: theme.spacing(2),
|
|
38
|
+
marginTop: theme.spacing(2)
|
|
39
|
+
}
|
|
40
|
+
}));
|
|
41
|
+
const searchRouteRef = createRouteRef({ id: "plugin.search.page" });
|
|
42
|
+
const SearchPage = createPageExtension({
|
|
43
|
+
id: "plugin.search.page",
|
|
44
|
+
routeRef: searchRouteRef,
|
|
45
|
+
configSchema: createSchemaFromZod(
|
|
46
|
+
(z) => z.object({
|
|
47
|
+
path: z.string().default("/search"),
|
|
48
|
+
noTrack: z.boolean().default(false)
|
|
49
|
+
})
|
|
50
|
+
),
|
|
51
|
+
inputs: {
|
|
52
|
+
items: createExtensionInput({
|
|
53
|
+
item: searchResultItemExtensionData
|
|
54
|
+
})
|
|
55
|
+
},
|
|
56
|
+
loader: async ({ config, inputs }) => {
|
|
57
|
+
const getResultItemComponent = (result) => {
|
|
58
|
+
var _a;
|
|
59
|
+
const value = inputs.items.find(({ item }) => {
|
|
60
|
+
var _a2;
|
|
61
|
+
return (_a2 = item == null ? void 0 : item.predicate) == null ? void 0 : _a2.call(item, result);
|
|
62
|
+
});
|
|
63
|
+
return (_a = value == null ? void 0 : value.item.component) != null ? _a : DefaultResultListItem;
|
|
64
|
+
};
|
|
65
|
+
const Component = () => {
|
|
66
|
+
const classes = useSearchPageStyles();
|
|
67
|
+
const { isMobile } = useSidebarPinState();
|
|
68
|
+
const { types } = useSearch();
|
|
69
|
+
const catalogApi = useApi(catalogApiRef);
|
|
70
|
+
return /* @__PURE__ */ React.createElement(Page, { themeId: "home" }, !isMobile && /* @__PURE__ */ React.createElement(Header, { title: "Search" }), /* @__PURE__ */ React.createElement(Content, null, /* @__PURE__ */ React.createElement(Grid, { container: true, direction: "row" }, /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(SearchBar, { debounceTime: 100 })), !isMobile && /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 3 }, /* @__PURE__ */ React.createElement(
|
|
71
|
+
SearchType.Accordion,
|
|
72
|
+
{
|
|
73
|
+
name: "Result Type",
|
|
74
|
+
defaultValue: "software-catalog",
|
|
75
|
+
showCounts: true,
|
|
76
|
+
types: [
|
|
77
|
+
{
|
|
78
|
+
value: "software-catalog",
|
|
79
|
+
name: "Software Catalog",
|
|
80
|
+
icon: /* @__PURE__ */ React.createElement(CatalogIcon, null)
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
value: "techdocs",
|
|
84
|
+
name: "Documentation",
|
|
85
|
+
icon: /* @__PURE__ */ React.createElement(DocsIcon, null)
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
value: "adr",
|
|
89
|
+
name: "Architecture Decision Records",
|
|
90
|
+
icon: /* @__PURE__ */ React.createElement(DocsIcon, null)
|
|
91
|
+
}
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
), /* @__PURE__ */ React.createElement(Paper, { className: classes.filters }, types.includes("techdocs") && /* @__PURE__ */ React.createElement(
|
|
95
|
+
SearchFilter.Select,
|
|
96
|
+
{
|
|
97
|
+
className: classes.filter,
|
|
98
|
+
label: "Entity",
|
|
99
|
+
name: "name",
|
|
100
|
+
values: async () => {
|
|
101
|
+
const { items } = await catalogApi.getEntities({
|
|
102
|
+
fields: ["metadata.name"],
|
|
103
|
+
filter: {
|
|
104
|
+
"metadata.annotations.backstage.io/techdocs-ref": CATALOG_FILTER_EXISTS
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
const names = items.map(
|
|
108
|
+
(entity) => entity.metadata.name
|
|
109
|
+
);
|
|
110
|
+
names.sort();
|
|
111
|
+
return names;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
), /* @__PURE__ */ React.createElement(
|
|
115
|
+
SearchFilter.Select,
|
|
116
|
+
{
|
|
117
|
+
className: classes.filter,
|
|
118
|
+
label: "Kind",
|
|
119
|
+
name: "kind",
|
|
120
|
+
values: ["Component", "Template"]
|
|
121
|
+
}
|
|
122
|
+
), /* @__PURE__ */ React.createElement(
|
|
123
|
+
SearchFilter.Checkbox,
|
|
124
|
+
{
|
|
125
|
+
className: classes.filter,
|
|
126
|
+
label: "Lifecycle",
|
|
127
|
+
name: "lifecycle",
|
|
128
|
+
values: ["experimental", "production"]
|
|
129
|
+
}
|
|
130
|
+
))), /* @__PURE__ */ React.createElement(Grid, { item: true, xs: true }, /* @__PURE__ */ React.createElement(SearchPagination, null), /* @__PURE__ */ React.createElement(SearchResult, null, ({ results }) => results.map((result, index) => {
|
|
131
|
+
const { noTrack } = config;
|
|
132
|
+
const { document, ...rest } = result;
|
|
133
|
+
const SearchResultListItem = getResultItemComponent(result);
|
|
134
|
+
return /* @__PURE__ */ React.createElement(
|
|
135
|
+
SearchResultListItem,
|
|
136
|
+
{
|
|
137
|
+
...rest,
|
|
138
|
+
key: index,
|
|
139
|
+
result: document,
|
|
140
|
+
noTrack
|
|
141
|
+
}
|
|
142
|
+
);
|
|
143
|
+
})), /* @__PURE__ */ React.createElement(SearchResultPager, null)))));
|
|
144
|
+
};
|
|
145
|
+
return /* @__PURE__ */ React.createElement(SearchContextProvider, null, /* @__PURE__ */ React.createElement(UrlUpdater, null), /* @__PURE__ */ React.createElement(Component, null));
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
const SearchNavItem = createNavItemExtension({
|
|
149
|
+
id: "plugin.search.nav.index",
|
|
150
|
+
routeRef: searchRouteRef,
|
|
151
|
+
title: "Search",
|
|
152
|
+
icon: SearchIcon
|
|
153
|
+
});
|
|
154
|
+
var alpha = createPlugin({
|
|
155
|
+
id: "plugin.search",
|
|
156
|
+
extensions: [SearchApi, SearchPage, SearchNavItem]
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
export { SearchApi, SearchNavItem, SearchPage, alpha as default };
|
|
160
|
+
//# sourceMappingURL=alpha.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alpha.esm.js","sources":["../src/alpha.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 React from 'react';\n\nimport { makeStyles, Theme, Grid, Paper } from '@material-ui/core';\nimport SearchIcon from '@material-ui/icons/Search';\n\nimport {\n CatalogIcon,\n Content,\n DocsIcon,\n Header,\n Page,\n useSidebarPinState,\n} from '@backstage/core-components';\nimport {\n createRouteRef,\n useApi,\n DiscoveryApi,\n IdentityApi,\n discoveryApiRef,\n identityApiRef,\n} from '@backstage/core-plugin-api';\n\nimport {\n createPlugin,\n createApiExtension,\n createPageExtension,\n createExtensionInput,\n createNavItemExtension,\n createSchemaFromZod,\n} from '@backstage/frontend-plugin-api';\n\nimport {\n catalogApiRef,\n CATALOG_FILTER_EXISTS,\n} from '@backstage/plugin-catalog-react';\n\nimport {\n DefaultResultListItem,\n SearchBar,\n SearchFilter,\n SearchPagination,\n SearchResult as SearchResults,\n SearchResultPager,\n useSearch,\n SearchContextProvider,\n} from '@backstage/plugin-search-react';\nimport { SearchResult } from '@backstage/plugin-search-common';\nimport { searchApiRef } from '@backstage/plugin-search-react';\nimport { searchResultItemExtensionData } from '@backstage/plugin-search-react/alpha';\n\nimport { SearchClient } from './apis';\nimport { SearchType } from './components/SearchType';\nimport { UrlUpdater } from './components/SearchPage/SearchPage';\n\n/** @alpha */\nexport const SearchApi = createApiExtension({\n factory: {\n api: searchApiRef,\n deps: { discoveryApi: discoveryApiRef, identityApi: identityApiRef },\n factory: ({\n identityApi,\n discoveryApi,\n }: {\n identityApi: IdentityApi;\n discoveryApi: DiscoveryApi;\n }) => new SearchClient({ discoveryApi, identityApi }),\n },\n});\n\nconst useSearchPageStyles = makeStyles((theme: Theme) => ({\n filter: {\n '& + &': {\n marginTop: theme.spacing(2.5),\n },\n },\n filters: {\n padding: theme.spacing(2),\n marginTop: theme.spacing(2),\n },\n}));\n\nconst searchRouteRef = createRouteRef({ id: 'plugin.search.page' });\n\n/** @alpha */\nexport const SearchPage = createPageExtension({\n id: 'plugin.search.page',\n routeRef: searchRouteRef,\n configSchema: createSchemaFromZod(z =>\n z.object({\n path: z.string().default('/search'),\n noTrack: z.boolean().default(false),\n }),\n ),\n inputs: {\n items: createExtensionInput({\n item: searchResultItemExtensionData,\n }),\n },\n loader: async ({ config, inputs }) => {\n const getResultItemComponent = (result: SearchResult) => {\n const value = inputs.items.find(({ item }) => item?.predicate?.(result));\n return value?.item.component ?? DefaultResultListItem;\n };\n\n const Component = () => {\n const classes = useSearchPageStyles();\n const { isMobile } = useSidebarPinState();\n const { types } = useSearch();\n const catalogApi = useApi(catalogApiRef);\n\n return (\n <Page themeId=\"home\">\n {!isMobile && <Header title=\"Search\" />}\n <Content>\n <Grid container direction=\"row\">\n <Grid item xs={12}>\n <SearchBar debounceTime={100} />\n </Grid>\n {!isMobile && (\n <Grid item xs={3}>\n <SearchType.Accordion\n name=\"Result Type\"\n defaultValue=\"software-catalog\"\n showCounts\n types={[\n {\n value: 'software-catalog',\n name: 'Software Catalog',\n icon: <CatalogIcon />,\n },\n {\n value: 'techdocs',\n name: 'Documentation',\n icon: <DocsIcon />,\n },\n {\n value: 'adr',\n name: 'Architecture Decision Records',\n icon: <DocsIcon />,\n },\n ]}\n />\n <Paper className={classes.filters}>\n {types.includes('techdocs') && (\n <SearchFilter.Select\n className={classes.filter}\n label=\"Entity\"\n name=\"name\"\n values={async () => {\n // Return a list of entities which are documented.\n const { items } = await catalogApi.getEntities({\n fields: ['metadata.name'],\n filter: {\n 'metadata.annotations.backstage.io/techdocs-ref':\n CATALOG_FILTER_EXISTS,\n },\n });\n\n const names = items.map(\n entity => entity.metadata.name,\n );\n names.sort();\n return names;\n }}\n />\n )}\n <SearchFilter.Select\n className={classes.filter}\n label=\"Kind\"\n name=\"kind\"\n values={['Component', 'Template']}\n />\n <SearchFilter.Checkbox\n className={classes.filter}\n label=\"Lifecycle\"\n name=\"lifecycle\"\n values={['experimental', 'production']}\n />\n </Paper>\n </Grid>\n )}\n <Grid item xs>\n <SearchPagination />\n <SearchResults>\n {({ results }) =>\n results.map((result, index) => {\n const { noTrack } = config;\n const { document, ...rest } = result;\n const SearchResultListItem =\n getResultItemComponent(result);\n return (\n <SearchResultListItem\n {...rest}\n key={index}\n result={document}\n noTrack={noTrack}\n />\n );\n })\n }\n </SearchResults>\n <SearchResultPager />\n </Grid>\n </Grid>\n </Content>\n </Page>\n );\n };\n\n return (\n <SearchContextProvider>\n <UrlUpdater />\n <Component />\n </SearchContextProvider>\n );\n },\n});\n\n/** @alpha */\nexport const SearchNavItem = createNavItemExtension({\n id: 'plugin.search.nav.index',\n routeRef: searchRouteRef,\n title: 'Search',\n icon: SearchIcon,\n});\n\n/** @alpha */\nexport default createPlugin({\n id: 'plugin.search',\n extensions: [SearchApi, SearchPage, SearchNavItem],\n});\n"],"names":["_a","SearchResults"],"mappings":";;;;;;;;;;;;;;;;;;;AAuEO,MAAM,YAAY,kBAAmB,CAAA;AAAA,EAC1C,OAAS,EAAA;AAAA,IACP,GAAK,EAAA,YAAA;AAAA,IACL,IAAM,EAAA,EAAE,YAAc,EAAA,eAAA,EAAiB,aAAa,cAAe,EAAA;AAAA,IACnE,SAAS,CAAC;AAAA,MACR,WAAA;AAAA,MACA,YAAA;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C,uBAAkB,CACrB,CACF,CACF,CACF,CAAA,CAAA;AAAA,KAEJ,CAAA;AAEA,IAAA,2CACG,qBACC,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,gBAAW,CACZ,kBAAA,KAAA,CAAA,aAAA,CAAC,eAAU,CACb,CAAA,CAAA;AAAA,GAEJ;AACF,CAAC,EAAA;AAGM,MAAM,gBAAgB,sBAAuB,CAAA;AAAA,EAClD,EAAI,EAAA,yBAAA;AAAA,EACJ,QAAU,EAAA,cAAA;AAAA,EACV,KAAO,EAAA,QAAA;AAAA,EACP,IAAM,EAAA,UAAA;AACR,CAAC,EAAA;AAGD,YAAe,YAAa,CAAA;AAAA,EAC1B,EAAI,EAAA,eAAA;AAAA,EACJ,UAAY,EAAA,CAAC,SAAW,EAAA,UAAA,EAAY,aAAa,CAAA;AACnD,CAAC,CAAA;;;;"}
|
|
@@ -1,21 +1,12 @@
|
|
|
1
|
-
import { useContent, SidebarSearchField } from '@backstage/core-components';
|
|
2
|
-
import { createRouteRef, createPlugin, createApiFactory, discoveryApiRef, identityApiRef, createRoutableExtension, createComponentExtension, useRouteRef, useApi } from '@backstage/core-plugin-api';
|
|
3
|
-
import { searchApiRef, SearchContextProvider, SearchBar, SearchResult, SearchResultPager, useSearch } from '@backstage/plugin-search-react';
|
|
4
|
-
import { Dialog, useTheme, DialogTitle, DialogContent, Grid, Divider, DialogActions, makeStyles as makeStyles$1, Card, CardHeader, CardContent, Accordion, AccordionSummary, AccordionDetails, List, ListItem, ListItemIcon, ListItemText, Tabs, Tab, FormControl, InputLabel, Select, Chip, MenuItem, Checkbox } from '@material-ui/core';
|
|
5
|
-
import Box from '@material-ui/core/Box';
|
|
6
|
-
import Button from '@material-ui/core/Button';
|
|
7
|
-
import IconButton from '@material-ui/core/IconButton';
|
|
8
|
-
import { makeStyles } from '@material-ui/core/styles';
|
|
9
|
-
import ArrowForwardIcon from '@material-ui/icons/ArrowForward';
|
|
10
|
-
import CloseIcon from '@material-ui/icons/Close';
|
|
11
|
-
import React, { useRef, useEffect, useCallback, useState, useContext, Fragment, cloneElement } from 'react';
|
|
12
|
-
import { useNavigate, useLocation, useOutlet } from 'react-router-dom';
|
|
13
1
|
import { ResponseError } from '@backstage/errors';
|
|
14
2
|
import qs from 'qs';
|
|
15
|
-
import {
|
|
16
|
-
import useUpdateEffect from 'react-use/lib/useUpdateEffect';
|
|
3
|
+
import React, { useEffect, useState, Fragment, cloneElement } from 'react';
|
|
17
4
|
import usePrevious from 'react-use/lib/usePrevious';
|
|
5
|
+
import { useOutlet, useLocation } from 'react-router-dom';
|
|
6
|
+
import { SearchContextProvider, useSearch, searchApiRef } from '@backstage/plugin-search-react';
|
|
7
|
+
import { makeStyles, Card, CardHeader, CardContent, Accordion, AccordionSummary, AccordionDetails, List, Divider, ListItem, ListItemIcon, ListItemText, Tabs, Tab, FormControl, InputLabel, Select, Chip, MenuItem, Checkbox } from '@material-ui/core';
|
|
18
8
|
import useEffectOnce from 'react-use/lib/useEffectOnce';
|
|
9
|
+
import { useApi } from '@backstage/core-plugin-api';
|
|
19
10
|
import ExpandMoreIcon from '@material-ui/icons/ExpandMore';
|
|
20
11
|
import AllIcon from '@material-ui/icons/FontDownload';
|
|
21
12
|
import useAsync from 'react-use/lib/useAsync';
|
|
@@ -49,187 +40,6 @@ class SearchClient {
|
|
|
49
40
|
}
|
|
50
41
|
}
|
|
51
42
|
|
|
52
|
-
const rootRouteRef = createRouteRef({
|
|
53
|
-
id: "search"
|
|
54
|
-
});
|
|
55
|
-
const searchPlugin = createPlugin({
|
|
56
|
-
id: "search",
|
|
57
|
-
apis: [
|
|
58
|
-
createApiFactory({
|
|
59
|
-
api: searchApiRef,
|
|
60
|
-
deps: { discoveryApi: discoveryApiRef, identityApi: identityApiRef },
|
|
61
|
-
factory: ({ discoveryApi, identityApi }) => {
|
|
62
|
-
return new SearchClient({ discoveryApi, identityApi });
|
|
63
|
-
}
|
|
64
|
-
})
|
|
65
|
-
],
|
|
66
|
-
routes: {
|
|
67
|
-
root: rootRouteRef
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
const SearchPage$1 = searchPlugin.provide(
|
|
71
|
-
createRoutableExtension({
|
|
72
|
-
name: "SearchPage",
|
|
73
|
-
component: () => import('./index-14e72004.esm.js').then((m) => m.SearchPage),
|
|
74
|
-
mountPoint: rootRouteRef
|
|
75
|
-
})
|
|
76
|
-
);
|
|
77
|
-
const SidebarSearchModal = searchPlugin.provide(
|
|
78
|
-
createComponentExtension({
|
|
79
|
-
name: "SidebarSearchModal",
|
|
80
|
-
component: {
|
|
81
|
-
lazy: () => import('./index-ec7f140c.esm.js').then(
|
|
82
|
-
(m) => m.SidebarSearchModal
|
|
83
|
-
)
|
|
84
|
-
}
|
|
85
|
-
})
|
|
86
|
-
);
|
|
87
|
-
const HomePageSearchBar = searchPlugin.provide(
|
|
88
|
-
createComponentExtension({
|
|
89
|
-
name: "HomePageSearchBar",
|
|
90
|
-
component: {
|
|
91
|
-
lazy: () => import('./index-3c2238df.esm.js').then((m) => m.HomePageSearchBar)
|
|
92
|
-
}
|
|
93
|
-
})
|
|
94
|
-
);
|
|
95
|
-
|
|
96
|
-
const useStyles$3 = makeStyles((theme) => ({
|
|
97
|
-
dialogTitle: {
|
|
98
|
-
gap: theme.spacing(1),
|
|
99
|
-
display: "grid",
|
|
100
|
-
alignItems: "center",
|
|
101
|
-
gridTemplateColumns: "1fr auto",
|
|
102
|
-
"&> button": {
|
|
103
|
-
marginTop: theme.spacing(1)
|
|
104
|
-
}
|
|
105
|
-
},
|
|
106
|
-
input: {
|
|
107
|
-
flex: 1
|
|
108
|
-
},
|
|
109
|
-
button: {
|
|
110
|
-
"&:hover": {
|
|
111
|
-
background: "none"
|
|
112
|
-
}
|
|
113
|
-
},
|
|
114
|
-
// Reduces default height of the modal, keeping a gap of 128px between the top and bottom of the page.
|
|
115
|
-
paperFullWidth: { height: "calc(100% - 128px)" },
|
|
116
|
-
dialogActionsContainer: { padding: theme.spacing(1, 3) },
|
|
117
|
-
viewResultsLink: { verticalAlign: "0.5em" }
|
|
118
|
-
}));
|
|
119
|
-
const Modal = ({ toggleModal }) => {
|
|
120
|
-
const classes = useStyles$3();
|
|
121
|
-
const navigate = useNavigate();
|
|
122
|
-
const { transitions } = useTheme();
|
|
123
|
-
const { focusContent } = useContent();
|
|
124
|
-
const searchRootRoute = useRouteRef(rootRouteRef)();
|
|
125
|
-
const searchBarRef = useRef(null);
|
|
126
|
-
useEffect(() => {
|
|
127
|
-
var _a;
|
|
128
|
-
(_a = searchBarRef == null ? void 0 : searchBarRef.current) == null ? void 0 : _a.focus();
|
|
129
|
-
});
|
|
130
|
-
const handleSearchResultClick = useCallback(() => {
|
|
131
|
-
setTimeout(focusContent, transitions.duration.leavingScreen);
|
|
132
|
-
}, [focusContent, transitions]);
|
|
133
|
-
const handleSearchBarSubmit = useCallback(() => {
|
|
134
|
-
var _a, _b;
|
|
135
|
-
const query = (_b = (_a = searchBarRef.current) == null ? void 0 : _a.value) != null ? _b : "";
|
|
136
|
-
navigate(`${searchRootRoute}?query=${query}`);
|
|
137
|
-
handleSearchResultClick();
|
|
138
|
-
}, [navigate, handleSearchResultClick, searchRootRoute]);
|
|
139
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(DialogTitle, null, /* @__PURE__ */ React.createElement(Box, { className: classes.dialogTitle }, /* @__PURE__ */ React.createElement(
|
|
140
|
-
SearchBar,
|
|
141
|
-
{
|
|
142
|
-
className: classes.input,
|
|
143
|
-
inputProps: { ref: searchBarRef },
|
|
144
|
-
onSubmit: handleSearchBarSubmit
|
|
145
|
-
}
|
|
146
|
-
), /* @__PURE__ */ React.createElement(IconButton, { "aria-label": "close", onClick: toggleModal }, /* @__PURE__ */ React.createElement(CloseIcon, null)))), /* @__PURE__ */ React.createElement(DialogContent, null, /* @__PURE__ */ React.createElement(
|
|
147
|
-
Grid,
|
|
148
|
-
{
|
|
149
|
-
container: true,
|
|
150
|
-
direction: "row-reverse",
|
|
151
|
-
justifyContent: "flex-start",
|
|
152
|
-
alignItems: "center"
|
|
153
|
-
},
|
|
154
|
-
/* @__PURE__ */ React.createElement(Grid, { item: true }, /* @__PURE__ */ React.createElement(
|
|
155
|
-
Button,
|
|
156
|
-
{
|
|
157
|
-
className: classes.button,
|
|
158
|
-
color: "primary",
|
|
159
|
-
endIcon: /* @__PURE__ */ React.createElement(ArrowForwardIcon, null),
|
|
160
|
-
onClick: handleSearchBarSubmit,
|
|
161
|
-
disableRipple: true
|
|
162
|
-
},
|
|
163
|
-
"View Full Results"
|
|
164
|
-
))
|
|
165
|
-
), /* @__PURE__ */ React.createElement(Divider, null), /* @__PURE__ */ React.createElement(
|
|
166
|
-
SearchResult,
|
|
167
|
-
{
|
|
168
|
-
onClick: handleSearchResultClick,
|
|
169
|
-
onKeyDown: handleSearchResultClick
|
|
170
|
-
}
|
|
171
|
-
)), /* @__PURE__ */ React.createElement(DialogActions, { className: classes.dialogActionsContainer }, /* @__PURE__ */ React.createElement(Grid, { container: true, direction: "row" }, /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(SearchResultPager, null)))));
|
|
172
|
-
};
|
|
173
|
-
const SearchModal = (props) => {
|
|
174
|
-
var _a;
|
|
175
|
-
const { open = true, hidden, toggleModal, children } = props;
|
|
176
|
-
const classes = useStyles$3();
|
|
177
|
-
return /* @__PURE__ */ React.createElement(
|
|
178
|
-
Dialog,
|
|
179
|
-
{
|
|
180
|
-
classes: {
|
|
181
|
-
paperFullWidth: classes.paperFullWidth
|
|
182
|
-
},
|
|
183
|
-
onClose: toggleModal,
|
|
184
|
-
"aria-labelledby": "search-modal-title",
|
|
185
|
-
fullWidth: true,
|
|
186
|
-
maxWidth: "lg",
|
|
187
|
-
open,
|
|
188
|
-
hidden
|
|
189
|
-
},
|
|
190
|
-
open && /* @__PURE__ */ React.createElement(SearchContextProvider, { inheritParentContextIfAvailable: true }, (_a = children && children({ toggleModal })) != null ? _a : /* @__PURE__ */ React.createElement(Modal, { toggleModal }))
|
|
191
|
-
);
|
|
192
|
-
};
|
|
193
|
-
|
|
194
|
-
const SearchModalContext = createVersionedContext("search-modal-context");
|
|
195
|
-
const SearchModalProvider = (props) => {
|
|
196
|
-
const value = useSearchModal(props.showInitially);
|
|
197
|
-
const versionedValue = createVersionedValueMap({ 1: value });
|
|
198
|
-
return /* @__PURE__ */ React.createElement(SearchModalContext.Provider, { value: versionedValue }, props.children);
|
|
199
|
-
};
|
|
200
|
-
function useSearchModal(initialState = false) {
|
|
201
|
-
const [state, setState] = useState({
|
|
202
|
-
hidden: !initialState,
|
|
203
|
-
open: initialState
|
|
204
|
-
});
|
|
205
|
-
const toggleModal = useCallback(
|
|
206
|
-
() => setState((prevState) => ({
|
|
207
|
-
open: true,
|
|
208
|
-
hidden: !prevState.hidden
|
|
209
|
-
})),
|
|
210
|
-
[]
|
|
211
|
-
);
|
|
212
|
-
const setOpen = useCallback(
|
|
213
|
-
(open) => setState((prevState) => ({
|
|
214
|
-
open: prevState.open || open,
|
|
215
|
-
hidden: !open
|
|
216
|
-
})),
|
|
217
|
-
[]
|
|
218
|
-
);
|
|
219
|
-
const parentContext = useContext(SearchModalContext);
|
|
220
|
-
const parentContextValue = parentContext == null ? void 0 : parentContext.atVersion(1);
|
|
221
|
-
const isParentContextPresent = !!(parentContextValue == null ? void 0 : parentContextValue.state);
|
|
222
|
-
const location = useLocation();
|
|
223
|
-
const locationKey = `${location.pathname}${location.search}${location.hash}`;
|
|
224
|
-
useUpdateEffect(() => {
|
|
225
|
-
setState((prevState) => ({
|
|
226
|
-
open: prevState.open,
|
|
227
|
-
hidden: true
|
|
228
|
-
}));
|
|
229
|
-
}, [locationKey]);
|
|
230
|
-
return isParentContextPresent ? parentContextValue : { state, toggleModal, setOpen };
|
|
231
|
-
}
|
|
232
|
-
|
|
233
43
|
const UrlUpdater = () => {
|
|
234
44
|
const location = useLocation();
|
|
235
45
|
const {
|
|
@@ -281,7 +91,7 @@ const SearchPage = () => {
|
|
|
281
91
|
return /* @__PURE__ */ React.createElement(SearchContextProvider, null, /* @__PURE__ */ React.createElement(UrlUpdater, null), outlet);
|
|
282
92
|
};
|
|
283
93
|
|
|
284
|
-
const useStyles$2 = makeStyles
|
|
94
|
+
const useStyles$2 = makeStyles((theme) => ({
|
|
285
95
|
card: {
|
|
286
96
|
backgroundColor: "rgba(0, 0, 0, .11)"
|
|
287
97
|
},
|
|
@@ -415,7 +225,7 @@ const SearchTypeAccordion = (props) => {
|
|
|
415
225
|
)));
|
|
416
226
|
};
|
|
417
227
|
|
|
418
|
-
const useStyles$1 = makeStyles
|
|
228
|
+
const useStyles$1 = makeStyles((theme) => ({
|
|
419
229
|
tabs: {
|
|
420
230
|
borderBottom: `1px solid ${theme.palette.textVerySubtle}`
|
|
421
231
|
},
|
|
@@ -468,7 +278,7 @@ const SearchTypeTabs = (props) => {
|
|
|
468
278
|
);
|
|
469
279
|
};
|
|
470
280
|
|
|
471
|
-
const useStyles = makeStyles
|
|
281
|
+
const useStyles = makeStyles((theme) => ({
|
|
472
282
|
label: {
|
|
473
283
|
textTransform: "capitalize"
|
|
474
284
|
},
|
|
@@ -536,27 +346,5 @@ SearchType.Tabs = (props) => {
|
|
|
536
346
|
return /* @__PURE__ */ React.createElement(SearchTypeTabs, { ...props });
|
|
537
347
|
};
|
|
538
348
|
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
const { focusContent } = useContent();
|
|
542
|
-
const navigate = useNavigate();
|
|
543
|
-
const handleSearch = useCallback(
|
|
544
|
-
(query) => {
|
|
545
|
-
const queryString = qs.stringify({ query }, { addQueryPrefix: true });
|
|
546
|
-
focusContent();
|
|
547
|
-
navigate(`${searchRoute()}${queryString}`);
|
|
548
|
-
},
|
|
549
|
-
[focusContent, navigate, searchRoute]
|
|
550
|
-
);
|
|
551
|
-
return /* @__PURE__ */ React.createElement(
|
|
552
|
-
SidebarSearchField,
|
|
553
|
-
{
|
|
554
|
-
icon: props.icon,
|
|
555
|
-
onSearch: handleSearch,
|
|
556
|
-
to: "/search"
|
|
557
|
-
}
|
|
558
|
-
);
|
|
559
|
-
};
|
|
560
|
-
|
|
561
|
-
export { HomePageSearchBar as H, SearchPage as S, SearchModalProvider as a, SearchModal as b, SearchType as c, SidebarSearch as d, SearchPage$1 as e, SidebarSearchModal as f, rootRouteRef as r, searchPlugin as s, useSearchModal as u };
|
|
562
|
-
//# sourceMappingURL=index-625b4401.esm.js.map
|
|
349
|
+
export { SearchClient as S, UrlUpdater as U, SearchPage as a, SearchType as b };
|
|
350
|
+
//# sourceMappingURL=SearchType-93364f77.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchType-93364f77.esm.js","sources":["../../src/apis.ts","../../src/components/SearchPage/SearchPage.tsx","../../src/components/SearchType/SearchType.Accordion.tsx","../../src/components/SearchType/SearchType.Tabs.tsx","../../src/components/SearchType/SearchType.tsx"],"sourcesContent":["/*\n * Copyright 2020 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 { DiscoveryApi, IdentityApi } from '@backstage/core-plugin-api';\nimport { ResponseError } from '@backstage/errors';\nimport { SearchApi } from '@backstage/plugin-search-react';\nimport { SearchQuery, SearchResultSet } from '@backstage/plugin-search-common';\n\nimport qs from 'qs';\n\nexport class SearchClient implements SearchApi {\n private readonly discoveryApi: DiscoveryApi;\n private readonly identityApi: IdentityApi;\n\n constructor(options: {\n discoveryApi: DiscoveryApi;\n identityApi: IdentityApi;\n }) {\n this.discoveryApi = options.discoveryApi;\n this.identityApi = options.identityApi;\n }\n\n async query(query: SearchQuery): Promise<SearchResultSet> {\n const { token } = await this.identityApi.getCredentials();\n const queryString = qs.stringify(query);\n const url = `${await this.discoveryApi.getBaseUrl(\n 'search',\n )}/query?${queryString}`;\n const response = await fetch(url, {\n headers: token ? { Authorization: `Bearer ${token}` } : {},\n });\n\n if (!response.ok) {\n throw await ResponseError.fromResponse(response);\n }\n\n return response.json();\n }\n}\n","/*\n * Copyright 2020 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 React, { useEffect } from 'react';\nimport usePrevious from 'react-use/lib/usePrevious';\nimport qs from 'qs';\nimport { useLocation, useOutlet } from 'react-router-dom';\nimport {\n SearchContextProvider,\n useSearch,\n} from '@backstage/plugin-search-react';\nimport { JsonObject } from '@backstage/types';\n\nexport const UrlUpdater = () => {\n const location = useLocation();\n const {\n term,\n setTerm,\n types,\n setTypes,\n pageCursor,\n setPageCursor,\n filters,\n setFilters,\n } = useSearch();\n\n const prevQueryParams = usePrevious(location.search);\n useEffect(() => {\n // Only respond to changes to url query params\n if (location.search === prevQueryParams) {\n return;\n }\n\n const query =\n qs.parse(location.search.substring(1), { arrayLimit: 0 }) || {};\n\n if (query.filters) {\n setFilters(query.filters as JsonObject);\n }\n\n if (query.query) {\n setTerm(query.query as string);\n }\n\n if (query.pageCursor) {\n setPageCursor(query.pageCursor as string);\n }\n\n if (query.types) {\n setTypes(query.types as string[]);\n }\n }, [prevQueryParams, location, setTerm, setTypes, setPageCursor, setFilters]);\n\n useEffect(() => {\n const newParams = qs.stringify(\n {\n query: term,\n types,\n pageCursor,\n filters,\n },\n { arrayFormat: 'brackets' },\n );\n const newUrl = `${window.location.pathname}?${newParams}`;\n\n // We directly manipulate window history here in order to not re-render\n // infinitely (state => location => state => etc). The intention of this\n // code is just to ensure the right query/filters are loaded when a user\n // clicks the \"back\" button after clicking a result.\n window.history.replaceState(null, document.title, newUrl);\n }, [term, types, pageCursor, filters]);\n\n return null;\n};\n\n/**\n * @public\n */\nexport const SearchPage = () => {\n const outlet = useOutlet();\n\n return (\n <SearchContextProvider>\n <UrlUpdater />\n {outlet}\n </SearchContextProvider>\n );\n};\n","/*\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 React, { cloneElement, Fragment, useEffect, useState } from 'react';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { searchApiRef, useSearch } from '@backstage/plugin-search-react';\nimport {\n Accordion,\n AccordionSummary,\n AccordionDetails,\n Card,\n CardContent,\n CardHeader,\n Divider,\n List,\n ListItem,\n ListItemIcon,\n ListItemText,\n makeStyles,\n} from '@material-ui/core';\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport AllIcon from '@material-ui/icons/FontDownload';\nimport useAsync from 'react-use/lib/useAsync';\n\nconst useStyles = makeStyles(theme => ({\n card: {\n backgroundColor: 'rgba(0, 0, 0, .11)',\n },\n cardContent: {\n paddingTop: theme.spacing(1),\n },\n icon: {\n color: theme.palette.common.black,\n },\n list: {\n width: '100%',\n },\n listItemIcon: {\n width: '24px',\n height: '24px',\n },\n accordion: {\n backgroundColor: theme.palette.background.paper,\n },\n accordionSummary: {\n minHeight: 'auto',\n '&.Mui-expanded': {\n minHeight: 'auto',\n },\n },\n accordionSummaryContent: {\n margin: theme.spacing(2, 0),\n '&.Mui-expanded': {\n margin: theme.spacing(2, 0),\n },\n },\n accordionDetails: {\n padding: theme.spacing(0, 0, 1),\n },\n}));\n\n/**\n * @public\n */\nexport type SearchTypeAccordionProps = {\n name: string;\n types: Array<{\n value: string;\n name: string;\n icon: JSX.Element;\n }>;\n defaultValue?: string;\n showCounts?: boolean;\n};\n\nexport const SearchTypeAccordion = (props: SearchTypeAccordionProps) => {\n const classes = useStyles();\n const { filters, setPageCursor, setTypes, term, types } = useSearch();\n const searchApi = useApi(searchApiRef);\n const [expanded, setExpanded] = useState(true);\n const { defaultValue, name, showCounts, types: givenTypes } = props;\n\n const toggleExpanded = () => setExpanded(prevState => !prevState);\n const handleClick = (type: string) => {\n return () => {\n setTypes(type !== '' ? [type] : []);\n setPageCursor(undefined);\n setExpanded(false);\n };\n };\n\n // Handle any provided defaultValue\n useEffect(() => {\n if (defaultValue) {\n setTypes([defaultValue]);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const definedTypes = [\n {\n value: '',\n name: 'All',\n icon: <AllIcon />,\n },\n ...givenTypes,\n ];\n const selected = types[0] || '';\n\n const { value: resultCounts } = useAsync(async () => {\n if (!showCounts) {\n return {};\n }\n\n const counts = await Promise.all(\n definedTypes\n .map(t => t.value)\n .map(async type => {\n const { numberOfResults } = await searchApi.query({\n term,\n types: type ? [type] : [],\n filters:\n types.includes(type) || (!types.length && !type) ? filters : {},\n pageLimit: 0,\n });\n\n return [\n type,\n numberOfResults !== undefined\n ? `${\n numberOfResults >= 10000 ? `>10000` : numberOfResults\n } results`\n : ' -- ',\n ];\n }),\n );\n\n return Object.fromEntries(counts);\n }, [filters, showCounts, term, types]);\n\n return (\n <Card className={classes.card}>\n <CardHeader title={name} titleTypographyProps={{ variant: 'overline' }} />\n <CardContent className={classes.cardContent}>\n <Accordion\n className={classes.accordion}\n expanded={expanded}\n onChange={toggleExpanded}\n >\n <AccordionSummary\n classes={{\n root: classes.accordionSummary,\n content: classes.accordionSummaryContent,\n }}\n expandIcon={<ExpandMoreIcon className={classes.icon} />}\n IconButtonProps={{ size: 'small' }}\n >\n {expanded\n ? 'Collapse'\n : definedTypes.filter(t => t.value === selected)[0]!.name}\n </AccordionSummary>\n <AccordionDetails classes={{ root: classes.accordionDetails }}>\n <List\n className={classes.list}\n component=\"nav\"\n aria-label=\"filter by type\"\n disablePadding\n dense\n >\n {definedTypes.map(type => (\n <Fragment key={type.value}>\n <Divider />\n <ListItem\n selected={\n types[0] === type.value ||\n (types.length === 0 && type.value === '')\n }\n onClick={handleClick(type.value)}\n button\n >\n <ListItemIcon>\n {cloneElement(type.icon, {\n className: classes.listItemIcon,\n })}\n </ListItemIcon>\n <ListItemText\n primary={type.name}\n secondary={resultCounts && resultCounts[type.value]}\n />\n </ListItem>\n </Fragment>\n ))}\n </List>\n </AccordionDetails>\n </Accordion>\n </CardContent>\n </Card>\n );\n};\n","/*\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 React, { useEffect } from 'react';\nimport { useSearch } from '@backstage/plugin-search-react';\nimport { BackstageTheme } from '@backstage/theme';\nimport { makeStyles, Tab, Tabs } from '@material-ui/core';\n\nconst useStyles = makeStyles((theme: BackstageTheme) => ({\n tabs: {\n borderBottom: `1px solid ${theme.palette.textVerySubtle}`,\n },\n tab: {\n height: '50px',\n fontWeight: theme.typography.fontWeightBold,\n fontSize: theme.typography.pxToRem(13),\n color: theme.palette.text.primary,\n minWidth: '130px',\n },\n}));\n\n/**\n * @public\n */\nexport type SearchTypeTabsProps = {\n types: Array<{\n value: string;\n name: string;\n }>;\n defaultValue?: string;\n};\n\nexport const SearchTypeTabs = (props: SearchTypeTabsProps) => {\n const classes = useStyles();\n const { setPageCursor, setTypes, types } = useSearch();\n const { defaultValue, types: givenTypes } = props;\n\n const changeTab = (_: React.ChangeEvent<{}>, newType: string) => {\n setTypes(newType !== '' ? [newType] : []);\n setPageCursor(undefined);\n };\n\n // Handle any provided defaultValue\n useEffect(() => {\n if (defaultValue) {\n setTypes([defaultValue]);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const definedTypes = [\n {\n value: '',\n name: 'All',\n },\n ...givenTypes,\n ];\n\n return (\n <Tabs\n aria-label=\"List of search types tabs\"\n className={classes.tabs}\n indicatorColor=\"primary\"\n value={types.length === 0 ? '' : types[0]}\n onChange={changeTab}\n >\n {definedTypes.map((type, idx) => (\n <Tab\n key={idx}\n className={classes.tab}\n label={type.name}\n value={type.value}\n />\n ))}\n </Tabs>\n );\n};\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n Checkbox,\n Chip,\n FormControl,\n InputLabel,\n ListItemText,\n makeStyles,\n MenuItem,\n Select,\n} from '@material-ui/core';\nimport React, { ChangeEvent } from 'react';\nimport useEffectOnce from 'react-use/lib/useEffectOnce';\nimport {\n SearchTypeAccordion,\n SearchTypeAccordionProps,\n} from './SearchType.Accordion';\nimport { SearchTypeTabs, SearchTypeTabsProps } from './SearchType.Tabs';\nimport { useSearch } from '@backstage/plugin-search-react';\n\nconst useStyles = makeStyles(theme => ({\n label: {\n textTransform: 'capitalize',\n },\n chips: {\n display: 'flex',\n flexWrap: 'wrap',\n marginTop: theme.spacing(1),\n },\n chip: {\n margin: 2,\n },\n}));\n\n/**\n * Props for {@link SearchType}.\n *\n * @public\n */\nexport type SearchTypeProps = {\n className?: string;\n name: string;\n values?: string[];\n defaultValue?: string[] | string | null;\n};\n\n/**\n * @public\n */\nconst SearchType = (props: SearchTypeProps) => {\n const { className, defaultValue, name, values = [] } = props;\n const classes = useStyles();\n const { types, setTypes } = useSearch();\n\n useEffectOnce(() => {\n if (!types.length) {\n if (defaultValue && Array.isArray(defaultValue)) {\n setTypes(defaultValue);\n } else if (defaultValue) {\n setTypes([defaultValue]);\n }\n }\n });\n\n const handleChange = (e: ChangeEvent<{ value: unknown }>) => {\n const value = e.target.value as string[];\n setTypes(value as string[]);\n };\n\n return (\n <FormControl\n className={className}\n variant=\"filled\"\n fullWidth\n data-testid=\"search-typefilter-next\"\n >\n <InputLabel className={classes.label} margin=\"dense\">\n {name}\n </InputLabel>\n <Select\n multiple\n variant=\"outlined\"\n value={types}\n onChange={handleChange}\n placeholder=\"All Results\"\n renderValue={selected => (\n <div className={classes.chips}>\n {(selected as string[]).map(value => (\n <Chip\n key={value}\n label={value}\n className={classes.chip}\n size=\"small\"\n />\n ))}\n </div>\n )}\n >\n {values.map((value: string) => (\n <MenuItem key={value} value={value}>\n <Checkbox checked={types.indexOf(value) > -1} />\n <ListItemText primary={value} />\n </MenuItem>\n ))}\n </Select>\n </FormControl>\n );\n};\n\n/**\n * A control surface for the search query's \"types\" property, displayed as a\n * single-select collapsible accordion suitable for use in faceted search UIs.\n * @public\n */\nSearchType.Accordion = (props: SearchTypeAccordionProps) => {\n return <SearchTypeAccordion {...props} />;\n};\n\n/**\n * A control surface for the search query's \"types\" property, displayed as a\n * tabs suitable for use in faceted search UIs.\n * @public\n */\nSearchType.Tabs = (props: SearchTypeTabsProps) => {\n return <SearchTypeTabs {...props} />;\n};\n\nexport { SearchType };\nexport type { SearchTypeAccordionProps, SearchTypeTabsProps };\n"],"names":["useStyles"],"mapp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AAO,EAAA,CAChC,CACD,CAAA;AAAA,KACH;AAAA,GACF,CAAA;AAEJ,EAAA;AAOA,UAAW,CAAA,SAAA,GAAY,CAAC,KAAoC,KAAA;AAC1D,EAAO,uBAAA,KAAA,CAAA,aAAA,CAAC,mBAAqB,EAAA,EAAA,GAAG,KAAO,EAAA,CAAA,CAAA;AACzC,CAAA,CAAA;AAOA,UAAW,CAAA,IAAA,GAAO,CAAC,KAA+B,KAAA;AAChD,EAAO,uBAAA,KAAA,CAAA,aAAA,CAAC,cAAgB,EAAA,EAAA,GAAG,KAAO,EAAA,CAAA,CAAA;AACpC,CAAA;;;;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { a as SearchPage } from './SearchType-93364f77.esm.js';
|
|
2
|
+
import '@backstage/errors';
|
|
3
|
+
import 'qs';
|
|
4
|
+
import 'react';
|
|
5
|
+
import 'react-use/lib/usePrevious';
|
|
6
|
+
import 'react-router-dom';
|
|
7
|
+
import '@backstage/plugin-search-react';
|
|
8
|
+
import '@material-ui/core';
|
|
9
|
+
import 'react-use/lib/useEffectOnce';
|
|
10
|
+
import '@backstage/core-plugin-api';
|
|
11
|
+
import '@material-ui/icons/ExpandMore';
|
|
12
|
+
import '@material-ui/icons/FontDownload';
|
|
13
|
+
import 'react-use/lib/useAsync';
|
|
14
|
+
//# sourceMappingURL=index-64b2be7b.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-64b2be7b.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
|