-
Notifications
You must be signed in to change notification settings - Fork 46
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
feat: Add additional power field types for IP address, LXD, and Virsh #5447
base: main
Are you sure you want to change the base?
Conversation
Hm, I'm getting some real strange behavior in tests surrounding a couple of selectors
const subnets = useSelector((state: RootState) =>
subnetSelectors.getByIds(state, vlan?.subnet_ids || [])
);
const errors = useSelector((state: RootState) =>
machineSelectors.eventErrorsForIds(state, systemId, [
NodeActions.TAG,
NodeActions.UNTAG,
])
)[0]?.error; Not quite sure what's causing these (or especially how it's related to this PR's changes), @petermakowski could you take a look if you have a minute? |
|
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.
Have you checked the bundle size impact of adding a new dependency?
: field.field_type === PowerFieldType.IP_ADDRESS || | ||
field.field_type === PowerFieldType.VIRSH_ADDRESS || | ||
field.field_type === PowerFieldType.LXD_ADDRESS | ||
? Yup.string().test({ | ||
name: "is-ip-address", | ||
message: "Please enter a valid IP address.", | ||
test: (value) => isIP(value as string), | ||
}) | ||
: Yup.string(); |
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 function has become quite difficult to read. I'd suggest to move this logic into a separate function, e.g. getPowerFieldSchema
that takes PowerField and returns correct Yup schema.
Good point - I'll run a before/after check. Although likelihood is we'll need this anyway for upcoming reserved IP work |
86aea4e
to
c59e8b8
Compare
Done
QA steps
Notes
The MP for the backend implementation of this is here