remove React imports and run api reports

Signed-off-by: Mark Dunphy <markd@spotify.com>
This commit is contained in:
Mark Dunphy
2025-04-08 13:20:53 -04:00
parent f84401f9fa
commit 60c2ec168d
7 changed files with 17 additions and 23 deletions
+5 -9
View File
@@ -11,7 +11,7 @@ import { ExtensionBlueprint } from '@backstage/frontend-plugin-api';
import { ExtensionDefinition } from '@backstage/frontend-plugin-api';
import { JsonValue } from '@backstage/types';
import { JSX as JSX_2 } from 'react';
import { default as React_2 } from 'react';
import { ReactNode } from 'react';
import { ResourcePermission } from '@backstage/plugin-permission-common';
import { RouteRef } from '@backstage/frontend-plugin-api';
import { TranslationRef } from '@backstage/core-plugin-api/alpha';
@@ -331,11 +331,7 @@ export const EntityContextMenuItemBlueprint: ExtensionBlueprint<{
kind: 'entity-context-menu-item';
name: undefined;
params: EntityContextMenuItemParams;
output: ConfigurableExtensionDataRef<
React_2.JSX.Element,
'core.reactElement',
{}
>;
output: ConfigurableExtensionDataRef<JSX_2.Element, 'core.reactElement', {}>;
inputs: {};
config: {};
configInput: {};
@@ -345,7 +341,7 @@ export const EntityContextMenuItemBlueprint: ExtensionBlueprint<{
// @alpha (undocumented)
export type EntityContextMenuItemParams = {
useProps: UseProps;
icon: React_2.JSX.Element;
icon: JSX_2.Element;
};
// @alpha (undocumented)
@@ -431,12 +427,12 @@ export function useEntityPermission(
// @alpha (undocumented)
export type UseProps = () =>
| {
title: React_2.ReactNode;
title: ReactNode;
href: string;
disabled?: boolean;
}
| {
title: React_2.ReactNode;
title: ReactNode;
onClick: () => void | Promise<void>;
disabled?: boolean;
};
@@ -13,8 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React from 'react';
import { EntityContextMenuItemBlueprint } from './EntityContextMenuItemBlueprint';
describe('EntityContextMenuItemBlueprint', () => {
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import React from 'react';
import { ReactNode, JSX } from 'react';
import {
coreExtensionData,
createExtensionBlueprint,
@@ -28,12 +28,12 @@ import { useEntityContextMenu } from '../../hooks/useEntityContextMenu';
/** @alpha */
export type UseProps = () =>
| {
title: React.ReactNode;
title: ReactNode;
href: string;
disabled?: boolean;
}
| {
title: React.ReactNode;
title: ReactNode;
onClick: () => void | Promise<void>;
disabled?: boolean;
};
@@ -41,7 +41,7 @@ export type UseProps = () =>
/** @alpha */
export type EntityContextMenuItemParams = {
useProps: UseProps;
icon: React.JSX.Element;
icon: JSX.Element;
};
/** @alpha */
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React from 'react';
import { ReactNode } from 'react';
import { useEntityContextMenu } from './useEntityContextMenu';
import { renderHook } from '@testing-library/react';
import {
@@ -29,7 +29,7 @@ const Provider = ({
children,
onMenuClose,
}: {
children: React.ReactNode;
children: ReactNode;
onMenuClose: () => void;
}) => (
<Context.Provider value={createVersionedValueMap({ 1: { onMenuClose } })}>
+2 -2
View File
@@ -403,9 +403,9 @@ export interface EntityLayoutProps {
// (undocumented)
children?: ReactNode;
// (undocumented)
NotFoundComponent?: ReactNode;
// (undocumented)
extraMenuItems?: JSX.Element[];
// (undocumented)
NotFoundComponent?: ReactNode;
parentEntityRelations?: string[];
// Warning: (ae-forgotten-export) The symbol "EntityContextMenuOptions" needs to be exported by the entry point index.d.ts
//
@@ -14,7 +14,6 @@
* limitations under the License.
*/
import React from 'react';
import {
EntityContextMenuItemBlueprint,
useEntityPermission,
@@ -37,6 +36,7 @@ import {
} from '@backstage/plugin-catalog-react';
import { rootRouteRef, unregisterRedirectRouteRef } from '../routes';
import { catalogEntityDeletePermission } from '@backstage/plugin-catalog-common/alpha';
import { useEffect } from 'react';
export const copyEntityUrlContextMenuItem = EntityContextMenuItemBlueprint.make(
{
@@ -48,7 +48,7 @@ export const copyEntityUrlContextMenuItem = EntityContextMenuItemBlueprint.make(
const alertApi = useApi(alertApiRef);
const { t } = useTranslationRef(catalogTranslationRef);
React.useEffect(() => {
useEffect(() => {
if (!copyState.error && copyState.value) {
alertApi.post({
message: t('entityContextMenu.copiedMessage'),
@@ -13,11 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React from 'react';
import {
createVersionedContext,
createVersionedValueMap,
} from '@backstage/version-bridge';
import { ReactNode } from 'react';
/** @internal */
export type EntityContextMenuContextValue = {
@@ -30,7 +30,7 @@ const EntityContextMenuContext = createVersionedContext<{
/** @internal */
export interface EntityContextMenuProviderProps {
children: React.ReactNode;
children: ReactNode;
onMenuClose: () => void;
}