Merge pull request #9779 from backstage/jhaals/dep-useEntityTypeFilter

Deprecate EntityTypeReturn type
This commit is contained in:
Fredrik Adelöw
2022-02-24 11:54:59 +01:00
committed by GitHub
3 changed files with 23 additions and 4 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-catalog-react': patch
---
Deprecated the `EntityTypeReturn` type and inlined the return type to `useEntityTypeFilter` as the type and function name does not align
+8 -2
View File
@@ -410,7 +410,7 @@ export interface EntityTypePickerProps {
initialFilter?: string;
}
// @public (undocumented)
// @public @deprecated (undocumented)
export type EntityTypeReturn = {
loading: boolean;
error?: Error;
@@ -572,7 +572,13 @@ export function useEntityPermission(permission: Permission): {
};
// @public
export function useEntityTypeFilter(): EntityTypeReturn;
export function useEntityTypeFilter(): {
loading: boolean;
error?: Error;
availableTypes: string[];
selectedTypes: string[];
setSelectedTypes: (types: string[]) => void;
};
// @public @deprecated
export function useOwnedEntities(allowedKinds?: string[]): {
@@ -23,7 +23,9 @@ import { catalogApiRef } from '../api';
import { useEntityList } from './useEntityListProvider';
import { EntityTypeFilter } from '../filters';
/** @public */
/** @public
* @deprecated type inlined with {@link useEntityTypeFilter}.
*/
export type EntityTypeReturn = {
loading: boolean;
error?: Error;
@@ -37,7 +39,13 @@ export type EntityTypeReturn = {
* based on the selected EntityKindFilter.
* @public
*/
export function useEntityTypeFilter(): EntityTypeReturn {
export function useEntityTypeFilter(): {
loading: boolean;
error?: Error;
availableTypes: string[];
selectedTypes: string[];
setSelectedTypes: (types: string[]) => void;
} {
const catalogApi = useApi(catalogApiRef);
const {
filters: { kind: kindFilter, type: typeFilter },