-
Notifications
You must be signed in to change notification settings - Fork 36
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
ACM-13728: Missing s390x arch option in Cpu architecture in InfraEnv #2668
base: releases/v2.12-cim
Are you sure you want to change the base?
ACM-13728: Missing s390x arch option in Cpu architecture in InfraEnv #2668
Conversation
@jgyselov: This pull request references ACM-13728 which is a valid jira issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: jgyselov The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
b95f2b3
to
ba72e83
Compare
25c363e
to
829d952
Compare
829d952
to
bc6016e
Compare
const onCpuArchToggle = React.useCallback(() => { | ||
if (cpuArchOpen) { | ||
setCpuArchOpen(false); | ||
} else { | ||
setCpuArchOpen(true); | ||
} | ||
}, [cpuArchOpen]); |
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 is no need to memoize this function. It could also be simplified to setCpuArchOpen(!cpuArchOpen)
const onCpuArchSelect = React.useCallback( | ||
(e?: React.SyntheticEvent<HTMLDivElement>) => { | ||
const val = e?.currentTarget.id as SupportedCpuArchitecture; | ||
setValue(val); | ||
|
||
if (val === CpuArchitecture.s390x) { | ||
setFieldValue('userManagedNetworking', true); | ||
} else { | ||
setFieldValue('userManagedNetworking', false); | ||
} | ||
setCpuArchOpen(false); | ||
}, | ||
[setValue, setFieldValue], | ||
); | ||
|
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.
Again, no need to memoize.
There is also a bug in formik, where setFieldValue
is always a new instance - we have a workaround for that in useFormikHelpers.ts
We can also simplify setFieldValue('userManagedNetworking', val === CpuArchitecture.s390x);
https://issues.redhat.com/browse/ACM-13728
Console PR: stolostron/console#3894