Skip to content

[Question]: Duplicate code in tmg and teal.widgets #881

Description

@donyunardi

What is your question?

The function variable_type_icons exists in two places:

tmg:

variable_type_icons <- function(var_type) {
checkmate::assert_character(var_type, any.missing = FALSE)
class_to_icon <- list(
numeric = "arrow-up-1-9",
integer = "arrow-up-1-9",
logical = "pause",
Date = "calendar",
POSIXct = "calendar",
POSIXlt = "calendar",
factor = "chart-bar",
character = "keyboard",
primary_key = "key",
unknown = "circle-question"
)

teal.widgets:
https://github.com/insightsengineering/teal.widgets/blob/d94641a1d7e532bef125e229cfc2407fd0d32d43/R/optionalInput.R#L323-L337

They're identical and I think they should live in teal.widgets.
Should we remove the one in tmg?

Code of Conduct

  • I agree to follow this project's Code of Conduct.

Contribution Guidelines

  • I agree to follow this project's Contribution Guidelines.

Security Policy

  • I agree to follow this project's Security Policy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    corequestionFurther information is requested

    Type

    No type

    Fields

    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