Issue Description
The CurrentChatTags component in apps/meteor/client/views/omnichannel/additionalForms/CurrentChatTags.tsx uses an unsafe as any type assertion with a FIXME comment:
onChange={handler as any} // FIXME: any
Root Cause
The component defines its handler prop type as handler: (value: { label: string; value: string }[]) => void, but AutoCompleteTagsMultiple (which wraps PaginatedMultiSelectFiltered) expects onChange: (values: PaginatedMultiSelectOption[]) => void, where PaginatedMultiSelectOption = { value: string | number; label: string }.
The mismatch is value: string vs value: string | number, which caused the need for the unsafe as any cast.
Expected Behavior
The component should use PaginatedMultiSelectOption from @rocket.chat/fuselage directly, eliminating the type mismatch and removing the need for an unsafe cast.
Affected Files
apps/meteor/client/views/omnichannel/additionalForms/CurrentChatTags.tsx
apps/meteor/client/views/omnichannel/components/Tags.tsx (consumer)
Issue Description
The
CurrentChatTagscomponent inapps/meteor/client/views/omnichannel/additionalForms/CurrentChatTags.tsxuses an unsafeas anytype assertion with aFIXMEcomment:onChange={handler as any} // FIXME: anyRoot Cause
The component defines its handler prop type as
handler: (value: { label: string; value: string }[]) => void, butAutoCompleteTagsMultiple(which wrapsPaginatedMultiSelectFiltered) expectsonChange: (values: PaginatedMultiSelectOption[]) => void, wherePaginatedMultiSelectOption = { value: string | number; label: string }.The mismatch is
value: stringvsvalue: string | number, which caused the need for the unsafeas anycast.Expected Behavior
The component should use
PaginatedMultiSelectOptionfrom@rocket.chat/fuselagedirectly, eliminating the type mismatch and removing the need for an unsafe cast.Affected Files
apps/meteor/client/views/omnichannel/additionalForms/CurrentChatTags.tsxapps/meteor/client/views/omnichannel/components/Tags.tsx(consumer)