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] Icon – Update "no icon" variant #592

Merged
merged 15 commits into from
Nov 15, 2024
Merged

Conversation

narin
Copy link
Contributor

@narin narin commented Nov 15, 2024

Description of Change

This PR is a follow-up of #573 and a fix for the errors that the app team is running into when running their unit tests:

node_modules/@department-of-veterans-affairs/mobile-component-library/src/components/Alert/Alert.tsx:165:9 - error TS2322: Type 'string' is not assignable to type '"AccessibilityNew" | "AccessibleForward" | "AccountBalance" | "AccountBox" | "AccountCircle" | "Acute" | "Add" | "AddCircle" | "AddCircleOutline" | "Adjust" | "Alarm" | "AlternateEmail" | ... 268 more ... | "ZoomOutMap"'.
  165     name={expanded ? 'ExpandLess' : 'ExpandMore'}
         ~~~~
   node_modules/@department-of-veterans-affairs/mobile-component-library/src/components/Icon/Icon.tsx
7
    11    name: keyof typeof IconMap
           ~~~~
The expected type comes from property 'name' which is declared here on type 'IntrinsicAttributes & PropsWithChildren<IconProps>'

I initially thought that it might be something related to their jest tsconfig but tried several changes to that without success.

While I do not know the exact reason why the noIcon prop is problematic, I confirmed that the errors go away when that type partial is removed. This PR replaces the noIcon prop with passing 'none' for name. This required some minor updates to Link and the unit tests as well. Summary of changes:

  • Removed noIcon prop
  • Added | 'none' to name prop
  • Updated logic within Icon and Link to support this
  • Updated Link unit tests and Icon story
  • Also, unrelated change, but added exports for each component's Props type in our index.tsx as I noticed in the app they are having to put the full path to the component to import the props. (See example)
  • Tested alpha build within app on Chika's branch and all tests are passing

Testing Packages

Screenshots/Video

iOS  
Android  

Testing

  • Tested on iOS
  • Tested on Android
  • Tested on Web

PR Checklist

Code reviewer validation:

  • General
    • PR is linked to ticket(s)
    • PR has changelog label applied if it's to be included in the changelog
    • Acceptance criteria:
      • All satisfied or
      • Documented reason for not being performed or
      • Split to separate ticket and ticket is linked by relevant AC(s)
    • Above PR sections adequately filled out
    • If any breaking changes, in accordance with the pre-1.0.0 versioning guidelines: a CU ticket has been created for the VA Mobile App detailing necessary adjustments with the package version that will be published by this ticket
  • Code
    • Tests are included if appropriate (or split to separate ticket)
    • New functions have proper TSDoc annotations

Publish

If changes warrant a new version per the versioning guidelines and the PR is approved and ready to merge:

@narin narin changed the title Bug/9064 narin patch icon [Bug] Icon – Update "no icon" variant Nov 15, 2024
@narin narin marked this pull request as ready for review November 15, 2024 04:54
@narin narin requested a review from a team as a code owner November 15, 2024 04:54
@TimRoe TimRoe merged commit 8fbef7e into main Nov 15, 2024
4 of 12 checks passed
@TimRoe TimRoe deleted the bug/9064-narin-patch-icon branch November 15, 2024 18:50
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.

3 participants