diff --git a/packages/app/src/components/scaffolder/customScaffolderExtensions.tsx b/packages/app/src/components/scaffolder/customScaffolderExtensions.tsx index 1c96e9325c..61407e2918 100644 --- a/packages/app/src/components/scaffolder/customScaffolderExtensions.tsx +++ b/packages/app/src/components/scaffolder/customScaffolderExtensions.tsx @@ -13,14 +13,44 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - +import React from 'react'; import type { FieldValidation } from '@rjsf/core'; import { createScaffolderFieldExtension, - TextValuePicker, + FieldExtensionComponentProps, scaffolderPlugin, } from '@backstage/plugin-scaffolder'; +import { TextField } from '@material-ui/core'; + +const TextValuePicker = (props: FieldExtensionComponentProps) => { + const { + onChange, + required, + schema: { title, description }, + rawErrors, + formData, + uiSchema: { 'ui:autofocus': autoFocus }, + idSchema, + placeholder, + } = props; + + return ( + onChange(value)} + margin="normal" + error={rawErrors?.length > 0 && !formData} + inputProps={{ autoFocus }} + /> + ); +}; + export const LowerCaseValuePickerFieldExtension = scaffolderPlugin.provide( createScaffolderFieldExtension({ name: 'LowerCaseValuePicker', diff --git a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/helpers.ts b/plugins/scaffolder-backend/src/scaffolder/actions/builtin/helpers.ts index 7ee334a3f7..307ac5f9b8 100644 --- a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/helpers.ts +++ b/plugins/scaffolder-backend/src/scaffolder/actions/builtin/helpers.ts @@ -44,6 +44,7 @@ export const executeShellCommand = async (options: RunCommandOptions) => { options: spawnOptions, logStream = new PassThrough(), } = options; + console.log('in exec shell commabnd'); await new Promise((resolve, reject) => { const process = spawn(command, args, spawnOptions); diff --git a/plugins/scaffolder/api-report.md b/plugins/scaffolder/api-report.md index d6a3edc1f2..1865d28578 100644 --- a/plugins/scaffolder/api-report.md +++ b/plugins/scaffolder/api-report.md @@ -76,14 +76,20 @@ export interface EntityPickerUiOptions { defaultKind?: string; } -// Warning: (ae-forgotten-export) The symbol "EntityTagsPickerUiOptions" needs to be exported by the entry point index.d.ts -// // @public export const EntityTagsPickerFieldExtension: FieldExtensionComponentProps< string[], EntityTagsPickerUiOptions >; +// Warning: (ae-missing-release-tag) "EntityTagsPickerUiOptions" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) +// +// @public (undocumented) +export interface EntityTagsPickerUiOptions { + // (undocumented) + kinds?: string[]; +} + // Warning: (ae-forgotten-export) The symbol "Props" needs to be exported by the entry point index.d.ts // Warning: (ae-missing-release-tag) "FavouriteTemplate" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // diff --git a/plugins/scaffolder/src/components/fields/EntityNamePicker/EntityNamePicker.tsx b/plugins/scaffolder/src/components/fields/EntityNamePicker/EntityNamePicker.tsx index f64c91b77f..2b8817aa4b 100644 --- a/plugins/scaffolder/src/components/fields/EntityNamePicker/EntityNamePicker.tsx +++ b/plugins/scaffolder/src/components/fields/EntityNamePicker/EntityNamePicker.tsx @@ -14,12 +14,35 @@ * limitations under the License. */ import React from 'react'; -import { TextValuePicker } from '../TextValuePicker'; import { FieldExtensionComponentProps } from '../../../extensions'; +import { TextField } from '@material-ui/core'; -export const EntityNamePicker = ({ - schema: { title = 'Name', description = 'Unique name of the component' }, - ...props -}: FieldExtensionComponentProps) => ( - -); +export const EntityNamePicker = ( + props: FieldExtensionComponentProps, +) => { + const { + onChange, + required, + schema: { title = 'Name', description = 'Unique name of the component' }, + rawErrors, + formData, + uiSchema: { 'ui:autofocus': autoFocus }, + idSchema, + placeholder, + } = props; + + return ( + onChange(value)} + margin="normal" + error={rawErrors?.length > 0 && !formData} + inputProps={{ autoFocus }} + /> + ); +}; diff --git a/plugins/scaffolder/src/components/fields/TextValuePicker/TextValuePicker.tsx b/plugins/scaffolder/src/components/fields/TextValuePicker/TextValuePicker.tsx deleted file mode 100644 index fe81649132..0000000000 --- a/plugins/scaffolder/src/components/fields/TextValuePicker/TextValuePicker.tsx +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2021 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 { TextField } from '@material-ui/core'; -import React from 'react'; -import { FieldExtensionComponentProps } from '../../../extensions'; - -export const TextValuePicker = ({ - onChange, - required, - schema: { title, description }, - rawErrors, - formData, - uiSchema: { 'ui:autofocus': autoFocus }, - idSchema, - placeholder, -}: FieldExtensionComponentProps) => ( - onChange(value)} - margin="normal" - error={rawErrors?.length > 0 && !formData} - inputProps={{ autoFocus }} - /> -); diff --git a/plugins/scaffolder/src/components/fields/TextValuePicker/index.ts b/plugins/scaffolder/src/components/fields/TextValuePicker/index.ts deleted file mode 100644 index 8ab810b6ed..0000000000 --- a/plugins/scaffolder/src/components/fields/TextValuePicker/index.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright 2021 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 { TextValuePicker } from './TextValuePicker';