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

More icon interface #2688

Merged
merged 4 commits into from
Jan 4, 2024
Merged

More icon interface #2688

merged 4 commits into from
Jan 4, 2024

Conversation

Befkadu1
Copy link
Contributor

@Befkadu1 Befkadu1 commented Jan 4, 2024

fix #2686

Review:

  • Commits are atomic
  • Commits have the correct type for the changes made
  • Commits with breaking changes are marked as such

Browsers tested:

(Check any that applies, it's ok to leave boxes unchecked if testing something didn't seem relevant.)

Windows:

  • Chrome
  • Edge
  • Firefox

Linux:

  • Chrome
  • Firefox

macOS:

  • Chrome
  • Firefox
  • Safari

Mobile:

  • Chrome on Android
  • iOS

Copy link

github-actions bot commented Jan 4, 2024

Documentation has been published to https://lundalogik.github.io/lime-elements/versions/PR-2688/

@Befkadu1 Befkadu1 force-pushed the more-icon-interface branch from 1d15499 to 8669eae Compare January 4, 2024 14:54
@Befkadu1 Befkadu1 force-pushed the more-icon-interface branch from 8669eae to b34746c Compare January 4, 2024 15:32
@Kiarokh Kiarokh merged commit 920d55a into next Jan 4, 2024
11 checks passed
@Kiarokh Kiarokh deleted the more-icon-interface branch January 4, 2024 15:38
@lime-opensource
Copy link
Collaborator

🎉 This PR is included in version 37.1.0-next.81 🎉

The release is available on:

Your semantic-release bot 📦🚀

{item.icon ? this.renderIcon(this.config, item) : null}
{this.renderIcon(this.config, item)}
Copy link
Contributor

Choose a reason for hiding this comment

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

😬

This change makes the list crash if any item doesn't have icon specified 😞

Reports of several customers having this problem: https://forum.lime-crm.com/t/query-visualizer-not-working-with-newer-lime-elements/5723

The problem is that renderIcon uses getIconName, which in turn does:

if (typeof icon === 'object' && 'name' in icon) {
    return icon.name;
}

The problem is that typeof null returns 'object', so this tries to run 'name' in null, which causes an error.

I think get-icon-props.ts is a pretty perfect example of how helper-functions can be broken out into a separate file, to make them testable. But unfortunately, there are no tests for that file 🙈 😄

I'll look into adding some tests and fixing the bug.

@Befkadu1 @Kiarokh

Copy link
Contributor

Choose a reason for hiding this comment

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

🙏

Copy link
Contributor Author

Choose a reason for hiding this comment

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

omg I did not know that typeof null returns 'object' 🙈. Sorry for the bug we created! Thanks for letting us know.

@lime-opensource
Copy link
Collaborator

🎉 This PR is included in version 37.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@lime-opensource
Copy link
Collaborator

🎉 This PR is included in version 37.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

list: empty icons are rendered, when icon.name is undefined
4 participants