chore: more moving out into the other packages
Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
@@ -38,6 +38,8 @@
|
||||
"@backstage/core-components": "workspace:^",
|
||||
"@backstage/core-plugin-api": "workspace:^",
|
||||
"@backstage/errors": "workspace:^",
|
||||
"@backstage/plugin-catalog-react": "workspace:^",
|
||||
"@backstage/plugin-scaffolder-common": "workspace:^",
|
||||
"@backstage/theme": "workspace:^",
|
||||
"@backstage/types": "workspace:^",
|
||||
"@backstage/version-bridge": "workspace:^",
|
||||
@@ -56,6 +58,7 @@
|
||||
"json-schema-library": "^7.3.9",
|
||||
"lodash": "^4.17.21",
|
||||
"qs": "^6.9.4",
|
||||
"zen-observable": "^0.10.0",
|
||||
"zod": "~3.18.0",
|
||||
"zod-to-json-schema": "~3.18.0"
|
||||
},
|
||||
@@ -67,8 +70,8 @@
|
||||
"devDependencies": {
|
||||
"@backstage/cli": "workspace:^",
|
||||
"@backstage/core-app-api": "workspace:^",
|
||||
"@backstage/plugin-catalog": "workspace:^",
|
||||
"@backstage/plugin-catalog-common": "workspace:^",
|
||||
"@backstage/plugin-scaffolder-common": "workspace:^",
|
||||
"@backstage/test-utils": "workspace:^",
|
||||
"@testing-library/jest-dom": "^5.10.1",
|
||||
"@testing-library/react": "^12.1.3",
|
||||
|
||||
@@ -15,12 +15,6 @@
|
||||
*/
|
||||
import { ApiHolder } from '@backstage/core-plugin-api';
|
||||
import { FieldValidation, FieldProps } from '@rjsf/core';
|
||||
import {
|
||||
UIOptionsType,
|
||||
FieldProps as FieldPropsV5,
|
||||
UiSchema as UiSchemaV5,
|
||||
FieldValidation as FieldValidationV5,
|
||||
} from '@rjsf/utils';
|
||||
import { JSONSchema7 } from 'json-schema';
|
||||
|
||||
/**
|
||||
|
||||
@@ -16,5 +16,5 @@
|
||||
|
||||
export * from './routes';
|
||||
export * from './extensions';
|
||||
|
||||
export * from './next';
|
||||
export * from './types';
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@
|
||||
import React from 'react';
|
||||
import { ReviewState } from './ReviewState';
|
||||
import { render } from '@testing-library/react';
|
||||
import { ParsedTemplateSchema } from './useTemplateSchema';
|
||||
import { ParsedTemplateSchema } from '../../hooks/useTemplateSchema';
|
||||
|
||||
describe('ReviewState', () => {
|
||||
it('should render the text as normal with no options', () => {
|
||||
+5
-1
@@ -16,14 +16,18 @@
|
||||
import React from 'react';
|
||||
import { StructuredMetadataTable } from '@backstage/core-components';
|
||||
import { JsonObject } from '@backstage/types';
|
||||
import { ParsedTemplateSchema } from './useTemplateSchema';
|
||||
import { Draft07 as JSONSchema } from 'json-schema-library';
|
||||
import { ParsedTemplateSchema } from '../../hooks/useTemplateSchema';
|
||||
|
||||
interface ReviewStateProps {
|
||||
schemas: ParsedTemplateSchema[];
|
||||
formState: JsonObject;
|
||||
}
|
||||
|
||||
/**
|
||||
* The ReviewState component used by the Stepper
|
||||
* @alpha
|
||||
*/
|
||||
export const ReviewState = (props: ReviewStateProps) => {
|
||||
const reviewData = Object.fromEntries(
|
||||
Object.entries(props.formState).map(([key, value]) => {
|
||||
@@ -0,0 +1,16 @@
|
||||
/*
|
||||
* 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 { ReviewState } from './ReviewState';
|
||||
@@ -33,7 +33,7 @@ import { NextFieldExtensionOptions } from '../../extensions';
|
||||
import { TemplateParameterSchema } from '../../../types';
|
||||
import { createAsyncValidators } from './createAsyncValidators';
|
||||
import { useTemplateSchema } from '../../hooks/useTemplateSchema';
|
||||
import { ReviewState } from './ReviewState';
|
||||
import { ReviewState } from '../ReviewState';
|
||||
import validator from '@rjsf/validator-ajv6';
|
||||
import { selectedTemplateRouteRef } from '../../../routes';
|
||||
import { useFormData } from '../../hooks/useFormData';
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { JsonObject } from '@backstage/types';
|
||||
import { NextCustomFieldValidator } from '../../../extensions';
|
||||
import { NextCustomFieldValidator } from '../../extensions';
|
||||
import { createAsyncValidators } from './createAsyncValidators';
|
||||
|
||||
describe('createAsyncValidators', () => {
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
import { FieldValidation } from '@rjsf/utils';
|
||||
import { JsonObject } from '@backstage/types';
|
||||
import { ApiHolder } from '@backstage/core-plugin-api';
|
||||
import { NextCustomFieldValidator } from '../../../extensions';
|
||||
import { Draft07 as JSONSchema } from 'json-schema-library';
|
||||
import { createFieldValidation } from './schema';
|
||||
import { createFieldValidation } from '../../lib';
|
||||
import { NextCustomFieldValidator } from '../../extensions';
|
||||
|
||||
export const createAsyncValidators = (
|
||||
rootSchema: JsonObject,
|
||||
|
||||
+1
-1
@@ -25,9 +25,9 @@ import {
|
||||
} from '@backstage/test-utils';
|
||||
import { TemplateCard } from './TemplateCard';
|
||||
import React from 'react';
|
||||
import { nextRouteRef } from '@backstage/plugin-scaffolder-react';
|
||||
import { TemplateEntityV1beta3 } from '@backstage/plugin-scaffolder-common';
|
||||
import { RELATION_OWNED_BY } from '@backstage/catalog-model';
|
||||
import { nextRouteRef } from '../../../routes';
|
||||
|
||||
describe('TemplateCard', () => {
|
||||
it('should render the card title', async () => {
|
||||
+1
-1
@@ -42,7 +42,7 @@ import React from 'react';
|
||||
import {
|
||||
nextSelectedTemplateRouteRef,
|
||||
viewTechDocRouteRef,
|
||||
} from '@backstage/plugin-scaffolder-react';
|
||||
} from '../../../routes';
|
||||
import { CardHeader } from './CardHeader';
|
||||
import { CardLink } from './CardLink';
|
||||
|
||||
@@ -13,4 +13,6 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
export { Stepper } from './Stepper';
|
||||
export * from './Stepper';
|
||||
export * from './TemplateCard';
|
||||
export * from './ReviewState';
|
||||
|
||||
@@ -21,10 +21,7 @@ import {
|
||||
} from './types';
|
||||
import { Extension, attachComponentData } from '@backstage/core-plugin-api';
|
||||
import { UIOptionsType } from '@rjsf/utils';
|
||||
import { FieldExtensionComponent } from '../../extensions';
|
||||
|
||||
export const FIELD_EXTENSION_WRAPPER_KEY = 'scaffolder.extensions.wrapper.v1';
|
||||
export const FIELD_EXTENSION_KEY = 'scaffolder.extensions.field.v1';
|
||||
import { FieldExtensionComponent, FIELD_EXTENSION_KEY } from '../../extensions';
|
||||
|
||||
/**
|
||||
* Method for creating field extensions that can be used in the scaffolder
|
||||
|
||||
@@ -13,12 +13,12 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { TemplateParameterSchema } from '../../../types';
|
||||
import { useTemplateSchema } from './useTemplateSchema';
|
||||
import { renderHook } from '@testing-library/react-hooks';
|
||||
import { TestApiProvider } from '@backstage/test-utils';
|
||||
import React from 'react';
|
||||
import { featureFlagsApiRef } from '@backstage/core-plugin-api';
|
||||
import { TemplateParameterSchema } from '../../types';
|
||||
|
||||
describe('useTemplateSchema', () => {
|
||||
it('should generate the correct schema', () => {
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
import { featureFlagsApiRef, useApi } from '@backstage/core-plugin-api';
|
||||
import { JsonObject } from '@backstage/types';
|
||||
import { UiSchema } from '@rjsf/utils';
|
||||
import { TemplateParameterSchema } from '../../../types';
|
||||
import { extractSchemaFromStep } from './schema';
|
||||
import { TemplateParameterSchema } from '../../types';
|
||||
import { extractSchemaFromStep } from '../lib';
|
||||
|
||||
export interface ParsedTemplateSchema {
|
||||
uiSchema: UiSchema;
|
||||
@@ -26,6 +26,7 @@ export interface ParsedTemplateSchema {
|
||||
title: string;
|
||||
description?: string;
|
||||
}
|
||||
|
||||
export const useTemplateSchema = (
|
||||
manifest: TemplateParameterSchema,
|
||||
): { steps: ParsedTemplateSchema[] } => {
|
||||
|
||||
@@ -15,3 +15,5 @@
|
||||
*/
|
||||
export * from './components';
|
||||
export * from './extensions';
|
||||
export * from './types';
|
||||
export * from './lib';
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
/*
|
||||
* 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 { extractSchemaFromStep, createFieldValidation } from './schema';
|
||||
@@ -13,3 +13,21 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { JsonObject } from '@backstage/types';
|
||||
|
||||
/**
|
||||
* The shape of each entry of parameters which gets rendered
|
||||
* as a separate step in the wizard input
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export type TemplateParameterSchema = {
|
||||
title: string;
|
||||
description?: string;
|
||||
steps: Array<{
|
||||
title: string;
|
||||
description?: string;
|
||||
schema: JsonObject;
|
||||
}>;
|
||||
};
|
||||
|
||||
@@ -30,7 +30,6 @@ import {
|
||||
ListActionsResponse,
|
||||
LogEvent,
|
||||
ScaffolderApi,
|
||||
TemplateParameterSchema,
|
||||
ScaffolderScaffoldOptions,
|
||||
ScaffolderScaffoldResponse,
|
||||
ScaffolderStreamLogsOptions,
|
||||
@@ -40,6 +39,8 @@ import {
|
||||
ScaffolderDryRunOptions,
|
||||
ScaffolderDryRunResponse,
|
||||
} from './types';
|
||||
|
||||
import { TemplateParameterSchema } from '@backstage/plugin-scaffolder-react';
|
||||
import queryString from 'qs';
|
||||
|
||||
/**
|
||||
|
||||
@@ -39,8 +39,10 @@ import * as fieldOverrides from './FieldOverrides';
|
||||
import { LayoutOptions } from '../../layouts';
|
||||
import { ReviewStepProps } from '../types';
|
||||
import { ReviewStep } from './ReviewStep';
|
||||
import { selectedTemplateRouteRef } from '@backstage/plugin-scaffolder-react';
|
||||
import { extractSchemaFromStep } from '../../next/TemplateWizardPage/Stepper/schema';
|
||||
import {
|
||||
selectedTemplateRouteRef,
|
||||
extractSchemaFromStep,
|
||||
} from '@backstage/plugin-scaffolder-react';
|
||||
|
||||
const Form = withTheme(MuiTheme);
|
||||
|
||||
|
||||
@@ -24,13 +24,7 @@ import { TaskPage } from './TaskPage';
|
||||
import { ActionsPage } from './ActionsPage';
|
||||
import { SecretsContextProvider } from './secrets/SecretsContext';
|
||||
import { TemplateEditorPage } from './TemplateEditorPage';
|
||||
|
||||
import {
|
||||
DEFAULT_SCAFFOLDER_FIELD_EXTENSIONS,
|
||||
FIELD_EXTENSION_KEY,
|
||||
FIELD_EXTENSION_WRAPPER_KEY,
|
||||
FieldExtensionOptions,
|
||||
} from '../extensions';
|
||||
import { DEFAULT_SCAFFOLDER_FIELD_EXTENSIONS } from '../extensions/default';
|
||||
import {
|
||||
useElementFilter,
|
||||
useRouteRef,
|
||||
@@ -43,6 +37,9 @@ import {
|
||||
scaffolderListTaskRouteRef,
|
||||
scaffolderTaskRouteRef,
|
||||
selectedTemplateRouteRef,
|
||||
FIELD_EXTENSION_KEY,
|
||||
FIELD_EXTENSION_WRAPPER_KEY,
|
||||
FieldExtensionOptions,
|
||||
} from '@backstage/plugin-scaffolder-react';
|
||||
import { ListTasksPage } from './ListTasksPage';
|
||||
import { LayoutOptions, LAYOUTS_KEY, LAYOUTS_WRAPPER_KEY } from '../layouts';
|
||||
|
||||
@@ -33,7 +33,7 @@ import { Theme as MuiTheme } from '@rjsf/material-ui';
|
||||
import CodeMirror from '@uiw/react-codemirror';
|
||||
import React, { useCallback, useMemo, useState } from 'react';
|
||||
import yaml from 'yaml';
|
||||
import { FieldExtensionOptions } from '../../extensions';
|
||||
import { FieldExtensionOptions } from '@backstage/plugin-scaffolder-react';
|
||||
import * as fieldOverrides from '../MultistepJsonForm/FieldOverrides';
|
||||
import { TemplateEditorForm } from './TemplateEditorForm';
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
import { makeStyles } from '@material-ui/core';
|
||||
import React, { useState } from 'react';
|
||||
import { FieldExtensionOptions } from '../../extensions';
|
||||
import { FieldExtensionOptions } from '@backstage/plugin-scaffolder-react';
|
||||
import type { LayoutOptions } from '../../layouts';
|
||||
import { TemplateDirectoryAccess } from '../../lib/filesystem';
|
||||
import { DirectoryEditorProvider } from './DirectoryEditorContext';
|
||||
|
||||
@@ -19,9 +19,11 @@ import { makeStyles } from '@material-ui/core/styles';
|
||||
import React, { Component, ReactNode, useMemo, useState } from 'react';
|
||||
import useDebounce from 'react-use/lib/useDebounce';
|
||||
import yaml from 'yaml';
|
||||
import { FieldExtensionOptions } from '../../extensions';
|
||||
import {
|
||||
FieldExtensionOptions,
|
||||
TemplateParameterSchema,
|
||||
} from '@backstage/plugin-scaffolder-react';
|
||||
import { LayoutOptions } from '../../layouts';
|
||||
import { TemplateParameterSchema } from '../../types';
|
||||
import { MultistepJsonForm } from '../MultistepJsonForm';
|
||||
import { createValidator } from '../TemplatePage';
|
||||
import { useDirectoryEditor } from './DirectoryEditorContext';
|
||||
|
||||
@@ -23,7 +23,7 @@ import { CustomFieldExplorer } from './CustomFieldExplorer';
|
||||
import { TemplateEditorIntro } from './TemplateEditorIntro';
|
||||
import { TemplateEditor } from './TemplateEditor';
|
||||
import { TemplateFormPreviewer } from './TemplateFormPreviewer';
|
||||
import { FieldExtensionOptions } from '../../extensions';
|
||||
import { FieldExtensionOptions } from '@backstage/plugin-scaffolder-react';
|
||||
import type { LayoutOptions } from '../../layouts';
|
||||
|
||||
type Selection =
|
||||
|
||||
@@ -32,7 +32,7 @@ import CloseIcon from '@material-ui/icons/Close';
|
||||
import React, { useCallback, useState } from 'react';
|
||||
import useAsync from 'react-use/lib/useAsync';
|
||||
import yaml from 'yaml';
|
||||
import { FieldExtensionOptions } from '../../extensions';
|
||||
import { FieldExtensionOptions } from '@backstage/plugin-scaffolder-react';
|
||||
import { LayoutOptions } from '../../layouts';
|
||||
import { TemplateEditorForm } from './TemplateEditorForm';
|
||||
import { TemplateEditorTextArea } from './TemplateEditorTextArea';
|
||||
|
||||
@@ -20,12 +20,12 @@ import React, { ComponentType, useCallback, useContext, useState } from 'react';
|
||||
import { Navigate, useNavigate } from 'react-router-dom';
|
||||
import useAsync from 'react-use/lib/useAsync';
|
||||
import { scaffolderApiRef } from '../../api';
|
||||
import { FieldExtensionOptions } from '../../extensions';
|
||||
import { SecretsContext } from '../secrets/SecretsContext';
|
||||
import {
|
||||
rootRouteRef,
|
||||
scaffolderTaskRouteRef,
|
||||
selectedTemplateRouteRef,
|
||||
FieldExtensionOptions,
|
||||
} from '@backstage/plugin-scaffolder-react';
|
||||
import { MultistepJsonForm } from '../MultistepJsonForm';
|
||||
import { createValidator } from './createValidator';
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
|
||||
import { createValidator } from './createValidator';
|
||||
import { CustomFieldValidator } from '../../extensions';
|
||||
import { CustomFieldValidator } from '@backstage/plugin-scaffolder-react';
|
||||
import { ApiHolder } from '@backstage/core-plugin-api';
|
||||
import { FormValidation } from '@rjsf/core';
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { CustomFieldValidator } from '../../extensions';
|
||||
import { CustomFieldValidator } from '@backstage/plugin-scaffolder-react';
|
||||
import { FormValidation } from '@rjsf/core';
|
||||
import { JsonObject, JsonValue } from '@backstage/types';
|
||||
import { ApiHolder } from '@backstage/core-plugin-api';
|
||||
|
||||
@@ -19,7 +19,7 @@ import zodToJsonSchema from 'zod-to-json-schema';
|
||||
import {
|
||||
CustomFieldExtensionSchema,
|
||||
FieldExtensionComponentProps,
|
||||
} from '../../extensions';
|
||||
} from '@backstage/plugin-scaffolder-react';
|
||||
|
||||
/**
|
||||
* @public
|
||||
|
||||
@@ -36,19 +36,8 @@ export type {
|
||||
ScaffolderTask,
|
||||
ScaffolderTaskOutput,
|
||||
ScaffolderTaskStatus,
|
||||
TemplateParameterSchema,
|
||||
} from './types';
|
||||
export {
|
||||
createScaffolderFieldExtension,
|
||||
ScaffolderFieldExtensions,
|
||||
} from './extensions';
|
||||
export type {
|
||||
CustomFieldExtensionSchema,
|
||||
CustomFieldValidator,
|
||||
FieldExtensionOptions,
|
||||
FieldExtensionComponentProps,
|
||||
FieldExtensionComponent,
|
||||
} from './extensions';
|
||||
|
||||
export { createScaffolderLayout, ScaffolderLayouts } from './layouts';
|
||||
export type { LayoutOptions, LayoutTemplate, LayoutComponent } from './layouts';
|
||||
export {
|
||||
@@ -64,10 +53,23 @@ export {
|
||||
export * from './components';
|
||||
|
||||
export {
|
||||
createScaffolderFieldExtension,
|
||||
ScaffolderFieldExtensions,
|
||||
rootRouteRef,
|
||||
nextRouteRef,
|
||||
selectedTemplateRouteRef,
|
||||
nextSelectedTemplateRouteRef,
|
||||
createNextScaffolderFieldExtension,
|
||||
type TemplateParameterSchema,
|
||||
type NextCustomFieldValidator,
|
||||
type NextFieldExtensionOptions,
|
||||
type NextFieldExtensionComponentProps,
|
||||
type FormProps,
|
||||
type CustomFieldExtensionSchema,
|
||||
type CustomFieldValidator,
|
||||
type FieldExtensionOptions,
|
||||
type FieldExtensionComponentProps,
|
||||
type FieldExtensionComponent,
|
||||
} from '@backstage/plugin-scaffolder-react';
|
||||
|
||||
export type { TaskPageProps } from './components/TaskPage';
|
||||
@@ -76,10 +78,3 @@ export type { TaskPageProps } from './components/TaskPage';
|
||||
export { NextScaffolderPage } from './plugin';
|
||||
export type { NextRouterProps } from './next';
|
||||
export type { TemplateGroupFilter } from './next';
|
||||
export type { FormProps } from './next';
|
||||
export {
|
||||
createNextScaffolderFieldExtension,
|
||||
type NextCustomFieldValidator,
|
||||
type NextFieldExtensionOptions,
|
||||
type NextFieldExtensionComponentProps,
|
||||
} from './extensions';
|
||||
|
||||
@@ -21,7 +21,7 @@ import { renderInTestApp } from '@backstage/test-utils';
|
||||
import {
|
||||
createScaffolderFieldExtension,
|
||||
ScaffolderFieldExtensions,
|
||||
} from '../../extensions';
|
||||
} from '@backstage/plugin-scaffolder-react';
|
||||
import { scaffolderPlugin } from '../../plugin';
|
||||
|
||||
jest.mock('../TemplateListPage', () => ({
|
||||
|
||||
@@ -20,17 +20,17 @@ import { TemplateWizardPage } from '../TemplateWizardPage';
|
||||
import {
|
||||
FIELD_EXTENSION_WRAPPER_KEY,
|
||||
FIELD_EXTENSION_KEY,
|
||||
DEFAULT_SCAFFOLDER_FIELD_EXTENSIONS,
|
||||
NextFieldExtensionOptions,
|
||||
FieldExtensionOptions,
|
||||
} from '../../extensions';
|
||||
type FormProps,
|
||||
} from '@backstage/plugin-scaffolder-react';
|
||||
|
||||
import { useElementFilter } from '@backstage/core-plugin-api';
|
||||
import { TemplateEntityV1beta3 } from '@backstage/plugin-scaffolder-common';
|
||||
import { TemplateGroupFilter } from '../TemplateListPage/TemplateGroups';
|
||||
import { nextSelectedTemplateRouteRef } from '@backstage/plugin-scaffolder-react';
|
||||
import { SecretsContextProvider } from '../../components/secrets/SecretsContext';
|
||||
import type { FormProps } from '../types';
|
||||
import { DEFAULT_SCAFFOLDER_FIELD_EXTENSIONS } from '../../extensions/default';
|
||||
|
||||
/**
|
||||
* The Props for the Scaffolder Router
|
||||
|
||||
@@ -18,7 +18,7 @@ jest.mock('./TemplateCard', () => ({ TemplateCard: jest.fn(() => null) }));
|
||||
import React from 'react';
|
||||
import { TemplateGroup } from './TemplateGroup';
|
||||
import { render } from '@testing-library/react';
|
||||
import { TemplateCard } from './TemplateCard';
|
||||
import { TemplateCard } from '@backstage/plugin-scaffolder-react';
|
||||
import { TemplateEntityV1beta3 } from '@backstage/plugin-scaffolder-common';
|
||||
|
||||
describe('TemplateGroup', () => {
|
||||
|
||||
@@ -22,7 +22,10 @@ import {
|
||||
Link,
|
||||
} from '@backstage/core-components';
|
||||
import { Typography } from '@material-ui/core';
|
||||
import { TemplateCard, TemplateCardProps } from './TemplateCard';
|
||||
import {
|
||||
TemplateCard,
|
||||
TemplateCardProps,
|
||||
} from '@backstage/plugin-scaffolder-react';
|
||||
import { stringifyEntityRef } from '@backstage/catalog-model';
|
||||
|
||||
export interface TemplateGroupProps {
|
||||
|
||||
@@ -22,7 +22,6 @@ import {
|
||||
InfoCard,
|
||||
MarkdownContent,
|
||||
} from '@backstage/core-components';
|
||||
import { NextFieldExtensionOptions } from '../../extensions';
|
||||
import { Navigate, useNavigate } from 'react-router-dom';
|
||||
import { stringifyEntityRef } from '@backstage/catalog-model';
|
||||
import {
|
||||
@@ -35,7 +34,10 @@ import {
|
||||
import { scaffolderApiRef } from '../../api';
|
||||
import useAsync from 'react-use/lib/useAsync';
|
||||
import { makeStyles } from '@material-ui/core';
|
||||
import { Stepper } from '@backstage/plugin-scaffolder-react';
|
||||
import {
|
||||
Stepper,
|
||||
NextFieldExtensionOptions,
|
||||
} from '@backstage/plugin-scaffolder-react';
|
||||
import { BackstageTheme } from '@backstage/theme';
|
||||
import {
|
||||
nextRouteRef,
|
||||
@@ -44,7 +46,7 @@ import {
|
||||
} from '@backstage/plugin-scaffolder-react';
|
||||
import { SecretsContext } from '../../components/secrets/SecretsContext';
|
||||
import { JsonValue } from '@backstage/types';
|
||||
import type { FormProps } from '../types';
|
||||
import type { FormProps } from '@backstage/plugin-scaffolder-react';
|
||||
|
||||
export type TemplateWizardPageProps = {
|
||||
customFieldExtensions: NextFieldExtensionOptions<any, any>[];
|
||||
|
||||
@@ -17,4 +17,4 @@ export * from './Router';
|
||||
export * from './TemplateListPage';
|
||||
export * from './TemplateWizardPage';
|
||||
|
||||
export type { FormProps } from './types';
|
||||
export type { FormProps } from '@backstage/plugin-scaffolder-react';
|
||||
|
||||
@@ -15,6 +15,13 @@
|
||||
*/
|
||||
|
||||
import { scmIntegrationsApiRef } from '@backstage/integration-react';
|
||||
import {
|
||||
nextRouteRef,
|
||||
registerComponentRouteRef,
|
||||
rootRouteRef,
|
||||
viewTechDocRouteRef,
|
||||
createScaffolderFieldExtension,
|
||||
} from '@backstage/plugin-scaffolder-react';
|
||||
import { scaffolderApiRef, ScaffolderClient } from './api';
|
||||
import {
|
||||
EntityPicker,
|
||||
@@ -34,13 +41,6 @@ import {
|
||||
RepoUrlPicker,
|
||||
RepoUrlPickerSchema,
|
||||
} from './components/fields/RepoUrlPicker/RepoUrlPicker';
|
||||
import { createScaffolderFieldExtension } from './extensions';
|
||||
import {
|
||||
nextRouteRef,
|
||||
registerComponentRouteRef,
|
||||
rootRouteRef,
|
||||
viewTechDocRouteRef,
|
||||
} from '@backstage/plugin-scaffolder-react';
|
||||
import {
|
||||
createApiFactory,
|
||||
createPlugin,
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { TaskSpec, TaskStep } from '@backstage/plugin-scaffolder-common';
|
||||
import { TemplateParameterSchema } from '@backstage/plugin-scaffolder-react';
|
||||
import { JsonObject, JsonValue, Observable } from '@backstage/types';
|
||||
import { JSONSchema7 } from 'json-schema';
|
||||
|
||||
@@ -71,22 +72,6 @@ export type ScaffolderTaskOutput = {
|
||||
[key: string]: unknown;
|
||||
};
|
||||
|
||||
/**
|
||||
* The shape of each entry of parameters which gets rendered
|
||||
* as a separate step in the wizard input
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export type TemplateParameterSchema = {
|
||||
title: string;
|
||||
description?: string;
|
||||
steps: Array<{
|
||||
title: string;
|
||||
description?: string;
|
||||
schema: JsonObject;
|
||||
}>;
|
||||
};
|
||||
|
||||
/**
|
||||
* The shape of a `LogEvent` message from the `scaffolder-backend`
|
||||
*
|
||||
|
||||
@@ -7461,7 +7461,9 @@ __metadata:
|
||||
"@backstage/core-components": "workspace:^"
|
||||
"@backstage/core-plugin-api": "workspace:^"
|
||||
"@backstage/errors": "workspace:^"
|
||||
"@backstage/plugin-catalog": "workspace:^"
|
||||
"@backstage/plugin-catalog-common": "workspace:^"
|
||||
"@backstage/plugin-catalog-react": "workspace:^"
|
||||
"@backstage/plugin-scaffolder-common": "workspace:^"
|
||||
"@backstage/test-utils": "workspace:^"
|
||||
"@backstage/theme": "workspace:^"
|
||||
@@ -7486,6 +7488,7 @@ __metadata:
|
||||
json-schema-library: ^7.3.9
|
||||
lodash: ^4.17.21
|
||||
qs: ^6.9.4
|
||||
zen-observable: ^0.10.0
|
||||
zod: ~3.18.0
|
||||
zod-to-json-schema: ~3.18.0
|
||||
peerDependencies:
|
||||
|
||||
Reference in New Issue
Block a user