Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: fix type for BoolFormatter value #211

Merged
merged 2 commits into from
Oct 31, 2024

Conversation

carlinmack
Copy link
Contributor

@carlinmack carlinmack commented May 29, 2024

❤️ Thank you for your contribution!

Description

Please describe briefly your pull request.

1st commit

value is used as a boolean, and therefore all the uses of this in the codebase pass a boolean test as value. I think value isn't a great name for this, but at least we should fix the expected type

class BoolFormatter extends React.Component {
  render() {
    const { value, icon, color, tooltip } = this.props;
    if (!value) {
      return null;
    }
    return <Icon title={tooltip} name={icon} color={color} />;
  }
}

2nd commit

There is a warning from eslint that we should provide a default value for the tooltip and looking at the repository, this icon is used to mean a variety of things such as activated, success, verified, confirmed, etc. As such I don't think we can define a sensible default value for tooltip

Checklist

Ticks in all boxes and 🟢 on all GitHub actions status checks are required to merge:

Frontend

Reminder

By using GitHub, you have already agreed to the GitHub’s Terms of Service including that:

  1. You license your contribution under the same terms as the current repository’s license.
  2. You agree that you have the right to license your contribution under the current repository’s license.

@carlinmack carlinmack added the bug Something isn't working label May 29, 2024
Copy link
Member

@alejandromumo alejandromumo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to check how this BoolFormatter is being used in all the codebase, sometimes we pass a boolean and othertimes we pass an object.

@carlinmack carlinmack removed their assignment Sep 12, 2024
@slint slint merged commit 4f08f26 into inveniosoftware:main Oct 31, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

Successfully merging this pull request may close these issues.

3 participants