Skip to content

Chore: Simplify getNodeIconType utility in WebDAV File Picker #40240

@Makeepan-dev

Description

@Makeepan-dev

Description

Currently, the getNodeIconType utility function in the WebDAV File Picker returns an object containing { icon, type, extension }. However, looking at the codebase and the inline // TODO, this function's callers only ever use the icon property.

Returning the unused type and extension variables adds unnecessary complexity. This issue proposes simplifying the function to directly return the icon name and updating its consumers and unit tests accordingly.

Expected Behavior

  • getNodeIconType.ts returns an IconName string instead of an object.
  • Unused type and extension local variables are removed from the function.
  • WebDAV table and grid components consume the simplified return type.

Actual Behavior

  • The function calculates and returns unused data, and caller components have to destruct the object: const { icon } = getNodeIconType(...)

Context

This was noted as a // TODO in apps/meteor/client/views/room/webdav/WebdavFilePickerModal/lib/getNodeIconType.ts. Cleaning this up will improve code maintainability.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: featurePull requests that introduces new feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions