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

refactor: Convert UI files to TS #3475

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

refactor: Convert UI files to TS #3475

wants to merge 6 commits into from

Conversation

calvin-codecov
Copy link
Contributor

@calvin-codecov calvin-codecov commented Nov 8, 2024

Description

Closes codecov/engineering-team#2724

Notable Changes

Screenshots

Link to Sample Entry

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. In 2022 this entity acquired Codecov and as result Sentry is going to need some rights from me in order to utilize my contributions in this PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

@calvin-codecov calvin-codecov marked this pull request as draft November 8, 2024 18:19
Comment on lines -139 to -142
{
[buttonVariant.outlined]:
'ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-indigo-600 shadow-sm',
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this seemed like a bug... with cs, if we pass an obj, it applies the key as the class string if the value is truthy. Which means this was always just adding the classname "undefined"

@codecov-staging
Copy link

codecov-staging bot commented Nov 8, 2024

Bundle Report

Changes will increase total bundle size by 20.74kB (0.12%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
gazebo-staging-system-esm* 5.59MB 1.02kB (-0.02%) ⬇️
gazebo-staging-system 5.56MB 21.76kB (0.39%) ⬆️

ℹ️ *Bundle size includes cached data from a previous commit

Copy link

codecov bot commented Nov 8, 2024

Bundle Report

Changes will increase total bundle size by 45.26kB (0.26%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
gazebo-production-system 5.56MB 21.76kB (0.39%) ⬆️
gazebo-production-system-esm 5.61MB 23.5kB (0.42%) ⬆️

@codecov-staging
Copy link

codecov-staging bot commented Nov 12, 2024

Codecov Report

Attention: Patch coverage is 96.15385% with 1 line in your changes missing coverage. Please review.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/ui/ContextSwitcher/ContextSwitcher.tsx 92.30% 1 Missing ⚠️

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3475      +/-   ##
==========================================
- Coverage   99.17%   99.09%   -0.09%     
==========================================
  Files         800      808       +8     
  Lines       14132    14399     +267     
  Branches     4001     4102     +101     
==========================================
+ Hits        14015    14268     +253     
- Misses        110      124      +14     
  Partials        7        7              
Files with missing lines Coverage Δ
.../Header/components/Navigator/MyContextSwitcher.tsx 100.00% <100.00%> (ø)
...bs/Admin/ManageAdminCard/AdminTable/AdminTable.tsx 100.00% <ø> (ø)
...gPlan/BillingDetails/EmailAddress/EmailAddress.tsx 100.00% <ø> (ø)
...illBanners/TriggerSyncBanner/TriggerSyncBanner.tsx 100.00% <100.00%> (ø)
...illBanners/TriggerSyncBanner/TriggerSyncBanner.tsx 100.00% <100.00%> (ø)
src/shared/AppLink/AppLink.jsx 100.00% <ø> (ø)
.../LicenseExpirationModal/LicenseExpirationModal.tsx 100.00% <ø> (ø)
.../shared/ListRepo/ReposTableTeam/ReposTableTeam.tsx 100.00% <100.00%> (ø)
src/ui/Avatar/Avatar.jsx 100.00% <ø> (ø)
src/ui/Button/Button.tsx 100.00% <100.00%> (ø)
... and 4 more

... and 18 files with indirect coverage changes

Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 100.00% <100.00%> (ø)
Pages 98.81% <100.00%> (-0.13%) ⬇️
Services 99.36% <ø> (+<0.01%) ⬆️
Shared 99.74% <100.00%> (+<0.01%) ⬆️
UI 99.13% <95.00%> (-0.08%) ⬇️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 620fe27...dc2431f. Read the comment docs.

@codecov-qa
Copy link

codecov-qa bot commented Nov 12, 2024

Codecov Report

Attention: Patch coverage is 96.15385% with 1 line in your changes missing coverage. Please review.

Project coverage is 99.09%. Comparing base (620fe27) to head (dc2431f).
Report is 3 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/ui/ContextSwitcher/ContextSwitcher.tsx 92.30% 1 Missing ⚠️

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3475      +/-   ##
==========================================
- Coverage   99.17%   99.09%   -0.09%     
==========================================
  Files         800      808       +8     
  Lines       14132    14399     +267     
  Branches     4008     4095      +87     
==========================================
+ Hits        14015    14268     +253     
- Misses        110      124      +14     
  Partials        7        7              
Files with missing lines Coverage Δ
.../Header/components/Navigator/MyContextSwitcher.tsx 100.00% <100.00%> (ø)
...bs/Admin/ManageAdminCard/AdminTable/AdminTable.tsx 100.00% <ø> (ø)
...gPlan/BillingDetails/EmailAddress/EmailAddress.tsx 100.00% <ø> (ø)
...illBanners/TriggerSyncBanner/TriggerSyncBanner.tsx 100.00% <100.00%> (ø)
...illBanners/TriggerSyncBanner/TriggerSyncBanner.tsx 100.00% <100.00%> (ø)
src/shared/AppLink/AppLink.jsx 100.00% <ø> (ø)
.../LicenseExpirationModal/LicenseExpirationModal.tsx 100.00% <ø> (ø)
.../shared/ListRepo/ReposTableTeam/ReposTableTeam.tsx 100.00% <100.00%> (ø)
src/ui/Avatar/Avatar.jsx 100.00% <ø> (ø)
src/ui/Button/Button.tsx 100.00% <100.00%> (ø)
... and 4 more

... and 18 files with indirect coverage changes

Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 100.00% <100.00%> (ø)
Pages 98.81% <100.00%> (-0.13%) ⬇️
Services 99.36% <ø> (+<0.01%) ⬆️
Shared 99.74% <100.00%> (+<0.01%) ⬆️
UI 99.13% <95.00%> (-0.08%) ⬇️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 620fe27...dc2431f. Read the comment docs.

Copy link

codecov-public-qa bot commented Nov 12, 2024

Codecov Report

Attention: Patch coverage is 96.15385% with 1 line in your changes missing coverage. Please review.

Project coverage is 99.09%. Comparing base (620fe27) to head (dc2431f).
Report is 3 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/ui/ContextSwitcher/ContextSwitcher.tsx 92.30% 1 Missing ⚠️

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3475      +/-   ##
==========================================
- Coverage   99.17%   99.09%   -0.09%     
==========================================
  Files         800      808       +8     
  Lines       14132    14399     +267     
  Branches     4001     4095      +94     
==========================================
+ Hits        14015    14268     +253     
- Misses        110      124      +14     
  Partials        7        7              
Files with missing lines Coverage Δ
.../Header/components/Navigator/MyContextSwitcher.tsx 100.00% <100.00%> (ø)
...bs/Admin/ManageAdminCard/AdminTable/AdminTable.tsx 100.00% <ø> (ø)
...gPlan/BillingDetails/EmailAddress/EmailAddress.tsx 100.00% <ø> (ø)
...illBanners/TriggerSyncBanner/TriggerSyncBanner.tsx 100.00% <100.00%> (ø)
...illBanners/TriggerSyncBanner/TriggerSyncBanner.tsx 100.00% <100.00%> (ø)
src/shared/AppLink/AppLink.jsx 100.00% <ø> (ø)
.../LicenseExpirationModal/LicenseExpirationModal.tsx 100.00% <ø> (ø)
.../shared/ListRepo/ReposTableTeam/ReposTableTeam.tsx 100.00% <100.00%> (ø)
src/ui/Avatar/Avatar.jsx 100.00% <ø> (ø)
src/ui/Button/Button.tsx 100.00% <100.00%> (ø)
... and 4 more

... and 18 files with indirect coverage changes

Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 100.00% <100.00%> (ø)
Pages 98.81% <100.00%> (-0.13%) ⬇️
Services 99.36% <ø> (+<0.01%) ⬆️
Shared 99.74% <100.00%> (+<0.01%) ⬆️
UI 99.13% <95.00%> (-0.08%) ⬇️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 620fe27...dc2431f. Read the comment docs.

Copy link

codecov bot commented Nov 12, 2024

Codecov Report

Attention: Patch coverage is 96.15385% with 1 line in your changes missing coverage. Please review.

Project coverage is 99.09%. Comparing base (620fe27) to head (dc2431f).
Report is 3 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/ui/ContextSwitcher/ContextSwitcher.tsx 92.30% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3475      +/-   ##
==========================================
- Coverage   99.17%   99.09%   -0.09%     
==========================================
  Files         800      808       +8     
  Lines       14132    14399     +267     
  Branches     4008     4102      +94     
==========================================
+ Hits        14015    14268     +253     
- Misses        110      124      +14     
  Partials        7        7              
Files with missing lines Coverage Δ
.../Header/components/Navigator/MyContextSwitcher.tsx 100.00% <100.00%> (ø)
...bs/Admin/ManageAdminCard/AdminTable/AdminTable.tsx 100.00% <ø> (ø)
...gPlan/BillingDetails/EmailAddress/EmailAddress.tsx 100.00% <ø> (ø)
...illBanners/TriggerSyncBanner/TriggerSyncBanner.tsx 100.00% <100.00%> (ø)
...illBanners/TriggerSyncBanner/TriggerSyncBanner.tsx 100.00% <100.00%> (ø)
src/shared/AppLink/AppLink.jsx 100.00% <ø> (ø)
.../LicenseExpirationModal/LicenseExpirationModal.tsx 100.00% <ø> (ø)
.../shared/ListRepo/ReposTableTeam/ReposTableTeam.tsx 100.00% <100.00%> (ø)
src/ui/Avatar/Avatar.jsx 100.00% <ø> (ø)
src/ui/Button/Button.tsx 100.00% <100.00%> (ø)
... and 4 more

... and 18 files with indirect coverage changes

Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 100.00% <100.00%> (ø)
Pages 98.81% <100.00%> (-0.13%) ⬇️
Services 99.36% <ø> (+<0.01%) ⬆️
Shared 99.74% <100.00%> (+<0.01%) ⬆️
UI 99.13% <95.00%> (-0.08%) ⬇️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 620fe27...dc2431f. Read the comment docs.

@codecov-releaser
Copy link
Contributor

codecov-releaser commented Nov 12, 2024

✅ Deploy preview for gazebo ready!

Previews expire after 1 month automatically.

Storybook

Commit Created Cloud Enterprise
8fff124 Tue, 12 Nov 2024 08:21:57 GMT Expired Expired
91a6090 Tue, 12 Nov 2024 18:16:07 GMT Expired Expired
dc2431f Tue, 12 Nov 2024 21:56:08 GMT Cloud Enterprise

@calvin-codecov calvin-codecov marked this pull request as ready for review November 12, 2024 18:00
Comment on lines +118 to +125
interface WithTo {
to: AppLinkProps
hook?: string
}
interface WithoutTo {
to?: never
hook: string
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this replaces the validation function for hook from the PropTypes

Comment on lines +133 to +135
type ExtendedButtonProps = ButtonProps &
(WithTo | WithoutTo) &
Partial<AppLinkProps>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Button essentially has to shepherd along props to possible AppLink render

@calvin-codecov calvin-codecov changed the title refactor: Convert ContextSwitcher to TS refactor: Convert UI files to TS Nov 12, 2024
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.

Migrate UI elements to TS (Part 1)
2 participants