removed deprecated entity props

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2022-02-18 13:09:56 +01:00
parent 10a0a8046b
commit 2262fe19c9
41 changed files with 61 additions and 186 deletions
+4 -9
View File
@@ -31,9 +31,7 @@ export enum BuildStatus {
// Warning: (ae-missing-release-tag) "EntityGithubActionsContent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export const EntityGithubActionsContent: (_props: {
entity?: Entity | undefined;
}) => JSX.Element;
export const EntityGithubActionsContent: () => JSX.Element;
// Warning: (ae-missing-release-tag) "EntityLatestGithubActionRunCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
@@ -42,7 +40,6 @@ export const EntityLatestGithubActionRunCard: ({
branch,
variant,
}: {
entity?: Entity | undefined;
branch: string;
variant?: InfoCardVariants | undefined;
}) => JSX.Element;
@@ -54,7 +51,6 @@ export const EntityLatestGithubActionsForBranchCard: ({
branch,
variant,
}: {
entity?: Entity | undefined;
branch: string;
variant?: InfoCardVariants | undefined;
}) => JSX.Element;
@@ -315,7 +311,7 @@ export type Jobs = {
export const LatestWorkflowRunCard: ({
branch,
variant,
}: Props_3) => JSX.Element;
}: Props_2) => JSX.Element;
// Warning: (ae-missing-release-tag) "LatestWorkflowsForBranchCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
@@ -323,7 +319,7 @@ export const LatestWorkflowRunCard: ({
export const LatestWorkflowsForBranchCard: ({
branch,
variant,
}: Props_3) => JSX.Element;
}: Props_2) => JSX.Element;
// Warning: (ae-missing-release-tag) "RecentWorkflowRunsCard" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
@@ -335,11 +331,10 @@ export const RecentWorkflowRunsCard: ({
variant,
}: Props) => JSX.Element;
// Warning: (ae-forgotten-export) The symbol "Props" needs to be exported by the entry point index.d.ts
// Warning: (ae-missing-release-tag) "Router" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export const Router: (_props: Props_2) => JSX.Element;
export const Router: () => JSX.Element;
// Warning: (ae-missing-release-tag) "Step" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Entity } from '@backstage/catalog-model';
import { readGitHubIntegrationConfigs } from '@backstage/integration';
import { useEntity } from '@backstage/plugin-catalog-react';
import {
@@ -122,8 +121,6 @@ export const LatestWorkflowRunCard = ({
};
type Props = {
/** @deprecated The entity is now grabbed from context instead */
entity?: Entity;
branch: string;
variant?: InfoCardVariants;
};
@@ -75,7 +75,7 @@ describe('<RecentWorkflowRunsCard />', () => {
jest.resetAllMocks();
});
const renderSubject = (props: RecentWorkflowRunsCardProps = { entity }) =>
const renderSubject = (props: RecentWorkflowRunsCardProps = {}) =>
render(
<ThemeProvider theme={lightTheme}>
<MemoryRouter>
@@ -85,7 +85,7 @@ describe('<RecentWorkflowRunsCard />', () => {
[configApiRef, configApi],
]}
>
<EntityProvider entity={props.entity!}>
<EntityProvider entity={entity}>
<RecentWorkflowRunsCard {...props} />
</EntityProvider>
</TestApiProvider>
@@ -113,7 +113,7 @@ describe('<RecentWorkflowRunsCard />', () => {
it('requests only the required number of workflow runs', async () => {
const limit = 3;
renderSubject({ entity, limit });
renderSubject({ limit });
expect(useWorkflowRuns).toHaveBeenCalledWith(
expect.objectContaining({ initialPageSize: limit }),
);
@@ -128,7 +128,7 @@ describe('<RecentWorkflowRunsCard />', () => {
it('filters workflows by branch if one is specified', async () => {
const branch = 'master';
renderSubject({ entity, branch });
renderSubject({ branch });
expect(useWorkflowRuns).toHaveBeenCalledWith(
expect.objectContaining({ branch }),
);
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Entity } from '@backstage/catalog-model';
import { readGitHubIntegrationConfigs } from '@backstage/integration';
import { useEntity } from '@backstage/plugin-catalog-react';
import React, { useEffect } from 'react';
@@ -34,8 +33,6 @@ import {
const firstLine = (message: string): string => message.split('\n')[0];
export type Props = {
/** @deprecated The entity is now grabbed from context instead */
entity?: Entity;
branch?: string;
dense?: boolean;
limit?: number;
@@ -26,12 +26,7 @@ import { MissingAnnotationEmptyState } from '@backstage/core-components';
export const isGithubActionsAvailable = (entity: Entity) =>
Boolean(entity.metadata.annotations?.[GITHUB_ACTIONS_ANNOTATION]);
type Props = {
/** @deprecated The entity is now grabbed from context instead */
entity?: Entity;
};
export const Router = (_props: Props) => {
export const Router = () => {
const { entity } = useEntity();
if (!isGithubActionsAvailable(entity)) {