-
Notifications
You must be signed in to change notification settings - Fork 43
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
[#911] Add validation to migration throttling inputs and add CPU throttling field #915
[#911] Add validation to migration throttling inputs and add CPU throttling field #915
Conversation
@@ -34,14 +34,30 @@ export class GeneralSettings extends React.Component { | |||
}; | |||
|
|||
render() { | |||
const { isFetchingServers, isFetchingSettings, isSavingSettings, savedSettings, settingsForm } = this.props; | |||
const { |
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.
Similar blocks of code found in 9 locations. Consider refactoring.
input: { value, onChange }, | ||
postfix | ||
} = this.props; | ||
const { id, label, input, postfix, initialUncheckedValue, meta } = this.props; |
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.
Similar blocks of code found in 6 locations. Consider refactoring.
c934b51
to
c864c98
Compare
ca776f7
to
c8c6166
Compare
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 looks pretty good! What happened to those postfix labels, though?
@@ -287,8 +287,10 @@ Object { | |||
"isSavingSettings": false, | |||
"postConversionHostsResults": Array [], | |||
"savedSettings": Object { | |||
"cpu_limit_per_host": undefined, |
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.
We should add these fields to the SettingsReducer tests so they appear in the snapshots here.
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.
You're right. Fixed.
</div> | ||
<InputGroup> | ||
<FormControl type="text" name={id} id={id} readOnly={!this.state.inputEnabled} {...input} /> | ||
<InputGroup.Addon>{postfix}</InputGroup.Addon> |
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 haven't had a chance yet to test this locally, but based on your screenshots it doesn't look like this postfix is rendering anymore?
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.
Yup, those labels are being rendered correctly (I forgot to update screenshots in the initial comment).
Those postfix labels do work, I just forgot to update the screenshots with the working version. Fixed now. |
c8c6166
to
16c1b4a
Compare
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.
Forgot to get back around to this... this looks good, just waiting to merge it until after ManageIQ/manageiq#18576 is merged.
This PR is associated with this BZ targeted for 5.10.4: https://bugzilla.redhat.com/show_bug.cgi?id=1690851 |
@mzazrivec sorry for the additional churn, but based on the call with @fdupont-redhat earlier today, it looks like CPU throttling will make it in for 5.10.4 but the network throttling will need to wait until 5.10.5. So... deja vu... can we comment out the network field and turn this PR into CPU throttling only, and then open another PR to re-enable the network field? |
This commit can be reverted later, once the backend support is in.
16c1b4a
to
929d236
Compare
Checked commits mzazrivec/miq_v2v_ui_plugin@a2d20cf~...929d236 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 |
@mturley Sure, I removed the network throttling in a separate commit, which can be later reverted (once backend support is in). |
Perfect, thanks @mzazrivec. I moved the network part of the issue to #940 so we can still close #911 here. |
@mzazrivec, last thing, I promise.... I was giving your changes a final review and I noticed we never right-aligned the field names for the Concurrent Migrations section like they are in the mockups. We should have those two field labels right-aligned, and the ones with the checkboxes left-aligned. If you could make that change I'll approve the PR, sorry I didn't notice sooner. |
@mturley Initially, I did try to implement it that way, but it did not look very good in my opinion: I can make the change, if you insist, but I'd rather keep it the way it looks right now, since mixing the label alignments produces a bit funny look & fell (in my opinion of course). |
I think I agree with you, but I'll let @vconzola make the final decision. |
Per our discussion in the v2v standup meeting, @mturley will try to make a simple change to the CSS class to use top aligned labels. But if it's too much, let's just leave them left aligned. |
@mzazrivec here's a commit that switches the form to a vertical layout: mturley@ef218c0 It looks like this. @vconzola does this look good to you? With validation error showing: |
Other than my few comments in Slack, LGTM. Ship it. |
Ok @mzazrivec I made a couple other tweaks to the commit based on feedback from Vince, here's the final version to cherry-pick: mturley@ef218c0 |
The backend PR this depended on is also now merged (ManageIQ/manageiq#18576). |
I'm going to go ahead and merge this one as-is so it can make the GA build, I'll open a separate PR to change the layout to vertical. |
…rottling_inputs [#911] Add validation to migration throttling inputs and add CPU throttling field (cherry picked from commit 03106c9) https://bugzilla.redhat.com/show_bug.cgi?id=1702085
Hammer backport details:
|
…ation_throttling_inputs" This reverts commit ea0aa27.
Reverted Hammer backport.
|
Initial screen

Validation error

Validation pass

Fixes: #911
Associated RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1690851