From 075e0648b8af051133ccd09742e136af69dbc904 Mon Sep 17 00:00:00 2001 From: Hellgren Heikki Date: Wed, 24 Sep 2025 10:23:35 +0300 Subject: [PATCH 1/3] feat(scaffolder): add missing form fields for the nfs Signed-off-by: Hellgren Heikki --- .changeset/wide-flies-jog.md | 5 + plugins/scaffolder/report-alpha.api.md | 126 +++++++++++++++++- plugins/scaffolder/report.api.md | 75 ++++++++++- plugins/scaffolder/src/alpha/extensions.tsx | 67 +++++++++- .../src/alpha/fields/EntityNamePicker.ts | 28 ++++ .../src/alpha/fields/EntityPicker.ts | 24 ++++ .../src/alpha/fields/EntityTagsPicker.ts | 24 ++++ .../src/alpha/fields/MultiEntityPicker.ts | 24 ++++ .../src/alpha/fields/MyGroupsPicker.ts | 24 ++++ .../src/alpha/fields/OwnedEntityPicker.ts | 24 ++++ .../src/alpha/fields/OwnerPicker.ts | 24 ++++ .../src/alpha/fields/RepoBranchPicker.ts | 24 ++++ plugins/scaffolder/src/alpha/plugin.tsx | 20 ++- .../fields/EntityNamePicker/index.ts | 1 + .../fields/EntityNamePicker/schema.ts | 5 +- .../fields/EntityNamePicker/validation.ts | 3 + .../fields/MultiEntityPicker/schema.ts | 7 + .../scaffolder/src/components/fields/index.ts | 3 + 18 files changed, 496 insertions(+), 12 deletions(-) create mode 100644 .changeset/wide-flies-jog.md create mode 100644 plugins/scaffolder/src/alpha/fields/EntityNamePicker.ts create mode 100644 plugins/scaffolder/src/alpha/fields/EntityPicker.ts create mode 100644 plugins/scaffolder/src/alpha/fields/EntityTagsPicker.ts create mode 100644 plugins/scaffolder/src/alpha/fields/MultiEntityPicker.ts create mode 100644 plugins/scaffolder/src/alpha/fields/MyGroupsPicker.ts create mode 100644 plugins/scaffolder/src/alpha/fields/OwnedEntityPicker.ts create mode 100644 plugins/scaffolder/src/alpha/fields/OwnerPicker.ts create mode 100644 plugins/scaffolder/src/alpha/fields/RepoBranchPicker.ts diff --git a/.changeset/wide-flies-jog.md b/.changeset/wide-flies-jog.md new file mode 100644 index 0000000000..4fbafe66a1 --- /dev/null +++ b/.changeset/wide-flies-jog.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-scaffolder': patch +--- + +Added missing form fields for the new frontend system. diff --git a/plugins/scaffolder/report-alpha.api.md b/plugins/scaffolder/report-alpha.api.md index 534d136e6f..505688247f 100644 --- a/plugins/scaffolder/report-alpha.api.md +++ b/plugins/scaffolder/report-alpha.api.md @@ -226,6 +226,126 @@ const _default: OverridableFrontendPlugin< routeRef?: RouteRef; }; }>; + 'scaffolder-form-field:scaffolder/entity-name-picker': ExtensionDefinition<{ + kind: 'scaffolder-form-field'; + name: 'entity-name-picker'; + config: {}; + configInput: {}; + output: ExtensionDataRef< + () => Promise, + 'scaffolder.form-field-loader', + {} + >; + inputs: {}; + params: { + field: () => Promise; + }; + }>; + 'scaffolder-form-field:scaffolder/entity-picker': ExtensionDefinition<{ + kind: 'scaffolder-form-field'; + name: 'entity-picker'; + config: {}; + configInput: {}; + output: ExtensionDataRef< + () => Promise, + 'scaffolder.form-field-loader', + {} + >; + inputs: {}; + params: { + field: () => Promise; + }; + }>; + 'scaffolder-form-field:scaffolder/entity-tags-picker': ExtensionDefinition<{ + kind: 'scaffolder-form-field'; + name: 'entity-tags-picker'; + config: {}; + configInput: {}; + output: ExtensionDataRef< + () => Promise, + 'scaffolder.form-field-loader', + {} + >; + inputs: {}; + params: { + field: () => Promise; + }; + }>; + 'scaffolder-form-field:scaffolder/multi-entity-picker': ExtensionDefinition<{ + kind: 'scaffolder-form-field'; + name: 'multi-entity-picker'; + config: {}; + configInput: {}; + output: ExtensionDataRef< + () => Promise, + 'scaffolder.form-field-loader', + {} + >; + inputs: {}; + params: { + field: () => Promise; + }; + }>; + 'scaffolder-form-field:scaffolder/my-groups-picker': ExtensionDefinition<{ + kind: 'scaffolder-form-field'; + name: 'my-groups-picker'; + config: {}; + configInput: {}; + output: ExtensionDataRef< + () => Promise, + 'scaffolder.form-field-loader', + {} + >; + inputs: {}; + params: { + field: () => Promise; + }; + }>; + 'scaffolder-form-field:scaffolder/owned-entity-picker': ExtensionDefinition<{ + kind: 'scaffolder-form-field'; + name: 'owned-entity-picker'; + config: {}; + configInput: {}; + output: ExtensionDataRef< + () => Promise, + 'scaffolder.form-field-loader', + {} + >; + inputs: {}; + params: { + field: () => Promise; + }; + }>; + 'scaffolder-form-field:scaffolder/owner-picker': ExtensionDefinition<{ + kind: 'scaffolder-form-field'; + name: 'owner-picker'; + config: {}; + configInput: {}; + output: ExtensionDataRef< + () => Promise, + 'scaffolder.form-field-loader', + {} + >; + inputs: {}; + params: { + field: () => Promise; + }; + }>; + 'scaffolder-form-field:scaffolder/repo-branch-picker': ExtensionDefinition<{ + kind: 'scaffolder-form-field'; + name: 'repo-branch-picker'; + config: {}; + configInput: {}; + output: ExtensionDataRef< + () => Promise, + 'scaffolder.form-field-loader', + {} + >; + inputs: {}; + params: { + field: () => Promise; + }; + }>; 'scaffolder-form-field:scaffolder/repo-url-picker': ExtensionDefinition<{ kind: 'scaffolder-form-field'; name: 'repo-url-picker'; @@ -402,10 +522,10 @@ export const scaffolderTranslationRef: TranslationRef< readonly 'ongoingTask.title': 'Run of'; readonly 'ongoingTask.contextMenu.cancel': 'Cancel'; readonly 'ongoingTask.contextMenu.startOver': 'Start Over'; - readonly 'ongoingTask.contextMenu.retry': 'Retry'; readonly 'ongoingTask.contextMenu.hideLogs': 'Hide Logs'; readonly 'ongoingTask.contextMenu.showLogs': 'Show Logs'; readonly 'ongoingTask.contextMenu.hideButtonBar': 'Hide Button Bar'; + readonly 'ongoingTask.contextMenu.retry': 'Retry'; readonly 'ongoingTask.contextMenu.showButtonBar': 'Show Button Bar'; readonly 'ongoingTask.subtitle': 'Task {{taskId}}'; readonly 'ongoingTask.pageTitle.hasTemplateName': 'Run of {{templateName}}'; @@ -488,8 +608,8 @@ export const scaffolderTranslationRef: TranslationRef< readonly 'templateListPage.pageTitle': 'Create a new component'; readonly 'templateListPage.templateGroups.defaultTitle': 'Templates'; readonly 'templateListPage.templateGroups.otherTitle': 'Other Templates'; - readonly 'templateListPage.contentHeader.supportButtonTitle': 'Create new software components using standard templates. Different templates create different kinds of components (services, websites, documentation, ...).'; readonly 'templateListPage.contentHeader.registerExistingButtonTitle': 'Register Existing Component'; + readonly 'templateListPage.contentHeader.supportButtonTitle': 'Create new software components using standard templates. Different templates create different kinds of components (services, websites, documentation, ...).'; readonly 'templateListPage.additionalLinksForEntity.viewTechDocsTitle': 'View TechDocs'; readonly 'templateWizardPage.title': 'Create a new component'; readonly 'templateWizardPage.subtitle': 'Create new software components using standard templates in your organization'; @@ -502,8 +622,8 @@ export const scaffolderTranslationRef: TranslationRef< readonly 'templateEditorToolbar.addToCatalogDialogTitle': 'Publish changes'; readonly 'templateEditorToolbar.addToCatalogDialogContent.stepsIntroduction': 'Follow the instructions below to create or update a template:'; readonly 'templateEditorToolbar.addToCatalogDialogContent.stepsListItems': 'Save the template files in a local directory\nCreate a pull request to a new or existing git repository\nIf the template already exists, the changes will be reflected in the software catalog once the pull request gets merged\nBut if you are creating a new template, follow the documentation linked below to register the new template repository in software catalog'; - readonly 'templateEditorToolbar.addToCatalogDialogActions.documentationUrl': 'https://backstage.io/docs/features/software-templates/adding-templates/'; readonly 'templateEditorToolbar.addToCatalogDialogActions.documentationButton': 'Go to the documentation'; + readonly 'templateEditorToolbar.addToCatalogDialogActions.documentationUrl': 'https://backstage.io/docs/features/software-templates/adding-templates/'; readonly 'templateEditorToolbarFileMenu.button': 'File'; readonly 'templateEditorToolbarFileMenu.options.openDirectory': 'Open template directory'; readonly 'templateEditorToolbarFileMenu.options.createDirectory': 'Create template directory'; diff --git a/plugins/scaffolder/report.api.md b/plugins/scaffolder/report.api.md index a4a339f01e..b1a6b62e9d 100644 --- a/plugins/scaffolder/report.api.md +++ b/plugins/scaffolder/report.api.md @@ -70,6 +70,15 @@ export const EntityNamePickerFieldExtension: FieldExtensionComponent_2< any >; +// @public (undocumented) +export const EntityNamePickerFieldSchema: FieldSchema_2; + +// @public (undocumented) +export const entityNamePickerValidation: ( + value: string, + validation: FieldValidation, +) => void; + // @public export const EntityPickerFieldExtension: FieldExtensionComponent_2< string, @@ -228,6 +237,39 @@ export const MultiEntityPickerFieldExtension: FieldExtensionComponent_2< } >; +// @public (undocumented) +export const MultiEntityPickerFieldSchema: FieldSchema_2< + string[], + { + defaultKind?: string | undefined; + defaultNamespace?: string | false | undefined; + catalogFilter?: + | Record< + string, + | string + | string[] + | { + exists?: boolean | undefined; + } + > + | Record< + string, + | string + | string[] + | { + exists?: boolean | undefined; + } + >[] + | undefined; + allowArbitraryValues?: boolean | undefined; + } +>; + +// @public +export type MultiEntityPickerUiOptions = NonNullable< + (typeof MultiEntityPickerFieldSchema.TProps.uiSchema)['ui:options'] +>; + // @public export const MyGroupsPickerFieldExtension: FieldExtensionComponent_2< string, @@ -380,9 +422,9 @@ export const RepoBranchPickerFieldExtension: FieldExtensionComponent_2< | { azure?: string[] | undefined; github?: string[] | undefined; - gitlab?: string[] | undefined; bitbucket?: string[] | undefined; gerrit?: string[] | undefined; + gitlab?: string[] | undefined; gitea?: string[] | undefined; } | undefined; @@ -391,6 +433,33 @@ export const RepoBranchPickerFieldExtension: FieldExtensionComponent_2< } >; +// @public (undocumented) +export const RepoBranchPickerFieldSchema: FieldSchema_2< + string, + { + requestUserCredentials?: + | { + secretsKey: string; + additionalScopes?: + | { + azure?: string[] | undefined; + github?: string[] | undefined; + bitbucket?: string[] | undefined; + gerrit?: string[] | undefined; + gitlab?: string[] | undefined; + gitea?: string[] | undefined; + } + | undefined; + } + | undefined; + } +>; + +// @public +export type RepoBranchPickerUiOptions = NonNullable< + (typeof RepoBranchPickerFieldSchema.TProps.uiSchema)['ui:options'] +>; + // @public export const repoPickerValidation: ( value: string, @@ -416,9 +485,9 @@ export const RepoUrlPickerFieldExtension: FieldExtensionComponent_2< | { azure?: string[] | undefined; github?: string[] | undefined; - gitlab?: string[] | undefined; bitbucket?: string[] | undefined; gerrit?: string[] | undefined; + gitlab?: string[] | undefined; gitea?: string[] | undefined; } | undefined; @@ -443,9 +512,9 @@ export const RepoUrlPickerFieldSchema: FieldSchema_2< | { azure?: string[] | undefined; github?: string[] | undefined; - gitlab?: string[] | undefined; bitbucket?: string[] | undefined; gerrit?: string[] | undefined; + gitlab?: string[] | undefined; gitea?: string[] | undefined; } | undefined; diff --git a/plugins/scaffolder/src/alpha/extensions.tsx b/plugins/scaffolder/src/alpha/extensions.tsx index 803644d95a..cb69e691b8 100644 --- a/plugins/scaffolder/src/alpha/extensions.tsx +++ b/plugins/scaffolder/src/alpha/extensions.tsx @@ -19,13 +19,13 @@ import { convertLegacyRouteRef, } from '@backstage/core-compat-api'; import { - NavItemBlueprint, - PageBlueprint, ApiBlueprint, + createExtensionInput, discoveryApiRef, fetchApiRef, identityApiRef, - createExtensionInput, + NavItemBlueprint, + PageBlueprint, } from '@backstage/frontend-plugin-api'; import { rootRouteRef } from '../routes'; import CreateComponentIcon from '@material-ui/icons/AddCircleOutline'; @@ -72,6 +72,67 @@ export const repoUrlPickerFormField = FormFieldBlueprint.make({ }, }); +export const entityNamePickerFormField = FormFieldBlueprint.make({ + name: 'entity-name-picker', + params: { + field: () => + import('./fields/EntityNamePicker').then(m => m.EntityNamePicker), + }, +}); + +export const entityPickerFormField = FormFieldBlueprint.make({ + name: 'entity-picker', + params: { + field: () => import('./fields/EntityPicker').then(m => m.EntityPicker), + }, +}); + +export const ownerPickerFormField = FormFieldBlueprint.make({ + name: 'owner-picker', + params: { + field: () => import('./fields/OwnerPicker').then(m => m.OwnerPicker), + }, +}); + +export const entityTagsPickerFormField = FormFieldBlueprint.make({ + name: 'entity-tags-picker', + params: { + field: () => + import('./fields/EntityTagsPicker').then(m => m.EntityTagsPicker), + }, +}); + +export const multiEntityPickerFormField = FormFieldBlueprint.make({ + name: 'multi-entity-picker', + params: { + field: () => + import('./fields/MultiEntityPicker').then(m => m.MultiEntityPicker), + }, +}); + +export const myGroupsPickerFormField = FormFieldBlueprint.make({ + name: 'my-groups-picker', + params: { + field: () => import('./fields/MyGroupsPicker').then(m => m.MyGroupsPicker), + }, +}); + +export const ownedEntityPickerFormField = FormFieldBlueprint.make({ + name: 'owned-entity-picker', + params: { + field: () => + import('./fields/OwnedEntityPicker').then(m => m.OwnedEntityPicker), + }, +}); + +export const repoBranchPickerFormField = FormFieldBlueprint.make({ + name: 'repo-branch-picker', + params: { + field: () => + import('./fields/RepoBranchPicker').then(m => m.RepoBranchPicker), + }, +}); + export const scaffolderApi = ApiBlueprint.make({ params: defineParams => defineParams({ diff --git a/plugins/scaffolder/src/alpha/fields/EntityNamePicker.ts b/plugins/scaffolder/src/alpha/fields/EntityNamePicker.ts new file mode 100644 index 0000000000..715cb068a0 --- /dev/null +++ b/plugins/scaffolder/src/alpha/fields/EntityNamePicker.ts @@ -0,0 +1,28 @@ +/* + * Copyright 2024 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 { createFormField } from '@backstage/plugin-scaffolder-react/alpha'; +import { EntityNamePicker as Component } from '../../components/fields/EntityNamePicker/EntityNamePicker'; +import { + EntityNamePickerFieldSchema, + entityNamePickerValidation, +} from '../../components'; + +export const EntityNamePicker = createFormField({ + component: Component, + name: 'EntityNamePicker', + validation: entityNamePickerValidation, + schema: EntityNamePickerFieldSchema, +}); diff --git a/plugins/scaffolder/src/alpha/fields/EntityPicker.ts b/plugins/scaffolder/src/alpha/fields/EntityPicker.ts new file mode 100644 index 0000000000..059e87fc19 --- /dev/null +++ b/plugins/scaffolder/src/alpha/fields/EntityPicker.ts @@ -0,0 +1,24 @@ +/* + * Copyright 2024 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 { createFormField } from '@backstage/plugin-scaffolder-react/alpha'; +import { EntityPicker as Component } from '../../components/fields/EntityPicker/EntityPicker'; +import { EntityPickerFieldSchema } from '../../components'; + +export const EntityPicker = createFormField({ + component: Component, + name: 'EntityPicker', + schema: EntityPickerFieldSchema, +}); diff --git a/plugins/scaffolder/src/alpha/fields/EntityTagsPicker.ts b/plugins/scaffolder/src/alpha/fields/EntityTagsPicker.ts new file mode 100644 index 0000000000..c4d5f88abb --- /dev/null +++ b/plugins/scaffolder/src/alpha/fields/EntityTagsPicker.ts @@ -0,0 +1,24 @@ +/* + * Copyright 2024 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 { createFormField } from '@backstage/plugin-scaffolder-react/alpha'; +import { EntityTagsPicker as Component } from '../../components/fields/EntityTagsPicker/EntityTagsPicker'; +import { EntityTagsPickerFieldSchema } from '../../components'; + +export const EntityTagsPicker = createFormField({ + component: Component, + name: 'EntityTagsPicker', + schema: EntityTagsPickerFieldSchema, +}); diff --git a/plugins/scaffolder/src/alpha/fields/MultiEntityPicker.ts b/plugins/scaffolder/src/alpha/fields/MultiEntityPicker.ts new file mode 100644 index 0000000000..32bc54f86e --- /dev/null +++ b/plugins/scaffolder/src/alpha/fields/MultiEntityPicker.ts @@ -0,0 +1,24 @@ +/* + * Copyright 2024 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 { createFormField } from '@backstage/plugin-scaffolder-react/alpha'; +import { MultiEntityPicker as Component } from '../../components/fields/MultiEntityPicker/MultiEntityPicker'; +import { MultiEntityPickerFieldSchema } from '../../components'; + +export const MultiEntityPicker = createFormField({ + component: Component, + name: 'MultiEntityPicker', + schema: MultiEntityPickerFieldSchema, +}); diff --git a/plugins/scaffolder/src/alpha/fields/MyGroupsPicker.ts b/plugins/scaffolder/src/alpha/fields/MyGroupsPicker.ts new file mode 100644 index 0000000000..cc5f717c28 --- /dev/null +++ b/plugins/scaffolder/src/alpha/fields/MyGroupsPicker.ts @@ -0,0 +1,24 @@ +/* + * Copyright 2024 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 { createFormField } from '@backstage/plugin-scaffolder-react/alpha'; +import { MyGroupsPicker as Component } from '../../components/fields/MyGroupsPicker/MyGroupsPicker'; +import { MyGroupsPickerFieldSchema } from '../../components'; + +export const MyGroupsPicker = createFormField({ + component: Component, + name: 'MyGroupsPicker', + schema: MyGroupsPickerFieldSchema, +}); diff --git a/plugins/scaffolder/src/alpha/fields/OwnedEntityPicker.ts b/plugins/scaffolder/src/alpha/fields/OwnedEntityPicker.ts new file mode 100644 index 0000000000..6f40b23803 --- /dev/null +++ b/plugins/scaffolder/src/alpha/fields/OwnedEntityPicker.ts @@ -0,0 +1,24 @@ +/* + * Copyright 2024 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 { createFormField } from '@backstage/plugin-scaffolder-react/alpha'; +import { OwnedEntityPicker as Component } from '../../components/fields/OwnedEntityPicker/OwnedEntityPicker'; +import { OwnedEntityPickerFieldSchema } from '../../components'; + +export const OwnedEntityPicker = createFormField({ + component: Component, + name: 'OwnedEntityPicker', + schema: OwnedEntityPickerFieldSchema, +}); diff --git a/plugins/scaffolder/src/alpha/fields/OwnerPicker.ts b/plugins/scaffolder/src/alpha/fields/OwnerPicker.ts new file mode 100644 index 0000000000..ea58f1f00f --- /dev/null +++ b/plugins/scaffolder/src/alpha/fields/OwnerPicker.ts @@ -0,0 +1,24 @@ +/* + * Copyright 2024 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 { createFormField } from '@backstage/plugin-scaffolder-react/alpha'; +import { OwnerPicker as Component } from '../../components/fields/OwnerPicker/OwnerPicker'; +import { OwnerPickerFieldSchema } from '../../components'; + +export const OwnerPicker = createFormField({ + component: Component, + name: 'OwnerPicker', + schema: OwnerPickerFieldSchema, +}); diff --git a/plugins/scaffolder/src/alpha/fields/RepoBranchPicker.ts b/plugins/scaffolder/src/alpha/fields/RepoBranchPicker.ts new file mode 100644 index 0000000000..9694b6a8c4 --- /dev/null +++ b/plugins/scaffolder/src/alpha/fields/RepoBranchPicker.ts @@ -0,0 +1,24 @@ +/* + * Copyright 2024 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 { createFormField } from '@backstage/plugin-scaffolder-react/alpha'; +import { RepoBranchPicker as Component } from '../../components/fields/RepoBranchPicker/RepoBranchPicker'; +import { RepoBranchPickerFieldSchema } from '../../components'; + +export const RepoBranchPicker = createFormField({ + component: Component, + name: 'RepoBranchPicker', + schema: RepoBranchPickerFieldSchema, +}); diff --git a/plugins/scaffolder/src/alpha/plugin.tsx b/plugins/scaffolder/src/alpha/plugin.tsx index a414c61da5..3b41aa3893 100644 --- a/plugins/scaffolder/src/alpha/plugin.tsx +++ b/plugins/scaffolder/src/alpha/plugin.tsx @@ -17,10 +17,10 @@ import { convertLegacyRouteRefs } from '@backstage/core-compat-api'; import { createFrontendPlugin } from '@backstage/frontend-plugin-api'; import { - rootRouteRef, actionsRouteRef, editRouteRef, registerComponentRouteRef, + rootRouteRef, scaffolderListTaskRouteRef, scaffolderTaskRouteRef, selectedTemplateRouteRef, @@ -28,10 +28,18 @@ import { viewTechDocRouteRef, } from '../routes'; import { + entityNamePickerFormField, + entityPickerFormField, + entityTagsPickerFormField, + multiEntityPickerFormField, + myGroupsPickerFormField, + ownedEntityPickerFormField, + ownerPickerFormField, + repoBranchPickerFormField, repoUrlPickerFormField, + scaffolderApi, scaffolderNavItem, scaffolderPage, - scaffolderApi, } from './extensions'; import { isTemplateEntityV1beta3 } from '@backstage/plugin-scaffolder-common'; import { formFieldsApi } from '@backstage/plugin-scaffolder-react/alpha'; @@ -73,5 +81,13 @@ export default createFrontendPlugin({ formDecoratorsApi, formFieldsApi, repoUrlPickerFormField, + entityNamePickerFormField, + entityPickerFormField, + ownerPickerFormField, + entityTagsPickerFormField, + multiEntityPickerFormField, + myGroupsPickerFormField, + ownedEntityPickerFormField, + repoBranchPickerFormField, ], }); diff --git a/plugins/scaffolder/src/components/fields/EntityNamePicker/index.ts b/plugins/scaffolder/src/components/fields/EntityNamePicker/index.ts index 7076221480..82d9cb0b17 100644 --- a/plugins/scaffolder/src/components/fields/EntityNamePicker/index.ts +++ b/plugins/scaffolder/src/components/fields/EntityNamePicker/index.ts @@ -14,3 +14,4 @@ * limitations under the License. */ export { entityNamePickerValidation } from './validation'; +export { EntityNamePickerFieldSchema } from './schema'; diff --git a/plugins/scaffolder/src/components/fields/EntityNamePicker/schema.ts b/plugins/scaffolder/src/components/fields/EntityNamePicker/schema.ts index fe4765b8b8..0230f26879 100644 --- a/plugins/scaffolder/src/components/fields/EntityNamePicker/schema.ts +++ b/plugins/scaffolder/src/components/fields/EntityNamePicker/schema.ts @@ -15,7 +15,10 @@ */ import { makeFieldSchema } from '@backstage/plugin-scaffolder-react'; -const EntityNamePickerFieldSchema = makeFieldSchema({ +/** + * @public + */ +export const EntityNamePickerFieldSchema = makeFieldSchema({ output: z => z.string(), }); diff --git a/plugins/scaffolder/src/components/fields/EntityNamePicker/validation.ts b/plugins/scaffolder/src/components/fields/EntityNamePicker/validation.ts index 9302e9abc1..e475606c11 100644 --- a/plugins/scaffolder/src/components/fields/EntityNamePicker/validation.ts +++ b/plugins/scaffolder/src/components/fields/EntityNamePicker/validation.ts @@ -17,6 +17,9 @@ import { FieldValidation } from '@rjsf/utils'; import { KubernetesValidatorFunctions } from '@backstage/catalog-model'; +/** + * @public + */ export const entityNamePickerValidation = ( value: string, validation: FieldValidation, diff --git a/plugins/scaffolder/src/components/fields/MultiEntityPicker/schema.ts b/plugins/scaffolder/src/components/fields/MultiEntityPicker/schema.ts index 667b4638b8..aa396229ee 100644 --- a/plugins/scaffolder/src/components/fields/MultiEntityPicker/schema.ts +++ b/plugins/scaffolder/src/components/fields/MultiEntityPicker/schema.ts @@ -16,6 +16,9 @@ import { z as zod } from 'zod'; import { makeFieldSchema } from '@backstage/plugin-scaffolder-react'; +/** + * @public + */ export const entityQueryFilterExpressionSchema = zod.record( zod .string() @@ -23,6 +26,9 @@ export const entityQueryFilterExpressionSchema = zod.record( .or(zod.array(zod.string())), ); +/** + * @public + */ export const MultiEntityPickerFieldSchema = makeFieldSchema({ output: z => z.array(z.string()), uiOptions: z => @@ -54,6 +60,7 @@ export const MultiEntityPickerFieldSchema = makeFieldSchema({ /** * The input props that can be specified under `ui:options` for the * `EntityPicker` field extension. + * @public */ export type MultiEntityPickerUiOptions = NonNullable< (typeof MultiEntityPickerFieldSchema.TProps.uiSchema)['ui:options'] diff --git a/plugins/scaffolder/src/components/fields/index.ts b/plugins/scaffolder/src/components/fields/index.ts index 7f119f27be..dc1de86adb 100644 --- a/plugins/scaffolder/src/components/fields/index.ts +++ b/plugins/scaffolder/src/components/fields/index.ts @@ -14,10 +14,13 @@ * limitations under the License. */ export * from './EntityPicker'; +export * from './EntityNamePicker'; export * from './OwnerPicker'; export * from './RepoUrlPicker'; export * from './OwnedEntityPicker'; export * from './EntityTagsPicker'; +export * from './RepoBranchPicker'; +export * from './MultiEntityPicker'; export * from './MyGroupsPicker'; export { type FieldSchema, makeFieldSchemaFromZod } from './utils'; From 48d409f4abe5df6d08f1731b8dc1366cbd424580 Mon Sep 17 00:00:00 2001 From: Hellgren Heikki Date: Wed, 24 Sep 2025 10:25:14 +0300 Subject: [PATCH 2/3] fix: correct year for copyright headers Signed-off-by: Hellgren Heikki --- plugins/scaffolder/src/alpha/fields/EntityNamePicker.ts | 2 +- plugins/scaffolder/src/alpha/fields/EntityPicker.ts | 2 +- plugins/scaffolder/src/alpha/fields/EntityTagsPicker.ts | 2 +- plugins/scaffolder/src/alpha/fields/MultiEntityPicker.ts | 2 +- plugins/scaffolder/src/alpha/fields/MyGroupsPicker.ts | 2 +- plugins/scaffolder/src/alpha/fields/OwnedEntityPicker.ts | 2 +- plugins/scaffolder/src/alpha/fields/OwnerPicker.ts | 2 +- plugins/scaffolder/src/alpha/fields/RepoBranchPicker.ts | 2 +- plugins/scaffolder/src/alpha/fields/RepoUrlPicker.ts | 4 ++-- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/plugins/scaffolder/src/alpha/fields/EntityNamePicker.ts b/plugins/scaffolder/src/alpha/fields/EntityNamePicker.ts index 715cb068a0..770e055948 100644 --- a/plugins/scaffolder/src/alpha/fields/EntityNamePicker.ts +++ b/plugins/scaffolder/src/alpha/fields/EntityNamePicker.ts @@ -1,5 +1,5 @@ /* - * Copyright 2024 The Backstage Authors + * Copyright 2025 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. diff --git a/plugins/scaffolder/src/alpha/fields/EntityPicker.ts b/plugins/scaffolder/src/alpha/fields/EntityPicker.ts index 059e87fc19..d4ae6a5ecb 100644 --- a/plugins/scaffolder/src/alpha/fields/EntityPicker.ts +++ b/plugins/scaffolder/src/alpha/fields/EntityPicker.ts @@ -1,5 +1,5 @@ /* - * Copyright 2024 The Backstage Authors + * Copyright 2025 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. diff --git a/plugins/scaffolder/src/alpha/fields/EntityTagsPicker.ts b/plugins/scaffolder/src/alpha/fields/EntityTagsPicker.ts index c4d5f88abb..35b45a91a6 100644 --- a/plugins/scaffolder/src/alpha/fields/EntityTagsPicker.ts +++ b/plugins/scaffolder/src/alpha/fields/EntityTagsPicker.ts @@ -1,5 +1,5 @@ /* - * Copyright 2024 The Backstage Authors + * Copyright 2025 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. diff --git a/plugins/scaffolder/src/alpha/fields/MultiEntityPicker.ts b/plugins/scaffolder/src/alpha/fields/MultiEntityPicker.ts index 32bc54f86e..0b89e7351b 100644 --- a/plugins/scaffolder/src/alpha/fields/MultiEntityPicker.ts +++ b/plugins/scaffolder/src/alpha/fields/MultiEntityPicker.ts @@ -1,5 +1,5 @@ /* - * Copyright 2024 The Backstage Authors + * Copyright 2025 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. diff --git a/plugins/scaffolder/src/alpha/fields/MyGroupsPicker.ts b/plugins/scaffolder/src/alpha/fields/MyGroupsPicker.ts index cc5f717c28..a8f0e74b8c 100644 --- a/plugins/scaffolder/src/alpha/fields/MyGroupsPicker.ts +++ b/plugins/scaffolder/src/alpha/fields/MyGroupsPicker.ts @@ -1,5 +1,5 @@ /* - * Copyright 2024 The Backstage Authors + * Copyright 2025 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. diff --git a/plugins/scaffolder/src/alpha/fields/OwnedEntityPicker.ts b/plugins/scaffolder/src/alpha/fields/OwnedEntityPicker.ts index 6f40b23803..becd48b5ce 100644 --- a/plugins/scaffolder/src/alpha/fields/OwnedEntityPicker.ts +++ b/plugins/scaffolder/src/alpha/fields/OwnedEntityPicker.ts @@ -1,5 +1,5 @@ /* - * Copyright 2024 The Backstage Authors + * Copyright 2025 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. diff --git a/plugins/scaffolder/src/alpha/fields/OwnerPicker.ts b/plugins/scaffolder/src/alpha/fields/OwnerPicker.ts index ea58f1f00f..53ec16eb8b 100644 --- a/plugins/scaffolder/src/alpha/fields/OwnerPicker.ts +++ b/plugins/scaffolder/src/alpha/fields/OwnerPicker.ts @@ -1,5 +1,5 @@ /* - * Copyright 2024 The Backstage Authors + * Copyright 2025 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. diff --git a/plugins/scaffolder/src/alpha/fields/RepoBranchPicker.ts b/plugins/scaffolder/src/alpha/fields/RepoBranchPicker.ts index 9694b6a8c4..176b4fdaa6 100644 --- a/plugins/scaffolder/src/alpha/fields/RepoBranchPicker.ts +++ b/plugins/scaffolder/src/alpha/fields/RepoBranchPicker.ts @@ -1,5 +1,5 @@ /* - * Copyright 2024 The Backstage Authors + * Copyright 2025 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. diff --git a/plugins/scaffolder/src/alpha/fields/RepoUrlPicker.ts b/plugins/scaffolder/src/alpha/fields/RepoUrlPicker.ts index add8408b2d..829c20d7c0 100644 --- a/plugins/scaffolder/src/alpha/fields/RepoUrlPicker.ts +++ b/plugins/scaffolder/src/alpha/fields/RepoUrlPicker.ts @@ -1,5 +1,5 @@ /* - * Copyright 2024 The Backstage Authors + * Copyright 2025 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. @@ -16,8 +16,8 @@ import { createFormField } from '@backstage/plugin-scaffolder-react/alpha'; import { RepoUrlPicker as Component } from '../../components/fields/RepoUrlPicker/RepoUrlPicker'; import { - RepoUrlPickerFieldSchema, repoPickerValidation, + RepoUrlPickerFieldSchema, } from '../../components'; export const RepoUrlPicker = createFormField({ From 4ee97cf3ab270d583b0f8bf2f7aeb8b75e50dbe9 Mon Sep 17 00:00:00 2001 From: Hellgren Heikki Date: Wed, 24 Sep 2025 10:43:15 +0300 Subject: [PATCH 3/3] chore(scaffolder): clean up api report from schemas and validators Signed-off-by: Hellgren Heikki --- plugins/scaffolder/report-alpha.api.md | 6 +- plugins/scaffolder/report.api.md | 79 ++----------------- .../src/alpha/fields/EntityNamePicker.ts | 4 +- .../src/alpha/fields/EntityPicker.ts | 6 +- .../src/alpha/fields/EntityTagsPicker.ts | 6 +- .../src/alpha/fields/MultiEntityPicker.ts | 6 +- .../src/alpha/fields/MyGroupsPicker.ts | 6 +- .../src/alpha/fields/OwnedEntityPicker.ts | 6 +- .../src/alpha/fields/OwnerPicker.ts | 6 +- .../src/alpha/fields/RepoBranchPicker.ts | 6 +- .../src/alpha/fields/RepoUrlPicker.ts | 4 +- .../fields/EntityNamePicker/index.ts | 1 + .../fields/EntityNamePicker/schema.ts | 3 - .../fields/EntityNamePicker/validation.ts | 3 - .../components/fields/EntityPicker/index.ts | 1 + .../fields/EntityTagsPicker/index.ts | 1 + .../fields/EntityTagsPicker/schema.ts | 1 - .../fields/MultiEntityPicker/index.ts | 1 + .../fields/MultiEntityPicker/schema.ts | 7 -- .../components/fields/MyGroupsPicker/index.ts | 1 + .../fields/MyGroupsPicker/schema.ts | 1 - .../fields/OwnedEntityPicker/index.ts | 1 + .../fields/OwnedEntityPicker/schema.ts | 3 +- .../components/fields/OwnerPicker/index.ts | 1 + .../components/fields/OwnerPicker/schema.ts | 1 - .../fields/RepoBranchPicker/index.ts | 2 +- .../fields/RepoBranchPicker/schema.ts | 5 -- .../components/fields/RepoUrlPicker/index.ts | 1 + .../fields/RepoUrlPicker/validation.ts | 1 - .../scaffolder/src/components/fields/index.ts | 10 --- plugins/scaffolder/src/components/index.ts | 28 ++++++- 31 files changed, 77 insertions(+), 131 deletions(-) diff --git a/plugins/scaffolder/report-alpha.api.md b/plugins/scaffolder/report-alpha.api.md index 505688247f..a5dd2a22d1 100644 --- a/plugins/scaffolder/report-alpha.api.md +++ b/plugins/scaffolder/report-alpha.api.md @@ -522,10 +522,10 @@ export const scaffolderTranslationRef: TranslationRef< readonly 'ongoingTask.title': 'Run of'; readonly 'ongoingTask.contextMenu.cancel': 'Cancel'; readonly 'ongoingTask.contextMenu.startOver': 'Start Over'; + readonly 'ongoingTask.contextMenu.retry': 'Retry'; readonly 'ongoingTask.contextMenu.hideLogs': 'Hide Logs'; readonly 'ongoingTask.contextMenu.showLogs': 'Show Logs'; readonly 'ongoingTask.contextMenu.hideButtonBar': 'Hide Button Bar'; - readonly 'ongoingTask.contextMenu.retry': 'Retry'; readonly 'ongoingTask.contextMenu.showButtonBar': 'Show Button Bar'; readonly 'ongoingTask.subtitle': 'Task {{taskId}}'; readonly 'ongoingTask.pageTitle.hasTemplateName': 'Run of {{templateName}}'; @@ -608,8 +608,8 @@ export const scaffolderTranslationRef: TranslationRef< readonly 'templateListPage.pageTitle': 'Create a new component'; readonly 'templateListPage.templateGroups.defaultTitle': 'Templates'; readonly 'templateListPage.templateGroups.otherTitle': 'Other Templates'; - readonly 'templateListPage.contentHeader.registerExistingButtonTitle': 'Register Existing Component'; readonly 'templateListPage.contentHeader.supportButtonTitle': 'Create new software components using standard templates. Different templates create different kinds of components (services, websites, documentation, ...).'; + readonly 'templateListPage.contentHeader.registerExistingButtonTitle': 'Register Existing Component'; readonly 'templateListPage.additionalLinksForEntity.viewTechDocsTitle': 'View TechDocs'; readonly 'templateWizardPage.title': 'Create a new component'; readonly 'templateWizardPage.subtitle': 'Create new software components using standard templates in your organization'; @@ -622,8 +622,8 @@ export const scaffolderTranslationRef: TranslationRef< readonly 'templateEditorToolbar.addToCatalogDialogTitle': 'Publish changes'; readonly 'templateEditorToolbar.addToCatalogDialogContent.stepsIntroduction': 'Follow the instructions below to create or update a template:'; readonly 'templateEditorToolbar.addToCatalogDialogContent.stepsListItems': 'Save the template files in a local directory\nCreate a pull request to a new or existing git repository\nIf the template already exists, the changes will be reflected in the software catalog once the pull request gets merged\nBut if you are creating a new template, follow the documentation linked below to register the new template repository in software catalog'; - readonly 'templateEditorToolbar.addToCatalogDialogActions.documentationButton': 'Go to the documentation'; readonly 'templateEditorToolbar.addToCatalogDialogActions.documentationUrl': 'https://backstage.io/docs/features/software-templates/adding-templates/'; + readonly 'templateEditorToolbar.addToCatalogDialogActions.documentationButton': 'Go to the documentation'; readonly 'templateEditorToolbarFileMenu.button': 'File'; readonly 'templateEditorToolbarFileMenu.options.openDirectory': 'Open template directory'; readonly 'templateEditorToolbarFileMenu.options.createDirectory': 'Create template directory'; diff --git a/plugins/scaffolder/report.api.md b/plugins/scaffolder/report.api.md index b1a6b62e9d..27fa47a184 100644 --- a/plugins/scaffolder/report.api.md +++ b/plugins/scaffolder/report.api.md @@ -70,15 +70,6 @@ export const EntityNamePickerFieldExtension: FieldExtensionComponent_2< any >; -// @public (undocumented) -export const EntityNamePickerFieldSchema: FieldSchema_2; - -// @public (undocumented) -export const entityNamePickerValidation: ( - value: string, - validation: FieldValidation, -) => void; - // @public export const EntityPickerFieldExtension: FieldExtensionComponent_2< string, @@ -237,39 +228,6 @@ export const MultiEntityPickerFieldExtension: FieldExtensionComponent_2< } >; -// @public (undocumented) -export const MultiEntityPickerFieldSchema: FieldSchema_2< - string[], - { - defaultKind?: string | undefined; - defaultNamespace?: string | false | undefined; - catalogFilter?: - | Record< - string, - | string - | string[] - | { - exists?: boolean | undefined; - } - > - | Record< - string, - | string - | string[] - | { - exists?: boolean | undefined; - } - >[] - | undefined; - allowArbitraryValues?: boolean | undefined; - } ->; - -// @public -export type MultiEntityPickerUiOptions = NonNullable< - (typeof MultiEntityPickerFieldSchema.TProps.uiSchema)['ui:options'] ->; - // @public export const MyGroupsPickerFieldExtension: FieldExtensionComponent_2< string, @@ -422,9 +380,9 @@ export const RepoBranchPickerFieldExtension: FieldExtensionComponent_2< | { azure?: string[] | undefined; github?: string[] | undefined; + gitlab?: string[] | undefined; bitbucket?: string[] | undefined; gerrit?: string[] | undefined; - gitlab?: string[] | undefined; gitea?: string[] | undefined; } | undefined; @@ -433,33 +391,6 @@ export const RepoBranchPickerFieldExtension: FieldExtensionComponent_2< } >; -// @public (undocumented) -export const RepoBranchPickerFieldSchema: FieldSchema_2< - string, - { - requestUserCredentials?: - | { - secretsKey: string; - additionalScopes?: - | { - azure?: string[] | undefined; - github?: string[] | undefined; - bitbucket?: string[] | undefined; - gerrit?: string[] | undefined; - gitlab?: string[] | undefined; - gitea?: string[] | undefined; - } - | undefined; - } - | undefined; - } ->; - -// @public -export type RepoBranchPickerUiOptions = NonNullable< - (typeof RepoBranchPickerFieldSchema.TProps.uiSchema)['ui:options'] ->; - // @public export const repoPickerValidation: ( value: string, @@ -473,11 +404,11 @@ export const repoPickerValidation: ( export const RepoUrlPickerFieldExtension: FieldExtensionComponent_2< string, { - allowedHosts?: string[] | undefined; allowedOrganizations?: string[] | undefined; allowedOwners?: string[] | undefined; allowedProjects?: string[] | undefined; allowedRepos?: string[] | undefined; + allowedHosts?: string[] | undefined; requestUserCredentials?: | { secretsKey: string; @@ -485,9 +416,9 @@ export const RepoUrlPickerFieldExtension: FieldExtensionComponent_2< | { azure?: string[] | undefined; github?: string[] | undefined; + gitlab?: string[] | undefined; bitbucket?: string[] | undefined; gerrit?: string[] | undefined; - gitlab?: string[] | undefined; gitea?: string[] | undefined; } | undefined; @@ -500,11 +431,11 @@ export const RepoUrlPickerFieldExtension: FieldExtensionComponent_2< export const RepoUrlPickerFieldSchema: FieldSchema_2< string, { - allowedHosts?: string[] | undefined; allowedOrganizations?: string[] | undefined; allowedOwners?: string[] | undefined; allowedProjects?: string[] | undefined; allowedRepos?: string[] | undefined; + allowedHosts?: string[] | undefined; requestUserCredentials?: | { secretsKey: string; @@ -512,9 +443,9 @@ export const RepoUrlPickerFieldSchema: FieldSchema_2< | { azure?: string[] | undefined; github?: string[] | undefined; + gitlab?: string[] | undefined; bitbucket?: string[] | undefined; gerrit?: string[] | undefined; - gitlab?: string[] | undefined; gitea?: string[] | undefined; } | undefined; diff --git a/plugins/scaffolder/src/alpha/fields/EntityNamePicker.ts b/plugins/scaffolder/src/alpha/fields/EntityNamePicker.ts index 770e055948..dcb68edd15 100644 --- a/plugins/scaffolder/src/alpha/fields/EntityNamePicker.ts +++ b/plugins/scaffolder/src/alpha/fields/EntityNamePicker.ts @@ -14,11 +14,11 @@ * limitations under the License. */ import { createFormField } from '@backstage/plugin-scaffolder-react/alpha'; -import { EntityNamePicker as Component } from '../../components/fields/EntityNamePicker/EntityNamePicker'; import { + EntityNamePicker as Component, EntityNamePickerFieldSchema, entityNamePickerValidation, -} from '../../components'; +} from '../../components/fields/EntityNamePicker'; export const EntityNamePicker = createFormField({ component: Component, diff --git a/plugins/scaffolder/src/alpha/fields/EntityPicker.ts b/plugins/scaffolder/src/alpha/fields/EntityPicker.ts index d4ae6a5ecb..c80b38fe43 100644 --- a/plugins/scaffolder/src/alpha/fields/EntityPicker.ts +++ b/plugins/scaffolder/src/alpha/fields/EntityPicker.ts @@ -14,8 +14,10 @@ * limitations under the License. */ import { createFormField } from '@backstage/plugin-scaffolder-react/alpha'; -import { EntityPicker as Component } from '../../components/fields/EntityPicker/EntityPicker'; -import { EntityPickerFieldSchema } from '../../components'; +import { + EntityPicker as Component, + EntityPickerFieldSchema, +} from '../../components/fields/EntityPicker'; export const EntityPicker = createFormField({ component: Component, diff --git a/plugins/scaffolder/src/alpha/fields/EntityTagsPicker.ts b/plugins/scaffolder/src/alpha/fields/EntityTagsPicker.ts index 35b45a91a6..9a8e86730e 100644 --- a/plugins/scaffolder/src/alpha/fields/EntityTagsPicker.ts +++ b/plugins/scaffolder/src/alpha/fields/EntityTagsPicker.ts @@ -14,8 +14,10 @@ * limitations under the License. */ import { createFormField } from '@backstage/plugin-scaffolder-react/alpha'; -import { EntityTagsPicker as Component } from '../../components/fields/EntityTagsPicker/EntityTagsPicker'; -import { EntityTagsPickerFieldSchema } from '../../components'; +import { + EntityTagsPicker as Component, + EntityTagsPickerFieldSchema, +} from '../../components/fields/EntityTagsPicker'; export const EntityTagsPicker = createFormField({ component: Component, diff --git a/plugins/scaffolder/src/alpha/fields/MultiEntityPicker.ts b/plugins/scaffolder/src/alpha/fields/MultiEntityPicker.ts index 0b89e7351b..8e8c65d67c 100644 --- a/plugins/scaffolder/src/alpha/fields/MultiEntityPicker.ts +++ b/plugins/scaffolder/src/alpha/fields/MultiEntityPicker.ts @@ -14,8 +14,10 @@ * limitations under the License. */ import { createFormField } from '@backstage/plugin-scaffolder-react/alpha'; -import { MultiEntityPicker as Component } from '../../components/fields/MultiEntityPicker/MultiEntityPicker'; -import { MultiEntityPickerFieldSchema } from '../../components'; +import { + MultiEntityPicker as Component, + MultiEntityPickerFieldSchema, +} from '../../components/fields/MultiEntityPicker'; export const MultiEntityPicker = createFormField({ component: Component, diff --git a/plugins/scaffolder/src/alpha/fields/MyGroupsPicker.ts b/plugins/scaffolder/src/alpha/fields/MyGroupsPicker.ts index a8f0e74b8c..a2cd5823b4 100644 --- a/plugins/scaffolder/src/alpha/fields/MyGroupsPicker.ts +++ b/plugins/scaffolder/src/alpha/fields/MyGroupsPicker.ts @@ -14,8 +14,10 @@ * limitations under the License. */ import { createFormField } from '@backstage/plugin-scaffolder-react/alpha'; -import { MyGroupsPicker as Component } from '../../components/fields/MyGroupsPicker/MyGroupsPicker'; -import { MyGroupsPickerFieldSchema } from '../../components'; +import { + MyGroupsPicker as Component, + MyGroupsPickerFieldSchema, +} from '../../components/fields/MyGroupsPicker'; export const MyGroupsPicker = createFormField({ component: Component, diff --git a/plugins/scaffolder/src/alpha/fields/OwnedEntityPicker.ts b/plugins/scaffolder/src/alpha/fields/OwnedEntityPicker.ts index becd48b5ce..7b13797ce1 100644 --- a/plugins/scaffolder/src/alpha/fields/OwnedEntityPicker.ts +++ b/plugins/scaffolder/src/alpha/fields/OwnedEntityPicker.ts @@ -14,8 +14,10 @@ * limitations under the License. */ import { createFormField } from '@backstage/plugin-scaffolder-react/alpha'; -import { OwnedEntityPicker as Component } from '../../components/fields/OwnedEntityPicker/OwnedEntityPicker'; -import { OwnedEntityPickerFieldSchema } from '../../components'; +import { + OwnedEntityPicker as Component, + OwnedEntityPickerFieldSchema, +} from '../../components/fields/OwnedEntityPicker'; export const OwnedEntityPicker = createFormField({ component: Component, diff --git a/plugins/scaffolder/src/alpha/fields/OwnerPicker.ts b/plugins/scaffolder/src/alpha/fields/OwnerPicker.ts index 53ec16eb8b..00761207a0 100644 --- a/plugins/scaffolder/src/alpha/fields/OwnerPicker.ts +++ b/plugins/scaffolder/src/alpha/fields/OwnerPicker.ts @@ -14,8 +14,10 @@ * limitations under the License. */ import { createFormField } from '@backstage/plugin-scaffolder-react/alpha'; -import { OwnerPicker as Component } from '../../components/fields/OwnerPicker/OwnerPicker'; -import { OwnerPickerFieldSchema } from '../../components'; +import { + OwnerPicker as Component, + OwnerPickerFieldSchema, +} from '../../components/fields/OwnerPicker'; export const OwnerPicker = createFormField({ component: Component, diff --git a/plugins/scaffolder/src/alpha/fields/RepoBranchPicker.ts b/plugins/scaffolder/src/alpha/fields/RepoBranchPicker.ts index 176b4fdaa6..b1cf2d8802 100644 --- a/plugins/scaffolder/src/alpha/fields/RepoBranchPicker.ts +++ b/plugins/scaffolder/src/alpha/fields/RepoBranchPicker.ts @@ -14,8 +14,10 @@ * limitations under the License. */ import { createFormField } from '@backstage/plugin-scaffolder-react/alpha'; -import { RepoBranchPicker as Component } from '../../components/fields/RepoBranchPicker/RepoBranchPicker'; -import { RepoBranchPickerFieldSchema } from '../../components'; +import { + RepoBranchPicker as Component, + RepoBranchPickerFieldSchema, +} from '../../components/fields/RepoBranchPicker'; export const RepoBranchPicker = createFormField({ component: Component, diff --git a/plugins/scaffolder/src/alpha/fields/RepoUrlPicker.ts b/plugins/scaffolder/src/alpha/fields/RepoUrlPicker.ts index 829c20d7c0..10394f7df0 100644 --- a/plugins/scaffolder/src/alpha/fields/RepoUrlPicker.ts +++ b/plugins/scaffolder/src/alpha/fields/RepoUrlPicker.ts @@ -14,11 +14,11 @@ * limitations under the License. */ import { createFormField } from '@backstage/plugin-scaffolder-react/alpha'; -import { RepoUrlPicker as Component } from '../../components/fields/RepoUrlPicker/RepoUrlPicker'; import { repoPickerValidation, + RepoUrlPicker as Component, RepoUrlPickerFieldSchema, -} from '../../components'; +} from '../../components/fields/RepoUrlPicker'; export const RepoUrlPicker = createFormField({ component: Component, diff --git a/plugins/scaffolder/src/components/fields/EntityNamePicker/index.ts b/plugins/scaffolder/src/components/fields/EntityNamePicker/index.ts index 82d9cb0b17..fc295d66c5 100644 --- a/plugins/scaffolder/src/components/fields/EntityNamePicker/index.ts +++ b/plugins/scaffolder/src/components/fields/EntityNamePicker/index.ts @@ -13,5 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +export { EntityNamePicker } from './EntityNamePicker'; export { entityNamePickerValidation } from './validation'; export { EntityNamePickerFieldSchema } from './schema'; diff --git a/plugins/scaffolder/src/components/fields/EntityNamePicker/schema.ts b/plugins/scaffolder/src/components/fields/EntityNamePicker/schema.ts index 0230f26879..68c8d5157e 100644 --- a/plugins/scaffolder/src/components/fields/EntityNamePicker/schema.ts +++ b/plugins/scaffolder/src/components/fields/EntityNamePicker/schema.ts @@ -15,9 +15,6 @@ */ import { makeFieldSchema } from '@backstage/plugin-scaffolder-react'; -/** - * @public - */ export const EntityNamePickerFieldSchema = makeFieldSchema({ output: z => z.string(), }); diff --git a/plugins/scaffolder/src/components/fields/EntityNamePicker/validation.ts b/plugins/scaffolder/src/components/fields/EntityNamePicker/validation.ts index e475606c11..9302e9abc1 100644 --- a/plugins/scaffolder/src/components/fields/EntityNamePicker/validation.ts +++ b/plugins/scaffolder/src/components/fields/EntityNamePicker/validation.ts @@ -17,9 +17,6 @@ import { FieldValidation } from '@rjsf/utils'; import { KubernetesValidatorFunctions } from '@backstage/catalog-model'; -/** - * @public - */ export const entityNamePickerValidation = ( value: string, validation: FieldValidation, diff --git a/plugins/scaffolder/src/components/fields/EntityPicker/index.ts b/plugins/scaffolder/src/components/fields/EntityPicker/index.ts index b8df596c98..08583dca30 100644 --- a/plugins/scaffolder/src/components/fields/EntityPicker/index.ts +++ b/plugins/scaffolder/src/components/fields/EntityPicker/index.ts @@ -13,4 +13,5 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +export { EntityPicker } from './EntityPicker'; export { EntityPickerFieldSchema, type EntityPickerUiOptions } from './schema'; diff --git a/plugins/scaffolder/src/components/fields/EntityTagsPicker/index.ts b/plugins/scaffolder/src/components/fields/EntityTagsPicker/index.ts index 52bad9a80d..77786f0e1a 100644 --- a/plugins/scaffolder/src/components/fields/EntityTagsPicker/index.ts +++ b/plugins/scaffolder/src/components/fields/EntityTagsPicker/index.ts @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +export { EntityTagsPicker } from './EntityTagsPicker'; export { EntityTagsPickerFieldSchema, type EntityTagsPickerUiOptions, diff --git a/plugins/scaffolder/src/components/fields/EntityTagsPicker/schema.ts b/plugins/scaffolder/src/components/fields/EntityTagsPicker/schema.ts index d1a300f5c8..0162804ce1 100644 --- a/plugins/scaffolder/src/components/fields/EntityTagsPicker/schema.ts +++ b/plugins/scaffolder/src/components/fields/EntityTagsPicker/schema.ts @@ -46,7 +46,6 @@ export type EntityTagsPickerProps = typeof EntityTagsPickerFieldSchema.TProps; /** * The input props that can be specified under `ui:options` for the * `EntityTagsPicker` field extension. - * * @public */ export type EntityTagsPickerUiOptions = NonNullable< diff --git a/plugins/scaffolder/src/components/fields/MultiEntityPicker/index.ts b/plugins/scaffolder/src/components/fields/MultiEntityPicker/index.ts index 9a597b9b97..add40e4a81 100644 --- a/plugins/scaffolder/src/components/fields/MultiEntityPicker/index.ts +++ b/plugins/scaffolder/src/components/fields/MultiEntityPicker/index.ts @@ -14,6 +14,7 @@ * limitations under the License. */ +export { MultiEntityPicker } from './MultiEntityPicker'; export { MultiEntityPickerFieldSchema, type MultiEntityPickerUiOptions, diff --git a/plugins/scaffolder/src/components/fields/MultiEntityPicker/schema.ts b/plugins/scaffolder/src/components/fields/MultiEntityPicker/schema.ts index aa396229ee..667b4638b8 100644 --- a/plugins/scaffolder/src/components/fields/MultiEntityPicker/schema.ts +++ b/plugins/scaffolder/src/components/fields/MultiEntityPicker/schema.ts @@ -16,9 +16,6 @@ import { z as zod } from 'zod'; import { makeFieldSchema } from '@backstage/plugin-scaffolder-react'; -/** - * @public - */ export const entityQueryFilterExpressionSchema = zod.record( zod .string() @@ -26,9 +23,6 @@ export const entityQueryFilterExpressionSchema = zod.record( .or(zod.array(zod.string())), ); -/** - * @public - */ export const MultiEntityPickerFieldSchema = makeFieldSchema({ output: z => z.array(z.string()), uiOptions: z => @@ -60,7 +54,6 @@ export const MultiEntityPickerFieldSchema = makeFieldSchema({ /** * The input props that can be specified under `ui:options` for the * `EntityPicker` field extension. - * @public */ export type MultiEntityPickerUiOptions = NonNullable< (typeof MultiEntityPickerFieldSchema.TProps.uiSchema)['ui:options'] diff --git a/plugins/scaffolder/src/components/fields/MyGroupsPicker/index.ts b/plugins/scaffolder/src/components/fields/MyGroupsPicker/index.ts index 00be19cf96..42982dcb6f 100644 --- a/plugins/scaffolder/src/components/fields/MyGroupsPicker/index.ts +++ b/plugins/scaffolder/src/components/fields/MyGroupsPicker/index.ts @@ -14,6 +14,7 @@ * limitations under the License. */ +export { MyGroupsPicker } from './MyGroupsPicker'; export { MyGroupsPickerSchema, type MyGroupsPickerUiOptions, diff --git a/plugins/scaffolder/src/components/fields/MyGroupsPicker/schema.ts b/plugins/scaffolder/src/components/fields/MyGroupsPicker/schema.ts index 6ccda91afb..41e8579328 100644 --- a/plugins/scaffolder/src/components/fields/MyGroupsPicker/schema.ts +++ b/plugins/scaffolder/src/components/fields/MyGroupsPicker/schema.ts @@ -36,7 +36,6 @@ export type MyGroupsPickerUiOptions = NonNullable< /** * Props for the MyGroupsPicker. - * @public */ export type MyGroupsPickerProps = typeof MyGroupsPickerFieldSchema.TProps; diff --git a/plugins/scaffolder/src/components/fields/OwnedEntityPicker/index.ts b/plugins/scaffolder/src/components/fields/OwnedEntityPicker/index.ts index 985dae1d3c..6738a8a057 100644 --- a/plugins/scaffolder/src/components/fields/OwnedEntityPicker/index.ts +++ b/plugins/scaffolder/src/components/fields/OwnedEntityPicker/index.ts @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +export { OwnedEntityPicker } from './OwnedEntityPicker'; export { OwnedEntityPickerFieldSchema, type OwnedEntityPickerUiOptions, diff --git a/plugins/scaffolder/src/components/fields/OwnedEntityPicker/schema.ts b/plugins/scaffolder/src/components/fields/OwnedEntityPicker/schema.ts index 6dd00df49d..e5435c150f 100644 --- a/plugins/scaffolder/src/components/fields/OwnedEntityPicker/schema.ts +++ b/plugins/scaffolder/src/components/fields/OwnedEntityPicker/schema.ts @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { EntityPickerFieldSchema } from '../EntityPicker/schema'; +import { EntityPickerFieldSchema } from '../EntityPicker'; /** * @public @@ -23,7 +23,6 @@ export const OwnedEntityPickerFieldSchema = EntityPickerFieldSchema; /** * The input props that can be specified under `ui:options` for the * `OwnedEntityPicker` field extension. - * * @public */ export type OwnedEntityPickerUiOptions = NonNullable< diff --git a/plugins/scaffolder/src/components/fields/OwnerPicker/index.ts b/plugins/scaffolder/src/components/fields/OwnerPicker/index.ts index 9d94650e04..5080ee1602 100644 --- a/plugins/scaffolder/src/components/fields/OwnerPicker/index.ts +++ b/plugins/scaffolder/src/components/fields/OwnerPicker/index.ts @@ -13,4 +13,5 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +export { OwnerPicker } from './OwnerPicker'; export { OwnerPickerFieldSchema, type OwnerPickerUiOptions } from './schema'; diff --git a/plugins/scaffolder/src/components/fields/OwnerPicker/schema.ts b/plugins/scaffolder/src/components/fields/OwnerPicker/schema.ts index 76389216ba..5a5b2e9cf6 100644 --- a/plugins/scaffolder/src/components/fields/OwnerPicker/schema.ts +++ b/plugins/scaffolder/src/components/fields/OwnerPicker/schema.ts @@ -54,7 +54,6 @@ export const OwnerPickerFieldSchema = makeFieldSchema({ /** * The input props that can be specified under `ui:options` for the * `OwnerPicker` field extension. - * * @public */ export type OwnerPickerUiOptions = NonNullable< diff --git a/plugins/scaffolder/src/components/fields/RepoBranchPicker/index.ts b/plugins/scaffolder/src/components/fields/RepoBranchPicker/index.ts index 2b87b62ebd..e41b723aa9 100644 --- a/plugins/scaffolder/src/components/fields/RepoBranchPicker/index.ts +++ b/plugins/scaffolder/src/components/fields/RepoBranchPicker/index.ts @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - +export { RepoBranchPicker } from './RepoBranchPicker'; export { RepoBranchPickerFieldSchema, type RepoBranchPickerUiOptions, diff --git a/plugins/scaffolder/src/components/fields/RepoBranchPicker/schema.ts b/plugins/scaffolder/src/components/fields/RepoBranchPicker/schema.ts index 62a3b66e14..4e76f4d988 100644 --- a/plugins/scaffolder/src/components/fields/RepoBranchPicker/schema.ts +++ b/plugins/scaffolder/src/components/fields/RepoBranchPicker/schema.ts @@ -15,9 +15,6 @@ */ import { makeFieldSchema } from '@backstage/plugin-scaffolder-react'; -/** - * @public - */ export const RepoBranchPickerFieldSchema = makeFieldSchema({ output: z => z.string(), uiOptions: z => @@ -69,8 +66,6 @@ export const RepoBranchPickerFieldSchema = makeFieldSchema({ /** * The input props that can be specified under `ui:options` for the * `RepoBranchPicker` field extension. - * - * @public */ export type RepoBranchPickerUiOptions = NonNullable< (typeof RepoBranchPickerFieldSchema.TProps.uiSchema)['ui:options'] diff --git a/plugins/scaffolder/src/components/fields/RepoUrlPicker/index.ts b/plugins/scaffolder/src/components/fields/RepoUrlPicker/index.ts index 33e5ef1715..d4dc219b68 100644 --- a/plugins/scaffolder/src/components/fields/RepoUrlPicker/index.ts +++ b/plugins/scaffolder/src/components/fields/RepoUrlPicker/index.ts @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +export { RepoUrlPicker } from './RepoUrlPicker'; export { RepoUrlPickerFieldSchema, type RepoUrlPickerUiOptions, diff --git a/plugins/scaffolder/src/components/fields/RepoUrlPicker/validation.ts b/plugins/scaffolder/src/components/fields/RepoUrlPicker/validation.ts index 06c2fd5684..682fc6bb2a 100644 --- a/plugins/scaffolder/src/components/fields/RepoUrlPicker/validation.ts +++ b/plugins/scaffolder/src/components/fields/RepoUrlPicker/validation.ts @@ -22,7 +22,6 @@ import { scmIntegrationsApiRef } from '@backstage/integration-react'; * The validation function for the `repoUrl` that is returned from the * field extension. Ensures that you have all the required fields filled for * the different providers that exist. - * * @public */ export const repoPickerValidation = ( diff --git a/plugins/scaffolder/src/components/fields/index.ts b/plugins/scaffolder/src/components/fields/index.ts index dc1de86adb..287f62022c 100644 --- a/plugins/scaffolder/src/components/fields/index.ts +++ b/plugins/scaffolder/src/components/fields/index.ts @@ -13,14 +13,4 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -export * from './EntityPicker'; -export * from './EntityNamePicker'; -export * from './OwnerPicker'; -export * from './RepoUrlPicker'; -export * from './OwnedEntityPicker'; -export * from './EntityTagsPicker'; -export * from './RepoBranchPicker'; -export * from './MultiEntityPicker'; -export * from './MyGroupsPicker'; - export { type FieldSchema, makeFieldSchemaFromZod } from './utils'; diff --git a/plugins/scaffolder/src/components/index.ts b/plugins/scaffolder/src/components/index.ts index 552a75c99b..abafd42ed2 100644 --- a/plugins/scaffolder/src/components/index.ts +++ b/plugins/scaffolder/src/components/index.ts @@ -14,7 +14,33 @@ * limitations under the License. */ export * from './fields'; -export type { RepoUrlPickerUiOptions } from './fields'; + +export { + EntityPickerFieldSchema, + type EntityPickerUiOptions, +} from './fields/EntityPicker'; +export { + EntityTagsPickerFieldSchema, + type EntityTagsPickerUiOptions, +} from './fields/EntityTagsPicker'; +export { + MyGroupsPickerFieldSchema, + MyGroupsPickerSchema, + type MyGroupsPickerUiOptions, +} from './fields/MyGroupsPicker'; +export { + OwnedEntityPickerFieldSchema, + type OwnedEntityPickerUiOptions, +} from './fields/OwnedEntityPicker'; +export { + OwnerPickerFieldSchema, + type OwnerPickerUiOptions, +} from './fields/OwnerPicker'; +export { + repoPickerValidation, + RepoUrlPickerFieldSchema, + type RepoUrlPickerUiOptions, +} from './fields/RepoUrlPicker'; export { TemplateTypePicker } from './TemplateTypePicker';