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
Fixes #24599 - Not custom instance type should disable params #5945
Conversation
Issues: #24599 |
$('[id$=_cores]').attr('disabled', 'disabled'); | ||
$('[id$=_sockets]').attr('disabled', 'disabled'); | ||
$('[id$=_ha]').attr('disabled', 'disabled'); | ||
} |
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.
Closing curly brace does not appear on the same line as the subsequent block brace-style
tnx @shiramax , |
Thanks @lizagilman |
I find the current default values for Template and Instance type fields a bit confusing. For Template field - "Select template" (current default) For Instance Type field- Basically "Select Template" and "Blank" has the same behavior - no auto updating of any other fields. I can think of three other options for default values. For Template -
For Instance type -
also should the field names and the option names, or some of them, be titlized? @Rohoover / @terezanovotna could you advise here? |
Hi @lizagilman, I am looking on the PF Multiple Select component, how about using "Nothing Selected" for both template and instance type? |
Hi @terezanovotna tnx for the reply Sounds good for the Template field |
@lizagilman, @terezanovotna |
Thanks for the explanation @shiramax that is helpful! If it is default and already has a name, could we name it: Default - Blank Would that make sense? The user knows it is default and if he/she wants select something different, he/she can. |
@lizagilman @terezanovotna , I'm not loving the prefix "Default-" |
@shiramax Do you think it is clear for the user that Blank and Custom are default? If so, it's fine to use it. I want to avoid the situation when the user starts wondering what Blank and Custom actually mean |
I agree with @shiramax We should mimic ovirt. Are these optional fields or required? Another option would be to make the fields required, keep "Select XX" but force a selection. "Select XX" should not be a clickable option. |
$('[id$=_memory]').attr('disabled', 'disabled'); | ||
$('[id$=_cores]').attr('disabled', 'disabled'); | ||
$('[id$=_sockets]').attr('disabled', 'disabled'); | ||
$('[id$=_ha]').attr('disabled', 'disabled'); |
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.
If you would like, you can do something like [ $('[id$=_memory]'), $('[id$=_cores]'), $('[id$=_sockets]'), $('[id$=_ha]') ].forEach( ()=> $(this).attr('disabled', 'disabled') })
[test foreman] |
$('[id$=_cores]').removeAttr('disabled'); | ||
$('[id$=_sockets]').removeAttr('disabled'); | ||
$('[id$=_ha]').removeAttr('disabled'); | ||
} |
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.
Please use .prop('disabled', <true or false>)
instead of attr
and removeAttr
. Building on @lizagilman's suggestion, you can do it all in one:
[ _'memory', '_cores', '_sockets', '_ha'].forEach((name)=>
$(`[id$=${name}]`).prop('disabled', (result.name != null)))
$('[id$=_sockets]').val(result.sockets); | ||
$('[id$=_ha]').prop('checked', result.ha); | ||
} | ||
[ '_memory', '_cores', '_sockets', '_ha'].forEach((name)=> $(`[id$=${name}]`).prop('readOnly', (result.name != null))) |
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 should be no space after '[' array-bracket-spacing
Unexpected parentheses around single function argument having a body with no curly braces arrow-parens
Missing space before => arrow-spacing
Missing semicolon semi
$('[id$=_memory]').val(result.memory).trigger('change'); | ||
$('[id$=_cores]').val(result.cores); | ||
$('[id$=_sockets]').val(result.sockets); | ||
$('[id$=_ha]').prop('checked', result.ha); |
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.
Expected indentation of 10 spaces but found 12 indent
if (result.name != null) { | ||
$('[id$=_memory]').val(result.memory).trigger('change'); | ||
$('[id$=_cores]').val(result.cores); | ||
$('[id$=_sockets]').val(result.sockets); |
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.
Expected indentation of 10 spaces but found 12 indent
$('[id$=_ha]').prop('checked', result.ha); | ||
if (result.name != null) { | ||
$('[id$=_memory]').val(result.memory).trigger('change'); | ||
$('[id$=_cores]').val(result.cores); |
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.
Expected indentation of 10 spaces but found 12 indent
$('[id$=_sockets]').val(result.sockets); | ||
$('[id$=_ha]').prop('checked', result.ha); | ||
if (result.name != null) { | ||
$('[id$=_memory]').val(result.memory).trigger('change'); |
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.
Expected indentation of 10 spaces but found 12 indent
const instanceTypeSelector = $('#host_compute_attributes_instance_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.
Trailing spaces not allowed no-trailing-spaces
8f3b324
to
449e2cd
Compare
@lizagilman, @tbrisker please review again :) |
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.
Thanks @shiramax and @lizagilman !
No description provided.