remove SecurityTab

Signed-off-by: Paul Cowan <paul.cowan@cutting.scot>
This commit is contained in:
Paul Cowan
2022-12-12 16:30:53 +00:00
parent 8948615130
commit 88abf5378d
3 changed files with 3 additions and 103 deletions
@@ -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 (
<Box display="flex" alignItems="center" flexDirection="column">
<h1>This is a different wrapper for the review page</h1>
</Box>
);
};
/*
* This is an exmaple component that uses the <EmbeddedScaffolderWorkflow />
*/
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) => (
<h2>{error?.message ?? 'Houston we have a problem.'}</h2>
);
return (
<EmbeddedScaffolderWorkflow
title="Altered title"
description={`
## This is markdown
- overriding the template description
`}
onComplete={onComplete}
onError={onError}
namespace="default"
templateName="docs-template"
initialFormState={{
name: 'prefilled-name',
description: 'prefilled description',
owner: 'acme-corp',
repoUrl: 'github.com?owner=component&repo=component',
}}
frontPage={
<>
<h1>Security Insights</h1>
<p>
Security insights actionable advice to improve security posture of
your application
</p>
<p>
You must complete on-boarding process to activate security insights
on this project.
</p>
</>
}
finishPage={
<>
<h1>Security Insights</h1>
<p>Congratulations, this application is complete!</p>
</>
}
ReviewStateWrapper={ReviewWrapper}
/>
);
}
@@ -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]);
@@ -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('<EmbeddedScaffolderWorkflow />', () => {
it('should embed workflow inside another component', () => {});
});