Skip to content

Commit c65a031

Browse files
committed
test(plugin-detail): type the markdown editor's onChange and the highlight fixtures (objectui#11541)
Drops two `as any` casts in the new pin file (a plain name/label pair is a HighlightField) and the `any` on the markdown branch's onChange parameter, which TextAreaField already types as string. No behaviour change. Claude-Session: https://claude.ai/code/session_01FjqrwXPfSMkSfkKYDSRkN2 Co-authored-by: Claude <noreply@anthropic.com>
1 parent 950c768 commit c65a031

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎packages/plugin-detail/src/InlineFieldInput.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ export const InlineFieldInput: React.FC<InlineFieldInputProps> = ({
422422
// `html` / `richtext` never reach this component: the hosts' gate still
423423
// excludes them.
424424
if (editType === 'markdown') {
425-
return <TextAreaField field={field as any} value={value} onChange={(v: any) => onChange(v)} autoFocus={autoFocus} error={error} />;
425+
return <TextAreaField field={field as any} value={value} onChange={(v) => onChange(v)} autoFocus={autoFocus} error={error} />;
426426
}
427427
// Reference fields (lookup / master_detail / tree / user / owner) store an id
428428
// but may arrive `$expand`-ed as a record object. A plain text input would

‎packages/plugin-detail/src/__tests__/InlineFieldInput.markdownEditor-11541.test.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ describe('objectui#11541 — both detail hosts offer the markdown editor', () =>
129129
}
130130
const { container } = render(
131131
<InlineEditProvider canEdit>
132-
<HeaderHighlight fields={[{ name: 'notes', label: 'Notes' }] as any} data={{ notes: STORED }} objectSchema={markdownSchema} />
132+
<HeaderHighlight fields={[{ name: 'notes', label: 'Notes' }]} data={{ notes: STORED }} objectSchema={markdownSchema} />
133133
<EnterEdit />
134134
</InlineEditProvider>,
135135
);
@@ -232,7 +232,7 @@ describe('objectui#11541 — `html` and `richtext` still open no editor', () =>
232232
const { container } = render(
233233
<InlineEditProvider canEdit>
234234
<HeaderHighlight
235-
fields={[{ name: 'body', label: 'Body' }] as any}
235+
fields={[{ name: 'body', label: 'Body' }]}
236236
data={{ body: MARKUP[type] }}
237237
objectSchema={{ fields: { body: { type, label: 'Body' } } }}
238238
/>

0 commit comments

Comments
 (0)