-
Notifications
You must be signed in to change notification settings - Fork 179
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): add heater shaker types #9577
Conversation
This PR adds the constants and types necessary for the heater shaker module in shared-data and redux.
Codecov Report
@@ Coverage Diff @@
## edge #9577 +/- ##
==========================================
+ Coverage 75.44% 75.87% +0.42%
==========================================
Files 1908 1917 +9
Lines 50869 51476 +607
Branches 4892 4899 +7
==========================================
+ Hits 38379 39057 +678
+ Misses 11569 11496 -73
- Partials 921 923 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @sakibh LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you for adding these types! 🍰
module={module} | ||
controlDisabledReason={controlDisabledReason} | ||
/> | ||
{module.type !== HEATERSHAKER_MODULE_TYPE && ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I gated this to not render ModuleControls
when the module is heaterShakerModuleType
because there are no controls for the heater shaker in this legacy component.
@@ -31,6 +33,12 @@ export const SUPPORTED_MODULE_SLOTS: SupportedSlotMap = { | |||
value: SPAN7_8_10_11_SLOT, | |||
}, | |||
], | |||
[HEATERSHAKER_MODULE_TYPE]: [ | |||
{ | |||
name: 'Slot 6 (supported)', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be revisited, I put in slot 6 as a placeholder.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 🐳
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code changes look LGTM, smoke tested PD and seems to look as expected (and since PD e2e tests are passing we know all critical flows still work 😄 )
@@ -419,7 +419,7 @@ export const ICON_DATA_BY_NAME = { | |||
path: | |||
'M11.6 6V5c0-2-1.6-3.6-3.6-3.6S4.4 3 4.4 5v1H3v8h10V6h-1.4zM8 11c-.6 0-1-.4-1-1s.4-1 1-1 1 .4 1 1-.4 1-1 1zM5.6 6V5c0-1.3 1.1-2.4 2.4-2.4s2.4 1.1 2.4 2.4v1H5.6z', | |||
}, | |||
'heater-shaker': { | |||
'ot-heater-shaker': { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😁
function render(props: ModuleFieldsProps) { | ||
return mount( | ||
<Provider store={store}> | ||
<ModuleFields {...props} /> | ||
</Provider> | ||
) | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how come this change needed to be made?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool with it, honestly just curious
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had to include this because of the getEnabledHeaterShaker
feature flag in that component. It conditionally filters out the heater shaker after the modules end point is hit. When the flag is removed shall we revert the test as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh sorry i meant the shallow
vs mount
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ohh, for that I was following a similar pattern in another component/test called EditModuleCard.test.tsx
which also tests with a feature flag (getDisableModuleRestrictions
) and wraps the component with a Provider. From some digging around I gathered mount
is needed here over shallow
because it needs the full life cycle (componentDidMount) to the test the component.
Overview
This PR adds the constants and types necessary for the heater shaker module in
shared-data
andredux
.Changelog
shared-data
andredux
Review requests
Risk assessment
low