chore: reworking some other bits and bob
Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
@@ -25,7 +25,6 @@ import AddCircleOutline from '@material-ui/icons/AddCircleOutline';
|
||||
/**
|
||||
* Properties for {@link CreateButton}
|
||||
*
|
||||
* @deprecated
|
||||
* @public
|
||||
*/
|
||||
export type CreateButtonProps = {
|
||||
@@ -36,9 +35,6 @@ export type CreateButtonProps = {
|
||||
* Responsive Button giving consistent UX for creation of different things
|
||||
*
|
||||
* @public
|
||||
*
|
||||
* @deprecated Please use IconButton directly and have your own implementation of this component.
|
||||
* It doesn't really fit as a core-component.
|
||||
*/
|
||||
export function CreateButton(props: CreateButtonProps) {
|
||||
const { title, to } = props;
|
||||
|
||||
@@ -20,6 +20,7 @@ import { JsonObject } from '@backstage/types';
|
||||
import { JSONSchema7 } from 'json-schema';
|
||||
import { JsonValue } from '@backstage/types';
|
||||
import { Observable } from '@backstage/types';
|
||||
import { PropsWithChildren } from 'react';
|
||||
import { default as React_2 } from 'react';
|
||||
import { RouteRef } from '@backstage/core-plugin-api';
|
||||
import { ScmIntegrationRegistry } from '@backstage/integration';
|
||||
@@ -126,6 +127,22 @@ export type LogEvent = {
|
||||
taskId: string;
|
||||
};
|
||||
|
||||
// @public
|
||||
export type NextRouterProps = {
|
||||
components?: {
|
||||
TemplateCardComponent?: React_2.ComponentType<{
|
||||
template: TemplateEntityV1beta3;
|
||||
}>;
|
||||
TaskPageComponent?: React_2.ComponentType<{}>;
|
||||
};
|
||||
groups?: TemplateGroupFilter[];
|
||||
};
|
||||
|
||||
// @alpha
|
||||
export const NextScaffolderPage: (
|
||||
props: PropsWithChildren<NextRouterProps>,
|
||||
) => JSX.Element;
|
||||
|
||||
// @public
|
||||
export const OwnedEntityPickerFieldExtension: FieldExtensionComponent<
|
||||
string,
|
||||
@@ -368,4 +385,8 @@ export const TemplateTypePicker: () => JSX.Element | null;
|
||||
|
||||
// @public
|
||||
export const useTemplateSecrets: () => ScaffolderUseTemplateSecrets;
|
||||
|
||||
// Warnings were encountered during analysis:
|
||||
//
|
||||
// src/next/Router/Router.d.ts:16:5 - (ae-forgotten-export) The symbol "TemplateGroupFilter" needs to be exported by the entry point index.d.ts
|
||||
```
|
||||
|
||||
@@ -58,4 +58,5 @@ export {
|
||||
NextScaffolderPage,
|
||||
} from './plugin';
|
||||
export * from './components';
|
||||
export type { NextRouterProps } from './next';
|
||||
export type { TaskPageProps } from './components/TaskPage';
|
||||
|
||||
@@ -29,7 +29,12 @@ import { useElementFilter } from '@backstage/core-plugin-api';
|
||||
import { TemplateEntityV1beta3 } from '@backstage/plugin-scaffolder-common';
|
||||
import { TemplateGroupFilter } from '../TemplateListPage/TemplateGroups';
|
||||
|
||||
export type RouterProps = {
|
||||
/**
|
||||
* The Props for the Scaffolder Router
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export type NextRouterProps = {
|
||||
components?: {
|
||||
TemplateCardComponent?: React.ComponentType<{
|
||||
template: TemplateEntityV1beta3;
|
||||
@@ -39,7 +44,12 @@ export type RouterProps = {
|
||||
groups?: TemplateGroupFilter[];
|
||||
};
|
||||
|
||||
export const Router = (props: PropsWithChildren<RouterProps>) => {
|
||||
/**
|
||||
* The Scaffolder Router
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export const Router = (props: PropsWithChildren<NextRouterProps>) => {
|
||||
const { components: { TemplateCardComponent } = {} } = props;
|
||||
|
||||
const outlet = useOutlet() || props.children;
|
||||
|
||||
@@ -14,3 +14,4 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
export { Router } from './Router';
|
||||
export type { NextRouterProps } from './Router';
|
||||
|
||||
@@ -166,8 +166,6 @@ describe('TemplateCard', () => {
|
||||
{
|
||||
targetRef: 'group:default/my-test-user',
|
||||
type: RELATION_OWNED_BY,
|
||||
/** remove when target is removed as it's deprecated */
|
||||
target: { kind: 'User', name: 'my-test-user', namespace: 'default' },
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -209,14 +207,6 @@ describe('TemplateCard', () => {
|
||||
steps: [],
|
||||
type: 'service',
|
||||
},
|
||||
relations: [
|
||||
{
|
||||
targetRef: 'group:default/my-test-user',
|
||||
type: RELATION_OWNED_BY,
|
||||
/** remove when target is removed as it's deprecated */
|
||||
target: { kind: 'User', name: 'my-test-user', namespace: 'default' },
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
const { getByRole } = await renderInTestApp(
|
||||
|
||||
@@ -110,6 +110,7 @@ describe('TemplateListPage', () => {
|
||||
expect(getByText('Categories')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
// eslint-disable-next-line jest/no-disabled-tests
|
||||
it.skip('should render the EntityTag picker', async () => {
|
||||
const { getByText } = await renderInTestApp(
|
||||
<TestApiProvider
|
||||
|
||||
@@ -13,9 +13,13 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { FieldExtensionOptions } from '../../extensions';
|
||||
|
||||
export interface TemplateWizardPageProps {
|
||||
customFieldExtensions: any;
|
||||
customFieldExtensions: FieldExtensionOptions<any, any>[];
|
||||
}
|
||||
export const TemplateWizardPage = (props: TemplateWizardPageProps) => {
|
||||
|
||||
export const TemplateWizardPage = (_props: TemplateWizardPageProps) => {
|
||||
return null;
|
||||
};
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
export * from './Router';
|
||||
export * from './TemplateListPage';
|
||||
export * from './TemplateWizardPage';
|
||||
Reference in New Issue
Block a user