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

Convert Badge and Branding to Typescript #1801

Merged
merged 16 commits into from
Mar 2, 2024
Merged

Conversation

recondesigns
Copy link
Contributor

Description of changes

Converting components included all test and storybook files for each.

  • Converted Badge component to Typescript, removed prop-types, and added a props type
  • Converted Branding components to Typescript, removed prop-types, and added a props type
    • ColorSection
    • FontSection
    • LogoSection
    • Swatch

Issue Resolved

Fixes #NA

Screenshots/GIFs

All new .tsx files

Screenshot 2024-02-29 at 9 58 48 PM

@recondesigns recondesigns requested a review from kylemh March 1, 2024 04:00
Copy link

vercel bot commented Mar 1, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
operation-code ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 2, 2024 3:31pm
storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 2, 2024 3:31pm

Copy link
Member

@kylemh kylemh left a comment

Choose a reason for hiding this comment

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

looks like we've got a few spots where we're ignoring type errors in app code. Let's resolve those and we should be good to go!

components/Badge/Badge.tsx Outdated Show resolved Hide resolved
@@ -3,7 +3,9 @@ import Swatch from 'components/Branding/Swatch/Swatch';
import Content from 'components/Content/Content';

function ColorSection() {
// @ts-expect-error
Copy link
Member

Choose a reason for hiding this comment

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

it's fine to have error expects in test code, but not in UI code... what's the error here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So, the ts error is: "Property 'primary' does not exist on type '{}'.ts(2339)", and the error flag is on brandColorsObject.primary. I think I found a way to solve the error.

Screenshot 2024-03-02 at 8 44 40 AM

components/Branding/FontSection/FontSection.tsx Outdated Show resolved Hide resolved
Copy link

codeclimate bot commented Mar 2, 2024

Code Climate has analyzed commit fd0d0f2 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (90% is the threshold).

This pull request will bring the total coverage in the repository to 79.6% (-1.0% change).

View more on Code Climate.

Copy link

cypress bot commented Mar 2, 2024

Passing run #4639 ↗︎

0 25 0 0 Flakiness 0

Details:

removed unused @ts-directives
Project: operation_code Commit: fd0d0f2428
Status: Passed Duration: 03:06 💡
Started: Mar 2, 2024 3:31 PM Ended: Mar 2, 2024 3:34 PM

Review all test suite changes for PR #1801 ↗︎

@kylemh kylemh merged commit de9d16a into main Mar 2, 2024
17 of 18 checks passed
@kylemh kylemh deleted the convert-badge-and-branding-to-ts branch March 2, 2024 16:08
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.

2 participants