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(app): remove invalid type warnings for strings from atoms #11918

Merged
merged 6 commits into from
Dec 23, 2022

Conversation

koji
Copy link
Contributor

@koji koji commented Dec 21, 2022

Overview

Add String() to remove warnings from atoms
The lines I added String() should be string since most of them are CSS property values for test cases(not null / not undefined).

This is part of RAUT-74

The number of warnings

edge: 3432
this branch: 3234

Changelog

  • Add String()

Review requests

Risk assessment

low

@codecov
Copy link

codecov bot commented Dec 21, 2022

Codecov Report

Merging #11918 (9f0a908) into edge (3c06c7f) will decrease coverage by 0.00%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##             edge   #11918      +/-   ##
==========================================
- Coverage   74.17%   74.17%   -0.01%     
==========================================
  Files        2164     2164              
  Lines       59752    59753       +1     
  Branches     6264     6265       +1     
==========================================
- Hits        44324    44323       -1     
  Misses      13953    13953              
- Partials     1475     1477       +2     
Flag Coverage Δ
app 73.18% <66.66%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
app/src/atoms/Interstitial/Interstitial.tsx 66.66% <0.00%> (ø)
app/src/atoms/MenuList/index.tsx 100.00% <ø> (ø)
app/src/atoms/structure/Divider.tsx 100.00% <ø> (ø)
app/src/atoms/Banner/index.tsx 86.66% <100.00%> (-13.34%) ⬇️
app/src/atoms/StatusLabel/index.tsx 100.00% <100.00%> (ø)

@koji koji marked this pull request as ready for review December 21, 2022 07:14
@koji koji requested a review from a team as a code owner December 21, 2022 07:14
@koji koji requested review from jerader and a team and removed request for a team and jerader December 21, 2022 07:14
Copy link
Collaborator

@jerader jerader left a comment

Choose a reason for hiding this comment

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

Nice Koji! thank you for removing a few hundred warnings! Just left a few questions.

@@ -119,7 +121,7 @@ export function Banner(props: BannerProps): JSX.Element {
<Flex flex="1" alignItems={ALIGN_CENTER}>
{props.children}
</Flex>
{onCloseClick && !(isCloseActionLoading ?? false) ? (
{onCloseClick != null && !(isCloseActionLoading ?? false) ? (
Copy link
Collaborator

Choose a reason for hiding this comment

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

can you maybe change onCloseClick prop on line 32 to say

onCloseClick?: (() => void) | React.MouseEventHandler<HTMLButtonElement>

Also, why is the != null no longer needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will update

@@ -132,7 +134,7 @@ export function Banner(props: BannerProps): JSX.Element {
)}
</Btn>
) : null}
{isCloseActionLoading && (
{(isCloseActionLoading ?? false) && (
Copy link
Collaborator

Choose a reason for hiding this comment

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

why do we not need the ?? false 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.

I will take a look

Copy link
Contributor Author

Choose a reason for hiding this comment

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

isCloseActionLoading?: boolean
maybe add false as the default value and keep the {isCloseActionLoading && (

@koji
Copy link
Contributor Author

koji commented Dec 21, 2022

Nice Koji! thank you for removing a few hundred warnings! Just left a few questions.

@jerader thank you for reviewing. I will address your feedback.

@koji koji changed the title refactor(app): Remove string warnings from atoms refactor(app): remove invalid type warnings for strings from atoms Dec 22, 2022
@koji
Copy link
Contributor Author

koji commented Dec 22, 2022

  • resolve conflicts

@koji koji merged commit a2c4523 into edge Dec 23, 2022
y3rsh added a commit that referenced this pull request Jan 6, 2023
* origin/edge: (34 commits)
  refactor(app): update desktop robot settings calibration section for OT-3 (#11942)
  feat(hardware): add CAN message to update motor position from encoders (#11868)
  ci(monorepo): upgrade windows versions on github workflows (#11940)
  feat(app): implement useCalibrationTaskList hook (#11894)
  feat(app, app-shell, app-shell-odd): create node layer for ODD (#11944)
  refactor(app): Remove recalibrate option from POC and TLC overflow menus [RAUT-93] (#11915)
  fix(api): home z should home gripper z too (#11950)
  refactor(shared-data): gripper use force polynomial function  (#11946)
  refactor(api): move `ModuleGeometry` to legacy protocol core module (#11939)
  refactor(api): deprecate `ModuleContext.geometry` (#11938)
  chore(usb-bridge): add usb-bridge tests to test-py, add restart to push-ot3 (#11937)
  Revert "feat(app-shell-odd): create node layer for ODD (#11852)" (#11941)
  feat(app-shell-odd): create node layer for ODD (#11852)
  feature(hardware): add a warning style to can_mon and an "estop_released" error id (#11924)
  fix(hardware): Remove while loop and rely on  number_of_messages when parsing motor position response.  (#11929)
  fix(hardware): save can_comm / can_mon logs to read-write location (#11933)
  feat(api): Support 96 channel in the hardware controller (#11866)
  refactor(app): revert run a protocol from devices pages (#11909)
  refactor(app): remove warnings (#11922)
  refactor(app): remove invalid type warnings for strings from atoms (#11918)
  ...
@koji koji deleted the refactor-remove-string-warnings-from-atoms branch January 9, 2023 20:06
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