Skip to content

Commit 09a38c9

Browse files
committed
Remove 'as any' assertion from FieldList.tsx
Replaced object literal prop spreading with explicit props for CheckboxTree component. - Removed unused ref callback (treeDomNode was assigned but never used) - Added required selectedList and onSelectionChange props with empty defaults (unused since isSelectable=false) - Converted all props from object literal spread to direct JSX props
1 parent 8821fe2 commit 09a38c9

File tree

1 file changed

+31
-32
lines changed
  • packages/libs/wdk-client/src/Components/AttributeFilter

1 file changed

+31
-32
lines changed

packages/libs/wdk-client/src/Components/AttributeFilter/FieldList.tsx

Lines changed: 31 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -141,40 +141,39 @@ export default class FieldList extends React.Component<
141141
return (
142142
<div className="field-list">
143143
<CheckboxTree<TreeNode<Field>>
144-
{...({
145-
ref: this.handleCheckboxTreeRef,
146-
autoFocusSearchBox: autoFocus,
147-
tree: fieldTree,
148-
expandedList: this.state.expandedNodes,
149-
getNodeId: this.getNodeId,
150-
getNodeChildren: this.getNodeChildren,
151-
onExpansionChange: this.handleExpansionChange,
152-
isSelectable: false,
153-
isSearchable: true,
154-
searchBoxPlaceholder: 'Find a variable',
155-
searchBoxHelp: makeSearchHelpText(
156-
'the variables by name or description'
157-
),
158-
searchTerm: this.state.searchTerm,
159-
onSearchTermChange: this.handleSearchTermChange,
160-
searchPredicate: this.searchPredicate,
161-
renderNode: (node: FieldTreeNode) => (
162-
<FieldNode
163-
node={node}
164-
searchTerm={this.state.searchTerm}
165-
isActive={node.field.term === activeField?.term}
166-
handleFieldSelect={this.handleFieldSelect}
167-
/>
168-
),
169-
linksPosition: LinksPosition.Top,
170-
styleOverrides: {
171-
treeNode: {
172-
nodeWrapper: {
173-
padding: 0,
174-
},
144+
autoFocusSearchBox={autoFocus}
145+
tree={fieldTree}
146+
expandedList={this.state.expandedNodes}
147+
getNodeId={this.getNodeId}
148+
getNodeChildren={this.getNodeChildren}
149+
onExpansionChange={this.handleExpansionChange}
150+
isSelectable={false}
151+
selectedList={[]}
152+
onSelectionChange={() => {}}
153+
isSearchable={true}
154+
searchBoxPlaceholder="Find a variable"
155+
searchBoxHelp={makeSearchHelpText(
156+
'the variables by name or description'
157+
)}
158+
searchTerm={this.state.searchTerm}
159+
onSearchTermChange={this.handleSearchTermChange}
160+
searchPredicate={this.searchPredicate}
161+
renderNode={(node: FieldTreeNode) => (
162+
<FieldNode
163+
node={node}
164+
searchTerm={this.state.searchTerm}
165+
isActive={node.field.term === activeField?.term}
166+
handleFieldSelect={this.handleFieldSelect}
167+
/>
168+
)}
169+
linksPosition={LinksPosition.Top}
170+
styleOverrides={{
171+
treeNode: {
172+
nodeWrapper: {
173+
padding: 0,
175174
},
176175
},
177-
} as any)}
176+
}}
178177
/>
179178
</div>
180179
);

0 commit comments

Comments
 (0)