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

Robustly handle missing icons. #391

Merged

Conversation

rtibbles
Copy link
Member

@rtibbles rtibbles commented Dec 1, 2022

Description

  • This makes the KIcon component properly handle when it is passed an icon name that does not exist, preventing TypeErrors
  • Defaults to a brokenImage icon in the cases that the icon is not recognised

Issue addressed

Fixes #390

Before/after screenshots

Added documentation of this behaviour to the main KIcon docs.

Screenshot from 2022-12-01 09-49-54

(optional) Implementation notes

At a high level, how did you implement this?

Does this introduce any tech-debt items?

Testing checklist

  • Contributor has fully tested the PR manually
  • If there are any front-end changes, before/after screenshots are included
  • Critical and brittle code paths are covered by unit tests
  • The change has been added to the changelog

Reviewer guidance

  • Is the code clean and well-commented?
  • Are there tests for this change?
  • Are all UI components LTR and RTL compliant (if applicable)?
  • Add other things to check for here

Comments

@rtibbles rtibbles changed the base branch from develop to release-v1.4.x December 1, 2022 17:52
docs/pages/kicon.vue Outdated Show resolved Hide resolved
Co-authored-by: Devon Rueckner <[email protected]>
Copy link
Member

@marcellamaki marcellamaki left a comment

Choose a reason for hiding this comment

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

This looks good to me. I like the approach. And thanks, @indirectlylit for the notes on the docs!

@marcellamaki marcellamaki merged commit 6c85d2e into learningequality:release-v1.4.x Dec 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Gracefully handle invalid icon selection
3 participants