-
Notifications
You must be signed in to change notification settings - Fork 364
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
fix: [M3-6480] - Fix blank Node Pool plan selection #9009
fix: [M3-6480] - Fix blank Node Pool plan selection #9009
Conversation
Co-authored-by: Hussain Khalil <hussain@sanpilot.co>
Co-authored-by: Hussain Khalil <hussain@sanpilot.co>
Co-authored-by: Hussain Khalil <hussain@sanpilot.co>
Co-authored-by: Hussain Khalil <hussain@sanpilot.co>
…k-plan-selection Co-authored-by: Hussain Khalil <hussain@sanpilot.co>
const [_types, setNewType] = React.useState<ExtendedTypeWithCount[]>( | ||
addCountToTypes(types) | ||
const [typeCountMap, setTypeCountMap] = React.useState<Map<string, number>>( | ||
new Map() |
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.
Decided to use a Map
here instead of an index signature object because those can lead to runtime errors without noUncheckedIndexedAccess
enabled:
const map1: { [key: string]: number } = {"type1": 0};
const type2Count: number = map1["type2"]; # no type error
vs with Map
:
const map1: Map<string, number> = new Map([[ "type1", 0 ]]);
const type2Count: number = map1.get("type2"); # type error: number | undefined is not assignable to number.
Co-authored-by: Hussain Khalil <hussain@sanpilot.co>
...nager/src/features/Kubernetes/KubernetesClusterDetail/NodePoolsDisplay/AddNodePoolDrawer.tsx
Outdated
Show resolved
Hide resolved
2 flaky tests on run #3069 ↗︎
Details:
linodes/rescue-linode.spec.ts • 1 flaky test
objectStorage/object-storage.e2e.spec.ts • 1 flaky test
This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. |
Co-authored-by: Hussain Khalil <hussain@sanpilot.co>
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 did not notice any regressions, thank you for for the fix!
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 !
…k-plan-selection Co-authored-by: Hussain Khalil <hussain@sanpilot.co>
Description 📝
Fixes a bug introduced in #8840 that causes the
AddNodePool
drawer to not show any plans in certain situations.Also included are basic unit tests that validate the fix and small amendments to the recent
useQueryClient
PR.Preview 📷
How to test 🧪
AddNodePoolDrawer
appears and displays all plan types and details.