catalog: rename CatalogResultListItem to CatalogSearchResultListItem
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-catalog': patch
|
||||
---
|
||||
|
||||
Renamed `CatalogResultListItem` to `CatalogSearchResultListItem` along with its prop type, leaving the old names in place as a deprecations.
|
||||
@@ -0,0 +1,22 @@
|
||||
---
|
||||
'@backstage/create-app': patch
|
||||
---
|
||||
|
||||
Update the template to reflect the renaming of `CatalogResultListItem` to `CatalogSearchResultListItem` from `@backstage/plugin-catalog`.
|
||||
|
||||
To apply this change to an existing app, make the following change to `packages/app/src/components/search/SearchPage.tsx`:
|
||||
|
||||
```diff
|
||||
-import { CatalogResultListItem } from '@backstage/plugin-catalog';
|
||||
+import { CatalogSearchResultListItem } from '@backstage/plugin-catalog';
|
||||
```
|
||||
|
||||
```diff
|
||||
case 'software-catalog':
|
||||
return (
|
||||
- <CatalogResultListItem
|
||||
+ <CatalogSearchResultListItem
|
||||
key={document.location}
|
||||
result={document}
|
||||
/>
|
||||
```
|
||||
@@ -24,7 +24,7 @@ import {
|
||||
SidebarPinStateContext,
|
||||
} from '@backstage/core-components';
|
||||
import { useApi } from '@backstage/core-plugin-api';
|
||||
import { CatalogResultListItem } from '@backstage/plugin-catalog';
|
||||
import { CatalogSearchResultListItem } from '@backstage/plugin-catalog';
|
||||
import {
|
||||
catalogApiRef,
|
||||
CATALOG_FILTER_EXISTS,
|
||||
@@ -136,7 +136,7 @@ const SearchPage = () => {
|
||||
switch (type) {
|
||||
case 'software-catalog':
|
||||
return (
|
||||
<CatalogResultListItem
|
||||
<CatalogSearchResultListItem
|
||||
key={document.location}
|
||||
result={document}
|
||||
/>
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import { makeStyles, Theme, Grid, List, Paper } from '@material-ui/core';
|
||||
|
||||
import { CatalogResultListItem } from '@backstage/plugin-catalog';
|
||||
import { CatalogSearchResultListItem } from '@backstage/plugin-catalog';
|
||||
import {
|
||||
catalogApiRef,
|
||||
CATALOG_FILTER_EXISTS,
|
||||
@@ -116,7 +116,7 @@ const SearchPage = () => {
|
||||
switch (type) {
|
||||
case 'software-catalog':
|
||||
return (
|
||||
<CatalogResultListItem
|
||||
<CatalogSearchResultListItem
|
||||
key={document.location}
|
||||
result={document}
|
||||
/>
|
||||
|
||||
@@ -104,13 +104,19 @@ const catalogPlugin: BackstagePlugin<
|
||||
export { catalogPlugin };
|
||||
export { catalogPlugin as plugin };
|
||||
|
||||
// @public @deprecated (undocumented)
|
||||
export const CatalogResultListItem: typeof CatalogSearchResultListItem;
|
||||
|
||||
// @public @deprecated (undocumented)
|
||||
export type CatalogResultListItemProps = CatalogSearchResultListItemProps;
|
||||
|
||||
// @public (undocumented)
|
||||
export function CatalogResultListItem(
|
||||
props: CatalogResultListItemProps,
|
||||
export function CatalogSearchResultListItem(
|
||||
props: CatalogSearchResultListItemProps,
|
||||
): JSX.Element;
|
||||
|
||||
// @public
|
||||
export interface CatalogResultListItemProps {
|
||||
export interface CatalogSearchResultListItemProps {
|
||||
// (undocumented)
|
||||
result: IndexableDocument;
|
||||
}
|
||||
|
||||
+17
-3
@@ -38,16 +38,18 @@ const useStyles = makeStyles({
|
||||
});
|
||||
|
||||
/**
|
||||
* Props for {@link CatalogResultListItem}.
|
||||
* Props for {@link CatalogSearchResultListItem}.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export interface CatalogResultListItemProps {
|
||||
export interface CatalogSearchResultListItemProps {
|
||||
result: IndexableDocument;
|
||||
}
|
||||
|
||||
/** @public */
|
||||
export function CatalogResultListItem(props: CatalogResultListItemProps) {
|
||||
export function CatalogSearchResultListItem(
|
||||
props: CatalogSearchResultListItemProps,
|
||||
) {
|
||||
const result = props.result as any;
|
||||
|
||||
const classes = useStyles();
|
||||
@@ -71,3 +73,15 @@ export function CatalogResultListItem(props: CatalogResultListItemProps) {
|
||||
</Link>
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @deprecated use {@link CatalogSearchResultListItemProps} instead
|
||||
*/
|
||||
export type CatalogResultListItemProps = CatalogSearchResultListItemProps;
|
||||
|
||||
/**
|
||||
* @public
|
||||
* @deprecated use {@link CatalogSearchResultListItem} instead
|
||||
*/
|
||||
export const CatalogResultListItem = CatalogSearchResultListItem;
|
||||
+8
-2
@@ -14,5 +14,11 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export { CatalogResultListItem } from './CatalogResultListItem';
|
||||
export type { CatalogResultListItemProps } from './CatalogResultListItem';
|
||||
export {
|
||||
CatalogSearchResultListItem,
|
||||
CatalogResultListItem,
|
||||
} from './CatalogSearchResultListItem';
|
||||
export type {
|
||||
CatalogSearchResultListItemProps,
|
||||
CatalogResultListItemProps,
|
||||
} from './CatalogSearchResultListItem';
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
export * from './components/AboutCard';
|
||||
export * from './components/CatalogKindHeader';
|
||||
export * from './components/CatalogResultListItem';
|
||||
export * from './components/CatalogSearchResultListItem';
|
||||
export * from './components/CatalogTable';
|
||||
export * from './components/CatalogTable/columns';
|
||||
export * from './components/EntityLayout';
|
||||
|
||||
Reference in New Issue
Block a user