update other scaffolder inputs to textfield

Signed-off-by: Stephen Glass <stephen@stephen.glass>
This commit is contained in:
Stephen Glass
2024-08-19 09:40:45 -04:00
parent 46e5e554f3
commit d6f0d712a5
8 changed files with 43 additions and 57 deletions
+2 -1
View File
@@ -1,5 +1,6 @@
---
'@backstage/plugin-scaffolder': patch
'@backstage/plugin-scaffolder-react': patch
---
Change scaffolder secret widget to use `TextField` component for more flexibility in theme overrides.
Change scaffolder widgets to use `TextField` component for more flexibility in theme overrides.
@@ -15,8 +15,7 @@
*/
import { WidgetProps } from '@rjsf/utils';
import InputLabel from '@material-ui/core/InputLabel';
import Input from '@material-ui/core/Input';
import TextField from '@material-ui/core/TextField';
import React from 'react';
import FormHelperText from '@material-ui/core/FormHelperText';
import { MarkdownContent } from '@backstage/core-components';
@@ -32,9 +31,9 @@ export const PasswordWidget = (
return (
<>
<InputLabel htmlFor={title}>{title}</InputLabel>
<Input
<TextField
id={title}
label={title}
aria-describedby={title}
onChange={e => {
onChange(e.target.value);
@@ -17,8 +17,7 @@
import FormControl from '@material-ui/core/FormControl';
import React from 'react';
import FormHelperText from '@material-ui/core/FormHelperText';
import Input from '@material-ui/core/Input';
import InputLabel from '@material-ui/core/InputLabel';
import TextField from '@material-ui/core/TextField';
import { BaseRepoBranchPickerProps } from './types';
@@ -43,9 +42,9 @@ export const DefaultRepoBranchPicker = ({
required={required}
error={rawErrors?.length > 0 && !branch}
>
<InputLabel htmlFor="branchInput">Branch</InputLabel>
<Input
<TextField
id="branchInput"
label="Branch"
onChange={e => onChange({ branch: e.target.value })}
value={branch}
/>
@@ -17,8 +17,7 @@
import React from 'react';
import FormControl from '@material-ui/core/FormControl';
import FormHelperText from '@material-ui/core/FormHelperText';
import Input from '@material-ui/core/Input';
import InputLabel from '@material-ui/core/InputLabel';
import TextField from '@material-ui/core/TextField';
import { BaseRepoUrlPickerProps } from './types';
import { Select, SelectItem } from '@backstage/core-components';
@@ -65,14 +64,12 @@ export const AzureRepoPicker = (
items={organizationItems}
/>
) : (
<>
<InputLabel htmlFor="orgInput">Organization</InputLabel>
<Input
id="orgInput"
onChange={e => onChange({ organization: e.target.value })}
value={organization}
/>
</>
<TextField
id="orgInput"
label="Organization"
onChange={e => onChange({ organization: e.target.value })}
value={organization}
/>
)}
<FormHelperText>
The Organization that this repo will belong to
@@ -95,14 +92,12 @@ export const AzureRepoPicker = (
items={projectItems}
/>
) : (
<>
<InputLabel htmlFor="projectInput">Project</InputLabel>
<Input
id="projectInput"
onChange={e => onChange({ project: e.target.value })}
value={project}
/>
</>
<TextField
id="projectInput"
label="Project"
onChange={e => onChange({ project: e.target.value })}
value={project}
/>
)}
<FormHelperText>
The Project that this repo will belong to
@@ -16,8 +16,7 @@
import React from 'react';
import FormControl from '@material-ui/core/FormControl';
import FormHelperText from '@material-ui/core/FormHelperText';
import Input from '@material-ui/core/Input';
import InputLabel from '@material-ui/core/InputLabel';
import TextField from '@material-ui/core/TextField';
import { BaseRepoUrlPickerProps } from './types';
export const GerritRepoPicker = (props: BaseRepoUrlPickerProps) => {
@@ -26,9 +25,9 @@ export const GerritRepoPicker = (props: BaseRepoUrlPickerProps) => {
return (
<>
<FormControl margin="normal" error={rawErrors?.length > 0 && !workspace}>
<InputLabel htmlFor="ownerInput">Owner</InputLabel>
<Input
<TextField
id="ownerInput"
label="Owner"
onChange={e => onChange({ owner: e.target.value })}
value={owner}
/>
@@ -39,9 +38,9 @@ export const GerritRepoPicker = (props: BaseRepoUrlPickerProps) => {
required
error={rawErrors?.length > 0 && !workspace}
>
<InputLabel htmlFor="parentInput">Parent</InputLabel>
<Input
<TextField
id="parentInput"
label="Parent"
onChange={e => onChange({ workspace: e.target.value })}
value={workspace}
/>
@@ -16,8 +16,7 @@
import React from 'react';
import FormControl from '@material-ui/core/FormControl';
import FormHelperText from '@material-ui/core/FormHelperText';
import Input from '@material-ui/core/Input';
import InputLabel from '@material-ui/core/InputLabel';
import TextField from '@material-ui/core/TextField';
import { Select, SelectItem } from '@backstage/core-components';
import { BaseRepoUrlPickerProps } from './types';
@@ -56,9 +55,9 @@ export const GiteaRepoPicker = (
/>
) : (
<>
<InputLabel htmlFor="ownerInput">Owner</InputLabel>
<Input
<TextField
id="ownerInput"
label="Owner"
onChange={e => onChange({ owner: e.target.value })}
value={owner}
/>
@@ -16,8 +16,7 @@
import React from 'react';
import FormControl from '@material-ui/core/FormControl';
import FormHelperText from '@material-ui/core/FormHelperText';
import Input from '@material-ui/core/Input';
import InputLabel from '@material-ui/core/InputLabel';
import TextField from '@material-ui/core/TextField';
import { Select, SelectItem } from '@backstage/core-components';
import { BaseRepoUrlPickerProps } from './types';
@@ -52,14 +51,12 @@ export const GithubRepoPicker = (
items={ownerItems}
/>
) : (
<>
<InputLabel htmlFor="ownerInput">Owner</InputLabel>
<Input
id="ownerInput"
onChange={e => onChange({ owner: e.target.value })}
value={owner}
/>
</>
<TextField
id="ownerInput"
label="Owner"
onChange={e => onChange({ owner: e.target.value })}
value={owner}
/>
)}
<FormHelperText>
The organization, user or project that this repo will belong to
@@ -16,8 +16,7 @@
import React from 'react';
import FormControl from '@material-ui/core/FormControl';
import FormHelperText from '@material-ui/core/FormHelperText';
import Input from '@material-ui/core/Input';
import InputLabel from '@material-ui/core/InputLabel';
import TextField from '@material-ui/core/TextField';
import { Select, SelectItem } from '@backstage/core-components';
import { BaseRepoUrlPickerProps } from './types';
@@ -55,14 +54,12 @@ export const GitlabRepoPicker = (
items={ownerItems}
/>
) : (
<>
<InputLabel htmlFor="ownerInput">Owner</InputLabel>
<Input
id="ownerInput"
onChange={e => onChange({ owner: e.target.value })}
value={owner}
/>
</>
<TextField
id="ownerInput"
label="Owner"
onChange={e => onChange({ owner: e.target.value })}
value={owner}
/>
)}
<FormHelperText>
GitLab namespace where this repository will belong to. It can be the