refactor: apply review suggestions

Signed-off-by: Camila Belo <camilaibs@gmail.com>
This commit is contained in:
Camila Belo
2024-10-01 14:25:59 +02:00
parent f989c47e63
commit 8f52640e54
3 changed files with 30 additions and 36 deletions
+4 -6
View File
@@ -325,12 +325,10 @@ export const scaffolderTranslationRef: TranslationRef<
readonly 'templateEditorToolbar.installedActionsDocumentationTooltip': 'Installed Actions Documentation';
readonly 'templateEditorToolbar.addToCatalogButton': 'Publish';
readonly 'templateEditorToolbar.addToCatalogDialogTitle': 'Publish changes';
readonly 'templateEditorToolbar.addToCatalogDialogContent.introduction': 'Follow the instructions below to create or update a template:';
readonly 'templateEditorToolbar.addToCatalogDialogContent.step1': 'Save the template files in a local directory';
readonly 'templateEditorToolbar.addToCatalogDialogContent.step2': 'Create a pull request to a new or existing git repository';
readonly 'templateEditorToolbar.addToCatalogDialogContent.step3': 'If the template already exists, the changes will be reflected in the software catalog once the pull request gets merged';
readonly 'templateEditorToolbar.addToCatalogDialogContent.step4': 'But if you are creating a new template, follow the documentation linked below to register the new template repository in software catalog';
readonly 'templateEditorToolbar.addToCatalogDialogActions.closeButton': 'Close';
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';
}
>;
@@ -31,7 +31,6 @@ import DialogActions from '@material-ui/core/DialogActions';
import ExtensionIcon from '@material-ui/icons/Extension';
import DescriptionIcon from '@material-ui/icons/Description';
import { Link } from '@backstage/core-components';
import { FieldExtensionOptions } from '@backstage/plugin-scaffolder-react';
import { ActionPageContent } from '../../../components/ActionsPage/ActionsPage';
@@ -137,31 +136,30 @@ export function TemplateEditorToolbar(props: {
<DialogContent dividers>
<DialogContentText id="publish-dialog-slide-description">
{t(
'templateEditorToolbar.addToCatalogDialogContent.introduction',
'templateEditorToolbar.addToCatalogDialogContent.stepsIntroduction',
)}
<ol>
<li>
{t('templateEditorToolbar.addToCatalogDialogContent.step1')}
</li>
<li>
{t('templateEditorToolbar.addToCatalogDialogContent.step2')}
</li>
<li>
{t('templateEditorToolbar.addToCatalogDialogContent.step3')}
</li>
<li>
{t('templateEditorToolbar.addToCatalogDialogContent.step4')}
<br />
<Link to="https://backstage.io/docs/features/software-templates/adding-templates/">
https://backstage.io/docs/features/software-templates/adding-templates/
</Link>
</li>
</ol>
<ul>
{t(
'templateEditorToolbar.addToCatalogDialogContent.stepsListItems',
)
.split('\n')
.map((step, index) => (
<li key={index}>{step}</li>
))}
</ul>
</DialogContentText>
</DialogContent>
<DialogActions>
<Button color="primary" onClick={() => setShowPublishModal(false)}>
{t('templateEditorToolbar.addToCatalogDialogActions.closeButton')}
<Button
color="primary"
href={t(
'templateEditorToolbar.addToCatalogDialogActions.documentationUrl',
)}
target="_blank"
>
{t(
'templateEditorToolbar.addToCatalogDialogActions.documentationButton',
)}
</Button>
</DialogActions>
</Dialog>
+6 -8
View File
@@ -304,17 +304,15 @@ export const scaffolderTranslationRef = createTranslationRef({
addToCatalogButton: 'Publish',
addToCatalogDialogTitle: 'Publish changes',
addToCatalogDialogContent: {
introduction:
stepsIntroduction:
'Follow the instructions below to create or update a template:',
step1: 'Save the template files in a local directory',
step2: 'Create a pull request to a new or existing git repository',
step3:
'If the template already exists, the changes will be reflected in the software catalog once the pull request gets merged',
step4:
'But if you are creating a new template, follow the documentation linked below to register the new template repository in software catalog',
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',
},
addToCatalogDialogActions: {
closeButton: 'Close',
documentationButton: 'Go to the documentation',
documentationUrl:
'https://backstage.io/docs/features/software-templates/adding-templates/',
},
},
},