diff --git a/packages/core-components/src/components/Select/Select.tsx b/packages/core-components/src/components/Select/Select.tsx index 3b6582865c..b5a641acd4 100644 --- a/packages/core-components/src/components/Select/Select.tsx +++ b/packages/core-components/src/components/Select/Select.tsx @@ -102,7 +102,7 @@ const useStyles = makeStyles( { name: 'BackstageSelect' }, ); -export type Item = { +export type SelectItem = { label: string; value: string | number; }; @@ -111,7 +111,7 @@ export type Selection = string | string[] | number | number[]; export type SelectProps = { multiple?: boolean; - items: Item[]; + items: SelectItem[]; label: string; placeholder?: string; selected?: Selection; diff --git a/packages/core-components/src/components/Select/index.tsx b/packages/core-components/src/components/Select/index.tsx index 8c9ae28ac8..293d626ee6 100644 --- a/packages/core-components/src/components/Select/index.tsx +++ b/packages/core-components/src/components/Select/index.tsx @@ -16,10 +16,10 @@ export { SelectComponent as Select } from './Select'; export type { - Item, SelectClassKey, SelectInputBaseClassKey, Selection, + SelectItem, } from './Select'; export type { ClosedDropdownClassKey } from './static/ClosedDropdown'; export type { OpenedDropdownClassKey } from './static/OpenedDropdown'; diff --git a/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.tsx b/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.tsx index 42e24cc998..e4d6f280f4 100644 --- a/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.tsx +++ b/plugins/scaffolder/src/components/fields/RepoUrlPicker/RepoUrlPicker.tsx @@ -13,7 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { Item, Progress, Select, Selection } from '@backstage/core-components'; +import { + Progress, + Select, + Selection, + SelectItem, +} from '@backstage/core-components'; import { useApi } from '@backstage/core-plugin-api'; import { scmIntegrationsApiRef } from '@backstage/integration-react'; import FormControl from '@material-ui/core/FormControl'; @@ -237,13 +242,13 @@ export const RepoUrlPicker = ({ return ; } - const hostsOptions: Item[] = integrations + const hostsOptions: SelectItem[] = integrations ? integrations .filter(i => allowedHosts?.includes(i.host)) .map(i => ({ label: i.title, value: i.host })) : [{ label: 'Loading...', value: 'loading' }]; - const ownersOptions: Item[] = allowedOwners + const ownersOptions: SelectItem[] = allowedOwners ? allowedOwners.map(i => ({ label: i, value: i })) : [{ label: 'Loading...', value: 'loading' }];