Skip to content

Commit 4972af6

Browse files
committed
fix(app-shell): type the flow-label read; FlowPreview test passes the required preview props
Claude-Session: https://claude.ai/code/session_01WGufzi3ezPzTysQPDEjmVz Co-authored-by: Claude <noreply@anthropic.com>
1 parent ba47b53 commit 4972af6

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎ui/packages/app-shell/src/views/metadata-admin/previews/FlowCanvas.test.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,7 @@ describe('Flow designer — package label translations (flows.<flow>.label, appr
709709
vi.stubGlobal('fetch', vi.fn(async () => new Response('not found', { status: 404 })));
710710
const { container } = render(
711711
<I18nProvider instance={zhInstance()} persistLanguage={false}>
712-
<FlowPreview draft={DRAFT} selection={null} onSelectionChange={() => {}} />
712+
<FlowPreview type="flow" name="opportunity_approval" draft={DRAFT} selection={null} onSelectionChange={() => {}} />
713713
</I18nProvider>,
714714
);
715715
expect((container.querySelector('[data-node-id="manager_review"]') as HTMLElement).textContent).toContain('经理审核');

‎ui/packages/app-shell/src/views/metadata-admin/previews/flow-label-translations.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export function flowLabelTranslations(
4444
language: string,
4545
): FlowLabelTranslations | undefined {
4646
if (!bundle || !flowName) return undefined;
47-
const flowLabel = translateFlow({ name: flowName }, bundle, { locale: language }).label;
47+
const flowLabel = translateFlow<{ name: string; label?: string }>({ name: flowName }, bundle, { locale: language }).label;
4848
const approvals = bundle[language]?.flows?.[flowName]?.approvals;
4949
return {
5050
flowLabel: typeof flowLabel === 'string' && flowLabel ? flowLabel : undefined,

0 commit comments

Comments
 (0)