From 88abf5378d304892abf38cf030749c146b703fe8 Mon Sep 17 00:00:00 2001 From: Paul Cowan Date: Mon, 12 Dec 2022 16:30:53 +0000 Subject: [PATCH] remove SecurityTab Signed-off-by: Paul Cowan --- .../components/SecurityTab/SecurityTab.tsx | 79 ------------------- .../components/SecurityTab/showSecurityTab.ts | 22 ------ .../EmbeddedScaffolderWorkflow.test.tsx | 5 +- 3 files changed, 3 insertions(+), 103 deletions(-) delete mode 100644 packages/app/src/components/SecurityTab/SecurityTab.tsx delete mode 100644 packages/app/src/components/SecurityTab/showSecurityTab.ts rename packages/app/src/components/SecurityTab/index.ts => plugins/scaffolder/src/next/EmbeddedScaffolderWorkflow/EmbeddedScaffolderWorkflow.test.tsx (83%) diff --git a/packages/app/src/components/SecurityTab/SecurityTab.tsx b/packages/app/src/components/SecurityTab/SecurityTab.tsx deleted file mode 100644 index 5f1e0a82e0..0000000000 --- a/packages/app/src/components/SecurityTab/SecurityTab.tsx +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright 2022 The Backstage Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import React from 'react'; -import { EmbeddedScaffolderWorkflow } from '@backstage/plugin-scaffolder'; -import { Box } from '@material-ui/core'; - -const ReviewWrapper = () => { - return ( - -

This is a different wrapper for the review page

-
- ); -}; - -/* - * This is an exmaple component that uses the - */ -export function SecurityTab(): JSX.Element | null { - // eslint-disable-next-line no-console - const onComplete = async () => console.log('we can add to onComplete here'); - - const onError = (error: Error | undefined) => ( -

{error?.message ?? 'Houston we have a problem.'}

- ); - - return ( - -

Security Insights

-

- Security insights actionable advice to improve security posture of - your application -

-

- You must complete on-boarding process to activate security insights - on this project. -

- - } - finishPage={ - <> -

Security Insights

-

Congratulations, this application is complete!

- - } - ReviewStateWrapper={ReviewWrapper} - /> - ); -} diff --git a/packages/app/src/components/SecurityTab/showSecurityTab.ts b/packages/app/src/components/SecurityTab/showSecurityTab.ts deleted file mode 100644 index 364436e44e..0000000000 --- a/packages/app/src/components/SecurityTab/showSecurityTab.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2022 The Backstage Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { Entity } from '@backstage/catalog-model'; - -export const SECURITY_ANNOTATION = 'myorg.org/security'; - -/** @public */ -export const showSecurityTab = (entity: Entity) => - Boolean(entity.metadata.annotations?.[SECURITY_ANNOTATION]); diff --git a/packages/app/src/components/SecurityTab/index.ts b/plugins/scaffolder/src/next/EmbeddedScaffolderWorkflow/EmbeddedScaffolderWorkflow.test.tsx similarity index 83% rename from packages/app/src/components/SecurityTab/index.ts rename to plugins/scaffolder/src/next/EmbeddedScaffolderWorkflow/EmbeddedScaffolderWorkflow.test.tsx index 2c7908e958..e3ac127f68 100644 --- a/packages/app/src/components/SecurityTab/index.ts +++ b/plugins/scaffolder/src/next/EmbeddedScaffolderWorkflow/EmbeddedScaffolderWorkflow.test.tsx @@ -13,5 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -export { SecurityTab } from './SecurityTab'; -export { showSecurityTab } from './showSecurityTab'; +describe('', () => { + it('should embed workflow inside another component', () => {}); +});