Skip to content

Unsafe as any type assertion in CurrentChatTags component #38692

@NAME-ASHWANIYADAV

Description

@NAME-ASHWANIYADAV

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions