fix: title and description are now correctly displayed

Signed-off-by: Federico Morreale <frc.morreale@gmail.com>
This commit is contained in:
Federico Morreale
2023-10-11 11:37:35 +02:00
parent 664e86f7f9
commit 26e4d916d5
2 changed files with 14 additions and 2 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-scaffolder': patch
---
Title and description in RepoUrlPicker are now correctly displayed.
@@ -31,6 +31,7 @@ import { RepoUrlPickerProps } from './schema';
import { RepoUrlPickerState } from './types';
import useDebounce from 'react-use/lib/useDebounce';
import { useTemplateSecrets } from '@backstage/plugin-scaffolder-react';
import { Box, Divider, Typography } from '@material-ui/core';
export { RepoUrlPickerSchema } from './schema';
@@ -41,7 +42,7 @@ export { RepoUrlPickerSchema } from './schema';
* @public
*/
export const RepoUrlPicker = (props: RepoUrlPickerProps) => {
const { uiSchema, onChange, rawErrors, formData } = props;
const { uiSchema, onChange, rawErrors, formData, schema } = props;
const [state, setState] = useState<RepoUrlPickerState>(
parseRepoPickerUrl(formData),
);
@@ -157,9 +158,15 @@ export const RepoUrlPicker = (props: RepoUrlPickerProps) => {
const hostType =
(state.host && integrationApi.byHost(state.host)?.type) ?? null;
return (
<>
{schema.title && (
<Box my="8px">
<Typography variant="h5">{schema.title}</Typography>
<Divider />
</Box>
)}
{schema.description && <p>{schema.description}</p>}
<RepoUrlPickerHost
host={state.host}
hosts={allowedHosts}