Merge pull request #26586 from backstage/scaffolder/copy-improvements

[Scaffolder] copy improvements
This commit is contained in:
Ben Lambert
2024-09-10 10:24:35 +02:00
committed by GitHub
7 changed files with 19 additions and 7 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/core-components': patch
---
Removed default title set to Unknown page on `ContentHeaderTitle` component to support usage of component without title prop.
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-scaffolder': patch
---
Removed duplicated titles on Scaffolder `TemplateListPage` component
@@ -30,6 +30,13 @@ describe('<ContentHeader/>', () => {
rendered.getByText('Title');
});
it('should render without title', async () => {
const rendered = await renderInTestApp(
<ContentHeader>content</ContentHeader>,
);
rendered.getByText('content');
});
it('should render with titleComponent', async () => {
const title = 'Custom title';
const titleComponent = <h1>{title}</h1>;
@@ -73,10 +73,7 @@ type ContentHeaderTitleProps = {
className?: string;
};
const ContentHeaderTitle = ({
title = 'Unknown page',
className,
}: ContentHeaderTitleProps) => (
const ContentHeaderTitle = ({ title, className }: ContentHeaderTitleProps) => (
<Typography
variant="h4"
component="h2"
-1
View File
@@ -230,7 +230,6 @@ 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.title': 'Available 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.additionalLinksForEntity.viewTechDocsTitle': 'View TechDocs';
@@ -177,7 +177,7 @@ export const TemplateListPage = (props: TemplateListPageProps) => {
<ScaffolderPageContextMenu {...scaffolderPageContextMenuProps} />
</Header>
<Content>
<ContentHeader title={t('templateListPage.contentHeader.title')}>
<ContentHeader>
<RegisterExistingButton
title={t(
'templateListPage.contentHeader.registerExistingButtonTitle',
-1
View File
@@ -261,7 +261,6 @@ export const scaffolderTranslationRef = createTranslationRef({
otherTitle: 'Other Templates',
},
contentHeader: {
title: 'Available Templates',
registerExistingButtonTitle: 'Register Existing Component',
supportButtonTitle:
'Create new software components using standard templates. Different templates create different kinds of components (services, websites, documentation, ...).',