docs: add more about prop signature change details

Signed-off-by: JounQin <admin@1stg.me>
This commit is contained in:
JounQin
2025-03-11 21:48:41 +08:00
committed by benjdlambert
parent 66a1140dd8
commit d1ce7a47d9
4 changed files with 12 additions and 2 deletions
+7 -1
View File
@@ -1,5 +1,11 @@
---
'@backstage/plugin-catalog-import': patch
'@backstage/plugin-catalog-import': minor
---
Add i18n support for catalog-import plugin
`ImportStepper` component now supports i18n, it's `generateStepper` prop now
accepts a third `t: TranslationFunction<typeof catalogImportTranslationRef.T>`
function from `@backstage/core-plugin-api/alpha` and uses it to translate the
stepper steps, checkout `catalogImportTranslationRef` from `@backstage/plugin-catalog-import/alpha`
for more details.
+1
View File
@@ -216,6 +216,7 @@ export interface ImportStepperProps {
generateStepper?: (
flow: ImportFlows,
defaults: StepperProvider,
t: TranslationFunction<typeof catalogImportTranslationRef.T>,
) => StepperProvider;
// (undocumented)
initialUrl?: string;
@@ -16,7 +16,9 @@
import { InfoCard, InfoCardVariants } from '@backstage/core-components';
import { useApi } from '@backstage/core-plugin-api';
import { TranslationFunction } from '@backstage/core-plugin-api/alpha';
import { useTranslationRef } from '@backstage/frontend-plugin-api';
import { catalogImportTranslationRef } from '@backstage/plugin-catalog-import/alpha';
import Step from '@material-ui/core/Step';
import StepContent from '@material-ui/core/StepContent';
import Stepper from '@material-ui/core/Stepper';
@@ -24,7 +26,6 @@ import { makeStyles } from '@material-ui/core/styles';
import { useMemo } from 'react';
import { catalogImportApiRef } from '../../api';
import { catalogImportTranslationRef } from '../../translation';
import { ImportFlows, ImportState, useImportState } from '../useImportState';
import {
defaultGenerateStepper,
@@ -49,6 +50,7 @@ export interface ImportStepperProps {
generateStepper?: (
flow: ImportFlows,
defaults: StepperProvider,
t: TranslationFunction<typeof catalogImportTranslationRef.T>,
) => StepperProvider;
variant?: InfoCardVariants;
}
@@ -86,6 +86,7 @@ export interface StepperProvider {
*
* @param flow - the name of the active flow
* @param defaults - the default steps
* @param t - the translation function
* @public
*/
export function defaultGenerateStepper(